/* ============================================================
   PORTFOLIO — style.css
   PC + Mobile vollständig responsive
   ============================================================ */

/* ── RESET & VARIABLEN ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Farben Dark */
    --bg:        #080c14;
    --bg-2:      #0f1522;
    --surface:   rgba(255, 255, 255, 0.04);
    --card:      rgba(255, 255, 255, 0.05);
    --border:    rgba(0, 255, 255, 0.12);
    --accent:    #00e5ff;
    --accent-2:  #0077ff;
    --text:      #edf2ff;
    --muted:     #8a9bbb;

    /* Fonts */
    --font: 'Poppins', sans-serif;
}

/* ── LIGHT MODE VARIABLEN ── */
body.light {
    --bg:      #f0f4ff;
    --bg-2:    #e6edf8;
    --surface: rgba(255, 255, 255, 0.85);
    --card:    #ffffff;
    --border:  rgba(0, 119, 204, 0.18);
    --accent:  #0055cc;
    --accent-2:#0033aa;
    --text:    #0d1420;
    --muted:   #4a5a78;
}

/* ── BASE ── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Glow-Hintergrund (dark only) */
body:not(.light)::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 40% at 0% 0%, rgba(0,229,255,0.09) 0%, transparent 55%),
        radial-gradient(ellipse 50% 50% at 100% 100%, rgba(0,119,255,0.07) 0%, transparent 50%);
}

img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }

/* ── STERNE ── */
.stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 15% 20%, rgba(255,255,255,0.65), transparent),
        radial-gradient(1.5px 1.5px at 70% 12%, rgba(255,255,255,0.55), transparent),
        radial-gradient(1px 1px   at 45% 55%,  rgba(255,255,255,0.45), transparent),
        radial-gradient(1px 1px   at 88% 75%,  rgba(255,255,255,0.50), transparent),
        radial-gradient(1px 1px   at 30% 85%,  rgba(255,255,255,0.40), transparent),
        radial-gradient(1px 1px   at 60% 35%,  rgba(255,255,255,0.35), transparent);
    background-size: 350px 350px;
    opacity: 0.6;
}

body.light .stars { display: none; }

/* ── FADE ANIMATION ── */
.fade {
    animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 2rem;
    height: 64px;
    background: rgba(8, 12, 20, 0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

body.light .navbar {
    background: rgba(240, 244, 255, 0.88);
}

.navbar .logo {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    white-space: nowrap;
    text-shadow: 0 0 14px rgba(0,229,255,0.4);
    flex-shrink: 0;
}

body.light .navbar .logo {
    text-shadow: none;
}

/* ── DESKTOP NAV LINKS ── */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--muted);
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover { color: var(--accent); }

/* ── THEME + MENU BUTTON ── */
#themeToggle,
.menu-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

#themeToggle:hover,
.menu-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Hamburger standardmäßig versteckt auf Desktop */
.menu-btn { display: none; }

/* ============================================================
   SECTIONS – ALLGEMEIN
   ============================================================ */
section {
    position: relative;
    z-index: 1;
    padding: 110px 10% 80px;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 18px rgba(0,229,255,0.4);
    margin-bottom: 20px;
}

body.light h1 {
    text-shadow: none;
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(0,229,255,0.3);
    margin-bottom: 16px;
}

body.light h2 {
    text-shadow: none;
    color: var(--accent);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.75;
}

/* ============================================================
   CARDS – GEMEINSAM
   ============================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    backdrop-filter: blur(12px);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.12);
}

body.light .card {
    background: #fff;
    border: 1px solid rgba(0, 100, 200, 0.12);
    box-shadow: 0 2px 20px rgba(0,0,0,0.07);
}

body.light .card:hover {
    box-shadow: 0 8px 30px rgba(0,100,200,0.12);
    border-color: rgba(0, 100, 200, 0.3);
}

/* ── TAGS ── */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tags span {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent);
    font-size: 0.73rem;
    font-weight: 500;
    border: 1px solid rgba(0, 229, 255, 0.18);
}

