/* Daily World — dailyworld.app. Family fonts: Bungee (display), Jockey One (UI). */

:root {
    --navy: #101f31;
    --gold: #ffdd7c;
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #1d2633;
    --muted: #5b6676;
    --heading: #101f31;
    --line: #e2e7ee;
    --notice: #fff5d1;
    --on: #101f31;          /* switched-on colour, the same for every game */
    --seg-track: #eaeef4;   /* the track behind one-of-a-kind settings */
    --chip-on: #e1e9f5;     /* a picked pick-several setting */
    --display: 'Bungee', 'Arial Black', system-ui, sans-serif;
    --ui: 'Jockey One', 'Segoe UI', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a1220;
        --card: #111b2b;
        --text: #e6ebf3;
        --muted: #9aa6b8;
        --heading: #f2f5fa;
        --line: #22314a;
        --notice: rgba(255, 221, 124, 0.12);
        --on: #ffdd7c;
        --seg-track: rgba(255, 255, 255, 0.07);
        --chip-on: rgba(255, 221, 124, 0.16);
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--ui);
    font-size: 18px;
    line-height: 1.4;
}

a { color: inherit; }

img { display: block; }

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--navy);
    color: #ffffff;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-size: 1.15rem;
    text-decoration: none;
    text-transform: uppercase;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-link {
    font-size: 1.05rem;
    text-decoration: none;
    opacity: 0.85;
}

.topbar-link:hover { opacity: 1; text-decoration: underline; }

/* Signed in: "Your stats" carries your current streak (both go to /me). */
.topbar-stats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topbar-stats:has(.topbar-streak) { opacity: 1; }

.topbar-streak {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 221, 124, 0.16);
    color: var(--gold);
    font-family: var(--display);
    font-size: 0.95rem;
}

.topbar-stats:hover .topbar-streak { background: rgba(255, 221, 124, 0.26); }

/* Only the word is underlined on hover, not the streak. */
.topbar-stats:hover { text-decoration: none; }
.topbar-stats:hover .topbar-stats-label { text-decoration: underline; }

.brand span, .topbar-link { white-space: nowrap; }

/* Rightmost: your picture, or a person outline while signed out; both go to /profile. */
.topbar-me {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    transition: transform .2s ease;
}

.topbar-me:has(.person) { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85); }
.topbar-me:hover, .topbar-me:focus-visible { transform: scale(1.08); }
.topbar-me:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

@media (max-width: 480px) {
    .topbar { gap: 10px; padding: 12px 14px; }
    .topbar-nav { gap: 14px; }
}

/* Narrow phones, signed in: the streak says it; the word stays for screen readers. */
@media (max-width: 420px) {
    .topbar-stats:has(.topbar-streak) .topbar-stats-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }
}


/* ---- Hero ------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 28px 20px 60px;
    background: var(--navy);
    color: #ffffff;
    isolation: isolate;
}

/* Soft glows in the games' colours, drifting slowly. */
.hero-glow {
    position: absolute;
    inset: -25%;
    z-index: -1;
    background:
        radial-gradient(32% 38% at 22% 30%, rgba(255, 221, 124, 0.20), transparent 70%),
        radial-gradient(30% 36% at 78% 22%, rgba(128, 221, 221, 0.16), transparent 70%),
        radial-gradient(34% 40% at 70% 80%, rgba(226, 153, 153, 0.16), transparent 70%),
        radial-gradient(28% 34% at 30% 85%, rgba(255, 74, 46, 0.12), transparent 70%);
    animation: drift 26s ease-in-out infinite alternate;
}

