/* ==========================================================================
   Battlesnake Arena design system — Mauá Dev "Direction E: Two-Toggle Themes"
   Minimal editorial: cool paper, hairline rules, mono data — navy is the
   focus, red is held in reserve for what's live, won, or wrong.

   Two theme axes, resolved onto html[data-app-theme="light|dark"]:
     - site theme    (system | light | dark)  — every page
     - game theater  (match | dark | light)   — pages marked data-theater-page
   Resolution happens in the inline head script (no-FOUC) + /static/theme.js.
   ========================================================================== */

:root {
  --paper: #F5F7FB;
  --ink: #111A2F;
  --muted: #586584;
  --hairline: #DBE1ED;
  --hairline-dark: #C5CDE0;
  --accent: #185AC3;
  --accent-deep: #0F4295;
  --accent-wash: #EBF2FC;
  --red: #C81E29;
  --red-deep: #9A131C;
  --red-wash: #FDEDEE;
  --card: #FFFFFF;
  --hover: #EEF1F8;
  --pill: #E5EAF3;
  --up: #148A5C;
  --down: #C0392B;
  --display: "Bricolage Grotesque", sans-serif;
  --body: "Instrument Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}
html[data-app-theme="dark"] {
  --paper: #0A0F1C;
  --ink: #E9EEF9;
  --muted: #8D9DC4;
  --hairline: #202E4E;
  --hairline-dark: #2D3E64;
  --accent: #4D91FF;
  --accent-deep: #85B4FF;
  --accent-wash: rgba(77, 145, 255, .14);
  --red: #FF4D58;
  --red-deep: #FF858D;
  --red-wash: rgba(255, 77, 88, .14);
  --card: #141E36;
  --hover: #192645;
  --pill: #202E4E;
  --up: #3DDBA0;
  --down: #FF6B6B;
}

/* --- base ------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: light; }
html[data-app-theme="dark"] { color-scheme: dark; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; }
h1 { font-weight: 800; letter-spacing: -.03em; font-size: clamp(36px, 4vw, 52px); line-height: 1.05; }
h2 { font-weight: 700; font-size: 24px; }
h3 { font-weight: 700; font-size: 16px; }

/* --- nav ---------------------------------------------------------------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 32px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  transition: opacity .15s ease;
}
.wordmark:hover { opacity: .8; }
.wordmark .logo-mark { height: 28px; width: auto; flex-shrink: 0; display: block; color: var(--ink); }
.wordmark .event-tag {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--hairline-dark);
}
.site-nav .links { display: flex; gap: 26px; font-size: 14.5px; font-weight: 500; color: var(--muted); }
.site-nav .links a:hover { color: var(--ink); }
.site-nav .links a.active { color: var(--accent); }
.site-nav .spacer { flex: 1; }

.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.5;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.solid:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.danger:hover { background: var(--down); border-color: var(--down); color: #fff; }

.nav-user { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; }
.nav-avatar { width: 34px; height: 34px; border: 1.5px solid var(--hairline-dark); }
.nav-user:hover .nav-avatar { border-color: var(--accent); }

.user-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pill);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
  text-transform: uppercase;
}

/* theme controls */
.theme-ctl { display: flex; gap: 10px; align-items: center; }
.theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline-dark);
  background: none;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .15s;
}
.theme-btn:hover { border-color: var(--ink); }
.theme-btn svg { width: 16px; height: 16px; }
html[data-app-theme="light"] .ic-sun { display: none; }
html[data-app-theme="dark"] .ic-moon { display: none; }

/* appearance popover */
.appearance {
  position: fixed;
  top: 74px;
  right: 32px;
  z-index: 98;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 20px 22px;
  width: 250px;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .35);
  font-size: 13.5px;
}
.appearance h4 { font-family: var(--display); font-size: 14px; margin-bottom: 2px; }
.appearance fieldset { border: none; margin-top: 14px; }
.appearance legend {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 6px;
}
.appearance label { display: flex; gap: 8px; align-items: center; padding: 3px 0; cursor: pointer; color: var(--ink); }
.appearance input { accent-color: var(--accent); }
.appearance .hint { margin-top: 14px; font-size: 11px; color: var(--muted); line-height: 1.5; }

/* mobile menu (CSS-only disclosure) */
.mobile-menu { display: none; position: relative; }
.mobile-menu summary {
  list-style: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline-dark);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary svg { width: 18px; height: 18px; }