body.light .tags span {
    background: rgba(0,85,204,0.08);
    color: var(--accent);
    border-color: rgba(0,85,204,0.15);
}

/* ── BUTTONS ── */
button {
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    box-shadow: 0 0 20px rgba(0,229,255,0.25);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0,229,255,0.4);
}

/* Form-Button */
form button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
}

form button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0,229,255,0.3);
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-page {
    padding: 110px 10% 80px;
    text-align: center;
}

.about-page h1 {
    margin-bottom: 40px;
}

/* Profil Box */
.profile-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 50px;
}

.profile-large {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 25px rgba(0,229,255,0.35);
}

body.light .profile-large {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Intro Badge */
.intro-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 50px;
    padding: 14px 28px;
    backdrop-filter: blur(10px);
    max-width: 600px;
}

body.light .intro-badge {
    background: #fff;
    border-color: rgba(0,100,200,0.2);
    box-shadow: 0 2px 15px rgba(0,0,0,0.07);
}

.intro-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse-dot 2s infinite;
}

body.light .intro-dot { box-shadow: none; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}

.intro-badge p { color: var(--muted); font-size: 0.9rem; }
body.light .intro-badge p { color: #333; }

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 50px;
}

.info-grid .card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.info-grid .card p { font-size: 0.88rem; }

/* Extra About */
.extra-about-section { margin-top: 80px; }

.extra-about-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(0,229,255,0.35);
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

body.light .extra-about-title { text-shadow: none; }

.extra-about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    max-width: 860px;
    margin: 0 auto;
}

.about-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 18px;
    padding: 26px 26px 26px 22px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.about-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 28px rgba(0,229,255,0.1);
}

body.light .about-block {
    background: #fff;
    border: 1px solid rgba(0,100,200,0.15);
    border-left: 4px solid var(--accent);
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
}

