/* ============================================================
   JomChess — landing theme (home page and About page)
   Loaded after style.css, which provides the shared tokens.
   ============================================================ */
:root {
    --c-play: #34d399;
    --c-chars: #fb7185;
    --c-tactics: #a78bfa;
    --c-drills: #60a5fa;
    --c-pitch: #fbbf24;
    --c-tools: #2dd4bf;
    --lp-card: rgba(17, 29, 51, 0.62);
    --lp-card-hover: rgba(24, 40, 68, 0.82);
    --lp-glow: rgba(212, 160, 48, 0.2);
    --lp-glow-2: rgba(96, 165, 250, 0.18);
    --lp-ink-on-accent: #1a1300;
}

[data-theme="light"] {
    --c-play: #059669;
    --c-chars: #e11d48;
    --c-tactics: #7c3aed;
    --c-drills: #2563eb;
    --c-pitch: #b45309;
    --c-tools: #0d9488;
    --lp-card: rgba(255, 255, 255, 0.86);
    --lp-card-hover: #ffffff;
    --lp-glow: rgba(234, 179, 8, 0.18);
    --lp-glow-2: rgba(59, 130, 246, 0.12);
    --lp-ink-on-accent: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.lp {
    overflow-x: clip;
}

.lp-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Top bar ---------- */
.lp-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}

.lp-brand {
    margin-inline-end: auto;
    display: flex;
}

.lp-brand img {
    height: 64px;
    width: auto;
}

@media (max-width: 760px) {
    .lp-brand img { height: 52px; }
}

/* ---------- Language menu (globe dropdown) ---------- */
.lang-menu {
    position: relative;
}

.lang-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 10px 0 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--chip-bg);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: border-color 0.2s, background 0.2s;
}

.lang-menu summary::-webkit-details-marker {
    display: none;
}

.lang-menu summary:hover,
.lang-menu[open] summary {
    border-color: var(--accent);
}

.lm-globe {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.lm-chev {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s var(--ease);
}

.lang-menu[open] .lm-chev {
    transform: rotate(180deg);
}

.lm-list {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 60;
    min-width: 190px;
    max-height: calc(100vh - 90px);   /* 13 languages: scroll on short screens */
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-panel-solid);
    box-shadow: var(--shadow-lg);
    animation: lm-in 0.18s var(--ease) both;
}

@keyframes lm-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.lm-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}

.lm-list a:hover,
.lm-list a:focus-visible {
    background: var(--chip-bg);
}

.lm-list a[aria-current="page"] {
    color: var(--accent);
}

.lm-list a[aria-current="page"]::after {
    content: '\2713';
    font-weight: 800;
}

/* "Also in Malay" note, shown once to Malay browsers */
.lang-suggest {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 4px 0 8px;
    padding: 10px 12px 10px 16px;
    border-radius: 14px;
    background: var(--accent-bg);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    font-size: 14px;
    color: var(--text-primary);
}

.lang-suggest[hidden] {
    display: none;
}

.lang-suggest a {
    font-weight: 800;
    color: var(--accent);
}

.lang-suggest button {
    margin-inline-start: auto;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 18px;
    cursor: pointer;
}

/* Hindi: Devanagari letters come from Noto Sans Devanagari; its marks need more line height */
:lang(hi) body,
body:lang(hi) {
    font-family: 'Outfit', 'Noto Sans Devanagari', sans-serif;
}

/* Russian and Ukrainian: Outfit has no Cyrillic letters, so they come from Onest
   (loaded only on /ru/ and /uk/); Latin letters and digits stay in Outfit */
:lang(ru) body,
body:lang(ru),
:lang(uk) body,
body:lang(uk) {
    font-family: 'Outfit', 'Onest', sans-serif;
}

/* Vietnamese: Outfit lacks the stacked accents (ế, ộ, ữ...), so the whole page uses Be Vietnam Pro */
:lang(vi) body,
body:lang(vi) {
    font-family: 'Be Vietnam Pro', 'Outfit', sans-serif;
}

