/* ══════════════════════════════════════════════════════════════
   only words — a semantic proximity instrument
   ink & ember: warm black ground, cream plate, hot→cold readout
   ══════════════════════════════════════════════════════════════ */

:root {
  --ink:        #0d0c0b;
  --ink-2:      #14120f;
  --plate:      #1a1714;
  --plate-2:    #221d18;
  --edge:       #322a22;
  --edge-hot:   #4a3a29;

  --paper:      #f0e8da;
  --paper-dim:  #b3a794;
  --paper-mute: #7c7264;

  --hot-white:  #fff2d2;
  --ember:      #ff5a1f;
  --amber:      #f0932b;
  --ochre:      #b9a13c;
  --sage:       #5c8f7b;
  --teal:       #3d6b7d;
  --frost:      #2a3a46;

  /* DM Serif Display. Heavier than Instrument Serif, which is what this
     ground needs — thin type loses against near-black. One weight, plus an
     italic, which is all the display face is asked for. */
  --serif: 'DM Serif Display', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --ease:   cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* Author rules beat the UA sheet, so [hidden] needs restating. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 12% -10%, #1c1713 0%, transparent 58%),
    radial-gradient(90% 60% at 92% 4%, #17181a 0%, transparent 55%),
    var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .01em;
  overflow-x: hidden;
}

/* ── atmosphere ─────────────────────────────────────────────── */

.grain {
  position: fixed; inset: -50%;
  z-index: 9;
  pointer-events: none;
  opacity: .3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: drift 7s steps(4) infinite;
}
@keyframes drift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}

.vignette {
  position: fixed; inset: 0;
  z-index: 8;
  pointer-events: none;
  background: radial-gradient(115% 90% at 50% 40%, transparent 42%, rgba(0,0,0,.6) 100%);
}

/* ── masthead ───────────────────────────────────────────────── */

.masthead {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.9rem) var(--gutter);
  border-bottom: 1px solid var(--edge);
}

.mark {
  display: inline-flex; align-items: center;
  text-decoration: none;
}
/* The artwork carries its own wordmark, so the ground stays dark for now.
   A light theme swaps the src to /logo__light.png — same trim, same box. */
.mark__logo {
  display: block;
  width: auto;
  height: clamp(26px, 4.4vw, 34px);
}

/* ── layout ─────────────────────────────────────────────────── */

#app {
  position: relative; z-index: 2;
  flex: 1;
  width: 100%;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 4rem;
}

.view { display: none; max-width: 1180px; margin: 0 auto; }
.view.is-active { display: block; animation: rise .55s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.colophon {
  position: relative; z-index: 2;
  display: flex; gap: .6rem; justify-content: center;
  padding: 1.4rem var(--gutter) 2rem;
  font-size: .66rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--paper-mute);
  border-top: 1px solid var(--edge);
}
.colophon__dot { opacity: .5; }

/* ── type ───────────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 1.1rem;
  font-size: .66rem; text-transform: uppercase; letter-spacing: .26em;
  color: var(--amber);
}
.eyebrow::before {
  content: ''; display: inline-block; vertical-align: middle;
  width: 26px; height: 1px; margin-right: .7rem;
  background: linear-gradient(90deg, transparent, var(--amber));
}

.display {
  margin: 0 0 1.4rem;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.7rem, 7.2vw, 5.2rem);
  line-height: .98; letter-spacing: -.015em;
  text-wrap: balance;
}
.display em {
  font-style: italic;
  color: var(--amber);
}
.display--sm { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.05; }

.lede {
  margin: 0 0 1.6rem;
  max-width: 46ch;
  color: var(--paper-dim);
  font-size: .92rem; line-height: 1.75;
}
.fineprint {
  margin: 1rem 0 0;
  font-size: .72rem; letter-spacing: .06em;
  color: var(--paper-mute);
}

/* ── compose ────────────────────────────────────────────────── */

.compose {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.compose__lede { animation: rise .7s var(--ease) both; }
.compose__form {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  border: 1px solid var(--edge);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255,90,31,.05), transparent 40%),
    var(--plate);
  box-shadow: 0 40px 80px -50px #000, inset 0 1px 0 rgba(255,242,210,.05);
  animation: rise .7s var(--ease) .12s both;
}

