@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #020617;
    --bg-secondary: #0b1224;
    --accent: #6ee7ff;
    --accent-strong: #22d3ee;
    --accent-warm: #f472b6;
    --text: #f8fafc;
    --text-muted: rgba(248, 250, 252, 0.7);
    --surface: rgba(15, 23, 42, 0.7);
    --surface-strong: rgba(30, 41, 59, 0.85);
    --glow: 0 20px 55px rgba(34, 211, 238, 0.25);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --transition: all 0.28s ease;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 10% 0%, rgba(110, 231, 255, 0.18), transparent 42%), radial-gradient(circle at 90% 8%, rgba(244, 114, 182, 0.2), transparent 50%), linear-gradient(180deg, var(--bg) 0%, var(--bg-secondary) 60%, #000512 100%);
    background-attachment: fixed;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem clamp(1.5rem, 5vw, 3.5rem);
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.logo {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.logo span {
    color: var(--accent-strong);
}

.tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.chip {
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(14, 23, 42, 0.6);
    color: var(--text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover,
.chip:focus-visible {
    border-color: var(--accent-strong);
    color: var(--accent-strong);
    box-shadow: var(--glow);
}

.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 4vw, 4rem) clamp(1.5rem, 5vw, 3.5rem) 4rem;
    display: grid;
    gap: clamp(2.5rem, 5vw, 4rem);
}

.intro {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: stretch;
}

.intro-copy h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    letter-spacing: 0.04em;
}

.intro-copy p {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.features li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--text-muted);
}

.features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    box-shadow: 0 0 10px rgba(110, 231, 255, 0.8);
}

.score-panel {
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: var(--radius-xl);
    background: var(--surface-strong);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: var(--glow);
    display: grid;
    gap: 1.2rem;
    align-content: start;
}

.score {
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.score span {
    font-size: 1.8rem;
    color: var(--accent);
}

.status {
    min-height: 2.2rem;
    font-weight: 600;
    color: var(--accent-warm);
}

.powerup-display {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.game-wrapper {
    position: relative;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(2, 6, 23, 0.92) 70%, rgba(2, 6, 23, 1) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: clamp(1rem, 2.5vw, 1.5rem);
    box-shadow: var(--glow);
}

#gameCanvas {
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
    background: #0b1224;
}

.overlay {
    position: absolute;
    inset: clamp(1rem, 2.5vw, 1.5rem);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1rem;
    color: rgba(248, 250, 252, 0.85);
    pointer-events: none;
}

.touch-controls {
    margin-top: clamp(1rem, 2vw, 1.5rem);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.touch-controls button {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.85rem 2.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.7);
    color: var(--text);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
}

.touch-controls button:hover,
.touch-controls button:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--glow);
}

.guide {
    padding: clamp(2rem, 4vw, 3rem);
    border-radius: var(--radius-xl);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.12);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.55);
}

.guide h2 {
    margin: 0 0 1.5rem;
    font-size: 1.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guide-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-grid article {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.16);
    transition: var(--transition);
}

.guide-grid article:hover {
    border-color: var(--accent-strong);
    box-shadow: var(--glow);
}

.guide-grid h3 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
}

.guide-grid p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.site-footer {
    padding: 2.5rem clamp(1.5rem, 5vw, 3rem) 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .site-header {
        grid-template-columns: minmax(0, 1fr);
        text-align: center;
    }

    .header-actions {
        justify-content: center;
    }

    .intro {
        grid-template-columns: 1fr;
    }

    .guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .site-header {
        gap: 1rem;
    }

    .intro-copy h1 {
        font-size: clamp(2rem, 8vw, 2.6rem);
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }

    .touch-controls {
        flex-direction: column;
    }

    .touch-controls button {
        width: 100%;
    }
}
