/* ============================================================
   SnakeGame.org.uk - "Handheld LCD" design system
   Pale Nokia-LCD paper, green-black ink, apple-red accent.
   Display: Bricolage Grotesque / Body: Instrument Sans
   Pixel utility: Silkscreen (scores, labels, kbd only)
   ============================================================ */

:root {
    --paper: #E9EDDA;
    --paper-deep: #DFE5C9;
    --panel: #C4D19E;
    --panel-deep: #AFBF87;
    --ink: #1D2415;
    --ink-soft: #46542F;
    --ink-faint: #6C7A50;
    --apple: #C23B21;
    --apple-deep: #97290F;
    --amber-bg: #F2E3B7;
    --amber-line: #C09A3E;
    --amber-ink: #6D4F0A;
    --line: #AAB683;
    --bezel: #262B1E;
    --bezel-hi: #3C4430;
    --paper-on-ink: #E9EDDA;
    --shadow: 0.3rem 0.3rem 0 rgba(29, 36, 21, 0.9);
    --shadow-sm: 0.2rem 0.2rem 0 rgba(29, 36, 21, 0.9);
    --radius: 14px;
    --radius-sm: 8px;
    --wrap: 1120px;
    --font-display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
    --font-body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
    --font-pixel: 'Silkscreen', 'Courier New', monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.7;
    font-size: 1.0625rem;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--apple-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--apple); }
ul, ol { padding-left: 1.4rem; }
::selection { background: var(--ink); color: var(--paper); }

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
strong { color: var(--ink); }

.eyebrow {
    font-family: var(--font-pixel);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--apple-deep);
    display: inline-block;
    margin-bottom: 0.9rem;
}

.lead { font-size: 1.18rem; color: var(--ink-soft); }

kbd {
    font-family: var(--font-pixel);
    font-size: 0.72rem;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 6px;
    box-shadow: 0 3px 0 var(--ink);
    padding: 0.15rem 0.5rem 0.1rem;
    display: inline-block;
    margin: 0 0.15rem 0.25rem 0;
    white-space: nowrap;
}

/* ===== Layout ===== */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.4rem; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 1.4rem; }
.section { padding: 4.5rem 0; }
.section-deep { background: var(--paper-deep); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 2.6rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--ink-soft); margin-top: 0.8rem; }

/* Snake divider: segmented body ending in an apple */
.snake-divider {
    height: 10px;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1.4rem;
    display: flex;
    align-items: center;
    gap: 0;
}
.snake-divider::before {
    content: "";
    flex: 1;
    height: 8px;
    background: repeating-linear-gradient(90deg, var(--ink) 0 14px, transparent 14px 20px);
    border-radius: 4px;
    opacity: 0.55;
}
.snake-divider::after {
    content: "";
    width: 12px;
    height: 12px;
    margin-left: 8px;
    background: var(--apple);
    border-radius: 50%;
    box-shadow: 0 -3px 0 -1px var(--ink-soft);
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
}
.header-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1.4rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.logo:hover { color: var(--ink); }
.logo svg { width: 34px; height: 34px; }
.logo .tld {
    font-family: var(--font-pixel);
    font-size: 0.62rem;
    color: var(--ink-faint);
    align-self: flex-end;
    margin-bottom: 0.35rem;
    letter-spacing: 0.08em;
}

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--ink);
    text-decoration: none;
    padding: 0.3rem 0;
    border-bottom: 3px solid transparent;
}
.nav-links a:hover { border-bottom-color: var(--panel-deep); }
.nav-links a.active { border-bottom-color: var(--apple); }
.nav-links a.nav-cta {
    background: var(--ink);
    color: var(--paper-on-ink);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    border-bottom: none;
    box-shadow: var(--shadow-sm);
}
.nav-links a.nav-cta:hover { background: var(--ink-soft); transform: translate(1px, 1px); box-shadow: 0.1rem 0.1rem 0 rgba(29,36,21,0.9); }