.field { display: block; margin-bottom: 1.9rem; }
.field__label {
  display: block; margin-bottom: .55rem;
  font-size: .64rem; text-transform: uppercase; letter-spacing: .24em;
  color: var(--paper-mute);
}
.field__label em { font-style: normal; opacity: .6; }

.field input {
  width: 100%; padding: .2rem 0 .55rem;
  background: none; border: 0; outline: none;
  color: var(--paper);
  font-family: var(--serif); font-size: clamp(1.8rem, 4.4vw, 2.6rem);
  letter-spacing: -.01em;
}
.field--slim input { font-size: 1.15rem; font-family: var(--mono); font-weight: 400; }
.field input::placeholder { color: #4b4238; }

.field__rule { display: block; height: 1px; background: var(--edge-hot); position: relative; }
.field__rule::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--ember), var(--amber));
  transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.field input:focus ~ .field__rule::after { transform: scaleX(1); }

/* ── buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .85rem 1.5rem;
  border: 1px solid var(--edge-hot); border-radius: 2px;
  background: none; color: var(--paper);
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .18em; text-decoration: none;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease),
              border-color .3s var(--ease), transform .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: var(--amber); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.btn--major {
  width: 100%;
  padding: 1.05rem 1.5rem;
  background: linear-gradient(100deg, var(--ember), var(--amber));
  border-color: transparent; color: #16100a; font-weight: 600;
}
.btn--major:hover { box-shadow: 0 16px 40px -18px rgba(255,90,31,.75); }
.btn--minor { font-size: .68rem; padding: .7rem 1.15rem; }
.btn--quiet { border-color: var(--edge); color: var(--paper-mute); }
.btn--quiet:hover { color: var(--paper-dim); }
.btn--ghost { border-color: var(--edge-hot); }
.btn[disabled] { opacity: .5; cursor: progress; transform: none; }

.compose__wait { display: none; gap: 4px; }
.compose__wait i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: blip 1s infinite; }
.compose__wait i:nth-child(2) { animation-delay: .15s; }
.compose__wait i:nth-child(3) { animation-delay: .3s; }
.is-working .compose__go { display: none; }
.is-working .compose__wait { display: inline-flex; }

.notice {
  margin: 0 0 1.1rem;
  padding: .7rem .9rem;
  border-left: 2px solid var(--ember);
  background: rgba(255,90,31,.07);
  font-size: .78rem; color: #ffcbb2;
}

/* ── created ────────────────────────────────────────────────── */

.created { max-width: 660px; margin: clamp(1rem, 6vh, 4rem) auto; }

.sharebox {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin: 1.8rem 0 1.4rem;
  padding: .55rem .55rem .55rem 1rem;
  border: 1px solid var(--edge-hot); border-radius: 2px;
  background: var(--plate);
}
.sharebox__label {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .22em;
  color: var(--paper-mute);
}
.sharebox input {
  flex: 1 1 14rem; min-width: 0;
  background: none; border: 0; outline: none;
  color: var(--amber); font-family: var(--mono); font-size: .85rem;
}
.created__actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ── play ───────────────────────────────────────────────────── */

.play { max-width: 780px; margin: 0 auto; }
.play__head { margin-bottom: 2.2rem; }

.probe { display: flex; gap: .5rem; margin-bottom: 1rem; }
.probe input {
  flex: 1; min-width: 0;
  padding: 1rem 1.15rem;
  background: var(--plate); border: 1px solid var(--edge-hot); border-radius: 2px;
  outline: none; color: var(--paper);
  font-family: var(--serif); font-size: 1.5rem; letter-spacing: -.005em;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.probe input:focus { border-color: var(--amber); background: var(--plate-2); }
.probe input::placeholder { color: #4b4238; }

.btn--probe { flex: 0 0 auto; padding-inline: 1.5rem; position: relative; }
.probe__wait { display: none; gap: 4px; }
.probe__wait i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: blip 1s infinite; }
.probe__wait i:nth-child(2) { animation-delay: .15s; }
.probe__wait i:nth-child(3) { animation-delay: .3s; }
@keyframes blip { 0%,60%,100% { opacity: .2; } 30% { opacity: 1; } }
.is-probing .probe__go { display: none; }
.is-probing .probe__wait { display: inline-flex; }

/* latest reading */
.latest {
  position: relative;
  margin: 1.4rem 0 1.8rem;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--edge-hot); border-radius: 3px;
  background: var(--plate);
  overflow: hidden;
  animation: rise .45s var(--ease) both;
}
.latest__fill {
  position: absolute; inset: 0; right: auto;
  transform-origin: left;
  animation: sweep .7s var(--ease) both;
}
@keyframes sweep { from { transform: scaleX(0); } }
.latest__body { position: relative; display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.latest__word {
  font-family: var(--serif); font-size: clamp(2rem, 6vw, 3rem); line-height: 1;
  text-shadow: 0 1px 10px rgba(8,7,6,.9);
}
.latest__rank {
  margin-left: auto;
  min-width: 4ch; text-align: right;
  font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 10px rgba(8,7,6,.9);
}
.latest__note {
  position: relative; margin: .7rem 0 0;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--paper-mute);
}

