/* GameBoard: a web-1 / classic-Mac desktop look, after Poolsuite, in the
   penguin's colours: indigo desktop, snow windows, navy ink, beak orange. */

:root {
  /* desktop */
  --desk: #3f3f74;
  --desk-dot: rgb(255 255 255 / 0.07);
  --desk-ink: #f3f2ff;
  --desk-muted: #c3c2e6;
  /* windows */
  --paper: #f5f6fb;
  --white: #ffffff;
  --ink: #222034;
  --muted: #5f5d80;
  --link: #3f3f74;
  /* accents */
  --beak: #df7126;
  --orange: #f4a46c;
  --orange-hi: #f8bb8f;
  --peach: #ffe3cd;
  --ice: #d3e3f6;
  --periwinkle: #e1e1f4;
  --mint: #cbeedb;
  --sun: #ffe6a3;
  --lilac: #e8daf3;
  --stone: #e2e3ea;
  --rose: #f7c6c8;
  --good: #2f8a4c;
  --bad: #c3303b;
  --ui: Tahoma, Verdana, Geneva, "Segoe UI", sans-serif;
  --body: Verdana, Geneva, Tahoma, sans-serif;
  --shadow: 3px 3px 0 rgb(14 12 32 / 0.45), 0 16px 34px rgb(10 8 30 / 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 13px/1.5 var(--body);
  background-color: var(--desk);
  background-image: radial-gradient(var(--desk-dot) 1px, transparent 1px);
  background-size: 4px 4px;
}
body.no-scroll { overflow: hidden; }
#app { flex: 1; display: flex; flex-direction: column; }
::selection { background: var(--orange-hi); }

a { color: var(--link); }
a:hover { background: var(--peach); }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-family: var(--ui); font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 10px 0 4px; }

code {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.92em;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 0 4px;
}

/* ---------- form controls ---------- */

input, select, textarea {
  font: 13px var(--body);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgb(0 0 0 / 0.12);
  padding: 6px 8px;
  width: 100%;
  min-width: 0;
}
textarea { resize: vertical; }
select { width: auto; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 2px var(--orange), inset 1px 1px 0 rgb(0 0 0 / 0.12); }
input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--beak); box-shadow: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 700 12px/1 var(--ui);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 5px;
  padding: 8px 14px;
  box-shadow: inset -1px -1px 0 rgb(0 0 0 / 0.14), inset 1px 1px 0 var(--white), 1px 1px 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}
.btn:hover { background: var(--white); }
.btn:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: inset 1px 1px 0 rgb(0 0 0 / 0.18); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--orange); }
.btn.primary:hover { background: var(--orange-hi); }
.btn.danger { background: var(--rose); color: #7d0f1c; }
.btn.danger:hover { background: #fad6d7; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--white); }
.btn.sm { padding: 6px 10px; }
.btn.block { width: 100%; }

.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}
.link:hover { background: var(--peach); }
.link.danger { color: var(--bad); }

/* ---------- utility ---------- */

.boot { padding: 48px; text-align: center; font: 700 16px var(--ui); color: var(--desk-ink); }
.muted { color: var(--muted); }
.xs { font-size: 11px; }
.center { text-align: center; }
.pad { padding: 8px 0; }
.spacer, .grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row > input { flex: 1; width: auto; }
.form-error { color: var(--bad); font-weight: bold; }
.form-error::before { content: "⚠ "; }

/* ---------- windows ---------- */

.win {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
/* Classic title bar: pinstripes, with the close box and title masking them. */
.win-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 25px;
  padding: 6px 7px;
  flex: none;
  border-bottom: 1px solid var(--ink);
  border-radius: 5px 5px 0 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(var(--ink) 0 1px, transparent 1px 2px);
  background-clip: content-box;
  background-origin: content-box;
}
.win-close {
  position: relative;
  flex: none;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--paper);
}
/* Close boxes that actually close something are faded red; hovering shows an
   × drawn from two bars, so it sits dead centre whatever the font. */
