@font-face { font-family: "PressStart"; src: url(/vendor/press-start.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Pixelify"; src: url(/vendor/pixelify.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixelify"; src: url(/vendor/pixelify-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Pixelify"; src: url(/vendor/pixelify-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Pixelify"; src: url(/vendor/pixelify-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Emerald menu palette */
  --bg: #2c4a7a; --bg2: #3b64a8; --panel: #f8f8f8; --ink: #303030; --ink2: #6c6c6c; --line: #303030;
  --accent: #357f43; --accent2: #f8b030; --red: #e05048; --blue: #4880d8; --gold: #e8b828;
  --ace: #e05048; --rotation: #4880d8; --bench: #888; --extra: #a060c8;
  --radius: 10px;
  /* Theme colours (Preferences → LOOK; public/themes.js sets them on <html>). These defaults are the Classic look. */
  --stripe: rgba(255,255,255,.035); --on-bg: #fff; --on-bg2: #e6eefc; --title-shadow: #1a2c4a;
  --bar: #1f3864; --deep: #101c34; --on-bar: #fff; --bar-ink: #dfe7f7; --tab-ink: #c8d8f0; --bar-fine: #9fb3d9;
  --ring: #c8d8f0; --on-accent: #fff; --sel: #3b64a8; --selbg: #e6eefc; --selbg2: #eef3fd; --link: #4880d8; --strong: #1f3864;
  --hi: #ffd75e; --hi-ink: #1d2340; --focus: #f0b400; --back: #ffd84a; --card: #fff; --cream: #f4f1e8;
  --mute1: #6b6f86; --mute2: #5b6280; --mute3: #4b4f66; --side: #0d1830; --side1: #12203f; --side2: #0b1428;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Pixelify", ui-monospace, monospace; font-weight: 500; font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; font-size: 17px; color: var(--ink); line-height: 1.35;
  background: var(--bg) repeating-linear-gradient(45deg, transparent 0 14px, var(--stripe) 14px 28px);
  -webkit-font-smoothing: none; padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
img.px { image-rendering: pixelated; }
h1, h2, h3, .title, .tabs button, .pt-btn { font-family: "PressStart", monospace; font-weight: 400; letter-spacing: .5px; }
/* Press Start has one weight; a hairline stroke in the text's own colour makes it read heavier without blurring. */
h1, h2, h3, .title, .tabs button, .pt-btn, .px, [style*="PressStart"] { -webkit-text-stroke: .35px currentColor; }
b, strong { font-weight: 700; }
h1 { font-size: 13px; margin: 0; color: var(--on-bar); text-shadow: 2px 2px 0 var(--title-shadow); }
h2 { font-size: 11px; margin: 0 0 10px; }
h3 { font-size: 10px; margin: 0 0 8px; color: var(--ink2); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }

header.top {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--bar); border-bottom: 4px solid var(--deep);
}
header.top select { max-width: 52vw; background: var(--panel); border: 3px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 15px; }
.hdr-link { all: unset; cursor: pointer; color: var(--bar-ink); font-size: 14px; padding: 8px; border-radius: 6px; }
.hdr-link:hover, .hdr-link:focus-visible { background: rgba(255,255,255,.12); }
@media (max-width: 560px) { .hdr-link[href="/guide"] { display: none; } }
.sync { display: flex; align-items: center; gap: 6px; color: var(--on-bar); font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #777; box-shadow: 0 0 0 2px var(--deep); }
.dot.on { background: #58d068; } .dot.err { background: var(--red); } .dot.pulse { animation: pulse 1s ease-out 3; }
@keyframes pulse { 0% { box-shadow: 0 0 0 2px var(--deep), 0 0 0 0 #58d068; } 100% { box-shadow: 0 0 0 2px var(--deep), 0 0 0 12px transparent; } }

main { max-width: 980px; margin: 0 auto; padding: 12px; display: grid; gap: 14px; }

/* Pokémon-style text box (NES.css container, tuned to the GBA look) */
.box { background: var(--panel); border: 4px solid var(--line); border-radius: var(--radius); padding: 14px; position: relative;
  box-shadow: inset 0 0 0 3px var(--ring), 0 4px 0 var(--deep); }
.box.green { box-shadow: inset 0 0 0 3px #a8d8a0, 0 4px 0 var(--deep); }
.box.gold { box-shadow: inset 0 0 0 3px #f0d890, 0 4px 0 var(--deep); }
.box.red { box-shadow: inset 0 0 0 3px #f0b0a8, 0 4px 0 var(--deep); }
.box > .title { position: absolute; top: -12px; left: 12px; background: var(--panel); padding: 2px 8px; font-size: 10px; border: 3px solid var(--line); border-radius: 6px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink2); } .small { font-size: 14px; } .right { margin-left: auto; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.party { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.pt-btn { cursor: pointer; border: 3px solid var(--line); border-radius: 6px; background: var(--card); padding: 8px 10px; font-size: 9px; box-shadow: 0 3px 0 var(--line); }
.pt-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.pt-btn.primary { background: var(--accent); color: var(--on-accent); } .pt-btn.warn { background: var(--red); color: #fff; } .pt-btn.gold { background: var(--accent2); }
.pt-btn.small { padding: 5px 7px; font-size: 8px; }
input.pt, select.pt, textarea.pt { background: var(--card); border: 3px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; }
textarea.pt { min-height: 90px; resize: vertical; }
label.f { display: grid; gap: 4px; font-size: 14px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; overflow-x: auto; background: var(--bar); border-top: 4px solid var(--deep);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 4px; scrollbar-width: none; }
.tabs button { flex: 1 0 auto; border: 3px solid transparent; background: transparent; color: var(--tab-ink); font-size: 8px; padding: 8px 6px; border-radius: 6px; cursor: pointer; }
.tabs button.active { background: var(--panel); color: var(--ink); border-color: var(--line); }

/* Pokémon cards */
.mon { background: var(--card); border: 3px solid var(--line); border-radius: 8px; padding: 8px; display: grid; gap: 4px; justify-items: center; text-align: center; position: relative; cursor: pointer; }
.mon .spr { width: 96px; height: 96px; display: grid; place-items: center; }
.mon .spr img { max-width: 96px; max-height: 96px; image-rendering: pixelated; }
.mon.missing .spr img { filter: brightness(0) opacity(.35); }
.mon .nm { font-weight: 600; }
.mon .tier { position: absolute; top: 6px; left: 6px; font-family: "PressStart"; font-size: 7px; color: #fff; padding: 3px 4px; border-radius: 4px; }
.mon .flag { position: absolute; top: 6px; right: 6px; font-size: 13px; }
.tier.ace { background: var(--ace); } .tier.rotation { background: var(--rotation); } .tier.bench { background: var(--bench); } .tier.extra { background: var(--extra); }
.hp { width: 100%; height: 8px; border: 2px solid var(--line); border-radius: 4px; background: #505050; overflow: hidden; }
.hp > i { display: block; height: 100%; background: #58d068; } .hp.mid > i { background: #f8d030; } .hp.low > i { background: #f05038; }
.moves { font-size: 13px; color: var(--ink2); }

.types { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.type { display: inline-block; height: 14px; image-rendering: pixelated; }
.type.big { height: 21px; }
.type.css { font-family: "PressStart"; font-size: 6px; color: #fff; padding: 3px 4px; border-radius: 3px; height: auto; text-transform: uppercase; text-shadow: 1px 1px 0 rgba(0,0,0,.5); }

.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { width: 44px; height: 44px; border: 3px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: #e8e8e8; }
.badge { background: radial-gradient(circle at 35% 30%, #fff8d0, var(--gold)); }
.badge.off { background: #d0d0d0; } .badge.off > * { filter: grayscale(1) opacity(.35); }

.list { display: grid; gap: 6px; }
.item { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 3px solid var(--line); border-radius: 8px; background: var(--card); }
.item.done { background: #e8f4e8; }
.item .grow { flex: 1; min-width: 0; }
.chk { width: 24px; height: 24px; flex: none; border: 3px solid var(--line); border-radius: 5px; background: var(--card); display: grid; place-items: center; cursor: pointer; font-size: 15px; line-height: 1; }
.chk.on { background: var(--accent); color: #fff; }
.warn { border-color: var(--red); background: #fdeceb; }
.ev { display: flex; gap: 8px; font-size: 15px; padding: 6px 0; border-bottom: 2px dashed #d8d8d8; }
.ev .when { color: var(--ink2); white-space: nowrap; font-size: 13px; }
.pill { font-size: 13px; border: 2px solid var(--line); border-radius: 999px; padding: 1px 8px; background: var(--card); }
.typebar { display: flex; flex-wrap: wrap; gap: 6px; }
.typebar .t { display: flex; align-items: center; gap: 3px; font-size: 14px; }
.typebar .t.hi { outline: 3px solid var(--red); border-radius: 4px; }

dialog { border: 4px solid var(--line); border-radius: var(--radius); padding: 16px; width: min(560px, 94vw); background: var(--panel); box-shadow: 0 6px 0 var(--deep); }
dialog::backdrop { background: rgba(16, 28, 52, .6); }
.search-results { max-height: 260px; overflow: auto; display: grid; gap: 4px; margin-top: 6px; }
.search-results button { display: flex; align-items: center; gap: 8px; text-align: left; border: 2px solid var(--line); border-radius: 6px; background: var(--card); padding: 2px 6px; cursor: pointer; }
.search-results img { width: 40px; height: 40px; image-rendering: pixelated; }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: 92vw;
  background: var(--panel); border: 4px solid var(--line); border-radius: 8px; padding: 10px 14px; box-shadow: 0 4px 0 var(--deep); }
.pc-box { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.pc-box .cell { aspect-ratio: 1; background: #d8e8f8; border: 2px solid #98b0d0; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.pc-box .cell img { width: 100%; image-rendering: pixelated; }
.empty { text-align: center; padding: 18px; color: var(--ink2); }
code { background: #eee; padding: 1px 4px; border-radius: 4px; font-size: 14px; word-break: break-all; }
@media (min-width: 760px) { body { padding-bottom: 0; padding-top: 0; } .tabs { position: sticky; top: var(--hdr-h, 58px); bottom: auto; border: 0; border-bottom: 4px solid var(--deep); justify-content: center; } .tabs button { flex: 0 0 auto; } .toast { bottom: 24px; } }
.pt-btn:disabled { opacity: .4; cursor: default; }
details summary { cursor: pointer; }
.mon .flag.px { top: 4px; right: 4px; }
table td { padding: 2px; }

/* Home, Games, Preferences and Account aren't about one run: no run picker, sync or run tabs there, but their own bar. */
body.home #runPicker, body.home #tabs, body.home #syncBox { display: none; }
body:not(.home) #homeTabs { display: none; }
.tabs button.back { color: var(--back); }

/* ---- Challenge picker, challenge card, encounters ---- */
.page-h { font-size: 10px; color: var(--on-bg); text-shadow: 2px 2px 0 var(--title-shadow); margin: 6px 4px -4px; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 4px; flex-wrap: wrap; }
.steps li { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #e9e4d5; color: #6b6f86; }
.steps li.on { background: var(--strong); color: #fff; } .steps li.done { background: #c9e7cf; color: #1e5b2c; }
.style-grid { display: grid; grid-auto-rows: max-content; align-content: start; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: min(56dvh, 520px); overflow: auto; padding: 2px; }
.style-card { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 4px; align-content: start; padding: 10px 12px; border: 3px solid var(--deep); border-radius: 10px; background: var(--card); position: relative; min-height: 120px; }
.style-card:hover { background: #fbf8ef; } .style-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.style-card.on { background: var(--selbg); box-shadow: inset 0 0 0 3px var(--sel); }
.style-card .ic { font-size: 24px; line-height: 1; } .style-card b { font-size: 16px; }
.style-card .bl { font-size: 13px; color: var(--mute3); line-height: 1.35; }
.style-card .tag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #eee5c8; color: #5b4a12; }
.style-card .tag.pick { background: #3a9b4e; color: #fff; }
.stars { color: #f0a500; font-size: 13px; letter-spacing: 1px; } .stars i { font-style: normal; color: #d8d2bf; }
.ch-head { display: flex; gap: 12px; align-items: center; }
.ch-ic { font-size: 30px; line-height: 1; } .ch-name { font-size: 17px; }
.heat { flex: none; display: grid; place-items: center; min-width: 64px; padding: 6px 8px; border-radius: 10px; border: 3px solid var(--deep); background: #c9e7cf; color: #1e5b2c; }
.heat b { font-family: "PressStart"; font-size: 14px; } .heat span { font-size: 11px; font-weight: 700; }
.heat.h1 { background: #e3efc4; color: #3f5a12; } .heat.h2 { background: #fbe3b3; color: #6b4300; } .heat.h3 { background: #f7c2b0; color: #7a2410; } .heat.h4 { background: #3a1010; color: #ffb9a6; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; } .seg .pt-btn { flex: 1 1 auto; min-height: 44px; }
.seg label.pt-btn { display: inline-flex; gap: 6px; align-items: center; }
.mods { display: grid; gap: 6px; max-height: min(44dvh, 420px); overflow: auto; }
.mod { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid #d8d2bf; border-radius: 10px; background: var(--card); cursor: pointer; }
.mod.on { border-color: var(--sel); background: var(--selbg2); }
.mod input { width: 20px; height: 20px; accent-color: var(--sel); } .mod span { display: grid; gap: 2px; } .mod b { font-size: 15px; }
.mod em { font-style: normal; font-weight: 700; font-size: 13px; color: var(--mute1); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--card); border: 2px solid var(--deep); }
.chip .x { all: unset; cursor: pointer; margin-left: 4px; padding: 0 3px; color: #b62c22; font-weight: 700; }
.game-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.gp { display: grid; justify-items: center; gap: 6px; padding: 10px; border: 3px solid var(--deep); border-radius: 10px; background: var(--card); cursor: pointer; text-align: center; font-weight: 700; font-size: 14px; }
.gp input { position: absolute; opacity: 0; pointer-events: none; }
.gp img { width: 64px; height: 64px; object-fit: contain; } .gp.on { background: var(--selbg); box-shadow: inset 0 0 0 3px var(--sel); }
.gp .plus { width: 64px; height: 64px; display: grid; place-items: center; font-size: 34px; border: 3px dashed #9aa3bd; border-radius: 10px; color: var(--mute1); }
.enc { align-items: center; } .enc .enc-ic { width: 22px; text-align: center; } .enc.dead { opacity: .6; } .enc.dead img { filter: grayscale(1); }
#dlg { max-width: min(760px, calc(100vw - 24px)); }
@media (max-width: 560px) { .style-grid { grid-template-columns: 1fr 1fr; } .style-card { min-height: 0; padding: 8px 10px; } .style-card .bl { display: none; } .ch-ic { font-size: 24px; } }

[hidden] { display: none !important; }

/* Spacing pass: nothing may push the page sideways; phones get a one-line header and a tab bar that fits. */
html, body { overflow-x: clip; }
main > * { min-width: 0; }
@media (max-width: 560px) {
  header.top { gap: 8px; row-gap: 6px; padding-left: 10px; padding-right: 10px; }
  header.top h1 { font-size: 11px; }
  header.top select { flex: 1 1 140px; max-width: none; min-width: 0; }
  #syncText { display: none; }
  #signOut { display: none; }               /* still on the Games page → Settings */
  .tabs { gap: 2px; padding-left: 4px; padding-right: 4px; }
  .tabs button { flex: 1 1 0; min-width: 0; padding: 10px 0; border-width: 2px; font-family: "Pixelify", sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0; -webkit-text-stroke: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabs button .lbl { display: none; }
  .tabs button.back, .tabs button[data-tab="settings"] { flex: 0 0 32px; font-size: 13px; font-family: system-ui, sans-serif; }
  main { padding: 10px 8px; gap: 12px; }
  .box { padding: 12px 10px; }
}

/* Header: logo / "My games" go home, the run picker, and PLAY as the main action next to it. */
.brand-btn { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 2px 4px; }
.brand-btn:focus-visible, .play-btn:focus-visible { outline: 3px solid var(--hi); outline-offset: 2px; }
.play-btn { text-decoration: none; color: var(--on-accent) !important; padding: 9px 14px; font-size: 10px; white-space: nowrap; }
body.home .play-btn { display: none; }
.tabs button[data-tab="settings"] { flex: 0 0 auto; }
@media (max-width: 560px) {
  .hdr-nav { display: none; }              /* phones: the logo and the 🏠 / HOME tab in the bottom bar */
  header.top h1 { display: none; }
  .play-btn { padding: 9px 11px; }
  .tabs button[data-tab="settings"] { flex: 0 0 40px; font-size: 15px; font-family: system-ui, sans-serif; }
}

/* Save sync picker */
.sync-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.sync-app { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 2px; padding: 10px 12px; border: 3px solid var(--deep); border-radius: 10px; background: var(--card); }
.sync-app b { font-size: 15px; } .sync-app span { font-size: 12px; color: var(--mute2); } .sync-app em { font-style: normal; font-size: 12px; font-weight: 700; color: #2e7d3e; }
.sync-app.on { background: var(--selbg); box-shadow: inset 0 0 0 3px var(--sel); } .sync-app:focus-visible { outline: 3px solid var(--focus); }
.sync-body { margin-top: 10px; }
.sync-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sync-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 15px; }
.sync-steps .sn { width: 26px; height: 26px; border-radius: 50%; background: var(--sel); color: #fff; display: grid; place-items: center; font: 700 13px system-ui, sans-serif; }
.creds { display: grid; gap: 6px; margin-top: 6px; }
.creds label { display: grid; grid-template-columns: 84px 1fr auto; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.creds code { background: var(--card); border: 2px solid var(--deep); border-radius: 6px; padding: 6px 8px; font-size: 13px; overflow-wrap: anywhere; }
.ra-save { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 2px solid #d8d2bf; border-radius: 8px; background: var(--card); cursor: pointer; }
.ra-save.on { border-color: var(--sel); background: var(--selbg2); }
@media (max-width: 560px) { .creds label { grid-template-columns: 1fr auto; } .creds label > span { grid-column: 1 / -1; } }

/* Score, achievements, Hall of Fame */
.score-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.score-big { display: grid; justify-items: start; } .score-big b { font: 22px "PressStart"; color: var(--strong); } .score-big span { font-size: 13px; color: var(--mute2); }
.score-how { line-height: 1.5; }
.splits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .splits span { display: grid; padding: 4px 8px; border: 2px solid #d8d2bf; border-radius: 8px; background: var(--card); font-size: 12px; } .splits b { font-size: 14px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ach { display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px; border: 2px solid #d8d2bf; border-radius: 10px; background: #f1eee4; color: #6b6f86; }
.ach > span { grid-row: 1 / 3; font-size: 24px; text-align: center; filter: grayscale(1); opacity: .6; } .ach b { font-size: 14px; } .ach small { font-size: 11px; line-height: 1.3; }
.ach.on { background: #fff8e0; border-color: #f0b400; color: #1d2340; } .ach.on > span { filter: none; opacity: 1; }
.hof-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid #d8d2bf; border-radius: 10px; background: var(--card); }
.hof-row .rk { font: 14px "PressStart"; color: #f0b400; width: 28px; text-align: center; } .hof-row .pts { font: 12px "PressStart"; color: var(--strong); }
.new-rule { margin-top: 8px; } .new-rule[open] { display: grid; gap: 6px; padding: 8px; border: 2px dashed #d8d2bf; border-radius: 10px; }

/* Preferences → LOOK: theme swatches (each shows its bar, page, button and highlight colors; the chosen one gets a ✓, not just a color). */
.look-now { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; margin: 6px 0; }
.swatch { all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: grid; gap: 6px; align-content: start; min-height: 66px; padding: 7px;
  border: 3px solid var(--deep); border-radius: 10px; background: var(--card); color: var(--ink); text-align: left; }
.swatch:hover { background: var(--selbg2); }
.swatch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatch.on { background: var(--selbg); box-shadow: inset 0 0 0 3px var(--sel); }
.sw-c { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr; height: 22px; border-radius: 5px; overflow: hidden; border: 2px solid var(--deep); }
.sw-c i { display: block; }
.sw-n { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; line-height: 1.2; }
.sw-n b { font-size: 14px; } .sw-n small { flex-basis: 100%; font-size: 12px; color: var(--mute2); }
.sw-n .types { justify-content: flex-start; }
.swatches.mons .sw-n img { width: 40px; height: 40px; image-rendering: pixelated; margin: -4px 0; }
.sw-ok { position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sel); color: #fff;
  font: 700 15px system-ui, sans-serif; border: 2px solid var(--deep); }
.look-g { margin-top: 10px; border-top: 2px dashed #d8d2bf; padding-top: 4px; }
.look-g > summary { font-weight: 700; font-size: 16px; padding: 10px 2px; }
.look-g > summary small { font-weight: 500; color: var(--mute2); font-size: 13px; margin-left: 6px; }
.dual-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 10px; }
.dual-pick select { min-height: 44px; }
.look .seg { max-width: 560px; margin-top: 4px; }
@media (max-width: 560px) { .swatches { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; } .dual-pick { grid-template-columns: 1fr; } }

/* ---- Navigation (the tracker page only: body.app): Home and My games in the header, a 🏠 tab on phones, the current
   page always marked. style.css is shared with the player and the site pages, so these rules are scoped. ---- */
.app .hdr-nav { display: flex; gap: 2px; }
.app .hdr-link { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 0 10px; }
.app .hdr-link[aria-current="page"] { color: var(--on-bar); background: rgba(255,255,255,.12); box-shadow: inset 0 -3px 0 var(--hi); }
.app .hdr-link:focus-visible, .app .tabs button:focus-visible { outline: 3px solid var(--hi); outline-offset: 2px; }
/* the run picker starts small (so the header fits on one line before anything wraps) and grows into the free room */
.app header.top select { flex: 1 1 150px; min-width: 120px; max-width: 340px; min-height: 44px; text-overflow: ellipsis; }
.app .play-btn { min-height: 44px; display: inline-flex; align-items: center; }
.app .brand-btn { min-height: 44px; min-width: 44px; justify-content: center; box-sizing: border-box; }
.app .tabs button { min-height: 44px; }
.app .tabs button.active { box-shadow: inset 0 -3px 0 var(--hi); }
.app .tabs .home-tab { display: none; }
.app .tabs .gear { font-family: system-ui, sans-serif; font-size: 15px; -webkit-text-stroke: 0; }
.acct-sep { border: 0; border-top: 2px solid var(--ring); margin: 4px 6px; }
/* Home's own bar names Home/Games there; phones use the bottom bar (🏠 on run pages) instead of header links */
.app.home .hdr-nav, .app.home #playTab { display: none; }
/* One header row at every width: below 1200px the logo drops its word, the sync word (the dot stays, its words are
   in its tooltip) and How-tos (also in the account menu); below 760px "My games" and your name go to the menu too. */
@media (max-width: 1199px) { .app header.top h1, .app #syncText, .app header.top > .hdr-link[href="/guide"] { display: none; } }
@media (max-width: 759px) { .app .hdr-nav [data-nav="games"], .app .acct-nm, .app .acct-car { display: none; } .app .acct-btn { min-width: 44px; justify-content: center; padding: 8px 10px; } }
@media (max-width: 560px) {
  .app .hdr-nav { display: none; }
  .app header.top select { flex: 1 1 140px; max-width: none; min-height: 44px; }
  .app .acct-btn { min-width: 48px; }
  .app .tabs .home-tab { display: block; flex: 0 0 44px; font-family: system-ui, sans-serif; font-size: 18px; padding: 8px 0; }
  .app #homeTabs button { font-size: 12px; }
  .app .tabs button[data-tab="settings"] { flex: 0 0 44px; }
}
/* tap targets: 44px tall on touch screens and phones */
@media (pointer: coarse), (max-width: 560px) {
  .app .pt-btn { min-height: 44px; min-width: 44px; } .app .pt-btn.small { padding: 8px 10px; } .app .chip .x { min-width: 32px; min-height: 32px; }
  .app input.pt, .app select.pt { min-height: 44px; } .app details > summary { padding-top: 11px; padding-bottom: 11px; }
  .app .brand-btn { min-width: 44px; justify-content: center; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ell { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Home ---- */
.home-hi { padding: 4px 4px 0; color: var(--on-bg); min-width: 0; }
.home-hi h2 { font-size: 14px; margin: 0; text-shadow: 2px 2px 0 var(--title-shadow); line-height: 1.5; }
.home-hi p { margin: 2px 0 0; font-size: 16px; color: var(--on-bg2); }
.pt-btn.big { font-size: 11px; padding: 12px 16px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.app a.pt-btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.app a.pt-btn.primary { color: var(--on-accent); }
.home-cont .cont { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; }
.cont-art { width: 96px; height: 96px; object-fit: contain; border-radius: 8px; }
.cont-art.px { padding: 22px; }
.cont-main { min-width: 0; }
.cont-name { font: 700 21px/1.2 "Pixelify", ui-monospace, monospace; -webkit-text-stroke: 0; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cont-sub { font-size: 15px; color: var(--ink2); }
.cont-party { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.cont-party .cp { display: grid; justify-items: center; width: 60px; background: var(--card); border: 2px solid var(--ring); border-radius: 8px; padding: 2px 0 3px; }
.cont-party .cp small { font-size: 12px; font-weight: 700; line-height: 1; }
.cont-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.cont-facts > div { min-width: 0; background: var(--card); border: 2px solid var(--ring); border-radius: 8px; padding: 6px 10px; }
.cont-facts dt { font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .5px; }
.cont-facts dd { margin: 2px 0 0; font-size: 16px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.cont-facts dd .ell { max-width: 100%; }
.cap-pill { background: var(--hi); color: var(--hi-ink); border-color: var(--deep); font-weight: 700; white-space: nowrap; }
.sync-ok { color: #1d5a2a; background: #e3f4e5; border-color: #2e7d3e; white-space: nowrap; } .sync-bad { color: #7a1d16; background: #fdeceb; border-color: #b3261e; white-space: nowrap; }
.cont-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.cont-actions .pt-btn { flex: 1 1 160px; }
@media (max-width: 560px) {
  .home-cont .cont { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
  .cont-art { width: 64px; height: 64px; } .cont-art.px { padding: 14px; }
  .cont-facts { grid-template-columns: 1fr 1fr; } .cont-facts > div:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .cont-party .cp { width: calc((100% - 20px) / 6); min-width: 44px; } .cont-party .cp img { width: 100%; height: auto; max-width: 56px; }
}

.hruns { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.hrun { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.hrun-open { all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 8px 10px; min-height: 64px; border: 3px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.hrun-open:hover { background: var(--selbg2); } .hrun-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hrun.last .hrun-open { box-shadow: inset 0 0 0 2px var(--sel); }
.hrun-art { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; } .hrun-art.px { padding: 10px; }
.hrun-txt { display: grid; gap: 2px; min-width: 0; } .hrun-txt b { font-size: 16px; }
.hrun-stats { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; font-weight: 700; }
.hrun-play { flex: 0 0 48px; padding: 0; min-height: 48px; font: 700 18px system-ui, sans-serif; -webkit-text-stroke: 0; }
.home-arch { margin-top: 12px; } .home-arch > summary { font-weight: 700; padding: 10px 2px; min-height: 44px; box-sizing: border-box; }
.home-arch .hruns { margin-top: 4px; } .home-arch .hrun-open { opacity: .85; }

.home-duo { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.home-duo:empty { display: none; }
.lb-me { display: flex; gap: 12px; align-items: center; min-width: 0; }
.lb-me .grow { display: grid; min-width: 0; flex: 1; } .lb-me b { font-size: 16px; }
.lb-rank { font: 20px "PressStart"; color: var(--strong); -webkit-text-stroke: .35px currentColor; white-space: nowrap; }
.hach { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hach li { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border: 2px solid #f0b400; border-radius: 10px; background: #fff8e0; color: #1d2340; min-width: 0; }
.hach li .grow { display: grid; min-width: 0; flex: 1; } .hach li .muted { color: #4b4f66; }
.hach-ic { font-size: 22px; flex: none; }

.hgames { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
.hgame { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; justify-items: center; gap: 2px; padding: 8px; border: 3px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); text-align: center; min-height: 44px; }
.hgame b { font-size: 14px; max-width: 100%; } .hgame small { font-size: 12px; }
.hgame:hover { background: var(--selbg2); } .hgame:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hgame-art { width: 64px; height: 64px; object-fit: contain; } .hgame-art.px { padding: 16px; }

.home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.home-links a { display: flex; gap: 8px; align-items: center; min-height: 52px; padding: 8px 12px; border: 3px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink);
  text-decoration: none; font-weight: 700; box-shadow: 0 3px 0 var(--deep); }
.home-links a span { font-size: 20px; } .home-links a:hover { background: var(--selbg); } .home-links a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 400px) { .home-links { grid-template-columns: 1fr 1fr; } }

.home-ob { padding-top: 18px; }
.ob-x { all: unset; box-sizing: border-box; cursor: pointer; position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px;
  font: 700 18px system-ui, sans-serif; color: var(--ink2); }
.ob-x:hover { background: var(--selbg); } .ob-x:focus-visible { outline: 3px solid var(--focus); }
.ob-bar { height: 10px; border: 2px solid var(--line); border-radius: 6px; background: var(--card); overflow: hidden; margin: 4px 52px 12px 0; }
.ob-bar i { display: block; height: 100%; background: var(--accent); }
.ob-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ob-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border: 2px solid var(--ring); border-radius: 10px; background: var(--card); }
.ob-list li.next { border-color: var(--sel); box-shadow: inset 0 0 0 2px var(--sel); }
.ob-list li.done { opacity: .75; } .ob-list li.done b { text-decoration: line-through; text-decoration-thickness: 2px; }
.ob-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sel); color: #fff; font: 700 14px system-ui, sans-serif; }
.ob-list li.done .ob-n { background: #2e7d3e; }
.ob-body { display: grid; gap: 2px; min-width: 0; } .ob-body b { font-size: 16px; }
.ob-act { margin-top: 6px; } .ob-act .pt-btn { min-height: 44px; }

/* ---- Account page: a side list of sections (a menu on phones and tablets) and one section at a time ---- */
main:focus { outline: none; }
.acct-page { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
.acct-main { display: grid; gap: 14px; min-width: 0; }
.acct-main > .box { margin-top: 8px; }
.acct-nav { position: sticky; top: calc(var(--hdr-h, 58px) + 66px); min-width: 0; }
.acct-sel { display: none; }
.acct-side { list-style: none; margin: 0; padding: 6px; display: grid; gap: 4px; background: var(--panel); border: 4px solid var(--line); border-radius: var(--radius); box-shadow: inset 0 0 0 3px var(--ring), 0 4px 0 var(--deep); }
.acct-tab { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 52px; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
.acct-tab:hover { background: var(--selbg2); }
.acct-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.acct-tab[aria-current] { background: var(--selbg); box-shadow: inset 4px 0 0 var(--sel), inset 0 0 0 2px var(--sel); }
.acct-ti { font-size: 19px; text-align: center; font-family: system-ui, sans-serif; }
.acct-tt { display: grid; min-width: 0; } .acct-tt b { font-size: 16px; } .acct-tt small { font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbadge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #c62828; color: #fff; font: 700 12px/1 system-ui, sans-serif; border: 2px solid var(--deep); box-sizing: border-box; }
@media (max-width: 899px) {
  .acct-page { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .acct-nav { position: static; }
  .acct-side { display: none; }
  .acct-sel { display: grid; gap: 4px; color: var(--on-bg); font-weight: 700; }
  .acct-sel select { min-height: 48px; font-size: 17px; font-weight: 700; color: var(--ink); }
}
.acc .acc-h { margin: 14px 0 2px; font-size: 9px; color: var(--ink2); }
.acc .linkish { all: unset; cursor: pointer; color: var(--link); text-decoration: underline; font-weight: 700; }
.acc .linkish:focus-visible { outline: 3px solid var(--focus); }
.acc .warn-t { color: #b3261e; font-weight: 700; }
.wrap { overflow-wrap: anywhere; word-break: break-word; }
.prof-top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.prof-top .grow { display: grid; gap: 4px; justify-items: start; min-width: 0; flex: 1; }
.prof-nm { font-size: 19px; overflow-wrap: anywhere; }
img.av { width: 40px; height: 40px; flex: none; image-rendering: pixelated; object-fit: contain; border-radius: 50%; background: var(--selbg2); border: 2px solid var(--ring); }
img.av.ball { padding: 7px; box-sizing: border-box; }
img.av.av-xl { width: 96px; height: 96px; } img.av.av-xl.ball { padding: 22px; }
.ball-sm { width: 40px; height: 40px; display: grid; place-items: center; flex: none; font-size: 20px; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 300px; overflow: auto;
  background: var(--panel); border: 3px solid var(--line); border-radius: 8px; box-shadow: 0 4px 0 var(--deep), 0 10px 24px rgba(0,0,0,.25); }
.combo-list li { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 4px 8px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.combo-list li img { width: 40px; height: 40px; image-rendering: pixelated; }
.combo-list li span { flex: 1; font-weight: 700; } .combo-list li small { color: var(--ink2); }
.combo-list li:hover, .combo-list li.on { background: var(--selbg); box-shadow: inset 0 0 0 2px var(--sel); }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prow { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 3px solid var(--line); border-radius: 8px; background: var(--card); min-width: 0; }
.prow .grow { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; } .prow.dim { opacity: .7; }
.prow .pt-btn { flex: none; }
.ulink { font-weight: 700; overflow-wrap: anywhere; }
.pill.bad-pill { background: #fdeceb; border-color: #b3261e; color: #7a1d16; }
.pill.play-pill { background: #e3f4e5; border-color: #2e7d3e; color: #1d5a2a; }
#dlg .ferr, .act-err { color: #b3261e; font-weight: 600; margin: 0; font-size: 15px; } #dlg .ferr:empty { display: none; }
#dlg .act-f { font-size: 15px; font-weight: 600; } #dlg .act-f .pt { font-size: 16px; padding: 10px 12px; }
.quote { margin: 0; padding: 8px 12px; border-left: 4px solid var(--ring); background: var(--card); }
@media (max-width: 420px) { .prow { flex-wrap: wrap; } .prow .pt-btn { margin-left: 50px; } .prof-top { align-items: flex-start; } img.av.av-xl { width: 72px; height: 72px; } img.av.av-xl.ball { padding: 16px; } }

/* ---- Admin ---- */
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.adm-tab { all: unset; box-sizing: border-box; cursor: pointer; min-height: 44px; padding: 8px 12px; border: 3px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-weight: 700; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; }
.adm-tab:hover { background: var(--selbg2); } .adm-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.adm-tab[aria-pressed=true] { background: var(--strong); color: #fff; border-color: var(--deep); }
.adm-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.adm-tools .grow { flex: 1 1 220px; min-width: 0; } .adm-tools select { min-height: 46px; }
.adm-err { padding: 10px 12px; border: 3px solid #b3261e; border-radius: 8px; background: #fdeceb; color: #5c1410; overflow-wrap: anywhere; }
.adm-err .pt-btn { color: var(--ink); }
.tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.tile { all: unset; box-sizing: border-box; display: grid; gap: 2px; align-content: start; padding: 10px 12px; border: 3px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); min-width: 0; min-height: 86px; }
button.tile { cursor: pointer; } button.tile:hover { background: var(--selbg2); } button.tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tile .t-l { font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .5px; }
.tile .t-v { font: 18px/1.3 "PressStart", monospace; -webkit-text-stroke: .35px currentColor; color: var(--strong); overflow-wrap: anywhere; }
.tile .t-s { font-size: 13px; color: var(--ink2); }
.tile.warn-tile { border-color: #b3261e; box-shadow: inset 0 0 0 2px #f0b0a8; } .tile.warn-tile .t-v { color: #b3261e; }
.adm-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 15px; }
.adm-table th { text-align: left; font-size: 12px; color: var(--ink2); text-transform: uppercase; letter-spacing: .5px; padding: 0 8px; }
.adm-table td { background: var(--card); border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); padding: 6px 8px; vertical-align: middle; }
.adm-table td:first-child { border-left: 3px solid var(--line); border-radius: 8px 0 0 8px; } .adm-table td:last-child { border-right: 3px solid var(--line); border-radius: 0 8px 8px 0; }
.adm-table tr.susp td { background: #fdeceb; color: #5c1410; }
.adm-u { all: unset; box-sizing: border-box; cursor: pointer; display: grid; min-height: 44px; align-content: center; max-width: 260px; overflow-wrap: anywhere; color: var(--link); }
.adm-u b { font-size: 16px; text-decoration: underline; } .adm-u span { font-size: 13px; color: var(--ink2); }
.adm-u:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 1099px) {
  .adm-table, .adm-table tbody, .adm-table tr, .adm-table td { display: block; }
  .adm-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .adm-table tr { border: 3px solid var(--line); border-radius: 8px; background: var(--card); padding: 6px 10px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
  .adm-table tr.susp { background: #fdeceb; }
  .adm-table td, .adm-table td:first-child, .adm-table td:last-child { border: 0; border-radius: 0; padding: 2px 0; background: none; }
  .adm-table td::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .5px; }
  .adm-table td:first-child, .adm-table td:last-child { grid-column: 1 / -1; } .adm-table td:first-child::before { display: none; }
  .adm-u { max-width: none; }
}
.reps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rep { padding: 10px 12px; border: 3px solid var(--line); border-radius: 8px; background: var(--card); min-width: 0; overflow-wrap: anywhere; }
.rep-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 16px; }
.rep-note { margin: 6px 0 0; padding: 6px 10px; border-left: 4px solid var(--ring); white-space: pre-wrap; }
.rep-act { margin-top: 8px; }
.audit { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.audit li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; padding: 7px 2px; border-bottom: 2px dashed var(--ring); font-size: 15px; overflow-wrap: anywhere; }
.audit li time { color: var(--ink2); font-size: 13px; } .audit li > div { display: grid; }
.seg-f { border: 0; padding: 0; margin: 0; } .seg-f legend { padding: 0; margin-bottom: 4px; font-weight: 700; }
.seg-f input { width: 18px; height: 18px; accent-color: var(--sel); margin: 0; }
.reset-box { margin-top: 12px; padding: 10px; border: 3px dashed var(--sel); border-radius: 8px; background: var(--selbg2); display: grid; gap: 6px; }
.reset-box input { font-size: 14px; } .reset-box .row { flex-wrap: nowrap; } .reset-box .grow { flex: 1; min-width: 0; }

/* the account drawer: a panel from the right on wide screens, the whole screen on phones */
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); max-width: 100vw; padding: 0; border: 0; border-left: 4px solid var(--line); border-radius: 0;
  background: var(--panel); color: var(--ink); box-shadow: -6px 0 0 var(--deep); display: none; }
dialog.drawer[open] { display: flex; flex-direction: column; }
dialog.drawer::backdrop { background: rgba(16, 28, 52, .6); }
.dr-head { display: flex; gap: 12px; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 12px 12px 16px; border-bottom: 4px solid var(--line); background: var(--panel); }
.dr-head .grow { flex: 1; min-width: 0; display: grid; }
.dr-nm { margin: 0; font: 700 20px/1.2 "Pixelify", ui-monospace, monospace; -webkit-text-stroke: 0; overflow-wrap: anywhere; }
.dr-head h2:focus { outline: none; } .dr-head h2:focus-visible { outline: 3px solid var(--focus); }
.dr-x, .bell-x { all: unset; box-sizing: border-box; cursor: pointer; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 8px; font: 700 20px system-ui, sans-serif; color: var(--ink); }
.dr-x:hover, .bell-x:hover { background: var(--selbg); } .dr-x:focus-visible, .bell-x:focus-visible { outline: 3px solid var(--focus); }
.dr-body { flex: 1; overflow: auto; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 16px; align-content: start; overscroll-behavior: contain; }
.dr-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.dr-kv > div { background: var(--card); border: 2px solid var(--ring); border-radius: 8px; padding: 6px 10px; min-width: 0; }
.dr-kv dt { font-size: 11px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .5px; } .dr-kv dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.dr-sec h3 { margin: 0 0 8px; }
.dr-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Notification bell ---- */
/* the header (and the bell panel and account menu inside it) sits above the sticky/fixed tab bars */
.app header.top { z-index: 30; }
.bell-head .pt-btn { color: var(--ink); }
body[data-page=account][data-sec=admin] main { max-width: 1280px; }
.bell { position: relative; }
.bell-btn { position: relative; min-width: 44px; min-height: 44px; display: inline-grid !important; place-items: center; padding: 0 8px !important; box-sizing: border-box; }
.bell-ic { font-size: 20px; line-height: 1; font-family: system-ui, sans-serif; }
.bell-btn[aria-expanded=true] { background: rgba(255,255,255,.14); }
.bell-n { position: absolute; top: 3px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #d32f2f; color: #fff; font: 700 12px/16px system-ui, sans-serif; text-align: center; border: 2px solid var(--bar); box-sizing: border-box; }
.bell-panel { position: absolute; right: -54px; top: calc(100% + 6px); z-index: 45; width: min(400px, calc(100vw - 16px)); max-height: min(70vh, 600px); display: flex; flex-direction: column;
  background: var(--panel); color: var(--ink); border: 4px solid var(--line); border-radius: 10px; box-shadow: 0 4px 0 var(--deep), 0 12px 28px rgba(0,0,0,.35); overflow: hidden; }
.bell-panel[hidden] { display: none; }
.bell-head { display: flex; gap: 8px; align-items: center; padding: 8px 6px 8px 12px; border-bottom: 3px solid var(--ring); }
.bell-head h2 { margin: 0; flex: 1; font-size: 10px; } .bell-head h2:focus { outline: none; } .bell-head h2:focus-visible { outline: 3px solid var(--focus); }
.bell-body { overflow: auto; flex: 1; overscroll-behavior: contain; padding-bottom: 6px; }
.bell-grp { margin: 10px 12px 4px; font-size: 8px; color: var(--ink2); }
.bell-list { list-style: none; margin: 0; padding: 0 6px; display: grid; gap: 2px; }
.ntf { display: grid; grid-template-columns: 30px minmax(0, 1fr) 12px; gap: 8px; align-items: start; padding: 8px 6px; border-radius: 8px; }
.ntf.unread { background: var(--selbg2); }
.ntf-ic { font-size: 20px; line-height: 1.2; text-align: center; font-family: system-ui, sans-serif; }
.ntf-b { min-width: 0; overflow-wrap: anywhere; } .ntf-b p { margin: 0; font-size: 16px; line-height: 1.35; }
.ntf-b a { display: inline-block; padding: 2px 0; }
.ntf-m { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.ntf-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #d32f2f; box-shadow: 0 0 0 2px var(--panel); }
.bell-empty { margin: 0; padding: 22px 18px; text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--ink); }
.bell-empty p { margin: 0; color: var(--ink2); font-size: 15px; } .bell-big { font-size: 34px; font-family: system-ui, sans-serif; }
.bell-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; padding: 6px 12px; border-top: 3px solid var(--ring); font-size: 15px; font-weight: 700; }
.bell-foot a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 560px) {
  .bell-panel { position: fixed; inset: 0; right: 0; top: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; border-radius: 0; z-index: 70; box-shadow: none; }
  .bell-head { padding-top: calc(8px + env(safe-area-inset-top)); background: var(--bar); color: var(--on-bar); border-bottom: 4px solid var(--deep); }
  .bell-head .bell-x { color: var(--on-bar); }
  .bell-foot { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  html.sheet-open, html.sheet-open body { overflow: hidden; }
}

/* ---- Home: what the people you follow did ---- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fitem { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--ring); border-radius: 10px; background: var(--card); min-width: 0; }
.fitem .grow { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.fitem p { margin: 0; font-size: 16px; line-height: 1.35; }
.fitem .fav { flex: none; line-height: 0; }
.f-ic { font-family: system-ui, sans-serif; }
.f-mon { width: 48px; height: 48px; flex: none; image-rendering: pixelated; }
.feed-empty { display: grid; gap: 10px; justify-items: start; }
@media (max-width: 400px) { .f-mon { width: 40px; height: 40px; } }

/* ---- the site owner's announcement ---- */
.site-banner { max-width: 980px; margin: 12px auto 0; display: flex; gap: 10px; align-items: center; padding: 8px 6px 8px 14px; border: 4px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--deep); width: calc(100% - 24px); box-sizing: border-box; }
.site-banner.info { background: #e6eefc; color: #13254a; } .site-banner.warn { background: #fff1c9; color: #4a3000; border-color: #6b4300; }
.site-banner p { margin: 0; flex: 1; min-width: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.sb-ic { font-size: 20px; font-family: system-ui, sans-serif; flex: none; }
.sb-x { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; font: 700 18px system-ui, sans-serif; color: inherit; }
.sb-x:hover { background: rgba(0,0,0,.08); } .sb-x:focus-visible { outline: 3px solid #1f3864; }
.site-banner.preview { margin: 0; width: 100%; box-shadow: none; border-width: 3px; }
@media (max-width: 560px) { .site-banner { width: calc(100% - 16px); margin-top: 10px; } }

@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } * { scroll-behavior: auto !important; transition: none !important; } }
body[data-page=account][data-sec=admin] .site-banner { max-width: 1256px; }
/* phones: the bell joins the header row, so the run picker gives up some width rather than pushing the menu to a 2nd line */
@media (max-width: 560px) {
  .app header.top { gap: 6px; }
  .app header.top select { flex: 20 1 60px; min-width: 0; }
  .app .play-btn { padding: 9px 8px; }
  .app .bell-btn { padding: 0 4px !important; }
  .app .acct-btn { min-width: 44px; padding: 8px 6px; }
}
/* The site footer: every page but the player. */
.site-foot { margin-top: 40px; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); background: var(--bar); border-top: 4px solid var(--deep); color: var(--tab-ink); font-size: 14px; }
.site-foot .in { max-width: 1040px; margin: 0 auto; display: grid; gap: 8px; }
.site-foot .in > div:first-child { display: flex; flex-wrap: wrap; gap: 0 6px; margin-left: -8px; }
.site-foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--on-bar); border-radius: 6px; }
.site-foot a[aria-current="page"] { text-decoration: none; box-shadow: inset 0 -3px 0 var(--hi); }
.site-foot .fine { font-size: 12px; color: var(--bar-fine); line-height: 1.5; }
/* Delete is never the loudest thing on a card: an outlined red button, filled only on hover/focus; one tap target size. */
.pt-btn.del-quiet { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 70%, transparent); box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 2px; font-size: 10px; }
.pt-btn.del-quiet:hover, .pt-btn.del-quiet:focus-visible { background: var(--red); color: #fff; border-color: var(--red); }
.pt-btn.del-quiet .lbl { font-size: 9px; }
@media (max-width: 560px) { .item .pt-btn.del-quiet .lbl { display: none; } }
@media (pointer: coarse) { .pt-btn.del-quiet { min-height: 44px; min-width: 44px; } }
.game-card:focus-visible { outline: 3px solid var(--sel); outline-offset: 3px; }


/* ===== In-app help kit (public/help.js · docs/help-design.md). Theme colours only; 44px tap targets; posters and no
   motion under prefers-reduced-motion. ===== */
.hk-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin: -4px 0 -4px 6px;
  padding: 0; border: 2px solid currentColor; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; vertical-align: middle; flex: none;
  font: italic 700 13px/1 Georgia, "Times New Roman", serif; -webkit-text-stroke: 0; letter-spacing: 0; opacity: .85; }
.hk-btn::before { content: ""; position: absolute; inset: -12px; } /* 44 × 44 hit area around the 20px circle */
.hk-btn:hover, .hk-btn[aria-expanded="true"] { opacity: 1; background: var(--hi); color: var(--hi-ink); border-color: var(--hi-ink); }
.hk-btn:focus-visible, .hk-walkbtn:focus-visible, .hk-tourbtn:focus-visible, .hk-x:focus-visible, .hk-skip:focus-visible, .hk-copybtn:focus-visible, .hk-pp:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.box > .title .hk-btn { width: 18px; height: 18px; font-size: 12px; margin: -6px -3px -6px 6px; }
h1 .hk-btn { width: 22px; height: 22px; font-size: 14px; text-shadow: none; }
.hk-walkbtn, .hk-tourbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 4px 12px; border: 3px solid var(--line); border-radius: 999px;
  background: var(--selbg); color: var(--strong); font: 400 9px/1.3 "PressStart", monospace; letter-spacing: .3px; cursor: pointer; text-align: left; text-decoration: none; box-shadow: 0 2px 0 var(--line); }
.hk-walkbtn:hover, .hk-tourbtn:hover { background: var(--hi); color: var(--hi-ink); }
@media (pointer: coarse) { .hk-walkbtn, .hk-tourbtn { min-height: 44px; } }
.sync-body > .hk-walkbtn, .ais-help .hk-walkbtn, label .hk-walkbtn, .ais-opt > .hk-walkbtn { margin: 4px 0 8px; }
.ais-help .hk-walkbtn { margin: 6px 6px 2px 0; }
#dropboxBox + .hk-walkbtn, .hk-walkbtn + #dropboxBox { margin-top: 6px; }
.hk-flash { outline: 4px solid var(--focus) !important; outline-offset: 3px; border-radius: 6px; }

/* the popover / bottom sheet */
.hk-pop { position: fixed; z-index: 70; inset: auto; margin: 0; padding: 0; width: 380px; max-width: calc(100vw - 24px); max-height: 80vh; display: flex; flex-direction: column;
  background: var(--panel); color: var(--ink); border: 4px solid var(--line); border-radius: var(--radius); box-shadow: inset 0 0 0 3px var(--ring), 0 6px 0 var(--deep), 0 10px 30px rgba(0,0,0,.35);
  overflow: visible; font-size: 15px; line-height: 1.4; text-align: left; }
.hk-pop:popover-open { display: flex; }
.hk-pop-in { overflow: auto; overscroll-behavior: contain; padding: 12px 14px 14px; max-height: inherit; }
.hk-pop .hk-arrow { position: absolute; left: var(--ax, 50%); top: -11px; width: 16px; height: 16px; margin-left: -8px; background: var(--panel); border: 4px solid var(--line); border-right: 0; border-bottom: 0; transform: rotate(45deg); }
.hk-pop.up .hk-arrow { top: auto; bottom: -11px; transform: rotate(225deg); }
.hk-pop.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100% !important; max-width: none; max-height: 66vh !important;
  border-radius: 14px 14px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
.hk-pop.sheet .hk-arrow { display: none; }
.hk-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hk-title { flex: 1 1 0; margin: 0; font-size: 11px; line-height: 1.5; color: var(--strong); padding-top: 12px; outline: none; min-width: 0; overflow-wrap: anywhere; }
.hk-sub { order: 3; flex-basis: 100%; font-size: 13px; color: var(--mute2); margin-top: -4px; }
.hk-x { flex: none; width: 44px; height: 44px; margin: -4px -8px -4px 0; border: 0; background: none; color: var(--ink); font-size: 18px; cursor: pointer; border-radius: 8px; }
.hk-x:hover { background: var(--selbg); }
.hk-body { margin: 0 0 10px; overflow-wrap: anywhere; }
.hk-note { display: block; font-size: 13px; color: var(--mute2); margin: 4px 0; }
.hk-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.hk-more, .hk-site { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--link); font-weight: 600; }
.hk-media { position: relative; margin: 6px auto 8px; border: 3px solid var(--line); border-radius: 8px; background: var(--deep); overflow: hidden; max-height: 46vh; }
.hk-media video, .hk-media img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--deep); }
.hk-media.still { aspect-ratio: auto; }
.hk-media.still img { max-height: 44vh; height: auto; }
.hk-media figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hk-pp { position: absolute; right: 6px; bottom: 6px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; background: rgba(16,28,52,.75); color: #fff; font-size: 14px; cursor: pointer; }
.hk-media video { cursor: pointer; }
/* walkthroughs */
.hk-pop.wide { width: 420px; }
.hk-dots { display: flex; gap: 5px; list-style: none; padding: 0; margin: 0 0 8px; }
.hk-dots li { flex: 1; height: 5px; border-radius: 3px; background: var(--selbg); border: 1px solid var(--ring); }
.hk-dots li.done { background: var(--sel); } .hk-dots li.on { background: var(--accent); }
.hk-step-t { font-size: 10px; color: var(--strong); margin: 4px 0 6px; line-height: 1.5; }
.hk-shot { margin: 4px 0 8px; }
.hk-scr { display: block; width: 100%; max-width: 380px; height: auto; margin: 0 auto; }
.hk-shot figcaption { font-size: 12px; color: var(--mute2); text-align: center; margin-top: 4px; }
.hk-unsure { font-size: 13px; background: var(--selbg2); border-left: 4px solid var(--sel); padding: 6px 8px; border-radius: 4px; margin: 0 0 8px; }
.hk-copy { display: grid; gap: 6px; margin: 6px 0 10px; }
.hk-copy-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; background: var(--card); border: 2px solid var(--ring); border-radius: 6px; padding: 4px 4px 4px 8px; }
.hk-copy-row span { grid-column: 1 / -1; font-size: 12px; color: var(--mute2); }
.hk-copy-row code { font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.hk-copybtn { min-height: 40px; min-width: 64px; border: 3px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font: 400 9px "PressStart", monospace; cursor: pointer; }
.hk-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; padding: 8px; border-radius: 6px; background: var(--selbg2); }
.hk-nav { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; }
.hk-nav .pt-btn { min-height: 44px; }
.hk-nav .grow { flex: 1; }
.hk-foot { margin-top: 2px; }
.hk-ring { animation: hk-pulse 1.6s ease-in-out infinite; }
@keyframes hk-pulse { 50% { opacity: .35; } }
/* tours */
.hk-tour { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.hk-tour.nospot { background: rgba(8, 14, 28, .55); pointer-events: auto; }
.hk-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 4px var(--focus), 0 0 0 9999px rgba(8, 14, 28, .55); transition: left .2s, top .2s, width .2s, height .2s; pointer-events: none; }
.hk-tour.nospot .hk-spot { display: none; }
.hk-card { position: fixed; pointer-events: auto; max-height: calc(100vh - 24px); overflow: auto; background: var(--panel); color: var(--ink); border: 4px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 0 0 3px var(--ring), 0 6px 0 var(--deep), 0 10px 30px rgba(0,0,0,.4); padding: 10px 14px 12px; font-size: 15px; }
.hk-card.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 62vh; border-radius: 14px 14px 0 0; border-bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.hk-card .hk-media { max-height: 32vh; }
.hk-card.sheet .hk-media { max-height: 24vh; }
.hk-skip { min-height: 44px; border: 0; background: none; color: var(--link); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 0 4px; }
/* first-time tips, toasts, Account → Help & tours */
.hk-tip { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; padding: 10px 6px 10px 12px; border: 3px dashed var(--sel); border-radius: 8px; background: var(--selbg2); text-align: left; font-size: 15px; }
.hk-tip-ic { font-size: 22px; line-height: 1; padding-top: 2px; }
.hk-tip-tx { flex: 1; min-width: 0; }
.hk-tip .hk-x { margin: -6px 0 -6px 0; }
.hk-toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; max-width: min(92vw, 520px);
  background: var(--deep); color: #fff; border: 3px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 15px; }
.hk-tours, .hk-walks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hk-tours li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 2px dashed var(--ring); }
.hk-tours .grow { flex: 1 1 220px; }
.hk-walks { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.hk-walks .hk-walkbtn { width: 100%; justify-content: flex-start; }
.hk-h3 { margin: 16px 0 8px; }
.hk-done { font-size: 12px; color: var(--accent); }
.hk-reset { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .hk-ring { animation: none; } .hk-spot { transition: none; } }
/* A checkbox and its words stay on one line together; the words wrap beside the box, never under it. */
label.chk-line { flex-wrap: nowrap; align-items: flex-start; gap: 8px; }
label.chk-line > input { flex: none; margin-top: 2px; width: 20px; height: 20px; }
label.chk-line > span { flex: 1 1 auto; min-width: 0; }