/* gauge legend */
.gauge {
  display: flex; align-items: center; gap: .8rem;
  margin: 0 0 .9rem;
  font-size: .6rem; text-transform: uppercase; letter-spacing: .22em;
  color: var(--paper-mute);
}
.gauge__bar {
  flex: 1; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--frost), var(--teal), var(--sage),
                              var(--ochre), var(--amber), var(--ember), var(--hot-white));
}

/* readings list */
.readings { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.reading {
  position: relative;
  display: flex; align-items: center; gap: 1rem;
  padding: .72rem .95rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--ink-2);
  overflow: hidden;
  animation: rise .4s var(--ease) both;
}
.reading__fill {
  position: absolute; inset: 0; right: auto;
  transform-origin: left;
  animation: sweep .8s var(--ease) both;
}
.reading__word {
  position: relative;
  font-family: var(--serif); font-size: 1.3rem; line-height: 1.2;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 8px rgba(8,7,6,.85);
}
.reading__rank {
  position: relative; margin-left: auto;
  min-width: 4ch; text-align: right;
  font-size: .95rem; font-weight: 500; font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  text-shadow: 0 1px 8px rgba(8,7,6,.85);
}
.reading--fresh { border-color: var(--edge-hot); }
.reading--win {
  border-color: var(--ember);
  box-shadow: 0 0 40px -12px rgba(255,90,31,.85);
}
.reading--win .reading__word { color: var(--hot-white); }

.play__stats {
  display: flex; gap: 1.4rem; flex-wrap: wrap;
  margin: 1.6rem 0 0;
  font-size: .66rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--paper-mute);
}
.play__stats b { color: var(--paper-dim); font-weight: 500; }

.play__actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* ── finale ─────────────────────────────────────────────────── */

.finale {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  padding: var(--gutter);
  background: rgba(8,7,6,.86);
  backdrop-filter: blur(7px);
  animation: fadein .4s var(--ease) both;
}
@keyframes fadein { from { opacity: 0; } }

.finale__inner {
  width: min(560px, 100%);
  max-height: 86dvh; overflow-y: auto;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border: 1px solid var(--edge-hot); border-radius: 3px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(255,90,31,.13), transparent 62%),
    var(--plate);
  box-shadow: 0 60px 120px -60px #000;
  animation: rise .5s var(--ease) .05s both;
  text-align: center;
}
.finale__word {
  margin: .2rem 0 1rem;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(2.6rem, 9vw, 4.4rem); line-height: 1;
  color: var(--hot-white);
  text-shadow: 0 0 60px rgba(255,90,31,.5);
}
.finale .lede { margin-inline: auto; }
.finale__closest {
  list-style: none; margin: 1.6rem 0 0; padding: 1.2rem 0 0;
  border-top: 1px solid var(--edge);
  display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center;
}
.finale__closest li {
  padding: .3rem .6rem;
  border: 1px solid var(--edge);
  border-radius: 2px;
  font-size: .72rem; letter-spacing: .04em;
  color: var(--paper-dim);
}
.finale__closest li b { color: var(--amber); font-weight: 500; }
.finale .created__actions { justify-content: center; }


/* ── identity + liveness ────────────────────────────────────── */

.whoami {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-top: 1.1rem;
  font-size: .64rem; text-transform: uppercase; letter-spacing: .22em;
  color: var(--paper-mute);
}
.whoami input {
  width: 11rem; padding: .35rem .6rem;
  background: var(--plate); border: 1px solid var(--edge); border-radius: 2px;
  outline: none; color: var(--paper);
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
  text-transform: none;
  transition: border-color .3s var(--ease);
}
.whoami input:focus { border-color: var(--amber); }

