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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Bangers', cursive;
    width: 100vw;
    height: 100vh;
}

/* Screens */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Start Screen */
#start-screen {
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
    flex-direction: column;
}

.start-content {
    text-align: center;
    padding: 40px;
}

.game-title {
    font-size: 72px;
    color: #ff6b35;
    text-shadow:
        3px 3px 0 #c44125,
        6px 6px 0 rgba(0,0,0,0.3),
        0 0 30px rgba(255, 107, 53, 0.5);
    letter-spacing: 4px;
    margin-bottom: 10px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.subtitle {
    font-size: 24px;
    color: #a8d8ea;
    margin-bottom: 40px;
    font-family: 'Bangers', cursive;
    letter-spacing: 2px;
}

.instructions {
    margin-bottom: 40px;
}

.instruction-item {
    font-size: 20px;
    color: #e8e8e8;
    margin: 12px 0;
    font-family: 'Bangers', cursive;
    letter-spacing: 1px;
}

.btn-start {
    font-family: 'Bangers', cursive;
    font-size: 36px;
    padding: 18px 60px;
    background: linear-gradient(180deg, #ff6b35 0%, #c44125 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 3px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    transition: all 0.2s;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
}

.btn-start:active {
    transform: translateY(0);
}

.camera-note {
    margin-top: 20px;
    color: #666;
    font-size: 14px;
    font-family: sans-serif;
}

/* Game Screen */
#game-screen {
    background: #000;
}

#webcam {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    opacity: 0;
    pointer-events: none;
}

#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 100;
    pointer-events: none;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.score-label, .best-label {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 2px;
}

.score-value, .best-value {
    font-size: 48px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
}

.best-value {
    font-size: 28px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.combo-display {
    font-size: 32px;
    color: #00ff88;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
    opacity: 0;
    transition: opacity 0.3s;
}

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

.lives-display {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.life {
    font-size: 28px;
    color: #ff4444;
    transition: all 0.3s;
}

.life.lost {
    opacity: 0.2;
    transform: scale(0.7);
}

.hud-right {
    align-items: flex-end;
}

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

.overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
    color: white;
    font-size: 24px;
}

.loading-sub {
    font-size: 16px;
    color: #888;
    margin-top: 10px;
    font-family: sans-serif;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #ff6b35;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Game Over Screen */
#gameover-screen {
    background: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    z-index: 300;
}

.gameover-content {
    text-align: center;
}

.gameover-title {
    font-size: 72px;
    color: #ff4444;
    text-shadow:
        3px 3px 0 #8b0000,
        0 0 30px rgba(255, 68, 68, 0.5);
    margin-bottom: 40px;
    animation: shakeIn 0.5s;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.final-score, .final-best {
    margin: 15px 0;
}

.final-label {
    display: block;
    font-size: 20px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 2px;
}

.final-value {
    font-size: 56px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
}

#final-best-value {
    font-size: 36px;
    color: #ffd700;
}

#gameover-screen .btn-start {
    margin-top: 40px;
}

/* Kiro IDE Screen */
#kiro-screen {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 40%, #1a1f2e 100%);
    z-index: 350;
    overflow-y: auto;
}

.kiro-content {
    max-width: 900px;
    width: 90%;
    padding: 40px 20px;
    animation: kiroFadeIn 0.8s ease-out;
}

@keyframes kiroFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.kiro-header {
    text-align: center;
    margin-bottom: 40px;
}

.kiro-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.kiro-icon {
    font-size: 48px;
    background: linear-gradient(135deg, #ff9900, #ff6600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kiro-title {
    font-family: 'Bangers', cursive;
    font-size: 42px;
    color: #ff9900;
    text-shadow: 0 0 20px rgba(255, 153, 0, 0.4);
    letter-spacing: 2px;
}

.kiro-subtitle {
    font-family: sans-serif;
    font-size: 18px;
    color: #8b949e;
    margin-top: 8px;
}

.kiro-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 35px;
}

.kiro-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: rgba(255, 153, 0, 0.05);
    border: 1px solid rgba(255, 153, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    animation: stepSlideIn 0.6s ease-out backwards;
}

.kiro-step:nth-child(1) { animation-delay: 0.2s; }
.kiro-step:nth-child(2) { animation-delay: 0.4s; }
.kiro-step:nth-child(3) { animation-delay: 0.6s; }
.kiro-step:nth-child(4) { animation-delay: 0.8s; }

@keyframes stepSlideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.kiro-step:hover {
    background: rgba(255, 153, 0, 0.1);
    border-color: rgba(255, 153, 0, 0.5);
    transform: translateX(5px);
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff9900, #ff6600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bangers', cursive;
    font-size: 22px;
    color: #fff;
    font-weight: bold;
}

.step-content h3 {
    font-family: 'Bangers', cursive;
    font-size: 22px;
    color: #e6edf3;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.step-content p {
    font-family: sans-serif;
    font-size: 14px;
    color: #8b949e;
    line-height: 1.5;
}

.kiro-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 35px;
    animation: kiroFadeIn 1s ease-out 1s backwards;
}

.tech-tag {
    font-family: monospace;
    font-size: 13px;
    padding: 6px 14px;
    background: rgba(56, 139, 253, 0.1);
    border: 1px solid rgba(56, 139, 253, 0.3);
    border-radius: 20px;
    color: #58a6ff;
}

.kiro-footer {
    text-align: center;
}

.kiro-cta {
    font-family: 'Bangers', cursive;
    font-size: 24px;
    color: #ff9900;
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 153, 0, 0.3);
}

#kiro-back-btn {
    background: linear-gradient(180deg, #ff9900 0%, #cc7a00 100%);
    box-shadow: 0 8px 25px rgba(255, 153, 0, 0.3);
}

#kiro-back-btn:hover {
    box-shadow: 0 12px 35px rgba(255, 153, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 42px;
    }
    .score-value {
        font-size: 36px;
    }
    .btn-start {
        font-size: 28px;
        padding: 14px 40px;
    }
}