.mobile-menu[open] summary { border-color: var(--ink); }
.mobile-menu .sheet {
  position: absolute;
  top: 52px;
  right: 0;
  z-index: 97;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 10px;
  width: 220px;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .35);
  display: flex;
  flex-direction: column;
}
.mobile-menu .sheet a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
}
.mobile-menu .sheet a:hover { background: var(--hover); }
.mobile-menu .sheet a.active { color: var(--accent); }
.mobile-menu .sheet a.cta { color: var(--accent); font-weight: 600; border-top: 1px solid var(--hairline); border-radius: 0 0 10px 10px; margin-top: 4px; padding-top: 14px; }

/* --- page scaffold ------------------------------------------------------ */
main { flex: 1; width: 100%; }
.page { max-width: 1200px; margin: 0 auto; padding: 44px 32px 96px; }

.crumb { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .06em; }
.crumb a:hover { color: var(--accent); }
.page-head { display: flex; align-items: flex-end; gap: 24px; margin-top: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 15.5px; padding-bottom: 9px; max-width: 52ch; }

/* mode tabs */
.modes { display: flex; gap: 6px; margin: 34px 0 0; border-bottom: 1px solid var(--hairline); }
.mode {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--muted);
  padding: 10px 18px 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.mode:hover { color: var(--ink); }
.mode.on { color: var(--ink); border-bottom-color: var(--accent); }
.mode .n {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: var(--pill);
  padding: 1px 7px;
  border-radius: 999px;
}

/* stat band */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--hairline); }
.stat { padding: 26px 28px 24px 0; }
.stat + .stat { border-left: 1px solid var(--hairline); padding-left: 28px; }
.stat .label {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
.stat .value { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -.02em; margin-top: 6px; }
.stat .value small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.stat .value .live { color: var(--red); }

/* hairline data tables */
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--hairline-dark);
}
table.data th.r, table.data td.r { text-align: right; }
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--hairline); font-size: 15px; vertical-align: middle; }
table.data tr:hover td { background: var(--hover); }
table.data tr.you td { background: var(--accent-wash); }
table.data td.rank { font-family: var(--mono); color: var(--muted); font-size: 13.5px; width: 48px; }
table.data tr.top td.rank { color: var(--accent-deep); font-weight: 600; }
table.data td.num { font-family: var(--mono); font-size: 14px; }
table.data td.rating { font-family: var(--mono); font-weight: 600; font-size: 15px; }

.snake-cell { display: flex; align-items: center; gap: 12px; }
.chip {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 0 0 1px rgba(0, 0, 0, .06);
  width: 34px;
  height: 22px;
  border-radius: 6px 12px 12px 6px;
  position: relative;
  flex-shrink: 0;
}
.chip::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  right: 6px;
  top: 6px;
}
.snake-cell .name { font-weight: 600; letter-spacing: -.01em; }
.snake-cell .name:hover { color: var(--accent); }
.snake-cell .owner { font-size: 12.5px; color: var(--muted); display: block; margin-top: -2px; }
.snake-details { min-width: 0; }
.snake-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
/* No text-transform/letter-spacing here on purpose: tag names are mixed case ("Fly.io", "C#"). */
.snake-tag { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 11px; background: var(--pill); color: var(--muted); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }

.delta { font-family: var(--mono); font-size: 12px; margin-left: 8px; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }

/* pager */
.pager { display: flex; gap: 8px; margin-top: 26px; font-family: var(--mono); font-size: 13px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.pager a { padding: 6px 12px; border: 1px solid var(--hairline); border-radius: 8px; }
.pager a:hover { border-color: var(--ink); color: var(--ink); }
.pager .cur { padding: 6px 12px; background: var(--ink); color: var(--paper); border-radius: 8px; }
.pager .spacer { flex: 1; }

/* side rail */
.rail h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.rail .block { padding: 26px 0; border-bottom: 1px solid var(--hairline); }
.rail .block:first-child { padding-top: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); position: relative; flex-shrink: 0; }
.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--red);
  animation: live-ping 1.8s cubic-bezier(.3, .6, .35, 1) infinite;
}
@keyframes live-ping { 0% { transform: scale(.4); opacity: .75; } 100% { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; opacity: 0; } }
.feed { list-style: none; margin-top: 14px; }
.feed li { display: flex; gap: 12px; padding: 9px 0; font-size: 13.5px; align-items: baseline; }
.feed .t { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; width: 52px; flex-shrink: 0; }
.feed b { font-weight: 600; }
.feed .place { font-family: var(--mono); font-size: 12px; }
.feed .p1 { color: var(--accent-deep); font-weight: 600; }
.feed .p4 { color: var(--muted); }
.meta-list { margin-top: 14px; font-size: 14px; }
.meta-list div { display: flex; justify-content: space-between; padding: 7px 0; }
.meta-list dt { color: var(--muted); }
.meta-list dd { font-family: var(--mono); font-size: 13px; }