.live-dot {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .6rem; letter-spacing: .2em; color: var(--sage);
}
.live-dot i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 0 rgba(92,143,123,.7);
  animation: beat 2.4s var(--ease) infinite;
}
@keyframes beat {
  0%   { box-shadow: 0 0 0 0 rgba(92,143,123,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(92,143,123,0); }
  100% { box-shadow: 0 0 0 0 rgba(92,143,123,0); }
}

/* ── watch ──────────────────────────────────────────────────── */

.watch { max-width: 1060px; margin: 0 auto; }
.watch__head { margin-bottom: 2.4rem; }
.watch__head .display { margin-bottom: 1.2rem; }

/* Masked answer: same weight and rhythm as the word it stands in for. */
#watch-secret.is-masked {
  letter-spacing: .06em;
  opacity: .55;
  -webkit-user-select: none;
  user-select: none;
}
.peek { margin-bottom: 1.2rem; }
.sharebox--host { border-color: var(--edge); }
.sharebox--host input { color: var(--sage); }

.watch__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.watch__tabs { display: flex; gap: .35rem; margin-bottom: .9rem; }
.tab {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .8rem;
  border: 1px solid var(--edge); border-radius: 2px;
  background: none; color: var(--paper-mute);
  font-family: var(--mono); font-size: .62rem;
  text-transform: uppercase; letter-spacing: .2em;
  cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.tab:hover { color: var(--paper-dim); }
.tab.is-on {
  color: var(--paper);
  border-color: var(--edge-hot);
  background: var(--plate);
}
.tab:not(.is-on) .live-dot i { animation: none; background: var(--paper-mute); box-shadow: none; }

.watch__label {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 0 .9rem;
  font-size: .64rem; font-weight: 400; text-transform: uppercase; letter-spacing: .24em;
  color: var(--paper-mute);
}

.reading__who {
  position: relative;
  padding: .16rem .45rem;
  border: 1px solid var(--edge-hot); border-radius: 2px;
  font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--paper-dim);
  white-space: nowrap;
}

.standings { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.standings li {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .7rem .9rem;
  background: var(--ink-2); border: 1px solid transparent; border-radius: 2px;
}
.standings li.is-solved { border-color: var(--ember); }
.standings__who { font-family: var(--serif); font-size: 1.15rem; }
.standings__n {
  margin-left: auto;
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--paper-mute);
}
.standings__best { font-size: .95rem; font-weight: 500; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .watch__grid { grid-template-columns: 1fr; }
}

/* ── responsive ─────────────────────────────────────────────── */

@media (max-width: 860px) {
  .compose { grid-template-columns: 1fr; gap: 2.4rem; }
}
@media (max-width: 540px) {
  .probe { flex-direction: column; }
  .btn--probe { width: 100%; }
  .reading__word { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   content pages — about, how to play, privacy, terms
   Static prose that shares the instrument's chrome but drops the
   view-switching machinery. No JS runs on these pages.
   ══════════════════════════════════════════════════════════════ */

.page {
  position: relative; z-index: 2;
  flex: 1;
  width: 100%;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 4rem;
}

.prose {
  max-width: 68ch;
  margin: 0 auto;
}

.prose > h1 { margin: 0 0 1.6rem; }

.prose h2 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 3rem 0 .9rem;
  color: var(--hot-white);
}

.prose h3 {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--amber);
  margin: 2.2rem 0 .7rem;
}

.prose p { margin: 0 0 1.1rem; color: var(--paper-dim); }
.prose p strong { color: var(--paper); font-weight: 500; }
.prose em { font-family: var(--serif); font-style: italic; color: var(--paper); }

.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.3rem; color: var(--paper-dim); }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--amber); }

.prose a { color: var(--amber); text-decoration: none; border-bottom: 1px solid var(--edge-hot); }
.prose a:hover { color: var(--hot-white); border-bottom-color: var(--amber); }

.prose code {
  font-family: var(--mono); font-size: .85em;
  background: var(--plate); border: 1px solid var(--edge);
  padding: .12em .4em; border-radius: 3px;
  color: var(--hot-white);
}

/* A pulled-out statement — used for the one-line answer at the top of a
   privacy section, so a skimmer gets the point without reading the clause. */