.hamburger {
    display: none;
    background: none;
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 40px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.hamburger span { display: block; width: 20px; height: 3px; background: var(--ink); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 900px) {
    .hamburger { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--paper);
        border-bottom: 2px solid var(--ink);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.4rem 1.4rem;
        gap: 0.4rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--line); }
    .nav-links a.nav-cta { text-align: center; margin-top: 0.6rem; border-bottom: none; }
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.8rem 1.7rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--ink);
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s;
    background: var(--paper);
    color: var(--ink);
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 0.1rem 0.1rem 0 rgba(29,36,21,0.9); }
.btn:active { transform: translate(4px, 4px); box-shadow: none; }
.btn-ink { background: var(--ink); color: var(--paper-on-ink); }
.btn-ink:hover { background: var(--ink-soft); color: var(--paper-on-ink); }
.btn-apple { background: var(--apple); color: #fff; border-color: var(--ink); }
.btn-apple:hover { background: var(--apple-deep); color: #fff; }
.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }

/* ===== The handheld device (signature element) ===== */
.device {
    background: linear-gradient(160deg, var(--bezel-hi), var(--bezel) 55%);
    border-radius: 26px;
    padding: 1.1rem 1.1rem 1.4rem;
    box-shadow: 0.45rem 0.45rem 0 rgba(29, 36, 21, 0.35), inset 0 2px 0 rgba(255,255,255,0.12);
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}
.device-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.3rem 0.8rem;
}
.device-brand {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    color: #97A47C;
    text-transform: uppercase;
}
.device-speaker { display: flex; gap: 4px; }
.device-speaker i {
    width: 4px; height: 4px; border-radius: 50%;
    background: #10140B;
    box-shadow: 0 1px 0 rgba(255,255,255,0.15);
}
.lcd {
    position: relative;
    background: var(--panel);
    border-radius: 10px;
    border: 3px solid #10140B;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25), inset 0 6px 18px rgba(16,20,11,0.28);
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.lcd canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.lcd-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.4rem;
    padding: 1.2rem;
    background: rgba(196, 209, 158, 0.93);
    transition: opacity 0.25s;
}
.lcd-overlay.hidden { opacity: 0; pointer-events: none; }
.lcd-overlay h2, .lcd-overlay h3 { font-family: var(--font-pixel); font-size: clamp(0.95rem, 2.6vw, 1.3rem); letter-spacing: 0.06em; }
.lcd-overlay p { font-size: 0.95rem; color: var(--ink-soft); margin: 0; max-width: 34ch; }
.lcd-overlay .btn { margin-top: 0.7rem; }
.device-hud {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding-top: 0.95rem;
}
.hud-chip {
    font-family: var(--font-pixel);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: #C9D4AC;
    background: #10140B;
    border-radius: 6px;
    padding: 0.42rem 0.7rem 0.3rem;
    min-width: 92px;
    text-align: center;
    text-transform: uppercase;
}
.hud-chip b { display: block; font-size: 1.05rem; color: #E4ECC8; font-weight: 400; margin-top: 0.1rem; }
.hud-chip.hot b { color: #FFB08F; }

/* Game controls under device */
.game-controls { display: flex; justify-content: center; gap: 0.8rem; padding: 1.3rem 0 0.4rem; flex-wrap: wrap; }
.game-controls .btn { padding: 0.62rem 1.4rem; font-size: 0.95rem; }

/* D-pad (touch) */
.dpad { display: none; margin: 1.2rem auto 0; width: 176px; }
.dpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 6px; width: 176px; height: 176px; }
.dpad-btn {
    background: var(--ink);
    border: none;
    border-radius: 10px;
    color: var(--paper-on-ink);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-shadow: 0 4px 0 rgba(29,36,21,0.5);
}
.dpad-btn:active { background: var(--apple-deep); transform: translateY(2px); box-shadow: 0 2px 0 rgba(29,36,21,0.5); }
@media (max-width: 820px), (pointer: coarse) { .dpad { display: block; } }

/* ===== Hero ===== */
.hero { padding: 4rem 0 4.5rem; }
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3.4rem;
    align-items: center;
}
.hero-grid > * { min-width: 0; }
.hero h1 span { color: var(--apple-deep); }
.hero .lead { margin: 1.1rem 0 1.8rem; }
.hero-meta { display: flex; gap: 1.6rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-meta div { font-size: 0.92rem; color: var(--ink-soft); }
.hero-meta b { font-family: var(--font-pixel); display: block; font-size: 1.05rem; color: var(--ink); font-weight: 400; }
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2.4rem; }
}

/* ===== Cards ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.4rem; }
.card {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    box-shadow: var(--shadow);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
a.card:hover { transform: translate(2px, 2px); box-shadow: 0.1rem 0.1rem 0 rgba(29,36,21,0.9); color: var(--ink); }
.card h3 { margin: 0; }
.card p { color: var(--ink-soft); font-size: 0.97rem; margin: 0; flex: 1; }
.card .card-go { font-weight: 700; color: var(--apple-deep); font-size: 0.95rem; }
.card-tag {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: var(--paper-deep);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 0.25rem 0.5rem 0.15rem;
    align-self: flex-start;
}
.card-tag.new { color: #fff; background: var(--apple); border-color: var(--apple-deep); }

/* Pixel icon in cards */
.pix { width: 44px; height: 44px; image-rendering: pixelated; }

/* ===== Page header ===== */
.page-head { padding: 3.6rem 0 3rem; }
.page-head h1 span { color: var(--apple-deep); }
.page-head .lead { margin-top: 1rem; max-width: 720px; }
.breadcrumbs { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 1.3rem; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--apple-deep); text-decoration: underline; }

/* ===== Prose / article ===== */
.prose h2 { margin: 2.6rem 0 1rem; }
.prose h3 { margin: 2rem 0 0.7rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--apple-deep); font-weight: 700; }