/* Arabic: Noto Kufi Arabic for Arabic letters, Outfit for Latin and digits */
:lang(ar) body,
body:lang(ar) {
    font-family: 'Outfit', 'Noto Kufi Arabic', sans-serif;
}

/* Letter-spacing breaks the joined Arabic letters; Arabic has no capitals */
:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3,
.lp-section h2:lang(ar),
.lp-kicker:lang(ar) {
    letter-spacing: normal;
    text-transform: none;
}

.lp-hero h1:lang(ar) {
    line-height: 1.35;
}

/* Simplified Chinese: the device's own CJK font for Chinese characters (no big download),
   Outfit for Latin and digits. Wide letter-spacing and capitals do not suit CJK. */
:lang(zh) body,
body:lang(zh) {
    font-family: 'Outfit', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', 'Source Han Sans SC', sans-serif;
}

:lang(zh) h1,
:lang(zh) h2,
:lang(zh) h3,
.lp-section h2:lang(zh),
.lp-kicker:lang(zh) {
    letter-spacing: normal;
    text-transform: none;
}

.lp-hero h1:lang(zh) {
    line-height: 1.25;
}

/* Right-to-left (Arabic). The demo board (files a-h), the picker carousels with their
   arrows and dots, and the phone bottom bar stay left-to-right: their scroll code assumes LTR.
   The text inside the picker cards and the bar labels stays right-to-left. */
[dir="rtl"] .lp-board,
[dir="rtl"] .pick-track,
[dir="rtl"] .pick-nav,
[dir="rtl"] .pick-foot,
[dir="rtl"] .bn-strip {
    direction: ltr;
}

[dir="rtl"] .pick-track > *,
[dir="rtl"] .bn-label {
    direction: rtl;
}

[dir="rtl"] .card:hover .card-tag .arrow {
    transform: translateX(-3px);
}

/* The feedback form is in English */
[dir="rtl"] .fb-dialog {
    direction: ltr;
}

:lang(hi) h1,
:lang(hi) h2,
:lang(hi) h3 {
    letter-spacing: normal;
}

.lp-hero h1:lang(hi) {
    line-height: 1.3;
}

/* Spaced-out capitals break Devanagari's joined letters */
.lp-section h2:lang(hi),
.lp-kicker:lang(hi) {
    letter-spacing: normal;
    text-transform: none;
    font-size: 14px;
}

/* ---------- Hero ---------- */
.lp-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 48px;
    align-items: center;
    padding: 24px 0 44px;
}

