/* Wipeday. Tokens and rules in DESIGN.md. */
:root {
  --night: #0d1315; --deep: #141c1f; --steel: #1c272b; --line: #2b393d;
  --bone: #ece3d0; --bone-2: #d8cfbb; --fog: #9eb0ac; --fog-2: #71827f;
  --rust: #d4642a; --rust-deep: #9a3d16; --ember: #f2a75c;
  --q0: #ece3d0; --q1: #8fc1a5; --q2: #79a6dc; --q3: #f2a75c; --glow: #a6d96a;
  --display: 'Tanker', 'Impact', sans-serif;
  --text: 'Sentient', Georgia, serif;
  --r: 6px;
  --ease-out: cubic-bezier(.2, .9, .3, 1.15);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--bone); font: 400 17px/1.55 var(--text); min-height: 100svh; }
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1; margin: 0; letter-spacing: .01em; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; border-radius: 3px; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* grain, very quiet */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: 0 1.4em; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--steel); color: var(--bone); text-decoration: none; cursor: pointer; font-weight: 500; font-size: 16px;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease; user-select: none; }
.btn:hover { border-color: var(--fog-2); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.go { background: var(--rust); border-color: var(--rust); color: #1b0d06; font-weight: 700; }
.btn.go:hover { background: #df7038; }
.btn.go:active { background: var(--rust-deep); color: var(--bone); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 .9em; font-size: 14px; }
.btn.xs { min-height: 28px; padding: 0 .6em; font-size: 13px; }

/* ---------- top bar (inner pages) ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(13, 19, 21, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.top nav { display: flex; gap: 4px; margin-left: 8px; }
.top nav a { text-decoration: none; padding: 7px 12px; border-radius: var(--r); color: var(--fog); font-size: 15px; }
.top nav a:hover { color: var(--bone); }
.top nav a[aria-current="page"] { color: var(--bone); background: var(--steel); }
.ca-chip { margin-left: auto; font-size: 14px; color: var(--fog); display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.ca-chip b { color: var(--bone); font-weight: 500; }
.ca-chip button { background: none; border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; cursor: pointer; color: var(--bone); font-size: 13px; }

/* ---------- home ---------- */
.hero { position: relative; min-height: max(100svh, 760px); overflow: hidden; display: flex; flex-direction: column; align-items: center; isolation: isolate; }
.hero .scene { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero-copy { width: min(680px, calc(100% - 32px)); text-align: center; padding-top: clamp(56px, 11vh, 120px); display: flex; flex-direction: column; align-items: center; }
.kicker { font-style: italic; color: var(--fog); font-size: 16px; }
.hero h1 { margin: 18px 0 0; }
.hero h1 svg { width: min(560px, 86vw); height: auto; }
.rule { width: 220px; height: 10px; margin: 22px 0 18px; color: var(--fog-2); }
.lede { font-size: 19px; line-height: 1.55; color: var(--bone-2); max-width: 560px; }
.ctas { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; justify-content: center; }
.ctas .btn { min-height: 52px; font-size: 17px; padding: 0 1.8em; }
.plate { position: relative; margin-top: 26px; width: min(520px, 100%); padding: 16px 26px 15px; border-radius: 4px; text-align: center;
  background: linear-gradient(180deg, #1d2629, #161e21); border: 1px solid #34454a; box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 30px rgba(0,0,0,.35); }
.plate::before, .plate::after { content: ""; position: absolute; top: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #8a9693, #3a4447 70%); box-shadow: 0 0 0 1px #0d1315; }
.plate::before { left: 9px; } .plate::after { right: 9px; }
.plate .lab { font-size: 14px; color: var(--fog); font-style: italic; }
.plate .addr { font-size: 15px; margin-top: 4px; word-break: break-all; color: var(--bone); }
.plate .soon { font-family: var(--display); font-size: 30px; color: var(--bone); margin-top: 2px; letter-spacing: .02em; }
.plate .note { font-size: 13.5px; color: var(--fog-2); margin-top: 2px; }
.plate .btn { margin-top: 10px; }
.plate .rv { position: absolute; bottom: 9px; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8a9693, #3a4447 70%); box-shadow: 0 0 0 1px #0d1315; }
.plate .rv.l { left: 9px; } .plate .rv.r { right: 9px; }

.tags { max-width: 1180px; margin: 0 auto; padding: 72px 20px 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.tag { position: relative; background: var(--deep); border: 1px solid var(--line); border-radius: var(--r); padding: 30px 26px 26px; }
.tag::before { content: ""; position: absolute; top: -11px; left: 50%; width: 92px; height: 24px; transform: translateX(-50%) rotate(-2.5deg);
  background: rgba(236, 227, 208, .16); border-left: 1px dashed rgba(236,227,208,.18); border-right: 1px dashed rgba(236,227,208,.18); }
.tag:nth-child(2)::before { transform: translateX(-50%) rotate(2deg); }
.tag:nth-child(3)::before { transform: translateX(-50%) rotate(-1deg); }
.tag .ico { color: var(--fog); margin-bottom: 14px; }
.tag h2 { font-size: 30px; }
.tag p { margin-top: 8px; color: var(--bone-2); font-size: 16px; }

.foot { border-top: 1px solid var(--line); margin-top: 30px; }
.foot .in { max-width: 1180px; margin: 0 auto; padding: 28px 20px 34px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.foot nav { display: flex; gap: 18px; font-size: 15px; }
.foot nav a { color: var(--fog); text-decoration: none; }
.foot nav a:hover { color: var(--bone); }
.foot .fine { width: 100%; font-size: 11px; color: var(--fog-2); line-height: 1.6; }

/* campfire: the one motion moment on the home page */
@keyframes flick { 0%, 100% { transform: scale(1, 1) skewX(0); } 25% { transform: scale(.96, 1.06) skewX(-2deg); } 50% { transform: scale(1.03, .95) skewX(1.5deg); } 75% { transform: scale(.98, 1.04) skewX(-1deg); } }
@keyframes breathe { 0%, 100% { opacity: .9; } 50% { opacity: .72; } }
.fire .tongue { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 1.3s ease-in-out infinite; }
.fire .tongue.b { animation-duration: 1.7s; animation-delay: -.4s; }
.fire .tongue.c { animation-duration: 1.1s; animation-delay: -.8s; }
.fire .glow { animation: breathe 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .fire .tongue, .fire .glow { animation: none; } }

/* ---------- inner pages ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 26px 20px 40px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(40px, 6vw, 64px); }
.page-head p { color: var(--fog); max-width: 560px; }
.panel { background: var(--deep); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.panel h2 { font-size: 26px; margin-bottom: 12px; }
.panel h3 { font-family: var(--text); font-weight: 700; font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--fog); }
.fine { font-size: 13px; color: var(--fog-2); }
.msg { font-size: 14px; color: var(--ember); min-height: 1.4em; }
.err { color: #ff8a6a; }

/* survivors */
.roster { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 560px; overflow: hidden;
  background: radial-gradient(ellipse 60% 40% at 50% 92%, rgba(242,167,92,.16), transparent 70%), linear-gradient(180deg, #121a1d 0%, #141c1f 62%, #1d1b17 62.2%, #181712 100%); }
.stage .who { text-align: center; padding-top: 6px; }
.stage .who h2 { font-size: 54px; margin: 0; }
.stage .who p { color: var(--fog); }
.stage .fig { margin-top: auto; }
.stage .fig svg { width: min(260px, 60vw); height: auto; }
.stage .acts { display: flex; gap: 10px; padding: 16px 0 6px; flex-wrap: wrap; justify-content: center; }
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--steel); }
.row[aria-selected="true"] { border-color: var(--rust); }
.row .pick { flex: 1; min-width: 0; text-align: left; background: none; border: 0; cursor: pointer; padding: 2px 0; }
.row .pick b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.05; }
.row .pick span { font-size: 13px; color: var(--fog); }
.row .face { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #0f1618; flex: none; }
.row .face svg { width: 74px; height: 111px; margin: -9px 0 0 -17px; }
.empty { text-align: center; padding: 30px 10px; color: var(--fog); }
.empty svg { margin: 0 auto 14px; }
.wipes { margin-top: 18px; }
.wipes li { font-size: 14px; color: var(--fog); padding: 4px 0; border-bottom: 1px dashed var(--line); }
.wipes ul { list-style: none; padding: 0; margin: 0; }

/* workbench */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { text-decoration: none; padding: 8px 16px; border-radius: var(--r); border: 1px dashed var(--line); color: var(--fog); font-family: var(--display); font-size: 20px; letter-spacing: .02em; }
.tabs a[aria-selected="true"] { color: var(--bone); border-style: solid; border-color: var(--rust); background: var(--steel); }
.bench { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.bench.wide { grid-template-columns: minmax(0, 1fr); }
.maker { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
.maker .fig { background: linear-gradient(180deg, #121a1d 0%, #141c1f 70%, #1d1b17 70.2%); border-radius: var(--r); display: flex; align-items: flex-end; justify-content: center; min-height: 440px; padding-bottom: 10px; }
.field { margin-bottom: 14px; }
.field label, .field .lab { display: block; font-size: 14px; color: var(--fog); margin-bottom: 6px; }
.input { width: 100%; background: var(--steel); border: 1px solid var(--line); border-radius: var(--r); color: var(--bone); padding: 10px 12px; font: 500 18px var(--text); }
.input:focus { outline: none; border-color: var(--rust); }
.stepper { display: flex; align-items: center; gap: 8px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--steel); }
.stepper .v { flex: 1; text-align: center; font-size: 15px; }
.stepper .v small { color: var(--fog); display: block; font-size: 12px; }
.stepper button { width: 34px; height: 34px; border-radius: 4px; border: 1px solid var(--line); background: var(--deep); cursor: pointer; }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--bone); box-shadow: 0 0 0 2px var(--night) inset; }
.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kit { display: flex; flex-direction: column; justify-content: flex-start; text-align: left; background: var(--steel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; }
.kit[aria-pressed="true"] { border-color: var(--rust); }
.kit b { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 15px; }
.kit span { display: block; font-size: 13px; color: var(--fog); margin-top: 4px; line-height: 1.4; }
.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.cell { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 5px; background: #10171a; display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--fog-2); }
.cell.known { color: var(--q0); }
.cell.known.q1 { color: var(--q1); } .cell.known.q2 { color: var(--q2); } .cell.known.q3 { color: var(--q3); }
.cell[aria-pressed="true"] { border-color: var(--bone); }
.cell .lk { position: absolute; right: 4px; bottom: 4px; color: var(--fog-2); }
.q0 { color: var(--q0); } .q1 { color: var(--q1); } .q2 { color: var(--q2); } .q3 { color: var(--q3); }
.tier-row { margin-bottom: 16px; }
.tier-row h3 { display: flex; justify-content: space-between; }
.detail .ico { margin-bottom: 8px; }
.detail h3 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 14px; margin-top: 10px; }
.stats dt { color: var(--fog); } .stats dd { margin: 0; }
.loot { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.srcs { display: flex; flex-direction: column; gap: 6px; }
.srcs button { text-align: left; background: var(--steel); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; cursor: pointer; }
.srcs button[aria-pressed="true"] { border-color: var(--rust); }
.srcs b { display: block; font-weight: 500; }
.srcs span { font-size: 13px; color: var(--fog); }
table.odds { width: 100%; border-collapse: collapse; font-size: 15px; }
table.odds th { text-align: left; font-weight: 500; color: var(--fog); font-size: 13px; border-bottom: 1px solid var(--line); padding: 6px 8px; }
table.odds td { padding: 7px 8px; border-bottom: 1px dashed var(--line); }
table.odds td.r { text-align: right; }
table.odds button { background: none; border: 0; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 8px; text-align: left; }
.perks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.perk { background: var(--steel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.perk h3 { font-family: var(--display); font-weight: 400; font-size: 24px; display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 4px; }
.perk h3 small { font-family: var(--text); font-size: 12px; color: var(--fog); }
.perk p { font-size: 14px; color: var(--bone-2); }
.perk ol { margin: 8px 0 0; padding-left: 20px; font-size: 13px; color: var(--fog); }
.miles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mile { display: flex; gap: 12px; align-items: center; background: var(--steel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.mile .badge { width: 44px; height: 44px; border-radius: 50%; border: 1px dashed var(--fog-2); display: grid; place-items: center; color: var(--fog-2); flex: none; }
.mile.got .badge { border: 2px solid var(--rust); color: var(--rust); }
.mile b { display: block; font-weight: 700; font-size: 15px; }
.mile span { font-size: 13px; color: var(--fog); }
.meter { height: 8px; border-radius: 4px; background: #0f1618; overflow: hidden; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; background: var(--rust); }

/* lost */
.lost { min-height: 70svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 40px 20px; }
.lost h1 { font-size: 56px; }

/* toast */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { background: #1d2629; border: 1px solid var(--line); border-left: 3px solid var(--rust); color: var(--bone); padding: 10px 16px; border-radius: var(--r); font-size: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: tin .3s var(--ease-out); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .roster, .bench { grid-template-columns: minmax(0, 1fr); }
  .maker { grid-template-columns: minmax(0, 1fr); }
  .maker .fig { min-height: 340px; }
  .loot { grid-template-columns: minmax(0, 1fr); }
  .srcs { flex-direction: row; flex-wrap: wrap; }
  .srcs button { flex: 1 1 150px; }
}
@media (max-width: 720px) {
  .tags { grid-template-columns: minmax(0, 1fr); padding-top: 48px; }
  .top .in { flex-wrap: wrap; gap: 8px 14px; padding: 8px 14px; }
  .top nav { margin-left: 0; order: 3; width: 100%; }
  .top nav a { padding: 6px 10px; }
  .ca-chip { font-size: 13px; }
  .lede { font-size: 17px; }
  .page { padding: 18px 14px 30px; }
  .stage { min-height: 500px; }
  .stage .who h2 { font-size: 44px; }
}
@media (max-width: 400px) {
  table.odds th:nth-child(2), table.odds td:nth-child(2) { display: none; }
  .ctas .btn { flex: 1 1 100%; }
  .hero-copy { padding-top: 40px; }
}