/* ===== Tables ===== */
.spec-table { width: 100%; border-collapse: collapse; margin: 1.4rem 0 2rem; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.spec-table-scroll { overflow-x: auto; }
.spec-table th, .spec-table td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.98rem; }
.spec-table th { font-family: var(--font-pixel); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; background: var(--paper-deep); color: var(--ink-soft); width: 38%; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }

/* ===== FAQ ===== */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 2px solid var(--ink); }
.faq summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 0.2rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.08rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-pixel); color: var(--apple-deep); font-size: 1rem; }
.faq details[open] summary::after { content: "-"; }
.faq .faq-a { padding: 0 0.2rem 1.2rem; color: var(--ink-soft); }

/* ===== Timeline (history) ===== */
.timeline { position: relative; padding-left: 2rem; margin-top: 1rem; }
.timeline::before {
    content: "";
    position: absolute;
    left: 6px; top: 8px; bottom: 8px;
    width: 6px;
    background: repeating-linear-gradient(180deg, var(--ink) 0 12px, transparent 12px 18px);
    border-radius: 3px;
    opacity: 0.5;
}
.timeline-item { position: relative; padding: 0 0 2.2rem 1.4rem; }
.timeline-item::before {
    content: "";
    position: absolute;
    left: -2rem; top: 6px;
    width: 14px; height: 14px;
    background: var(--apple);
    border: 3px solid var(--ink);
    border-radius: 50%;
    transform: translateX(2px);
}
.timeline-year { font-family: var(--font-pixel); font-size: 0.8rem; color: var(--apple-deep); letter-spacing: 0.1em; }
.timeline-item h3 { margin: 0.3rem 0 0.5rem; }
.timeline-item p { color: var(--ink-soft); margin: 0; }

/* ===== Notices / gambling cautions ===== */
.notice {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-left: 10px solid var(--apple);
    border-radius: var(--radius-sm);
    padding: 1.2rem 1.4rem;
    margin: 1.6rem 0;
}
.notice-amber { border-left-color: var(--amber-line); background: var(--amber-bg); }
.notice h3, .notice h4 { margin-bottom: 0.5rem; font-size: 1.05rem; }
.notice p { font-size: 0.97rem; color: var(--ink-soft); }
.age-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-pixel);
    font-size: 0.72rem;
    background: var(--apple);
    color: #fff;
    border: 2px solid var(--ink);
    border-radius: 50%;
    width: 44px; height: 44px;
    flex-shrink: 0;
}
.notice-flex { display: flex; gap: 1.1rem; align-items: flex-start; }

/* Rating bars for slot reviews */
.rating-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.7rem; }
.rating-row span { flex: 0 0 130px; font-family: var(--font-pixel); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.rating-track { flex: 1; height: 14px; background: var(--paper-deep); border: 2px solid var(--ink); border-radius: 7px; overflow: hidden; }
.rating-fill { height: 100%; background: repeating-linear-gradient(90deg, var(--ink) 0 8px, var(--ink-soft) 8px 10px); }

/* ===== CTA banner ===== */
.cta-banner {
    background: var(--ink);
    color: var(--paper-on-ink);
    border-radius: var(--radius);
    padding: 2.8rem 2.4rem;
    text-align: center;
    margin: 0 1.4rem;
}
.cta-inner { max-width: var(--wrap); margin: 0 auto; }
.cta-banner h2 { color: var(--paper-on-ink); margin-bottom: 0.6rem; }
.cta-banner p { color: #B9C29C; max-width: 560px; margin: 0 auto 1.6rem; }
.cta-banner .btn { box-shadow: 0.3rem 0.3rem 0 rgba(233, 237, 218, 0.25); }

/* ===== Footer ===== */
.site-footer {
    background: var(--ink);
    color: #B9C29C;
    margin-top: 4.5rem;
    padding: 3.2rem 0 2rem;
    font-size: 0.95rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.2rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { color: var(--paper-on-ink); margin-bottom: 0.8rem; }
.footer-brand p { font-size: 0.92rem; }
.footer-heading { font-family: var(--font-pixel); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8A9670; margin-bottom: 0.9rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.45rem; }
.footer-links a { color: #C9D2AE; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
    border-top: 1px solid #3C4430;
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #8A9670;
}
.footer-safer { font-size: 0.85rem; color: #8A9670; margin-top: 1.6rem; border: 1px solid #3C4430; border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; }
.footer-safer a { color: #C9D2AE; }

/* ===== Scroll animations ===== */
.animate-on-scroll { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.animate-on-scroll.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .animate-on-scroll { opacity: 1; transform: none; transition: none; }
    * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ===== Focus ===== */
a:focus-visible, button:focus-visible, summary:focus-visible {
    outline: 3px solid var(--apple);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== 404 ===== */
.err-code { font-family: var(--font-pixel); font-size: clamp(3rem, 10vw, 6rem); color: var(--apple-deep); line-height: 1; }

/* ===== Helpers ===== */
.center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.small { font-size: 0.88rem; color: var(--ink-faint); }
