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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #e0e0e0;
    font-family: 'Share Tech Mono', monospace;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.screen.hidden {
    display: none;
}

.timer {
    font-size: 20vw;
    letter-spacing: 0.02em;
}

#score {
    font-size: 8vw;
    margin-top: 2vh;
    color: #888;
}

#instruction {
    position: absolute;
    bottom: 5vh;
    font-size: 3vw;
    color: #555;
}

.arcade-button {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    background: transparent;
    color: #e0e0e0;
    border: 2px solid #e0e0e0;
    padding: 1.5vh 3vw;
    margin-top: 2vh;
    cursor: pointer;
    transition: all 0.1s ease;
}

.arcade-button:hover {
    background: #e0e0e0;
    color: #000;
}

.arcade-button:active {
    transform: scale(0.95);
}

.arcade-button:disabled {
    color: #555;
    border-color: #555;
    cursor: not-allowed;
}

.arcade-button:disabled:hover {
    background: transparent;
    color: #555;
}

/* Game Over Screen */
#final-score-label {
    font-size: 2vw;
    color: #555;
}

#final-score {
    font-size: 10vw;
}

#final-taps-label {
    font-size: 2vw;
    color: #555;
    margin-top: 2vh;
}

#final-taps {
    font-size: 6vw;
    color: #888;
}

#tier-breakdown {
    font-size: 1.8vw;
    color: #888;
    margin-top: 1vh;
    text-align: center;
    line-height: 1.4;
}

#initials-input {
    display: flex;
    gap: 3vw;
    margin-top: 3vh;
}

.initial-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1vh;
}

.arrow-btn {
    font-size: 4vw;
    background: transparent;
    color: #555;
    border: none;
    cursor: pointer;
    padding: 0.5vh 1vw;
    transition: color 0.1s ease;
}

.arrow-btn:hover {
    color: #e0e0e0;
}

.arrow-btn:active {
    transform: scale(0.9);
}

.initial-slot {
    font-size: 6vw;
    width: 8vw;
    height: 8vw;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #555;
}

/* Leaderboard Screen */
#leaderboard-title {
    font-size: 6vw;
    margin-bottom: 3vh;
}

#leaderboard-list {
    font-size: 3vw;
    width: 80%;
    max-width: 500px;
    max-height: 50vh;
    overflow-y: auto;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    padding: 1vh 0;
    border-bottom: 1px solid #333;
}

.leaderboard-rank {
    width: 10%;
    color: #555;
}

.leaderboard-initials {
    width: 20%;
}

.leaderboard-device {
    width: 10%;
    font-size: 2.5vw;
}

.leaderboard-points {
    width: 25%;
    text-align: right;
}

.leaderboard-perfects {
    width: 15%;
    text-align: right;
    color: #0f0;
}

.leaderboard-greats {
    width: 15%;
    text-align: right;
    color: #0ff;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .timer {
        font-size: 25vw;
    }

    .arcade-button {
        font-size: 8vw;
        padding: 2.5vh 8vw;
    }

    #instruction {
        font-size: 4vw;
    }

    .initial-slot {
        font-size: 12vw;
        width: 16vw;
        height: 18vw;
    }

    #initials-instruction {
        font-size: 3.5vw;
    }

    #leaderboard-list {
        font-size: 4vw;
    }

    .leaderboard-device {
        font-size: 3.5vw;
    }
}

/* Lock layout on orientation change */
@media (orientation: landscape) and (max-height: 500px) {
    #game-container {
        height: 100vh;
        overflow: hidden;
    }
    
    .timer {
        font-size: 15vh;
    }
    
    #score {
        font-size: 8vh;
    }
    
    .arcade-button {
        font-size: 5vh;
        padding: 1.5vh 4vw;
    }
    
    #tier-breakdown {
        font-size: 2.5vh;
        line-height: 1.2;
    }
    
    .initial-column {
        gap: 0.5vh;
    }
    
    .arrow-btn {
        font-size: 4vh;
    }
    
    .initial-slot {
        font-size: 6vh;
        width: 10vh;
        height: 8vh;
    }
}

/* Instructions Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.popup.hidden {
    display: none;
}

.popup-content {
    text-align: center;
    padding: 4vh 4vw;
    max-width: 500px;
    background: #111;
    border: 2px solid #333;
}

@media (max-width: 600px) {
    .popup-content {
        max-width: 100%;
        border: none;
        background: transparent;
    }
}

.popup-content h1 {
    font-size: 3rem;
    margin-bottom: 3vh;
    color: #e0e0e0;
}

.popup-content p {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 2vh;
    line-height: 1.4;
}

.popup-content .tier-hint {
    margin-top: 3vh;
    color: #888;
}

.popup-content .tier-examples {
    font-size: 1rem;
    color: #e0e0e0;
    letter-spacing: 0.1em;
}

@media (max-width: 600px) {
    .popup-content h1 {
        font-size: 12vw;
    }
    
    .popup-content p {
        font-size: 5vw;
    }
    
    .popup-content .tier-examples {
        font-size: 4vw;
    }
}

/* Disabled button state */
.arcade-button:disabled {
    color: #555;
    border-color: #555;
    cursor: not-allowed;
}

.arcade-button:disabled:hover {
    background: transparent;
    color: #555;
}

/* Game Over Screen */
#gameover-screen {
    padding: 2vh 4vw;
    justify-content: center;
}

.score-taps-row {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4vw;
    margin-bottom: 2vh;
}

.score-box, .taps-box {
    text-align: center;
}

.score-box label, .taps-box label {
    font-size: 1.2rem;
    color: #555;
    display: block;
    margin-bottom: 0.5vh;
}

.score-box .value, .taps-box .value {
    font-size: 3rem;
    color: #e0e0e0;
}

#tier-breakdown {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 2vh;
    text-align: center;
    line-height: 1.5;
}

#initials-submit-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3vw;
}

#initials-input {
    display: flex;
    gap: 1vw;
}

.initial-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5vh;
}

.arrow-btn {
    font-size: 1.5rem;
    background: transparent;
    color: #555;
    border: none;
    cursor: pointer;
    padding: 0.5vh 1vw;
    transition: color 0.1s ease;
}

.arrow-btn:hover {
    color: #e0e0e0;
}

.arrow-btn:active {
    transform: scale(0.9);
}

.initial-slot {
    font-size: 2.5rem;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #555;
}

/* Mobile Game Over */
@media (max-width: 600px) {
    #gameover-screen {
        padding: 3vh 5vw;
    }

    .score-taps-row {
        gap: 10vw;
        margin-bottom: 3vh;
    }

    .score-box label, .taps-box label {
        font-size: 4vw;
    }

    .score-box .value, .taps-box .value {
        font-size: 12vw;
    }

    #tier-breakdown {
        font-size: 4vw;
        line-height: 1.8;
        margin-bottom: 3vh;
    }

    #tier-breakdown .points-math {
        display: none;
    }

    #initials-submit-row {
        flex-direction: column;
        gap: 3vh;
    }

    #initials-input {
        gap: 5vw;
    }

    .initial-slot {
        font-size: 10vw;
        width: 15vw;
        height: 15vw;
    }

    .arrow-btn {
        font-size: 6vw;
    }

    .arcade-button {
        font-size: 6vw;
        padding: 2vh 8vw;
    }
}

/* Personal best message */
#personal-best-message {
    font-size: 1rem;
    color: #0f0;
    margin-bottom: 2vh;
    text-align: center;
}

#personal-best-message.hidden {
    display: none;
}

@media (max-width: 600px) {
    #personal-best-message {
        font-size: 4vw;
    }
}