/* ───────────────────────────────────────────────────────────────────────
   Party games — shared styles for every game's player and host screens
   (GeoQuiz and Scam Spotter sections further down).

   Colours follow the Digital Skills Australia brand: navy for text and
   main buttons, amber for the action button and highlights, green for
   "well done", on clean white and pale-grey backgrounds. The logo goes in
   public/assets/games/brand/ (see the README there).

   Built for older players: large type (Atkinson Hyperlegible was designed
   for low-vision readers), strong contrast, big tap targets, nothing that
   relies on hover, and plain words.
   ─────────────────────────────────────────────────────────────────────── */

:root {
    /* Digital Skills Australia */
    --navy: #173a5e;
    --navy-dark: #0f2a45;
    --amber: #e9a23b;
    --amber-dark: #c7841f;
    --amber-soft: #fdf3e1;
    --green: #3fa45f;          /* the brand's friendly green */

    --paper: #f5f7fa;
    --card: #ffffff;
    --ink: #173a5e;
    --muted: #4b5563;
    --line: #dde3ea;
    --brand: var(--navy);       /* main buttons, headings, highlights */
    --brand-dark: var(--navy-dark);
    --action: var(--amber);     /* the one big "do it" button on each screen */
    --action-dark: var(--amber-dark);
    --action-ink: var(--navy);  /* navy on amber — white on amber is too faint to read */
    --go: #15803d;              /* success: answered, correct, points */
    --go-dark: #166534;
    --sky: #1d5fbf;
    --danger: #b91c1c;
    --gold: #b7791f;
    --focus: #2563eb;
    --radius: 16px;
    --shadow: 0 8px 28px rgba(23, 58, 94, 0.10);
    --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --heading-font: "Inter", "Atkinson Hyperlegible", system-ui, sans-serif;
    font-size: 20px;
}

:root.big-text { font-size: 25px; }

@media (min-width: 768px) {
    :root { font-size: 22px; }
    :root.big-text { font-size: 27px; }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
}

body { min-height: 100dvh; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-family: var(--heading-font); font-weight: 800; letter-spacing: -0.02em; color: var(--navy); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
p { margin: 0 0 0.9em; }

[hidden] { display: none !important; }

:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 3px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 3.2rem;
    padding: 0.6em 1.4em;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 0 var(--brand-dark);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
    touch-action: manipulation;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-dark); }
.btn.go { background: var(--action); color: var(--action-ink); box-shadow: 0 4px 0 var(--action-dark); }
.btn.go:active { box-shadow: 0 1px 0 var(--action-dark); }
.btn.quiet {
    background: var(--card);
    color: var(--ink);
    box-shadow: inset 0 0 0 3px var(--line), 0 3px 0 var(--line);
}
.btn.quiet:active { box-shadow: inset 0 0 0 3px var(--line); }
.btn.small { min-height: 2.4rem; font-size: 0.95rem; padding: 0.35em 1em; }
.btn.block { display: flex; width: 100%; }
.btn:disabled,
.btn[aria-disabled="true"] {
    background: #c9d0d9;
    color: #4b4b4b;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.link-btn {
    appearance: none;
    background: none;
    border: 0;
    padding: 0.5em 0.25em;
    font: inherit;
    font-size: 1rem;
    color: var(--sky);
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
    min-height: 2.4rem;
}

/* ─── Forms ───────────────────────────────────────────────────────────── */

label.field-label {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4em;
}

.field-hint {
    display: block;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 400;
    margin-top: 0.15em;
}

input.text,
select.text {
    width: 100%;
    min-height: 3.4rem;
    padding: 0.5em 0.75em;
    border: 3px solid #8a95a5;
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 1.35rem;
}
input.text:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25); }

input.code-input {
    text-align: center;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
    padding: 0.25em 0.4em;
}

.error {
    background: #fdecec;
    color: #7f1d1d;
    border: 3px solid #f3b4b4;
    border-radius: 14px;
    padding: 0.7em 0.9em;
    font-weight: 700;
    margin: 0.8em 0;
}

/* ─── Layout helpers ──────────────────────────────────────────────────── */

