﻿* { margin: 0; padding: 0; box-sizing: border-box; }
        body { overflow: hidden; background: #020502; font-family: 'Hiragino Sans', sans-serif; }
        canvas { display: block; }

        #overlay {
            position: absolute; inset: 0;
            background: linear-gradient(160deg, #0a1a0a 0%, #051205 100%);
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            z-index: 100; color: white; text-align: center;
        }
        .title {
            font-size: 5rem; font-weight: 900; color: #facc15;
            text-shadow: 0 0 60px rgba(250,204,21,0.6);
            letter-spacing: -2px; margin-bottom: 8px;
        }
        .subtitle { font-size: 1.2rem; color: #86efac; margin-bottom: 40px; font-weight: 600; }
        .keys-info {
            display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; justify-content: center;
        }
        .key-item {
            background: rgba(255,255,255,0.07); border: 2px solid rgba(255,255,255,0.15);
            border-radius: 12px; padding: 12px 20px; text-align: center; color: white;
        }
        .key-item span { font-size: 1.6rem; font-weight: 900; color: #facc15; display: block; }
        .btn-start {
            background: #facc15; color: #000; padding: 18px 80px;
            font-size: 1.8rem; font-weight: 900; border-radius: 60px; border: none;
            cursor: pointer; box-shadow: 0 8px 0 #b45309, 0 0 40px rgba(250,204,21,0.4);
            transition: all 0.1s; letter-spacing: 2px;
        }
        .btn-start:hover { transform: translateY(-2px); }
        .btn-start:active { transform: translateY(6px); box-shadow: 0 2px 0 #b45309; }

        #hud {
            position: absolute; top: 0; left: 0; right: 0;
            display: none; padding: 20px 30px; pointer-events: none;
        }
        #hud-inner { display: flex; justify-content: space-between; align-items: flex-start; }
        #timer-box {
            background: rgba(0,0,0,0.75); border: 3px solid #facc15;
            border-radius: 16px; padding: 10px 24px;
        }
        #timer { font-family: 'Courier New', monospace; font-size: 3rem; font-weight: 900; color: #facc15; }
        #status-box {
            background: rgba(0,0,0,0.75); border: 3px solid #6366f1;
            border-radius: 16px; padding: 10px 24px; text-align: right;
        }
        #status { color: #a5b4fc; font-size: 0.9rem; font-weight: 700; }
        #next-label { color: white; font-size: 1.4rem; font-weight: 900; }

        #obstacle-bar {
            position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
            display: none; pointer-events: none;
        }
        .obs-track {
            display: flex; gap: 10px; align-items: center;
            background: rgba(0,0,0,0.7); border: 2px solid rgba(255,255,255,0.15);
            border-radius: 50px; padding: 10px 24px;
        }
        .obs-dot {
            width: 18px; height: 18px; border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.1);
            transition: all 0.3s;
        }
        .obs-dot.cleared { background: #4ade80; border-color: #4ade80; box-shadow: 0 0 10px #4ade80; }
        .obs-dot.current { background: #facc15; border-color: #facc15; box-shadow: 0 0 10px #facc15; animation: pulse 0.8s ease-in-out infinite; }
        @keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.3); } }

        #msg-box {
            position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%);
            font-size: 5rem; font-weight: 900; color: #4ade80;
            text-shadow: 0 0 40px rgba(74,222,128,0.8);
            opacity: 0; pointer-events: none; z-index: 150; font-style: italic;
        }
        .show-msg { animation: msgFade 1.2s ease-out forwards; }
        @keyframes msgFade {
            0% { opacity:0; transform:translate(-50%,-60%) scale(0.5); }
            15% { opacity:1; transform:translate(-50%,-50%) scale(1.1); }
            30% { transform:translate(-50%,-50%) scale(1); }
            80% { opacity:1; }
            100% { opacity:0; }
        }
        #fail-msg {
            position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%);
            font-size: 2.8rem; font-weight: 900; color: #f87171;
            text-shadow: 0 0 30px rgba(248,113,113,0.8);
            opacity: 0; pointer-events: none; z-index: 150;
        }
        .show-fail { animation: failFade 1.5s ease-out forwards; }
        @keyframes failFade {
            0% { opacity:0; transform:translate(-50%,-50%) scale(1.3); }
            15% { opacity:1; transform:translate(-50%,-50%) scale(1); }
            80% { opacity:1; }
            100% { opacity:0; }
        }
        #clear-screen {
            position: absolute; inset: 0; background: rgba(0,0,0,0.85);
            display: none; flex-direction: column; justify-content: center; align-items: center;
            z-index: 200; color: white;
        }
        .victory-text {
            font-size: 7rem; font-weight: 900; color: #facc15;
            text-shadow: 0 0 60px rgba(250,204,21,1);
            animation: victoryPop 0.8s cubic-bezier(0.175,0.885,0.32,1.275);
        }
        @keyframes victoryPop { from { transform: scale(0) rotate(-10deg); } to { transform: scale(1); } }
#final-time { font-size: 2.5rem; font-weight: 700; margin-top: 16px; color: #86efac; }
#countdown {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 7rem;
    font-weight: 900;
    color: #facc15;
    text-shadow: 0 0 28px rgba(250, 204, 21, 0.9);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
}

#guide-panel {
    margin: 14px auto 0;
    width: 380px;
    background: rgba(0, 0, 0, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 10px 14px 12px;
    text-align: center;
}
#guide-title {
    color: #facc15;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
#guide-meter {
    position: relative;
    height: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}
#guide-center-band {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 90px;
    transform: translateX(-50%);
    background: rgba(74, 222, 128, 0.25);
}
#guide-needle {
    position: absolute;
    left: 50%;
    top: 2px;
    width: 20px;
    height: 16px;
    transform: translateX(-50%);
    border-radius: 8px;
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    transition: left 0.08s ease, background 0.12s ease, box-shadow 0.12s ease;
}
#guide-text {
    margin-top: 8px;
    color: #fca5a5;
    font-size: 0.9rem;
    font-weight: 800;
}