.win-bar button.win-close { background: #f2b9bc; cursor: pointer; }
.win-bar button.win-close:hover,
.win-bar button.win-close:focus-visible { background: #ec8f95; outline: none; }
.win-bar button.win-close:active { background: #d9626a; }
button.win-close:hover::before,
button.win-close:hover::after,
button.win-close:focus-visible::before,
button.win-close:focus-visible::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 1.5px;
  background: var(--ink);
  transform: translate(-50%, -50%) rotate(45deg);
}
button.win-close:hover::after,
button.win-close:focus-visible::after { transform: translate(-50%, -50%) rotate(-45deg); }
.win-title {
  margin: 0 auto;
  padding: 0 8px;
  background: var(--paper);
  font: 700 12px/13px var(--ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}
.win-bar .count {
  flex: none;
  padding: 0 6px;
  background: var(--paper);
  font: 700 11px/13px var(--ui);
}
.win-body { padding: 14px; min-width: 0; }

/* ---------- menu bar ---------- */

.menubar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  height: 30px;
  padding: 0 8px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  font: 12px var(--ui);
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.2);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 4px;
  color: var(--ink);
  font: 700 14px var(--ui);
  text-decoration: none;
}
.brand:hover { background: transparent; }
.brand img { width: 22px; height: 22px; image-rendering: pixelated; border: 1px solid var(--ink); border-radius: 3px; }
.brand.big { flex-direction: column; justify-content: center; font-size: 24px; padding: 4px 0 0; }
.brand.big img { width: 64px; height: 64px; border-radius: 6px; box-shadow: 3px 3px 0 var(--beak); }
.menu-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  background: none;
  border: 0;
  font: inherit;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover:not(.static) { background: var(--ink); color: var(--paper); }
.menu-item.static { cursor: default; color: var(--muted); }
.nav-badge {
  min-width: 17px;
  padding: 0 4px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--beak);
  color: var(--white);
  font: 700 11px/15px var(--ui);
  text-align: center;
}
.nav-badge[hidden] { display: none; }

.main { flex: 1; width: 100%; max-width: 1800px; margin: 0 auto; padding: 22px 18px 32px; }

/* ---------- footer ---------- */

.footer { padding: 18px 16px 22px; text-align: center; }
.badges88 { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 10px; }
.b88 {
  display: inline-flex;
  align-items: center;
  width: 88px;
  height: 31px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--white);
  font: 700 8px/1.1 var(--ui);
  text-transform: uppercase;
  text-align: center;
  box-shadow: 2px 2px 0 rgb(0 0 0 / 0.3);
}
.b88 > b, .b88 > img {
  flex: none;
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-right: 1px solid var(--ink);
  font-size: 10px;
}
.b88 > img { width: 31px; padding: 4px; image-rendering: pixelated; }
.b88-go > b { background: var(--ice); }
.b88-sql > b { background: var(--periwinkle); }
.b88-view > b { background: var(--sun); font-size: 8px; }
.b88-peng > img { background: var(--desk); }
.marquee {
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto;
  font: 12px var(--ui);
  color: var(--desk-muted);
  white-space: nowrap;
}
.marquee span { display: inline-block; padding-left: 100%; animation: marquee 28s linear infinite; }
.ticker-add {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--desk-muted);
  font: 11px var(--ui);
  text-decoration: underline;
  cursor: pointer;
}
.ticker-add:hover { color: var(--desk-ink); }
@keyframes marquee { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; padding-left: 0; }
}

/* ---------- auth ---------- */

.auth-wrap { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .win-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px 22px; }
.tagline { margin: -8px 0 0; text-align: center; font: 11px var(--ui); color: var(--muted); }
.notice { margin: 0; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 4px; background: var(--sun); }

/* ---------- boards list ---------- */

