/* City Lag — mobile-first base styles */
@font-face {
  font-family: "Archivo Black";
  src: url("../fonts/archivo-black.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #0b1526;
  --line-teal: #14b8a6;
  --line-pink: #ec4899;
  --line-purple: #8b5cf6;
  --line-yellow: #fbbf24;
  --display: "Archivo Black", system-ui, sans-serif;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #14b8a6;
  --accent-ink: #ffffff;
  --ok: #16a34a;
  --danger: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: inherit; }
h1, h2 { line-height: 1.15; margin: 0 0 .5em; }
h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; }
h1 { font-size: 1.7rem; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top));
  background: var(--ink); color: #fff;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--line-teal) 0 25%, var(--line-pink) 25% 50%, var(--line-purple) 50% 75%, var(--line-yellow) 75%) 1;
}
.brand { display: flex; align-items: center; }
.brand img { height: 30px; width: auto; display: block; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar nav a, .topbar .linkish { color: #fff; text-decoration: none; font-size: .95rem; }

.container { max-width: 880px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }

/* Cards & layout */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 420px; margin: 1rem auto; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 > .card { margin-bottom: 0; } .grid-2 { margin-bottom: 1rem; } }
.row { display: flex; gap: .6rem; align-items: flex-end; }
.row > label { flex: 1; }
.row.wrap { flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.inline { display: inline; }

/* Forms */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
label small { font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
input, select {
  font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
fieldset { border: 0; padding: 1.1rem; margin: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .9rem; }
legend { font-weight: 800; font-size: 1.05rem; padding: 0; float: left; width: 100%; margin-bottom: .2rem; }
legend + * { clear: both; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; }

.modes { display: grid; gap: .6rem; }
@media (min-width: 560px) { .modes { grid-template-columns: 1fr 1fr; } }
.mode { border: 2px solid var(--line); border-radius: 10px; padding: .7rem .8rem; cursor: pointer; font-weight: 400; }
.mode:has(input:checked) { border-color: var(--ink); }
.mode input { position: absolute; opacity: 0; }
.mode.disabled { opacity: .5; cursor: not-allowed; }

/* Buttons */
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: .4rem;
  font: inherit; font-weight: 700; padding: .65rem 1.1rem; border-radius: 10px;
  border: 1px solid var(--ink); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-small { padding: .3rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; padding: .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; color: inherit; }
.linkish.danger { color: var(--danger); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }

/* Flash */
.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: #dcfce7; color: #14532d; }
.flash-error { background: #fee2e2; color: #7f1d1d; }

/* Lists & badges */
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a { text-decoration: none; display: flex; flex-direction: column; }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .15rem .5rem; border-radius: 99px; background: var(--line); color: var(--ink); white-space: nowrap; }
.badge-running, .badge-halftime { background: #dcfce7; color: #14532d; }
.badge-lobby { background: #fef3c7; color: #78350f; }
.badge-finished { background: #e0e7ff; color: #312e81; }

/* Hero */
.hero { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 2rem 1.4rem; margin-bottom: 1rem; }
.hero-logo { width: min(100%, 420px); height: auto; display: block; margin: 0 0 1.6rem; }
.hero h1 { font-size: 1.9rem; }
.hero p { font-size: 1.05rem; max-width: 36em; color: #cbd5e1; }
.hero a { color: #fff; }
.hero .btn { border-color: #fff; background: transparent; color: #fff; }
.hero .btn-primary { background: var(--line-teal); border-color: var(--line-teal); color: var(--ink); }

/* Lobby */
.lobby-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.join-code { background: var(--ink); color: #fff; border-radius: var(--radius); padding: .7rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.join-code strong { font-size: 1.8rem; letter-spacing: .25em; font-family: ui-monospace, monospace; }
.join-code .btn { background: transparent; color: #fff; border-color: #fff; }
.settings { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
.settings dt { color: var(--muted); }
.settings dd { margin: 0; font-weight: 600; }
.pair-form select { width: auto; flex: 1 1 8rem; }

/* Rules */
.rules .lead { font-size: 1.1rem; }
.rules section { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin-bottom: 1rem; scroll-margin-top: 4.5rem; }
.rules li { margin-bottom: .35rem; }
.toc { margin: 0 0 1.2rem; font-size: .92rem; }
.states { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; align-items: start; }
.states dt { font-weight: 700; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.states dd { margin: 0; }
.swatch { width: 1.1rem; height: 1.1rem; border-radius: 4px; border: 2px solid #1d4ed8; display: inline-block; }
.swatch.locked { background: #9ca3af; border-color: #6b7280; }
.swatch.unlocked { background: #fff; border-color: #6b7280; border-style: dashed; }
.swatch.claimed { background: repeating-linear-gradient(45deg, #1d4ed8 0 3px, #bfdbfe 3px 7px); }
.swatch.owned { background: #1d4ed8; }

/* Footer & fan-game notice */
.site-footer { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.site-footer p { margin: 0 0 .5rem; }
.fan-note { background: #fff7e6; border-left: 4px solid var(--line-yellow); padding: .8rem 1rem; border-radius: 8px; font-size: .95rem; }

/* ---------- Admin & contributor spaces ---------- */
.container:has(.challenge-form) { max-width: 1120px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.eyebrow { margin: 0 0 .2rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.eyebrow a { text-decoration: none; }
.section-title { margin: 1.6rem 0 .8rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.stats > div { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .7rem .8rem; display: flex; flex-direction: column; }
.stats strong { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.1; }
.stats span { color: var(--muted); font-size: .8rem; }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input { flex: 1 1 12rem; width: auto; }
.filters select { width: auto; }

.admin-list { list-style: none; padding: 0; margin: 0 0 1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-list li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.admin-list li:last-child { border-bottom: 0; }
.admin-list .who { display: flex; flex-direction: column; min-width: 0; }
.admin-list .who span { overflow: hidden; text-overflow: ellipsis; }
.admin-list li.is-removed .who { opacity: .55; }
.actions-inline { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.role-form select { width: auto; padding: .35rem .5rem; font-weight: 700; font-size: .85rem; }
.role-form select.role-admin { border-color: var(--line-purple); color: #5b21b6; }
.role-form select.role-contributor { border-color: var(--line-teal); color: #0f766e; }
.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.15); padding: .5rem .8rem; display: flex; flex-direction: column; gap: .5rem; white-space: nowrap; }
.more-menu .linkish { text-decoration: none; font-weight: 600; }
.badge-removed, .badge-archived { background: #f3f4f6; color: #6b7280; }
.badge-draft { background: #fef3c7; color: #78350f; }
.badge-published { background: #dcfce7; color: #14532d; }

/* Challenge list */
.challenge-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.challenge-list a { display: flex; flex-direction: column; gap: .3rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; text-decoration: none; border-left: 4px solid var(--line); }
.challenge-list a:hover { border-left-color: var(--line-teal); }
.challenge-list .row-top { display: flex; justify-content: space-between; gap: .6rem; align-items: center; }
.challenge-list .desc { color: #374151; }
.challenge-list .meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.tag { font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 6px; background: #f1f5f9; color: #334155; }
.tag-spot { background: #fce7f3; color: #9d174d; }
.tag-zones { background: #ede9fe; color: #5b21b6; }
.tag-city { background: #ccfbf1; color: #115e59; }
.empty { text-align: center; padding: 2rem 1rem; }

/* Challenge form */
.challenge-form { display: grid; gap: 1.2rem; align-items: start; }
@media (min-width: 960px) { .challenge-form { grid-template-columns: minmax(0, 1fr) 340px; } .cf-side { position: sticky; top: 4.5rem; } }
textarea { font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; resize: vertical; }
textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.counter { align-self: flex-end; font-weight: 400; font-size: .75rem; color: var(--muted); margin-top: -.15rem; }
.counter.near { color: var(--danger); }
.choice-grid { display: grid; gap: .5rem; }
@media (min-width: 560px) { .choice-grid { grid-template-columns: 1fr 1fr; } .choice-grid.three { grid-template-columns: repeat(3, 1fr); } }
.choice { border: 2px solid var(--line); border-radius: 10px; padding: .6rem .75rem; cursor: pointer; font-weight: 400; gap: .15rem; position: relative; }
.choice:has(input:checked) { border-color: var(--ink); background: #f8fafc; }
.choice input { position: absolute; opacity: 0; }
.choice small { color: var(--muted); line-height: 1.35; }
.label { font-weight: 600; margin: 0 0 .4rem; }
.zone-group { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .5rem; }
.zone-group > span { width: 100%; }
.zone-chip { flex-direction: row; font-weight: 600; }
.zone-chip input { position: absolute; opacity: 0; }
.zone-chip span { display: inline-block; min-width: 2.6rem; text-align: center; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; cursor: pointer; background: #fff; }
.zone-chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.zone-chip input:focus-visible + span { outline: 2px solid var(--line-teal); }

/* Challenge card (preview + guide) */
.challenge-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; border-top: 5px solid var(--line-teal); }
.challenge-card header { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.challenge-card h2, .challenge-card h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1.25rem; margin: 0 0 .4rem; overflow-wrap: anywhere; }
.pv-short { font-size: 1.02rem; margin: 0 0 .6rem; overflow-wrap: anywhere; }
.challenge-card details { background: #f8fafc; border-radius: 8px; padding: .5rem .7rem; font-size: .9rem; }
.challenge-card summary { font-weight: 700; cursor: pointer; }
.pv-fine { margin-top: .4rem; color: #374151; overflow-wrap: anywhere; }
.pv-tools { margin: .7rem 0 0; font-size: .82rem; color: var(--muted); }
.tips { margin-top: 1rem; background: #fff7e6; border-left: 4px solid var(--line-yellow); border-radius: 8px; padding: .7rem 1rem; font-size: .88rem; }
.tips h3 { margin: 0 0 .3rem; font-size: .95rem; }
.tips ul { margin: 0; padding-left: 1.1rem; }

.principles li { margin-bottom: .4rem; }
.example-grid { display: grid; gap: .8rem; }
@media (min-width: 720px) { .example-grid { grid-template-columns: 1fr 1fr; } }
.challenge-card.good .why { margin: .7rem 0 0; font-size: .88rem; color: #14532d; background: #f0fdf4; border-radius: 8px; padding: .5rem .7rem; }
.bad-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.bad-list li { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem; border-left: 4px solid var(--danger); }
.bad-list p { margin: .2rem 0; }
.bad-title { font-weight: 700; font-size: 1.05rem; color: var(--danger); }
.bad-list .fix { color: #14532d; }

/* Narrow screens: compact header, wrapping forms */
.brand .brand-icon { display: none; }
@media (max-width: 560px) {
  /* the links fold into the menu, so the full logo fits again */
  .topbar nav { gap: .8rem; }
  .topbar nav a, .topbar .linkish { font-size: .88rem; }
}
.new-user > label { flex: 1 1 11rem; }
.new-user > .btn { align-self: flex-end; }

/* =====================================================================
   THEME — "broadcast sticker": bold game-show graphics, our own way.
   Hard offset shadows + thick ink outlines (sticker look), uppercase
   display type, the 4 loop colours as category colours, a faint transit
   grid as paper. Overrides the base styles above.
   ===================================================================== */
:root {
  --bg: #e9eef5;
  --line: #cfd8e3;
  --stroke: 2.5px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --pop-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --scope-anywhere: var(--line-yellow);
  --scope-city: var(--line-teal);
  --scope-zones: var(--line-purple);
  --scope-spot: var(--line-pink);
}
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(11,21,38,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,21,38,.045) 1px, transparent 1px);
  background-size: 28px 28px;
}
h1, .section-title, .card h2, legend, .g-panel h2 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em;
}
.card h2, legend { font-size: 1.05rem; }

/* Sticker surfaces */
.card, fieldset, .stats > div, .admin-list, .challenge-list a, .bad-list li, .rules section, .challenge-card {
  border: var(--stroke); box-shadow: var(--pop); border-radius: var(--radius);
}
.challenge-list a { border-left-width: 2.5px; }
.challenge-list a:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); border-left-color: var(--ink); }
.challenge-list a { transition: transform .12s, box-shadow .12s; }

/* Buttons: chunky stickers that press down */
.btn {
  border: var(--stroke); box-shadow: var(--pop-sm); border-radius: 12px; text-transform: uppercase;
  letter-spacing: .03em; font-size: .9rem; transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--line-teal); color: var(--ink); }
.btn-danger { background: #fff; }
.btn-small { box-shadow: 2px 2px 0 var(--ink); font-size: .75rem; border-width: 2px; }
.topbar .btn, .join-code .btn { box-shadow: none; }

/* Inputs */
input, select, textarea { border: 2px solid var(--ink); border-radius: 10px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--line-teal); outline-offset: 0; }
.choice, .mode { border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); background: #fff; }
.choice:has(input:checked), .mode:has(input:checked) { background: #ccfbf1; box-shadow: 0 0 0 var(--ink); transform: translate(2px, 2px); }

/* Labels like map station tags */
.badge { border-radius: 6px; font-family: var(--display); font-weight: 400; letter-spacing: .04em; padding: .2rem .55rem; }
.tag { border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; }
.tag-anywhere { background: var(--scope-anywhere); color: var(--ink); }
.tag-city { background: var(--scope-city); color: var(--ink); }
.tag-zones { background: var(--scope-zones); color: #fff; }
.tag-spot { background: var(--scope-spot); color: #fff; }
.eyebrow { display: inline-block; background: var(--ink); color: #fff; padding: .15rem .55rem; border-radius: 5px; }
.eyebrow a { color: #fff; }

/* Banner headings: a tilted strip, like a broadcast lower third */
.page-head h1, .hero h1 { position: relative; }
.page-head h1::after {
  content: ""; display: block; height: 6px; width: 72px; margin-top: .35rem; border-radius: 3px;
  background: linear-gradient(90deg, var(--line-teal) 0 25%, var(--line-pink) 25% 50%, var(--line-purple) 50% 75%, var(--line-yellow) 75%);
}

/* Hero */
.hero { border: var(--stroke); box-shadow: 6px 6px 0 var(--line-teal); overflow: hidden; position: relative; }
.hero::before {
  content: none; position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background:
    linear-gradient(90deg, transparent 49%, var(--line-pink) 49% 51%, transparent 51%) 0 0 / 220px 100%,
    linear-gradient(0deg, transparent 49%, var(--line-yellow) 49% 51%, transparent 51%) 0 0 / 100% 160px;
}
.hero > * { position: relative; }
.hero .btn-primary { box-shadow: 3px 3px 0 #fff; border-color: #fff; }
.hero .btn { box-shadow: 3px 3px 0 #fff; }

/* Join code, like a departure board */
.join-code { border: var(--stroke); box-shadow: var(--pop); }
.join-code strong { color: var(--line-yellow); }

/* Challenge card = a playing card, colour band by scope */
.challenge-card { border-top-width: 2.5px; padding: 0; overflow: hidden; background: #fff; }
.challenge-card header {
  margin: 0; padding: .55rem .8rem; background: var(--scope-zones); border-bottom: var(--stroke);
}
.challenge-card[data-scope="anywhere"] header { background: var(--scope-anywhere); }
.challenge-card[data-scope="city"] header { background: var(--scope-city); }
.challenge-card[data-scope="spot"] header { background: var(--scope-spot); }
.challenge-card header .badge { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.challenge-card > :not(header) { margin-left: 1rem; margin-right: 1rem; }
.challenge-card h2, .challenge-card h3 { margin-top: .8rem; font-size: 1.35rem; line-height: 1.1; }
.challenge-card details { border: 1.5px dashed var(--ink); background: #f8fafc; }
.challenge-card > :last-child { margin-bottom: 1rem; }
.challenge-card .reward { font-family: var(--display); text-transform: uppercase; font-size: .8rem; letter-spacing: .04em; margin: .2rem 1rem .5rem; color: var(--ink); }
.challenge-card .reward span { background: var(--line-yellow); padding: .05rem .35rem; border-radius: 4px; }
.challenge-card.good .why { border: 1.5px solid #14532d; }

.tips { border: 2px solid var(--ink); box-shadow: var(--pop-sm); border-left-width: 8px; }
.fan-note { border: 2px solid var(--ink); border-left-width: 8px; }
.flash { border: 2px solid var(--ink); box-shadow: var(--pop-sm); }
.stats strong { font-size: 1.8rem; }
.zone-chip span { border: 2px solid var(--ink); }
.site-footer { border-top: 2px solid var(--ink); }
.challenge-card.good .why { margin: .7rem 1rem 1rem; }

/* Flat icons (sprite) */
.ic { width: 1.15em; height: 1.15em; fill: currentColor; vertical-align: -.18em; flex-shrink: 0; }
.ic-lg { width: 1.6em; height: 1.6em; }

.h-icon { width: 1.25em; height: 1.25em; vertical-align: -.22em; margin-right: .2rem; color: var(--line-purple); }
.h-icon.good { color: #16a34a; } .h-icon.bad { color: var(--danger); }
.btn .ic { width: 1.1em; height: 1.1em; }
.pv-tools .ic { vertical-align: -.2em; }
.home-alert { display: flex; align-items: center; gap: .8rem; background: var(--line-yellow); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); padding: .8rem 1rem; margin-bottom: 1rem; text-decoration: none; }
.home-alert .ic { width: 1.8rem; height: 1.8rem; }
.home-alert span { flex: 1; display: flex; flex-direction: column; }
.home-alert small { text-transform: uppercase; font-weight: 700; font-size: .72rem; letter-spacing: .06em; }
.home-alert strong { font-family: var(--display); font-weight: 400; text-transform: uppercase; }

/* ---------- Header: links on desktop, drop-down menu on mobile ---------- */
.menu-toggle { display: none; }
.topbar nav a, .topbar nav .linkish { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; }
.topbar nav .ic { display: none; }
.nav-user, .topbar nav a[href="/"] { display: none !important; }
@media (max-width: 720px) {
  .topbar { position: sticky; }
  .menu-toggle {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
    background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.6);
  }
  .menu-toggle .ic { width: 1.4rem; height: 1.4rem; }
  .menu-toggle .ic-close, .menu-open .menu-toggle .ic-open { display: none; }
  .menu-open .menu-toggle .ic-close { display: block; }
  .menu-open .menu-toggle { background: #fff; color: var(--ink); }
  .topbar nav {
    display: none; position: absolute; top: calc(100% + 4px); right: .6rem; left: .6rem; z-index: 50;
    flex-direction: column; align-items: stretch; gap: 0; padding: .4rem;
    background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink);
  }
  .menu-open nav { display: flex; }
  .topbar nav a, .topbar nav .linkish, .topbar nav form { width: 100%; }
  .topbar nav a, .topbar nav .linkish {
    color: var(--ink); font-size: 1rem; font-weight: 700; padding: .75rem .8rem; border-radius: 10px; text-decoration: none;
  }
  .topbar nav a:active, .topbar nav .linkish:active, .topbar nav a:hover { background: #f1f5f9; }
  .topbar nav .ic { display: inline-block; width: 1.3rem; height: 1.3rem; color: var(--line-purple); }
  .topbar nav .linkish { color: var(--danger); }
  .topbar nav .linkish .ic { color: var(--danger); }
  .nav-user, .topbar nav a[href="/"] { display: flex !important; }
  .nav-user { align-items: center; gap: .4rem; padding: .6rem .8rem .7rem; margin-bottom: .3rem; border-bottom: 2px dashed var(--line); font-weight: 700; color: var(--muted); }
  .nav-user .ic { display: inline-block; width: 1.3rem; height: 1.3rem; }
}

/* =====================================================================
   PLAYING CARDS — challenges look like cards dealt in a game show.
   Our own take: a metro "station" emblem, corner indices in the scope
   colour, a frame inside the card, a navy back with the loop.
   ===================================================================== */
.challenge-card {
  --sc: var(--scope-zones);
  position: relative; max-width: 420px; margin-inline: auto; padding: 1.4rem 1.3rem 1.3rem;
  background: #fff; border: 3px solid var(--ink); border-top-width: 3px; border-radius: 22px; box-shadow: 6px 6px 0 var(--ink);
  overflow: visible;
}
.challenge-card[data-scope="anywhere"] { --sc: var(--scope-anywhere); }
.challenge-card[data-scope="city"] { --sc: var(--scope-city); }
.challenge-card[data-scope="zones"] { --sc: var(--scope-zones); }
.challenge-card[data-scope="spot"] { --sc: var(--scope-spot); }
.challenge-card::before {
  content: ""; position: absolute; inset: 8px; border: 2.5px solid var(--sc); border-radius: 15px; pointer-events: none;
}
.challenge-card > * { position: relative; }
.challenge-card > :not(header) { margin-left: 0; margin-right: 0; }

/* Corner indices, like a real card */
.cc-corner { position: absolute; display: flex; flex-direction: column; align-items: center; color: var(--sc); line-height: 1; }
.cc-corner .ic { width: 1.25rem; height: 1.25rem; filter: drop-shadow(1px 1px 0 var(--ink)); }
.cc-corner.tl { top: 16px; left: 16px; }
.cc-corner.br { bottom: 16px; right: 16px; transform: rotate(180deg); }

/* Emblem: a big metro station */
.cc-emblem {
  width: 88px; height: 88px; margin: .2rem auto .7rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--sc); border: 3px solid var(--ink); box-shadow: inset 0 0 0 7px #fff, 3px 3px 0 var(--ink);
}
.cc-emblem .ic { width: 38px; height: 38px; color: var(--ink); }
.challenge-card[data-scope="zones"] .cc-emblem .ic, .challenge-card[data-scope="spot"] .cc-emblem .ic { color: #fff; filter: drop-shadow(1.5px 1.5px 0 var(--ink)); }

.challenge-card header { background: none !important; border: 0 !important; padding: 0 !important; margin: 0 0 .5rem !important; justify-content: center; display: flex; flex-wrap: wrap; gap: .35rem; }
.challenge-card header .badge { background: #fff; border: 1.5px solid var(--ink); }
.challenge-card h2, .challenge-card h3 { text-align: center; font-size: 1.55rem; line-height: 1.05; margin: .3rem 0 .45rem; }
.challenge-card .reward { text-align: center; margin: 0 0 .8rem; }
.challenge-card .pv-short { text-align: center; font-size: 1.05rem; }
.challenge-card details { margin-top: .4rem; text-align: left; }
.challenge-card .pv-tools { text-align: center; }
.challenge-card.good .why { margin: .8rem 0 .4rem; }
.example-grid .challenge-card { max-width: none; }

/* Card back + flip reveal */
.card-back {
  max-width: 420px; min-height: 440px; margin-inline: auto; border-radius: 22px; position: relative;
  background: var(--ink); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  display: grid; place-items: center; text-align: center; color: #fff; overflow: hidden;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 10px, transparent 10px 20px);
}
.card-back::before {
  content: ""; position: absolute; inset: 10px; border-radius: 15px; border: 4px solid transparent;
  background: linear-gradient(90deg, var(--line-teal), var(--line-pink), var(--line-purple), var(--line-yellow)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card-back img { width: 110px; height: 110px; }
.card-back p { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; margin: .6rem 0 0; font-size: 1.1rem; }
.flip-out { animation: flipOut .45s ease-in forwards; }
.flip-in { animation: flipIn .5s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes flipOut { to { transform: perspective(900px) rotateY(90deg); } }
@keyframes flipIn { from { transform: perspective(900px) rotateY(-90deg); } to { transform: perspective(900px) rotateY(0); } }
@media (prefers-reduced-motion: reduce) { .flip-out, .flip-in { animation: none; } }
.challenge-card > .cc-corner { position: absolute; }
.challenge-card > .cc-emblem { margin: .2rem auto .7rem; }
.challenge-card > .ch-timer { margin-left: auto; margin-right: auto; }
.challenge-card { padding-bottom: 2.4rem; }

/* Mobile menu: float above a dimmed page instead of sitting on the content */
@media (max-width: 720px) {
  .topbar nav { top: calc(100% + 12px); left: .9rem; right: .9rem; padding: .6rem; gap: .15rem; z-index: 60; }
  .topbar::after {
    content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none;
    background: rgba(11, 21, 38, .55); opacity: 0; transition: opacity .15s;
  }
  .topbar.menu-open::after { opacity: 1; pointer-events: auto; top: var(--bar-h, 64px); }
  .topbar nav a, .topbar nav .linkish { padding: .85rem .9rem; }
  .nav-user { padding: .5rem .9rem .8rem; margin-bottom: .35rem; }
  .topbar.menu-open nav { animation: menuIn .15s ease-out; }
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } }

/* Bot trap: off-screen, never seen by people */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
label.check span { font-weight: 500; }

/* Legal pages & account */
.lang-note { font-size: .85rem; color: var(--muted); margin: 0 0 .4rem; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: .5rem .4rem; border-bottom: 1px solid var(--line); }
.legal-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
@media (max-width: 560px) { .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; } .legal-table tr:first-child { display: none; } .legal-table td:first-child { font-weight: 700; padding-top: .8rem; } .legal-table td { border: 0; padding: .15rem 0; } }
.danger-zone { border-color: var(--danger) !important; box-shadow: 4px 4px 0 var(--danger) !important; }
@media (max-width: 720px) { .topbar nav .nav-account { display: none !important; } }
.topbar nav a.nav-user { text-decoration: none; }

.badge-test { background: var(--line-yellow); color: var(--ink); }

.test-box { border: 2.5px dashed var(--ink); border-radius: 12px; padding: .8rem; background: repeating-linear-gradient(45deg, #fffbea 0 12px, #fff 12px 24px); }