/* table + rail layout */
.grid { display: grid; grid-template-columns: 1fr 320px; gap: 56px; margin-top: 44px; align-items: start; }

/* small variants & badges */
.stat .value.sm { font-family: var(--mono); font-weight: 500; font-size: 17px; padding-top: 9px; }
.btn.sm { padding: 5px 14px; font-size: 13px; }
.badge { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: var(--pill); color: var(--muted); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ok { color: var(--up); }
.badge.warn { color: var(--down); }
.section { margin-top: 48px; }
.section h2 { margin-bottom: 4px; }
.section table.data { margin-top: 16px; }
p.empty { color: var(--muted); font-size: 14.5px; margin: 18px 0; }

/* sort bar above data tables */
.sortbar { display: flex; gap: 14px; align-items: baseline; margin-bottom: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sortbar span:first-child { text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; }
.sortbar a:hover { color: var(--ink); }
.sortbar .on { color: var(--accent-deep); font-weight: 600; }

/* rail: user snake rows + join form */
.rail .mine { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.rail .mine .mname { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .mine form { display: inline; }
.rail .mstats { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 4px 0 0 44px; }
.rail .railp { font-size: 14px; color: var(--muted); margin-top: 10px; }
.owner-inline { color: var(--muted); font-size: 12.5px; }
.join-form { display: flex; gap: 8px; margin-top: 16px; }
.join-form select { flex: 1; min-width: 0; font-family: var(--body); font-size: 14px; padding: 8px 10px; border: 1px solid var(--hairline-dark); border-radius: 10px; background: var(--card); color: var(--ink); }

/* --- flash message ------------------------------------------------------ */
.flash-message {
  max-width: 1200px;
  margin: 0 auto;
  width: calc(100% - 64px);
  background: var(--accent-wash);
  border: 1px solid var(--accent);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14.5px;
  animation: flash-in .4s ease, flash-out .5s 6s forwards;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flash-out { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }

.live-refresh-expired {
  margin: 16px 0;
  background: var(--accent-wash);
  border: 1px solid var(--accent);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14.5px;
}
.live-refresh-expired a { font-weight: 600; }

/* --- footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--hairline); margin-top: 64px; }
.site-footer .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.site-footer a:hover { color: var(--accent); }
.site-footer .credit { color: var(--muted); }
.site-footer .credit::before { content: "—"; margin-right: 8px; color: var(--hairline-dark); }
.site-footer .spacer { flex: 1; }

/* --- legacy classes (pre-redesign pages), tokenized ---------------------- */
/* These keep not-yet-redesigned pages presentable inside the new shell.
   Their slices will replace them with the primitives above. */
.pagination { display: flex; gap: 8px; align-items: center; margin: 16px 0; font-family: var(--mono); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--hairline); border-radius: 8px; color: var(--muted); }
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination .disabled { color: var(--hairline-dark); pointer-events: none; }
.rating-positive { color: var(--up); font-weight: 600; }
.rating-negative { color: var(--down); font-weight: 600; }
.rating-neutral { color: var(--muted); }
.rating-chart-container { margin: 16px 0; }
.rating-chart { border: 1px solid var(--hairline); border-radius: 8px; display: block; }
.rating-chart .grid { stroke: var(--hairline); }
.rating-chart .line { stroke: var(--accent); }
.rating-chart .lbl { fill: var(--muted); font-family: var(--mono); font-size: 11px; }

/* Leaderboard entry page */
.entry-avatar { width: 44px; height: 44px; align-self: center; }
.owner-avatar { width: 24px; height: 24px; margin-right: 8px; }
.stat .formrow { margin-top: 8px; font-size: 15px; letter-spacing: 2px; }

/* Empty-state block with CTAs (tournaments, future empty listings) */
.empty-state { margin: 28px 0 8px; }
.empty-state .cta-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.activity-feed { max-height: 300px; overflow-y: auto; border: 1px solid var(--hairline); border-radius: 12px; padding: 12px; }
.activity-feed-item { padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.activity-feed-item:last-child { border-bottom: none; }

/* --- forms (shared editorial form kit) ----------------------------------- */
/* Promoted post-redesign from the slice 5/7/8 sections so every stacked form
   (profile edit, snake create/edit, claim flow, tournament create/edit)
   shares one recipe. Inline row forms (.join-form, .seed-form, .rail-form)
   stay page-local. */
.form-stack { display: flex; flex-direction: column; gap: 20px; margin-top: 22px; max-width: 560px; }
.form-stack > .btn { align-self: flex-start; margin-top: 4px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--hairline-dark);
  border-radius: 12px;
  padding: 11px 14px;
  min-height: 46px;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.field input[type="url"] { font-family: var(--mono); font-size: 13.5px; }
.field input[type="number"] { font-family: var(--mono); }
.field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.form-cta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.form-error { background: var(--red-wash); border: 1px solid var(--red); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 16px 0; }
.form-ok { background: color-mix(in srgb, var(--up) 12%, transparent); border: 1px solid var(--up); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 16px 0; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) {
  .form-stack > .btn { align-self: stretch; text-align: center; }
}

/* --- interaction layer: scroll reveal + counters, all pages -------------- */
/* Progressive enhancement: elements are fully visible with no JS. JS (see
   /static/interactions.js) adds .is-visible via IntersectionObserver, and
   fills in [data-count] targets with an eased count-up. */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ==========================================================================
   Per-page sections. Each redesign slice owns exactly one block below and
   must not edit outside it — keeps parallel slice PRs conflict-free.
   ========================================================================== */

/* --- page: home (slice 4) ------------------------------------------------ */
/* hero (logged out) */
.home .hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 64px;
  align-items: center;
  padding: 28px 0 24px;
}
.home .kicker {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.home .kicker::before { content: ""; width: 28px; height: 1.5px; background: var(--accent); }
.home .hero h1 { font-size: clamp(42px, 5vw, 64px); line-height: 1.02; }
.home .hero h1 em, .home .statement h2 em { font-style: normal; color: var(--accent); }
.home .hero .lede { margin-top: 26px; font-size: 19px; color: var(--muted); max-width: 44ch; }
.home .cta-row { margin-top: 36px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.home .cta-row .btn { padding: 11px 24px; }
.home .cta-note { font-size: 13.5px; color: var(--muted); margin-top: 16px; font-family: var(--mono); }
.home .cta-note code { font: inherit; }

/* decorative board — intentionally dark-framed in both themes.
   Two combatants, two brand colors: blue vs. red, sharing one gold food dot. */
.home .board-frame { position: relative; }
.home .board {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  aspect-ratio: 1;
  gap: 4px;
  padding: 14px;
  background: linear-gradient(180deg, #101A32, #0A0F1C);
  border: 1px solid #22304F;
  border-radius: 20px;
  box-shadow:
    0 24px 60px -24px rgba(3, 6, 14, .6),
    0 0 70px -32px rgba(77, 145, 255, .45),
    0 0 70px -32px rgba(255, 77, 88, .35);
}
.home .board .cell { background: #16213C; border-radius: 4px; position: relative; }
.home .board .seg { border-radius: 4px; }
.home .board .seg.head { border-radius: 7px; }
.home .board .seg.head::after {
  content: "";
  position: absolute;
  width: 18%;
  height: 18%;
  background: #0A0F1C;
  border-radius: 50%;
  top: 24%;
  right: 24%;
}
.home .board .food::after {
  content: "";
  position: absolute;
  inset: 26%;
  background: #FFB020;
  border-radius: 50%;
  box-shadow: 0 0 9px rgba(255, 176, 32, .55);
  animation: food-glow 2.6s ease-in-out infinite;
}
@keyframes food-glow {
  0%, 100% { box-shadow: 0 0 9px rgba(255, 176, 32, .55); transform: scale(1); }
  50% { box-shadow: 0 0 14px rgba(255, 176, 32, .8); transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .home .board .food::after { animation: none; }
}
.home .board-caption {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translate(-50%, 100%);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* recent-games strip (static) */
.home .strip {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-top: 64px;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
}
.home .strip .inner { display: inline-block; }
.home .strip b { font-weight: 600; color: var(--ink); }
.home .strip .win { color: var(--red-deep); font-weight: 600; }
.home .strip .lose { color: var(--muted); font-weight: 600; }
.home .strip .sep { margin: 0 26px; color: var(--hairline-dark); }

/* editorial features (logged out) */
.home .features { padding: 72px 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); }
.home .feature { padding: 8px 36px 8px 0; }
.home .feature + .feature { border-left: 1px solid var(--hairline); padding-left: 36px; }
.home .feature .num { font-family: var(--mono); font-size: 12.5px; color: var(--accent); font-weight: 600; }
.home .feature h2 { font-size: 21px; letter-spacing: -.01em; margin: 14px 0 10px; }
.home .feature p { font-size: 15px; color: var(--muted); }
.home a.more { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--accent); padding: 4px 0; }
.home a.more:hover { color: var(--accent-deep); }

/* closing statement (logged out) */
.home .statement { padding: 88px 0 24px; text-align: center; }
.home .statement h2 {
  font-weight: 800;
  letter-spacing: -.03em;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.12;
  max-width: 21ch;
  margin: 0 auto;
}
.home .statement p { color: var(--muted); margin: 22px auto 0; max-width: 52ch; }
.home .statement .btn { margin-top: 34px; display: inline-block; }

/* welcome band (logged in) */
.home .welcome { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.welcome-avatar { width: 64px; height: 64px; border: 1px solid var(--hairline-dark); }
.home .welcome .who { min-width: 0; }
/* GitHub logins run to 39 chars; never let the welcome heading push the page wide. */
.home .welcome h1 { font-size: clamp(30px, 3.4vw, 40px); overflow-wrap: anywhere; }
.home .welcome .sub { color: var(--muted); font-size: 15.5px; margin-top: 4px; }
.home .welcome .cta-row { margin: 0 0 0 auto; }

/* snake quick-status rows (logged in) */
.home .snakes .rows { margin-top: 16px; border-top: 1px solid var(--hairline-dark); }
.home .srow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  min-height: 44px;
  border-bottom: 1px solid var(--hairline);
}
.home .srow:hover { background: var(--hover); }
.home .srow .sname { font-weight: 600; letter-spacing: -.01em; }
.home .srow:hover .sname { color: var(--accent); }
.home .srow .surl {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home .srow .badge { margin-left: auto; }
.home .srow .surl + .badge { margin-left: 0; }

/* ladder preview + recent games rail */
.home .grid { margin-top: 56px; }
.home .ladder-sub { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.home .ladder table.data { margin-top: 18px; }
.home .ladder a.more { margin-top: 18px; }

@media (max-width: 900px) {
  .home .hero { grid-template-columns: 1fr; gap: 56px; padding-top: 12px; }
  .home .features { grid-template-columns: 1fr; gap: 32px; padding: 56px 0 8px; }
  .home .feature { padding: 0; }
  .home .feature + .feature { border-left: none; border-top: 1px solid var(--hairline); padding: 32px 0 0; }
  .home .welcome .cta-row { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  .home .hero { gap: 44px; }
  .home .strip { margin-top: 48px; }
  .home .strip .sep { margin: 0 18px; }
  .home .board { gap: 3px; padding: 10px; border-radius: 16px; }
  .home .statement { padding: 64px 0 16px; }
  .home .srow .badge { display: none; }
}

/* --- page: game theater (slice 3) ---------------------------------------- */

/* Theater pages resolve their theme from the theater axis (create_theater_page).
   The stage panel frames the board.battlesnake.com iframe. */
.refresh-link { color: var(--accent); }
.live-pill { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--red); color: var(--red-deep); display: inline-flex; gap: 7px; align-items: center; margin-left: 12px; vertical-align: 1px; }
.live-pill.quiet { border-color: var(--hairline-dark); color: var(--muted); }
.theater { display: grid; grid-template-columns: 1fr 320px; gap: 40px; margin-top: 28px; align-items: start; }
/* stage stays dark in BOTH theater themes, per the locked mockup */
.board-wrap { background: #1E181D; border: 1px solid #2A232A; border-radius: 18px; padding: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 24px 60px -30px rgba(0, 0, 0, .4); }
.board-wrap iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 10px; background: #171117; }
.theater-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.theater-rail-head { font-size: 18px; display: flex; align-items: baseline; gap: 10px; }
.theater-rail-head .sub-count { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; }
.snakes { margin-top: 10px; }
.scard { border: 1px solid var(--hairline); border-radius: 14px; padding: 13px 16px; margin-top: 10px; background: var(--card); }
.scard .top { display: flex; gap: 12px; align-items: center; }
.scard .name { font-weight: 600; letter-spacing: -.01em; }
.scard .owner { font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.scard .place { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.scard.p1 { border-color: var(--accent); }
.scard.p1 .place { color: var(--accent-deep); font-weight: 600; }
.gmeta { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.share-row { display: flex; gap: 8px; margin-top: 12px; }
.share-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: var(--card); border: 1px solid var(--hairline-dark); border-radius: 10px; padding: 8px 12px; }
.share-row input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

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

/* --- page: profile + snakes (slice 5) ------------------------------------ */

/* identity header (/me) */
.profile-head { display: flex; align-items: center; gap: 22px; margin-top: 36px; }
.profile-head .avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid var(--hairline-dark);
  flex-shrink: 0;
  background: var(--pill);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .45);
}
.profile-head .who { min-width: 0; }
.profile-head h2 { font-weight: 800; letter-spacing: -.02em; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; overflow-wrap: anywhere; }
.profile-head .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 4px; }
.profile-head .bio { font-size: 15px; color: var(--muted); margin-top: 8px; max-width: 60ch; white-space: pre-wrap; overflow-wrap: break-word; }

.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* snakes list table (/battlesnakes) */
.head-actions { margin-left: auto; padding-bottom: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.url-cell { font-family: var(--mono); font-size: 13px; color: var(--muted); max-width: 340px; }
.url-cell a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.url-cell a:hover { color: var(--accent); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline; margin: 0; }

@media (max-width: 640px) {
  .profile-head { gap: 16px; }
  .profile-head .avatar { width: 60px; height: 60px; }
  .profile-actions .btn, .head-actions .btn { padding: 11px 20px; }
  .row-actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .row-actions .btn.sm { padding: 9px 16px; }
}

/* --- page: customizations (slice 6) --------------------------------------- */

.cz-note { font-size: 14px; color: var(--muted); margin-top: 18px; }
.cz-note a { color: var(--accent); }
.cz-group { margin-top: 48px; }
.cz-group-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--hairline); padding-bottom: 10px; }
.cz-group-head h2 { font-size: 22px; }
.cz-count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.cz-kind { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; margin: 24px 0 12px; }
.cz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.cz-item { border: 1px solid var(--hairline); border-radius: 14px; padding: 14px 10px 12px; text-align: center; background: var(--card); transition: border-color .15s, transform .15s; }
.cz-item:hover { border-color: var(--hairline-dark); transform: translateY(-2px); }
.cz-item.locked .cz-swatch, .cz-item.locked .cz-name { opacity: .55; }
/* Snake head/tail art is dark line-work on transparent; a fixed light
   swatch keeps every asset legible in both site themes. */
.cz-swatch { background: #F4F1EB; border-radius: 10px; aspect-ratio: 1; display: grid; place-items: center; padding: 12px; }
.cz-swatch img { width: 100%; height: 100%; object-fit: contain; }
.cz-name { font-weight: 600; font-size: 13.5px; letter-spacing: -.01em; margin: 10px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  .cz-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
}

/* --- page: claim/import (slice 7) ------------------------------------------ */

/* Narrow centered column for the play-account claim/recovery flow. */
.form-page { max-width: 460px; margin: 0 auto; }
.form-page .crumb { margin-bottom: 4px; }
.form-page .page-head { margin-bottom: 20px; }
.form-page h1 { font-size: clamp(28px, 3vw, 38px); }
.form-page .lede { color: var(--ink); font-size: 15.5px; margin-bottom: 16px; }
.form-page .fine { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.form-page .fine a { color: var(--accent); }
.form-page .fine.alt { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--hairline); }

.form-page .form-stack { margin-top: 8px; }
.form-page .form-stack .fine { margin: 0; }

/* --- page: tournaments (slice 8) -------------------------------------------- */

.page-head .spacer { flex: 1; }
.head-cta { margin-bottom: 12px; }
.head-status { margin-bottom: 14px; }
.champ-chip { display: inline-block; vertical-align: -2px; margin-right: 8px; }
.badge.live { color: var(--red-deep); background: var(--red-wash); }

.round-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--red-deep);
  border: 1px solid var(--red);
  background: var(--red-wash);
  border-radius: 999px;
  padding: 5px 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  letter-spacing: .04em;
  margin-bottom: 12px;
  white-space: nowrap;
}
.round-pill .live-dot { width: 7px; height: 7px; flex-shrink: 0; }

.tourney-desc { margin-top: 16px; max-width: 70ch; font-size: 15.5px; }

/* bracket */
.bracket-note {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 44px;
}
.bracket-scroll { overflow-x: auto; margin-top: 10px; padding-bottom: 8px; }
.round-labels { display: grid; border-bottom: 1px solid var(--hairline); padding-bottom: 10px; }
.round-labels span {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}
.bracket { display: grid; margin-top: 18px; }

.bracket .match {
  border: 1px solid var(--hairline-dark);
  border-radius: 12px;
  background: var(--card);
  align-self: center;
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  position: relative;
}
.bracket .match .tag {
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.bracket .team { display: flex; align-items: center; gap: 10px; padding: 7px 2px; font-size: 14.5px; }
.bracket .team + .team { border-top: 1px solid var(--hairline); }
.bracket .team .chip { width: 24px; height: 16px; border-radius: 4px 9px 9px 4px; }
.bracket .team .chip::after { width: 3px; height: 3px; right: 4px; top: 4px; }
.bracket .chip.tbd { border: 1px dashed var(--hairline-dark); background: none; box-shadow: none; }
.bracket .chip.tbd::after { display: none; }
.bracket .team .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -.01em;
}
.bracket .team .score { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.bracket .team.w .name { font-weight: 700; }
.bracket .team.w .score { color: var(--accent-deep); font-weight: 600; }
.bracket .team.l .name, .bracket .team.l .score { color: var(--muted); }
.bracket .team.tbd .name { color: var(--muted); font-style: italic; }

.bracket .conn {
  border-top: 1px solid var(--hairline-dark);
  border-right: 1px solid var(--hairline-dark);
  border-bottom: 1px solid var(--hairline-dark);
}
.bracket .conn-h { align-self: center; height: 1px; background: var(--hairline-dark); }

.bracket .match.live {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-wash), 0 12px 30px -18px rgba(200, 30, 41, .5);
}
.bracket .match.live .tag { color: var(--red); font-weight: 600; }
.bracket .match.live .tag .live-dot { width: 5px; height: 5px; }
.bracket .match.live .team .score { color: var(--ink); font-weight: 600; }

.bracket .mgames {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 5px 2px 2px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
}
.bracket .mgames a { color: var(--muted); }
.bracket .mgames a:hover { color: var(--accent); }

/* intentionally dark (navy) in both themes: a sliver of the game theater */
.theater-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  background:
    linear-gradient(rgba(233, 238, 249, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 238, 249, .05) 1px, transparent 1px),
    #0D1428;
  background-size: 9px 9px, 9px 9px, auto;
  border-radius: 8px;
  padding: 8px 12px;
  transition: filter .15s;
}
.theater-strip:hover { filter: brightness(1.25); }
.theater-strip .play {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF4D58;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 0 12px -2px rgba(255, 77, 88, .8);
}
.theater-strip .play svg { width: 8px; height: 8px; display: block; margin-left: 1px; }
.theater-strip .label { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: #8894B8; }
.theater-strip .go { margin-left: auto; font-family: var(--mono); font-size: 11px; color: #FF4D58; white-space: nowrap; }

.bracket .champ {
  align-self: center;
  width: 100%;
  border: 1.5px dashed var(--hairline-dark);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
}
.bracket .champ.crowned {
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--hover), var(--hover)) padding-box,
    linear-gradient(135deg, var(--accent), var(--red)) border-box;
}
.bracket .champ .glyph { font-size: 20px; line-height: 1; }
.bracket .champ .label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 8px;
}
.bracket .champ .who { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--muted); margin-top: 4px; }
.bracket .champ.crowned .who { color: var(--ink); font-size: 17px; }

/* registered snakes: seed move + unregister row actions */
.reg-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.seed-form { display: inline-flex; gap: 6px; align-items: center; }
.seed-form input {
  width: 64px;
  font-family: var(--mono);
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--hairline-dark);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}

/* rail forms (owner controls, import, register) */
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.owner-actions form { display: inline; }
.rail-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.rail-form select, .rail-form input {
  font-family: var(--body);
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--hairline-dark);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
.rail-form select { flex: 1; min-width: 0; }
.rail-form input[type="number"] { width: 76px; font-family: var(--mono); }
.rail-form .lbl { font-family: var(--mono); font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .bracket-scroll { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
  .reg-actions .btn.sm, .owner-actions .btn.sm { padding: 10px 16px; }
  .seed-form input { padding: 10px 8px; }
}

/* --- responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
  .hide-md { display: none; }
  .site-nav .links { display: none; }
  .mobile-menu { display: block; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: none; padding-left: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--hairline); padding-left: 28px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .site-nav { gap: 12px; padding: 18px 20px; }
  /* sign-in moves into the mobile menu sheet; avatar stays for logged-in */
  .site-nav > .btn.solid { display: none; }
  .wordmark .event-tag { display: none; }
  .nav-user-name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .theme-btn { width: 44px; height: 44px; }
  .appearance { right: 16px; left: 16px; width: auto; top: 80px; }
  .page { padding: 28px 20px 96px; }
  .flash-message { width: calc(100% - 40px); }
  .modes { overflow-x: auto; scrollbar-width: none; }
  .modes::-webkit-scrollbar { display: none; }
  .mode { white-space: nowrap; }
  table.data th, table.data td { padding-left: 8px; padding-right: 8px; }
  .site-footer .inner { padding: 24px 20px; }
}
/* Narrow phones: logged-in nav is glyph + 2 theme buttons + menu + avatar.
   With the wordmark text that sums past 375px and the avatar clips. */
@media (max-width: 420px) {
  .wordmark-text { display: none; }
  .wordmark .event-tag { display: none; }
}

/* --- page: create game --------------------------------------------------- */

.gc.grid { margin-top: 40px; }
.gc .rail { position: sticky; top: 28px; }
.gc-section h2 { margin-bottom: 2px; }
.gc-sub { color: var(--muted); font-size: 14.5px; }

/* selectable snake rows (own snakes + search results) */
.gc-rows { margin-top: 16px; }
.gc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--hairline);
  background: var(--card);
  border-radius: 14px;
  padding: 13px 16px;
  margin-top: 10px;
  transition: border-color .15s;
}
.gc-row:hover { border-color: var(--hairline-dark); }
.gc-row.sel { border-color: var(--accent); }
.gc-row .gc-who { min-width: 0; flex: 1; }
.gc-row .gc-name { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; flex-wrap: wrap; }
.gc-row .gc-url {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gc-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.gc-actions form { display: inline; margin: 0; }
.gc-empty { margin-top: 16px; }
.gc-empty .btn { display: inline-block; margin-top: 14px; }
.gc-empty p:first-child { font-weight: 600; }

/* public snake search */
.gc-search { display: flex; gap: 8px; margin-top: 16px; max-width: 480px; }
.gc-search input {
  flex: 1;
  min-width: 0;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--hairline-dark);
  border-radius: 12px;
  padding: 10px 14px;
}
.gc-search input:hover { border-color: var(--muted); }
.gc-search input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.gc-results-head { margin-top: 26px; }
.gc-none { color: var(--muted); font-size: 14.5px; margin-top: 18px; }

/* lineup rail */
.gc-slots { margin-top: 14px; }
.gc-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--hairline);
  background: var(--card);
  border-radius: 12px;
  padding: 9px 12px;
  margin-top: 8px;
  min-height: 46px;
}
.gc-slot-name { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-slot form { display: inline; margin-left: auto; }
.gc-slot .badge { flex-shrink: 0; }
.gc-slot.empty {
  border-style: dashed;
  border-color: var(--hairline-dark);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  justify-content: center;
}
.gc-x {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.gc-x:hover { background: var(--red-wash); color: var(--red-deep); }
.gc-hint { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
.gc-reset { margin-top: 10px; }

/* settings + CTA */
.gc-settings { max-width: none; gap: 16px; margin-top: 16px; }
.gc-settings > .btn { align-self: stretch; text-align: center; margin-top: 8px; padding: 11px 24px; }

@media (max-width: 980px) {
  .gc.grid { grid-template-columns: 1fr; gap: 8px; }
  .gc .rail { position: static; }
}
@media (max-width: 640px) {
  .gc-row { flex-wrap: wrap; padding: 14px 16px; }
  .gc-row .gc-who { flex-basis: calc(100% - 40px); }
  .gc-actions { width: 100%; }
  .gc-actions form { flex: 1; }
  .gc-actions .btn { width: 100%; padding: 10px 14px; }
  .gc-search { max-width: none; }
}
.gc-solo-warn { color: var(--red-deep); }

/* game view: queued-game placeholder (board viewer has no frames to show yet) */
.board-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #9C8F99;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
