@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

body {
    background-color: #1a1c1a; 
    color: #00ff66; 
    font-family: 'Share Tech Mono', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.terminal-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 480px;
}

/* THE RETRO BEIGE MONITOR FRAME */
.game-container {
    background: #d8d2c4; 
    border: 12px solid #b8b2a4; 
    border-top-width: 16px; 
    border-bottom-width: 36px; 
    border-radius: 24px; 
    padding: 15px; 
    box-shadow: 0 12px 0 #8c867a, 0 20px 25px rgba(0, 0, 0, 0.6); 
    width: 100%;
    height: 440px; 
    box-sizing: border-box;
    position: relative;
    display: flex;
}

/* MONITOR GLASS SCREEN CORE (PITCH BLACK) */
.rhythm-highway {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    background: #000000 !important; 
    border: 8px solid #2a2825; 
    border-radius: 12px; 
    overflow: hidden;
    padding: 15px; 
    box-sizing: border-box;
}

/* MENU LAYOUT SYSTEM */
.menu-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    text-align: center;
}

.menu-title {
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    text-shadow: 0 0 8px #00ff66;
    letter-spacing: 2px;
}

.menu-subtitle {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 25px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 80%;
}

/* LEVEL SELECT GRID */
.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 90%;
    margin-bottom: 25px;
}

/* MENU BUTTONS */
.menu-btn, .lvl-btn {
    background: transparent;
    color: #00ff66;
    border: 2px solid #00ff66;
    font-family: 'Share Tech Mono', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.menu-btn {
    padding: 12px;
    font-size: 1.1rem;
    letter-spacing: 1px;
    box-shadow: 0 0 5px rgba(0, 255, 102, 0.2);
}

.lvl-btn {
    padding: 15px 0;
    font-size: 1.2rem;
}

.menu-btn:hover, .lvl-btn:hover {
    background: #00ff66;
    color: #000;
    box-shadow: 0 0 15px #00ff66;
}

.secondary-btn {
    color: #888;
    border-color: #888;
}
.secondary-btn:hover {
    background: #888;
    color: #000;
    box-shadow: 0 0 15px #888;
}

/* HEADER STATS SCREEN COVERS */
.stats {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #00ff66;
    font-weight: bold;
    border-bottom: 1px dashed rgba(0, 255, 102, 0.3);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* FLOATING GREEN POP-UP BOX WINDOW */
.game-window-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    width: 100%;
    border: 2px solid #00ff66; 
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.2);
    background: rgba(0, 20, 5, 0.15); 
    position: relative;
    padding: 15px;
    box-sizing: border-box;
}

/* STATIC TARGET WORD DISPLAY */
#word-display {
    font-size: 2.5rem;
    margin: 0 0 15px 0;
    text-shadow: 0 0 10px #00ff66;
    letter-spacing: 2px;
    text-align: center;
    word-break: break-all;
}

/* INTEGRATED TYPING BOX */
input {
    background: rgba(0,0,0,0.5);
    border: none;
    border-bottom: 2px solid #00ff66;
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.4rem;
    padding: 8px;
    text-align: center;
    width: 85%;
    outline: none;
    border-radius: 2px;
}

/* FULL MECHANICAL KEYBOARD */
.keyboard {
    background: #2b2925; 
    border: 5px solid #1f1d1a;
    border-bottom-width: 10px; 
    padding: 8px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.key-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    width: 100%;
}

.key {
    background: #ebdcc5; 
    border: none;
    border-radius: 4px;
    color: #333; 
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 11px 0;
    flex: 1;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 3px 0 #b3a590;
    user-select: none;
    transition: all 0.05s ease;
}

.key:active, .key.pressed {
    transform: translateY(3px);
    box-shadow: 0 0px 0 #b3a590;
    background: #00ff66; 
    color: #000;
}

.space-bar { flex: 4; background: #1a1a1a; color: #fff;}
.backspace { flex: 1.5; color: #ff0055; }
.symbol { background: #d0c2ad; }

/* RE-TRY OVERLAY SCREEN */
.hidden { display: none !important; }

#game-over {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 0, 0, 0.95);
    border: 3px solid #ff0055;
    color: #ff0055;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    text-align: center;
}

#game-over h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.end-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#restart-btn {
    border-color: #ff0055;
    color: #ff0055;
    animation: pulse-border 1.5s infinite alternate;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 5px rgba(255, 0, 85, 0.4); }
    100% { box-shadow: 0 0 15px rgba(255, 0, 85, 1); }
}