/* CSS Variables */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --accent-gold: #ffd700;
    --accent-cyan: #00d4ff;
    --accent-purple: #a855f7;
    --accent-pink: #ff6b9d;
    --accent-green: #22c55e;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);

    /* Rhythm game specific */
    --bg-lane: #12121a;
    --border: #1a1a2a;
    --text-dim: #3a3a4a;
    --neon-cyan: #00ffff;
    --neon-magenta: #ff00ff;
    --neon-yellow: #ffff00;
    --neon-green: #00ff88;
    --perfect: #00ffff;
    --great: #00ff88;
    --good: #ffff00;
    --miss: #ff4444;
    --combo: #ff00ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Background effects */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.bg-orb:nth-child(1) {
    width: 400px;
    height: 400px;
    background: var(--neon-magenta);
    top: -100px;
    left: -100px;
}

.bg-orb:nth-child(2) {
    width: 300px;
    height: 300px;
    background: var(--neon-cyan);
    bottom: -50px;
    right: -50px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 12px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 5px;
}

.back-btn {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

header h1 {
    font-family: 'Fira Code', 'Black Han Sans', monospace;
    font-size: 1.6rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px var(--neon-cyan);
}

header h1::before {
    content: '> ';
    color: var(--neon-green);
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Game Container */
.game-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Score Header */
.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.score-display {
    display: flex;
    gap: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

.score-item {
    display: flex;
    gap: 6px;
}

.score-label {
    color: var(--text-dim);
}

.score-value {
    color: var(--neon-yellow);
    text-shadow: 0 0 5px var(--neon-yellow);
    min-width: 50px;
}

/* Song List */
.song-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.song-list.hidden {
    display: none;
}

.song-list-header {
    padding: 10px 14px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--neon-cyan);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.song-items {
    max-height: 200px;
    overflow-y: auto;
}

.song-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.song-item:last-child {
    border-bottom: none;
}

.song-item:hover {
    background: rgba(0, 255, 255, 0.1);
}

.song-item:active {
    background: rgba(0, 255, 255, 0.2);
}

.song-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.song-title {
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
}

.song-artist {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.song-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.song-bpm {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--neon-magenta);
}

.song-best {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--neon-yellow);
}

.no-songs-message {
    padding: 30px 14px;
    text-align: center;
    color: var(--text-dim);
}

.no-songs-message p {
    margin-bottom: 8px;
}

.no-songs-message .hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    opacity: 0.7;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: width 0.1s linear;
}

/* Game Area */
.game-area {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.game-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 10;
}

/* Lanes */
.lanes {
    display: flex;
    height: 100%;
    position: relative;
}

.lane {
    flex: 1;
    border-right: 1px solid var(--border);
    position: relative;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.02) 80%,
        rgba(255, 255, 255, 0.05) 100%
    );
}

.lane:last-child {
    border-right: none;
}

.lane.active {
    background: linear-gradient(180deg,
        rgba(0, 255, 255, 0.05) 0%,
        rgba(0, 255, 255, 0.1) 80%,
        rgba(0, 255, 255, 0.2) 100%
    );
}

.lane-label {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Judgment line */
.judgment-line {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
    z-index: 5;
}

.judgment-line::before,
.judgment-line::after {
    content: '>';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Fira Code', monospace;
    color: var(--neon-cyan);
    font-size: 0.8rem;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.judgment-line::before { left: 4px; }
.judgment-line::after { right: 4px; content: '<'; }

/* Hit zones */
.hit-zones {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    z-index: 2;
}

.hit-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fira Code', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--bg-lane);
    transition: all 0.1s ease;
}

.hit-zone:last-child {
    border-right: none;
}

.hit-zone.pressed {
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
    background: rgba(0, 255, 255, 0.1);
}

/* Notes */
.note {
    position: absolute;
    width: 80%;
    left: 10%;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 4px;
    transition: opacity 0.1s ease;
    z-index: 3;
}

.note.lane-0 { color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan); }
.note.lane-1 { color: var(--neon-magenta); text-shadow: 0 0 10px var(--neon-magenta); }
.note.lane-2 { color: var(--neon-yellow); text-shadow: 0 0 10px var(--neon-yellow); }
.note.lane-3 { color: var(--neon-green); text-shadow: 0 0 10px var(--neon-green); }

.note.hit {
    animation: noteHit 0.2s ease-out forwards;
}