.about-block-icon { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.about-block p { font-size: 0.88rem; }
body.light .about-block p { color: #333; }

.about-block-wide { grid-column: 1 / -1; }

.about-quote {
    text-align: center;
    margin: 50px auto 0;
    padding: 32px 36px;
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    max-width: 680px;
}

.about-quote p { font-size: 1rem; font-weight: 500; color: var(--text); }
.about-quote span { color: var(--accent); }

body.light .about-quote { background: #fff; box-shadow: 0 2px 20px rgba(0,0,0,0.07); }
body.light .about-quote p { color: #111; }

/* ============================================================
   GALLERY PAGE
   ============================================================ */
.gallery-page {
    padding: 110px 10% 80px;
    text-align: center;
}

.gallery-page h1 { margin-bottom: 16px; }
.gallery-page > p { margin-bottom: 48px; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}

.gallery-grid img {
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.gallery-grid img:hover {
    transform: scale(1.04);
    box-shadow: 0 0 28px rgba(0, 229, 255, 0.3);
}

/* ============================================================
   PROJECTS PAGE
   ============================================================ */
.projects-page {
    padding: 110px 10% 80px;
    text-align: center;
}

.projects-page h1  { margin-bottom: 14px; }
.projects-page > p { margin-bottom: 48px; }

.projects-page .card {
    margin-top: 32px;
    text-align: left;
}

.projects-page .card h2 {
    font-size: 1.3rem;
    color: var(--accent);
    text-shadow: none;
    margin-bottom: 10px;
}

.tutorial-box {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 18px;
    border-radius: 14px;
}

body.light .tutorial-box {
    background: #f5f8ff;
    border-color: rgba(0,100,200,0.15);
    color: #111;
}

.tutorial-box h3 { font-size: 0.95rem; margin-bottom: 8px; color: var(--text); }
.tutorial-box p  { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.tutorial-box ul { padding-left: 18px; }
.tutorial-box li { font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }

.tutorial-box button {
    margin-top: 10px;
    width: 100%;
    padding: 8px;
    background: #22c55e;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
}

video {
    width: 100%;
    border-radius: 18px;
    margin-top: 22px;
    border: 1px solid var(--border);
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-page {
    padding: 110px 10% 80px;
    text-align: center;
}

.contact-page h1  { margin-bottom: 14px; }
.contact-page > p { margin-bottom: 48px; }

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    text-align: left;
}

.contact-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 30px;
    backdrop-filter: blur(12px);
    transition: transform 0.3s, box-shadow 0.3s;
}

.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 28px rgba(0,229,255,0.1);
}

body.light .contact-card {
    background: #fff;
    border-color: rgba(0,100,200,0.12);
    box-shadow: 0 2px 18px rgba(0,0,0,0.07);
}

.contact-card h2 {
    font-size: 1.1rem;
    color: var(--text);
    text-shadow: none;
    margin-bottom: 20px;
}

body.light .contact-card h2 { color: #111; }

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-links a {
    color: var(--accent);
    font-size: 1rem;
    transition: text-shadow 0.2s;
}

.contact-links a:hover {
    text-shadow: 0 0 12px rgba(0,229,255,0.5);
}

body.light .contact-links a { color: var(--accent); }

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

input,
textarea {
    font-family: var(--font);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    resize: vertical;
}

input::placeholder,
textarea::placeholder { color: var(--muted); }

input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(0,229,255,0.15);
}

body.light input,
body.light textarea {
    background: #f8faff;
    border-color: rgba(0,100,200,0.2);
    color: #111;
}

body.light input:focus,
body.light textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0,85,204,0.12);
}

/* ============================================================
   SKILL BARS
   ============================================================ */
.skills { padding: 80px 10%; }

.skill { margin-bottom: 22px; }
.skill-label { margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; color: var(--text); }

.bar {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    overflow: hidden;
}

.fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px rgba(0,229,255,0.4);
    width: 0;
    transition: width 1s ease;
}

.fill.animated { /* JS adds this */  }

.html { width: 90%; }
.css  { width: 85%; }
.js   { width: 70%; }
.py   { width: 75%; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 24px rgba(0,229,255,0.12);
}

body.light .stat-card {
    background: #fff;
    border-color: rgba(0,100,200,0.12);
    box-shadow: 0 2px 15px rgba(0,0,0,0.07);
}

/* ============================================================
   GAME PAGE
   ============================================================ */
.game-section {
    padding: 110px 5% 80px;
    text-align: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

canvas#gameCanvas,
canvas#game {
    border: 2px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 0 24px rgba(0,229,255,0.2);
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Game Panels */
#menuPanel,
#gamePanel {
    position: relative;
    z-index: 1;
}

.hidden { display: none !important; }

/* Difficulty Buttons */
.diff-btn {
    padding: 10px 20px;
    margin: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
}

.diff-btn.active,
.diff-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Game Overlay */
#gameOverOverlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 20, 0.88);
    border-radius: 8px;
    z-index: 10;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 32px 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
}

footer span { color: var(--accent); }

/* ============================================================
   MOBILE NAVIGATION DROPDOWN
   (für alle Seiten außer index.html)
   ============================================================ */