.prose .keynote {
  border-left: 2px solid var(--ember);
  padding: .1rem 0 .1rem 1.1rem;
  margin: 0 0 1.4rem;
  color: var(--paper);
}

.prose .updated {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--paper-mute);
  margin-bottom: 2.5rem;
}

.prose__end {
  display: flex; flex-wrap: wrap; gap: .7rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--edge);
}

/* ── footer navigation ──────────────────────────────────────── */

.colophon { flex-wrap: wrap; }
.colophon a {
  color: var(--paper-mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.colophon a:hover { color: var(--paper-dim); border-bottom-color: var(--edge-hot); }

@media (max-width: 620px) {
  .colophon { gap: .5rem; font-size: .6rem; }
}

/* ── accounts ───────────────────────────────────────────────── */

.masthead__right {
  display: flex; align-items: center; gap: 1.1rem;
}
.account-chip { display: inline-flex; align-items: center; gap: .7rem; }
.account-chip__name {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--paper-dim);
}
.account-chip__btn {
  appearance: none; background: none; cursor: pointer;
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: .38rem .7rem;
  font-family: var(--mono); font-weight: 300;
  font-size: .62rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--paper-dim);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.account-chip__btn:hover { border-color: var(--edge-hot); color: var(--paper); }

/* A button that reads as prose, for the links inside fineprint. */
.linkish {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--amber);
  border-bottom: 1px solid transparent;
}
.linkish:hover { border-bottom-color: currentColor; }

.account {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: var(--gutter);
  background: rgba(6, 5, 5, .82);
  backdrop-filter: blur(3px);
}
.account__card {
  position: relative;
  width: min(27rem, 100%);
  max-height: 90dvh; overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  background: var(--plate);
  border: 1px solid var(--edge);
  border-radius: 3px;
}
.account__close {
  position: absolute; top: .5rem; right: .7rem;
  appearance: none; background: none; border: 0; cursor: pointer;
  font-size: 1.5rem; line-height: 1;
  color: var(--paper-mute);
}
.account__close:hover { color: var(--paper); }

.account__panel .display { margin: .2rem 0 1.2rem; }
.lede--tight { margin: -.7rem 0 1.4rem; font-size: .82rem; color: var(--paper-dim); }
.account__panel .field { margin-bottom: 1.1rem; }
.account__panel .btn--major { width: 100%; margin-top: .3rem; }
.account__google { width: 100%; margin-top: .7rem; }
.account__panel .fineprint { margin-top: 1.1rem; text-align: center; }
.notice.is-good { color: var(--sage); }

@media (max-width: 860px) {
  /* The meta strapline already hides here; keep the account controls. */
  .masthead__right { gap: .6rem; }
}

/* ── the signed-out compose gate ────────────────────────────── */

.compose__gate {
  padding: clamp(1.4rem, 4vw, 2rem);
  border: 1px solid var(--edge);
  border-radius: 3px;
  background: var(--plate);
}
.gate__lede {
  margin: 0 0 1.4rem;
  font-size: .84rem; line-height: 1.7;
  color: var(--paper-dim);
}
.compose__gate .btn--major { width: 100%; }
.compose__gate .fineprint { margin-top: 1rem; text-align: center; }

/* The permanent link is the one worth sharing, so it reads as the primary. */
.sharebox--permalink input { color: var(--hot-white); }

/* ── modes and closed rounds ────────────────────────────────── */

.modes { border: 0; margin: 0 0 1.2rem; padding: 0; }
.modes legend { padding: 0; margin-bottom: .7rem; }
.mode {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .1rem .6rem;
  padding: .7rem .8rem;
  border: 1px solid var(--edge);
  border-radius: 2px;
  cursor: pointer;
}
.mode + .mode { margin-top: .5rem; }
.mode:has(input:checked) { border-color: var(--edge-hot); background: var(--plate-2); }
.mode input { grid-row: 1 / span 2; align-self: start; margin-top: .2rem; accent-color: var(--ember); }
.mode__name {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--paper);
}
.mode__note { font-size: .74rem; line-height: 1.55; color: var(--paper-mute); }

#limit-field { margin-bottom: 1.2rem; }
#limit-field .fineprint { margin-top: .35rem; }

/* A finished round reports rather than warns, so it does not read as an error. */
.notice--done { border-left-color: var(--sage); color: var(--paper-dim); }