@keyframes noteHit {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Perfect Hit - 더 크게 커지면서 사라지는 효과 */
.note.perfect-hit {
    animation: notePerfectHit 0.35s ease-out forwards;
}

@keyframes notePerfectHit {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
    30% {
        transform: scale(1.6);
        opacity: 1;
        filter: brightness(1.5);
    }
    60% {
        transform: scale(1.8);
        opacity: 0.8;
        filter: brightness(2);
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
        filter: brightness(2.5);
    }
}

/* Great Hit - 중간 크기 */
.note.great-hit {
    animation: noteGreatHit 0.25s ease-out forwards;
}

@keyframes noteGreatHit {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    40% {
        transform: scale(1.4);
        opacity: 1;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Long Note (Hold) Styles */
.note.hold {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
    overflow: visible;
}

.note.hold .note-head {
    position: relative;
    z-index: 3;
    font-weight: 700;
}

.note.hold .note-tail {
    width: 60%;
    background: linear-gradient(180deg,
        currentColor 0%,
        rgba(255, 255, 255, 0.3) 100%
    );
    opacity: 0.6;
    border-radius: 0 0 4px 4px;
    position: relative;
    margin-top: -2px;
}

.note.hold .note-end {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: -2px;
}

/* Hold note lane colors for tail */
.note.hold.lane-0 .note-tail {
    background: linear-gradient(180deg, var(--neon-cyan) 0%, rgba(0, 255, 255, 0.2) 100%);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.note.hold.lane-1 .note-tail {
    background: linear-gradient(180deg, var(--neon-magenta) 0%, rgba(255, 0, 255, 0.2) 100%);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.note.hold.lane-2 .note-tail {
    background: linear-gradient(180deg, var(--neon-yellow) 0%, rgba(255, 255, 0, 0.2) 100%);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.note.hold.lane-3 .note-tail {
    background: linear-gradient(180deg, var(--neon-green) 0%, rgba(0, 255, 136, 0.2) 100%);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Holding state - pulse animation */
.note.hold.holding {
    animation: holdPulse 0.3s ease-in-out infinite alternate;
}

.note.hold.holding .note-head {
    transform: scale(1.2);
}

.note.hold.holding .note-tail {
    opacity: 0.9;
}

@keyframes holdPulse {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.5);
        text-shadow: 0 0 20px currentColor;
    }
}

/* Hold note hit animation */
.note.hold.hit {
    animation: holdComplete 0.3s ease-out forwards;
}

@keyframes holdComplete {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Judgment feedback */
.judgment-feedback {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    opacity: 0;
    z-index: 20;
    pointer-events: none;
}

.judgment-feedback.show {
    animation: judgmentPop 0.5s ease-out forwards;
}

.judgment-feedback.perfect { color: var(--perfect); text-shadow: 0 0 20px var(--perfect); }
.judgment-feedback.great { color: var(--great); text-shadow: 0 0 20px var(--great); }
.judgment-feedback.good { color: var(--good); text-shadow: 0 0 20px var(--good); }
.judgment-feedback.miss { color: var(--miss); text-shadow: 0 0 20px var(--miss); }

@keyframes judgmentPop {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(0.5); }
    20% { transform: translateX(-50%) translateY(-10px) scale(1.2); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(1); }
}

/* Combo display */
.combo-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.combo-display.show {
    opacity: 1;
}

.combo-count {
    font-family: 'Fira Code', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: var(--combo);
    text-shadow: 0 0 30px var(--combo);
    line-height: 1;
}

.combo-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 4px;
}

/* Controls info */
.controls-info {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--text-dim);
}

.control-item {
    display: flex;
    gap: 4px;
    align-items: center;
}

.key-hint {
    padding: 2px 6px;
    background: var(--bg-lane);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--neon-cyan);
}

/* Start overlay */
.start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 26, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.start-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.start-text {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 20px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.start-btn {
    padding: 14px 36px;
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bg-primary);
    background: var(--neon-cyan);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 20px var(--neon-cyan);
    min-height: 50px;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--neon-cyan);
}

.start-btn.secondary {
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    box-shadow: none;
}

.start-btn.secondary:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* Difficulty Modal */
.difficulty-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 26, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.difficulty-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    text-align: center;
    padding: 20px;
    position: relative;
}

.modal-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px var(--neon-cyan);
    margin-bottom: 4px;
}

.modal-artist {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.modal-info {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--neon-magenta);
    margin-bottom: 20px;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.diff-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 50px;
}

.diff-btn.easy {
    background: rgba(0, 255, 136, 0.1);
    color: var(--neon-green);
}

.diff-btn.easy:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.diff-btn.normal {
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan);
}

.diff-btn.normal:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.diff-btn.hard {
    background: rgba(255, 0, 255, 0.1);
    color: var(--neon-magenta);
}

.diff-btn.hard:hover {
    background: rgba(255, 0, 255, 0.2);
    border-color: var(--neon-magenta);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.diff-btn.expert {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
}

.diff-btn.expert:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
}