/* Faint dot grid, like a map projection. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.5px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
    mask-image: linear-gradient(to bottom, #000 40%, transparent);
}

@keyframes drift {
    from { transform: translate3d(-4%, -3%, 0) rotate(0deg); }
    to { transform: translate3d(4%, 3%, 0) rotate(10deg); }
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    grid-template-areas: "copy art";
    align-items: center;
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-copy { grid-area: copy; }

.eyebrow {
    margin: 0;
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 6px 0 10px;
    font-family: var(--display);
    font-size: clamp(2.2rem, 5.4vw, 3.7rem);
    font-weight: normal;
    line-height: 1.04;
}

.lede {
    max-width: 34ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.25rem;
}

.countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin: 18px 0 0;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
}

#countdown {
    display: inline-block;
    min-width: 6.4em;
    color: var(--gold);
    font-family: var(--display);
    letter-spacing: 0.04em;
}

/* Floating logos */
.hero-art {
    grid-area: art;
    position: relative;
    justify-self: center;
    width: min(460px, 100%);
    aspect-ratio: 1;
}

.float {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: auto;
    border-radius: 22%;
    box-shadow: 0 22px 40px -14px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.07);
    animation: float var(--d) ease-in-out infinite, appear 0.8s ease-out both;
    animation-delay: calc(var(--i) * -1.1s), calc(var(--i) * 90ms);
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(var(--r)); }
    50% { transform: translateY(-14px) rotate(calc(var(--r) * -0.5)); }
}