/* ── the shared feed (social rounds) ────────────────────────── */

.pubfeed {
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--edge);
}
.pubfeed__title {
  margin: 0 0 1rem;
  font-family: var(--mono); font-weight: 400;
  font-size: .66rem; text-transform: uppercase; letter-spacing: .22em;
  color: var(--paper-mute);
}
.pubfeed__list { list-style: none; margin: 0; padding: 0; }
.pubfeed__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: .8rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--ink-2);
  font-size: .8rem;
}
.pubfeed__who { color: var(--paper-dim); }
.pubfeed__word { color: var(--paper); }
.pubfeed__rank { font-variant-numeric: tabular-nums; color: var(--paper-mute); }
/* A winning guess is the secret, so the public copy never carries the word. */
.pubfeed__row.is-solve .pubfeed__word { color: var(--ember); }

/* ── leaderboard ────────────────────────────────────────────── */

.ranks { list-style: none; margin: 1.6rem 0 0; padding: 0; }
.rank {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto auto;
  align-items: baseline;
  gap: .9rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--ink-2);
}
.rank__place {
  font-variant-numeric: tabular-nums;
  font-size: .72rem;
  color: var(--paper-mute);
  text-align: right;
}
.rank__who { color: var(--paper); }
.rank__solves { font-size: .72rem; color: var(--paper-mute); }
.rank__points {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--amber);
}
/* The top three carry the heat, so the board reads at a glance. */
.rank:nth-child(1) .rank__place, .rank:nth-child(1) .rank__points { color: var(--ember); }
.rank:nth-child(2) .rank__place { color: var(--amber); }
.rank:nth-child(3) .rank__place { color: var(--ochre); }
.rank.is-you { background: var(--plate); }
.rank.is-you .rank__who { color: var(--hot-white); }

@media (max-width: 540px) {
  .rank { grid-template-columns: 1.8rem 1fr auto; gap: .6rem; }
  .rank__solves { display: none; }
}

/* ── your rounds ────────────────────────────────────────────── */

.active {
  margin: 1.6rem 0 2rem;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  border: 1px solid var(--edge-hot);
  border-radius: 3px;
  background: var(--plate);
}
.active__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: .9rem;
}
.active__label {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .22em;
  color: var(--ember);
}
.active__mode {
  font-size: .68rem; letter-spacing: .1em;
  color: var(--paper-mute);
}
.active__word {
  display: flex; align-items: baseline; gap: .8rem;
  margin: 0 0 .6rem;
}
/* Masked by default — this page is as streamable as the board is. */
.active__secret {
  font-family: var(--serif); font-size: 1.7rem;
  color: var(--hot-white);
}
.active__stats { margin: 0 0 1.2rem; font-size: .76rem; color: var(--paper-mute); }

a.account-chip__name { text-decoration: none; }
a.account-chip__name:hover { color: var(--paper); }

@media (max-width: 620px) {
  .history__row {
    grid-template-columns: 1fr auto;
    gap: .3rem .8rem;
  }
  .history__mode, .history__stat { display: none; }
}

/* Signed in, the name is the account's and cannot be typed over. */
#player-name.is-locked {
  color: var(--paper-dim);
  border-color: var(--edge);
  cursor: default;
}

/* ── the rounds table ───────────────────────────────────────── */

/*
 * One grid for the whole table, not one per row.
 *
 * Giving each row its own grid-template-columns looks equivalent and is not:
 * an `auto` or `fr` track is sized against the content of that row alone, so
 * every row picked its own column widths and nothing lined up. The rows are
 * display:contents instead, which lifts the cells into the table's grid and
 * makes the tracks shared. Borders move to the cells, since a row with no box
 * of its own cannot carry one.
 */
.table {
  display: grid;
  grid-template-columns:
    minmax(5rem, 1fr)     /* word    */
    minmax(6rem, auto)    /* mode    */
    4.5rem                /* guessed */
    4rem                  /* found   */
    minmax(10rem, auto)   /* ended   */
    minmax(5rem, auto);   /* actions */
  align-items: baseline;
  column-gap: 1.4rem;
  margin-top: 1.4rem;
}
.table__head,
.table__body,
.table__row { display: contents; }