.page {
    max-width: 34rem;
    margin: 0 auto;
    padding: 1.2rem 1rem 3rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem 1.2rem;
}

.stack > * + * { margin-top: 1rem; }

.muted { color: var(--muted); }
.center { text-align: center; }

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.4rem 0 1.2rem;
}
.brand-mark {
    width: 2.6rem;
    height: 2.6rem;
    flex: none;
}
.brand-name { font-family: var(--heading-font); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy); }
.brand-tag { color: var(--muted); font-size: 0.95rem; }

.step-label {
    display: inline-block;
    background: var(--amber-soft);
    color: #8a5a10;
    border: 2px solid #f1cf94;
    border-radius: 999px;
    padding: 0.15em 0.85em;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.text-size-toggle {
    position: fixed;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 3000;
    min-height: 2.6rem;
    padding: 0.2em 0.9em;
    border-radius: 999px;
    border: 3px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}
.text-size-toggle[aria-pressed="true"] { border-color: var(--ink); }
body.immersive .text-size-toggle { display: none; }
body.immersive .view-top { padding-right: 0.9rem; }

/* Big tick / status icon circles */
.status-icon {
    width: 5.5rem;
    height: 5.5rem;
    margin: 0.5rem auto 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 3rem;
    color: #fff;
    background: var(--go);
}
.status-icon.wait { background: var(--sky); }

.dots span {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin: 0 0.25rem;
    border-radius: 50%;
    background: var(--muted);
    animation: dot 1.4s infinite ease-in-out both;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .dots span { animation: none; opacity: 0.7; }
    .btn { transition: none; }
}

.banner {
    position: fixed;
    left: 50%;
    top: 0.7rem;
    transform: translateX(-50%);
    z-index: 4000;
    background: var(--ink);
    color: #fff;
    border-radius: 999px;
    padding: 0.55em 1.2em;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow);
    max-width: calc(100vw - 1.5rem);
    text-align: center;
}

/* ─── Full-screen play views (photo / map) ────────────────────────────── */

.fullscreen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