@media (max-width: 767px) {

    /* Hamburger einblenden */
    .menu-btn { display: flex; }

    /* Nav-Links: standard versteckt */
    .nav-links {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: rgba(8, 12, 20, 0.97);
        border-bottom: 1px solid var(--border);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.3s ease;
    }

    body.light .nav-links {
        background: rgba(240, 244, 255, 0.98);
    }

    .nav-links.open {
        max-height: 400px;
        padding: 12px 0;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 12px 28px;
        font-size: 0.9rem;
        color: var(--muted);
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    body.light .nav-links a { color: #333; }
    .nav-links a:hover { color: var(--accent); background: rgba(0,229,255,0.04); }
}

/* ============================================================
   RESPONSIVE — TABLET & MOBILE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    section,
    .about-page,
    .gallery-page,
    .projects-page,
    .contact-page {
        padding: 100px 6% 70px;
    }

    .extra-about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile */
@media (max-width: 767px) {

    .navbar { padding: 0 1.2rem; }

    /* Sections */
    section,
    .about-page,
    .gallery-page,
    .projects-page,
    .contact-page {
        padding: 90px 5% 60px;
    }

    /* H1/H2 kleiner */
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.3rem; }

    /* Profile */
    .profile-large {
        width: 120px;
        height: 120px;
    }

    /* Intro Badge */
    .intro-badge {
        padding: 12px 18px;
        border-radius: 16px;
    }
    .intro-badge p { font-size: 0.82rem; }

    /* Info Grid: 1 Spalte */
    .info-grid {
        grid-template-columns: 1fr;
    }

    /* Extra About Grid: 1 Spalte */
    .extra-about-grid {
        grid-template-columns: 1fr;
    }

    .about-block-wide { grid-column: auto; }

    /* Quote */
    .about-quote { padding: 22px 20px; }
    .about-quote p { font-size: 0.9rem; }

    /* Gallery Grid: 2 Spalten auf Mobile */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Contact: 1 Spalte */
    .contact-container {
        grid-template-columns: 1fr;
    }

    /* Cards */
    .card { padding: 20px; }

    /* Game */
    .game-section { padding: 90px 3% 50px; }
    canvas#gameCanvas { width: 100% !important; height: auto !important; }

    /* Skills */
    .skills { padding: 60px 5%; }
}

/* Extra Small */
@media (max-width: 400px) {
    h1 { font-size: 1.55rem; }
    .gallery-grid { grid-template-columns: 1fr; }
    .profile-large { width: 100px; height: 100px; }
}

/* ============================================================
   LIGHT MODE — ABSCHLUSS-FIXES
   ============================================================ */
body.light p         { color: var(--muted); }
body.light h3        { color: #111; }
body.light .fill     { box-shadow: none; }
body.light footer    { border-top-color: rgba(0,100,200,0.15); }


.touch-pad {
    display: none;
    width: min(260px, 100%);
    margin: 20px auto 0;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.touch-btn {
    min-height: 58px;
    border-radius: 16px;
    font-size: 1.35rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}

@media (max-width: 900px) {
    .touch-pad {
        display: grid;
    }
}

/* ============================================================
   GAME PAGE REFRESH
   Scoped to game.html so the other portfolio pages keep their layout.
   ============================================================ */
body.snake-page {
    --game-panel: rgba(10, 14, 24, 0.86);
    --game-panel-strong: rgba(13, 20, 32, 0.96);
    --game-border: rgba(0, 229, 255, 0.18);
    --game-muted: #9aa8c5;
    --game-pink: #ff4bd8;
    --game-green: #78ffb0;
    --game-shadow: rgba(0, 0, 0, 0.36);
    min-height: 100vh;
    color: var(--text);
    font-family: "Inter", var(--font), sans-serif;
    background:
        linear-gradient(135deg, rgba(5, 7, 12, 0.98), rgba(12, 18, 26, 0.98) 52%, rgba(7, 13, 11, 0.98));
}

body.snake-page.light {
    --game-panel: rgba(255, 255, 255, 0.9);
    --game-panel-strong: rgba(255, 255, 255, 0.98);
    --game-border: rgba(35, 104, 217, 0.2);
    --game-muted: #52627f;
    --game-shadow: rgba(35, 72, 120, 0.12);
    background: linear-gradient(135deg, #f5f8ff, #eaf2ff 48%, #eefaf4);
}

body.snake-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 88%);
}

body.snake-page.light::before {
    background-image:
        linear-gradient(rgba(35, 104, 217, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(35, 104, 217, 0.045) 1px, transparent 1px);
}

.snake-page .navbar {
    height: 68px;
    min-height: 68px;
    padding: 12px clamp(16px, 4vw, 52px);
    background: rgba(5, 7, 12, 0.88);
}

.snake-page.light .navbar {
    background: rgba(255, 255, 255, 0.9);
}

.snake-page .nav-links a[aria-current="page"] {
    color: var(--accent);
}

.snake-page .game-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: clamp(92px, 10vh, 118px) clamp(12px, 3vw, 34px) clamp(30px, 5vh, 56px);
}

.snake-page .game-shell {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 0 !important;
}

.snake-page .game-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: clamp(16px, 3vw, 28px);
}

.snake-page .game-kicker {
    margin: 0 0 8px;
    color: var(--game-green);
    font-family: "Orbitron", sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.snake-page .game-hero h1 {
    margin: 0;
    color: var(--accent);
    font-family: "Orbitron", sans-serif;
    font-size: clamp(2.3rem, 5vw, 5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0;
    text-shadow: 0 0 24px rgba(0, 229, 255, 0.34);
}

.snake-page.light .game-hero h1 {
    text-shadow: none;
}

.snake-page .game-hero p:not(.game-kicker) {
    max-width: 560px;
    margin: 0;
    color: var(--game-muted);
    font-size: clamp(0.92rem, 1.5vw, 1.05rem);
    line-height: 1.65;
}

.snake-page .game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(292px, 370px);
    align-items: start;
    gap: clamp(16px, 2.3vw, 30px);
}

.snake-page .play-zone {
    min-width: 0;
}

.snake-page .canvas-wrap {
    position: relative;
    width: min(100%, 900px, calc(100vh - 210px));
    margin: 0 auto;
    padding: clamp(8px, 1vw, 14px);
    border: 1px solid var(--game-border);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
        var(--game-panel);
    box-shadow: 0 28px 80px var(--game-shadow);
}

.snake-page #gameCanvas {
    width: 100% !important;
    max-width: none;
    height: auto !important;
    aspect-ratio: 1;
    display: block;
    margin: 0;
    border: 2px solid rgba(0, 229, 255, 0.22);
    border-radius: 16px;
    background: #05070d;
    box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.12);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.snake-page.light #gameCanvas {
    background: #eef5ff;
    border-color: rgba(35, 104, 217, 0.22);
}