.lp-hero::before {
    content: '';
    position: absolute;
    inset: -140px -20% -40px;
    background:
        radial-gradient(35% 55% at 80% 45%, var(--lp-glow-2), transparent 70%),
        radial-gradient(35% 55% at 15% 35%, var(--lp-glow), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.lp-hero h1 {
    font-size: clamp(38px, 5.4vw, 62px);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.045em;
    margin-bottom: 16px;
    animation: rise 0.7s var(--ease) both;
}

.lp-hero h1 .grad {
    background: linear-gradient(100deg, #f2c14e 0%, #fb7185 50%, #a78bfa 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

[data-theme="light"] .lp-hero h1 .grad {
    background-image: linear-gradient(100deg, #b45309 0%, #e11d48 50%, #7c3aed 95%);
}

.lp-lead {
    font-size: 18px;
    line-height: 1.55;
    color: var(--text-body);
    max-width: 480px;
    margin-bottom: 26px;
    animation: rise 0.7s 0.06s var(--ease) both;
}

.lp-ctas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    animation: rise 0.7s 0.12s var(--ease) both;
}

.lp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f2c14e, var(--accent));
    color: var(--lp-ink-on-accent);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 22px -10px rgba(212, 160, 48, 0.7);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

[data-theme="light"] .lp-btn {
    background: linear-gradient(135deg, #d4a030, #a16207);
}

.lp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px -10px rgba(212, 160, 48, 0.8);
}

.lp-btn svg {
    flex: none;
    width: 18px;
    height: 18px;
}

.lp-btn-ghost,
[data-theme="light"] .lp-btn-ghost {
    background: var(--chip-bg);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    box-shadow: none;
}

.lp-btn-ghost:hover {
    background: var(--btn-secondary-hover);
    box-shadow: none;
}

.lp-free {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.lp-free b {
    color: var(--success);
}

/* Live board */
.lp-board-card {
    width: 300px;
    padding: 10px;
    border-radius: 22px;
    background: var(--lp-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: rotate(2deg);
    animation: rise 0.9s 0.1s var(--ease) both;
}

.lp-board {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
}

.lp-board-caption {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 4px 2px;
}

.lp-board-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
}

.lp-board-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.lp-move {
    padding: 2px 9px;
    border-radius: 6px;
    background: var(--chip-bg);
    font-size: 12.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lp-sq { background: var(--board-light); }
.lp-sq.dark { background: var(--board-dark); }
.lp-sq.hl { box-shadow: inset 0 0 0 999px var(--highlight-last); }

.lp-piece {
    position: absolute;
    left: 0;
    top: 0;
    width: 12.5%;
    height: 12.5%;
    transition: transform 0.55s var(--ease), opacity 0.35s;
    pointer-events: none;
}

.lp-piece img {
    width: 100%;
    height: 100%;
    display: block;
}

.lp-piece.gone { opacity: 0; }

/* ---------- Sections ---------- */
.lp-section {
    padding-bottom: 40px;
}

.lp-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.lp-section h2::before {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sec, var(--accent));
}

.lp-section h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---------- Game cards ---------- */
.lp-games {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.card {
    --tile: var(--accent);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 20px 20px;
    border-radius: 22px;
    background: var(--lp-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    animation: rise 0.6s var(--ease) both;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.card::before {
    content: '';
    position: absolute;
    right: -40%;
    bottom: -50%;
    width: 110%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--tile) 22%, transparent), transparent 70%);
    z-index: -1;
    transition: transform 0.45s var(--ease);
}

.card:hover,
.card:focus-visible {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--tile) 60%, transparent);
    background: var(--lp-card-hover);
    box-shadow: var(--shadow-lg);
}

.card:hover::before { transform: scale(1.3); }

.card--play    { --tile: var(--c-play); }
.card--chars   { --tile: var(--c-chars); }
.card--tactics { --tile: var(--c-tactics); }
.card--drills  { --tile: var(--c-drills); }
.card--pitch   { --tile: var(--c-pitch); }
.card--tool    { --tile: var(--c-tools); }

/* Solid colour tiles (home page). Mid-dark tones so white text stays readable in both themes. */
.card--play    { --g1: #059669; --g2: #064e3b; }
.card--chars   { --g1: #e11d48; --g2: #881337; }
.card--tactics { --g1: #7c3aed; --g2: #4c1d95; }
.card--drills  { --g1: #2563eb; --g2: #1e3a8a; }
.card--pitch   { --g1: #ea580c; --g2: #9a3412; }
.card--tool    { --g1: #0d9488; --g2: #134e4a; }

.card--solid,
.card--solid:hover,
.card--solid:focus-visible {
    background: linear-gradient(155deg, var(--g1), var(--g2));
    border-color: transparent;
    color: #fff;
}

.card--solid {
    box-shadow: 0 14px 30px -16px var(--g2);
}

.card--solid:hover,
.card--solid:focus-visible {
    box-shadow: 0 22px 40px -16px var(--g2);
}

.card--solid::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
}

/* Big faded chess piece in the corner */
.card--solid::after {
    content: attr(data-glyph);
    position: absolute;
    inset-inline-end: -6px;
    bottom: -34px;
    font-size: 132px;
    line-height: 1;
    color: #fff;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
    transition: transform 0.45s var(--ease);
}

.card--solid:hover::after {
    transform: rotate(-8deg) scale(1.06);
}

/* .card.card--solid to outrank the general ".card p" rule further down */
.card.card--solid p {
    color: rgba(255, 255, 255, 0.88);
}

.card--solid .card-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.card--solid .card-faces img {
    border-color: rgba(255, 255, 255, 0.9);
}

.card--solid .card-tag {
    color: #fff;
}

.card--solid .card-tag .arrow {
    background: rgba(255, 255, 255, 0.2);
}

.card--solid:hover .card-tag .arrow {
    background: #fff;
    color: var(--g2);
}

.lp-games .card:nth-child(1) { animation-delay: 0.10s; }
.lp-games .card:nth-child(2) { animation-delay: 0.15s; }
.lp-games .card:nth-child(3) { animation-delay: 0.20s; }
.lp-games .card:nth-child(4) { animation-delay: 0.25s; }
.lp-games .card:nth-child(5) { animation-delay: 0.30s; }

.card-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    border-radius: 15px;
    font-size: 28px;
    color: var(--tile);
    background: color-mix(in srgb, var(--tile) 15%, transparent);
}

.card-faces {
    display: flex;
    height: 50px;
    margin-bottom: 8px;
}

.card-faces img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid var(--bg-panel-solid);
    margin-inline-start: -12px;
}

.card-faces img:first-child { margin-inline-start: 0; }

.card h3 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.card p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.card-tag {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tile);
}

.card-tag .arrow {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tile) 15%, transparent);
    transition: transform 0.3s var(--ease), background 0.3s;
}

.card:hover .card-tag .arrow {
    transform: translateX(3px);
    background: var(--tile);
    color: var(--bg-body);
}

/* ---------- Tools ---------- */
.lp-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.lp-tools .card {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    animation-delay: 0.35s;
}

.lp-tools .card-icon {
    flex: none;
    margin: 0;
}

.lp-tools .card-text {
    flex: 1;
    min-width: 0;
}

.lp-tools .card-tag {
    margin: 0;
    padding: 0;
}

/* ---------- Game picker (modal) ---------- */
.pick {
    width: min(980px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--bg-panel-solid);
    color: var(--text-primary);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.pick::backdrop {
    background: rgba(5, 10, 20, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.pick[open] {
    animation: pick-in 0.35s var(--ease) both;
}

@keyframes pick-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.pick-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 24px 6px;
}

.pick-head h2 {
    flex: 1;
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.pick-nav {
    display: flex;
    gap: 6px;
}

.pick-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--chip-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.pick-btn:hover { background: var(--btn-secondary-hover); }
.pick-btn:disabled { opacity: 0.35; cursor: default; }

.pick-sub {
    padding: 0 24px;
    font-size: 14.5px;
    color: var(--text-secondary);
}

.pick-track {
    display: flex;
    gap: 14px;
    padding: 18px 24px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 24px;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.pick-track::-webkit-scrollbar { display: none; }

.opt {
    --tile: var(--accent);
    flex: 0 0 280px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 20px 20px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background:
        radial-gradient(120% 70% at 100% 100%, color-mix(in srgb, var(--tile) 18%, transparent), transparent 60%),
        var(--bg-inset);
}

.opt--play    { --tile: var(--c-play); }
.opt--chars   { --tile: var(--c-chars); }
.opt--tactics { --tile: var(--c-tactics); }
.opt--drills  { --tile: var(--c-drills); }
.opt--pitch   { --tile: var(--c-pitch); }
.opt--tool    { --tile: var(--c-tools); }

/* Tools picker: two cards fit, so they share the width */
.pick--tools {
    width: min(680px, calc(100vw - 24px));
}

.pick--tools .opt {
    flex: 1 1 0;
    min-width: 250px;
}

/* Nothing to scroll: no arrows or dots */
.pick.fits .pick-nav,
.pick.fits .pick-foot .pick-btn,
.pick.fits .pick-dots button {
    display: none;
}

.pick.fits .pick-foot {
    padding-bottom: 14px;
}

.opt {
    box-shadow: inset 0 4px 0 var(--tile);
}

.opt .card-icon,
.opt .card-faces {
    margin-bottom: 6px;
}

.opt .card-icon {
    background: var(--tile);
    color: var(--bg-body);
}

.opt h3 {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.opt p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.opt ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 6px 0 10px;
}

.opt li {
    position: relative;
    padding-inline-start: 26px;
    font-size: 14px;
    line-height: 18px;
}

.opt li::before {
    content: '\2713';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tile) 18%, transparent);
    color: var(--tile);
    font-size: 11px;
    font-weight: 800;
}

.opt-go {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 12px;
    background: var(--tile);
    color: var(--bg-body);
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    transition: transform 0.2s var(--ease), filter 0.2s;
}

[data-theme="light"] .opt-go { color: #fff; }

.opt-go:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.pick-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 18px 20px;
}

/* Bottom arrows are for phones; desktop has them in the header */
.pick-foot .pick-btn {
    display: none;
}

.pick-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.pick-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--border-strong);
    cursor: pointer;
    transition: width 0.3s var(--ease), background 0.3s;
}

.pick-dots button.on {
    width: 22px;
    background: var(--accent);
}

html.pick-open {
    overflow: hidden;
}

/* ---------- Feedback strip (styles from style.css .help-strip) ---------- */
.lp-help {
    max-width: none;
    margin: 4px 0 8px;
    padding: 18px 22px;
    border-radius: 22px;
    background: var(--lp-card);
}

/* ---------- Footer ---------- */
.lp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 16px 24px 36px;
    font-size: 14px;
    color: var(--text-muted);
}

.lp-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.lp-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.lp-footer a:hover { color: var(--text-primary); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .lp-games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .pick-nav { display: none; }
    .pick-foot .pick-btn { display: grid; width: 44px; height: 44px; }
    .pick-foot { justify-content: space-between; padding: 8px 18px 18px; }
    .pick-head { padding: 20px 18px 4px; }
    .pick-sub { padding: 0 18px; }
    .pick-track { padding: 16px 18px 6px; scroll-padding: 0 18px; gap: 12px; }
    .opt { flex-basis: 82%; }
    .lp-container { padding: 0 16px; }
    .lp-hero {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 8px 0 32px;
        text-align: center;
    }
    .lp-lead { margin-left: auto; margin-right: auto; }
    .lp-ctas { justify-content: center; }
    .lp-board-card { display: none; }
    .lp-games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .lp-tools { grid-template-columns: 1fr; gap: 12px; }
    .card { padding: 18px 16px 16px; border-radius: 20px; }
    .card p { font-size: 13.5px; }
    .lp-footer { justify-content: center; text-align: center; padding: 16px 16px 32px; }
}

@media (max-width: 480px) {
    .lp-ctas { gap: 8px; }
    .lp-ctas .lp-btn { padding: 0 14px; font-size: 14.5px; }
}

@media (max-width: 360px) {
    .lp-games { grid-template-columns: 1fr; }
}

/* ============================================================
   Bottom navigation for phones (bottom-nav.js; home page and About only)
   A carousel: the item in the middle becomes the big raised button.
   ============================================================ */
.bottom-nav {
    display: none;
}

@property --bn-spin {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@keyframes bn-spin {
    to { --bn-spin: 360deg; }
}

@media (max-width: 760px) {
    .bottom-nav {
        --bn-h: 66px;        /* the bar */
        --bn-lift: 34px;     /* room above the bar for the raised button */
        --bn-item: 74px;
        --bn-bg: rgba(15, 25, 45, 0.8);
        --bn-edge: rgba(255, 255, 255, 0.08);
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 900;
        display: block;
        height: var(--bn-h);
        transition: transform 0.35s var(--ease), opacity 0.35s;
    }

    [data-theme="light"] .bottom-nav {
        --bn-bg: rgba(255, 255, 255, 0.82);
        --bn-edge: rgba(16, 24, 40, 0.08);
    }

    /* The bar itself (drawn behind the strip, which is taller so the raised button isn't clipped) */
    .bottom-nav::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 24px;
        background: var(--bn-bg);
        border: 1px solid var(--bn-edge);
        -webkit-backdrop-filter: blur(18px) saturate(1.6);
        backdrop-filter: blur(18px) saturate(1.6);
        box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    [data-theme="light"] .bottom-nav::before {
        box-shadow: 0 14px 34px -12px rgba(16, 24, 40, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    /* Slides away while scrolling down */
    .bottom-nav.bn-away {
        transform: translateY(calc(100% + 50px + env(safe-area-inset-bottom)));
        opacity: 0;
    }

    .bn-strip {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--bn-h) + var(--bn-lift));
        display: flex;
        /* Side padding lets the first and last items reach the middle */
        padding: 0 calc(50% - var(--bn-item) / 2);
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
    }

    .bn-strip::-webkit-scrollbar {
        display: none;
    }

    /* Each item takes its game's colour */
    .bn-home    { --bn-c: #d4a030; }
    .bn-play    { --bn-c: #d4a030; }
    .bn-chars   { --bn-c: #e11d48; }
    .bn-tactics { --bn-c: #7c3aed; }
    .bn-drills  { --bn-c: #2563eb; }
    .bn-pitch   { --bn-c: #ea580c; }
    .bn-tools   { --bn-c: #0d9488; }
    .bn-about   { --bn-c: #64748b; }

    .bn-item {
        flex: 0 0 var(--bn-item);
        scroll-snap-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        padding-bottom: 9px;
        color: var(--text-muted);
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* The icon is always a 60px disc; side items are shrunk and sit inside the bar */
    .bn-icon {
        position: relative;
        width: 60px;
        height: 60px;
        margin-bottom: 1px;
        transform: translateY(14px) scale(0.68);
        transition: transform 0.35s var(--ease);
    }

    .bn-disc {
        position: relative;
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: 4px solid transparent;
        font-size: 30px;
        line-height: 1;
        color: var(--bn-c);
        transition: background 0.35s, color 0.35s, border-color 0.35s, box-shadow 0.35s;
    }

    .bn-disc svg {
        width: 30px;
        height: 30px;
    }

    .bn-play-svg {
        margin-left: 3px; /* optical centre of the triangle */
    }

    /* Brighter icons on the dark bar */
    :root:not([data-theme="light"]) .bn-item:not(.is-centre) .bn-disc {
        color: color-mix(in srgb, var(--bn-c) 70%, #fff);
    }

    .bn-label {
        font-size: 10.5px;
        font-weight: 600;
        line-height: 14px;
        white-space: nowrap;
        transition: color 0.3s;
    }

    .bn-item.here .bn-label {
        color: var(--bn-c);
    }

    :root:not([data-theme="light"]) .bn-item.here .bn-label {
        color: color-mix(in srgb, var(--bn-c) 70%, #fff);
    }

    /* ---- The item in the middle: big, raised, in its own colour ---- */
    .bn-item.is-centre .bn-icon {
        transform: translateY(-8px) scale(1);
    }

    .bn-item.is-centre .bn-disc {
        background: linear-gradient(135deg, color-mix(in srgb, var(--bn-c) 70%, #fff), var(--bn-c));
        border-color: var(--bg-panel-solid);
        color: #fff;
        box-shadow: 0 10px 22px -6px color-mix(in srgb, var(--bn-c) 75%, transparent);
    }

    .bn-item.is-centre.bn-home .bn-disc,
    .bn-item.is-centre.bn-play .bn-disc {
        color: #1a1300;
    }

    /* Slowly turning rainbow ring around the middle button */
    .bn-icon::before {
        content: '';
        position: absolute;
        inset: -3px;
        border-radius: 50%;
        background: conic-gradient(from var(--bn-spin), #f2c14e, #fb7185, #a78bfa, #60a5fa, #34d399, #f2c14e);
        opacity: 0;
        transition: opacity 0.35s;
        animation: bn-spin 6s linear infinite;
    }

    .bn-item.is-centre .bn-icon::before {
        opacity: 1;
    }

    .bn-item.is-centre .bn-label {
        color: var(--text-primary);
        font-weight: 800;
    }

    .bn-item:active .bn-icon {
        transform: translateY(14px) scale(0.6);
    }

    .bn-item.is-centre:active .bn-icon {
        transform: translateY(-8px) scale(0.93);
    }

    /* Room for the bar at the bottom of the page */
    body.has-bottom-nav {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }

    .has-bottom-nav .update-toast {
        bottom: calc(110px + env(safe-area-inset-bottom));
    }
}