.table__head > * {
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--edge);
  font-size: .6rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--paper-mute);
}
.table__row > * {
  padding: .75rem 0;
  border-bottom: 1px solid var(--ink-2);
  font-size: .78rem;
}

.table__word { font-family: var(--serif); font-size: 1.05rem; color: var(--paper); }
.table__dim { color: var(--paper-mute); white-space: nowrap; }
.table__num { font-variant-numeric: tabular-nums; text-align: right; color: var(--paper-dim); }
.table__act { display: flex; gap: .9rem; justify-content: flex-end; }
.table__link {
  appearance: none; background: none; border: 0; padding: 0;
  font: inherit; color: var(--amber); text-decoration: none; cursor: pointer;
}
.table__link:hover { text-decoration: underline; }
.table__row.is-open > .table__dim { color: var(--amber); }

.table--guesses {
  grid-template-columns:
    minmax(5rem, 1fr) minmax(7rem, auto) 5rem 5rem minmax(8rem, auto) minmax(4rem, auto);
}

/* The action sits with the content, not stretched across the page. */
.me__act { margin: 1.8rem 0 .4rem; }
.me__act .btn { display: inline-flex; }

a.account-chip__name { text-decoration: none; }
a.account-chip__name:hover { color: var(--paper); }

@media (max-width: 720px) {
  /* Two columns on a phone: the word, and what happened to it. */
  .table { grid-template-columns: 1fr auto; column-gap: 1rem; }
  .table--guesses { grid-template-columns: 1fr auto; }
  .table__head { display: none; }
  .table__num { display: none; }
  .table__row > * { padding: .5rem 0; border-bottom: 0; }
  .table__word { grid-column: 1; padding-top: .9rem; }
  .table__act { grid-column: 2; padding-top: .9rem; }
  .table__dim { font-size: .72rem; }
  /* The last cell of each row closes it off, since cells lost their row box. */
  .table__row > *:nth-last-child(2) { border-bottom: 1px solid var(--ink-2); padding-bottom: .9rem; }
  .table__row > *:last-child { border-bottom: 1px solid var(--ink-2); padding-bottom: .9rem; }
}

/* ── boot ───────────────────────────────────────────────────── */

.boot {
  display: flex; flex-direction: column; align-items: center; gap: 1.4rem;
  padding: clamp(4rem, 18vh, 9rem) 0;
}
.boot__rings { position: relative; width: 34px; height: 34px; display: block; }
.boot__rings i {
  position: absolute; inset: 0; margin: auto;
  border-radius: 50%;
  border: 1px solid var(--edge-hot);
  border-top-color: var(--ember);
  animation: spin 1.1s linear infinite;
}
.boot__rings i:nth-child(2) {
  inset: 8px;
  border-color: var(--edge);
  border-top-color: var(--amber);
  animation-duration: 1.7s;
  animation-direction: reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot__note {
  margin: 0;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .22em;
  color: var(--paper-mute);
}

/* ── tabs ───────────────────────────────────────────────────── */

.tabs {
  display: flex; gap: 1.6rem;
  margin: 2.6rem 0 0;
  border-bottom: 1px solid var(--edge);
}
.tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  padding: 0 0 .7rem;
  margin-bottom: -1px;
  border-bottom: 1px solid transparent;
  font-family: var(--mono); font-weight: 300;
  font-size: .64rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--paper-mute);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.tab:hover { color: var(--paper-dim); }
.tab.is-on { color: var(--ember); border-bottom-color: var(--ember); }

/* The tab strip already carries the heading, so the table sits close under it. */
.table { margin-top: 1.4rem; }

.table--guesses .table__head,
.table--guesses .table__row {
  grid-template-columns: minmax(5rem, 1fr) 8rem 4.5rem 5rem auto 5rem;
}

/* ── round facts ────────────────────────────────────────────── */

/* Was one bullet-separated run of text. Each fact now has a label, so the
   values are scannable instead of read left to right. */
.facts {
  display: flex; flex-wrap: wrap; gap: 0 2.4rem;
  list-style: none; margin: 0 0 1.6rem; padding: 0;
}
.fact { display: flex; flex-direction: column; gap: .25rem; }
.fact__label {
  font-size: .58rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--paper-mute);
}
.fact__value {
  font-size: .82rem; letter-spacing: .04em;
  color: var(--paper-dim);
}

@media (max-width: 540px) {
  .facts { gap: 0 1.4rem; }
}
