/* Peregrino's split on the web, as the app lays out a page: the top pane (a map,
   the globe over it, with the thing's artifact on it) and the page, side by side
   on a wide screen, stacked on a phone. The share pages (/s/<token>) and
   /where-have-you-been/ both wear it (with assets/split.js), so they match. The
   artifacts are paper: always light. */

:root {
  --bg: #f4f1ec;
  --sheet: #fbfaf7;
  --card: #ffffff;
  --ink: #1c1a18;
  --muted: #6f6a63;
  --faint: #a29c94;
  --line: rgba(28, 26, 24, 0.08);
  --lip: rgba(28, 26, 24, 0.14);
  --accent: #2e6fe0;
  --accent-lip: #1f4fa8;

  --sky: #2e8fea;
  --grass: #3fa535;
  --sun: #f2a60c;
  --coral: #ee4b3f;
  --grape: #7c5be6;
  --teal: #14a3a0;
  --pink: #e04c8c;

  --ocean-a: #4f9be6;
  --ocean-b: #2c6fc4;
  --land: #93c97a;
  --land-edge: #6fa75c;
  --visited: #ee4b3f;
  --lived: #f2a60c;

  --paper: #f7f4ee;
  --paper-ink: #1c1a18;
  --paper-muted: #77706a;
  --pencil: #9097a3;

  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  --print: -apple-system, "SF Pro Display", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --radius-sheet: 34px;
  --pad: 20px;
}

:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110;
    --sheet: #1a1917;
    --card: #23221f;
    --ink: #f3f0eb;
    --muted: #a7a098;
    --faint: #7a746d;
    --line: rgba(255, 255, 255, 0.09);
    --lip: rgba(0, 0, 0, 0.55);
    --accent: #5c8ff2;
    --accent-lip: #2f5bb5;
    --ocean-a: #2a5c9c;
    --ocean-b: #183c6e;
    --land: #5e8f4f;
    --land-edge: #4a7540;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--round);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* MARK: Icons (Lucide, drawn in the current colour) */

