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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a1a;
    font-family: system-ui, -apple-system, sans-serif;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* ---------- HUD ---------- */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 8px;
    padding: 10px;
    pointer-events: none;
    z-index: 5;
    flex-wrap: wrap;
}

.hud-box {
    background: rgba(10, 25, 45, 0.65);
    border: 1px solid rgba(160, 220, 255, 0.35);
    border-radius: 10px;
    padding: 6px 12px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
}

.hud-label {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: #9fd0e8;
}

.hud-box span:last-child {
    font-size: 1.05rem;
    font-weight: 700;
}

#sound-toggle {
    pointer-events: auto;
    margin-left: auto;
    background: rgba(10, 25, 45, 0.65);
    border: 1px solid rgba(160, 220, 255, 0.35);
    border-radius: 10px;
    font-size: 1.2rem;
    padding: 6px 12px;
    cursor: pointer;
}

/* ---------- Speech bubble ---------- */
#bubble {
    position: absolute;
    z-index: 6;
    background: #fff;
    color: #333;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 16px;
    transform: translate(-50%, -100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

#bubble::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 9px solid #fff;
}

#bubble.show {
    opacity: 1;
}

/* ---------- Screens ---------- */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 18, 34, 0.78);
    z-index: 10;
}

.screen-content {
    text-align: center;
    color: #fff;
    background: rgba(14, 32, 56, 0.92);
    border: 1px solid rgba(160, 220, 255, 0.35);
    border-radius: 18px;
    padding: 2.2rem 2.6rem;
    max-width: 90vw;
}

.screen-content h1 {
    font-size: 2.4rem;
    margin-bottom: 0.6rem;
    background: linear-gradient(135deg, #7fd4ff, #ff9633);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.big-icon {
    font-size: 3rem;
    margin: 0.4rem 0 0.8rem;
}

.screen-content p {
    color: #cfe6f5;
    margin: 0.3rem 0;
    line-height: 1.45;
}

.controls-info {
    margin: 1.1rem 0;
    color: #9fc3da;
    font-size: 0.9rem;
}

kbd {
    background: #22405f;
    border: 1px solid #3b6b96;
    border-radius: 5px;
    padding: 2px 7px;
    font-family: inherit;
    font-size: 0.85em;
}

.lc-stats {
    margin: 0.8rem 0 1.2rem;
    font-size: 1.05rem;
}

.lc-stats span {
    font-weight: 700;
    color: #7fd4ff;
}

.lc-total {
    margin-top: 0.6rem !important;
    font-size: 1.2rem;
}

.lc-total span {
    color: #ffd24d;
}

button#start-btn,
button#next-btn {
    margin-top: 0.8rem;
    background: linear-gradient(135deg, #ff9633, #ff7a1a);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.75rem 2.4rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 140, 30, 0.4);
    transition: transform 0.12s ease;
}

button#start-btn:hover,
button#next-btn:hover {
    transform: scale(1.05);
}

@media (max-width: 600px) {
    .hud-box { min-width: 52px; padding: 4px 8px; }
    .hud-box span:last-child { font-size: 0.9rem; }
    .screen-content { padding: 1.5rem 1.2rem; }
    .screen-content h1 { font-size: 1.8rem; }
}