.view-top {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    padding-right: 7.5rem; /* room for the text-size toggle */
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    min-height: 3.6rem;
}
.view-top .pill {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.15em 0.8em;
    white-space: nowrap;
}
.pill.timer { font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.pill.timer.low { background: #f6c343; color: var(--ink); }
.host-timer { font-size: 3rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; margin: 0 0 0.6rem; }
.host-timer.low { color: var(--brand); }

.view-instruction {
    flex: none;
    background: #fdf3e1;
    color: var(--ink);
    padding: 0.6rem 0.9rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 3px solid #f1cf94;
}

.view-body { position: relative; flex: 1; min-height: 0; }
.view-body > .pano,
.view-body > .map { position: absolute; inset: 0; }

.view-actions {
    flex: none;
    display: flex;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem calc(0.8rem + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 3px solid var(--line);
}
.view-actions .btn { flex: 1; }
.view-actions.stacked { flex-direction: column; gap: 0.3rem; }
.view-actions.stacked .link-btn { align-self: center; }

.drag-hint {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 5;
    background: rgba(23, 58, 94, 0.88);
    color: #fff;
    border-radius: 999px;
    padding: 0.6em 1.2em;
    font-weight: 700;
    font-size: 1.05rem;
    pointer-events: none;
    text-align: center;
    width: max-content;
    max-width: calc(100% - 1.5rem);
}

/* Pannellum: friendlier loading box */
.pnlm-load-box { border-radius: 16px !important; font-family: var(--font) !important; }
.pnlm-load-box p { font-size: 1.1rem !important; }

/* Leaflet: big, easy zoom buttons */
.leaflet-container { font-family: var(--font); background: #aad3df; }
.leaflet-touch .leaflet-bar a,
.leaflet-bar a {
    width: 3rem !important;
    height: 3rem !important;
    line-height: 3rem !important;
    font-size: 1.8rem !important;
}
.leaflet-control-attribution { font-size: 11px; }

.pin {
    width: 34px;
    height: 46px;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}
.target-pin {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
}

.map-label {
    background: #fff;
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 0.1em 0.6em;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: none;
    white-space: nowrap;
}
.map-label::before { display: none; }

/* ─── Results ─────────────────────────────────────────────────────────── */

.result-card {
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.8rem;
    z-index: 800;
    max-width: 30rem;
    margin: 0 auto;
}
.result-country { font-size: 1.1rem; color: var(--muted); font-weight: 700; margin-bottom: 0.2rem; }
.result-points { font-size: 2.2rem; font-weight: 700; color: var(--go); line-height: 1.1; }
.result-distance { font-size: 1.2rem; font-weight: 700; }

.leaderboard { list-style: none; margin: 0; padding: 0; }
.leaderboard li {
    display: grid;
    grid-template-columns: 2.4rem 1fr auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55em 0.4em;
    border-bottom: 2px solid #eaeef3;
    font-size: 1.1rem;
}
.leaderboard li:last-child { border-bottom: 0; }
.leaderboard li.me { background: #fff4d6; border-radius: 12px; font-weight: 700; }
.leaderboard .rank { font-weight: 700; color: var(--muted); text-align: center; }
.leaderboard .who { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.leaderboard .who span:last-child { overflow-wrap: anywhere; }
.leaderboard .pts { font-weight: 700; font-variant-numeric: tabular-nums; }

.swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    flex: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, 0.2);
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.6rem;
    margin: 1rem 0 1.4rem;
}
.podium .place { flex: 1; max-width: 9rem; text-align: center; }
.podium .block {
    border-radius: 14px 14px 0 0;
    color: #fff;
    font-weight: 700;
    font-size: 1.8rem;
    display: grid;
    place-items: center;
}
.podium .p1 .block { height: 7rem; background: var(--gold); }
.podium .p2 .block { height: 5rem; background: #7c8799; }
.podium .p3 .block { height: 3.8rem; background: #a0603a; }
.podium .name { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.2rem; overflow-wrap: anywhere; }
.podium .score { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.3rem; }

/* ─── Host screen ─────────────────────────────────────────────────────── */

.host-page { max-width: 80rem; margin: 0 auto; padding: 1.2rem 1.5rem 3rem; }

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.7rem;
}
.choice {
    position: relative;
    display: block;
    cursor: pointer;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: block;
    border: 3px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 0.7em 0.9em;
    font-weight: 700;
    min-height: 3.2rem;
}
.choice small { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.choice input:checked + span { border-color: var(--navy); background: var(--amber-soft); box-shadow: inset 0 0 0 2px var(--navy); }
.choice input:focus-visible + span { outline: 4px solid var(--focus); outline-offset: 2px; }
.choice input:disabled + span { opacity: 0.5; cursor: not-allowed; }

.rounds-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.rounds-row .choice span { min-width: 4.2rem; text-align: center; font-size: 1.3rem; }

.lobby {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; } }

.join-panel { text-align: center; }
.join-url { font-size: 1.7rem; font-weight: 700; overflow-wrap: anywhere; }
.join-code {
    font-size: clamp(3.2rem, 6.5vw, 6.5rem);
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    margin: 0.2em 0 0.25em;
    font-variant-numeric: tabular-nums;
    color: var(--brand);
}
.qr {
    display: inline-block;
    background: #fff;
    padding: 12px;
    border-radius: 14px;
    border: 3px solid var(--line);
}
.qr img, .qr canvas { display: block; width: 180px; height: 180px; }

.player-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 999px;
    padding: 0.3em 0.4em 0.3em 0.8em;
    font-weight: 700;
    font-size: 1.05rem;
}
.chip.away { opacity: 0.55; }
.chip.done { border-color: var(--go); background: #ecf8f0; }
.chip .x {
    appearance: none;
    border: 0;
    background: #edf1f6;
    color: var(--ink);
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.host-play {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 1rem;
    height: calc(100dvh - 2.4rem);
}
@media (max-width: 1000px) {
    .host-play { grid-template-columns: 1fr; height: auto; }
    .host-play .stage { height: 60vh; }
}
.host-play .stage {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow);
}
.host-play .stage > .stage-content,
.host-play .stage-content > .pano,
.host-play .stage-content > .map { position: absolute; inset: 0; }
.host-side { display: flex; flex-direction: column; gap: 1rem; min-height: 0; overflow: auto; }
.host-actions {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem 0 0.2rem;
    background: var(--paper);
}
body.host .text-size-toggle { top: auto; bottom: 0.6rem; left: 0.6rem; right: auto; }
body.host.playing .corner-controls { display: none; } /* keep the projector stage clear */

.corner-code {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 900;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 14px;
    padding: 0.4em 0.9em;
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: var(--shadow);
}
.corner-code b { color: var(--brand); font-size: 1.4rem; letter-spacing: 0.04em; }

.progress {
    height: 1.2rem;
    border-radius: 999px;
    background: #edf1f6;
    overflow: hidden;
}
.progress > div { height: 100%; background: var(--go); transition: width 0.4s ease; }

.big-number { font-size: 2.6rem; font-weight: 700; line-height: 1; }

.round-results { list-style: none; margin: 0; padding: 0; }
.round-results li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.4em 0;
    border-bottom: 2px solid #eaeef3;
}
.round-results li:last-child { border-bottom: 0; }
.round-results small { color: var(--muted); display: block; }


/* ─── Shared extras ───────────────────────────────────────────────────── */

.sticky-top { position: sticky; top: 0; z-index: 1000; }

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

.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.8rem; }
.game-choice span { min-height: 5.5rem; padding: 0.9em 1em; }
.game-choice b { display: block; font-size: 1.3rem; margin-bottom: 0.2rem; }

.game-name-pill {
    display: inline-block;
    margin: 0 0 0.5rem;
    background: var(--amber-soft);
    color: var(--navy);
    border: 2px solid #f1cf94;
    border-radius: 999px;
    padding: 0.15em 0.9em;
    font-weight: 700;
}

.pill-soft {
    display: inline-block;
    background: #edf1f6;
    border-radius: 999px;
    padding: 0.25em 0.9em;
    font-weight: 700;
    font-size: 0.95rem;
}

/* ─── GeoQuiz ─────────────────────────────────────────────────────────── */

.reveal-map-wrap { position: relative; height: 52vh; min-height: 16rem; }
.reveal-map-wrap > .map { position: absolute; inset: 0; }

/* ─── Scam Spotter ────────────────────────────────────────────────────── */

.scam-page { padding-bottom: 11rem; }   /* room for the action bar */
.scam-instruction { font-size: 1.25rem; font-weight: 700; margin: 0.2rem 0 0.5rem; }
.scam-goal { margin-bottom: 0.9rem; }

.hint-clue {
    background: #e8efff;
    border: 3px dashed var(--sky);
    border-radius: 14px;
    padding: 0.7em 0.9em;
    margin: 0 0 0.9rem;
    font-size: 1.05rem;
}

.scam-actions {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: var(--paper);
    border-top: 3px solid var(--line);
    padding: 0.6rem 0.9rem calc(0.8rem + env(safe-area-inset-bottom));
}
.scam-actions > * { max-width: 40rem; margin-left: auto; margin-right: auto; }
.scam-count { text-align: center; margin: 0 auto 0.5rem; font-size: 1.1rem; }
.scam-actions .error { margin: 0 auto 0.5rem; }
.scam-buttons { display: flex; gap: 0.7rem; }
.scam-buttons .btn { flex: 1; padding-left: 0.6em; padding-right: 0.6em; white-space: nowrap; }

/* The message itself */
.scam {
    background: #fff;
    border: 2px solid #dde3ea;
    border-radius: 18px;
    overflow: hidden;
    line-height: 1.65;
    box-shadow: 0 6px 18px rgba(23, 58, 94, 0.08);
}
.scam p { margin: 0 0 0.8em; }
.scam p:last-child { margin-bottom: 0; }

.email-head { background: #f3f5f8; padding: 0.8rem 1rem; border-bottom: 2px solid #e3e8ef; }
.email-label { color: var(--muted); }
.email-subject { font-weight: 700; margin-top: 0.35rem; font-size: 1.05em; }
.email-body { padding: 1rem; }

.scam-sms { background: #f4f4f8; }
.sms-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; background: #fff; border-bottom: 2px solid #e5e5ec; }
.sms-avatar { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #d4d4dc; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.sms-label { display: block; color: var(--muted); font-size: 0.85em; }
.sms-from { font-weight: 700; }
.sms-thread { padding: 1rem; }
.sms-bubble {
    background: #e5e5ea;
    border-radius: 20px 20px 20px 6px;
    padding: 0.65rem 0.95rem;
    margin: 0 0 0.6rem;
    max-width: 92%;
}
.sms-note { color: var(--muted); font-size: 0.85em; }

.browser-bar { display: flex; align-items: center; gap: 0.7rem; background: #e8ecf1; padding: 0.55rem 0.8rem; border-bottom: 2px solid #dde3ea; }
.browser-dots { display: flex; gap: 0.3rem; flex: none; }
.browser-dots i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #c8d0da; }
.browser-address { flex: 1; min-width: 0; background: #fff; border-radius: 999px; padding: 0.3em 0.9em; font-size: 0.95em; overflow-wrap: anywhere; }
.web-page { padding: 1rem 1.1rem 1.2rem; }

.b-heading { font-size: 1.35em; line-height: 1.3; margin: 0 0 0.6em; }
.b-link { color: var(--sky); text-decoration: underline; overflow-wrap: anywhere; }
.b-price { font-size: 1.3em; font-weight: 700; color: #b91c1c; }
.b-small { font-size: 0.85em; color: var(--muted); }
.b-button-wrap { margin: 0.4em 0 0.9em; }
.b-button { display: inline-block; background: #1d4ed8; color: #fff; font-weight: 700; border-radius: 10px; padding: 0.45em 1.1em; }
.b-image {
    display: flex; align-items: center; gap: 0.6rem;
    background: #eef1f5; border: 2px dashed #c8d0da; border-radius: 12px;
    min-height: 5rem; padding: 0.8rem 1rem; margin: 0 0 0.9em; color: var(--muted);
}
.b-image-icon { font-size: 1.8rem; }

/* Tappable pieces */
.chunk {
    border-radius: 6px;
    padding: 0.08em 0.12em;
    margin: 0 -0.12em;          /* highlight without widening the gaps between words */
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}
.chunk[role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chunk[role="button"]:hover { background: #fdf3e1; }
.chunk[role="button"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.chunk.is-picked {
    background: #fcd34d;
    color: var(--ink);
    box-shadow: inset 0 -3px 0 #b45309;
}
.b-button .chunk.is-picked, .b-link .chunk.is-picked { color: var(--ink); }

.chunk.is-hinted { outline: 3px dashed var(--sky); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
    .chunk.is-hinted { animation: hint-pulse 1.6s ease-in-out 3; }
}
@keyframes hint-pulse { 50% { outline-color: rgba(29, 78, 216, 0.25); } }

/* The reveal */
.chunk.is-flag { background: #fde2e2; box-shadow: inset 0 -3px 0 #dc2626; }
.chunk.is-found { background: #d9f5e1; box-shadow: inset 0 -3px 0 #15803d; }
.chunk.is-missed { background: #fde2e2; box-shadow: inset 0 -3px 0 #dc2626; }
.chunk.is-wrong { background: #ececec; color: #555; text-decoration: line-through; text-decoration-color: #999; }
.b-button .chunk.is-flag, .b-button .chunk.is-found, .b-button .chunk.is-missed { color: var(--ink); }

.flag-badge {
    display: inline-grid; place-items: center;
    width: 1.5em; height: 1.5em; margin-left: 0.15em;
    border-radius: 50%;
    background: #b91c1c; color: #fff;
    font-size: 0.72em; font-weight: 700; line-height: 1;
    vertical-align: super;
}

.reveal-key { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0 0; font-size: 0.95rem; }
.key { border-radius: 6px; padding: 0.1em 0.5em; font-weight: 700; }
.key-found { background: #d9f5e1; box-shadow: inset 0 -3px 0 #15803d; }
.key-missed { background: #fde2e2; box-shadow: inset 0 -3px 0 #dc2626; }
.key-wrong { background: #ececec; text-decoration: line-through; color: #555; }

.flag-list { list-style: none; margin: 0; padding: 0; }
.flag-list li { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.7rem; padding: 0.75rem 0; border-bottom: 2px solid #eaeef3; }
.flag-list li:last-child { border-bottom: 0; }
.flag-list p { margin: 0.3rem 0 0; }
.flag-num {
    width: 2.1rem; height: 2.1rem; border-radius: 50%;
    background: #b91c1c; color: #fff; font-weight: 700;
    display: grid; place-items: center;
}
.flag-status { display: inline-block; margin-left: 0.3rem; font-size: 0.85rem; font-weight: 700; border-radius: 999px; padding: 0.1em 0.7em; background: #edf1f6; }
.flag-status.found { background: #d9f5e1; color: #14532d; }
.flag-status.missed { background: #fde2e2; color: #7f1d1d; }

/* Host: the scam on the big screen */
.host-play .stage:has(.scam-stage) { background: var(--paper); }
.scam-stage {
    position: absolute; inset: 0;
    overflow: auto;
    padding: 4.2rem 2rem 2rem;
    font-size: 1.3rem;
    background: var(--paper);
}
.scam-stage .scam { max-width: 48rem; margin: 0 auto; }
.scam-stage-title { text-align: center; font-size: 1.5rem; margin: 0 0 1rem; }

/* ───────────────────────────────────────────────────────────────────────
   Signing in, the host's account bar, and the Scam Spotter quizzes page
   ─────────────────────────────────────────────────────────────────────── */

.page.wide { max-width: 72rem; }

.account-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.2rem;
    margin: -0.4rem 0 1rem;
    font-size: 1rem;
}
.account-bar a { color: var(--sky); font-weight: 700; }
.account-bar .link-btn { padding: 0; }

.notice {
    background: #fff4d6;
    border: 3px solid #f2cf73;
    border-radius: 14px;
    padding: 0.8em 1em;
    margin: 0 0 1rem;
    font-weight: 700;
}
.notice.notice-ok { background: #e3f6e8; border-color: #9ad5ab; }

.show-password { display: inline-flex; align-items: center; gap: 0.4em; margin-top: 0.5em; font-size: 1rem; cursor: pointer; }
.show-password input { width: 1.3em; height: 1.3em; }

.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; }
.row-between h1, .row-between h2 { margin: 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.btn.danger { background: var(--danger); box-shadow: 0 4px 0 #7f1d1d; }
.btn.chosen { background: var(--ink); box-shadow: 0 3px 0 #000; }
.confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.status-pill { display: inline-block; border-radius: 999px; padding: 0.15em 0.8em; font-size: 0.9rem; font-weight: 700; margin-left: 0.3rem; }
.status-pill.draft { background: #edf1f6; color: var(--ink); }
.status-pill.published { background: #d9f5e1; color: #14532d; }

.quiz-list, .scam-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.quiz-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.2rem;
}
.quiz-card-main { flex: 1 1 18rem; }
.quiz-card h3 { font-size: 1.3rem; margin: 0 0 0.2em; }
.quiz-card h3 a { color: var(--ink); }
.quiz-card p { margin: 0.2em 0 0; }
.empty-state p:last-child { margin-bottom: 0; }

.scam-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 1rem 1.2rem; }
.scam-row-main { display: flex; gap: 0.8rem; align-items: flex-start; flex: 1 1 16rem; }
.scam-row-num {
    flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%;
    display: grid; place-items: center; background: #edf1f6; font-weight: 700;
}
.problem { color: #7f1d1d; font-weight: 700; margin-top: 0.3em; }
.scam-list details summary { cursor: pointer; padding: 0.2rem 0; }
.scam-preview { margin-top: 1rem; display: grid; gap: 1rem; }

/* Host setup: choosing a quiz */
.quiz-group { display: grid; gap: 0.6rem; }
.quiz-group-title { font-weight: 700; margin: 1.1rem 0 0.4rem; }
.quiz-choice span { display: block; }
.scam-kinds { margin: 0.2rem 0 0.4rem 1.2rem; padding-left: 0.9rem; border-left: 4px solid var(--line); }

/* The scam editor */
.editor { display: grid; gap: 1.2rem; align-items: start; }
@media (min-width: 960px) {
    .editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .editor-side { position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 0 0.3rem 0.5rem; }
}
.editor-step { display: flex; align-items: center; gap: 0.6rem; font-size: 1.35rem; margin: 0; }
.editor-step span {
    flex: none; width: 2rem; height: 2rem; border-radius: 50%;
    display: grid; place-items: center; background: var(--amber); color: var(--navy); font-size: 1.05rem;
}
.editor textarea.text { width: 100%; min-height: 5.5rem; padding: 0.5em 0.75em; border: 3px solid #8a95a5; border-radius: 14px; font: inherit; color: var(--ink); resize: vertical; }
.editor textarea.text:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25); }
.editor code, .editor kbd { background: #edf1f6; border-radius: 6px; padding: 0.05em 0.35em; font-family: inherit; font-weight: 700; }

.block-editor, .flag-editor { border: 3px solid var(--line); border-radius: 14px; padding: 0.8rem; display: grid; gap: 0.5rem; }
.block-editor-top { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; }
.block-editor-top .field-label { margin: 0; }
.block-editor-top select.text { width: auto; min-height: 2.6rem; font-size: 1rem; }
.block-editor-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.flag-editor { border-color: #f3b4b4; background: #fffafa; }
.flag-editor .field-label { margin: 0.3rem 0 0; font-size: 1.02rem; }
.flag-editor .btn { justify-self: start; }
.flag-editor-top { display: flex; gap: 0.6rem; align-items: center; }
.flag-words { font-weight: 700; }

.editor-preview-title { font-weight: 700; margin: 0 0 0.5rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.pill-soft.warn { background: #fde2e2; color: #7f1d1d; }
.editor-preview .chunk { outline: 2px dashed #a9b3c0; outline-offset: 1px; }
.editor-preview .chunk.is-picked { outline: 4px solid var(--focus); }
.assign-panel {
    margin-top: 0.8rem;
    background: var(--card);
    border: 3px solid var(--focus);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}
.assign-words { font-weight: 700; font-size: 1.15rem; margin: 0 0 0.3rem; }
.assign-question { margin: 0 0 0.5rem; }
.assign-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.editor-actions { margin-top: 1rem; display: grid; gap: 0.5rem; }
.editor-actions .link-btn { justify-self: center; }
.todo-title { font-weight: 700; margin: 0; }
.todo { margin: 0.3rem 0 0; padding-left: 1.3rem; }
.todo li { margin: 0.25rem 0; }
.todo.urgent { color: #7f1d1d; font-weight: 700; }
.ready { color: var(--go-dark); font-weight: 700; margin: 0; }

/* ─── Logo ────────────────────────────────────────────────────────────── */

.site-logo { display: flex; align-items: center; min-height: 3rem; margin: 0.2rem 0 1rem; }
.site-logo img { display: block; height: 3rem; width: auto; max-width: 16rem; }
.center .site-logo, .site-logo.center { justify-content: center; }
.site-logo .wordmark { font-family: var(--heading-font); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--navy); line-height: 1.1; }
.site-logo .wordmark span { display: block; font-size: 0.62rem; letter-spacing: 0.42em; font-weight: 700; text-transform: uppercase; }
.join-panel .site-logo { justify-content: center; margin-bottom: 0.6rem; }
.join-panel .site-logo img { height: 3.6rem; }

.powered-by {
    position: fixed; right: 0.8rem; bottom: 0.8rem; z-index: 800;
    display: flex; align-items: center; gap: 0.5rem;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: 0.3rem 0.9rem; font-size: 0.8rem; color: var(--muted);
    box-shadow: 0 4px 14px rgba(23, 58, 94, 0.08);
}
.powered-by img { height: 1.4rem; width: auto; display: block; }
.powered-by .wordmark { font-weight: 800; color: var(--navy); }
/* Leave room for the "Bigger text" button in the top corner */
.page > .site-logo { padding-right: 8.5rem; }
.page > .site-logo img { max-width: 100%; }