.ic {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* MARK: The split */

.split {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.stage {
  position: relative;
  height: clamp(340px, 54vh, 620px);
  overflow: hidden;
  background: linear-gradient(160deg, var(--ocean-a), var(--ocean-b));
  flex: none;
}

.stage .map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 0.4s ease;
}
.stage .map path { fill: var(--land); stroke: var(--land-edge); stroke-width: 0.5; vector-effect: non-scaling-stroke; }
.stage .map path.on { fill: var(--visited); stroke: #b8352b; }
.stage .map path.lived { fill: var(--lived); stroke: #b77d06; }
.stage .map .route { fill: none; stroke: #ffffff; stroke-width: 2.4; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0.95; }
.stage .map .route.shadow { stroke: rgba(10, 30, 70, 0.35); stroke-width: 5; }
.stage .map .dot { fill: #ffffff; stroke: #2c6fc4; stroke-width: 2.5; vector-effect: non-scaling-stroke; }

/* Soft vignette so the artifact reads over the map. */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(8, 20, 45, 0.28));
}

/* The globe: deep space behind it, over the flat map once it has loaded. */
.stage .globe-host { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity 0.6s ease; }
.stage .globe-host canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.stage .globe-host canvas:active { cursor: grabbing; }
.stage.has-globe { background: radial-gradient(120% 90% at 50% 35%, #0e1a33 0%, #050811 70%); }
.stage.has-globe .globe-host { opacity: 1; }
.stage.has-globe .map { opacity: 0; }
.stage.has-globe::after { background: none; }

.stage .hold {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  /* Low in the pane, as the app holds it: the places show above it. */
  place-items: end center;
  padding: 28px 18px 56px;
}
.stage .hold > .fit { width: min(100%, 640px); pointer-events: auto; }

.page {
  position: relative;
  z-index: 3;
  margin-top: calc(-1 * var(--radius-sheet));
  background: var(--sheet);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
  flex: 1;
}
.page .grabber {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  margin: 9px auto 0;
}
.page-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px var(--pad) 56px;
}

/* Side by side: the pane on the left, held still; the page scrolls. */
@media (min-width: 960px) {
  :root { --pad: 36px; }
  .split {
    flex-direction: row;
    align-items: flex-start;
    padding: 14px;
    gap: 14px;
  }
  .stage {
    position: sticky;
    top: 14px;
    height: calc(100vh - 28px);
    flex: 1 1 56%;
    border-radius: 30px;
  }
  .stage .hold { padding: 48px 48px 56px; }
  .stage .hold > .fit { width: min(100%, 720px); }
  .page {
    margin-top: 0;
    flex: 0 1 44%;
    min-width: 460px;
    max-width: 760px;
    border-radius: 30px;
    box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(0, 0, 0, 0.06);
    min-height: calc(100vh - 28px);
  }
  .page .grabber { display: none; }
  .page-inner { padding-top: 24px; }
}
@media (min-width: 1500px) {
  .stage { flex-basis: 60%; }
  .page { flex-basis: 40%; }
}

/* MARK: Page chrome */

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-bottom: 6px;
}
.bar .spacer { flex: 1; }

.toy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--lip), 0 0 0 1px var(--line);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.toy:active { transform: translateY(3px); box-shadow: 0 0 0 var(--lip), 0 0 0 1px var(--line); }
.toy.circle { width: 44px; height: 44px; border-radius: 50%; font-size: 20px; }
.toy.capsule { height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 800; font-size: 16px; }
.toy.prominent { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-lip); }
.toy.prominent:active { box-shadow: 0 0 0 var(--accent-lip); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}
.eyebrow .ic { font-size: 15px; }
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(#ffd34d, #f2b705);
  color: #4a3500;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--card);
}

h1.title {
  font-size: clamp(32px, 4.2vw, 44px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.6px;
  margin: 10px 0 6px;
  overflow-wrap: anywhere;
}
.subtitle { margin: 0; color: var(--muted); font-size: 18px; font-weight: 600; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.pill .ic { font-size: 15px; color: var(--muted); }
.pill.planned { color: var(--muted); border: 1.5px dashed var(--faint); box-shadow: none; background: transparent; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.fact {
  background: var(--card);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 0 0 1px var(--line);
}
.fact .v { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.fact .l { color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 2px; }

.section { margin-top: 34px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 22px; font-weight: 900; margin: 0; letter-spacing: -0.2px; }
.count {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--line);
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
}

.card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 0 0 1px var(--line);
  padding: 4px 16px;
}

/* A row: lead, title over detail, chevron when it opens something. */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  -webkit-tap-highlight-color: transparent;
}
.row:last-child { border-bottom: 0; }
a.row { cursor: pointer; }
a.row:hover .row-title { color: var(--accent); }
.row-lead {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 19px;
  color: #fff;
}
.row-lead.flag { background: #fff; padding: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.row-lead.flag img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.row-detail { color: var(--muted); font-size: 14px; font-weight: 600; margin-top: 2px; }
.row .chev { color: var(--faint); font-size: 17px; }
.row.planned .row-title { color: var(--muted); }

/* Key/value rows (a ticket's or an event's details). */
.kv { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.kv:last-child { border-bottom: 0; }
.kv .k { width: 108px; flex: none; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.kv .v { flex: 1; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.kv .v a { color: var(--accent); text-decoration: none; }

.notes { white-space: pre-wrap; font-size: 16px; line-height: 1.5; padding: 14px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
  font-weight: 800;
  font-size: 15px;
}

/* Artifacts in a section: a list — the compact artifact, what it is beside
   it — each opening its page. */
.alist { padding: 2px 14px; }
.aitem {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  -webkit-tap-highlight-color: transparent;
}
.aitem:last-child { border-bottom: 0; }
.aitem .athumb { width: 176px; flex: none; transition: transform 0.15s ease; }
.aitem.place .athumb { width: 150px; }
.aitem.stay .athumb { width: 96px; padding: 0 20px 0 4px; box-sizing: content-box; }
.aitem:hover .athumb { transform: translateY(-1px) rotate(-0.6deg); }
.aitem:hover .row-title { color: var(--accent); }
.aitem .row-detail + .row-detail { margin-top: 1px; }
.aitem .chev { color: var(--faint); font-size: 17px; }
.aitem.planned .row-title { color: var(--muted); }
@media (max-width: 420px) {
  .aitem { gap: 12px; }
  .aitem .athumb { width: 136px; }
  .aitem.place .athumb { width: 120px; }
  .aitem.stay .athumb { width: 80px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) { .aitem .athumb { transition: none; } }

/* (Kept for stamps outside a list.) */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px 16px;
}
.shelf a { display: block; text-decoration: none; transition: transform 0.15s ease; }
.shelf a:hover { transform: translateY(-2px) rotate(-0.4deg); }
/* Stamps are ink: always on paper, as the passport pages print them. */
.stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 16px 18px 12px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), inset 0 0 40px rgba(160, 130, 90, 0.08);
}
.stamps a { display: block; width: 116px; transition: transform 0.15s ease; }
.stamps a:hover { transform: scale(1.04); }

.state { text-align: center; padding: 40px 0; }
.state h1 { font-size: 30px; font-weight: 900; margin: 0 0 8px; }
.state p { color: var(--muted); font-size: 17px; margin: 0 0 22px; }

footer.foot { margin-top: 56px; color: var(--faint); font-size: 13px; text-align: center; }
footer.foot a { color: inherit; }

.enter { animation: enter 0.35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .enter { animation: none; } .toy, .shelf a, .stamps a { transition: none; } }

/* MARK: Artifacts (canonical size, scaled to fit by share.js) */

.fit { position: relative; }
.fit > .art { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.art {
  font-family: var(--print);
  color: var(--paper-ink);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.16)) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}
.art .outline { position: absolute; inset: 0; overflow: visible; }
.art .caps { text-transform: uppercase; letter-spacing: 2px; font-weight: 800; }
.art .mono { font-family: var(--mono); }
.art .muted { color: var(--paper-muted); }
.art .abs { position: absolute; }
.art .pencil-title { color: transparent; -webkit-text-stroke: 1.6px var(--pencil); }

/* A link that isn't there: an invitation to make your own (user request) */
.invite { display: flex; align-items: center; gap: 14px; padding: 16px; margin: 28px 0 22px; text-decoration: none; color: inherit; }
.invite img { flex: none; width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 6px 14px rgba(20, 60, 140, 0.25); }
.invite-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.invite-text b { font-size: 17px; font-weight: 900; }
.invite-text span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.invite .capsule { flex: none; display: inline-flex; align-items: center; }
@media (max-width: 520px) {
  .invite { flex-wrap: wrap; }
  .invite .capsule { width: 100%; justify-content: center; }
}

/* MARK: Picking (/where-have-you-been/: the countries you've been to, tapped
   on the map or ticked in the list) */

.stage.is-picking .map path { cursor: pointer; }

/* What a pick did, over the pane: the country's stamp coming down, its name. */
.stage .hold .picked { display: grid; justify-items: center; gap: 10px; transition: opacity 0.4s ease, transform 0.4s ease; }
.stage .hold .picked.is-leaving { opacity: 0; transform: translateY(8px); }
.picked .fit { animation: stamp-down 0.38s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes stamp-down { from { opacity: 0; transform: scale(1.7) rotate(-10deg); } to { opacity: 1; transform: none; } }
.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 6px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--line);
  font-size: 15px;
  white-space: nowrap;
  animation: enter 0.25s ease both;
}
.toast .row-lead.flag { width: 28px; height: 28px; padding: 2px; }
.toast .row-lead.flag img { width: 24px; height: 24px; }
.toast b { font-weight: 900; }
.toast span:last-child { color: var(--muted); font-weight: 700; }

/* Four numbers: in a row, two by two on a phone. */
.facts.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 480px) { .facts.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.toy:disabled { opacity: 0.45; cursor: default; transform: none; }
.toy .ic + span { margin-left: -2px; }

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 16px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}
.notice > span:first-child { flex: 1 1 220px; }
.notice-actions { display: flex; gap: 8px; }
.notice .toy.capsule { height: 36px; padding: 0 14px; font-size: 14px; }

/* The search: held at the top while the list scrolls under it, the rows
   fading out behind it. */
.picker { margin-top: 14px; }
.search-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 -10px;
  padding: 12px 10px 16px;
  background: linear-gradient(var(--sheet) 76%, transparent);
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 19px;
  box-shadow: 0 0 0 1px var(--line), 0 8px 22px rgba(0, 0, 0, 0.07);
}
.search:focus-within { box-shadow: 0 0 0 2px var(--accent), 0 8px 22px rgba(0, 0, 0, 0.07); }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
}
.search input::placeholder { color: var(--faint); }
.picker .section:first-of-type { margin-top: 14px; }
.picker .none { color: var(--muted); font-size: 17px; font-weight: 700; text-align: center; padding: 34px 0 6px; margin: 0; }