.page-head { margin-bottom: 18px; color: var(--desk-ink); }
.page-head p { margin: 4px 0 0; }
.page-head .muted { color: var(--desk-muted); }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; align-items: start; }
.board-link { display: block; color: inherit; text-decoration: none; }
.board-link:hover { background: none; }
.board-link .win { transition: transform 0.08s, box-shadow 0.08s; }
.board-link:hover .win { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--beak); }
.board-card .win-body { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.board-card p { margin: 0; }
.board-meta { margin-top: auto; font: 11px var(--ui); color: var(--muted); }
.editors { font-size: 12px; overflow-wrap: anywhere; }
.editors b { font: 700 11px var(--ui); color: var(--muted); }
.board-title .editors { margin-top: 4px; }
.view-only {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 6px 0 0;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--sun);
  font-size: 12px;
}
.pill.hot { background: var(--orange); color: var(--ink); }
.mode-switch .mode-light {
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--stone);
}
.mode-switch.on { background: var(--orange); }
.mode-switch.on .mode-light { background: #3fd16b; box-shadow: 0 0 4px #3fd16b; }
.mode-switch.on:hover { background: var(--ink); }
.admin-note { background: var(--peach); }
.section-title { margin: 26px 0 12px; font-size: 18px; color: var(--desk-ink); }
.page-head + .section-title { margin-top: 0; }
.section-empty { margin: 0; color: var(--desk-muted); }
.board-link { cursor: pointer; outline: none; }
.board-link:focus-visible .win { box-shadow: 0 0 0 3px var(--orange); }
.row > select { flex: 1; }
.danger-zone { margin-top: 6px; padding-top: 12px; border-top: 1px dotted var(--ink); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.folder {
  position: relative;
  width: 38px;
  height: 27px;
  margin-top: 7px;
  background: var(--ice);
  border: 1px solid var(--ink);
  border-radius: 0 3px 3px 3px;
  box-shadow: inset 0 5px 0 #e9f1fb;
}
.folder::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -7px;
  width: 15px;
  height: 6px;
  background: var(--ice);
  border: 1px solid var(--ink);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}
.new-board { border-style: dashed; }
.empty { display: grid; place-items: center; padding: 48px 16px; }
.alert { width: 100%; max-width: 420px; }
.alert .win-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.alert p { margin: 0; }

/* ---------- board view ---------- */

.board-head { margin-bottom: 18px; }
.board-head .win-body { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.board-title p { margin: 4px 0 0; max-width: 70ch; }
.crumb { font: 700 12px var(--ui); }
.board-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.board-actions input[type="search"] { width: 200px; }

.columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 300px);
  gap: 14px;
  overflow-x: auto;
  padding: 2px 6px 16px 2px;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--paper) var(--desk);
}
.column { min-height: 220px; scroll-snap-align: start; }
.column .win-bar { background-color: var(--col); }
.column .win-close, .column .win-title, .column .win-bar .count { background: var(--col); box-shadow: 0 0 0 3px var(--col); }
.col-c-periwinkle { --col: var(--periwinkle); }
.col-c-peach { --col: var(--peach); }
.col-c-ice { --col: var(--ice); }
.col-c-mint { --col: var(--mint); }
.col-c-lilac { --col: var(--lilac); }
.col-c-sun { --col: var(--sun); }
.col-c-rose { --col: var(--rose); }
.col-c-stone { --col: var(--stone); }
.add-col {
  min-height: 220px;
  border: 2px dashed var(--desk-muted);
  border-radius: 6px;
  background: transparent;
  color: var(--desk-ink);
  font: 700 12px var(--ui);
  cursor: pointer;
}
.add-col:hover { background: rgb(255 255 255 / 0.08); border-color: var(--desk-ink); }

/* column editor */
.col-editor { display: flex; flex-direction: column; }
.col-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px dotted var(--ink); }
.col-row:first-child { border-top: 0; padding-top: 0; }
.col-del { padding: 6px 8px; border: 1px solid var(--ink); border-radius: 4px; background: #fde8e9; }
.col-del select { flex: 1; }
.swatches { display: flex; gap: 4px; }
.swatch {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--col);
  cursor: pointer;
}
.swatch.on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink); }
.column .win-body { flex: 1; display: flex; padding: 0; }
.col-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 0 0 5px 5px; }
.col-body.drop-target { background: repeating-linear-gradient(45deg, rgb(244 164 108 / 0.3) 0 6px, transparent 6px 12px); }
.col-empty {
  padding: 22px 8px;
  border: 1px dashed var(--muted);
  border-radius: 4px;
  text-align: center;
  font: 11px var(--ui);
  color: var(--muted);
}

