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

body {
    font-family: 'Share Tech Mono', monospace;
    background: #1a1a2e;
    color: #ccccdd;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    user-select: none;
    -webkit-user-select: none;
}

#game-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ── Dial Container ── */

#dial-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dial-canvas {
    display: block;
}

/* ── Touch Area ── */

#touch-area {
    position: fixed;
    inset: 0;
    z-index: 5;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#touch-area.disabled {
    pointer-events: none;
}

/* ── Screens (overlays) ── */

.screen {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.screen.active {
    display: flex;
}

.screen-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

/* ── Menu Screen ── */

.game-title {
    font-size: 4rem;
    line-height: 1;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.menu-subtitle {
    font-size: 1rem;
    color: #888;
    letter-spacing: 0.3em;
    margin-bottom: 1.5rem;
}

.menu-highscore {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 2rem;
}

.menu-highscore span {
    color: #ffd700;
}

/* ── Buttons ── */

.btn {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0.6rem auto;
    padding: 0.8rem 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    border: 2px solid #555;
    border-radius: 6px;
    background: rgba(40, 40, 60, 0.8);
    color: #ccccdd;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.05em;
}

.btn:hover {
    border-color: #888;
    background: rgba(60, 60, 80, 0.9);
}

.btn:active {
    transform: scale(0.97);
}

.btn.primary {
    border-color: #ffd700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.btn.primary:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.btn i {
    margin-right: 0.4rem;
}

/* ── How To Play ── */

.howto-steps {
    text-align: left;
    margin: 1.5rem 0 2rem;
    line-height: 2.2;
}

.howto-steps p {
    font-size: 0.95rem;
}

.howto-steps i {
    width: 24px;
    text-align: center;
    color: #ffd700;
    margin-right: 0.5rem;
}

.howto-steps kbd {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    border: 1px solid #666;
    border-radius: 3px;
    background: rgba(60, 60, 80, 0.8);
    color: #ffd700;
}

/* ── HUD ── */

#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    pointer-events: none;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 0.65rem;
    color: #666;
    letter-spacing: 0.15em;
}

.hud-value {
    font-size: 1.3rem;
    color: #fff;
}

.hud-streak {
    text-align: center;
    font-size: 0.85rem;
    color: #ffd700;
    animation: pulse 0.8s ease-in-out infinite;
}

/* ── Rating Popup ── */

.rating-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9;
    font-size: 2.5rem;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    transition: none;
}

.rating-popup.show {
    animation: ratingPop 0.8s ease-out forwards;
}

@keyframes ratingPop {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    40% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(1);
    }
}

/* ── Round Result ── */

.tally {
    margin: 1.2rem 0;
    text-align: left;
}

.tally-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tally-target {
    color: #888;
}

.tally-rating {
    font-weight: bold;
}

.tally-points {
    color: #fff;
}

.result-total {
    font-size: 1.2rem;
    color: #ffd700;
    margin: 1rem 0 1.5rem;
    padding-top: 0.5rem;
    border-top: 2px solid rgba(255, 215, 0, 0.3);
}

/* ── Game Over ── */

.final-stats {
    margin: 1.5rem 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    color: #888;
}

.stat-value {
    color: #fff;
    font-size: 1.1rem;
}

.new-highscore {
    font-size: 1.3rem;
    color: #ffd700;
    margin: 1rem 0;
    animation: pulse 0.6s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ── Responsive ── */

@media (max-width: 480px) {
    .game-title {
        font-size: 3rem;
    }

    .hud-top {
        padding: 0.5rem 0.8rem;
    }

    .hud-value {
        font-size: 1.1rem;
    }

    .hud-combo {
        font-size: 1.2rem;
    }

    .rating-popup {
        font-size: 2rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-height: 500px) {
    .game-title {
        font-size: 2.5rem;
        margin-bottom: 0.3rem;
    }

    .menu-subtitle {
        margin-bottom: 0.8rem;
    }

    .menu-highscore {
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        margin: 0.4rem auto;
    }
}