/* A row you tick: the flag, the name, a round tick in the visited red. */
.row.pick {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
}
.row.pick:last-child { border-bottom: 0; }
.row.pick[hidden] { display: none; }
.pick .row-title, .pick .row-detail { display: block; }
.pick:hover .row-title { color: var(--accent); }
.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.tick {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  font-size: 17px;
  box-shadow: inset 0 0 0 2px var(--faint);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.pick[aria-pressed="true"] .tick { background: var(--visited); color: #fff; box-shadow: 0 2px 0 #b8352b; }
.pick:active .tick { transform: scale(0.88); }

.again { display: inline-flex; }
/* a narrow bar: Reset is its glyph alone, a circle like the back button, so the others keep one line */
@media (max-width: 480px) {
  .again { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .again span { display: none; }
  .bar .capsule { white-space: nowrap; }
}

/* The summary (what Share sends): each continent's flags, with their names. */
.flags {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 16px 8px;
  padding: 18px 12px 16px;
}
.flag-tile {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  min-width: 0;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.flag-tile .row-lead.flag { width: 54px; height: 54px; padding: 3px; }
.flag-tile .row-lead.flag img { width: 48px; height: 48px; }
.flag-tile.is-territory > span:last-child { color: var(--muted); }
@media (max-width: 420px) { .flags { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); padding-inline: 8px; } }
.again[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .picked .fit, .toast { animation: none; }
  .stage .hold .picked, .tick { transition: none; }
}

/* MARK: The share pages' own (assets/share.js): what's coming, what you can do
   with it, "Link copied", the wait */

/* How long until it (a trip, a ticket, an event), in the app's accent. */
.pill.soon { color: var(--accent); }
.pill.soon .ic { color: var(--accent); }
.pill[hidden] { display: none; }

/* Add to Calendar, Open in Maps: under the pills. */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions .toy.capsule { font-size: 15px; padding: 0 16px; }
.actions .toy .ic { font-size: 17px; }

/* "Link copied": a capsule over the bottom of the page. */
/* /s/example-<kind>: says it's an example, over the page */
.example-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 9px 14px;
  border-radius: 14px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.example-note .ic { flex: none; width: 16px; height: 16px; }
.example-note a { color: inherit; text-decoration: underline; }

.flash {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 20;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--sheet);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.flash.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Opening…: a spinner, only once the wait is noticeable. */
.state.loading { display: grid; justify-items: center; gap: 14px; }
.state.loading p { margin: 0; }
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  opacity: 0;
  animation: spin 0.8s linear infinite, appear 0.2s ease 0.5s forwards;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes appear { to { opacity: 1; } }
.state .toy { margin-bottom: 6px; }

/* Keyboard focus: a ring in the accent on whatever can be reached. */
.toy:focus-visible, .invite:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a.row:focus-visible, .aitem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
.kv a:focus-visible, footer.foot a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1.title:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .flash { transition: none; }
  .spinner { animation: spin 1.6s linear infinite, appear 0s 0.5s forwards; }
}
