:root {
    --navy: #10172a;
    --purple: #6d28d9;
    --pink: #ec4899;
    --orange: #fb923c;
    --yellow: #facc15;
    --cyan: #22d3ee;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: white;
    background:
        radial-gradient(circle at 20% 15%, rgba(250, 204, 21, 0.42), transparent 15%),
        radial-gradient(circle at 82% 28%, rgba(236, 72, 153, 0.45), transparent 20%),
        linear-gradient(135deg, #0f172a 0%, #581c87 42%, #fb7185 70%, #f97316 100%);
}

.app {
    width: min(1180px, 94%);
    margin: 0 auto;
    padding: 28px 0 34px;
}

.menu {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 24px;
    margin-bottom: 22px;
}

.title-block,
.card,
.game-shell,
.panel {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.74);
    backdrop-filter: blur(16px);
    border-radius: 32px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.34);
}

.title-block {
    position: relative;
    overflow: hidden;
    min-height: 330px;
    padding: 34px;
}

.title-block::before {
    content: "";
    position: absolute;
    right: -80px;
    top: -100px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, #facc15, #fb923c 45%, transparent 68%);
    border-radius: 50%;
    filter: blur(3px);
}

.title-block::after {
    content: "";
    position: absolute;
    left: -20%;
    bottom: -75px;
    width: 140%;
    height: 160px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.95), rgba(8, 145, 178, 0.95) 60%, transparent 61%);
    border-radius: 50% 50% 0 0;
}

.tag {
    position: relative;
    z-index: 2;
    display: inline-block;
    margin: 0 0 16px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--pink));
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 12px;
}

h1 {
    position: relative;
    z-index: 2;
    margin: 0;
    font-size: clamp(54px, 8vw, 110px);
    line-height: 0.82;
    letter-spacing: -4px;
    text-transform: uppercase;
    text-shadow: 0 8px 0 rgba(0, 0, 0, 0.24);
}

.intro {
    position: relative;
    z-index: 2;
    max-width: 650px;
    margin: 20px 0 0;
    color: #ffe4e6;
    font-size: 18px;
    line-height: 1.5;
}

.card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card h2,
.panel h2 {
    margin: 0 0 12px;
    font-size: 30px;
}

.card p,
.panel p {
    color: #e0f2fe;
    line-height: 1.55;
}

.buttons {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

button {
    border: none;
    border-radius: 18px;
    padding: 14px 22px;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: var(--navy);
    font-weight: 1000;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

button:hover {
    transform: translateY(-2px) scale(1.02);
}

.ghost {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.music-btn {
    background: linear-gradient(135deg, #22d3ee, #a855f7);
    color: white;
}

.keys {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: #fce7f3;
    align-items: center;
}

.keys span {
    padding: 7px 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.17);
    font-weight: 900;
}

.game-shell {
    padding: 18px;
}

.hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.hud div {
    background: rgba(2, 6, 23, 0.62);
    border-radius: 18px;
    padding: 12px;
    text-align: center;
}

.hud small {
    display: block;
    color: #fbcfe8;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 12px;
    margin-bottom: 3px;
}

.hud strong {
    color: var(--yellow);
    font-size: 26px;
}

canvas {
    width: 100%;
    display: block;
    border-radius: 26px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    background: #0891b2;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 22px;
    background: rgba(2, 6, 23, 0.72);
}

.panel {
    position: relative;
    width: min(640px, 96%);
    padding: 30px;
    color: white;
}

.close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
}

.quiz-label {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--navy) !important;
    font-weight: 1000;
    text-transform: uppercase;
    font-size: 12px;
}

#quizAnswers {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

#quizAnswers button {
    text-align: left;
    color: white;
    background: linear-gradient(135deg, #0ea5e9, #7c3aed);
}

#quizAnswers button.correct {
    background: #16a34a;
}

#quizAnswers button.wrong {
    background: #dc2626;
}

#quizFeedback {
    min-height: 26px;
    font-weight: 900;
}

.hidden {
    display: none;
}

@media (max-width: 850px) {
    .menu,
    .hud {
        grid-template-columns: 1fr;
    }

    button {
        width: 100%;
    }
}
