/* ゲーム画面専用CSS */
#game-screen {
    flex-direction: column;
    background: linear-gradient(135deg, #11111b 0%, #1e1e2e 100%);
}

.game-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(30, 30, 46, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    z-index: 100;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
}

#score-display {
    color: #f9e2af;
}

#combo-display {
    color: #a6e3a1;
}

.game-area {
    position: relative;
    width: 800px;
    height: 600px;
    margin-top: 70px;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    z-index: 1;
}

.lanes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 0;
}

.lane {
    flex: 1;
    border-left: 2px solid rgba(166, 173, 200, 0.3);
    background: rgba(137, 180, 250, 0.05);
    position: relative;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.lane:last-child {
    border-right: 2px solid rgba(166, 173, 200, 0.3);
}

.lane.active {
    background: rgba(137, 180, 250, 0.2);
}

.lane.hit {
    background: rgba(166, 227, 161, 0.3);
    animation: laneHit 0.2s ease-out;
}

@keyframes laneHit {
    0% { background: rgba(166, 227, 161, 0.6); }
    100% { background: rgba(166, 227, 161, 0.1); }
}

.judgment-line {
    position: absolute;
    bottom: 100px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #f38ba8 0%, #fab387 50%, #f9e2af 100%);
    box-shadow: 0 0 20px rgba(243, 139, 168, 0.8);
    z-index: 2;
    animation: judgmentLinePulse 2s ease-in-out infinite;
}

@keyframes judgmentLinePulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(243, 139, 168, 0.8);
        transform: scaleY(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(243, 139, 168, 1);
        transform: scaleY(1.2);
    }
}

.lane-keys {
    position: absolute;
    bottom: 50px;
    left: 0;
    width: 100%;
    display: flex;
    z-index: 2;
}

.key-indicator {
    flex: 1;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #cdd6f4;
    background: rgba(69, 71, 90, 0.8);
    border: 2px solid #45475a;
    border-radius: 8px;
    padding: 10px;
    margin: 0 5px;
    transition: all 0.1s ease;
}

.key-indicator.pressed {
    background: rgba(137, 180, 250, 0.8);
    border-color: #89b4fa;
    color: #1e1e2e;
    transform: scale(0.95);
}

/* ノーツスタイル */
.note {
    position: absolute;
    width: calc(25% - 4px);
    height: 20px;
    background: linear-gradient(135deg, #cba6f7 0%, #f38ba8 100%);
    border: 2px solid #f2cdcd;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(203, 166, 247, 0.5);
    z-index: 1;
    animation: noteGlow 1s ease-in-out infinite alternate;
}

@keyframes noteGlow {
    0% { 
        box-shadow: 0 4px 15px rgba(203, 166, 247, 0.5);
    }
    100% { 
        box-shadow: 0 6px 25px rgba(203, 166, 247, 0.8);
    }
}

.note.lane-0 { left: 2px; }
.note.lane-1 { left: calc(25% + 2px); }
.note.lane-2 { left: calc(50% + 2px); }
.note.lane-3 { left: calc(75% + 2px); }

/* 判定表示 */
.judgment-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    font-weight: bold;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.judgment-display.show {
    opacity: 1;
    animation: judgmentShow 0.8s ease-out;
}

.judgment-display.perfect {
    color: #a6e3a1;
    text-shadow: 0 0 20px #a6e3a1;
}

.judgment-display.good {
    color: #f9e2af;
    text-shadow: 0 0 20px #f9e2af;
}

.judgment-display.miss {
    color: #f38ba8;
    text-shadow: 0 0 20px #f38ba8;
}

@keyframes judgmentShow {
    0% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* カウントダウン表示 */
.countdown-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8em;
    font-weight: bold;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    color: #f9e2af;
    text-shadow: 
        0 0 20px #f9e2af,
        0 0 40px #f9e2af,
        0 0 60px #f9e2af;
    transition: opacity 0.2s ease;
}

.countdown-display.show {
    opacity: 1;
    animation: countdownPulse 1s ease-in-out;
}

.countdown-display.ready {
    font-size: 6em;
    color: #a6e3a1;
    text-shadow: 
        0 0 20px #a6e3a1,
        0 0 40px #a6e3a1,
        0 0 60px #a6e3a1;
}

.countdown-display.go {
    font-size: 7em;
    color: #f38ba8;
    text-shadow: 
        0 0 20px #f38ba8,
        0 0 40px #f38ba8,
        0 0 60px #f38ba8;
}

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

/* エフェクト */
.hit-effect {
    position: absolute;
    bottom: 96px;
    width: calc(25% - 4px);
    height: 8px;
    background: radial-gradient(circle, rgba(166, 227, 161, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    animation: hitEffect 0.4s ease-out;
}

@keyframes hitEffect {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.hit-effect.lane-0 { left: 2px; }
.hit-effect.lane-1 { left: calc(25% + 2px); }
.hit-effect.lane-2 { left: calc(50% + 2px); }
.hit-effect.lane-3 { left: calc(75% + 2px); }

/* ゲームコントロール */
.game-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
    .game-area {
        width: 90vw;
        max-width: 500px;
        height: 70vh;
    }
    
    #game-canvas {
        width: 100%;
        height: 100%;
    }
    
    .key-indicator {
        font-size: 1.2em;
        padding: 8px;
    }
    
    .judgment-display {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 10px 15px;
    }
    
    .game-info {
        font-size: 1em;
    }
    
    .key-indicator {
        font-size: 1em;
        padding: 6px;
        margin: 0 2px;
    }
    
    .judgment-display {
        font-size: 2em;
    }
    
    .note {
        height: 15px;
        border-radius: 8px;
    }
}

/* タッチデバイス用の調整 */
@media (hover: none) and (pointer: coarse) {
    .lane {
        background: rgba(137, 180, 250, 0.08);
    }
    
    .key-indicator {
        background: rgba(69, 71, 90, 0.9);
        border-color: #585b70;
        padding: 15px 8px;
    }
}