.game-card {
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.game-card:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.game-card.dragging { opacity: 0.35; }
.card-img {
  position: relative;
  aspect-ratio: 460 / 215;
  border-bottom: 1px solid var(--ink);
  background: repeating-conic-gradient(#e3e5ef 0 25%, var(--paper) 0 50%) 0 0 / 4px 4px;
  overflow: hidden;
}
.card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Halftone dot screen over the art, like Poolsuite's video window. */
.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgb(20 15 40 / 0.22) 0.7px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}
.placeholder { display: grid; place-items: center; height: 100%; font: 700 32px var(--ui); color: var(--muted); }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 8px 9px 9px; }
.card-title { font: 700 13px/1.25 var(--ui); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badges:empty { display: none; }
.badge {
  padding: 1px 5px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  font: 700 10px/1.4 var(--ui);
}
.badge.price.sale { background: #d4f0a8; }
.badge.mode { background: var(--periwinkle); }
.tier-platinum { background: #dde6f0; }
.tier-gold { background: #f3dc78; }
.tier-silver { background: #e0e0e0; }
.tier-bronze { background: #ebb684; }
.tier-borked { background: #f59a9a; }
.tier-native { background: var(--mint); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.note-count { font: 11px var(--ui); color: var(--muted); }

.dots { display: flex; flex-wrap: wrap; gap: 3px; }
.dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 23px;
  height: 23px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  font: 700 9px var(--ui);
}
.dot.want { background: var(--mint); }
.dot.maybe { background: var(--sun); }
.dot.pass { background: var(--stone); color: var(--muted); text-decoration: line-through; }
.dot.owns::after {
  content: "✓";
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--orange);
  font-size: 8px;
  text-decoration: none;
}

/* ---------- dialogs ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  overflow-y: auto;
  background: rgb(18 16 40 / 0.5);
}
.modal { width: 100%; max-width: 500px; box-shadow: 5px 5px 0 rgb(0 0 0 / 0.4), 0 24px 60px rgb(0 0 0 / 0.4); }
.modal.wide { max-width: 960px; }
.modal > .win-body { padding: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font: 700 10px var(--ui); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: 12px var(--ui); }

.search-results { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.result { display: flex; align-items: center; gap: 12px; padding: 5px; border-radius: 4px; }
.result:hover { background: var(--peach); }
.result img, .result-ph { flex: none; border: 1px solid var(--ink); border-radius: 3px; object-fit: cover; background: var(--paper); }
.result img.capsule, .result-ph { width: 120px; height: 45px; }
.result img.cover { width: 45px; height: 60px; margin: 0 37.5px; }
.result-text { flex: 1; min-width: 0; }
.result-title { font: 700 13px var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manual-add { margin-top: 8px; padding-top: 8px; border-top: 1px dotted var(--ink); }

/* game detail */
.game-detail { display: flex; flex-direction: column; gap: 14px; }
.hero {
  position: relative;
  min-height: 80px;
  margin: -16px -16px 0;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background: repeating-conic-gradient(#e3e5ef 0 25%, var(--paper) 0 50%) 0 0 / 4px 4px;
}
.hero img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgb(20 15 40 / 0.2) 0.7px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}
.hero-text {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  max-width: calc(100% - 24px);
  padding: 6px 12px 7px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--beak);
}
.hero.no-img .hero-text { position: static; margin: 12px; box-shadow: none; }
.hero h2 { font-size: 20px; }
.link-row { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.detail-main { display: flex; flex-direction: column; gap: 12px; }
.detail-side { display: flex; flex-direction: column; gap: 16px; }
.detail-side select { width: 100%; }
.summary { margin: 0; white-space: pre-line; }
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 4px;
}
.facts dt { font: 700 11px/1.75 var(--ui); color: var(--muted); }
.facts dd { margin: 0; }

.seg { display: flex; overflow: hidden; border: 1px solid var(--ink); border-radius: 5px; box-shadow: 1px 1px 0 var(--ink); }
.seg-btn {
  flex: 1;
  padding: 8px 4px;
  border: 0;
  border-right: 1px solid var(--ink);
  background: var(--paper);
  font: 700 11px var(--ui);
  color: var(--ink);
  cursor: pointer;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--white); }
.seg-btn.active { box-shadow: inset 1px 1px 0 rgb(0 0 0 / 0.2); }
.seg-btn.active.want { background: var(--mint); }
.seg-btn.active.maybe { background: var(--sun); }
.seg-btn.active.pass { background: var(--stone); }

.group { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.group li { display: flex; align-items: center; gap: 8px; }

.manage { padding: 8px 10px; background: var(--white); border: 1px solid var(--ink); border-radius: 4px; }
.manage summary { font: 700 12px var(--ui); cursor: pointer; }
.manage[open] summary { margin-bottom: 10px; }

.note-form { display: flex; flex-direction: column; gap: 6px; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.note { padding: 8px 10px; background: var(--white); border: 1px solid var(--ink); border-radius: 4px; }
.note-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.note-head strong { font: 700 12px var(--ui); }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- admin ---------- */

.admin-page { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.admin-list { display: flex; flex-direction: column; }
.admin-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 0; border-top: 1px dotted var(--ink); }
.admin-row:first-child { border-top: 0; padding-top: 0; }
.admin-row strong { font: 700 13px var(--ui); }
.admin-msg { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pill { margin-left: 6px; padding: 0 5px; border: 1px solid var(--ink); border-radius: 3px; background: var(--periwinkle); font: 700 10px var(--ui); vertical-align: middle; }
.secret .win-bar, .secret .win-close, .secret .win-title { background-color: var(--mint); box-shadow: 0 0 0 3px var(--mint); }
.secret .win-body { display: flex; flex-direction: column; gap: 8px; }
.secret p { margin: 0; }
.pw { padding: 4px 8px; font-size: 15px; user-select: all; }
.alert .win-bar, .alert .win-close, .alert .win-title { background-color: var(--rose); box-shadow: 0 0 0 3px var(--rose); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  padding: 9px 14px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font: 700 12px var(--ui);
}
.toast.error { background: #ffdde0; }
.toast.error::before { content: "⚠ "; }
.toast.ok { background: #dcf2e4; }
.toast.ok::before { content: "✓ "; }
.toast[hidden] { display: none; }

/* ---------- chat feed ---------- */

.layout { flex: 1; display: flex; align-items: flex-start; width: 100%; }
.layout.feed-right { flex-direction: row-reverse; }
.layout > .main { width: auto; min-width: 0; margin: 0; }
/* Short enough that the menu bar, chat and footer (with the ticker) all fit on
   one screen: 31px menu bar + 40px padding + ~130px footer. */
.feed {
  position: sticky;
  top: 31px;
  flex: none;
  width: 320px;
  height: calc(100vh - 205px);
  min-height: 320px;
  padding: 22px 0 18px 18px;
}
.layout.feed-right .feed { padding: 22px 18px 18px 0; }
.layout.feed-hidden .feed { display: none; }
.feed-win { height: 100%; }
.feed-win > .win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.feed-side {
  flex: none;
  width: 19px;
  height: 15px;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--paper);
  font: 700 10px/1 var(--ui);
  cursor: pointer;
}
.feed-side:hover { background: var(--white); }
.feed-compose { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-bottom: 1px solid var(--ink); }
.feed-link:empty { display: none; }
.feed-results { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; margin-top: 4px; }
.feed-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.post { padding: 8px 10px; background: var(--white); border: 1px solid var(--ink); border-radius: 4px; }
.post-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.post-head .dot { width: 20px; height: 20px; font-size: 8px; }
.post-head strong { font: 700 12px var(--ui); }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.game-chip, .feed-result {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 4px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
}
button.game-chip, .feed-result { cursor: pointer; }
button.game-chip:hover, .feed-result:hover { background: var(--peach); }
.feed-result { margin-top: 0; border-color: transparent; }
.game-chip img, .feed-result img, .chip-ph {
  flex: none;
  width: 64px;
  height: 30px;
  object-fit: cover;
  border: 1px solid var(--ink);
  border-radius: 2px;
}
.chip-ph { display: grid; place-items: center; font: 700 13px var(--ui); color: var(--muted); background: var(--stone); }
.chip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chip-title { font: 700 12px var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-reopen { position: fixed; bottom: 18px; z-index: 30; }
.feed-reopen-left { left: 18px; }
.feed-reopen-right { right: 18px; }
.feed-mobile-toggle { display: none; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
  .whoami, #clock, .hide-sm, .menubar .brand-text { display: none; }
  .menubar { overflow-x: auto; }
  .board-actions input[type="search"] { width: 100%; }
  .columns { grid-auto-columns: 82vw; }
  .main { padding: 16px 12px 24px; }

  /* The chat becomes a collapsible section above the page. */
  .layout, .layout.feed-right { flex-direction: column; align-items: stretch; }
  .feed, .layout.feed-right .feed { position: static; width: auto; height: auto; min-height: 0; padding: 12px 12px 0; }
  .layout.feed-hidden .feed { display: block; }
  .feed-reopen, .feed-side { display: none; }
  .feed-mobile-toggle { display: flex; width: 100%; }
  .feed .feed-win { display: none; height: 70vh; margin-top: 8px; }
  .feed.open .feed-win { display: flex; }
}
