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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0a0f14;
    color: #f0f4f8;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a2a1a 0%, #0a0f14 70%);
}

#game {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow:
        0 0 60px rgba(0, 0, 0, 0.6),
        0 0 120px rgba(45, 138, 78, 0.15);
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    display: none;
}

.panel {
    background: rgba(20, 28, 38, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    text-align: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    max-width: 480px;
    width: 90%;
}

.panel-small {
    padding: 2rem 2.5rem;
}

.title {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mode-select {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(251, 191, 36, 0.4);
}

.mode-option input[type="radio"] {
    accent-color: #f59e0b;
    width: 18px;
    height: 18px;
}

.btn-primary {
    display: inline-block;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
    letter-spacing: 0.02em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(245, 158, 11, 0.5);
}

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

.controls-hint {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.control-col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.control-col strong {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.pause-hint {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

.btn-mute {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(20, 28, 38, 0.8);
    backdrop-filter: blur(8px);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn-mute:hover {
    transform: scale(1.08);
    background: rgba(30, 40, 52, 0.95);
}

.panel h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    color: #fbbf24;
}

.panel p {
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1.5rem;
}

#final-score {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
}

@media (max-width: 600px) {
    .panel {
        padding: 1.75rem 1.5rem;
    }

    .title {
        font-size: 1.8rem;
    }

    .controls-hint {
        flex-direction: column;
        gap: 1rem;
    }
}