.snake-page .countdown-overlay {
    position: absolute;
    inset: clamp(8px, 1vw, 14px);
    display: none;
    place-items: center;
    border-radius: 16px;
    background: rgba(3, 8, 16, 0.72);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(5px);
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

.snake-page.light .countdown-overlay {
    background: rgba(238, 245, 255, 0.72);
}

.snake-page .countdown-overlay.show {
    display: grid;
    opacity: 1;
    visibility: visible;
}

.snake-page .countdown-number {
    width: clamp(104px, 16vw, 188px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 2px solid rgba(0, 229, 255, 0.42);
    border-radius: 28px;
    color: var(--accent);
    background: rgba(0, 229, 255, 0.12);
    font-family: "Orbitron", sans-serif;
    font-size: clamp(3.4rem, 12vw, 8rem);
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 32px rgba(0, 229, 255, 0.58);
    animation: snakeCountdownPop 0.7s ease both;
}

@keyframes snakeCountdownPop {
    0% {
        opacity: 0;
        transform: scale(0.72);
    }

    42% {
        opacity: 1;
        transform: scale(1.08);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.snake-page .touch-pad {
    display: none;
    width: min(286px, 100%);
    margin: 16px auto 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    touch-action: manipulation;
}

.snake-page .touch-btn {
    min-height: 58px;
    padding: 0;
    border: 1px solid var(--game-border);
    border-radius: 14px;
    color: var(--text);
    background: var(--game-panel);
    font-size: 1.35rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}

.snake-page .touch-btn:active {
    transform: scale(0.96);
    background: rgba(0, 229, 255, 0.16);
}

.snake-page .touch-empty {
    visibility: hidden;
}

.snake-page .game-sidebar {
    position: sticky;
    top: 86px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--game-border);
    border-radius: 22px;
    background: var(--game-panel);
    box-shadow: 0 22px 70px var(--game-shadow);
    backdrop-filter: blur(16px);
}

.snake-page .score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.snake-page .game-stat {
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid var(--game-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
}

.snake-page.light .game-stat {
    background: rgba(35, 104, 217, 0.055);
}

.snake-page .game-stat-wide {
    grid-column: 1 / -1;
}

.snake-page .game-stat small,
.snake-page .field-label,
.snake-page .status-box strong {
    display: block;
    margin-bottom: 5px;
    color: var(--game-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.snake-page .game-stat strong {
    display: block;
    color: var(--accent);
    font-family: "Orbitron", sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    line-height: 1.15;
}

.snake-page .control-panel {
    display: grid;
    gap: 10px;
}

.snake-page #difficulty,
.snake-page .play-btn,
.snake-page .small-btn,
.snake-page .back-btn {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    font: inherit;
}

.snake-page #difficulty {
    padding: 0 14px;
    border: 1px solid var(--game-border);
    color: var(--text);
    background: var(--game-panel-strong);
    outline: none;
}

.snake-page.light #difficulty {
    color: #0f172a;
}

.snake-page .button-row,
.snake-page .back-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.snake-page .play-btn,
.snake-page .small-btn,
.snake-page .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid transparent;
    cursor: pointer;
}

.snake-page .play-btn {
    color: #001018;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent), var(--game-green));
}

.snake-page .small-btn,
.snake-page .back-btn {
    color: var(--text);
    background: rgba(255, 255, 255, 0.075);
    border-color: var(--game-border);
}

.snake-page .play-btn:disabled,
.snake-page .small-btn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.snake-page .status-box {
    min-height: 106px;
    padding: 15px;
    border: 1px solid var(--game-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
}

.snake-page .status-box p {
    margin: 0;
    color: var(--game-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

@media (hover: hover) {
    .snake-page .play-btn:hover,
    .snake-page .small-btn:hover,
    .snake-page .back-btn:hover,
    .snake-page .touch-btn:hover {
        transform: translateY(-1px);
        border-color: var(--accent);
    }
}

@media (min-width: 1500px) {
    .snake-page .canvas-wrap {
        width: min(100%, 940px, calc(100vh - 196px));
    }
}

@media (max-width: 1180px) {
    .snake-page .game-layout {
        grid-template-columns: 1fr;
    }

    .snake-page .canvas-wrap {
        width: min(100%, 860px, calc(100vh - 210px));
    }

    .snake-page .game-sidebar {
        position: static;
        width: min(860px, 100%);
        margin: 0 auto;
    }
}

@media (max-width: 900px) {
    .snake-page .game-hero {
        display: block;
        text-align: center;
    }

    .snake-page .game-hero p:not(.game-kicker) {
        margin: 12px auto 0;
    }

    .snake-page .touch-pad {
        display: grid;
    }
}

@media (max-width: 767px) {
    .snake-page .navbar {
        min-height: 64px;
        height: 64px;
        padding-inline: 14px;
    }

    .snake-page .game-main {
        padding: 86px 10px 34px !important;
    }

    .snake-page .game-shell {
        width: 100%;
    }

    .snake-page .game-layout {
        gap: 12px;
    }

    .snake-page .canvas-wrap {
        width: min(100%, calc(100vw - 20px));
        padding: 6px;
        border-radius: 16px;
    }

    .snake-page #gameCanvas,
    .snake-page .countdown-overlay {
        border-radius: 12px;
    }

    .snake-page .countdown-overlay {
        inset: 6px;
    }

    .snake-page .game-sidebar {
        padding: 12px;
        border-radius: 16px;
    }

    .snake-page .score-grid,
    .snake-page .button-row,
    .snake-page .back-actions {
        grid-template-columns: 1fr;
    }

    .snake-page .status-box {
        min-height: auto;
    }
}

@media (max-width: 420px) {
    .snake-page .game-hero h1 {
        font-size: clamp(2rem, 16vw, 3rem) !important;
    }

    .snake-page .countdown-number {
        width: 96px;
        border-radius: 20px;
    }
}