.diff-name {
    font-weight: 700;
}

.diff-best {
    font-size: 0.75rem;
    opacity: 0.8;
}

.modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    background: var(--bg-secondary);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}

/* Result overlay */
.result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 26, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    padding: 20px;
    overflow-y: auto;
}

.result-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.result-title {
    font-family: 'Fira Code', monospace;
    font-size: 1.3rem;
    color: var(--neon-magenta);
    text-shadow: 0 0 20px var(--neon-magenta);
    margin-bottom: 10px;
}

.result-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Fira Code', monospace;
}

.result-item {
    font-size: 0.8rem;
}

.result-item span {
    color: var(--neon-yellow);
}

.result-grade {
    font-family: 'Fira Code', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.grade-s { color: var(--perfect); text-shadow: 0 0 30px var(--perfect); }
.grade-a { color: var(--great); text-shadow: 0 0 30px var(--great); }
.grade-b { color: var(--good); text-shadow: 0 0 30px var(--good); }
.grade-c { color: var(--miss); text-shadow: 0 0 30px var(--miss); }

/* Best Ranking */
.best-ranking {
    width: 100%;
    max-width: 250px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.ranking-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--accent-gold);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
}

.ranking-item.new-record {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid var(--accent-gold);
    animation: newRecordPulse 1s ease-in-out infinite;
}

@keyframes newRecordPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
}

.ranking-item .rank {
    color: var(--text-dim);
    width: 30px;
}

.ranking-item .rank-score {
    flex: 1;
    text-align: center;
    color: var(--neon-yellow);
}

.ranking-item .rank-grade {
    width: 30px;
    text-align: right;
    font-weight: 700;
}

.ranking-empty {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.75rem;
    padding: 10px;
}

.result-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Mobile touch zones */
.touch-zones {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 30;
}

.touch-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-dim);
    border-right: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.5);
}

.touch-zone:last-child {
    border-right: none;
}

.touch-zone:active {
    background: rgba(0, 255, 255, 0.2);
    color: var(--neon-cyan);
}

/* Game Content Article */
.game-content {
    margin-top: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-content h2 {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.game-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.tip-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
}

.tip-box p {
    margin-bottom: 6px;
}

.tip-box p:last-child {
    margin-bottom: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 16px;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-gold);
}

/* Mobile */
@media (hover: none) and (pointer: coarse) {
    .touch-zones {
        display: flex;
    }

    .hit-zones {
        display: none;
    }

    .controls-info {
        display: none;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .back-btn span {
        display: none;
    }

    .back-btn {
        padding: 8px;
    }

    .game-area {
        height: 350px;
    }

    .song-items {
        max-height: 150px;
    }

    .result-grade {
        font-size: 2rem;
    }

    .result-title {
        font-size: 1.1rem;
    }

    .result-stats {
        gap: 4px;
    }

    .result-item {
        font-size: 0.75rem;
    }

    .best-ranking {
        max-width: 200px;
    }

    .result-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 200px;
    }

    .start-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Fullscreen mode */
body.fullscreen-active .controls-info {
    display: none !important;
}

body.fullscreen-active .game-container {
    display: grid !important;
    grid-template-columns: 520px 280px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
        "header   header"
        "progress songlist"
        "game     songlist";
    gap: 0 8px;
    width: 808px;
    max-width: 808px;
}

body.fullscreen-active .header-bar {
    grid-area: header;
}

body.fullscreen-active .progress-bar {
    grid-area: progress;
}

body.fullscreen-active .game-area {
    grid-area: game;
}

body.fullscreen-active .song-list {
    grid-area: songlist;
    display: block !important;
    overflow-y: auto;
    align-self: stretch;
}

body.fullscreen-active .song-list .song-items {
    max-height: none;
}

@media (max-width: 600px) {
    body.fullscreen-active .container {
        justify-content: flex-start !important;
    }
    body.fullscreen-active .game-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 !important;
        min-height: 0 !important;
        transform: none !important;
    }
    body.fullscreen-active .song-list {
        flex-shrink: 0;
    }
    body.fullscreen-active .song-list .song-items {
        max-height: 100px;
    }
    body.fullscreen-active .song-list.hidden {
        display: none !important;
    }
    body.fullscreen-active .game-area {
        flex: 1 !important;
        height: auto !important;
        min-height: 0 !important;
    }
    body.fullscreen-active .judgment-line {
        bottom: 40px;
    }
    body.fullscreen-active .hit-zones {
        height: 40px;
    }
    body.fullscreen-active .touch-zones {
        height: 80px;
    }
}