@keyframes appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---- Signup ----------------------------------------------------------- */
.signup {
    max-width: 560px;
    margin-top: 22px;
    padding: 18px 18px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.picks legend {
    margin-bottom: 10px;
    padding: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pick {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: #ffffff;
    font-size: 1.02rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.pick:hover { transform: translateY(-1px); }

.pick input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pick img {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    transition: filter 0.2s, opacity 0.2s;
}

.pick:has(input:checked) {
    border-color: #ffffff;
    background: #ffffff;
    color: var(--navy);
}

.pick:not(:has(input:checked)) img {
    filter: grayscale(1);
    opacity: 0.5;
}

.pick:has(input:focus-visible) {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.signup-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.signup-row input[type=email] {
    flex: 1 1 auto;
    min-width: 0;
    height: 50px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    color: var(--navy);
    font: inherit;
    font-size: 1.1rem;
}

.signup-row input[type=email]:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.signup-msg {
    min-height: 1.3em;
    margin: 8px 0 0;
    color: #ffffff;
}

.fineprint {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
}

.hp {
    position: absolute;
    left: -9999px;
}

/* ---- Signed in: the welcome card in place of the signup ------------- */
.welcome {
    max-width: 560px;
    margin-top: 22px;
    padding: 20px 20px 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.welcome-hi {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.welcome-streak {
    margin: 4px 0 0;
    font-size: 1.6rem;
    line-height: 1.2;
}

.welcome-streak strong {
    color: var(--gold);
    font-family: var(--display);
    font-size: 2.3rem;
    font-weight: normal;
    vertical-align: -0.08em;
}

.welcome-meta {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.7);
}

.today-list {
    display: grid;
    gap: 6px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.today-game {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.today-game img {
    width: 30px;
    height: 30px;
    border-radius: 22%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.today-name {
    flex: 1;
    min-width: 0;
    font-size: 1.08rem;
}

.today-name small {
    color: var(--gold);
    font-size: 0.95rem;
}

.today-done {
    color: #7ee2a0;
    white-space: nowrap;
}

.today-play {
    padding: 4px 12px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--navy);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.today-play:hover { background: var(--gold); }

.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 16px;
}

.welcome-link { color: rgba(255, 255, 255, 0.85); }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
    flex: none;
    height: 50px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 1.15rem;
    cursor: pointer;
    transition: transform 0.15s, filter 0.15s;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

a.btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn-gold { background: var(--gold); color: var(--navy); }
.btn-dark { background: var(--navy); color: #ffffff; }
.btn-light { background: var(--bg); color: var(--heading); box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger { background: #c62828; color: #ffffff; }

@media (prefers-color-scheme: dark) {
    .btn-dark { background: var(--gold); color: var(--navy); }
}

/* ---- Game catalog ----------------------------------------------------- */
.catalog {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 44px 20px 12px;
}

.shelf { margin-bottom: 40px; }

.shelf-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin-bottom: 16px;
}

.shelf-head h2 {
    margin: 0;
    color: var(--heading);
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: normal;
}

.shelf-head p {
    margin: 0;
    color: var(--muted);
    font-size: 1.1rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px 20px 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 31, 49, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    animation: rise 0.6s ease-out both;
    animation-delay: calc(var(--i) * 70ms);
}

.card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    border-radius: 22%;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-name {
    color: var(--heading);
    font-size: 1.45rem;
    line-height: 1.1;
}

.card-blurb {
    flex: 1;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.35;
}

.card-play {
    align-self: flex-start;
    display: inline-flex;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--tile);
    color: var(--tile-fg);
    font-size: 1.05rem;
}

.card-play span { transition: transform 0.2s; }

.card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 20px 36px -20px color-mix(in srgb, var(--accent) 70%, transparent), 0 2px 6px rgba(16, 31, 49, 0.08);
}

.card:hover .card-icon { transform: rotate(-6deg) scale(1.06); }
.card:hover .card-play span { transform: translateX(3px); }

.card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
    .card-play { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ---- Panels (preferences, unsubscribe, errors) ------------------------ */
.panel-wrap {
    flex: 1;
    padding: 32px 16px 48px;
}

.panel {
    max-width: 620px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 10px 30px -18px rgba(16, 31, 49, 0.35);
}

.panel-narrow { max-width: 480px; }

.panel h1 {
    margin: 0 0 10px;
    color: var(--heading);
    font-family: var(--display);
    font-size: 1.7rem;
    font-weight: normal;
}

.panel-lede {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 1.15rem;
}

.panel-lede a { color: var(--heading); }

.panel-foot {
    margin: 18px 0 0;
    color: var(--muted);
}

.panel-foot a { color: var(--heading); }

.panel form .btn { margin-top: 14px; }

.notice {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-left: 4px solid var(--gold);
    border-radius: 10px;
    background: var(--notice);
    color: var(--text);
}

.toggles {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.toggles .btn { justify-self: start; }

.toggle {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle img {
    width: 48px;
    height: 48px;
    border-radius: 22%;
}

.toggle-text strong {
    display: block;
    color: var(--heading);
    font-size: 1.25rem;
    font-weight: normal;
    line-height: 1.15;
}

.toggle-text small {
    display: block;
    color: var(--muted);
    font-size: 1rem;
}

.switch {
    position: relative;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: var(--line);
    transition: background 0.2s;
}

.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
}

.toggle:has(input:checked) {
    border-color: var(--on);
    background: color-mix(in srgb, var(--on) 6%, var(--card));
}

.toggle:has(input:checked) .switch { background: var(--on); }
.toggle:has(input:checked) .switch::after { transform: translateX(18px); }

.toggle:has(input:focus-visible) {
    outline: 3px solid var(--on);
    outline-offset: 2px;
}

.panel h2 {
    margin: 0 0 12px;
    color: var(--heading);
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: normal;
}

.panel-quiet { box-shadow: none; }

/* ---- Sign in ---------------------------------------------------------- */
.signin-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.signin-form input[type=email] {
    flex: 1 1 auto;
    min-width: 0;
    height: 50px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 1.1rem;
}

.signin-form input[type=email]:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 1px;
}

.signin-msg {
    min-height: 1.3em;
    margin: 10px 0 0;
    color: var(--heading);
}

/* ---- Stats page ------------------------------------------------------- */
.stats {
    display: grid;
    gap: 18px;
    align-content: start;
}

.stats > * { width: 100%; max-width: 620px; margin: 0 auto; }

.streak-card {
    position: relative;
    overflow: hidden;
    padding: 28px 28px 24px;
    border-radius: 20px;
    background: var(--navy);
    color: #ffffff;
    text-align: center;
    isolation: isolate;
}

/* The number is the centre of the card; the flame leans against its left side. */
.streak-number {
    position: relative;
    display: inline-block;
    margin: 8px 0 0;
    color: var(--gold);
    font-family: var(--display);
    font-size: clamp(4.6rem, 20vw, 6.8rem);
    line-height: 0.95;
    text-shadow: 0 6px 30px rgba(255, 170, 60, 0.35);
}

.streak-fire {
    position: absolute;
    top: 50%;
    right: 100%;
    margin-right: 0.08em;
    font-size: 0.62em;
    transform: translateY(-50%);
    text-shadow: none;
}

.streak-label {
    margin: 4px 0 0;
    font-size: 1.35rem;
}

.streak-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 0;
}

.streak-meta span {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
}

.streak-meta strong { color: #ffffff; font-weight: normal; }

/* A game's current streak, next to its name on the stats page. */
.streak-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 8px;
    padding: 1px 9px;
    border-radius: 999px;
    background: #fff1c7;
    color: #8a5a00;
    font-family: var(--display);
    font-size: 0.85rem;
    vertical-align: 2px;
}

@media (prefers-color-scheme: dark) {
    .streak-pill { background: rgba(255, 221, 124, 0.16); color: var(--gold); }
}

.streak-nudge {
    display: inline-block;
    margin: 14px 0 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 221, 124, 0.14);
    color: var(--gold);
}

.game-stats { display: grid; gap: 12px; }

.game-block {
    overflow: hidden;
    border: 1.5px solid var(--line);
    border-radius: 14px;
}

.game-block .game-stat {
    border: 0;
    border-radius: 0;
}

/* Each game's own stats for one daily version, picked with its settings. */
.vstats {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--line);
}

.vstats-controls {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.vgroup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.vgroup[hidden] { display: none; }

/* Two settings on one line; the second one's label needs no fixed width. */
.vrow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.vrow .vgroup ~ .vgroup .vgroup-label { min-width: 0; }

.vgroup-label {
    min-width: 5.5em;
    color: var(--muted);
    font-size: 0.92rem;
}

/* Settings, calm on the eyes: one-of-a-kind choices sit in a soft segmented track
   (the chosen one raised in white); pick-several choices are light chips with a tick. */
.vgroup-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vgroup[data-many="0"] .vgroup-opts {
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--seg-track);
}

.vopt {
    padding: 4px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.98rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.vopt:hover { color: var(--heading); }

.vgroup[data-many="0"] .vopt[aria-pressed="true"] {
    background: var(--card);
    color: var(--heading);
    box-shadow: 0 1px 3px rgba(16, 31, 49, 0.18);
}

.vgroup[data-many="1"] .vopt { border-color: var(--line); }

.vgroup[data-many="1"] .vopt[aria-pressed="true"] {
    border-color: transparent;
    background: var(--chip-on);
    color: var(--heading);
}

.vgroup[data-many="1"] .vopt[aria-pressed="true"]::before {
    content: '✓';
    margin-right: 4px;
    font-size: 0.85em;
}

.vopt:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.vstats-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.vtile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 12px 10px;
    border-radius: 12px;
    background: var(--bg);
}

.vtile-value {
    color: var(--heading);
    font-family: var(--display);
    font-size: 1.5rem;
    line-height: 1.1;
}

.vtile-value small {
    margin-left: 5px;
    color: var(--muted);
    font-family: var(--ui);
    font-size: 1rem;
}

.vtile-label {
    color: var(--muted);
    font-size: 0.95rem;
}

.vstats-none {
    margin: 0;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.vstats-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg);
    color: var(--muted);
}

.vstats-reset {
    padding: 0;
    border: 0;
    background: none;
    color: var(--heading);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.game-stat {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
}

.game-stat img { width: 52px; height: 52px; border-radius: 22%; }

.game-stat-text strong {
    display: block;
    color: var(--heading);
    font-size: 1.25rem;
    font-weight: normal;
    line-height: 1.15;
}

.game-stat-text span { color: var(--muted); }

.game-stat .card-play {
    margin: 0;
    background: #000000;
    color: #ffffff;
    text-decoration: none;
}

.done-chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, #28a745 14%, var(--card));
    color: #1e7e34;
    font-size: 1rem;
    white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
    .done-chip { color: #7ee2a0; }
}

/* Calendar: one column per week, Sunday at the top. */
.cal {
    display: grid;
    grid-template-rows: repeat(7, 14px);
    grid-auto-flow: column;
    grid-auto-columns: 14px;
    gap: 3px;
    justify-content: start;
    overflow-x: auto;
}

.cal-day {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--line);
}

.cal-day.lvl-1 { background: #ffdd7c; }
.cal-day.lvl-2 { background: #f5a524; }
.cal-day.lvl-3 { background: #ff4a2e; }
.cal-day.future { background: transparent; }

.cal-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.cal-legend span:first-child { margin-right: 4px; }
.cal-legend span:last-child { margin-left: 4px; }

.account-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 12px;
}

.account-actions form { margin: 0; }
.account-actions .btn,
.account-actions form .btn { height: 44px; margin: 0; font-size: 1.05rem; }

.danger-link { color: #c62828; }

@media (prefers-color-scheme: dark) {
    .danger-link { color: #ff8a80; }
}

/* ---- Friends ------------------------------------------------------------ */
.friends-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border: 1.5px dashed var(--line);
    border-radius: 16px;
    background: var(--card);
    color: var(--heading);
    font-size: 1.15rem;
    text-decoration: none;
    transition: border-color 0.2s;
}

.friends-cta:hover { border-color: var(--on); }

.profile-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.field {
    display: grid;
    gap: 4px;
    color: var(--muted);
}

.field input {
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 1.15rem;
}

.field input:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.check input { width: 20px; height: 20px; accent-color: var(--on); }

.profile-form .btn { justify-self: start; margin-top: 4px; }

.profile-off {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.profile-off .panel-foot { margin: 0; }
.panel form.profile-off .btn { margin-top: 0; height: 44px; }

.invite-box {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.invite-link {
    flex: 1 1 auto;
    min-width: 0;
    height: 50px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--heading);
    font: inherit;
    font-size: 1.05rem;
}

.invite-reset {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--heading);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.board-game {
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
}

.board-head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    font-size: 1.15rem;
}

.board-head img { border-radius: 22%; }

.board-play {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.95rem;
    text-decoration: none;
}

.board-play:hover { color: var(--heading); }

.board-label {
    margin: 10px 0 2px;
    color: var(--muted);
    font-size: 0.9rem;
}

.board-rows {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.board-rows li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 10px;
}

.board-rows li.is-me { background: color-mix(in srgb, var(--gold) 28%, transparent); }

.board-rank {
    width: 1.4em;
    color: var(--muted);
    font-family: var(--display);
    text-align: center;
}

.board-rows li:first-child .board-rank { color: #c8901a; }

.board-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-result {
    color: var(--heading);
    font-size: 1.15rem;
    white-space: nowrap;
}

.board-empty {
    margin: 10px 0 2px;
    color: var(--muted);
}

.streak-table {
    width: 100%;
    border-collapse: collapse;
}

.streak-table th,
.streak-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.streak-table thead th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: normal;
}

.streak-table tbody th { color: var(--heading); font-weight: normal; }
.streak-table tr:last-child th, .streak-table tr:last-child td { border-bottom: 0; }
.streak-table tr.is-me th { font-family: var(--display); font-size: 0.95rem; }

.week-cell { white-space: nowrap; }

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 3px;
    border-radius: 50%;
    background: var(--line);
}

.dot.on { background: var(--gold); }

.friend-list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.friend-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.friend-list li:last-child { border-bottom: 0; }
.friend-list form { margin: 0; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .invite-box { flex-wrap: wrap; }
    .invite-link { flex-basis: 100%; }
    .streak-table th, .streak-table td { padding: 8px 4px; }
    .dot { width: 9px; height: 9px; margin-right: 2px; }
}

/* ---- Privacy ---------------------------------------------------------- */
.prose { max-width: 720px; }
.prose h2 { margin-top: 26px; }
.prose p, .prose li { color: var(--text); font-size: 1.1rem; line-height: 1.5; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--heading); }

/* ---- Footer ----------------------------------------------------------- */
.footer {
    padding: 24px 16px 36px;
    color: var(--muted);
    font-size: 1rem;
    text-align: center;
}

.footer a { color: inherit; }

/* ---- Small screens ---------------------------------------------------- */
@media (max-width: 899px) {
    .hero { padding: 18px 16px 44px; }

    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "art" "copy";
        gap: 18px;
    }

    /* The logos become one bobbing row above the heading. */
    .hero-art {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: clamp(4px, 2vw, 10px);
        width: 100%;
        aspect-ratio: auto;
        padding-top: 6px;
    }

    .float {
        position: static;
        width: clamp(28px, 9vw, 44px);
        box-shadow: 0 10px 18px -8px rgba(0, 0, 0, 0.6);
    }

    .float:first-child { width: clamp(36px, 12vw, 56px); }

    .catalog { padding: 32px 16px 8px; }
}

@media (max-width: 480px) {
    .signup { padding: 14px 12px 12px; }
    .signup-row, .signin-form { flex-direction: column; }
    .signup-row .btn, .signin-form .btn { width: 100%; }
    .game-stat { grid-template-columns: 44px minmax(0, 1fr); padding: 10px 12px; }
    .game-stat img { width: 44px; height: 44px; }
    .game-stat > :last-child { grid-column: 2; justify-self: start; }

    .vgroup { gap: 4px 8px; }
    .vgroup-label { width: 100%; }
    .vstats-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .streak-card { padding: 24px 18px 20px; }
    .panel { padding: 22px 18px; }
    .toggle { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 10px 12px; }
    .toggle img { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-glow, .float, .card { animation: none; }
    .card, .card-icon, .pick, .btn { transition: none; }
}

/* ---- Avatars and "Your profile" (accounts.js: colour, initial / emoji / flag) ---- */
.avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--av, var(--navy));
    color: var(--av-fg, #ffffff);
    font-family: var(--display);
    font-size: 1.05rem;
    line-height: 1;
}

.avatar-emoji { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-size: 1.3rem; }
.avatar-flag img {
    /* The whole flag, centred on your colour (flags aren't round, and some aren't rectangles). */
    width: auto;
    height: auto;
    max-width: 66%;
    max-height: 58%;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.avatar-xs { width: 24px; height: 24px; font-size: 0.68rem; }
.avatar-xs.avatar-emoji { font-size: 0.85rem; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.78rem; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.avatar-sm.avatar-emoji { font-size: 0.95rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }
.avatar-lg.avatar-emoji { font-size: 2.1rem; }

.board-name .avatar, .who .avatar { margin-right: 8px; vertical-align: middle; }
.board-name { display: flex; align-items: center; }
.who { display: inline-flex; align-items: center; min-width: 0; }

.profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-name {
    margin: 0;
    line-height: 1.2;
    color: var(--heading);
    font-family: var(--display);
    font-size: 1.5rem;
}

.profile-id { margin: 2px 0 0; color: var(--muted); font-size: 1rem; }

.account-id {
    color: var(--heading);
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
}

.profile-box .notice { margin: 14px 0 0; }

.look-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.look-form .btn { justify-self: start; }
.look-form .field small { font-size: 0.9rem; }

.look-form fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.look-form legend {
    width: 100%;
    margin-bottom: 6px;
    padding: 0;
    color: var(--muted);
}

/* Colour and picture choices: the radio is hidden, the circle shows it. */
.swatch, .pic {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.swatch input, .pic input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--av);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);   /* so Cream shows on a white card */
}

.swatch:has(input:checked), .pic:has(input:checked) .avatar {
    box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--heading);
}

.swatch:has(input:focus-visible), .pic:has(input:focus-visible) .avatar,
.pic-flag:has(input:focus-visible) .pic-flag-text {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

.pic-flag {
    gap: 8px;
    padding: 2px 4px 2px 0;
}

.pic-flag-text {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    color: var(--text);
}

.pic-flag:has(input:checked) .pic-flag-text {
    border-color: var(--heading);
    box-shadow: 0 0 0 1px var(--heading);
}

.pic-flag select {
    height: 40px;
    max-width: 210px;
    padding: 0 10px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
