/* McNet: clean monochrome UI. The only color comes from each person's chosen color
   (their name and the pins on their recommendations) and the beige board. */
/* ==========================================================================================
   WHAT THIS FILE IS: THE LOOK OF THE WHOLE SITE
   ==========================================================================================
   server.js decides WHAT is on each page; this file decides how it LOOKS: colors, sizes,
   spacing, fonts, rounded corners, and how things are arranged on phones versus computers.
   It's written in CSS ("Cascading Style Sheets"), which works like this:

     .btn.primary { background: black; color: white; }

   means "anything with the classes btn and primary (a main button) gets a black background and
   white text". The part before { } is the "selector" (which things on the page), and inside are
   "properties" (what to change) and their values. In server.js, page pieces carry matching
   class names, like <button class="btn primary">.

   A few more things that appear throughout:
     .name          a class (a label server.js puts on a piece of the page)
     #name          one particular element (an id)
     a b            "b inside a"; a > b means "b directly inside a"
     :hover         while the pointer is over it; :focus while it's selected for typing
     ::before / ::after   decorations drawn before or after an element, with no extra HTML
     :has(x)        "contains x" (used to style a page differently depending on what's in it)
     var(--name)    one of the color and size "variables" defined just below, so a color is
                    written once and reused everywhere
     px             pixels; em or rem: relative to the text size; % of the space available;
                    vw / vh: % of the screen's width or height; fr: a share of the leftover space
     #rrggbb        a color as red, green and blue amounts in hexadecimal (#ffffff is white);
                    rgba(r, g, b, a) is the same with "a" for how see-through it is (0 to 1)
     display: flex / grid   two ways of arranging things in rows, columns or grids
     @media (...)   rules that only apply in certain situations:
                      (max-width: 700px)              narrow screens, i.e. phones
                      (prefers-color-scheme: dark)    the device is set to dark mode
                      (prefers-reduced-motion)        the person asked their device for less
                                                      animation (motion sensitivity)
                      (hover: none)                   touch screens, where nothing can be hovered
     transition / animation   smooth changes and small movements

   THE McNet LOOK: almost everything is shades of gray (monochrome). Color comes only from each
   person's own chosen color (their name, pins and game pieces; those rules live in /users.css,
   which server.js makes from everyone's choices), the beige board, and a few game pieces.
   Everything is set in Inter, a free font included with the site (see "The site font" below), so
   text looks and lines up the same on every device. Articles are the exception: they use the font
   their writer picked.

   The file runs from general to specific: colors and fonts, then shared pieces (buttons, the
   top bar, the sidebar, forms), then each page (board, comments, articles, messages, profile,
   games, market), then each game, with adjustments for phones near the parts they adjust.
   ------------------------------------------------------------------------------------------ */

/* THE COLOR PALETTE for light mode. ":root" means the whole page. Each "--name" is a variable
   used elsewhere in this file:
     --bg / --side / --surface   page background, sidebar background, panels and cards
     --hover / --active          the light gray shown under the pointer, and when pressed
     --border / --border-strong  thin divider lines, and slightly darker ones
     --text / --text-2 / --text-3   main text, softer text, faintest text
     --primary                   main buttons (black in light mode, white-ish in dark mode)
     --board / --card            the beige recommendations board and its cards
     --shadow, --radius          the soft shadow and corner rounding used for panels
     --sans                      the font list (the first one the device has is used)
     --top-h / --side-w          the height of the top bar and width of the sidebar */
:root {
  --bg: #ffffff;
  --side: #f9f9f9;
  --surface: #ffffff;
  --hover: #f0f0f0;
  --active: #e8e8e8;
  --border: #e5e5e5;
  --border-strong: #d0d0d0;
  --text: #0d0d0d;
  --text-2: #5e5e5e;
  --text-3: #8f8f8f;
  --primary: #0d0d0d;
  --primary-text: #ffffff;
  --input: #ffffff;
  --board: #f2ebdf;
  --card: #ffffff;
  --card-border: #e7dece;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --radius: 12px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --top-h: 64px;
  --tab-h: 60px; /* the tab bar along the bottom on phones */
  --side-w: 264px;
  color-scheme: light;
}
/* DARK MODE. These replace the light colors in two cases: when someone chose dark mode with the
   moon button (the page then carries data-theme="dark"), or, just below, when their device is
   set to dark mode and they haven't chosen light mode on McNet. */
[data-theme="dark"] {
  --bg: #1b1b1b;
  --side: #141414;
  --surface: #222222;
  --hover: #2b2b2b;
  --active: #333333;
  --border: #2f2f2f;
  --border-strong: #444444;
  --text: #ececec;
  --text-2: #b0b0b0;
  --text-3: #808080;
  --primary: #ececec;
  --primary-text: #111111;
  --input: #262626;
  --board: #29251f;
  --card: #212121;
  --card-border: #3a342b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  /* Dark colors when the device is set to dark mode and no mode was chosen on McNet. */
  :root:not([data-theme="light"]) {
    --bg: #1b1b1b;
    --side: #141414;
    --surface: #222222;
    --hover: #2b2b2b;
    --active: #333333;
    --border: #2f2f2f;
    --border-strong: #444444;
    --text: #ececec;
    --text-2: #b0b0b0;
    --text-3: #808080;
    --primary: #ececec;
    --primary-text: #111111;
    --input: #262626;
    --board: #29251f;
    --card: #212121;
    --card-border: #3a342b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

/* ---------- The site font: Inter ----------
   Inter is a free font (license in public/fonts/Inter-OFL.txt) included with the site, so every device
   gets exactly the same letters. Each file holds every weight from thin to black ("variable"
   font): one for upright text, one for italics.
   size-adjust: Inter is drawn bigger than most fonts at the same size, and the site's sizes and
   spacing were set for Calibri's proportions. At 87.5% Inter's small letters are exactly as tall
   as Calibri's were (capitals within 1%), so every size on the site looks the way it did.
   "swap" shows text in a stand-in font while the file downloads, instead of nothing. */
@font-face { font-family: Inter; src: url(/fonts/inter-variable.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; size-adjust: 87.5%; }
@font-face { font-family: Inter; src: url(/fonts/inter-variable-italic.woff2) format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; size-adjust: 87.5%; }
/* Basic settings for the whole page. box-sizing: border-box makes widths include padding and
   borders, which keeps sizes predictable. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
/* everything in Inter (articles keep the font their writer picked) */
button, input, select, textarea, optgroup { font-family: inherit; }
h1, h2, h3 { letter-spacing: -0.02em; }
/* [hidden] things are never shown, whatever else says. .muted and .small: softer and smaller text. */
[hidden] { display: none !important; }
svg { flex: none; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }

.sep { color: var(--text-3); }
form.inline { display: inline; }

/* ---------- Buttons: shape comes from shading and weight, never color ---------- */
/* (Buttons are pill-shaped. "primary" is the main black button, "secondary" a gray one, "ghost"
   an outline-only one; "small" and "block" (full width) change the size.) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn.primary { background: var(--primary); color: var(--primary-text); }
/* Buttons: hover (pointer over it) makes them a shade darker or lighter. */
.btn.primary:hover { opacity: .85; }
.btn.secondary { background: var(--hover); color: var(--text); }
.btn.secondary:hover { background: var(--active); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost:hover, .btn.ghost.on { background: var(--hover); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none;
}
/* Round icon-only buttons (a picture with no words), and how they change on hover. */
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { background: var(--hover); color: var(--text); } /* a search that's open */
.icon-btn.small { width: 30px; height: 30px; border-radius: 8px; }
.text-btn {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-2); cursor: pointer;
}
.text-btn:hover { color: var(--text); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- Avatars ---------- */
/* (Profile pictures are circles in several sizes: xs, sm, md, lg, xl. People without a picture
   get the first letter of their name.) */
.av {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; object-fit: cover; overflow: hidden;
  background: var(--active); color: var(--text-2); font-weight: 600;
}
.av-xs { width: 22px; height: 22px; font-size: 11px; }
.av-sm { width: 28px; height: 28px; font-size: 12px; }
.av-md { width: 40px; height: 40px; font-size: 16px; }
/* Profile pictures ("av" is short for avatar) in their sizes: extra small to large. */
.av-lg { width: 64px; height: 64px; font-size: 26px; }
.av-xl { width: 88px; height: 88px; font-size: 34px; }
.av-group svg { width: 60%; height: 60%; }
.av-spacer { background: transparent; }
.name { font-weight: 600; }

/* ---------- Top bar ---------- */
/* (The top bar stays fixed at the top of the screen while the page scrolls underneath:
   "position: sticky".) */
header.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 8px; padding: 0 16px 0 20px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.brand {
  font-size: 34px; font-weight: 800; letter-spacing: -0.05em; text-decoration: none; color: var(--text);
  line-height: 1; margin-right: auto;
}
/* The McNet name at the top left (the "brand"). */
span.brand { cursor: default; user-select: none; }
/* The two-fish logo mark in front of the name. "inline-flex" lines the mark and the letters up
   side by side, centered on each other. The mark is 1.12 times the letters' size ("em" means
   "the current text size"), so it grows and shrinks with the name, and "width: auto" keeps its
   shape. The small negative margin nudges it up a hair to sit level with the capital letters. */
.brand { display: inline-flex; align-items: center; gap: .2em; }
.brand-mark { height: 1.12em; width: auto; flex: none; margin-top: -.04em; }
a.brand:hover { opacity: .8; }
.brand-wrap { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.brand-wrap .brand { margin-right: 0; }
.storage {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 0 0 0 12px; border-left: 1px solid var(--border);
  color: var(--text-3); white-space: nowrap; font-size: 12px; font-weight: 500; line-height: 18px;
  letter-spacing: .01em; cursor: default; position: relative;
}
/* The storage readout moderators see next to the name: the slash between the two numbers. */
.storage .slash { color: var(--border-strong); font-weight: 400; }
.storage[data-tip]::after {
  content: attr(data-tip); position: absolute; z-index: 50; top: calc(100% + 10px); left: 0;
  width: max-content; max-width: 260px; padding: 8px 12px; border-radius: 10px; white-space: normal;
  background: var(--primary); color: var(--primary-text); font-size: 12.5px; font-weight: 500; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .12s, transform .12s;
}
.storage[data-tip]:hover::after, .storage[data-tip]:focus-visible::after { opacity: 1; transform: none; }
/* The buttons at the top right of the page (search, appearance, your picture, log out). */
.top-actions { display: flex; align-items: center; gap: 4px; }
.search-btn span { font-weight: 500; }
.me {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; margin-left: 4px;
  border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px;
}
.me:hover, .me.on { background: var(--hover); }

/* ---------- Sidebar + content ---------- */
/* (The page is two columns: the sidebar on the left, a fixed width, and the content on the right
   taking the rest. On narrow screens the sidebar slides in from the left instead; see "Narrow
   screens" further down.) */
.shell { display: flex; align-items: flex-start; }
.side {
  position: sticky; top: var(--top-h); width: var(--side-w); flex: none;
  height: calc(100vh - var(--top-h)); overflow-y: auto;
  background: var(--side); border-right: 1px solid var(--border); padding: 14px 10px 24px;
}
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  text-decoration: none; font-weight: 500; color: var(--text);
}
/* The sidebar's links (McHub, Board, Articles...) and their icons. */
.side-link svg { color: var(--text-2); }
.side-link:hover { background: var(--hover); }
.side-link.active { background: var(--active); font-weight: 600; }
.side-gap { height: 14px; }
/* McHub sits above everything else, set apart: no icon, bold, with a rule under it */
.side-hub { display: block; margin: 0 0 6px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--text-2);
  font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.side-hub:hover { color: var(--text); background: var(--hover); }
.side-hub.active { color: var(--text); background: var(--active); }
.side-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 12px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
}
/* The sidebar's Messages heading with its search and + buttons. */
.side-head { position: relative; }
.side-chat {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  text-decoration: none; color: var(--text); min-width: 0;
}
.side-chat:hover { background: var(--hover); }
.side-chat.active { background: var(--active); }
.side-chat-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-chat-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
/* Each chat in the sidebar list: the newest message under the name, cut off with … if long. */
.side-chat-last { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-chat.unread .side-chat-last { color: var(--text); font-weight: 500; }
.side-chat-group { font-weight: 700; }
/* The right end of each chat, halfway down: the unread count, then when the last message was sent. */
.side-chat-name { overflow-wrap: anywhere; }
.side-chat-meta { flex: none; display: flex; align-items: center; gap: 8px; }
.side-chat-when { font-size: 12px; line-height: 1; color: var(--text-3); white-space: nowrap; }
.side-chat.unread .side-chat-when { color: var(--text-2); font-weight: 600; }
.side-new { margin-left: auto; }
.side-new > summary { list-style: none; }
.side-new > summary::-webkit-details-marker { display: none; }
.side-new[open] > summary { background: var(--active); color: var(--text); }
/* The + menu for starting a new chat. */
.side-new[open] > summary svg { transform: rotate(45deg); }
.side-people {
  position: absolute; left: 10px; right: 10px; z-index: 5; margin-top: 6px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  text-transform: none; letter-spacing: 0; max-height: 50vh; overflow-y: auto;
}
.side-person { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; }
.side-person:hover { background: var(--hover); }
.person-group { padding-left: 14px; }
/* What the sidebar shows when there are no chats yet. */
.side-empty { display: block; padding: 8px 12px; font-size: 13px; color: var(--text-3); text-decoration: none; }
.side-empty:hover { color: var(--text); }
/* The unread count. Inter's digits sit high in their line (room is left below for letters like
   g and y), so the number is nudged down 2px and right 0.4px; with the circle an odd 21px tall the
   digits then land exactly in its middle on every screen. */
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 21px;
  padding: 2px 5.6px 0 6.4px; border-radius: 999px; background: var(--primary); color: var(--primary-text);
  font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.content { flex: 1; min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 64px; }
.content > * { max-width: 880px; margin-left: auto; margin-right: auto; }
.content.wide > * { max-width: 1400px; }

/* Each page's heading area (the title, and any buttons beside it). */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
} /* buttons beside the title are centred on it */
.page-head h1 { font-size: 30px; margin: 0; line-height: 1.15; }
.page-head p { margin: 6px 0 0; }

/* ---------- Notices ---------- */
/* (The message boxes for errors and confirmations.) */
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 18px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--hover); font-size: 14px;
}
.notice.error { font-weight: 600; }
.notice.error::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-size: 12px; font-weight: 800; }
.notice.ok::before { content: "✓"; font-weight: 800; }

/* ---------- Forms ---------- */
/* (Text boxes, menus and labels: one consistent rounded style everywhere.) */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.opt { font-weight: 400; color: var(--text-3); }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--input); border: 1px solid var(--border-strong); border-radius: 10px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
/* The faint example text inside empty boxes ("placeholder"). */
input::placeholder, textarea::placeholder { color: var(--text-3); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hint { font-size: 13px; color: var(--text-2); margin: -4px 0 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.callout {
  padding: 14px 16px; border: 1.5px solid var(--text); border-radius: var(--radius); background: var(--hover);
  font-size: 13.5px; line-height: 1.5; color: var(--text);
}
/* Callouts: highlighted boxes of information. */
.callout strong { display: block; font-size: 15px; }

/* ---------- Search drop-down ---------- */
.search-panel {
  margin-bottom: 26px; padding: 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow);
}
.search-panel.fresh { animation: drop .16s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .search-panel.fresh { animation: none; } }
.search-row { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
/* The search bar and its boxes. */
.search-row input { margin: 0; border: 0; padding: 8px 2px; font-size: 17px; box-shadow: none; background: transparent; }
.search-row input:focus { box-shadow: none; }
.search-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border);
}
.search-filters label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.search-filters select, .search-filters input { margin-top: 4px; padding: 7px 10px; font-size: 14px; width: auto; min-width: 140px; }
.search-count { margin: 12px 0 0; font-size: 13px; color: var(--text-2); }

/* ---------- Composer ---------- */
/* (The "Pin Something" and "Open A Market" buttons that unfold a form underneath.) */
.composer { position: relative; }
.composer > summary { list-style: none; }
.composer > summary::-webkit-details-marker { display: none; }
.composer[open] > summary { background: var(--hover); color: var(--text); }
.composer-form {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(560px, calc(100vw - 32px));
  padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
}
/* Picking tags for a recommendation. */
.tag-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pick legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.chip-check { position: relative; font-weight: 500; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip-check span {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
  background: var(--hover); color: var(--text); border: 1px solid transparent;
}
.chip-check span:hover { background: var(--active); }
/* Tick-box chips: a tag that's picked turns solid. */
.chip-check input:checked + span { background: var(--primary); color: var(--primary-text); }
.chip-check input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- Board ---------- */
/* (The board is a beige surface with cards on it, arranged in as many columns as fit.
   "repeat(auto-fill, minmax(290px, 1fr))" means: as many columns as can be at least 290 pixels
   wide, sharing the space equally. app.js then packs cards upward into gaps, like a brick wall;
   that's what the "masonry" class is for.) */
.board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 22px; align-items: start;
  background: var(--board); border-radius: 22px; padding: clamp(14px, 2.5vw, 30px);
  min-height: 240px;
}
.board.masonry { grid-auto-rows: 1px; row-gap: 0; }
.empty { color: var(--text-2); text-align: center; padding: 48px 0; margin: 0; grid-column: 1 / -1; }
.note {
  position: relative; display: block; margin: 0; min-width: 0;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px;
  padding: 30px 18px 12px; box-shadow: var(--shadow); overflow-wrap: anywhere; scroll-margin-top: 90px;
}
/* The pin on each recommendation, in the poster's color. */
.pin {
  position: absolute; top: 8px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background-color: var(--text-3);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .18), inset 2px 2px 0 rgba(255, 255, 255, .35), 0 2px 3px rgba(0, 0, 0, .25);
}
.note-tools { position: absolute; top: 1px; right: 6px; display: flex; gap: 2px; margin: 0; } /* centred on the pin's line */
.note-tools .icon-btn { color: var(--text-3); }
.note-tools .icon-btn:hover { color: var(--text); }
.note:has(.note-tools) .note-title { padding-right: 22px; }
.note:has(.note-tools a) .note-title { padding-right: 52px; } /* room for Edit and Delete */
/* "Edited" after the date on a recommendation that was changed after posting */
.note-edited { flex: none; color: var(--text-3); font-size: 12.5px; }
/* 6. Title and link share one size; the description is a step smaller with tags tucked on the end */
.note-title { font-size: 20px; line-height: 1.25; margin: 0 0 6px; font-weight: 700; letter-spacing: -0.015em; }
.note-link {
  display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 4px; font-size: 14px; line-height: 1.4;
  color: var(--text-2); text-decoration: none; overflow: hidden;
}
.note-link svg { width: 14px; height: 14px; }
.note-link:hover { color: var(--text); }
.note-link:hover .link-url { text-decoration: underline; }
/* The website name and link under a recommendation. */
.link-site { font-weight: 600; color: var(--text); white-space: nowrap; }
.link-url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.note-text { margin-top: 8px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.note-text a, .cmt-text a, .bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.note-text a.tag { text-decoration: none; }
.tags { display: inline; margin-left: 4px; }
.note-text > .tags:first-child { margin-left: 0; }
.tag {
  display: inline-block; padding: 0 7px; margin: 2px 3px 0 0; border-radius: 999px; background: var(--hover); color: var(--text-3);
  font-size: 11px; font-weight: 500; line-height: 18px; text-decoration: none; vertical-align: 1px;
}
/* Tags on cards (the #words), and hover. */
.tag:hover { background: var(--active); color: var(--text); }
.note-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border);
}
.byline { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; font-size: 13px; color: var(--text-2); }
.byline .name { font-size: 13.5px; }
.byline .when { margin-left: auto; padding-left: 8px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.note-foot .byline { flex: 1; }
/* Small capital-letter labels above sections. */
.section-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0 0 10px; }
.pager { display: flex; justify-content: space-between; margin-top: 16px; }

/* ---------- Comments (fully collapsible) ---------- */
/* (Comments use <details>, which folds and unfolds by itself. Replies are indented under the
   comment they answer, with a thin line connecting the thread.) */
.comments { margin-top: 6px; }
.comments-toggle {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; margin-left: -10px;
  border-radius: 999px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--text-2);
}
.comments-toggle::-webkit-details-marker { display: none; }
.comments-toggle svg { width: 16px; height: 16px; }
.comments-toggle:hover { background: var(--hover); color: var(--text); }
/* The little arrow (chevron) that flips when a section opens or closes. */
.chev { width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.comments[open] > .comments-toggle .chev { transform: rotate(-135deg) translate(-1px, -1px); }
.comments-body { padding-top: 4px; }
.cmt { margin-top: 10px; font-size: 14px; scroll-margin-top: 90px; }
.cmt-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; cursor: pointer; list-style: none;
  font-size: 12.5px; color: var(--text-2); border-radius: 8px; padding: 2px 4px; margin-left: -4px;
}
.cmt-head::-webkit-details-marker { display: none; }
/* Comments: the name-and-time line at the top of each one. */
.cmt-head:hover { background: var(--hover); }
.cmt-head .name { font-size: 13px; }
.cmt-head .when { margin-left: auto; padding-left: 8px; color: var(--text-3); white-space: nowrap; }
.cmt-twist {
  width: 16px; height: 16px; border: 1px solid var(--border-strong); border-radius: 4px; position: relative; flex: none;
}
.cmt-twist::before, .cmt-twist::after { content: ""; position: absolute; left: 3px; right: 3px; top: 7px; height: 1px; background: var(--text-2); }
.cmt-twist::after { transform: rotate(90deg); }
.cmt[open] > .cmt-head .cmt-twist::after { display: none; }
/* A comment hidden by reports (only moderators see it). */
.cmt-hidden { display: none; font-style: italic; }
.cmt:not([open]) > .cmt-head .cmt-hidden { display: inline; }
.cmt-body { margin-left: 7px; padding-left: 15px; border-left: 1px solid var(--border-strong); }
.cmt-text { padding: 4px 0 2px; }
.cmt-edited { margin-left: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.cmt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
details.reply > summary {
  display: inline; list-style: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2);
}
/* Reply threads: hide the browser's own triangle on fold-out sections. */
details.reply > summary::-webkit-details-marker { display: none; }
details.reply > summary:hover { color: var(--text); text-decoration: underline; }
/* An open Reply or Edit box drops below the other actions, so they stay together on one line. */
details.reply[open] { flex-basis: 100%; order: 1; }
details.reply[open] > summary { color: var(--text); }
.replies { margin-top: 2px; }
.cmt-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.cmt-form textarea { margin: 0; padding: 8px 12px; font-size: 14px; min-height: 38px; border-radius: 19px; }

/* ---------- Articles ---------- */
/* (The article list, and the article page itself, which is set like a magazine: a narrower
   column of larger text.) */
.feed { display: flex; flex-direction: column; }
.article-card {
  display: block; padding: 22px 4px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.article-card:first-child { border-top: 1px solid var(--border); }
.article-card:hover .article-card-title { text-decoration: underline; text-underline-offset: 3px; }
.article-card-title {
  font-family: var(--article-font); font-size: 25px; line-height: 1.25;
  margin: 10px 0 4px; font-weight: 700; letter-spacing: -0.01em;
}
/* Article cards on the Articles page: the subtitle line. */
.article-card-sub { margin: 0 0 6px; font-size: 16px; color: var(--text-2); }
.article-card-excerpt { margin: 0; color: var(--text-2); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-meta { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.content > .article, .content > .article-comments, .content > .editor { max-width: 700px; }
.article-head { margin-bottom: 28px; }
.article-title {
  font-family: var(--article-font); font-size: clamp(32px, 5vw, 44px);
  line-height: 1.12; margin: 8px 0 10px; letter-spacing: -0.02em;
}
/* An open article: the subtitle under the title. */
.article-sub { font-family: var(--article-font); font-size: 20px; color: var(--text-2); margin: 0 0 22px; line-height: 1.4; }
.article-byline {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.article-tools { margin-left: auto; display: flex; gap: 4px; }
.prose { font-family: var(--article-font); font-size: 19px; line-height: 1.7; overflow-wrap: anywhere; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-family: inherit; font-size: 28px; line-height: 1.25; margin: 1.6em 0 .5em; }
/* Headings inside article writing (the # heading sizes). */
.prose h3 { font-size: 23px; margin: 1.4em 0 .4em; }
.prose h4 { font-size: 19px; margin: 1.2em 0 .3em; }
.prose blockquote { margin: 1.4em 0; padding: 0 0 0 20px; border-left: 3px solid var(--text); color: var(--text-2); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose hr { border: 0; text-align: center; margin: 2em 0; }
.prose hr::after { content: "· · ·"; color: var(--text-3); letter-spacing: .4em; }
.prose a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--hover); padding: 2px 5px; border-radius: 5px; }
/* The comments section under an article. */
.article-comments { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }
/* Article fonts: Times New Roman unless the writer picks another */
.font-times { --article-font: "Times New Roman", Times, "Liberation Serif", serif; }
.font-courier { --article-font: "Courier New", Courier, "Liberation Mono", monospace; }
.font-arial { --article-font: Arial, Helvetica, "Liberation Sans", sans-serif; }
.font-inter { --article-font: Inter, ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif; }
.font-roboto { --article-font: Roboto, Arial, Helvetica, sans-serif; }
/* Lobster only comes in one weight, so bold titles keep its own weight instead of a smeared fake bold */
.font-lobster { --article-font: Lobster, "Brush Script MT", cursive; font-synthesis: style; }
.font-lobster strong, .font-lobster b { font-synthesis: weight style; } /* **bold** words still stand out */
/* Roboto and Lobster are free fonts included with the site (licenses in public/fonts/) for
   articles written in them. Roboto has every weight in one file plus an italics file. */
@font-face { font-family: Roboto; src: url(/fonts/roboto-variable.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: Roboto; src: url(/fonts/roboto-variable-italic.woff2) format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: Lobster; src: url(/fonts/lobster-regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
.editor { display: flex; flex-direction: column; gap: 14px; }
.editor-fields { display: flex; flex-direction: column; gap: 14px; }
.editor-fields select { width: auto; min-width: 200px; }
.editor-title { font-family: var(--article-font); font-size: 26px; font-weight: 700; }
.editor-sub { font-family: var(--article-font); font-size: 18px; }
/* The article editor's writing box. */
.editor-body { min-height: 50vh; font-family: var(--article-font); font-size: 18px; line-height: 1.65; }
/* The subtitle and article boxes use the regular weight, like the published article (other
   boxes on the site are semi-bold) */
.editor-sub, .editor-body { font-weight: 400; }
.format-help { font-size: 13px; color: var(--text-2); }
.format-help summary { cursor: pointer; font-weight: 500; }
.format-help table { border-collapse: collapse; margin: 8px 0; }
.format-help td { padding: 4px 16px 4px 0; }
.format-help code { font-family: inherit; background: var(--hover); padding: 2px 6px; border-radius: 5px; color: var(--text); }
.editor-actions {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 0; background: var(--bg); border-top: 1px solid var(--border);
}

/* ---------- Messages ---------- */
/* (The chat page. Messages from other people sit on the left with their picture; your own sit on
   the right in a slightly darker bubble. Each bubble is only as wide as its text
   ("width: fit-content"), up to the width of the chat.) */
.people { display: flex; flex-direction: column; gap: 2px; max-width: 560px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text); }
.person:hover { background: var(--hover); }
.person-name { font-weight: 600; }
.content > .chat-page { max-width: 900px; }
.chat-page { display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 56px); min-height: 420px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.chat-title { font-size: 20px; margin: 0; line-height: 1.2; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px 6px; } /* (room for the color rings around pictures) */
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 80%; margin-top: 12px; }
.msg.cont { margin-top: 2px; }
.msg-main { min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-3); margin-bottom: 3px; }
.msg-meta .name { font-size: 13.5px; }
.bubble { width: fit-content; max-width: 100%; padding: 9px 14px; border-radius: 18px; background: var(--hover); overflow-wrap: anywhere; font-size: 15px; }
.msg.mine { align-self: flex-end; }
.msg.mine .msg-meta { justify-content: flex-end; }
/* Chat bubbles: your own messages are dark with light writing (light with dark in dark mode). */
.msg.mine .bubble { margin-left: auto; background: var(--active); }
/* "Edited" under a message whose words were changed after sending */
.msg-edited { margin-top: 2px; padding: 0 6px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.msg.mine .msg-edited { text-align: right; }
/* while editing a message, there's no photo or schedule to add */
.chat-form.editing .compose-row > label.icon-btn, .chat-form.editing .sched-pick { display: none; }
.chat-form {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border: 1px solid var(--border-strong); border-radius: 22px; background: var(--input);
}
.chat-form:focus-within { border-color: var(--text); }
.compose-row { display: flex; align-items: flex-end; gap: 4px; }
.chat-form textarea { flex: 1; margin: 0; border: 0; padding: 8px 4px; resize: none; max-height: 200px; box-shadow: none !important; background: transparent; }
/* The round Send button in the message box. */
.icon-btn.send { background: var(--primary); color: var(--primary-text); border-radius: 50%; width: 36px; height: 36px; flex: none; }
.icon-btn.send:hover { opacity: .85; background: var(--primary); color: var(--primary-text); }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.compose-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 0; }
.compose-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 999px;
  background: var(--hover); font-size: 13px; color: var(--text-2);
}
.compose-chip svg { width: 15px; height: 15px; flex: none; }
/* Chips above the message box ("Replying to...", "Scheduled for...", a photo). */
.compose-chip b { color: var(--text); font-weight: 600; }
.compose-chip .chip-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.compose-chip.img { padding: 4px; border-radius: 12px; }
.compose-chip.img img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.compose-error { margin: 0; padding: 0 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.tool {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 999px; background: none; color: var(--text-3); cursor: pointer; list-style: none;
}
/* The message box's tool buttons (photo, schedule, file). */
.tool::-webkit-details-marker { display: none; }
.tool svg { width: 16px; height: 16px; }
.tool:hover { background: var(--active); color: var(--text); }
.sched-pick { position: relative; }
.sched-pick > summary { list-style: none; }
.sched-pick > summary::-webkit-details-marker { display: none; }
.sched-pick[open] > summary, .sched-pick.on > summary { background: var(--active); color: var(--text); }
.sched-pop {
  position: absolute; z-index: 15; bottom: calc(100% + 8px); right: 0; display: flex; gap: 6px; align-items: center; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
}
/* The pop-up for picking when a scheduled message is sent. */
.sched-pop input { margin: 0; width: auto; padding: 6px 8px; font-size: 14px; }
.sched-list { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.sched-list:empty { display: none; }
.sched-list .msg.scheduled { opacity: .55; margin: 6px 0 10px; }
.sched-list .msg.scheduled .msg-main { padding-left: 0; }
.sched-list .msg-meta svg { width: 13px; height: 13px; }
.sched-list .msg-meta { align-items: center; gap: 6px; }
.sched-cancel { display: inline-flex; margin: 0; }
.sched-cancel .tool { width: 24px; height: 24px; padding: 0; }
/* A scheduled message waiting at the end of the chat, and its x. */
.sched-cancel .tool svg { width: 13px; height: 13px; }
.sched-list .msg.scheduled:hover { opacity: .85; }
.scheduled .msg-main { padding-left: 32px; }

/* Messages: reply quotes, photos, tools that appear on hover */
/* Each message's content and its tools share one row: the tools sit just beside the bubble (to the
   right of other people's, to the left of your own), centred on it, appearing on hover. */
.msg-main { position: relative; min-width: 0; }
.msg-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.msg.mine .msg-row { flex-direction: row-reverse; }
.msg-body { min-width: 0; }
.reply-quote {
  display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 3px; padding: 3px 10px;
  border-left: 2px solid var(--border-strong); color: var(--text-3); font-size: 12.5px; text-decoration: none;
}
/* The "replying to" line above a reply. */
.reply-quote svg { width: 13px; height: 13px; flex: none; }
.reply-quote .name { font-size: 12.5px; }
.reply-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.reply-quote:hover { color: var(--text); }
.msg.mine .reply-quote { margin-left: auto; width: fit-content; }
.msg-img { position: relative; display: block; width: fit-content; max-width: min(320px, 100%); margin-bottom: 3px; border-radius: 16px; overflow: hidden; }
.msg.mine .msg-img { margin-left: auto; }
/* An attached file: its icon, name and size, in a box like a message; tapping downloads it. */
.msg-file {
  display: flex; align-items: center; gap: 10px; width: fit-content; max-width: min(320px, 100%); margin-bottom: 3px;
  padding: 10px 14px 10px 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  color: var(--text); text-decoration: none;
}
.msg-file:hover { background: var(--hover); }
.msg.mine .msg-file { margin-left: auto; }
.msg-file > svg { flex: none; width: 26px; height: 26px; color: var(--text-2); }
/* A file attached in a chat: its name and size. */
.msg-file-text { display: flex; flex-direction: column; min-width: 0; }
.msg-file-name { font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.msg-file-size { font-size: 12px; line-height: 1.3; color: var(--text-3); }
/* how long until the file deletes itself, like the label on a photo */
.msg-file-ttl { flex: none; display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 2px 7px 2px 5px; border-radius: 999px; background: var(--hover); color: var(--text-2); font-size: 11px; font-weight: 600; }
.msg-file-ttl svg { width: 12px; height: 12px; }
.msg-file.gone { color: var(--text-3); }
.msg-file.gone:hover { background: var(--surface); }
.msg-file.gone .msg-file-name { font-weight: 500; }
.msg-img img { display: block; max-height: 320px; width: auto; max-width: 100%; }
.msg-img-ttl {
  position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 5px;
  border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 600;
}
/* The hourglass label on photos and files that delete themselves. */
.msg-img-ttl svg { width: 12px; height: 12px; }
.msg-img.gone { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 48px; background: var(--hover); color: var(--text-3); }
.msg-react { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.msg-react:has(.react) { margin-top: 4px; }
.msg.mine .msg-react { justify-content: flex-end; }
.msg-tools { display: flex; align-items: center; gap: 2px; flex: none; opacity: 0; transition: opacity .12s; }
.msg.mine .msg-tools { flex-direction: row-reverse; }
.msg:hover .msg-tools, .msg-tools:focus-within, .msg-tools:has(details[open]) { opacity: 1; }
/* Phones (no hover): the buttons are hidden and come out with gestures (see app.js): a double tap
   opens just the reaction picker, centred above the message; swiping your own message left shows
   reply, edit and delete. Swiping right slides the message over a reply arrow. */
@media (hover: none) {
  .msg[data-seq] { touch-action: pan-y; position: relative; }
  .msg-tools { display: none; }
  .msg.picking .msg-tools, .msg.revealed .msg-tools { display: flex; opacity: 1; }
  .msg.picking .msg-tools > :not(.react-pick), .msg.picking .react-pick > summary { display: none; }
  .msg.revealed .msg-tools > .react-pick { display: none; }
  .msg.revealed .msg-tools .tool { width: 34px; height: 34px; border-radius: 50%; background: var(--hover); color: var(--text); }
  /* your own message's buttons read left to right: Reply, Edit, Delete */
  .msg.mine.revealed .msg-tools { flex-direction: row; gap: 6px; }
  .msg.picking .pick { position: fixed; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); }
  .msg-main { transition: transform .2s ease-out; }
  .msg-main.dragging { transition: none; }
  .swipe-hint { position: absolute; left: 6px; top: 50%; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--hover); color: var(--text-2); opacity: 0; pointer-events: none; }
  .swipe-hint.ready { background: var(--primary); color: var(--primary-text); }
  .swipe-hint svg { width: 16px; height: 16px; }
}
@media (hover: none) and (prefers-reduced-motion: reduce) { .msg-main { transition: none; } }
/* Messages inside an open thread are indented one step per reply level. */
.msg[class*="depth-"] { max-width: 100%; align-self: stretch; }
.msg.mine[class*="depth-"] { flex-direction: row-reverse; }
.depth-1 { padding-left: 28px; } .depth-2 { padding-left: 56px; } .depth-3 { padding-left: 84px; } .depth-4 { padding-left: 112px; } .depth-5 { padding-left: 140px; }
[class*="depth-"]:not(.depth-0) { border-left: 2px solid transparent; background: linear-gradient(var(--border), var(--border)) no-repeat 14px 0 / 1px 100%; }
.msg.target { animation: glow 1.6s ease-out; }
@keyframes glow { from { background-color: var(--active); } }
.reacts { display: contents; }
.react {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 1px 8px; border-radius: 999px; cursor: pointer; /* emoji and count share a baseline */
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; line-height: 20px; height: 24px;
}
.react span { font-size: 12px; font-weight: 600; }
.react:hover { background: var(--hover); }
.react.mine { background: var(--active); border-color: var(--border-strong); color: var(--text); }
.react-pick { position: relative; }
.pick {
  position: absolute; z-index: 10; bottom: calc(100% + 6px); right: -8px; display: grid; grid-template-columns: repeat(7, 34px); gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
}
/* The emoji picker for your own messages opens toward the left. */
.msg.mine .pick { right: auto; left: -8px; }
.pick button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; font-size: 19px; cursor: pointer; }
.pick button:hover { background: var(--hover); transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .pick button:hover { transform: none; } .msg.target { animation: none; } }

/* Game invites inside chats */
/* (A game sent to a chat shows as a small card with the game's icon, name, status and button.) */
.game-card {
  display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 12px;
  border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface);
}
.game-card.over { opacity: .75; }
.game-card-text { flex: 1; min-width: 0; }
.game-card-title { font-weight: 700; }
.game-card-status { font-size: 13px; color: var(--text-2); }
/* Each game's icon tile. */
.game-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--hover); color: var(--text); flex: none; }
.game-icon svg { width: 24px; height: 24px; }
.ic-hole { fill: var(--hover); }
.game-icon.big { width: 64px; height: 64px; border-radius: 18px; }
.game-icon.big svg { width: 36px; height: 36px; }
.game-card.gone { min-width: 0; color: var(--text-3); }

/* ---------- Profile ---------- */
/* (The Profile page: one column of setting sections.) */
.content > .settings { max-width: 640px; }
.profile-card { display: flex; align-items: center; gap: 18px; padding: 8px 0 24px; }
.profile-card .mk-balance { margin-left: auto; }
.profile-name { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.setting { padding: 22px 0; border-top: 1px solid var(--border); }
.setting h2 { font-size: 16px; margin: 0 0 4px; }
.setting .muted { margin: 0 0 14px; }
.row-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
/* Rows of settings with a color picker. */
.row-form input[type="color"] { width: 44px; height: 40px; padding: 3px; margin: 0; cursor: pointer; }
.row-form input[name="color"] { width: 120px; margin: 0; }
.pin-preview { position: static; margin: 0 6px; width: 16px; height: 16px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }

/* ---------- Games (the only place besides names and pins where color shows) ---------- */
/* (The Games page's grid of game tiles, and the parts every game shares: the header with the back
   arrow, the status line, seats, and the Play button.) */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; align-items: start; }
/* Like the Board and McHub: each tile is only as tall as what's in it, and app.js packs the tiles
   below into the gaps, so a long Live list doesn't stretch the tiles beside it. */
.game-grid.masonry { grid-auto-rows: 1px; row-gap: 0; }
.game-tile { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.game-start {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px; margin: 0 0 16px; border: 0; border-radius: 14px;
  background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.game-start:hover { background: var(--hover); }
.game-tile-title { font-size: 19px; font-weight: 700; }
/* the Games page: a bigger icon, and the name centered in the space beside it */
.game-start .game-icon.big { width: 84px; height: 84px; border-radius: 22px; }
.game-start .game-icon.big svg { width: 48px; height: 48px; }
.game-start .game-tile-title { flex: 1; text-align: center; font-size: 21px; padding-right: 8px; }
.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.leaderboard li { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
/* The small rank and percentage share a baseline with the name and wins; the picture stays centred,
   and the text's line (21px) fits within the picture's 22px, so the row keeps its height. */
.leaderboard li > :not(.av) { line-height: 21px; }
.leaderboard li > .av { align-self: center; }
.leaderboard .rank { width: 16px; color: var(--text-3); font-size: 12px; font-weight: 700; }
.leaderboard .wins { margin-left: auto; font-weight: 700; }
.leaderboard .win-pct { min-width: 38px; text-align: right; color: var(--text-3); font-size: 12px; font-weight: 600; }
.games-page { width: 100%; }
.game-tile .section-label + .tile-live { margin-top: 0; }
.game-tile .leaderboard + .section-label { margin-top: 18px; }
/* McHub's live tiles. */
.tile-live { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.tile-game { display: flex; align-items: baseline; gap: 8px; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 14px; }
/* The names and the status line up by their baseline; the pictures and the eye stay centred, and the
   text's line is as tall as the pictures (22px) so it stays in the middle too. */
.tile-game > .tile-who, .tile-game > .tile-status { line-height: 22px; }
.tile-game > .tile-avs, .tile-game.watch > .tile-status { align-self: center; }
.tile-game.watch > .tile-status { display: flex; } /* so the eye is centred itself, not sat on the text line */
.tile-game:hover { background: var(--hover); }
.tile-avs { display: inline-flex; flex: none; width: 54px; } /* room for three overlapping pictures, so the names line up */
.tile-avs .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.tile-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-status { margin-left: auto; flex: none; color: var(--text-2); font-size: 13px; }
button.person { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.content > .game-page { max-width: 640px; }
.content > .game-page:has(.sb-seas:not(.one)), .content > .game-page:has(.go-board) { max-width: 820px; }
.game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.game-head h1 { margin: 0; font-size: 26px; }
/* A game's setup screen (the host's choices before sending). */
.game-setup { display: flex; flex-direction: column; gap: 14px; }
.game-setup .section-label { margin: 6px 0 0; }
.setup-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 40px; }
.setup-fields > label { display: flex; flex-direction: column; gap: 6px; }
.setup-fields > .setup-text { flex: 1 1 100%; }
.game-body { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.game-status { margin: 0; font-size: 17px; font-weight: 700; text-align: center; }
.game-join, .game-again { display: flex; justify-content: center; }
#game-error { text-align: center; margin-top: 10px; }

/* Tic-Tac-Toe */
.ttt-seats { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.ttt-seat { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 2px solid transparent; }
.ttt-seat.on { border-color: var(--border-strong); background: var(--hover); }
.ttt-mark { display: inline-flex; width: 22px; height: 22px; }
.ttt-mark svg { width: 100%; height: 100%; }
.ttt-vs { color: var(--text-3); font-size: 13px; font-weight: 600; }
.ttt-board {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(340px, 86vw); aspect-ratio: 1; max-width: 100%;
  padding: 8px; border-radius: 22px; background: var(--hover);
}
/* Tic-Tac-Toe's squares. */
.ttt-cell {
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 14px; background: var(--surface);
  padding: 18%; font: inherit; cursor: pointer; min-width: 0; min-height: 0; overflow: hidden;
}
.ttt-cell svg { width: 100%; height: 100%; }
button.ttt-cell:not(:disabled):hover { background: var(--bg); box-shadow: inset 0 0 0 2px var(--border-strong); }
button.ttt-cell:disabled { cursor: default; }
.ttt-cell.win { box-shadow: inset 0 0 0 3px currentColor; }

/* 20 Questions */
.tq-top { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tq-dots { display: grid; grid-template-columns: repeat(10, 12px); gap: 6px; }
.tq-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.tq-dot.used { background: var(--text); border-color: var(--text); }
.tq-secret { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--hover); font-weight: 700; }
.tq-secret svg { width: 16px; height: 16px; }
.tq-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.tq-q { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); flex-wrap: wrap; }
/* The question number and the question share a baseline; the picture and the answer pills stay
   centred, and the text's line matches the pills' height (28px) so it stays in the middle. */
.tq-q > .tq-num, .tq-q > .tq-text { line-height: 28px; }
.tq-q > .av, .tq-q > .tq-answer, .tq-q > form { align-self: center; }
.tq-num { width: 20px; color: var(--text-3); font-size: 12px; font-weight: 700; }
.tq-text { flex: 1; min-width: 120px; display: inline-flex; align-items: baseline; gap: 6px; }
.tq-text .tq-guess { align-self: center; display: inline-flex; }
.tq-guess svg { width: 16px; height: 16px; }
.tq-answers { display: flex; gap: 4px; flex-wrap: wrap; }
.tq-answer {
  display: inline-flex; padding: 4px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; border: 0;
  background: var(--hover); color: var(--text-2);
}
/* 20 Questions: the answer buttons the host presses. */
.tq-answer.tq-pick { cursor: pointer; }
.tq-answer.tq-pick:hover { filter: brightness(.95); }
.tq-answer.a-yes { background: #dcf3e3; color: #1f6b38; }
.tq-answer.a-no, .tq-answer.a-wrong { background: #fbe1df; color: #a1271d; }
.tq-answer.a-maybe { background: #fbefd6; color: #8a5a00; }
.tq-answer.a-correct { background: #fff; color: #111; box-shadow: inset 0 0 0 1.5px #c9c9c9; }
[data-theme="dark"] .tq-answer.a-yes { background: #1d3b27; color: #8fd8a6; }
[data-theme="dark"] .tq-answer.a-no, [data-theme="dark"] .tq-answer.a-wrong { background: #432320; color: #f4a59d; }
[data-theme="dark"] .tq-answer.a-maybe { background: #3d3118; color: #f0c56b; }
/* 20 Questions in dark mode: the answer colors, toned for a dark page. */
[data-theme="dark"] .tq-answer.a-correct { background: #fff; color: #111; box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tq-answer.a-yes { background: #1d3b27; color: #8fd8a6; }
  :root:not([data-theme="light"]) .tq-answer.a-no, :root:not([data-theme="light"]) .tq-answer.a-wrong { background: #432320; color: #f4a59d; }
  :root:not([data-theme="light"]) .tq-answer.a-maybe { background: #3d3118; color: #f0c56b; }
  :root:not([data-theme="light"]) .tq-answer.a-correct { background: #fff; color: #111; box-shadow: none; }
}
.tq-ask { display: flex; align-items: center; gap: 8px; width: 100%; }
.tq-ask input[name="text"] { flex: 1; margin: 0; }
/* 20 Questions: the bullseye toggle that marks a question as a guess. */
.tq-guess-toggle { position: relative; display: inline-flex; }
.tq-guess-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tq-guess-toggle span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--hover); color: var(--text-3); cursor: pointer; }
.tq-guess-toggle span svg { width: 20px; height: 20px; }
.tq-guess-toggle input:checked + span { background: var(--primary); color: var(--primary-text); }
.tq-guess-toggle input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- Logged-out pages ---------- */
/* (The welcome page for people who aren't signed in: a big title and the two buttons.) */
.public-main { max-width: 1040px; margin: 0 auto; padding: 0 20px 64px; }
.hero { padding: clamp(60px, 14vh, 140px) 0; text-align: center; }
.hero h1 { font-size: clamp(44px, 8.5vw, 96px); line-height: 1; margin: 0 auto 36px; max-width: 900px; letter-spacing: -0.05em; font-weight: 800; }
.lead { font-size: 19px; color: var(--text-2); margin: 0 auto 32px; max-width: 520px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.auth { max-width: 380px; margin: 9vh auto 0; }
.auth h1 { font-size: 28px; margin: 0 0 24px; }
.auth > .muted { margin: 0 0 24px; }
/* The log-in and sign-up page. */
.auth .btn.block { margin-top: 6px; padding: 12px; }

/* ---------- Narrow screens ---------- */
/* (Below 900 pixels wide, the sidebar is replaced by the tab bar along the bottom: symbols for
   McHub, Board, Articles, Market, Games and Chats, the page you're on shaded like the sidebar's
   highlight. It stays above the iPhone's home bar (the "safe-area" gap), and pages leave room
   for it at the bottom. Inside a conversation the message box takes its place, and a back arrow
   returns to Chats. Below 640 pixels, spacing tightens and some text gets smaller.) */
.tabbar, .chat-back { display: none; }
@media (max-width: 900px) {
  .side { display: none; }
  .content { padding-top: 20px; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px); }
  .tabbar {
    display: flex; justify-content: space-around; align-items: center; gap: 4px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding: 0 max(10px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-left));
    background: var(--bg); border-top: 1px solid var(--border);
  }
  /* The phone's bottom tab bar. */
  .tab {
    flex: 1; max-width: 76px; height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; color: var(--text-2); text-decoration: none;
  }
  .tab svg { width: 24px; height: 24px; stroke-width: 1.8; }
  .tab-mc { font-size: 20px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
  .tab:hover { color: var(--text); }
  .tab.on { color: var(--text); background: var(--active); }
  body.in-chat .tabbar { display: none; }
  /* While a chat is open on a phone, the page fills the screen. */
  body.in-chat .content { padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
  .chat-back { display: inline-flex; margin-left: -8px; }
  .editor-actions { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  header.top { padding: 0 10px 0 16px; }
  .brand-wrap { flex-direction: column; align-items: flex-start; gap: 3px; }
  .brand { font-size: 28px; }
  .storage { font-size: 10px; padding-left: 0; border-left: 0; gap: 3px; line-height: 14px; }
  /* Your name on the Profile page. */
  .me-name { display: none; }
  .search-btn { padding: 9px; width: 38px; }
  .me { padding: 4px; }
  .page-head h1 { font-size: 26px; }
  .board { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 12px; border-radius: 16px; }
  .composer-form { position: fixed; left: 16px; right: 16px; top: calc(var(--top-h) + 12px); width: auto; max-height: calc(100vh - var(--top-h) - 24px); overflow-y: auto; }
  .search-filters label { flex: 1 1 40%; }
  .search-filters select, .search-filters input { width: 100%; min-width: 0; }
  .msg { max-width: 92%; }
  /* The chat page layout. */
  .chat-page { height: calc(100vh - var(--top-h) - 40px); }
  .editor-title { font-size: 30px; }
  .prose { font-size: 18px; }
}

/* Choice buttons on a game's setup step (e.g. board size) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.seg legend { width: 100%; padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.seg label { position: relative; display: inline-flex; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border-strong); font-weight: 600; }
.seg input:checked + span { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.seg input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

/* Sea Battle */
.sb-seas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; width: 100%; }
.sb-seas.one { grid-template-columns: minmax(0, 380px); justify-content: center; }
@media (max-width: 760px) { .sb-seas { grid-template-columns: minmax(0, 1fr); } }
.sb-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sb-side.mine .sb-grid { --cell-bg: #eef3f7; }
.sb-who { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 2px solid transparent; align-self: flex-start; font-weight: 600; }
.sb-who.on { border-color: var(--border-strong); background: var(--hover); }
.sb-who.empty { color: var(--text-3); }
/* Battleship: the check mark shown once a player is ready. */
.sb-ready { display: inline-flex; width: 18px; height: 18px; color: var(--text); }
.sb-ready svg { width: 100%; height: 100%; }
.sb-form { margin: 0; }
.sb-grid.sb-n9 { --n: 9; } .sb-grid.sb-n10 { --n: 10; } .sb-grid.sb-n11 { --n: 11; } .sb-grid.sb-n12 { --n: 12; }
.sb-grid { --n: 10; --cell-bg: #e4edf5; position: relative; overflow: hidden; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); gap: 3px; padding: 6px; border-radius: 16px; background: #cfdeeb; aspect-ratio: 1; }
.sb-cell { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 5px; background: var(--cell-bg); color: #fff; font: inherit; }
button.sb-cell { cursor: pointer; }
button.sb-cell:not(.ship):hover { background: #f6f9fc; box-shadow: inset 0 0 0 2px #9fb6ca; }
.sb-cell.ship { border-radius: 2px; }
/* Battleship: the sea's squares. */
.sb-cell.solo { border-radius: 8px; }
.sb-cell.cap-l { border-radius: 10px 2px 2px 10px; } .sb-cell.cap-r { border-radius: 2px 10px 10px 2px; }
.sb-cell.cap-t { border-radius: 10px 10px 2px 2px; } .sb-cell.cap-b { border-radius: 2px 2px 10px 10px; }
.sb-cell.sb-seg { border-radius: 4px; }
.sb-cell.sunk { opacity: .45; }
.sb-cell.picked { box-shadow: inset 0 0 0 3px #111; }
button.sb-cell.ship:hover { filter: brightness(1.1); }
.sb-hit { display: flex; width: 70%; height: 70%; color: #fff; filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }
.sb-cell:not(.ship) .sb-hit { color: #222; filter: none; }
/* Battleship: the X marking a hit. */
.sb-hit svg { width: 100%; height: 100%; }
.sb-dot { width: 22%; height: 22%; border-radius: 50%; background: #7d93a8; }
.sb-cell.last { box-shadow: inset 0 0 0 2px #111; }
.sb-fleet { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; }
.sb-mini { --u: 11px; display: inline-block; height: 11px; width: calc(var(--u) * var(--len, 1)); border-radius: 3px;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--u) - 1.5px), rgba(255,255,255,.75) calc(var(--u) - 1.5px) var(--u)); }
.sb-mini.len-1 { --len: 1; } .sb-mini.len-2 { --len: 2; } .sb-mini.len-3 { --len: 3; } .sb-mini.len-4 { --len: 4; } .sb-mini.len-5 { --len: 5; }
.sb-mini.gone { opacity: .2; }
.sb-tools { display: flex; align-items: center; justify-content: center; gap: 12px; }
/* Battleship: the buttons under the sea (shuffle, ready). */
.sb-tools form { margin: 0; }
.sb-tools .btn svg { width: 22px; height: 22px; }
.tool.big { width: 44px; height: 44px; border-radius: 12px; background: var(--hover); }
.tool.big svg { width: 22px; height: 22px; }
.sb-opp { display: flex; justify-content: center; }
[data-theme="dark"] .sb-grid { --cell-bg: #1f2a35; background: #16202a; }
[data-theme="dark"] .sb-side.mine .sb-grid { --cell-bg: #243140; }
[data-theme="dark"] button.sb-cell:not(.ship):hover { background: #2c3a49; box-shadow: inset 0 0 0 2px #4d6479; }
[data-theme="dark"] .sb-cell:not(.ship) .sb-hit { color: #eee; }
/* Battleship in dark mode. */
[data-theme="dark"] .sb-cell.picked, [data-theme="dark"] .sb-cell.last { box-shadow: inset 0 0 0 2px #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sb-grid { --cell-bg: #1f2a35; background: #16202a; }
  :root:not([data-theme="light"]) .sb-side.mine .sb-grid { --cell-bg: #243140; }
  :root:not([data-theme="light"]) button.sb-cell:not(.ship):hover { background: #2c3a49; box-shadow: inset 0 0 0 2px #4d6479; }
  :root:not([data-theme="light"]) .sb-cell:not(.ship) .sb-hit { color: #eee; }
  :root:not([data-theme="light"]) .sb-cell.picked, :root:not([data-theme="light"]) .sb-cell.last { box-shadow: inset 0 0 0 2px #fff; }
}

/* Go: black and white stones on a beige board */
.go-n19 { --n: 19; } .go-n13 { --n: 13; } .go-n11 { --n: 11; }
.game-emoji { font-size: 28px; line-height: 1.1; }
.go-form { margin: 0; width: 100%; display: flex; justify-content: center; }
.go-board { position: relative; width: min(100%, 620px, calc(100vh - 250px)); min-width: min(100%, 300px); aspect-ratio: 1; border-radius: 10px; background: #e3c48c; color: #4a3517; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 6px 18px rgba(80,55,20,.18); box-sizing: border-box; }
.go-board > * { position: absolute; inset: 12px; }
.go-lines { width: auto; height: auto; }
.go-pts { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); }
.go-pt { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; font: inherit; }
/* Go: each point you can tap on the board. */
button.go-pt { cursor: pointer; }
.go-stone { width: 92%; height: 92%; border-radius: 50%; }
.go-stone.black { background: radial-gradient(circle at 35% 30%, #5a5a5a, #111 55%, #000); box-shadow: 0 1px 2px rgba(0,0,0,.45); }
.go-stone.white { background: radial-gradient(circle at 35% 30%, #fff, #f1f1ee 50%, #cfcfca); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.go-stone.seat { width: 18px; height: 18px; flex: none; }
.go-board.turn-b button.go-pt:hover::before, .go-board.turn-w button.go-pt:hover::before { content: ""; width: 88%; height: 88%; border-radius: 50%; opacity: .45; }
.go-board.turn-b button.go-pt:hover::before { background: #111; }
.go-board.turn-w button.go-pt:hover::before { background: #fff; }
.go-last { position: absolute; width: 40%; height: 40%; border-radius: 50%; border: 1.5px solid #fff; box-sizing: border-box; }
/* Go: the small marker on the last stone played (white stones get a dark marker). */
.go-stone.white + .go-last { border-color: #111; }
.go-pt.dead .go-stone { opacity: .35; }
.go-terr { position: absolute; width: 34%; height: 34%; border-radius: 2px; }
.go-terr.black { background: #111; } .go-terr.white { background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.go-tools { display: flex; align-items: center; justify-content: center; gap: 12px; }
.go-tools form { margin: 0; }
.go-tools .btn svg { width: 22px; height: 22px; }
.go-passed { margin: -6px 0 0; font-size: 14px; font-weight: 600; text-align: center; }
.go-pts-num { margin-left: 4px; font-weight: 700; }

/* Battleship radar: faint range rings and crosshairs on the sea you fire at, a ping where a shot lands */
.sb-radar::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(transparent calc(50% - .5px), rgba(70,120,150,.16) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(70,120,150,.16) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 calc(17% - 1px), rgba(70,120,150,.16) calc(17% - 1px) 17%); }
.sb-radar button.sb-cell:hover::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1.5px solid #3d7f94;
  background: linear-gradient(#3d7f94, #3d7f94) center / 1.5px 100% no-repeat, linear-gradient(#3d7f94, #3d7f94) center / 100% 1.5px no-repeat; opacity: .8; }
.sb-cell.last::after { content: ""; position: absolute; inset: -25%; border-radius: 50%; border: 2px solid #3d7f94; opacity: 0; pointer-events: none; animation: sb-ping 1.1s ease-out 2; }
@keyframes sb-ping { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sb-cell.last::after { animation: none; } }
/* Battleship's radar sweep in dark mode. */
[data-theme="dark"] .sb-radar::before { filter: brightness(1.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sb-radar::before { filter: brightness(1.8); } }

/* Connect 4: discs in each player's color */
.c4-form { margin: 0; display: flex; justify-content: center; width: 100%; }
.c4-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; width: min(100%, 470px); padding: 8px; border-radius: 20px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.c4-col { display: grid; grid-template-rows: repeat(6, auto); gap: 8px; padding: 4px; border: 0; border-radius: 12px; background: none; font: inherit; min-width: 0; }
button.c4-col { cursor: pointer; }
button.c4-col:hover { background: var(--border); }
.c4-hole { position: relative; aspect-ratio: 1; border-radius: 50%; background: var(--surface); box-shadow: inset 0 2px 4px rgba(0,0,0,.12); overflow: visible; }
.c4-disc { position: absolute; inset: 7%; border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.c4-disc.alt { background: transparent; box-shadow: inset 0 0 0 5px currentColor; }
/* Connect 4: the disc shown beside each player's name. */
.c4-disc.seat { position: static; display: inline-block; width: 18px; height: 18px; flex: none; }
.c4-disc.seat.alt { box-shadow: inset 0 0 0 4px currentColor; }
.c4-disc.seat.empty { box-shadow: inset 0 0 0 2px var(--border-strong); }
.c4-disc.win { outline: 3px solid var(--text); outline-offset: 2px; }
.c4-disc.last::after { content: ""; position: absolute; inset: 38%; border-radius: 50%; background: rgba(255,255,255,.75); }
.c4-disc.last.drop-0 { --fall: -130%; } .c4-disc.last.drop-1 { --fall: -250%; } .c4-disc.last.drop-2 { --fall: -370%; }
.c4-disc.last.drop-3 { --fall: -490%; } .c4-disc.last.drop-4 { --fall: -610%; } .c4-disc.last.drop-5 { --fall: -730%; }
.c4-disc.last { animation: c4-drop .38s cubic-bezier(.4, 0, 1, 1); }
@keyframes c4-drop { from { transform: translateY(var(--fall, -300%)); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .c4-disc.last { animation: none; } }

/* Checkers: neutral board, pieces in each player's color */
.ck-form { margin: 0; display: flex; justify-content: center; width: 100%; }
.ck-board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); width: min(100%, 520px); aspect-ratio: 1; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--border-strong); }
.ck-sq { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: 0; border: 0; font: inherit; }
.ck-sq.light { background: #f1efe9; }
.ck-sq.dark { background: #9c9a94; }
.ck-sq.dark.moved { background: #85837c; }
button.ck-sq { cursor: pointer; }
.ck-piece { position: relative; width: 78%; height: 78%; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 3px rgba(255,255,255,.28), inset 0 -4px 0 rgba(0,0,0,.22), 0 2px 4px rgba(0,0,0,.3); }
/* Checkers: player 2's pieces drawn as rings when the two colors are too alike. */
.ck-piece.alt { background: #f7f7f7; box-shadow: inset 0 0 0 7px currentColor, 0 2px 4px rgba(0,0,0,.3); }
.ck-piece.seat { width: 20px; height: 20px; flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.ck-piece.seat.alt { box-shadow: inset 0 0 0 4px currentColor; }
.ck-piece.can { box-shadow: 0 0 0 3px rgba(255,255,255,.85), inset 0 -4px 0 rgba(0,0,0,.22), 0 2px 4px rgba(0,0,0,.3); }
.ck-piece.picked { transform: translateY(-3px) scale(1.05); box-shadow: 0 0 0 3px #111, inset 0 -4px 0 rgba(0,0,0,.22), 0 6px 10px rgba(0,0,0,.35); }
.ck-crown { width: 52%; height: 52%; color: #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.ck-piece.alt .ck-crown { color: inherit; filter: none; }
.ck-crown svg { width: 100%; height: 100%; }
.ck-dot { width: 26%; height: 26%; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
/* Checkers: the dot marking where the picked-up piece can go. */
button.ck-sq.target:hover .ck-dot { transform: scale(1.3); }
[data-theme="dark"] .ck-sq.light { background: #3a3936; } [data-theme="dark"] .ck-sq.dark { background: #1f1f1d; } [data-theme="dark"] .ck-sq.dark.moved { background: #2c2b28; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ck-sq.light { background: #3a3936; } :root:not([data-theme="light"]) .ck-sq.dark { background: #1f1f1d; } :root:not([data-theme="light"]) .ck-sq.dark.moved { background: #2c2b28; }
}

/* Hangman */
.hm-top { display: flex; align-items: center; justify-content: center; gap: 18px; }
.hm-art { width: 150px; height: 150px; color: var(--text); }
.hm-art .hm-gallows { color: var(--text-3); }
.hm-art.done { color: #c0392b; }
.hm-lives { display: grid; grid-template-columns: repeat(2, 10px); gap: 6px; }
.hm-life { width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.hm-life.lost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.hm-phrase { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; }
/* Hangman: the word, one box per letter. */
.hm-word { display: inline-flex; gap: 6px; }
.hm-ch { display: inline-flex; align-items: flex-end; justify-content: center; width: 30px; height: 40px; border-bottom: 3px solid var(--text); font-size: 26px; font-weight: 700; line-height: 1; padding-bottom: 4px; }
.hm-ch.punct { border-bottom-color: transparent; width: 12px; }
.hm-ch.shown { color: var(--text-3); }
.hm-ch.missed { color: #c0392b; }
.hm-keys { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; width: 100%; }
.hm-row { display: flex; gap: 5px; justify-content: center; width: 100%; }
.hm-key { flex: 0 1 42px; min-width: 0; height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: var(--hover); color: var(--text); font: inherit; font-weight: 700; font-size: 17px; }
button.hm-key { cursor: pointer; }
/* Hangman: the on-screen keyboard keys. */
button.hm-key:hover { background: var(--border); }
.hm-key.right { background: var(--primary); color: var(--primary-text); }
.hm-key.wrong { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text-3); text-decoration: line-through; }



/* Crazy 8s: players sit around the table like GamePigeon; the arrow shows which way play goes */
/* (The card-table games (Crazy 8s, BS, Heads Up, Spades, Up & Down The River) seat players around
   an oval wooden table. Each seat's position is set with classes like c8-p5-2, meaning "seat 2 of
   5"; you are always seat 0, at the bottom.) */
.c8-lobby { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.c8-person { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; }
.c8-ring { position: relative; width: 100%; aspect-ratio: 1.45; margin: 4px 0 6px; }
.c8-felt { position: absolute; left: 50%; top: 50%; width: 62%; height: 56%; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #8c5b37, #6a4025 75%); box-shadow: inset 0 0 0 6px #4b2c17, inset 0 0 0 8px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center; }
/* the direction arrows are carved into the wood */
.c8-ring-arrow { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(38, 20, 8, .55); pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(255, 230, 200, .22)); }
.c8-ring-arrow path { vector-effect: non-scaling-stroke; }
.c8-felt.ccw .c8-ring-arrow { transform: scaleX(-1); }
/* BS uses a slightly lighter wood */
.c8-felt.bs-felt { background: radial-gradient(ellipse at 50% 40%, #a8754a, #85552f 75%); box-shadow: inset 0 0 0 6px #5f391c, inset 0 0 0 8px rgba(255,255,255,.1), 0 8px 24px rgba(0,0,0,.18); }
.c8-center { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }
.c8-center form { margin: 0; }
.c8-seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px 5px;
  border-radius: 14px; border: 2px solid transparent; font-size: 13px; min-width: 64px; }
.c8-seat .av { box-shadow: 0 0 0 2px var(--bg); }
.c8-seat.on { border-color: var(--border-strong); background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.c8-seat-name { font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Card games: the card count on each seat. */
.c8-count { position: absolute; top: 2px; right: 4px; min-width: 20px; padding: 1px 5px; border-radius: 8px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 12px; text-align: center; }
.c8-uno { padding: 1px 6px; border-radius: 6px; background: #e5484d; color: #fff; font-weight: 800; font-size: 10px; letter-spacing: .05em; }
.c8-p2-0 { left: 50.0%; top: 91.0%; }
.c8-p2-1 { left: 50.0%; top: 9.0%; }
.c8-p3-0 { left: 50.0%; top: 91.0%; }
.c8-p3-1 { left: 12.8%; top: 29.5%; }
.c8-p3-2 { left: 87.2%; top: 29.5%; }
.c8-p4-0 { left: 50.0%; top: 91.0%; }
.c8-p4-1 { left: 7.0%; top: 50.0%; }
/* Where each seat sits around the oval table. c8-p4-2 means "4 players, seat 2"; left and top are
   percentages of the table's width and height. (The lists below cover every table size.) */
.c8-p4-2 { left: 50.0%; top: 9.0%; }
.c8-p4-3 { left: 93.0%; top: 50.0%; }
.c8-p5-0 { left: 50.0%; top: 91.0%; }
.c8-p5-1 { left: 9.1%; top: 62.7%; }
.c8-p5-2 { left: 24.7%; top: 16.8%; }
.c8-p5-3 { left: 75.3%; top: 16.8%; }
.c8-p5-4 { left: 90.9%; top: 62.7%; }
.c8-p6-0 { left: 50.0%; top: 91.0%; }
.c8-p6-1 { left: 12.8%; top: 70.5%; }
/* (seat positions continued: 6 players) */
.c8-p6-2 { left: 12.8%; top: 29.5%; }
.c8-p6-3 { left: 50.0%; top: 9.0%; }
.c8-p6-4 { left: 87.2%; top: 29.5%; }
.c8-p6-5 { left: 87.2%; top: 70.5%; }
.c8-p7-0 { left: 50.0%; top: 91.0%; }
.c8-p7-1 { left: 16.4%; top: 75.6%; }
.c8-p7-2 { left: 8.1%; top: 40.9%; }
.c8-p7-3 { left: 31.3%; top: 13.1%; }
.c8-p7-4 { left: 68.7%; top: 13.1%; }
/* (seat positions continued: 7 players) */
.c8-p7-5 { left: 91.9%; top: 40.9%; }
.c8-p7-6 { left: 83.6%; top: 75.6%; }
.c8-p8-0 { left: 50.0%; top: 91.0%; }
.c8-p8-1 { left: 19.6%; top: 79.0%; }
.c8-p8-2 { left: 7.0%; top: 50.0%; }
.c8-p8-3 { left: 19.6%; top: 21.0%; }
.c8-p8-4 { left: 50.0%; top: 9.0%; }
.c8-p8-5 { left: 80.4%; top: 21.0%; }
.c8-p8-6 { left: 93.0%; top: 50.0%; }
/* (seat positions continued: 8 players) */
.c8-p8-7 { left: 80.4%; top: 79.0%; }
.c8-p9-0 { left: 50.0%; top: 91.0%; }
.c8-p9-1 { left: 22.4%; top: 81.4%; }
.c8-p9-2 { left: 7.7%; top: 57.1%; }
.c8-p9-3 { left: 12.8%; top: 29.5%; }
.c8-p9-4 { left: 35.3%; top: 11.5%; }
.c8-p9-5 { left: 64.7%; top: 11.5%; }
.c8-p9-6 { left: 87.2%; top: 29.5%; }
.c8-p9-7 { left: 92.3%; top: 57.1%; }
/* (seat positions continued: 9 players) */
.c8-p9-8 { left: 77.6%; top: 81.4%; }
.c8-p10-0 { left: 50.0%; top: 91.0%; }
.c8-p10-1 { left: 24.7%; top: 83.2%; }
.c8-p10-2 { left: 9.1%; top: 62.7%; }
.c8-p10-3 { left: 9.1%; top: 37.3%; }
.c8-p10-4 { left: 24.7%; top: 16.8%; }
.c8-p10-5 { left: 50.0%; top: 9.0%; }
.c8-p10-6 { left: 75.3%; top: 16.8%; }
.c8-p10-7 { left: 90.9%; top: 37.3%; }
/* (seat positions continued: 10 players) */
.c8-p10-8 { left: 90.9%; top: 62.7%; }
.c8-p10-9 { left: 75.3%; top: 83.2%; }
/* cards */
/* (Playing cards are drawn entirely with CSS: a rounded rectangle with the rank and suit symbol.
   Hearts and diamonds are red; card backs have a simple pattern.) */
.c8-card { --w: 60px; position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--w); aspect-ratio: 5 / 7.4; border-radius: calc(var(--w) * .13); border: 0; padding: 0;
  color: #fff; font: inherit; font-weight: 800; box-shadow: inset 0 0 0 calc(var(--w) * .05) #fff, 0 1px 4px rgba(0,0,0,.25); user-select: none; overflow: hidden; }
.c8-card.big { --w: 78px; }
.c-r { background: #e5484d; } .c-y { background: #f2bd1a; } .c-g { background: #2fa14d; } .c-b { background: #2f6fde; } .c-w { background: #141414; }
.c8-oval { position: relative; display: flex; align-items: center; justify-content: center; width: 72%; height: 64%; border-radius: 50%; background: #fff; transform: rotate(-24deg); overflow: hidden; }
.c-r .c8-oval { color: #e5484d; } .c-y .c8-oval { color: #d9a400; } .c-g .c8-oval { color: #2fa14d; } .c-b .c8-oval { color: #2f6fde; }
.c-w .c8-oval { background: #141414; box-shadow: 0 0 0 calc(var(--w) * .035) #fff; }
.c8-oval > svg, .c8-num { transform: rotate(24deg); }
/* Crazy 8s cards: the symbol in the middle oval. */
.c8-oval > svg { width: 62%; height: 62%; }
.c8-oval > svg.c8-d2 { width: 84%; height: 84%; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.c8-num { font-size: calc(var(--w) * .46); line-height: 1; text-shadow: 1px 1px 0 rgba(0,0,0,.12); }
.c8-quad { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: calc(var(--w) * .035); background: #141414; }
.c8-quad i { display: block; }
.c8-quad[class*="pick-"] i { opacity: .16; } .c8-quad.pick-r .r, .c8-quad.pick-y .y, .c8-quad.pick-b .b, .c8-quad.pick-g .g { opacity: 1; }
.c8-quad .r { background: #e5484d; } .c8-quad .y { background: #f2bd1a; } .c8-quad .b { background: #2f6fde; } .c8-quad .g { background: #2fa14d; }
.c8-solid { position: absolute; inset: 0; }
.c8-plus { position: relative; transform: rotate(24deg); color: #fff; font-size: calc(var(--w) * .34); -webkit-text-stroke: calc(var(--w) * .03) #141414; paint-order: stroke fill; }
/* Crazy 8s cards: the small numbers in two corners. */
.c8-corner { position: absolute; left: 9%; top: 6%; display: inline-flex; align-items: center; justify-content: center; min-width: 14%; font-size: calc(var(--w) * .2); line-height: 1; color: #fff; }
.c8-corner.end { left: auto; top: auto; right: 9%; bottom: 6%; transform: rotate(180deg); }
.c8-corner svg { width: calc(var(--w) * .2); height: calc(var(--w) * .2); }
.c8-card.back { background: #141414; cursor: default; }
button.c8-card.back { cursor: pointer; transition: transform .12s ease; }
button.c8-card.back:hover { transform: translateY(-3px); }
.c8-backface { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.c8-backoval { display: flex; align-items: center; justify-content: center; width: 70%; height: 80%; border-radius: 50%; background: #e5303a; transform: rotate(30deg); }
.c8-back8 { transform: rotate(-42deg); color: #f7c51e; font-size: calc(var(--w) * .62); font-weight: 800; line-height: 1;
  -webkit-text-stroke: calc(var(--w) * .03) #141414; paint-order: stroke fill; text-shadow: calc(var(--w) * .035) calc(var(--w) * .035) 0 #141414; }
/* Crazy 8s: your hand of cards. */
.c8-form { margin: 0; width: 100%; }
.c8-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; padding-top: 10px; }
.c8-slot { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; transition: transform .12s ease; }
button.c8-slot { cursor: pointer; }
.c8-slot.ok { transform: translateY(-8px); }
button.c8-slot.ok:hover { transform: translateY(-14px); }
.c8-slot.no { opacity: .45; }
.c8-pick { display: flex; gap: 4px; }
.c8-dot { width: 18px; height: 18px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--border-strong); }
/* Crazy 8s: the four color dots on a Wild, for picking its color. */
.c8-dot:hover { transform: scale(1.2); }
@media (max-width: 560px) {
  .c8-ring { aspect-ratio: .95; }
  .c8-felt { width: 64%; height: 46%; }
  .c8-card { --w: 50px; } .c8-card.big { --w: 60px; }
  .c8-seat { min-width: 0; padding: 4px; font-size: 11px; }
  .c8-seat .av { width: 30px; height: 30px; }
}

/* Texas Hold'em */
/* (The poker table: a green (or red, for McPoints) oval felt with the five shared cards and the
   pot in the middle, and seats around it.) */
.content > .game-page:has(.pk-ring) { max-width: 860px; }
.pk-ring { position: relative; width: 100%; aspect-ratio: 1.6; margin: 10px 0 64px; } /* room for the bottom seat's cards and hand name */
.pk-felt { position: absolute; left: 50%; top: 50%; width: 70%; height: 58%; transform: translate(-50%, -50%); border-radius: 999px;
  background: radial-gradient(ellipse at 50% 40%, #2f7a55, #1d5a3d 75%); box-shadow: inset 0 0 0 6px #173f2c, inset 0 0 0 8px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.18);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; }
.pk-board { display: flex; gap: 6px; }
.pk-pot { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: rgba(0,0,0,.28); font-weight: 700; font-size: 14px; }
.pk-pot svg { width: 16px; height: 16px; }
.pk-pot .name { filter: brightness(1.6); }
.pk-card { --w: 46px; position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: var(--w); aspect-ratio: 5 / 7;
  border-radius: calc(var(--w) * .12); background: #fff; color: #161616; box-shadow: 0 1px 3px rgba(0,0,0,.35); line-height: 1; }
/* Playing cards ("pk" for poker): the rank letter and suit. */
.pk-card b { font-size: calc(var(--w) * .42); font-weight: 800; letter-spacing: -.02em; }
.pk-card i { display: flex; width: calc(var(--w) * .38); height: calc(var(--w) * .38); margin-top: calc(var(--w) * .04); }
.pk-card i svg { width: 100%; height: 100%; }
.pk-card.red { color: #d33a3f; }
.pk-card.slot { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25); }
.pk-card.back { background: repeating-linear-gradient(45deg, #b8343a 0 3px, #9e2a30 3px 6px); box-shadow: inset 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.35); }
.pk-card.sm { --w: 26px; }
.pk-card.lg { --w: 66px; }
.pk-seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 76px; padding: 6px 8px;
  border-radius: 14px; border: 2px solid transparent; font-size: 13px; background: var(--bg); }
/* Poker and Blackjack seats: the player whose turn it is gets an outline. */
.pk-seat.on { border-color: var(--text); box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.pk-seat.won { border-color: #2f7a55; }
.pk-seat.idle { opacity: .45; }
.pk-seat .av { box-shadow: 0 0 0 2px var(--bg); }
.pk-name { font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-chips { font-weight: 700; }
.pk-bet { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: #1d5a3d; color: #fff; font-size: 12px; font-weight: 700; }
.pk-bet svg { width: 13px; height: 13px; }
.pk-felt.red ~ .pk-seat .pk-bet { background: #7c2426; }
/* Small tags on seats ("All In", the hand's name). */
.pk-tag { padding: 1px 7px; border-radius: 6px; background: var(--hover); font-size: 11px; font-weight: 700; white-space: nowrap; }
.pk-chips { display: inline-flex; align-items: center; gap: 5px; }
.pk-dealer { width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #111; font-size: 10px; font-weight: 800; flex: none;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px #111; }
.pk-seat-cards { display: flex; gap: 2px; margin-bottom: 3px; }
.pk-hole { display: flex; justify-content: center; gap: 8px; }
.pk-actions, .pk-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.pk-bottom form, .pk-actions form { margin: 0; }
.pk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; min-width: 116px; padding: 0 16px; border: 0; border-radius: 14px;
  background: var(--hover); color: var(--text); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
/* The poker-style buttons (Fold, Call, Raise...). */
.pk-btn:hover { background: var(--border); }
.pk-btn.dark { background: var(--primary); color: var(--primary-text); }
.pk-btn.dark:hover { opacity: .9; }
.pk-btn svg { width: 22px; height: 22px; }
.pk-raise .pk-amount { height: 46px; width: 116px; border-radius: 14px; text-align: center; font-weight: 700; }
.pk-actions form { margin: 0; }
.pk-raise { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pk-amount { margin: 0; padding: 8px 10px; }
.pk-final { width: min(100%, 360px); font-size: 16px; }
/* Where each poker seat sits around the table (pk-p4-3: 4 players, seat 3). */
.pk-p1-0 { left: 50.0%; top: 90.0%; }
.pk-p2-0 { left: 50.0%; top: 90.0%; }
.pk-p2-1 { left: 50.0%; top: 10.0%; }
.pk-p3-0 { left: 50.0%; top: 90.0%; }
.pk-p3-1 { left: 11.9%; top: 30.0%; }
.pk-p3-2 { left: 88.1%; top: 30.0%; }
.pk-p4-0 { left: 50.0%; top: 90.0%; }
.pk-p4-1 { left: 6.0%; top: 50.0%; }
.pk-p4-2 { left: 50.0%; top: 10.0%; }
/* (poker seat positions continued) */
.pk-p4-3 { left: 94.0%; top: 50.0%; }
.pk-p5-0 { left: 50.0%; top: 90.0%; }
.pk-p5-1 { left: 8.2%; top: 62.4%; }
.pk-p5-2 { left: 24.1%; top: 17.6%; }
.pk-p5-3 { left: 75.9%; top: 17.6%; }
.pk-p5-4 { left: 91.8%; top: 62.4%; }
.pk-p6-0 { left: 50.0%; top: 90.0%; }
.pk-p6-1 { left: 11.9%; top: 70.0%; }
.pk-p6-2 { left: 11.9%; top: 30.0%; }
/* (poker seat positions continued) */
.pk-p6-3 { left: 50.0%; top: 10.0%; }
.pk-p6-4 { left: 88.1%; top: 30.0%; }
.pk-p6-5 { left: 88.1%; top: 70.0%; }
.pk-p7-0 { left: 50.0%; top: 90.0%; }
.pk-p7-1 { left: 15.6%; top: 74.9%; }
.pk-p7-2 { left: 7.1%; top: 41.1%; }
.pk-p7-3 { left: 30.9%; top: 14.0%; }
.pk-p7-4 { left: 69.1%; top: 14.0%; }
.pk-p7-5 { left: 92.9%; top: 41.1%; }
/* (poker seat positions continued) */
.pk-p7-6 { left: 84.4%; top: 74.9%; }
.pk-p8-0 { left: 50.0%; top: 90.0%; }
.pk-p8-1 { left: 18.9%; top: 78.3%; }
.pk-p8-2 { left: 6.0%; top: 50.0%; }
.pk-p8-3 { left: 18.9%; top: 21.7%; }
.pk-p8-4 { left: 50.0%; top: 10.0%; }
.pk-p8-5 { left: 81.1%; top: 21.7%; }
.pk-p8-6 { left: 94.0%; top: 50.0%; }
.pk-p8-7 { left: 81.1%; top: 78.3%; }
/* (poker seat positions continued) */
.pk-p9-0 { left: 50.0%; top: 90.0%; }
.pk-p9-1 { left: 21.7%; top: 80.6%; }
.pk-p9-2 { left: 6.7%; top: 56.9%; }
.pk-p9-3 { left: 11.9%; top: 30.0%; }
.pk-p9-4 { left: 35.0%; top: 12.4%; }
.pk-p9-5 { left: 65.0%; top: 12.4%; }
.pk-p9-6 { left: 88.1%; top: 30.0%; }
.pk-p9-7 { left: 93.3%; top: 56.9%; }
.pk-p9-8 { left: 78.3%; top: 80.6%; }
/* (poker seat positions continued) */
.pk-p10-0 { left: 50.0%; top: 90.0%; }
.pk-p10-1 { left: 24.1%; top: 82.4%; }
.pk-p10-2 { left: 8.2%; top: 62.4%; }
.pk-p10-3 { left: 8.2%; top: 37.6%; }
.pk-p10-4 { left: 24.1%; top: 17.6%; }
.pk-p10-5 { left: 50.0%; top: 10.0%; }
.pk-p10-6 { left: 75.9%; top: 17.6%; }
.pk-p10-7 { left: 91.8%; top: 37.6%; }
.pk-p10-8 { left: 91.8%; top: 62.4%; }
/* (poker seat positions continued) */
.pk-p10-9 { left: 75.9%; top: 82.4%; }
.pk-p11-0 { left: 50.0%; top: 90.0%; }
.pk-p11-1 { left: 26.2%; top: 83.7%; }
.pk-p11-2 { left: 10.0%; top: 66.6%; }
.pk-p11-3 { left: 6.4%; top: 44.3%; }
.pk-p11-4 { left: 16.7%; top: 23.8%; }
.pk-p11-5 { left: 37.6%; top: 11.6%; }
.pk-p11-6 { left: 62.4%; top: 11.6%; }
.pk-p11-7 { left: 83.3%; top: 23.8%; }
/* (poker seat positions continued) */
.pk-p11-8 { left: 93.6%; top: 44.3%; }
.pk-p11-9 { left: 90.0%; top: 66.6%; }
.pk-p11-10 { left: 73.8%; top: 83.7%; }
.pk-p12-0 { left: 50.0%; top: 90.0%; }
.pk-p12-1 { left: 28.0%; top: 84.6%; }
.pk-p12-2 { left: 11.9%; top: 70.0%; }
.pk-p12-3 { left: 6.0%; top: 50.0%; }
.pk-p12-4 { left: 11.9%; top: 30.0%; }
.pk-p12-5 { left: 28.0%; top: 15.4%; }
/* (poker seat positions continued) */
.pk-p12-6 { left: 50.0%; top: 10.0%; }
.pk-p12-7 { left: 72.0%; top: 15.4%; }
.pk-p12-8 { left: 88.1%; top: 30.0%; }
.pk-p12-9 { left: 94.0%; top: 50.0%; }
.pk-p12-10 { left: 88.1%; top: 70.0%; }
.pk-p12-11 { left: 72.0%; top: 84.6%; }
@media (max-width: 600px) {
  .pk-ring { aspect-ratio: .9; }
  .pk-felt { width: 76%; height: 44%; }
  /* Smaller cards on phones. */
  .pk-card { --w: 34px; } .pk-card.sm { --w: 18px; } .pk-card.lg { --w: 58px; }
  .pk-seat { min-width: 0; padding: 3px 4px; font-size: 11px; }
  .pk-seat .av { width: 28px; height: 28px; }
}

/* Top bar search: just the magnifying glass */
.search-btn { width: 40px; padding: 9px; justify-content: center; }

/* Message search */
.side-search { margin-left: auto; }
.side-head .side-search + .side-new { margin-left: 0; }
.side-search.on { background: var(--active); color: var(--text); }
.content > .msg-search { max-width: 760px; }
.msg-search-form { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); }
.msg-search-form svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.msg-search-form input { flex: 1; border: 0; margin: 0; padding: 10px 4px; background: none; box-shadow: none; outline: none; font-size: 16px; }
.search-hits { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
/* Message search results. */
.search-hit { display: flex; gap: 12px; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--text); }
.search-hit:hover { background: var(--hover); }
.search-hit-main { min-width: 0; flex: 1; }
.search-hit-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.search-hit-meta .name { font-weight: 700; font-size: 14px; }
.search-chat { font-weight: 600; color: var(--text-2); }
.search-chat::before { content: "·"; margin-right: 8px; color: var(--text-3); }
.search-hit-meta time { margin-left: auto; }
.search-hit-text { margin-top: 2px; overflow-wrap: anywhere; }
/* The highlighted matching words in search results. */
.search-hit-text mark { background: var(--active); color: var(--text); border-radius: 4px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--text); }

/* Shared game links */
.person-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--hover); color: var(--text); flex: none; }
.person-icon svg { width: 20px; height: 20px; }
.invite-link { border-top: 1px solid var(--border) !important; border-radius: 0 0 12px 12px; margin-top: 6px; padding-top: 12px; }
.tile-game.watch .tile-status svg { width: 16px; height: 16px; color: var(--text-3); }
.tile-game.watch .tile-who { color: var(--text-2); }

/* BS */
.bs-center { gap: 22px; }
.bs-pile { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.bs-pile .pk-card { --w: 58px; }
.bs-empty { display: block; width: 58px; aspect-ratio: 5 / 7; border-radius: 8px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.bs-pile-count { position: absolute; right: -10px; bottom: -8px; min-width: 24px; padding: 2px 6px; border-radius: 9px; background: #111; color: #fff; font-size: 12px; text-align: center; box-shadow: 0 0 0 2px #85552f; }
.bs-claim { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.22); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,230,200,.35); }
.bs-claim b { font-size: 30px; font-weight: 800; }
.bs-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; min-height: 30px; }
/* BS: the line showing the last play ("maya ×3 Kings"). */
.bs-last { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--hover); font-weight: 600; font-size: 14px; }
.bs-last b { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 6px; background: var(--primary); color: var(--primary-text); }
.bs-x { color: var(--text-3); }
.bs-reveal { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--hover); font-size: 14px; font-weight: 600; }
.bs-mark { display: inline-flex; width: 22px; height: 22px; padding: 3px; border-radius: 50%; color: #fff; }
.bs-reveal.lied .bs-mark { background: #c0392b; } .bs-reveal.true .bs-mark { background: #1f7a45; }
.bs-mark svg { width: 100%; height: 100%; }
.bs-takes { margin-left: 4px; }
.bs-form { margin: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* BS: your hand (tap cards to pick them). */
.bs-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; padding-top: 12px; }
.bs-pick { position: relative; display: inline-flex; cursor: default; transition: transform .12s ease; }
label.bs-pick { cursor: pointer; }
.bs-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bs-pick .pk-card { --w: 50px; box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px var(--border); }
label.bs-pick:hover { transform: translateY(-4px); }
.bs-pick input:checked + .pk-card { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--text), 0 6px 12px rgba(0,0,0,.2); }
.bs-pick input:focus-visible + .pk-card { outline: 2px solid var(--text); outline-offset: 2px; }

/* Heads Up: players in a circle, no table */
.hu-ring { aspect-ratio: 1.45; }
.hu-mid { position: absolute; left: 50%; top: 50%; width: 60%; height: 54%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; }
.hu-ring-arrow { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--border-strong); pointer-events: none; }
.hu-ring-arrow path { vector-effect: non-scaling-stroke; }
.hu-mid.ccw .hu-ring-arrow { transform: scaleX(-1); }
.hu-center { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 80%; text-align: center; }
.hu-q { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.hu-q.muted { font-weight: 500; color: var(--text-2); }
/* Heads Up: each player's seat with their word. */
.hu-seat { gap: 3px; }
.hu-word { max-width: 132px; padding: 4px 10px; border-radius: 8px; background: var(--primary); color: var(--primary-text); font-weight: 800; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hu-word.hidden { background: var(--hover); color: var(--text-3); }
.hu-word.wait { background: var(--hover); color: var(--text-2); display: inline-flex; width: 30px; height: 24px; padding: 4px; justify-content: center; }
.hu-word.wait svg { width: 100%; height: 100%; }
.hu-seat.got { opacity: .6; }
.hu-voted { position: absolute; top: 30px; right: 4px; display: inline-flex; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--text); color: var(--bg); }
.hu-voted svg { width: 100%; height: 100%; }
.hu-place { position: absolute; top: 30px; left: 4px; min-width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
/* Heads Up: the answer and vote buttons (True, False, Unsure, Correct). */
.hu-answer, .hu-vote { display: inline-flex; align-items: center; justify-content: center; height: 40px; min-width: 100px; padding: 0 14px; border-radius: 12px; border: 0; font: inherit; font-weight: 800; }
.hu-vote { height: 48px; min-width: 112px; cursor: pointer; opacity: .9; }
.hu-vote:hover { opacity: 1; transform: translateY(-1px); }
.hu-vote.picked { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); opacity: 1; }
.a-true { background: #2f9e57; color: #fff; } .a-false { background: #d64545; color: #fff; }
.a-unsure { background: #f2c230; color: #3b2c00; } .a-correct { background: var(--primary); color: var(--primary-text); }
.hu-controls { display: flex; justify-content: center; width: 100%; }
.hu-votes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; }
.hu-ask { display: flex; gap: 8px; width: min(100%, 460px); margin: 0; }
/* Heads Up: the box for typing a question. */
.hu-ask input { flex: 1; margin: 0; }

/* Group Chat Quiz */
.cq-range { color: var(--text-3); font-size: 13px; font-weight: 600; }
.cq-dots { display: flex; gap: 6px; }
.cq-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.cq-dot.now { box-shadow: inset 0 0 0 2px var(--text); }
.cq-dot.right { background: var(--text); box-shadow: none; } .cq-dot.wrong { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); position: relative; }
.cq-dot.wrong::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--text-3); }
.cq-msgs { display: flex; flex-direction: column; gap: 6px; width: min(100%, 520px); }
.cq-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
/* Group Chat Quiz: the quoted message bubbles. */
.cq-msg .bubble { font-size: 17px; }
.cq-when { color: var(--text-3); font-size: 12.5px; padding-left: 12px; }
.cq-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(100%, 520px); margin: 0; }
@media (max-width: 480px) { .cq-options { grid-template-columns: 1fr; } }
.cq-option { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; }
.cq-option:hover { background: var(--hover); }
.cq-arrow { color: var(--text-3); margin: 0 2px; font-weight: 400; }
.cq-result { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--hover); }
.cq-result svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; }
/* Group Chat Quiz: the right and wrong marks. */
.cq-result.right svg { background: var(--primary); color: var(--primary-text); }
.cq-result.wrong svg { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1.5px var(--text-3); }
.cq-board { width: min(100%, 420px); }
.cq-progress { margin-left: auto; color: var(--text-3); font-size: 12px; }
.cq-board .wins { margin-left: auto; min-width: 18px; text-align: right; }

@media (max-width: 560px) {
  .hu-ring { width: 84%; margin: 14px auto 18px; }
  .hu-word { max-width: 84px; font-size: 11px; padding: 3px 7px; }
}
@media (max-width: 560px) {
  /* BS: the face-down pile. */
  .bs-pile .pk-card { --w: 40px; }
  .bs-empty { width: 40px; }
}

/* Profile: signed-in devices */
.devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-width: 560px; }
.device { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; }
.device:hover { background: var(--hover); }
.device > svg { width: 22px; height: 22px; flex: none; color: var(--text-2); }
.device-info { flex: 1; min-width: 0; }
.device-name { font-weight: 600; }

/* Group Chat Quiz: answering together */
.cq-option.chosen { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.cq-option.chosen .name { color: inherit; }
.cq-option.correct { box-shadow: 0 0 0 2px var(--text); border-color: var(--text); }
.cq-option.missed { text-decoration: line-through; text-decoration-color: var(--text-3); }
.cq-option.faded, .cq-option.missed { opacity: .5; }
.cq-who { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px; }
.cq-voters { display: inline-flex; gap: 2px; margin-left: 6px; }
.cq-voters .av { width: 20px; height: 20px; }
/* Group Chat Quiz: everyone's picture, dimmed until they've answered. */
.cq-answered { display: flex; gap: 6px; }
.cq-a { opacity: .3; transition: opacity .2s ease; }
.cq-a.done { opacity: 1; }
span.cq-option { cursor: default; }

/* ---------- Catan ---------- */
/* (Catan's sea and sand colors, in light and dark versions. The board itself is an SVG drawing
   made by catan.js; these rules color its tiles by resource.) */
:root { --cn-sea: #bcd4df; --cn-sand: #efe3c4; }
:root[data-theme="dark"] { --cn-sea: #1f3743; --cn-sand: #4a4230; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cn-sea: #1f3743; --cn-sand: #4a4230; } }
.cn-rules { display: flex; gap: 8px; }
.cn-pill { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--hover); font-weight: 700; font-size: 14px; }
.cn-pill .cn-ui { width: 16px; height: 16px; }
.cn-board-form { width: 100%; margin: 0; display: flex; justify-content: center; }
.cn-board { display: block; width: 100%; max-width: 640px; height: auto; font-family: inherit; overflow: visible; }
/* Catan: the bigger board for 5 to 6 players. */
.cn-b6 { max-width: 720px; }
.cn-sea { fill: var(--cn-sea); stroke: var(--cn-sea); stroke-width: 70; stroke-linejoin: round; }
.cn-hex { stroke: var(--cn-sand); stroke-width: 1.5; stroke-linejoin: round; stroke-opacity: .7; }
.t-wood .cn-hex { fill: #2c6e35; } .t-brick .cn-hex { fill: #c9542a; } .t-sheep .cn-hex { fill: #88c442; }
.t-wheat .cn-hex { fill: #f0b622; } .t-ore .cn-hex { fill: #6b7787; } .t-desert .cn-hex { fill: #e3c88a; }
.cn-tico { fill: none; stroke: rgba(255, 255, 255, .88); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.t-desert .cn-tico, .t-wheat .cn-tico { stroke: rgba(70, 50, 20, .55); }
.cn-token circle:first-child { fill: #f7f0df; stroke: rgba(0, 0, 0, .18); stroke-width: 1.5; }
.cn-token text { font-size: 19px; font-weight: 800; text-anchor: middle; fill: #1d1d1d; }
/* Catan: the dots under each number token. */
.cn-token .pip { fill: #1d1d1d; }
.cn-token.hot text, .cn-token.hot .pip { fill: #c0392b; }
.cn-robber circle, .cn-robber path { fill: #232323; stroke: #fff; stroke-width: 2; }
.cn-robber .shadow { fill: rgba(0, 0, 0, .35); stroke: none; }
.cn-port path { fill: none; stroke: #8a6a45; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.cn-port circle { fill: #fff; stroke: #8a6a45; stroke-width: 2; }
.cn-port text { font-size: 11.5px; font-weight: 800; text-anchor: middle; fill: #3b2a17; }
.cn-port[class*="pf-"] text { fill: #fff; }
.pf-wood circle { fill: #2c6e35; } .pf-brick circle { fill: #c9542a; } .pf-sheep circle { fill: #6fae2e; } .pf-wheat circle { fill: #d99b0c; } .pf-ore circle { fill: #5d6878; }
/* Catan: roads. */
.cn-road { stroke-width: 8; stroke-linecap: round; }
.cn-road-edge { stroke: rgba(0, 0, 0, .55); stroke-width: 12; stroke-linecap: round; }
.cn-build { stroke: #161616; stroke-width: 2.2; stroke-linejoin: round; }
.cn-vspot { fill: rgba(255, 255, 255, .92); stroke: #161616; stroke-width: 2; cursor: pointer; }
.cn-vspot:hover, .cn-vspot:focus-visible { fill: #161616; stroke: #fff; outline: none; }
.cn-espot { stroke: rgba(255, 255, 255, .9); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 2 9; cursor: pointer; }
.cn-espot:hover, .cn-espot:focus-visible { stroke: #161616; stroke-dasharray: none; outline: none; }
.cn-cspot { fill: transparent; stroke: #fff; stroke-width: 3; stroke-dasharray: 4 4; cursor: pointer; }
.cn-cspot:hover, .cn-cspot:focus-visible { fill: rgba(255, 255, 255, .3); outline: none; }
/* Catan: the hexes you can move the robber to. */
.cn-hspot { fill: transparent; stroke: #fff; stroke-width: 3; stroke-dasharray: 6 6; cursor: pointer; }
.cn-hspot:hover, .cn-hspot:focus-visible { fill: rgba(255, 255, 255, .28); outline: none; }

.cn-top { display: flex; align-items: center; justify-content: center; gap: 16px; width: min(100%, 640px); min-height: 44px; }
.cn-dice { display: flex; gap: 6px; flex: none; }
.cn-die { width: 40px; height: 40px; }
.cn-die.red rect { fill: #d63a3f; } .cn-die.red circle { fill: #f7c51e; }
.cn-die.yellow rect { fill: #f2bd1a; } .cn-die.yellow circle { fill: #d63a3f; }
.cn-die { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3)); }
/* The latest three moves, newest first and boldest. Two columns: who, then what happened, so
   the dice and resources line up from row to row. */
.cn-log { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 6px; row-gap: 3px; align-items: center; font-size: 13px; min-width: 0; }
.cn-log li { display: contents; color: var(--text-2); }
.cn-log li:first-child { color: var(--text); font-weight: 600; }
.cn-log li:not(:first-child) > * { opacity: .7; }
.cn-who, .cn-what { display: flex; align-items: center; gap: 5px; min-width: 0; }
.cn-what { flex-wrap: wrap; }
.cn-log .cn-ui { width: 15px; height: 15px; }
.cn-roll { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--primary); color: var(--primary-text); font-weight: 800; font-size: 12px; }
/* Catan: who got what in the history list. */
.cn-got { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; }
.cn-got .name { display: inline-block; }
.cn-gain { display: inline-flex; align-items: center; gap: 1px; height: 20px; padding: 0 5px 0 3px; border-radius: 6px; color: #fff; font-weight: 800; font-size: 12px; }
.cn-gain .cn-ico { width: 14px; height: 14px; }
.cn-swap { color: var(--text-3); font-weight: 400; }

.cn-ui { width: 17px; height: 17px; flex: none; }
.cn-ico { width: 20px; height: 20px; flex: none; }
.r-wood { background: #2c6e35; } .r-brick { background: #c9542a; } .r-sheep { background: #6fae2e; } .r-wheat { background: #e0a514; } .r-ore { background: #6b7787; }

/* Catan: the list of players with their cards and points. */
.cn-players { display: grid; gap: 4px; width: min(100%, 640px); }
.cn-player { display: grid; grid-template-columns: auto minmax(0, 1fr) repeat(4, auto); align-items: center; gap: 12px; padding: 6px 10px; border-radius: 12px; font-size: 14px; }
.cn-player.out { opacity: .45; }
.cn-pname { display: inline-flex; align-items: center; gap: 6px; }
.cn-pd > summary { list-style: none; cursor: pointer; }
.cn-pd > summary::-webkit-details-marker { display: none; }
.cn-pd > summary:hover { background: var(--hover); }
.cn-pd[open] > summary { background: var(--hover); }
.cn-tradeicon { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--border-strong); color: var(--text-2); }
/* Catan: the trade icon (blank when you can't trade with someone). */
.cn-tradeicon.none { border-color: transparent; }
.cn-pd[open] .cn-tradeicon { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.cn-awards { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cn-award { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--hover); color: var(--text-3); font-size: 13px; font-weight: 700; }
.cn-award.held { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); background: var(--surface); }
.cn-award-name { color: var(--text-2); font-weight: 600; }
.cn-award b { }
.cn-outgoings { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cn-outgoing { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 4px 4px 4px 8px; border-radius: 999px; border: 1px dashed var(--border-strong); }
/* Catan: the button that takes back your trade offer. */
.cn-withdraw { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--hover); color: var(--text-2); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.cn-withdraw:hover { background: var(--border); }
.cn-incoming { box-shadow: inset 0 0 0 1.5px var(--text); }
.cn-offer .av { width: 24px; height: 24px; }
.cn-rp i { position: absolute; right: -5px; bottom: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--primary); color: var(--primary-text); font-style: normal; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.cn-trade > summary .cn-ui { width: 18px; height: 18px; }
.game-page { position: relative; }
/* Resign, in every game that has it (Catan, Checkers, Go): a small flag at the top right of the
   page, level with the game's name. */
.waiting { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.waiting h1 { margin: 0; font-size: clamp(26px, 5vw, 40px); letter-spacing: -0.02em; }
.mod-slow { margin-bottom: 26px; }
.game-resign { position: absolute; top: 3px; right: 0; margin: 0; display: flex; align-items: center; gap: 2px; }
.game-resign-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.game-resign-btn:hover { background: var(--hover); color: var(--text); }
.game-resign-btn svg { width: 18px; height: 18px; }
/* keep a link game's share box clear of the flag */
.game-page:has(.game-resign) .game-head { padding-right: 40px; }
.game-page:has(.game-resign button:nth-of-type(2)) .game-head { padding-right: 76px; }
.game-page:has(.game-resign button:nth-of-type(3)) .game-head { padding-right: 112px; }
/* The link button (games for more than 2 players): copies the game's join link; a tick shows it worked. */
.game-link-btn.done { background: var(--primary); color: var(--primary-text); }
.game-head .host-btn + .host-btn { margin-left: 4px; }
/* Full screen (the host screen's button): just the game, filling the screen. Where the browser
   can't go full screen, the game covers the page instead and the button stays in the corner. */
#game:fullscreen { background: var(--bg); padding: 3vh 3vw; box-sizing: border-box; overflow: auto; justify-content: center; }
.game-full #game { position: fixed; inset: 0; z-index: 1000; background: var(--bg); padding: 3vh 3vw; box-sizing: border-box; overflow: auto; justify-content: center; }
/* The host's screen button at the top right of a game (just left of the Resign flag, when a game
   has one). It's pushed to the right ("margin-left: auto") unless a link game's share box is
   already there, in which case it sits just after the box. While the host screen is showing,
   the button is filled in (dark on light, light on dark). */
.game-head .host-btn { margin-left: auto; flex: none; }
.host-btn[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); }
.host-btn[aria-pressed="true"]:hover { background: var(--primary); opacity: .85; }
.cn-player.on { background: var(--hover); box-shadow: inset 0 0 0 1.5px var(--text); }
.cn-swatch { display: flex; }
.cn-pname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-stat { display: inline-flex; align-items: baseline; gap: 4px; color: var(--text-2); font-weight: 700; min-width: 34px; } /* "3" and "/12" share a baseline */
.cn-stat > .cn-ui { align-self: center; }
.cn-stat.cn-lead { color: var(--text); }
.cn-stat.cn-lead .cn-ui { fill: currentColor; fill-opacity: .25; }
.cn-points { color: var(--text); min-width: 54px; }
.cn-points small { color: var(--text-3); font-weight: 600; }

.cn-hand { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cn-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 54px; height: 74px; border-radius: 10px; color: #fff;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .85), 0 1px 3px rgba(0, 0, 0, .25); }
/* Catan: the resource cards in your hand. */
.cn-card .cn-ico { width: 26px; height: 26px; }
.cn-card b { font-size: 18px; line-height: 1; }
.cn-card.none { opacity: .35; }
.cn-devs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cn-dev { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; list-style: none; }
.cn-dev::-webkit-details-marker { display: none; }
.cn-dev:hover { background: var(--hover); }
.cn-dev.wait, .cn-dev.vp { cursor: default; color: var(--text-2); border-style: dashed; }
.cn-dev.wait:hover, .cn-dev.vp:hover { background: var(--surface); }
/* Catan: development cards. */
.cn-dev b { color: var(--text-3); font-weight: 700; }
.cn-devpick[open] > .cn-dev { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.cn-devpick { position: relative; }
.cn-pickform, .cn-panel { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0 0; padding: 12px; border-radius: 16px; background: var(--hover); }
.cn-respick { display: flex; gap: 6px; }
.cn-rp { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; cursor: pointer; opacity: .45; }
.cn-rp input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cn-rp:has(input:checked) { opacity: 1; box-shadow: 0 0 0 2.5px var(--text); }
.cn-rp:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 3px; }
/* Catan: the number boxes for trading and discarding. */
.cn-counts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cn-count { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 4px; width: 56px; border-radius: 10px; color: #fff; }
.cn-count input { width: 46px; padding: 4px 2px; border-radius: 7px; border: 0; text-align: center; font: inherit; font-weight: 800; color: #161616; background: #fff; }
.cn-count:has(input:disabled) { opacity: .35; }
.cn-tlabel { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.cn-trade { display: flex; flex-direction: column; align-items: center; }
.cn-trade > summary { list-style: none; cursor: pointer; }
.cn-trade > summary::-webkit-details-marker { display: none; }
.cn-trade[open] > summary { background: var(--primary); color: var(--primary-text); }
/* Catan: a trade offer (what's given and what's asked for). */
.cn-offer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; font-weight: 700; }
.cn-answers { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cn-answer { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 6px; border-radius: 12px; border: 1px dashed var(--border-strong); background: transparent; font: inherit; font-weight: 700; color: var(--text-2); }
.cn-answer.no { opacity: .4; text-decoration: line-through; }
.cn-answer.yes { border: 1.5px solid var(--text); background: var(--surface); color: var(--text); cursor: pointer; }
.cn-answer.yes:hover { background: var(--primary); color: var(--primary-text); }
.cn-answer.yes:hover .name { color: inherit; }
.cn-victims { display: flex; gap: 10px; justify-content: center; margin: 0; }
.cn-victim { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; }
/* Catan: the buttons for picking who to rob. */
.cn-victim:hover { background: var(--hover); }
.cn-turn { margin: 0; }
.cn-costs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: min(100%, 520px); margin-top: 4px; }
.cn-costs form { margin: 0; display: contents; }
.cn-cost { display: flex; align-items: center; gap: 3px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: transparent; font: inherit; color: var(--text-3); opacity: .7; text-align: left; }
.cn-cost.ok { opacity: 1; color: var(--text); border-color: var(--border-strong); }
.cn-cost.buy { cursor: pointer; background: var(--surface); }
.cn-cost.buy:hover { background: var(--hover); }
.cn-cost-name { flex: 1; font-weight: 700; font-size: 13px; }
/* Catan: the building costs list. */
.cn-cost i { display: flex; width: 20px; height: 20px; border-radius: 5px; color: #fff; align-items: center; justify-content: center; }
.cn-cost i .cn-ico { width: 14px; height: 14px; }
@media (max-width: 560px) {
  .cn-player { grid-template-columns: auto minmax(0, 1fr) repeat(4, auto); gap: 7px; padding: 5px 6px; font-size: 13px; }
  .cn-award-name { display: none; }
  .cn-player .av { width: 26px; height: 26px; }
  .cn-stat { min-width: 0; gap: 2px; }
  .cn-stat .cn-ui { width: 14px; height: 14px; }
  .cn-points { min-width: 0; }
  /* Catan: smaller cards on phones. */
  .cn-card { width: 50px; height: 68px; }
  .cn-costs { grid-template-columns: 1fr; }
  .cn-top { gap: 10px; }
  .cn-die { width: 34px; height: 34px; }
}

/* Quiz: messages from (possibly) different people */
.cq-msgs.many { gap: 14px; }
.cq-msg:has(.cq-sender) { flex-direction: row; align-items: flex-start; gap: 10px; }
.cq-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.cq-sender, .cq-n { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; background: var(--hover); color: var(--text-2); font-weight: 800; }
.cq-sender { width: 32px; height: 32px; font-size: 14px; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.cq-n { width: 18px; height: 18px; font-size: 11px; margin-right: 4px; }
.cq-slot { display: inline-flex; align-items: center; margin: 0 5px; }
.cq-option.chosen .cq-n { background: rgba(255, 255, 255, .2); color: inherit; }

/* ---------- McHub ---------- */
/* (McHub uses the same packed-column layout as the board; each item is outlined in its author's
   color.) */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 20px; align-items: start; }
.hub.masonry { grid-auto-rows: 1px; row-gap: 0; }
.hub > .empty { grid-column: 1 / -1; }
.hub-item { border: 2.5px solid var(--border-strong); border-radius: 16px; background: var(--surface); box-shadow: none; }
.note.hub-item { background: var(--surface); padding: 16px 18px 12px; }
.hub-article { padding: 4px 18px 12px; }
.hub-article .article-card { border: 0; padding: 14px 0 6px; }
.hub-game { padding: 12px 14px; }
/* On McHub a game is one card: no box inside the box. The outline (in the color of whoever started
   it) is the card; inside are the game's symbol (with their picture as a badge on its corner), its
   name, where it's at, and the button. The name and status wrap rather than get cut off. */
.hub-game .game-card { min-width: 0; padding: 0; gap: 14px; border: 0; border-radius: 0; background: none; }
.hub-game .game-icon { position: relative; width: 44px; height: 44px; border-radius: 13px; }
.hub-game .game-icon svg { width: 26px; height: 26px; }
.hub-game .game-card-title { font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; }
.hub-game .game-card-status { margin-top: 1px; line-height: 1.35; }
.game-card-by { position: absolute; right: -6px; bottom: -6px; display: flex; border-radius: 50%; }
.game-card-by .av { box-shadow: 0 0 0 2px var(--surface); }
.game-card-status { display: flex; align-items: center; flex-wrap: wrap; column-gap: 6px; }

/* ---------- Prediction Market ---------- */
/* (The market's colors: green for Yes, red for No (plus soft see-through versions for
   backgrounds), and blue for the price line. Like everything else, they have dark mode versions.) */
:root { --yes: #2c9a68; --yes-soft: rgba(44, 154, 104, .12); --no: #d33a4a; --no-soft: rgba(211, 58, 74, .11); --mk-line: #4a7fd6; }
:root[data-theme="dark"] { --yes: #4cc28c; --yes-soft: rgba(76, 194, 140, .15); --no: #f0646f; --no-soft: rgba(240, 100, 111, .15); --mk-line: #7aa6ee; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --yes: #4cc28c; --yes-soft: rgba(76, 194, 140, .15); --no: #f0646f; --no-soft: rgba(240, 100, 111, .15); --mk-line: #7aa6ee; } }
.mk-head-actions, .head-actions { display: flex; align-items: center; gap: 10px; }
.mk-balance { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--hover); }
.mk-balance svg { width: 18px; height: 18px; }
.mk-balance:hover { background: var(--active); }
.mk-grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; margin-bottom: 26px; align-items: start; }
/* Market cards: who opened the market. */
.mk-card-by { margin-top: 8px; font-size: 12.5px; }
.mk-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.mk-card.hub-item { border-width: 2.5px; }
.mk-card-link { display: block; padding: 16px 16px 6px; color: inherit; text-decoration: none; }
.mk-card-link:hover { background: var(--hover); }
.mk-card-top { display: flex; align-items: flex-start; gap: 12px; }
.mk-q { flex: 1; margin: 0; font-size: 20px; line-height: 1.25; }
/* The chance of Yes on a market card: the number big and heavy, "Yes" tucked under it, both
   right-aligned in the card's top corner. */
.mk-chance { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; color: var(--yes); }
.mk-chance b { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.mk-chance b i { font-style: normal; font-size: 23px; font-weight: 800; margin-left: 1px; }
.mk-chance small { font-size: 14px; font-weight: 800; margin-top: 4px; letter-spacing: .01em; }
.mk-chart { display: block; width: 100%; height: 54px; margin-top: 8px; }
.mk-chart.big { height: 200px; }
@media (max-width: 560px) { .mk-chart.big { height: 150px; } }
.mk-line { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
/* Market charts: the Yes and No lines. */
.mk-line.yes { stroke: var(--yes); } .mk-line.no { stroke: var(--no); display: none; }
.mk-chart:not(.big) .mk-line.yes, .mk-line.wallet { stroke: var(--mk-line); }
.mk-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.mk-chart-wrap { position: relative; padding-right: 34px; }
.mk-glabel { position: absolute; right: 0; font-size: 11px; color: var(--text-3); transform: translateY(-50%); }
/* chart is 180 tall with 13px top inset and 154px of plot: a label sits at its line */
.mk-glabel.g75 { top: calc(100% * (13 + 154 * .25) / 180); } .mk-glabel.g50 { top: calc(100% * (13 + 154 * .5) / 180); } .mk-glabel.g25 { top: calc(100% * (13 + 154 * .75) / 180); }
.mk-card-foot { display: flex; align-items: center; gap: 8px; padding: 8px 16px 14px; flex-wrap: wrap; }
.mk-card-foot .mk-vol { margin-left: auto; }
/* A card's Yes and No buttons: big and bold, so they're the first thing to tap. */
.mk-card-foot .mk-pill { height: 40px; min-width: 88px; justify-content: center; padding: 0 16px; gap: 7px; font-size: 16px; font-weight: 800; }
.mk-card-foot .mk-pill b { font-size: 17px; }
.mk-card .comments { border-top: 1px solid var(--border); padding: 0 16px 8px; }
/* On McHub a market card is a little more compact than on the Market page: tighter spacing and a
   shorter price line, same parts in the same places. */
.hub .mk-card-link { padding: 14px 16px 4px; }
.hub .mk-card-by { margin-top: 4px; }
.hub .mk-chart { height: 38px; margin-top: 6px; }
.hub .mk-card-foot { padding: 6px 16px 12px; }
.mk-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-weight: 700; font-size: 13.5px; text-decoration: none; background: var(--hover); color: var(--text); }
.mk-pill b { }
.mk-pill.yes { background: var(--yes-soft); color: var(--yes); }
.mk-pill.no { background: var(--no-soft); color: var(--no); }
/* Market Yes / No buttons, and hover. */
a.mk-pill.yes:hover { background: var(--yes); color: #fff; } a.mk-pill.no:hover { background: var(--no); color: #fff; }
.mk-pill svg { width: 15px; height: 15px; }
.mk-vol { display: inline-flex; align-items: baseline; gap: 5px; color: var(--text); font-size: 14.5px; font-weight: 700; }
.mk-vol svg { width: 17px; height: 17px; color: var(--text-2); align-self: center; }
.mk-vol small { color: var(--text-3); font-size: 12px; font-weight: 700; }
.mk-result { padding: 4px 10px; border-radius: 8px; font-weight: 800; font-size: 13px; background: var(--hover); }
.mk-result.r-yes, .mk-resolved.r-yes { background: var(--yes-soft); color: var(--yes); }
.mk-result.r-no, .mk-resolved.r-no { background: var(--no-soft); color: var(--no); }

/* One market's page. */
.mk-page { max-width: 1040px; }
.mk-title { display: flex; align-items: flex-start; gap: 14px; }
.mk-title h1 { flex: 1; margin: 0; font-size: 30px; line-height: 1.2; }
.mk-meta { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; }
.mk-details { color: var(--text-2); margin: 10px 0; max-width: 720px; }
.mk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; margin-top: 16px; align-items: start; }
@media (max-width: 900px) { .mk-layout { grid-template-columns: minmax(0, 1fr); } .mk-side-col { position: static; } }
.mk-big { display: flex; align-items: baseline; gap: 8px; }
.mk-big-n { font-size: 40px; font-weight: 800; line-height: 1; }
/* The big chance numbers on a market's page. */
.mk-big-l { font-weight: 700; }
.mk-big-n.yes, .mk-big-l.yes { color: var(--yes); } .mk-big-n.no, .mk-big-l.no { color: var(--no); display: none; }
/* Choosing No in the ticket flips the big number and the chart to No */
/* (This uses ":has" so that picking No on the order ticket changes what the rest of the page shows,
   with no script needed.) */
.mk-page:has(.mk-side.no input:checked) .mk-big .yes, .mk-page:has(.mk-side.no input:checked) .mk-line.yes { display: none; }
.mk-page:has(.mk-side.no input:checked) .mk-big .no { display: inline; }
.mk-page:has(.mk-side.no input:checked) .mk-line.no { display: inline; }
.mk-books { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.section-label.yes { color: var(--yes); } .section-label.no { color: var(--no); }
.mk-book { width: 100%; border-collapse: collapse; font-size: 14px; }
.mk-book td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.mk-book td:last-child { text-align: right; color: var(--text-2); }
/* The resting orders table. */
.mk-book td:nth-child(2) { font-weight: 700; }
.mk-book.yes td:nth-child(2) { color: var(--yes); } .mk-book.no td:nth-child(2) { color: var(--no); }
.mk-book td:first-child { color: var(--text-2) !important; font-weight: 600 !important; width: 52px; }
.mk-book.yes td:first-child { color: var(--yes); font-weight: 700; } .mk-book.no td:first-child { color: var(--no); font-weight: 700; }
/* Trading history: one row per trade in four columns (what, McPoints, price after, when). The
   numbers are right-aligned and every column lines up from row to row. */
.mk-trades { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content max-content max-content minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 6px; font-size: 13px; color: var(--text-2); }
.mk-trades li { display: contents; }
.mk-trades .mk-pill { justify-self: start; }
.mk-trades .mk-amt, .mk-trades .mk-t-after { justify-self: end; }
/* The amount fills its column: the coin always on the left edge, the number on the right. */
.mk-trades .mk-amt { justify-self: stretch; justify-content: space-between; gap: 6px; }
.mk-trades time { white-space: nowrap; }
.mk-trades .mk-pill { height: 24px; padding: 0 8px; font-size: 12px; }
.mk-side-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--top-h) + 16px); }
.mk-ticket { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface); }
.mk-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-side { position: relative; }
.mk-side input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
/* The order ticket's Yes / No switch. */
.mk-side span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px; border-radius: 12px; font-weight: 800; font-size: 16px; border: 1.5px solid transparent; }
.mk-side.yes span { background: var(--yes-soft); color: var(--yes); } .mk-side.no span { background: var(--no-soft); color: var(--no); }
.mk-side span { opacity: .55; }
.mk-side input:checked + span { opacity: 1; }
.mk-side.yes input:checked + span { border-color: var(--yes); } .mk-side.no input:checked + span { border-color: var(--no); }
.mk-side input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.mk-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--hover); }
.mk-seg label { display: block; position: relative; }
.mk-seg span { display: block; text-align: center; padding: 8px 0; border: 0; border-radius: 9px; font-weight: 700; color: var(--text-2); }
/* Segmented switches (Buy / Sell, Market / Limit): the picked one turns solid. */
.mk-seg input:checked + span { background: var(--surface); color: var(--text); border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.mk-field { display: flex; flex-direction: column; gap: 6px; }
.mk-limit { display: none; }
.mk-ticket:has(input[value="limit"]:checked) .mk-limit { display: flex; }
.mk-panel { padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; }
.mk-panel .section-label { margin-top: 0; }
.mk-sub { margin: 14px 0 8px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.mk-positions { padding: 18px 18px 16px; border: 1.5px solid var(--border-strong); border-radius: 18px; }
.mk-pos-title { margin: 0; font-size: 19px; font-weight: 800; }
/* The big Yes / No pills. */
.mk-pill.big { height: 40px; padding: 0 16px; font-size: 16px; gap: 8px; }
.mk-pill.big b { font-size: 17px; }
.mk-positions .mk-rows { gap: 10px; }
.mk-positions .mk-amt { font-size: 17px; }
.mk-positions .mk-amt svg { width: 19px; height: 19px; }
.mk-positions .section-label + .mk-sub { margin-top: 2px; }
/* A grid so every amount starts at the same spot, however wide the pill before it is. */
.mk-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); align-items: center; gap: 6px 10px; }
.mk-rows li { display: contents; }
.mk-rows .mk-pill { grid-column: 1; justify-self: start; }
.mk-rows .mk-amt { }
.mk-rows form { justify-self: end; }
.mk-amt { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.mk-amt svg { width: 16px; height: 16px; color: var(--text-2); }
.mk-votes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; }
/* Voting on a market's outcome. */
.mk-vote { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface); font: inherit; font-weight: 700; color: var(--text); cursor: pointer; }
.mk-vote b { font-size: 12px; color: var(--text-3); }
.mk-vote.r-yes { color: var(--yes); } .mk-vote.r-no { color: var(--no); }
.mk-vote.on.r-yes { background: var(--yes); color: #fff; border-color: var(--yes); } .mk-vote.on.r-no { background: var(--no); color: #fff; border-color: var(--no); }
.mk-vote.on.r-void { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.mk-vote.on b { color: inherit; }
.mk-tally { margin: 8px 0 0; text-align: center; color: var(--text-3); font-size: 13px; font-weight: 700; }
.mk-resolved { align-self: center; padding: 6px 14px; border-radius: 999px; font-size: 15px; font-weight: 800; background: var(--hover); }
.mk-resolve { position: relative; align-self: center; }
/* The fold-out for resolving a market. */
.mk-resolve > summary { list-style: none; cursor: pointer; }
.mk-resolve > summary::-webkit-details-marker { display: none; }
.mk-resolve[open] > summary { background: var(--active); }
.mk-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 280px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
/* Your wallet on a market's page: on the right of the row with the big chance, above the chart. */
.mk-big .mk-balance { margin-left: auto; align-self: center; }
.mk-balance.big { height: 48px; padding: 0 18px 0 12px; gap: 8px; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.mk-balance.big svg { width: 24px; height: 24px; }
.mk-balance.big b { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.mk-balance.big:hover { background: var(--hover); }
/* The resolve and resolved labels in the market details. */
.mk-meta .mk-resolve, .mk-meta .mk-resolved { margin-left: 2px; }
.mk-meta .mk-pop { left: 0; right: auto; }
.mk-h { margin: 22px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.mk-books { margin-top: 0; }
.mk-books .section-label { margin: 0 0 4px; }
.mk-lower { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; margin-top: 8px; align-items: start; }
@media (max-width: 1100px) { .mk-lower { grid-template-columns: minmax(0, 1fr); } }
/* the comments sit in their own rounded box beside the history, scrolling inside if long */
.mk-comments { margin-top: 22px; padding: 4px 14px 10px; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface); max-height: 460px; overflow-y: auto; }
.mk-comments .comments { margin: 0; }
.mk-t-after { color: var(--text-3); font-size: 12px; font-weight: 700; min-width: 32px; }
.mk-trades .mk-amt b { font-size: 13px; }
.mk-trades .mk-amt svg { width: 14px; height: 14px; }
/* Order size in contracts or McPoints, and what the order comes to (worked out by the server) */
.mk-pts { display: none; }
.mk-ticket:has(input[value="points"]:checked) .mk-pts { display: flex; }
.mk-ticket:has(input[value="points"]:checked) .mk-qty { display: none; }
.mk-quote { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); min-height: 46px; }
.mk-q-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); }
.mk-q-line { font-size: 14px; color: var(--text); font-weight: 600; }
.mk-q-line span:last-child { font-weight: 800; }
.mk-q-note { font-size: 12px; font-weight: 700; color: var(--text-3); }
/* The order ticket's total. */
.mk-q-total { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.mk-q-total > span { flex: 1; font-weight: 800; }
.mk-q-total b { font-size: 22px; }
.mk-q-total svg { width: 20px; height: 20px; color: var(--text-2); align-self: center; }
.mk-q-err { padding: 8px 10px; border-radius: 10px; background: var(--hover); color: var(--text-2); font-weight: 600; font-size: 14px; text-align: center; }
.mk-ticket .btn[disabled] { opacity: .45; cursor: not-allowed; }
/* 13. McPoint Wallet History */
.wallet-page { max-width: 760px; }
.wallet-page h1 { margin: 6px 0 12px; }
/* The total: coin, big number, then the change pill. The coin and the pill are both centred on the
   height of the digits (the pill starts on the number's baseline, then is lifted by half the
   difference between the big digits and its own digits). The pill uses the same size, padding and
   font as the Yes / No pills on the market cards. */
.wallet-now { display: flex; align-items: baseline; gap: 10px; }
.wallet-now svg { width: 30px; height: 30px; color: var(--text-2); align-self: center; position: relative; top: -2px; }
.wallet-now b { font-size: 40px; line-height: 1; }
.wallet-change { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; font-weight: 700; font-size: 13.5px; position: relative; top: -9px; }
.wallet-change.up { background: var(--yes-soft); color: var(--yes); } .wallet-change.down { background: var(--no-soft); color: var(--no); }
.wallet-split { display: flex; gap: 18px; margin: 10px 0 18px; color: var(--text-2); font-weight: 700; }
.wallet-split span { display: inline-flex; align-items: baseline; gap: 4px; } /* number and label share one baseline */
.wallet-split svg { align-self: center; }
.wallet-split svg { width: 16px; height: 16px; }
.wallet-split small { margin-left: 4px; color: var(--text-3); font-weight: 600; }
.wallet-chart { padding-right: 52px; }
.wallet-chart .mk-chart.big { height: 240px; }
/* the chart is 220 tall with 8px insets: labels at 20%, 50% and 80% of the range */
.mk-glabel.w0 { top: calc(100% * (8 + 204 * .8) / 220); } .mk-glabel.w1 { top: 50%; } .mk-glabel.w2 { top: calc(100% * (8 + 204 * .2) / 220); }
.wallet-range { display: flex; justify-content: space-between; margin-top: 6px; color: var(--text-3); font-size: 12.5px; }

/* Wallet: positions in each open market */
.wallet-pos-h { margin-top: 30px; }
.wallet-positions { display: flex; flex-direction: column; gap: 10px; }
.wallet-market { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 16px; color: inherit; text-decoration: none; }
.wallet-market:hover { background: var(--hover); }
.wm-top { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; }
.wm-q { flex: 1; font-weight: 800; font-size: 16px; }
.wm-chance { color: var(--text-2); font-weight: 800; }
.wm-rows { display: flex; flex-direction: column; gap: 6px; }
/* The wallet page's rows. */
.wm-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.wm-row .mk-sub { margin: 0; min-width: 130px; font-size: 13px; }
.wp-item { display: inline-flex; align-items: center; gap: 6px; }
.wm-value { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 2px; }
.wm-value small { color: var(--text-3); font-weight: 700; font-size: 12px; }
.wm-value .mk-amt b { font-size: 18px; }

/* Game setup: number fields, and Hold'em's McPoints buy-in (shown only when playing for McPoints) */
.setup-num { display: flex; flex-direction: column; gap: 6px; }
.setup-num input { width: 160px; }
.sf-buyin { display: none !important; }
.game-setup:has(input[name="stakes"][value="mcpoints"]:checked) .sf-buyin { display: flex !important; }
.game-setup:has(input[name="stakes"][value="mcpoints"]:checked) .sf-chips { display: none; }
/* Hold'em for McPoints: a red table */
.pk-felt.red { background: radial-gradient(ellipse at 50% 40%, #a8383a, #7c2426 75%); box-shadow: inset 0 0 0 6px #5c1a1c, inset 0 0 0 8px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.18); }
.pk-pot svg { width: 18px; height: 18px; }
.pk-buyin { gap: 6px; padding: 0 16px; }
.pk-buyin svg { width: 18px; height: 18px; }


/* Phones: the trade form comes right after the chart, before the order lists and history */
@media (max-width: 900px) {
  .mk-main { display: contents; }
  .mk-layout { display: flex; flex-direction: column; align-items: stretch; }
  .mk-big, .mk-chart-wrap { order: 1; }
  .mk-side-col { order: 2; position: static; }
  .mk-main > .mk-h, .mk-books { order: 3; }
  .mk-lower { order: 4; }
  .mk-title { flex-wrap: wrap; }
}
@media (max-width: 900px) { .mk-layout { gap: 18px; } }

/* Spades: four seats around a blue card table; the trick is played toward the middle */
.c8-felt.sp-felt { background: radial-gradient(ellipse at 50% 40%, #2f5f9e, #1d4378 75%); box-shadow: inset 0 0 0 6px #142f55, inset 0 0 0 8px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.18); }
.sp-trick { position: relative; width: 168px; height: 150px; }
.sp-play { position: absolute; transform: translate(-50%, -50%); transition: opacity .2s ease; }
.sp-play .pk-card { --w: 46px; }
.sp-t0 { left: 50%; top: 74%; } .sp-t1 { left: 20%; top: 50%; } .sp-t2 { left: 50%; top: 26%; } .sp-t3 { left: 80%; top: 50%; }
.sp-trick.last .sp-play { opacity: .5; }
.sp-trick.last .sp-play.won { opacity: 1; }
.sp-trick.last .sp-play.won .pk-card { box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.35); }
/* Spades: each player's bid. */
.sp-bid { padding: 1px 8px; border-radius: 999px; background: var(--hover); font-size: 12px; font-weight: 700; }
.sp-scores { display: flex; align-items: center; justify-content: center; gap: 14px; }
.sp-score { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--border); } /* score and last hand share a baseline */
.sp-score > .sp-avs, .sp-score > .sp-bags { align-self: center; }
.sp-score.mine { border-color: var(--text); }
.sp-score b { font-size: 18px; }
.sp-avs { display: inline-flex; }
.sp-avs .av + .av { margin-left: -6px; }
.sp-avs .av { box-shadow: 0 0 0 2px var(--bg); }
.sp-bags { min-width: 22px; padding: 1px 6px; border-radius: 6px; background: var(--hover); font-size: 12px; font-weight: 700; text-align: center; }
.sp-last { font-size: 12px; font-weight: 700; color: var(--text-3); }
/* Spades: the points to win. */
.sp-target { color: var(--text-3); font-weight: 700; font-size: 13px; }
.sp-team { padding: 0 7px; border-radius: 6px; background: var(--hover); font-size: 12px; font-weight: 800; }
.sp-team.t1 { background: var(--primary); color: var(--primary-text); }
.sp-pick { position: relative; display: inline-flex; padding: 0; border: 0; background: none; font: inherit; transition: transform .12s ease; }
.sp-pick .pk-card { --w: 50px; box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px var(--border); }
button.sp-pick { cursor: pointer; }
button.sp-pick:hover, button.sp-pick:focus-visible { transform: translateY(-10px); outline: none; }
button.sp-pick:focus-visible .pk-card { box-shadow: 0 0 0 3px var(--text); }
.sp-pick.no { opacity: .4; }
/* Spades: the bidding box. */
.sp-bidform { margin-top: 4px; }

/* Blackjack: the dealer across the top of the table, players along the curved front edge */
.content > .game-page:has(.bj-table) { max-width: 860px; }
.bj-table { width: 100%; display: flex; flex-direction: column; gap: 18px; padding: 18px 18px 30px; color: #fff; min-height: 360px;
  border-radius: 28px 28px 50% 50% / 28px 28px 34% 34%;
  background: radial-gradient(ellipse at 50% 30%, #2f7a55, #1d5a3d 75%); box-shadow: inset 0 0 0 6px #173f2c, inset 0 0 0 8px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.18); }
.bj-table.red { background: radial-gradient(ellipse at 50% 30%, #a8383a, #7c2426 75%); box-shadow: inset 0 0 0 6px #5c1a1c, inset 0 0 0 8px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.18); }
.bj-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; }
.bj-shoe, .bj-min { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(0,0,0,.28); font-weight: 700; font-size: 14px; }
.bj-shoe { justify-self: start; } .bj-min { justify-self: end; }
/* Blackjack: the shoe and minimum-bet labels. */
.bj-shoe svg, .bj-min svg { width: 18px; height: 18px; }
.bj-dealer { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bj-cards { display: flex; }
.bj-cards .pk-card + .pk-card { margin-left: calc(var(--w) * -.34); }
.pk-card.sm2 { --w: 40px; }
.bj-total { min-width: 32px; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.3); font-weight: 800; font-size: 14px; text-align: center; }
.bj-total.bust { background: rgba(0,0,0,.55); text-decoration: line-through; }
.bj-spots { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 14px 10px; margin-top: auto; }
.bj-spot { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 96px; }
/* Blackjack: an empty betting spot. */
.bj-spot.idle { opacity: .5; }
.bj-hand { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 6px 7px; border-radius: 14px; border: 2px solid transparent; }
.bj-hand.on { border-color: #fff; background: rgba(255,255,255,.08); }
.bj-bet { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.3); font-weight: 700; font-size: 13px; }
.bj-bet svg { width: 14px; height: 14px; }
.bj-res { padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 800; white-space: nowrap; background: rgba(0,0,0,.35); }
.bj-res.r-win, .bj-res.r-bj { background: #fff; color: #111; }
.bj-res.r-push { background: rgba(255,255,255,.22); }
.pk-seat.bj-seat { position: static; transform: none; color: var(--text); }
/* Blackjack: the seat whose turn it is. */
.bj-spot.on .bj-seat { border-color: var(--text); box-shadow: 0 2px 12px rgba(0,0,0,.12); }
@media (max-width: 700px) {
  .bj-table { padding: 14px 10px 24px; border-radius: 22px 22px 40% 40% / 22px 22px 18% 18%; }
  .bj-spot { min-width: 0; }
  .pk-card.sm2 { --w: 34px; }
  .sp-trick { width: 130px; height: 120px; }
  .sp-play .pk-card { --w: 36px; }
  .sp-pick .pk-card { --w: 40px; }
  .sp-scores { gap: 8px; }
}

/* Kings Corner: a chestnut-brown table with the eight piles around the deck in a 3-by-3 grid.
   --kcw is how wide one card is; everything on the table is sized from it. */
.kc-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.kc-seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px 5px; min-width: 64px;
  border-radius: 14px; border: 2px solid transparent; font-size: 13px; }
.kc-seat.on { border-color: var(--border-strong); background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.kc-last { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 13px; color: var(--text-2); }
.kc-last .name { font-weight: 700; }
.kc-form { margin: 0; width: 100%; display: flex; flex-direction: column; align-items: center; }
.kc-form > div { width: 100%; display: flex; flex-direction: column; align-items: center; }
/* Kings Corner (continued). */
.kc-table { --kcw: 52px; display: grid; grid-template-columns: repeat(3, calc(var(--kcw) + 34px)); grid-auto-rows: calc(var(--kcw) * 1.4 + 40px);
  justify-content: center; align-items: center; justify-items: center; gap: 6px; width: max-content; max-width: 100%; margin: 4px auto 0; padding: 18px 20px;
  border-radius: 26px; background: radial-gradient(ellipse at 50% 40%, #9a5b3e, #7a422a 75%);
  box-shadow: inset 0 0 0 6px #55291a, inset 0 0 0 8px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.18); }
.kc-table .pk-card { --w: var(--kcw); }
.kc-cell { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.kc-drop { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; }
button.kc-drop { cursor: pointer; transition: background-color .14s ease; }
@media (hover: hover) { button.kc-drop:hover { background: rgba(255,255,255,.1); } }
/* Kings Corner: the outline when a pile is picked with the keyboard. */
button.kc-drop:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
/* a pile: its top card, with a small copy of its bottom card just above it when there are two or
   more (the bottom card is the one that matters when the whole pile is moved) */
.kc-stack { position: relative; display: inline-flex; }
.kc-stack.two { padding-top: calc(var(--kcw) * .62); }
.kc-stack .kc-under { --w: calc(var(--kcw) * .56); position: absolute; left: 50%; top: 0; transform: translateX(-50%); }
.kc-n { position: absolute; right: -9px; bottom: -7px; min-width: 22px; padding: 1px 6px; border-radius: 9px; background: #1a0f0a; color: #fff;
  font-size: 12px; text-align: center; box-shadow: 0 0 0 2px #7a422a; }
.kc-slot { box-shadow: inset 0 0 0 1.5px rgba(255,235,220,.3); color: rgba(255,235,220,.35); }
.kc-slot b { font-size: calc(var(--w) * .34); }
.kc-deck { flex-direction: column; }
/* Kings Corner: the draw pile. */
.kc-deck .pk-card.back { box-shadow: inset 0 0 0 2px #fff, 0 2px 0 #4a2416, 0 4px 0 #3a1c10; }
.kc-deck-n { margin-top: 8px; color: rgba(255,235,220,.85); font-size: 13px; }
/* the handle that picks up a whole side pile; it fills in white once picked */
.kc-grab { position: absolute; right: 0; top: 0; display: flex; width: 26px; height: 26px; padding: 5px; border-radius: 50%;
  background: rgba(0,0,0,.28); color: rgba(255,255,255,.75); cursor: pointer; transition: background-color .14s ease, color .14s ease; }
.kc-grab input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kc-grab svg { width: 100%; height: 100%; }
.kc-grab:hover { color: #fff; }
.kc-grab:has(input:checked) { background: #fff; color: #55291a; }
.kc-grab:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; }
.kc-cell:has(.kc-grab input:checked) .kc-stack { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 3px rgba(255,255,255,.9)); }
/* Kings Corner: your hand. */
.kc-hand { padding-top: 18px; }
.kc-end { margin-top: 12px; }
@media (max-width: 640px) {
  .kc-table { --kcw: 40px; padding: 12px 10px; gap: 4px; border-radius: 22px; grid-template-columns: repeat(3, calc(var(--kcw) + 26px)); grid-auto-rows: calc(var(--kcw) * 1.4 + 30px); }
  .kc-grab { width: 22px; height: 22px; padding: 4px; }
  .kc-hand { gap: 6px 3px; }
  .kc-hand .pk-card { --w: 39px; }
}

/* Shmoenopoly: the board is an 11 by 11 grid of equal squares on a very faint green (the page's
   own background with a little green mixed in, so it suits light, dark and every page color). The
   40 spaces run round the edge; the middle holds the name, whose turn it is, the dice, the turn
   buttons and any trade offers. */
/* The players, in the middle of the board under the turn buttons: a small pill each with their
   picture, name and Shmoenopoly Bucks. The player whose turn it is has an outline. */
.sm-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
.sm-seat { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px 0 4px; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: 999px; background: var(--card); font-size: 13px; }
.sm-seat.on { border-color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.sm-seat.out { opacity: .45; }
.sm-seat-name { font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A balance below zero is debt: the amount turns grey and a dark Debt tag appears under it. */
.sm-cash { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.sm-cash.neg { color: var(--text-3); }
.sm-tags { display: flex; align-items: center; gap: 3px; }
.sm-debt { background: var(--text); color: var(--bg); }
.sm-tagic { display: inline-flex; color: var(--text-2); }
.sm-tagic .sm-ic { width: 15px; height: 15px; }
.sm-ic { width: 18px; height: 18px; flex: none; }
/* The board takes the game page's full width (the page is widened for Shmoenopoly). Its size
   unit --u is the width of one ordinary space: the board is 12 of them across (9 spaces plus two
   corners of 1.5 each), less the padding and gaps. Writing, pictures and tokens are sized from --u,
   so everything grows and shrinks with the board. (".sm-wrap", a "container" named smboard, lets
   the board measure its own width: "cqw" is one hundredth of it.) */
.content > .game-page:has(.sm-board) { max-width: 1000px; }
/* --u and --tok are worked out once, on the board itself, and passed down as finished lengths
   ("@property" says they're lengths). Without this, a space would work them out again against its
   own size instead of the board's. */
@property --u { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --tok { syntax: '<length>'; inherits: true; initial-value: 0px; }
.sm-wrap { width: 100%; container: smboard / inline-size; }
.sm-board { --felt: color-mix(in srgb, #2e9b57 9%, var(--bg)); --u: calc((100cqw - 32px) / 12); --tok: clamp(12px, calc(var(--u) * .26), 22px);
  display: grid; grid-template-columns: 1.5fr repeat(9, minmax(0, 1fr)) 1.5fr; grid-template-rows: 1.5fr repeat(9, minmax(0, 1fr)) 1.5fr; gap: 2px;
  width: 100%; aspect-ratio: 1; padding: 6px; border-radius: 16px; background: var(--felt);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #2e9b57 22%, var(--bg)); box-sizing: border-box; }
/* Where each space sits: r1 to r11 are the rows, c1 to c11 the columns. */
.sm-cell.r1 { grid-row: 1; } .sm-cell.r2 { grid-row: 2; } .sm-cell.r3 { grid-row: 3; } .sm-cell.r4 { grid-row: 4; } .sm-cell.r5 { grid-row: 5; } .sm-cell.r6 { grid-row: 6; }
.sm-cell.r7 { grid-row: 7; } .sm-cell.r8 { grid-row: 8; } .sm-cell.r9 { grid-row: 9; } .sm-cell.r10 { grid-row: 10; } .sm-cell.r11 { grid-row: 11; }
.sm-cell.c1 { grid-column: 1; } .sm-cell.c2 { grid-column: 2; } .sm-cell.c3 { grid-column: 3; } .sm-cell.c4 { grid-column: 4; } .sm-cell.c5 { grid-column: 5; } .sm-cell.c6 { grid-column: 6; }
.sm-cell.c7 { grid-column: 7; } .sm-cell.c8 { grid-column: 8; } .sm-cell.c9 { grid-column: 9; } .sm-cell.c10 { grid-column: 10; } .sm-cell.c11 { grid-column: 11; }
/* One space: a card (.sm-in) with its color band or picture along the top, its name and, while
   nobody owns it, its price. Once someone owns it, their colored line runs along the bottom
   instead, so the band and the owner's line never meet. Every card stands upright so all the
   writing reads the same way: the spaces along the top and bottom are one unit wide and one and
   a half tall, the ones up the sides one and a half wide and one tall, and the corners are bigger
   squares. The tokens sit just inside the ring, beside their space. */
.sm-cell { position: relative; min-width: 0; min-height: 0; }
.sm-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; overflow: hidden;
  border-radius: 5px; background: var(--card); color: var(--text); text-align: center; line-height: 1.12; }
.sm-cell.corner .sm-in { justify-content: center; }
.sm-cell.mort .sm-in { opacity: .45; }
.sm-cell.tap { cursor: pointer; }
.sm-cell.tap:hover .sm-in { box-shadow: inset 0 0 0 1.5px var(--border-strong); }
/* A property's card, opened by tapping it: it floats over the middle of the board. The choice
   buttons themselves are invisible; the card right after the picked one is shown. */
.sm-infos { grid-row: 1 / 12; grid-column: 1 / 12; position: relative; display: grid; place-items: center; min-height: 0; pointer-events: none; z-index: 3; }
.sm-spot { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sm-info { display: none; flex-direction: column; width: min(250px, 80%); overflow: hidden; border-radius: 14px; background: var(--card); color: var(--text);
  box-shadow: 0 0 0 1px var(--border), 0 14px 40px rgba(0,0,0,.22); pointer-events: auto; grid-area: 1 / 1; }
.sm-spot:checked + .sm-info { display: flex; }
.sm-info-head { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 8px 34px; color: #fff; font-size: 14px; text-align: center; }
.sm-info-head.g-yellow, .sm-info-head.g-light { color: #161616; }
.sm-info-head.plain { color: var(--text); border-bottom: 1px solid var(--border); }
.sm-info-head .sm-ic { width: 20px; height: 20px; }
.sm-info-x { position: absolute; top: 50%; right: 7px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-top: -13px;
  border-radius: 50%; color: inherit; cursor: pointer; opacity: .8; }
.sm-info-x:hover { opacity: 1; background: rgba(0,0,0,.12); }
.sm-info-x .sm-ic { width: 16px; height: 16px; }
.sm-info-body { display: flex; flex-direction: column; padding: 8px 14px; }
.sm-info-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; font-size: 13px; }
.sm-info-row b { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.sm-info-k { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.sm-info-row .sm-ic { width: 15px; height: 15px; }
.sm-info-ics { display: inline-flex; align-items: center; gap: 2px; }
.sm-info-ics .sm-dot { width: 9px; height: 9px; }
.sm-info-line { height: 1px; margin: 5px 0; background: var(--border); }
.sm-info-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.sm-band { display: flex; align-items: center; justify-content: center; width: 100%; height: calc(var(--u) * .22); flex: none; }
.sm-sp { display: flex; justify-content: center; padding-top: calc(var(--u) * .1); color: var(--text-2); }
.sm-sp .sm-ic { width: calc(var(--u) * .3); height: calc(var(--u) * .3); }
/* The side spaces are short, so their pictures are a little smaller and closer to the top. */
:is(.side-l, .side-r):not(.corner) .sm-sp { padding-top: calc(var(--u) * .07); }
:is(.side-l, .side-r):not(.corner) .sm-sp .sm-ic { width: calc(var(--u) * .24); height: calc(var(--u) * .24); }
.sm-cell.corner .sm-sp { padding-top: 0; }
.sm-cell.corner .sm-sp .sm-ic { width: calc(var(--u) * .45); height: calc(var(--u) * .45); }
/* Names are written in full, broken only between words, never inside one. */
.sm-nm { padding: calc(var(--u) * .07) 4px 0; font-size: calc(var(--u) * .15); font-weight: 700; letter-spacing: -.01em; hyphens: none; overflow-wrap: normal; word-break: normal; }
.sm-cell.corner .sm-nm { font-size: calc(var(--u) * .17); }
/* A name with one very long word (Mediterranean) is written a little smaller so the word fits. */
.sm-nm.long { font-size: calc(var(--u) * .128); letter-spacing: -.02em; }
.sm-pr { margin-top: auto; padding-bottom: calc(var(--u) * .07); font-size: calc(var(--u) * .135); font-weight: 600; color: var(--text-3); }
/* The owner's line along the bottom of the space, in the owner's color. */
.sm-own { position: absolute; z-index: 1; left: 4px; right: 4px; bottom: 3px; height: 4px; border-radius: 2px; }
/* Houses (small squares) and a hotel (one wide block), sitting on the color band. */
.sm-built { display: flex; gap: 2px; }
.sm-house, .sm-hotel { height: calc(var(--u) * .15); stroke: #fff; stroke-width: 1.1; stroke-linejoin: round; paint-order: stroke; overflow: visible; }
.sm-house { width: calc(var(--u) * .15); fill: #1f9d55; }
.sm-hotel { width: calc(var(--u) * .33); fill: #d93a32; }
/* Players' tokens: dots in their own colors, lined up just inside the ring of spaces beside the
   space they're on (above a bottom-row space, to the right of a left-side space, and so on), so
   they never cover a space's writing. In a corner they sit inside the corner square, at the
   bottom. The one whose turn it is has a ring. */
.sm-toks { position: absolute; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 2px; pointer-events: none; }
.side-b .sm-toks { left: 0; right: 0; bottom: calc(100% + 4px); flex-wrap: wrap-reverse; }
.side-t .sm-toks { left: 0; right: 0; top: calc(100% + 4px); }
.side-l .sm-toks { top: 0; bottom: 0; left: calc(100% + 4px); flex-direction: column; }
.side-r .sm-toks { top: 0; bottom: 0; right: calc(100% + 4px); flex-direction: column; flex-wrap: wrap-reverse; }
/* On a corner, tokens sit just inside the ring at the corner's inner point (diagonally in from
   it), three to a row, so they never cover the corner's picture or name. */
.sm-cell.corner .sm-toks { inset: auto; width: calc(var(--tok) * 3 + 4px); flex-direction: row; align-content: flex-start; }
.sm-cell.corner.r11 .sm-toks { bottom: calc(100% + 4px); flex-wrap: wrap-reverse; }
.sm-cell.corner.r1 .sm-toks { top: calc(100% + 4px); }
.sm-cell.corner.c11 .sm-toks { right: calc(100% + 4px); justify-content: flex-end; }
.sm-cell.corner.c1 .sm-toks { left: calc(100% + 4px); justify-content: flex-start; }
/* Each token is its player's piece (hat, car, dog...) as a solid shape in their color, with a thin
   light edge so it stands out on the board. The player whose turn it is gets a dark halo. */
.sm-tok { display: inline-flex; width: var(--tok); height: var(--tok); }
.sm-tok-svg { width: 100%; height: 100%; stroke: var(--card); stroke-width: 1.4; stroke-linejoin: round; paint-order: stroke; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.sm-tok.now .sm-tok-svg { filter: drop-shadow(0 0 1.5px var(--text)) drop-shadow(0 0 1.5px var(--text)); }
/* A player's piece beside their name. */
.sm-piece { width: 16px; height: 16px; display: block; }
/* Picking pieces at the start: a tile per piece. */
.sm-pick-form { margin: 0; }
.sm-pick-grid { display: grid; grid-template-columns: repeat(4, 76px); gap: 10px; justify-content: center; }
.sm-pick-tile { position: relative; display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; padding: 0; border: 1.5px solid var(--border); border-radius: 18px;
  background: var(--card); color: var(--text); cursor: pointer; font: inherit; }
.sm-pick-tile:not(:disabled):hover { border-color: var(--text); }
.sm-pick-tile:disabled { cursor: default; color: var(--text-3); }
.sm-pick-tile .sm-piece { width: 44px; height: 44px; }
.sm-pick-tile.taken { background: var(--surface); }
.sm-pick-tile.taken .av { position: absolute; right: -6px; bottom: -6px; box-shadow: 0 0 0 2px var(--bg); }
@media (max-width: 400px) { .sm-pick-grid { grid-template-columns: repeat(4, 64px); gap: 8px; } .sm-pick-tile { width: 64px; height: 64px; } .sm-pick-tile .sm-piece { width: 36px; height: 36px; } }
/* A board too small for readable writing (a narrow window or a phone) leaves the names off the
   spaces; the All Properties list below the board has them all. */
@container smboard (max-width: 820px) {
  .sm-cell:not(.corner) .sm-nm { display: none; }
  .sm-cell:not(.corner) .sm-pr { margin-top: auto; }
}
.sm-offers-in { display: contents; }
/* Offers under the board: the ones that didn't fit in the middle (see the view in shmoenopoly.js). */
.sm-offers-below { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }
.sm-offers-below .dup { display: none; }
.sm-offers-below:not(:has(> :not(.dup))) { display: none; }
@container smboard (max-width: 820px) {
  .sm-offers-in { display: none; }
  .sm-offers-below, .sm-offers-below:not(:has(> :not(.dup))) { display: flex; }
  .sm-offers-below .dup { display: flex; }
}
@container smboard (max-width: 480px) {
  .sm-offers-below .sm-offer { width: 100%; }
  .sm-nm, .sm-pr { display: none; }
  .sm-board { padding: 4px; gap: 1.5px; border-radius: 12px; --u: calc((100cqw - 23px) / 12); }
  .sm-in { border-radius: 3px; }
  .sm-own { left: 2px; right: 2px; bottom: 1.5px; height: 2.5px; }
  /* The middle is small here: no title, and trade offers in a compact form so they fit. */
  .sm-title { display: none; }
  .sm-seat-name { display: none; }
  .sm-info-body { padding: 4px 12px; } .sm-info-row { min-height: 20px; font-size: 12px; } .sm-info-head { min-height: 38px; font-size: 13px; }
  .sm-offer { gap: 6px; padding: 6px 8px; border-radius: 10px; }
  .sm-deal { gap: 4px; }
  .sm-deal .av { width: 20px; height: 20px; font-size: 10px; }
  .sm-chip { height: 22px; padding: 0 7px; font-size: 11px; gap: 3px; }
  .sm-offer .pk-btn { height: 30px; padding: 0 12px; font-size: 12.5px; }
}
/* The color groups (the classic board's colors). */
.g-brown { background: #8a5232; } .g-light { background: #a9dcf2; } .g-pink { background: #d6418f; } .g-orange { background: #f39228; }
.g-red { background: #df3a32; } .g-yellow { background: #f4d11e; } .g-green { background: #22a160; } .g-blue { background: #2554b8; }
/* The middle of the board. It keeps a margin clear all round for the tokens beside the spaces.
   Everything in it is sized from the size of a space (--u), between a smallest and largest size,
   so it all fits whatever the board's size, with nothing to scroll. */
.sm-center { grid-row: 2 / 11; grid-column: 2 / 11; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(4px, calc(var(--u) * .13), 10px); min-height: 0; padding: calc(var(--tok) + clamp(4px, calc(var(--u) * .18), 14px)); }
.sm-title { font-size: clamp(15px, calc(var(--u) * .38), 30px); font-weight: 800; letter-spacing: -.04em; color: var(--text); line-height: 1.15; }
.sm-center .game-status { margin: 0; font-size: clamp(12px, calc(var(--u) * .21), 17px); }
.sm-dice { display: flex; gap: clamp(5px, calc(var(--u) * .1), 8px); }
.sm-die { width: clamp(20px, calc(var(--u) * .46), 36px); height: clamp(20px, calc(var(--u) * .46), 36px); filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.3)); }
.sm-center .pk-bottom { gap: clamp(5px, calc(var(--u) * .1), 8px); }
.sm-center .pk-btn { height: clamp(28px, calc(var(--u) * .5), 40px); min-width: 0; padding: 0 clamp(10px, calc(var(--u) * .22), 18px); font-size: clamp(12px, calc(var(--u) * .2), 15px); border-radius: clamp(9px, calc(var(--u) * .16), 12px); }
.sm-center .pk-btn svg { width: clamp(14px, calc(var(--u) * .24), 19px); height: clamp(14px, calc(var(--u) * .24), 19px); }
.sm-center .sm-seats { gap: clamp(3px, calc(var(--u) * .08), 6px); }
.sm-center .sm-seat { height: clamp(22px, calc(var(--u) * .44), 34px); padding: 0 clamp(6px, calc(var(--u) * .14), 11px) 0 clamp(2px, calc(var(--u) * .05), 4px); gap: clamp(3px, calc(var(--u) * .08), 6px); font-size: clamp(10.5px, calc(var(--u) * .17), 13px); }
.sm-center .sm-seat .av { width: clamp(16px, calc(var(--u) * .32), 24px); height: clamp(16px, calc(var(--u) * .32), 24px); font-size: clamp(8px, calc(var(--u) * .13), 11px); }
.sm-center .sm-piece { width: clamp(12px, calc(var(--u) * .2), 16px); height: clamp(12px, calc(var(--u) * .2), 16px); }
.sm-center .sm-buy { font-size: clamp(12px, calc(var(--u) * .19), 15px); }
.sm-die rect { fill: #fff; } .sm-die circle { fill: #1a1a1a; }
.sm-turn { margin: 0; }
.sm-buy { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 600; }
.sm-buy b { margin-left: 2px; }
/* Trade offers, in the middle of the board. */
.sm-offer { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; width: fit-content; max-width: 100%;
  border-radius: 16px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0,0,0,.07); box-sizing: border-box; }
.sm-incoming { border-color: var(--border-strong); }
.sm-outgoing { flex-direction: row; justify-content: space-between; box-shadow: none; }
.sm-offer .pk-btn { height: 36px; min-width: 96px; font-size: 14px; }
.sm-deal { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.sm-deal-side { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.sm-swap { display: inline-flex; color: var(--text-3); }
.sm-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--hover); font-size: 12.5px; font-weight: 600; box-sizing: border-box; white-space: nowrap; }
.sm-chip .sm-ic { width: 14px; height: 14px; }
.sm-chip .sm-mark, .sm-pick .sm-mark { width: 14px; height: 14px; } .sm-chip .sm-mark .sm-ic, .sm-pick .sm-mark .sm-ic { width: 14px; height: 14px; }
.sm-chip.none { color: var(--text-3); }
.sm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
/* A property's mark (its color square, or a railroad's or utility's picture) always takes the same
   16 by 16 space, centered, so names line up whichever mark they have. */
.sm-mark { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: none; color: var(--text-2); }
.sm-mark .sm-ic { width: 16px; height: 16px; }
/* The trade panel, always open: a header bar with the trade picture on the left and the players
   to trade with on the right; then Give and Get, each a row of bubbles to tick (properties and
   Get Out of Jail Free cards) ending with a money box; then the Offer button. Only the chosen
   player's things show under Get (sm-to-0 is the first player in the list, sm-get-0 their things). */
.sm-panel { display: flex; flex-direction: column; gap: 12px; width: 100%; margin: 0; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-sizing: border-box; }
.sm-trade [data-keep="trade"] { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.sm-trade-head, .sm-trade-foot { grid-column: 1 / -1; }
/* What you give on the left and what you get on the right, with a thin line between them (one
   above the other on a narrow screen). */
.sm-trade .sm-side + .sm-side { padding-left: 18px; border-left: 1px solid var(--border); }
@media (max-width: 640px) {
  .sm-trade [data-keep="trade"] { grid-template-columns: 1fr; }
  .sm-trade .sm-side + .sm-side { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--border); }
}
.sm-trade-head { display: flex; align-items: center; gap: 10px; }
.sm-trade-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--hover); flex: none; }
.sm-to { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.sm-to-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 4px; border-radius: 999px; border: 1.5px solid var(--border); font-weight: 600; cursor: pointer; box-sizing: border-box; }
.sm-to-pick:has(input:checked) { border-color: var(--text); }
.sm-to-pick input, .sm-pick input { position: absolute; opacity: 0; pointer-events: none; }
.sm-to-pick:has(input:focus-visible), .sm-pick:has(input:focus-visible) span, .sm-money:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.sm-side { display: flex; flex-direction: column; gap: 6px; }
.sm-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sm-pick { position: relative; cursor: pointer; }
.sm-pick span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--hover); font-size: 13px; font-weight: 600; box-sizing: border-box; white-space: nowrap; }
.sm-pick span .sm-ic { width: 14px; height: 14px; }
.sm-pick small { color: var(--text-3); font-weight: 500; }
.sm-pick input:checked + span { background: var(--primary); color: var(--primary-text); }
.sm-pick input:checked + span small { color: inherit; opacity: .7; }
/* The money box looks like one more bubble: a dollar sign and the amount. */
.sm-money { display: inline-flex; align-items: center; gap: 1px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--hover); font-size: 15px; line-height: 1; font-weight: 700; box-sizing: border-box; cursor: text; }
/* (15 pixels so phones don't zoom in when the box is tapped; the box and the "$" share one line.) */
.sm-money input { width: 64px; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; line-height: 30px; font-weight: 700; box-shadow: none; }
.sm-money input:focus { outline: none; box-shadow: none; }
.sm-get { display: none; }
.sm-trade:has(.sm-to-0:checked) .sm-get-0, .sm-trade:has(.sm-to-1:checked) .sm-get-1, .sm-trade:has(.sm-to-2:checked) .sm-get-2,
.sm-trade:has(.sm-to-3:checked) .sm-get-3, .sm-trade:has(.sm-to-4:checked) .sm-get-4, .sm-trade:has(.sm-to-5:checked) .sm-get-5,
.sm-trade:has(.sm-to-6:checked) .sm-get-6 { display: flex; }
.sm-trade-foot { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--border); }
.sm-trade-foot .pk-btn { height: 40px; min-width: 110px; font-size: 14px; }
/* Your properties, each with its rent and the buttons that would work right now. */
.sm-deeds { display: flex; flex-direction: column; width: 100%; padding: 2px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-sizing: border-box; }
.sm-deed { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; margin: 0; padding: 11px 0; border-bottom: 1px solid var(--border); }
.sm-deed:last-child { border-bottom: 0; }
.sm-deed.mort { opacity: .7; }
.sm-deed-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; min-width: 0; }
.sm-deed-info { grid-column: 1; font-size: 12.5px; color: var(--text-3); }
.sm-deed-btns { grid-column: 2; grid-row: 1 / 3; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.sm-act { height: 32px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--hover); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sm-act:hover { background: var(--border); }
/* The fold-out lists (All Properties and History): a heading with a small arrow that turns over
   when the list is open. */
.sm-fold { width: 100%; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-sizing: border-box; overflow: hidden; }
.sm-fold > :not(summary) { margin: 0 14px 10px; width: calc(100% - 28px); }
.sm-fold-sum { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 13px 14px; font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; list-style: none; }
.sm-fold-sum::-webkit-details-marker { display: none; }
.sm-fold-sum:hover { background: var(--hover); }
.sm-chev { width: 15px; height: 15px; transition: transform .15s; }
.sm-fold[open] .sm-chev { transform: rotate(180deg); }
/* All Properties: a table, so the columns line up on every row. */
.sm-table { width: 100%; margin-top: 4px; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
.sm-table .c-dot { width: 26px; } .sm-table .c-price { width: 64px; } .sm-table .c-who { width: 38%; }
.sm-table td { height: 34px; padding: 0 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sm-table td:first-child { text-align: center; }
.sm-table .sm-mark { vertical-align: middle; }
.sm-t-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-t-price { color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
.sm-t-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-t-who > span { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.sm-t-who small { margin-left: 6px; color: var(--text-3); font-weight: 500; }
/* History: newest first. */
.sm-history { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.sm-history li { display: grid; grid-template-columns: minmax(0, 120px) 1fr; gap: 10px; align-items: baseline; padding: 7px 4px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.sm-history li > .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Phones: the middle of the board uses smaller text and buttons, and your properties' buttons drop
   under their names. */
@media (max-width: 560px) {
  .sm-offer { padding: 8px; }
  .sm-trade-head { align-items: flex-start; }
  .sm-deed { grid-template-columns: 1fr; }
  .sm-deed-btns { grid-column: 1; grid-row: auto; justify-content: flex-start; }
}

/* Go Fish: the players (with their cards and books), a blue "pond" table with the face-down pond
   and what just happened, then the ask buttons and your hand. */
.gf-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gf-seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 10px 7px; min-width: 70px;
  border-radius: 14px; border: 2px solid transparent; font-size: 13px; }
.gf-seat.on { border-color: var(--border-strong); background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
/* Each player's number of books, with a small book picture. */
.gf-bookn { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.gf-bookn svg { width: 14px; height: 14px; }
/* The table: a polished mahogany wood. The pond sits on the left and the finished books are laid
   down to its right, wrapping onto more rows as they pile up. */
.gf-table { display: flex; align-items: center; gap: 22px; width: fit-content; max-width: min(100%, 640px); min-height: 150px; padding: 20px 26px; box-sizing: border-box;
  border-radius: 26px; background: radial-gradient(ellipse at 50% 35%, #9a5436, #7a3b22 78%);
  box-shadow: inset 0 0 0 6px #57291a, inset 0 0 0 8px rgba(255,255,255,.07), 0 8px 24px rgba(0,0,0,.2); color: #fff; }
.gf-pond { display: flex; flex-direction: column; align-items: center; flex: none; }
.gf-pond .pk-card { --w: 52px; }
.gf-pond .pk-card.back { box-shadow: inset 0 0 0 2px #fff, 0 2px 0 #4a2216, 0 4px 0 #3a1a10; }
.gf-slot { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.gf-pond-n { margin-top: 8px; font-size: 13px; color: rgba(255,255,255,.85); }
.gf-laid { display: flex; flex-wrap: wrap; align-content: center; gap: 14px 14px; min-width: 0; }
/* One book: a small pile of its four cards laid down a little askew, with one suit on top (the
   cards underneath peek out), the other three suits as faint marks beneath, and a line in the
   color of the player who made it. */
.gf-book { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gf-stack { position: relative; display: flex; }
.gf-stack .pk-card { --w: 34px; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.gf-stack > i { position: absolute; inset: 0; border-radius: calc(34px * .12); background: #f3eee8; box-shadow: 0 1px 2px rgba(0,0,0,.4); transform-origin: 50% 90%; }
.gf-stack > i:nth-child(1) { transform: rotate(-9deg); }
.gf-stack > i:nth-child(2) { transform: rotate(6deg); }
.gf-stack > i:nth-child(3) { transform: rotate(-3deg); }
.gf-rest { display: flex; gap: 3px; height: 9px; color: rgba(255,255,255,.5); }
.gf-rest i { display: flex; width: 9px; height: 9px; }
.gf-rest svg { width: 100%; height: 100%; }
.gf-owner { width: 100%; height: 3px; border-radius: 2px; }
/* What just happened lights up for a moment: the newest book on the table, and the cards that
   just came into your hand (taken from someone or fished from the pond). */
@keyframes gf-new-book { 0% { transform: translateY(-12px) scale(1.12); filter: drop-shadow(0 0 10px rgba(255,255,255,.9)); } 100% { transform: none; filter: none; } }
@keyframes gf-new-card { 0% { transform: translateY(-10px); box-shadow: 0 0 0 3px var(--text), 0 8px 18px rgba(0,0,0,.25); } 70% { box-shadow: 0 0 0 3px var(--text), 0 1px 3px rgba(0,0,0,.35); } 100% { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,.35); } }
.gf-book.new .gf-stack { animation: gf-new-book .9s cubic-bezier(.2,.8,.3,1); }
.gf-hand .pk-card.new { animation: gf-new-card 1.8s ease-out; }
@media (prefers-reduced-motion: reduce) { .gf-book.new .gf-stack, .gf-hand .pk-card.new { animation: none; } }
.gf-form { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; width: 100%; }
.gf-who { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.gf-who-pick { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 4px; border-radius: 999px; border: 1.5px solid var(--border); font-weight: 600; cursor: pointer; box-sizing: border-box; }
.gf-who-pick:has(input:checked) { border-color: var(--text); }
.gf-who-pick input { position: absolute; opacity: 0; pointer-events: none; }
.gf-who-pick:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.gf-ranks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.gf-rank { width: 46px; height: 46px; border: 0; border-radius: 12px; background: var(--primary); color: var(--primary-text); font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; }
.gf-rank:hover { opacity: .88; }
.gf-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
@media (max-width: 560px) { .gf-table { gap: 14px; padding: 16px 18px; } .gf-hand .pk-card { --w: 40px; } .gf-rank { width: 42px; height: 42px; } }
:root[data-glow] .gf-table { box-shadow: 0 0 34px -8px rgba(201, 110, 62, .85), inset 0 0 0 6px #57291a; }
:root[data-glow] .gf-seat.on { box-shadow: 0 0 18px -4px rgba(255, 255, 255, .45); }

/* Coup: the players around the table with their coins and two cards each, the claim being
   answered, your two cards, and your buttons. Each character has its own color (--cc), used on
   its cards, chips and buttons: Duke purple, Assassin charcoal, Captain blue, Ambassador green,
   Contessa red. */
.c-duke { --cc: #7b3fa0; } .c-assassin { --cc: #3a3a3a; } .c-captain { --cc: #2f6fbd; } .c-ambassador { --cc: #2c9566; } .c-contessa { --cc: #c8323a; }
.co-ic { width: 18px; height: 18px; flex: none; }
.co-table { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.co-seat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 10px; min-width: 84px; border: 1.5px solid transparent; border-radius: 14px; }
.co-seat.on { border-color: var(--border-strong); background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.co-seat.out { opacity: .5; }
.co-seat-name { font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-coins { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-variant-numeric: tabular-nums; }
.co-coins .co-ic { width: 16px; height: 16px; color: #c9961a; }
.co-hand { display: flex; gap: 4px; margin-top: 2px; }
/* A character card: its color, picture and name. Small ones (on the table) show just the picture. */
.co-card { --cw: 92px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: var(--cw); aspect-ratio: 5 / 7;
  border-radius: 10px; background: var(--cc); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.85), 0 1px 3px rgba(0,0,0,.3); box-sizing: border-box; }
.co-card .co-ic { width: 38%; height: auto; }
.co-card b { font-size: 13px; font-weight: 800; letter-spacing: .01em; }
.co-card.small { --cw: 30px; gap: 0; border-radius: 5px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.85), 0 1px 2px rgba(0,0,0,.3); }
.co-card.small .co-ic { width: 62%; }
.co-card.small b { display: none; }
.co-card.back { background: repeating-linear-gradient(45deg, #3b3b3b 0 3px, #2c2c2c 3px 6px); }
.co-card.lost { opacity: .35; filter: grayscale(.7); }
.co-card.mine { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.85), 0 0 0 1.5px var(--text); }
/* The claim being answered, and who's still to answer. */
.co-prompt { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-sizing: border-box; }
.co-claim { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; font-weight: 600; }
.co-claim b { margin-left: 2px; }
.co-arrow { color: var(--text-3); }
.co-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 6px; border-radius: 999px; background: var(--cc); color: #fff; font-size: 12.5px; font-weight: 700; }
.co-chip .co-ic { width: 14px; height: 14px; }
.co-wait { display: flex; gap: 4px; min-height: 20px; }
/* Your buttons. */
.co-moves { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; width: 100%; }
.co-block { background: var(--cc); color: #fff; }
.co-block:hover { background: var(--cc); opacity: .88; }
.co-targets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.co-target { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1.5px solid var(--border); font-weight: 600; cursor: pointer; }
.co-target:has(input:checked) { border-color: var(--text); }
.co-target input, .co-expick input { position: absolute; opacity: 0; pointer-events: none; }
.co-target:has(input:focus-visible), .co-expick:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
/* Your turn's buttons, in two rows of equal-sized buttons: the three anyone can take, then the
   four that claim a character. */
.co-acts { display: flex; gap: 6px; width: 100%; }
.co-acts > .co-act { flex: 1 1 0; min-width: 0; height: 84px; }
.co-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px; padding: 8px 4px; border: 0; border-radius: 14px;
  background: var(--hover); color: var(--text); font: inherit; cursor: pointer; }
.co-act:hover { background: var(--border); }
.co-act[class*="c-"] { background: var(--cc); color: #fff; }
.co-act[class*="c-"]:hover { opacity: .88; }
.co-act b { font-size: 14px; font-weight: 700; }
.co-act small { display: inline-flex; align-items: center; gap: 2px; height: 16px; font-size: 12px; font-weight: 700; opacity: .85; }
.co-act small .co-ic { width: 13px; height: 13px; }
.co-act:disabled { opacity: .35; cursor: default; }
.co-act[class*="c-"]:disabled:hover { opacity: .35; }
/* Your cards, and picking one to lose. */
.co-mine { display: flex; justify-content: center; gap: 12px; }
.co-mine form { margin: 0; }
.co-pick { padding: 0; border: 0; background: none; border-radius: 10px; cursor: pointer; transition: transform .12s; }
.co-pick:hover { transform: translateY(-3px); }
.co-hint { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); text-align: center; }
/* The Ambassador's choice: tick the cards to keep. */
.co-ex { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.co-expick { position: relative; cursor: pointer; border-radius: 12px; }
.co-expick .co-card { --cw: 72px; }
.co-expick:has(input:checked) .co-card { box-shadow: inset 0 0 0 2px rgba(255,255,255,.85), 0 0 0 2.5px var(--text); }
.co-expick:not(:has(input:checked)) .co-card { opacity: .55; }
.co-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; text-align: center; color: var(--text-2); }
.co-log li:first-child { color: var(--text); font-weight: 600; }
@media (max-width: 560px) {
  .co-acts > .co-act { height: 76px; }
  .co-act b { font-size: 12.5px; }
  .co-card { --cw: 80px; }
  .co-card.small { --cw: 26px; }
  .co-seat { min-width: 70px; padding: 6px; }
}

/* Moderation */
.content > .mod-page { max-width: 720px; }
.mod-users { list-style: none; margin: 0 0 26px; padding: 0; }
.mod-user { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mod-user .name { font-weight: 700; }
.mod-user.banned .av, .mod-user.banned .name { opacity: .45; }
/* Online: a pill for everyone with McNet open right now. */
.mod-online-head { display: flex; align-items: center; gap: 8px; }
.mod-online { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 26px; padding: 0; }
.mod-online-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
/* Storage: one bar split into what uses McNet's space, darkest first. Below it, each part with
   its size, and the free space left on the drive. */
.mod-storage { margin: 0 0 26px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.mod-bar { display: block; width: 100%; height: 12px; border-radius: 6px; background: var(--hover); overflow: hidden; }
.mod-bar-0 { fill: var(--text); background: var(--text); }
.mod-bar-1 { fill: color-mix(in srgb, var(--text) 78%, var(--bg)); background: color-mix(in srgb, var(--text) 78%, var(--bg)); }
.mod-bar-2 { fill: color-mix(in srgb, var(--text) 62%, var(--bg)); background: color-mix(in srgb, var(--text) 62%, var(--bg)); }
.mod-bar-3 { fill: color-mix(in srgb, var(--text) 47%, var(--bg)); background: color-mix(in srgb, var(--text) 47%, var(--bg)); }
.mod-bar-4 { fill: color-mix(in srgb, var(--text) 33%, var(--bg)); background: color-mix(in srgb, var(--text) 33%, var(--bg)); }
.mod-bar-5 { fill: color-mix(in srgb, var(--text) 21%, var(--bg)); background: color-mix(in srgb, var(--text) 21%, var(--bg)); }
.mod-store-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.mod-store-list li { display: flex; align-items: center; gap: 8px; min-height: 32px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mod-store-list li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.mod-key { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mod-key.free { background: var(--hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
@media (max-width: 560px) { .mod-store-list { grid-template-columns: 1fr; } }
.mod-tag { padding: 1px 8px; border-radius: 6px; background: var(--hover); font-size: 12px; font-weight: 700; color: var(--text-2); }
.mod-actions { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.mod-group { margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; }
/* Moderation: group chat settings. */
.mod-group > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.mod-group > summary::-webkit-details-marker { display: none; }
.mod-group[open] > summary { margin-bottom: 12px; }
.mod-group form + form { margin-top: 10px; }
.mod-new { border: 0; padding: 0; }
.mod-new > summary.btn { display: inline-flex; width: auto; }
.mod-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-pick { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; }
.mod-pick input { margin: 0; }
/* Moderation: a picked member turns solid. */
.mod-pick:has(input:checked) { border-color: var(--text); background: var(--hover); }
.mod-btn.on { background: var(--hover); }
.mk-remove { margin-left: 4px; }
/* group chats */
.av-group { display: inline-flex; align-items: center; justify-content: center; background: var(--hover); color: var(--text); }
.av-group svg { width: 60%; height: 60%; }
.chat-avs { display: inline-flex; flex: none; }
.chat-avs .av + .av { margin-left: -8px; }
.chat-avs .av { box-shadow: 0 0 0 2px var(--bg); }
.chat-manage { margin-left: auto; }
.bubble.deleted { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text-3); font-style: italic; }

/* Rummikub: a thin, see-through grid in the middle, everyone seated around it, your tiles below */
/* (Rummikub: the grid of cells the tiles are dropped on, the seats around it, your rack below.
   Tiles are cream with the number in black, red, blue or orange. While dragging, a "ghost" copy
   follows your finger and the cell underneath is highlighted.) */
.content > .game-page:has(.rk-arena) { max-width: 1040px; }
.rk-form { width: 100%; margin: 0; }
.rk-arena { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px;
  grid-template-areas: "pool top ." "left board right" "me me me"; align-items: center; }
.rk-pool { grid-area: pool; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rk-pool .rk-tile { width: 22px; }
.rk-seat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 14px; border: 2px solid transparent; font-size: 13px; min-width: 70px; }
.rk-seat.on { border-color: var(--text); }
/* Rummikub: names on seats. */
.rk-seat-name { font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-seat.at-top { grid-area: top; justify-self: center; flex-direction: row; gap: 8px; }
.rk-seat.at-left { grid-area: left; }
.rk-seat.at-right { grid-area: right; }
.rk-count { min-width: 22px; padding: 1px 6px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; text-align: center; }
.rk-last { padding: 0 6px; border-radius: 6px; background: var(--hover); font-size: 11px; font-weight: 700; color: var(--text-2); }
.rk-board { grid-area: board; min-width: 0; justify-self: center; width: min(100%, max(640px, calc((100vh - 390px) * 1.2))); overflow: hidden; padding: 6px; border-radius: 16px; border: 1px solid rgba(127,127,127,.28);
  background: linear-gradient(160deg, rgba(127,127,127,.07), rgba(127,127,127,.02)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 20px rgba(0,0,0,.05); }
.rk-grid { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); }
/* Rummikub: each cell of the table grid. */
.rk-cell { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 5; padding: 1px;
  border-right: 1px solid rgba(127,127,127,.13); border-bottom: 1px solid rgba(127,127,127,.13); }
.rk-cell:nth-child(18n) { border-right: 0; }
.rk-cell:nth-last-child(-n+18) { border-bottom: 0; }
.rk-cell.rk-over { background: rgba(127,127,127,.18); }
.rk-me { grid-area: me; display: flex; align-items: center; gap: 12px; }
.rk-me .rk-seat { flex: none; }
.rk-rack { flex: 1; min-height: 78px; display: flex; flex-wrap: wrap; align-content: center; align-items: center; justify-content: center; gap: 5px; padding: 12px; border-radius: 18px; background: var(--hover); }
.rk-rack.rk-over { box-shadow: inset 0 0 0 2px var(--text); }
/* Rummikub: the tiles. */
.rk-tile { container-type: inline-size; width: 100%; aspect-ratio: 3 / 4; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 13%; background: linear-gradient(#fffbf1, #f2e8d0); box-shadow: inset 0 -2px 0 rgba(160,135,85,.25), 0 1px 0 #d8cba9, 0 2px 4px rgba(0,0,0,.22);
  font: inherit; line-height: 1; user-select: none; -webkit-user-select: none; }
/* the number sits big and heavy in the middle of the tile, like it's printed on */
.rk-tile b { margin-top: -6cqw; font-size: 66cqw; font-weight: 700; letter-spacing: -.05em; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.rk-tile.c-k { color: #1f1f1f; } .rk-tile.c-r { color: #cf3a3a; } .rk-tile.c-b { color: #2b5fbf; } .rk-tile.c-o { color: #d9821a; } .rk-tile.c-j { color: #cf3a3a; }
.rk-joker { width: 68%; height: auto; }
/* a tile face down: the plain back with its rim */
.rk-tile.back { background: linear-gradient(#f4ebd5, #e4d5b0); box-shadow: inset 0 0 0 2px #fbf5e6, inset 0 0 0 3px #cdb98b, 0 1px 0 #c9b88f, 0 2px 4px rgba(0,0,0,.25); }
.rk-rack .rk-tile { width: 42px; }
form.rk-form .rk-tile[data-rk-tile] { cursor: grab; touch-action: none; }
.rk-tile.sel { transform: translateY(-4px); box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111, 0 6px 10px rgba(0,0,0,.3); }
.rk-tile.fresh { box-shadow: 0 0 0 2px #e0b23a, 0 2px 4px rgba(0,0,0,.22); }
.rk-tile.bad { box-shadow: 0 0 0 2px #d64545, 0 2px 4px rgba(0,0,0,.22); }
.rk-lifted { opacity: .3; }
.rk-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; cursor: grabbing; box-shadow: 0 12px 24px rgba(0,0,0,.28) !important; }
/* Rummikub: the buttons (Sort, Reset, Draw, Done). */
.rk-controls { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.rk-ctl { display: flex; gap: 8px; }
.rk-controls .pk-btn.off { opacity: .4; }
.rk-meld { margin-left: 8px; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.2); font-size: 12px; font-weight: 700; }
@media (max-width: 700px) {
  .rk-arena { grid-template-columns: 1fr auto 1fr; grid-template-areas: "pool pool pool" "left top right" "board board board" "me me me"; gap: 8px; }
  .rk-seat { min-width: 0; padding: 4px; }
  .rk-seat.at-left { justify-self: end; } .rk-seat.at-right { justify-self: start; }
  .rk-seat.at-top { flex-direction: column; gap: 2px; }
  /* Rummikub: your rack. */
  .rk-me { flex-direction: column; }
  .rk-rack .rk-tile { width: 36px; }
  .rk-board { padding: 3px; border-radius: 12px; }
  .rk-controls { width: 100%; flex-direction: column; align-items: stretch; }
  .rk-ctl { width: 100%; } .rk-ctl > form { flex: 1; } .rk-ctl .pk-btn { width: 100%; min-width: 0; }
}

/* Up & Down The River: each suit is a line from Ace to King with the 7s lined up in the middle.
   .ud-h: suits run across (the 7s make a column); .ud-v: suits run up and down (the 7s make a row). */
.content > .game-page:has(.ud-board) { max-width: 860px; }
.ud-board { position: relative; width: max-content; max-width: 100%; overflow-x: auto; padding: 26px 26px; border-radius: 26px; display: flex;
  background: radial-gradient(ellipse at 50% 35%, #74492a, #573419 75%); box-shadow: inset 0 0 0 7px #3c2311, inset 0 0 0 9px rgba(255,255,255,.07), 0 8px 24px rgba(0,0,0,.18); }
.ud-turn { position: absolute; right: 12px; top: 12px; width: 26px; height: 26px; padding: 4px; border: 0; border-radius: 50%; background: transparent; color: #fff; opacity: .3; cursor: pointer; z-index: 20; }
.ud-turn:hover, .ud-turn:focus-visible { opacity: .8; }
.ud-turn svg { width: 100%; height: 100%; }
.ud-grid { display: grid; margin: 0 auto; }
.ud-cell { display: flex; }
/* Up & Down The River: the card size on its board. */
.pk-card.ud { --w: var(--udw); }
.pk-card.slot.ud { box-shadow: inset 0 0 0 1.5px rgba(255,230,200,.3); }
.ud-h { --udw: 42px; }
.ud-h .ud-grid { grid-template-columns: repeat(13, calc(var(--udw) + 4px)); grid-template-rows: repeat(4, auto); row-gap: 8px; }
.ud-v { --udw: 42px; padding: 26px 30px; }
.ud-v .ud-grid { grid-template-columns: repeat(4, calc(var(--udw) + 14px)); grid-auto-rows: auto; row-gap: 4px; justify-items: center; }
.ud-seats { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-bottom: 14px; }
.ud-seat { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 14px; border: 2px solid transparent; font-size: 14px; }
.ud-seat.on { border-color: var(--text); }
/* Up & Down The River: where each suit (s0 to s3) and rank (r1 to r13) sits, across or up and
   down (ud-h is across, ud-v up and down). */
.ud-h .s0 { grid-row: 1; } .ud-v .s0 { grid-column: 1; }
.ud-h .s1 { grid-row: 2; } .ud-v .s1 { grid-column: 2; }
.ud-h .s2 { grid-row: 3; } .ud-v .s2 { grid-column: 3; }
.ud-h .s3 { grid-row: 4; } .ud-v .s3 { grid-column: 4; }
.ud-h .r1 { grid-column: 1; } .ud-v .r1 { grid-row: 13; z-index: 13; }
.ud-h .r2 { grid-column: 2; } .ud-v .r2 { grid-row: 12; z-index: 12; }
.ud-h .r3 { grid-column: 3; } .ud-v .r3 { grid-row: 11; z-index: 11; }
.ud-h .r4 { grid-column: 4; } .ud-v .r4 { grid-row: 10; z-index: 10; }
.ud-h .r5 { grid-column: 5; } .ud-v .r5 { grid-row: 9; z-index: 9; }
/* (River positions continued) */
.ud-h .r6 { grid-column: 6; } .ud-v .r6 { grid-row: 8; z-index: 8; }
.ud-h .r7 { grid-column: 7; } .ud-v .r7 { grid-row: 7; z-index: 7; }
.ud-h .r8 { grid-column: 8; } .ud-v .r8 { grid-row: 6; z-index: 6; }
.ud-h .r9 { grid-column: 9; } .ud-v .r9 { grid-row: 5; z-index: 5; }
.ud-h .r10 { grid-column: 10; } .ud-v .r10 { grid-row: 4; z-index: 4; }
.ud-h .r11 { grid-column: 11; } .ud-v .r11 { grid-row: 3; z-index: 3; }
.ud-h .r12 { grid-column: 12; } .ud-v .r12 { grid-row: 2; z-index: 2; }
.ud-h .r13 { grid-column: 13; } .ud-v .r13 { grid-row: 1; z-index: 1; }
.ud-pass { padding: 0 6px; border-radius: 6px; background: var(--hover); font-size: 11px; font-weight: 700; color: var(--text-2); }
@media (max-width: 700px) {
  /* (River board, across) */
  .ud-h { --udw: 34px; padding: 18px 14px; }
  .ud-v { --udw: 40px; padding: 18px 16px; }
  .ud-seat { font-size: 13px; padding: 4px 8px 4px 4px; gap: 6px; }
}

/* Codenames */
.content > .game-page:has(.cdn-grid) { max-width: 860px; }
.cdn-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.cdn-team { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 16px; border: 2px solid; }
.cdn-team.t-red { border-color: #d64545; } .cdn-team.t-blue { border-color: #2f6fde; }
.cdn-team-name { margin: 0; font-size: 18px; }
.t-red .cdn-team-name { color: #d64545; } .t-blue .cdn-team-name { color: #2f6fde; }
.cdn-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cdn-members li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
/* Codenames: the spymaster tag. */
.cdn-spy-tag { padding: 1px 7px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 800; }
.cdn-bar { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.cdn-bar .t-red { justify-self: start; } .cdn-bar .t-blue { justify-self: end; }
.cdn-mid { justify-self: center; min-height: 44px; display: flex; align-items: center; }
.cdn-controls { width: 100%; display: flex; justify-content: center; }
.cdn-left { min-width: 46px; padding: 4px 12px; border-radius: 12px; color: #fff; font-size: 20px; font-weight: 800; text-align: center; opacity: .55; }
.cdn-left.on { opacity: 1; box-shadow: inset 0 0 0 3px rgba(255,255,255,.9); }
.cdn-left.t-red { background: #d64545; } .cdn-left.t-blue { background: #2f6fde; }
.cdn-clue { margin: 0; display: inline-flex; max-width: 100%; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-radius: 999px; border: 2px solid; font-size: 20px; font-weight: 800; }
/* Codenames: the clue, in its team's color. */
.cdn-clue.t-red { border-color: #d64545; } .cdn-clue.t-blue { border-color: #2f6fde; }
.cdn-clue b { min-width: 30px; padding: 2px 8px; border-radius: 999px; background: var(--text); color: var(--bg); text-align: center; }
.cdn-form { width: 100%; margin: 0; }
.cdn-grid { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; grid-auto-rows: 1fr; }
.cdn-card { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 6px 4px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 15px; text-align: center; overflow-wrap: anywhere; line-height: 1.15; }
button.cdn-card { cursor: pointer; }
button.cdn-card:hover { background: var(--hover); }
.cdn-card.hint.k-red { background: #f6dada; color: #8f1f1f; border-color: #d64545; }
/* Codenames: what the spymaster sees (each word's team as a tint). */
.cdn-card.hint.k-blue { background: #dce6fa; color: #173f8c; border-color: #2f6fde; }
.cdn-card.hint.k-neutral { background: #f3ecdc; color: #5b4d2e; border-color: #cdbb8f; }
.cdn-card.hint.k-assassin { background: #2a2a2a; color: #fff; border-color: #000; }
.cdn-card.open.k-red { background: #d64545; color: #fff; border-color: #d64545; }
.cdn-card.open.k-blue { background: #2f6fde; color: #fff; border-color: #2f6fde; }
.cdn-card.open.k-neutral { background: #e6d8b8; color: #5b4d2e; border-color: #e6d8b8; }
.cdn-card.open.k-assassin { background: #111; color: #fff; border-color: #111; }
.cdn-card.open { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(255,255,255,.55); }
.cdn-card.open.k-neutral { text-decoration-color: rgba(0,0,0,.3); }
/* Codenames: the word picked last. */
.cdn-card.last { box-shadow: inset 0 0 0 3px var(--text); }
.cdn-clue-form { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cdn-clue-form input[name="word"] { width: 200px; }
.cdn-n { width: 70px; height: 42px; }
.cdn-rosters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cdn-roster { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px 12px; padding: 8px 12px; border-radius: 12px; border: 2px solid; }
.cdn-roster.t-red { border-color: #d64545; } .cdn-roster.t-blue { border-color: #2f6fde; justify-content: flex-end; }
.cdn-who { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; }
.cdn-who.spy .name { text-decoration: underline; text-underline-offset: 3px; }
/* the shared custom word list on the setup page: a dictionary button beside the choices */
.setup-fields { position: relative; }
.setup-dict { align-self: flex-end; }
.setup-dict > summary { list-style: none; width: 46px; height: 46px; border: 1px solid var(--border-strong); cursor: pointer; }
.setup-dict > summary::-webkit-details-marker { display: none; }
.setup-dict[open] > summary { background: var(--hover); border-color: var(--text); }
.setup-dict > summary svg { width: 22px; height: 22px; }
.dict-panel { position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 30; display: flex; flex-direction: column; gap: 10px; padding: 16px;
  border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 32px rgba(0,0,0,.14); }
/* The custom word list's heading. */
.dict-head { display: flex; align-items: center; gap: 10px; }
.dict-head b { font-size: 17px; }
.dict-filter { margin: 0 0 0 auto; width: 180px; padding: 6px 10px; }
.dict-list { list-style: none; margin: 0; padding: 0; columns: 4 140px; column-gap: 18px; max-height: 50vh; overflow: auto; }
.dict-word { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 3px 0; break-inside: avoid; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.dict-add { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.dict-add textarea { margin: 0; }
.word-x { display: inline-flex; width: 18px; height: 18px; padding: 2px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; flex: none; }
.word-x svg { width: 100%; height: 100%; }
@media (max-width: 700px) {
  /* Codenames: the 5 by 5 grid of words. */
  .cdn-grid { gap: 5px; }
  .cdn-card { min-height: 52px; font-size: 12px; border-radius: 9px; padding: 4px 2px; overflow-wrap: normal; hyphens: auto; -webkit-hyphens: auto; }
  .cdn-teams { grid-template-columns: 1fr; }
  .cdn-card.long { font-size: 10px; letter-spacing: -.01em; }
}

/* Market pictures */
.mk-thumb { width: 60px; height: 60px; flex: none; border-radius: 13px; object-fit: cover; background: var(--hover); }
/* every card's top row is the same height, picture or not: the question gets two lines */
.mk-card-top { align-items: center; height: 60px; }
.mk-card-top .mk-q { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.mk-photo { width: 92px; height: 92px; flex: none; border-radius: 18px; object-fit: cover; background: var(--hover); }
/* Everything in a market's title row lines up with the title's first line (36px tall), however
   many lines the question wraps onto: the arrow, the picture button and the balance are centred
   on that line, and the picture starts level with it. */
.mk-title { align-items: flex-start; }
.mk-title h1 { line-height: 36px; }
.mk-photo-form { align-self: flex-start; margin-top: 3px; }
.mk-photo-form .icon-btn { position: relative; cursor: pointer; }
.mk-pick { display: flex; align-items: center; gap: 12px; }
.mk-pick-preview { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.mk-pick .file-btn { display: inline-flex; align-items: center; gap: 6px; }
/* group chat pictures */
.mod-pic { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mod-pic .file-btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 700px) { .mk-photo { width: 64px; height: 64px; border-radius: 14px; } }
.mod-pick input { accent-color: var(--text); }
.chat-blocked { margin: 10px 0 0; padding: 14px; border-radius: 16px; background: var(--hover); color: var(--text-2); text-align: center; font-weight: 600; }
@media (max-width: 700px) {
  .game-head { flex-wrap: wrap; }
  /* The copy-a-link box for game invites. */
}
.rk-ctl:empty { display: none; }
/* hands won this game, beside the chips */
.pk-rate { margin-left: 2px; padding: 0 5px; border-radius: 7px; background: rgba(127,127,127,.18); font-size: .82em; font-weight: 700; opacity: .9; }
@media (max-width: 700px) { .pk-ring { margin-bottom: 52px; } }
/* chat header: mute, edit and block, at the right */
.chat-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.chat-tools .icon-btn.on { background: var(--hover); }
/* Profile: notifications on / off */
.notify-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--hover); }
.notify-seg form { margin: 0; }
.seg-btn { min-width: 78px; height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg-btn:disabled { opacity: .4; cursor: default; }
/* a moderator's password reset: the one-time password to pass on */
.mod-reset { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.temp-pw { padding: 4px 10px; border-radius: 8px; background: var(--surface); font: inherit; font-weight: 700; font-size: 18px; letter-spacing: .06em; user-select: all; }

/* ---------- The top bar's icons: all one size, one line weight and one color ---------- */
header.top .icon-btn, header.top .search-btn { width: 38px; height: 38px; padding: 0; border-radius: 10px; color: var(--text-2); }
header.top .icon-btn:hover, header.top .search-btn:hover, header.top .search-btn.on, header.top .mod-btn.on { background: var(--hover); color: var(--text); }
header.top .icon-btn svg, header.top .search-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }

/* ---------- The appearance menu (the moon / sun button) ----------
   A small floating panel under the button. Row 1: three modes as a segmented control, each an icon
   with its name. Row 2: round color swatches, then Shuffle; the chosen one gets a ring and a check
   mark. */
.theme-menu { position: relative; }
.theme-menu > summary { list-style: none; }
.theme-menu > summary::-webkit-details-marker { display: none; }
header.top .theme-menu[open] > summary { background: var(--hover); color: var(--text); }
.theme-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 380px; margin: 0; padding: 12px;
  display: flex; flex-direction: column; gap: 12px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06); }
.theme-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: var(--hover); }
/* The appearance menu: Light, Dark, Glow and System. */
.theme-mode { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1; cursor: pointer; }
.theme-mode svg { width: 19px; height: 19px; }
.theme-mode:hover { color: var(--text); }
.theme-mode[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.theme-tints { display: grid; grid-template-columns: repeat(12, 1fr); justify-items: center; align-items: center; padding: 2px 2px 3px; }
.tint-swatch { position: relative; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); transition: transform .12s, box-shadow .12s; }
.tint-swatch:hover { transform: scale(1.1); }
/* The appearance menu: the page color swatches. */
.tint-swatch svg { width: 14px; height: 14px; stroke-width: 2.8; opacity: 0; }
.tint-swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.tint-swatch[aria-pressed="true"] svg { opacity: 1; }
.tint-swatch.t-yellow, .tint-swatch.t-lightgreen, .tint-swatch.t-lightblue, .tint-swatch.t-orange { color: #1d1d1d; }
/* "No Color": half white, half black. Its check mark flips color across the middle (white on the
   black half, black on the white half) so it shows on both. */
.tint-swatch.t-none { background: linear-gradient(90deg, #fff 50%, #111 50%); }
/* A thin grey outline on No Color and Shuffle so their edges show on any panel color. */
.tint-swatch.t-none, .tint-swatch.t-shuffle { box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .5); }
.tint-swatch.t-none[aria-pressed="true"], .tint-swatch.t-shuffle[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .5), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.tint-swatch.t-none svg { color: #fff; mix-blend-mode: difference; }
/* "Shuffle": a plain swatch with the shuffle arrows, always showing (no check mark when chosen,
   just the ring) */
.tint-swatch.t-shuffle { background: var(--surface); color: var(--text); }
.tint-swatch.t-shuffle svg { width: 16px; height: 16px; stroke-width: 2; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tint-swatch { transition: none; } .tint-swatch:hover { transform: none; } }
/* phones: the panel spans the screen just under the top bar */
@media (max-width: 600px) { .theme-pop { position: fixed; left: 12px; right: 12px; top: calc(var(--top-h) - 2px); width: auto; } }
/* (with 12 colors in a row, the circles are a little smaller on phones so they keep a gap) */
@media (max-width: 420px) { .tint-swatch { width: 23px; height: 23px; } .tint-swatch svg { width: 12px; height: 12px; } }

/* ---------- Page colors (the second row of the appearance menu) ----------
   Each color tints the page background, the sidebar and the hover shading; cards, buttons and
   text stay as they are. Light and dark mode each get their own version: a soft pastel in light
   mode and a deep, quiet shade in dark mode. Generated from one hue per color so they match. */
:root[data-tint="brown"] { --bg: #f3ece4; --side: #ede3d8; --hover: #e6dacd; --active: #ddcfbf; --border: #ddd2c6; --border-strong: #c9baab; }
:root[data-tint="brown"][data-theme="dark"] { --bg: #2a2018; --side: #211912; --surface: #2e2620; --hover: #3b3027; --active: #46392e; --border: #3d332b; --border-strong: #57483c; --card: #29221c; --input: #322a23; }
@media (prefers-color-scheme: dark) { :root[data-tint="brown"]:not([data-theme="light"]) { --bg: #2a2018; --side: #211912; --surface: #2e2620; --hover: #3b3027; --active: #46392e; --border: #3d332b; --border-strong: #57483c; --card: #29221c; --input: #322a23; } }
/* Brown: a natural walnut wood */
.tint-swatch.t-brown { background: #7d5130; }
:root[data-tint="red"] { --bg: #fbebed; --side: #f9e1e3; --hover: #f1d6d9; --active: #eccccf; --border: #e5d5d6; --border-strong: #d4bfc1; }
:root[data-tint="red"][data-theme="dark"] { --bg: #271315; --side: #1f0f11; --surface: #2a2021; --hover: #362527; --active: #412d2f; --border: #392b2c; --border-strong: #513e40; --card: #271e1f; --input: #2e2425; }
@media (prefers-color-scheme: dark) { :root[data-tint="red"]:not([data-theme="light"]) { --bg: #271315; --side: #1f0f11; --surface: #2a2021; --hover: #362527; --active: #412d2f; --border: #392b2c; --border-strong: #513e40; --card: #271e1f; --input: #2e2425; } }
.tint-swatch.t-red { background: #ba1c2c; }
:root[data-tint="pink"] { --bg: #fcf0f5; --side: #fae5ee; --hover: #f3dae4; --active: #eed0dc; --border: #e5d4db; --border-strong: #d4bfc7; }
:root[data-tint="pink"][data-theme="dark"] { --bg: #25161c; --side: #1d1116; --surface: #2a2024; --hover: #37252c; --active: #412c35; --border: #392a30; --border-strong: #513e45; --card: #271e22; --input: #2e2428; }
@media (prefers-color-scheme: dark) { :root[data-tint="pink"]:not([data-theme="light"]) { --bg: #25161c; --side: #1d1116; --surface: #2a2024; --hover: #37252c; --active: #412c35; --border: #392a30; --border-strong: #513e45; --card: #271e22; --input: #2e2428; } }
/* (each swatch shows its own color) */
.tint-swatch.t-pink { background: #e54384; }
:root[data-tint="orange"] { --bg: #fdf5ef; --side: #fceee3; --hover: #f5e5d8; --active: #f1ddcd; --border: #e6dcd3; --border-strong: #d6c8bd; }
:root[data-tint="orange"][data-theme="dark"] { --bg: #261c14; --side: #1e1610; --surface: #2b241f; --hover: #382d24; --active: #43362b; --border: #3a3129; --border-strong: #53463c; --card: #27221d; --input: #2f2823; }
@media (prefers-color-scheme: dark) { :root[data-tint="orange"]:not([data-theme="light"]) { --bg: #261c14; --side: #1e1610; --surface: #2b241f; --hover: #382d24; --active: #43362b; --border: #3a3129; --border-strong: #53463c; --card: #27221d; --input: #2f2823; } }
.tint-swatch.t-orange { background: #f28a36; }
:root[data-tint="yellow"] { --bg: #fefaee; --side: #fdf7e3; --hover: #f6f0d7; --active: #f2eacc; --border: #e7e2d2; --border-strong: #d7d1bc; }
:root[data-tint="yellow"][data-theme="dark"] { --bg: #272314; --side: #1e1b10; --surface: #2b291f; --hover: #393423; --active: #443e2a; --border: #3b3728; --border-strong: #544e3b; --card: #28251d; --input: #2f2c23; }
@media (prefers-color-scheme: dark) { :root[data-tint="yellow"]:not([data-theme="light"]) { --bg: #272314; --side: #1e1b10; --surface: #2b291f; --hover: #393423; --active: #443e2a; --border: #3b3728; --border-strong: #544e3b; --card: #28251d; --input: #2f2c23; } }
.tint-swatch.t-yellow { background: #f4cb34; }
/* Page colors (tints): each one sets the page's background shades (light, then dark versions). */
:root[data-tint="lightgreen"] { --bg: #f5fbf2; --side: #eef7e8; --hover: #e4f0de; --active: #dcead4; --border: #dbe3d7; --border-strong: #c7d1c1; }
:root[data-tint="lightgreen"][data-theme="dark"] { --bg: #1c2318; --side: #161b13; --surface: #242921; --hover: #2c3427; --active: #353f2f; --border: #30372c; --border-strong: #454f40; --card: #22261f; --input: #282c25; }
@media (prefers-color-scheme: dark) { :root[data-tint="lightgreen"]:not([data-theme="light"]) { --bg: #1c2318; --side: #161b13; --surface: #242921; --hover: #2c3427; --active: #353f2f; --border: #30372c; --border-strong: #454f40; --card: #22261f; --input: #282c25; } }
.tint-swatch.t-lightgreen { background: #83d256; }
:root[data-tint="green"] { --bg: #f3f9f6; --side: #eaf6ef; --hover: #e0eee6; --active: #d7e8de; --border: #d8e1dc; --border-strong: #c3d0c9; }
:root[data-tint="green"][data-theme="dark"] { --bg: #19221d; --side: #141a17; --surface: #222825; --hover: #29332d; --active: #313d36; --border: #2e3631; --border-strong: #424d47; --card: #202522; --input: #262c28; }
@media (prefers-color-scheme: dark) { :root[data-tint="green"]:not([data-theme="light"]) { --bg: #19221d; --side: #141a17; --surface: #222825; --hover: #29332d; --active: #313d36; --border: #2e3631; --border-strong: #424d47; --card: #202522; --input: #262c28; } }
.tint-swatch.t-green { background: #3fab6e; }
:root[data-tint="lightblue"] { --bg: #f1fafb; --side: #e7f7f9; --hover: #dceff2; --active: #d2e9ed; --border: #d5e2e4; --border-strong: #c0d1d3; }
/* (page colors continued) */
:root[data-tint="lightblue"][data-theme="dark"] { --bg: #172224; --side: #121b1c; --surface: #212829; --hover: #263436; --active: #2e3e40; --border: #2b3738; --border-strong: #3f4e50; --card: #1f2526; --input: #242c2d; }
@media (prefers-color-scheme: dark) { :root[data-tint="lightblue"]:not([data-theme="light"]) { --bg: #172224; --side: #121b1c; --surface: #212829; --hover: #263436; --active: #2e3e40; --border: #2b3738; --border-strong: #3f4e50; --card: #1f2526; --input: #242c2d; } }
.tint-swatch.t-lightblue { background: #4bccdd; }
:root[data-tint="blue"] { --bg: #f0f5fc; --side: #e6edf9; --hover: #dbe4f2; --active: #d1dced; --border: #d5dbe4; --border-strong: #bfc7d4; }
:root[data-tint="blue"][data-theme="dark"] { --bg: #161c24; --side: #11161d; --surface: #20242a; --hover: #262c36; --active: #2d3541; --border: #2b3039; --border-strong: #3e4551; --card: #1e2126; --input: #24282e; }
@media (prefers-color-scheme: dark) { :root[data-tint="blue"]:not([data-theme="light"]) { --bg: #161c24; --side: #11161d; --surface: #20242a; --hover: #262c36; --active: #2d3541; --border: #2b3039; --border-strong: #3e4551; --card: #1e2126; --input: #24282e; } }
.tint-swatch.t-blue { background: #2162ca; }
:root[data-tint="purple"] { --bg: #f5f1fb; --side: #efe8f8; --hover: #e6ddf0; --active: #ded4eb; --border: #dcd6e3; --border-strong: #c8c1d2; }
:root[data-tint="purple"][data-theme="dark"] { --bg: #1d1823; --side: #16121b; --surface: #242129; --hover: #2d2735; --active: #362f3f; --border: #312c37; --border-strong: #46404f; --card: #221f26; --input: #28252d; }
@media (prefers-color-scheme: dark) { :root[data-tint="purple"]:not([data-theme="light"]) { --bg: #1d1823; --side: #16121b; --surface: #242129; --hover: #2d2735; --active: #362f3f; --border: #312c37; --border-strong: #46404f; --card: #221f26; --input: #28252d; } }
/* (swatches continued) */
.tint-swatch.t-purple { background: #6c2fbc; }

/* The appearance button shows a sun while the page is light and a moon while it is dark, whether
   that was picked in the menu or comes from the device (System). */
.theme-menu > summary .tm-sun { display: inline-flex; }
.theme-menu > summary .tm-moon { display: none; }
[data-theme="dark"] .theme-menu > summary .tm-sun { display: none; }
[data-theme="dark"] .theme-menu > summary .tm-moon { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-menu > summary .tm-sun { display: none; }
  :root:not([data-theme="light"]) .theme-menu > summary .tm-moon { display: inline-flex; }
}

/* ---------- Chats page (what the Chats tab opens on phones) ---------- */
/* The same chat list as the sidebar, a little roomier, with message search and the + for a new
   chat beside the heading. */
.chats-head { display: flex; align-items: center; gap: 12px; }
.chats-tools { position: relative; display: flex; align-items: center; gap: 4px; margin-left: auto; }
.chats-tools .side-new { margin-left: 0; }
.chats-tools .side-people { left: auto; right: 0; top: 100%; width: min(300px, calc(100vw - 32px)); }
.chats-list { display: flex; flex-direction: column; gap: 2px; }
.chats-list { gap: 4px; }
.chats-list .side-chat { padding: 14px 12px; gap: 14px; border-radius: 14px; }
.chats-list .side-chat .av { width: 50px; height: 50px; font-size: 20px; }
/* The Messages page on phones: chat names. */
.chats-list .side-chat-name { font-size: 17.5px; line-height: 1.3; }
.chats-list .side-chat-last { font-size: 14.5px; margin-top: 2px; }
.chats-list .side-chat-when { font-size: 13.5px; }
/* On iPhones turned sideways, keep everything clear of the notch. */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* ---------- Names, profiles and leaderboards ---------- */
/* A person's name links to their profile: it looks the same as before, underlined on hover. */
a.name { text-decoration: none; }
a.name:hover { text-decoration: underline; }
/* Profile page: picture, name and join date, then three numbers, then their record. */
.people-page { max-width: 760px; }
.people-page .profile-card .icon-btn { margin-left: auto; }
.people-page h1.profile-name { margin: 0; line-height: 1.15; }
.settings .profile-card .text-btn { display: inline-block; margin-top: 4px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.stat {
  display: flex; align-items: baseline; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--text); text-decoration: none;
}
/* Profile stats (posts, wins...) and hover. */
a.stat:hover { background: var(--hover); }
.stat b { display: inline-flex; align-items: baseline; gap: 6px; font-size: 24px; line-height: 1.1; }
.stat .stat-coin { align-self: center; }
/* The label reads on from the number like a phrase ("72 McChat Messages"), just a little lighter. */
.stat small { font-size: 17px; font-weight: 600; color: var(--text-2); }
.stat-coin { display: inline-flex; color: var(--text-2); }
.stat .stat-coin svg { width: 20px; height: 20px; }

.people-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.people-list li + li { border-top: 1px solid var(--border); }
.people-list a { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; color: var(--text); text-decoration: none; } /* title and date share one baseline */
.people-list a:hover { background: var(--hover); }
.people-list-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-list-meta { flex: none; font-size: 13px; font-weight: 600; color: var(--text-3); }
/* A game-by-game record: symbol, name, then the numbers in fixed columns so they line up. */
.lb-games { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-games li { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.lb-games .game-icon { width: 34px; height: 34px; border-radius: 10px; }
.lb-games .game-icon svg { width: 20px; height: 20px; }
.lb-game-name { flex: 1; min-width: 0; font-weight: 600; }
.lb-num { flex: none; width: 64px; text-align: center; font-weight: 700; }
.lb-num small { margin-left: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
/* The profile's sections fold away: the heading (with its arrow) is the switch. */
.people-sec > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; margin: 26px 0 10px; }
.people-sec > summary::-webkit-details-marker { display: none; }
.people-sec > summary:hover { color: var(--text); }
.people-sec[open] > summary .chev { transform: rotate(-135deg) translate(-1px, -1px); }
.lb-head.people-head { padding-right: 0; }
.people-page .profile-card .people-act svg { width: 22px; height: 22px; }
/* Leaderboard pages */
.lb-page { max-width: 760px; }
.lb-page h1 { margin: 6px 0 16px; }
/* The title and the sort switch share one line (the switch wraps under the title only if there
   isn't room). */
.lb-title { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.lb-title h1 { margin: 0; }
.lb-sort { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--hover); }
.lb-sort .seg-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.lb-head { display: flex; justify-content: flex-end; gap: 12px; padding: 0 50px 6px 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.lb-head span { width: 64px; text-align: center; white-space: nowrap; }
.lb-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.lb-list > li + li { border-top: 1px solid var(--border); }
/* A McPoints row's divider line sits inside its 60px, so it gives up 1px of top padding: the inside
   stays 36px and the coin, picture and text sit exactly in the middle like the first row. */
.lb-list > li.lb-row + li.lb-row { padding-top: 11px; }
.lb-row { --lb-lh: 36px; display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; height: 60px; } /* every row exactly 60px tall */
/* The rank, the name and the bigger numbers line up by their baseline (the line the letters sit
   on) instead of each being centred on its own, which left the smaller ones sitting a little high.
   Each piece of text gets a line as tall as the inside of the row (--lb-lh), so the text still
   sits in the middle of the row; pictures and the arrow are centred as before. */
.lb-row > :not(.av) { line-height: var(--lb-lh); }
.lb-row > .av, .lb-row > .chev, .lb-row > .lb-coin { align-self: center; }
.lb-row.lb-you, .lb-more.lb-you > .lb-row { background: var(--hover); }
.lb-rank { flex: none; width: 22px; font-size: 13px; font-weight: 700; color: var(--text-3); }
.lb-row .name { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-num.lb-main { color: var(--text); }
.lb-row .lb-num:not(.lb-main) { color: var(--text-2); font-weight: 600; }
.lb-list > .lb-row .lb-num { width: auto; font-size: 16px; }
/* The McPoints coin sits just left of the number, centred like the picture. */
.lb-row > .lb-coin { align-self: center; margin-right: -6px; }
/* McPoints: every number gets the same width, right-aligned, so the coins beside them line up
   down the list however long each number is. */
.lb-pts { min-width: 6ch; text-align: right; }
.lb-more > summary { list-style: none; cursor: pointer; }
.lb-more > summary::-webkit-details-marker { display: none; }
.lb-more > summary:hover { background: var(--hover); }
.lb-more > summary .chev { flex: none; margin: 0 4px 0 10px; color: var(--text-3); }
.lb-more[open] > summary .chev { transform: rotate(-135deg) translate(-1px, -1px); }
.lb-more .lb-games { padding: 4px 49px 6px 50px; } /* right edge lines up with the numbers above */
.lb-more .lb-games li { gap: 12px; }
.lb-more .lb-games .lb-num { color: var(--text-2); font-weight: 600; }
@media (max-width: 640px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .lb-num, .lb-head span { width: 44px; }
  .lb-head { gap: 8px; padding-right: 38px; }
  .lb-row { --lb-lh: 40px; gap: 8px; padding: 10px 12px; }
  .lb-list > li.lb-row + li.lb-row { padding-top: 9px; }
  /* Leaderboards: the "more" fold-out. */
  .lb-more > summary .chev { margin: 0 4px 0 6px; }
  .lb-more .lb-games { padding-left: 12px; padding-right: 37px; }
  .lb-games li, .lb-more .lb-games li { gap: 8px; }
}
/* One post on its own page */
.post-page { max-width: 640px; }
.post-single .note { width: 100%; }
/* The username box on the Profile page sits in one row with its button, like Color. */
.row-form input[name="username"] { width: 260px; max-width: 100%; margin: 0; }
/* In a one-on-one chat, the person's picture and name at the top open their profile. */
a.chat-person { display: inline-flex; color: inherit; text-decoration: none; }
a.chat-person:hover { text-decoration: underline; }

/* ---------- Back arrows ----------
   The back arrow never takes a row of its own. On pages with a title it sits on the title's line,
   to its left; on a single post (which has no title) it sits in the card's top-left corner, across
   from the delete button. */
.lb-page > .back-link, .wallet-page > .back-link { float: left; margin: 5px 6px 0 -10px; } /* centred on the title's first line */
.people-page > .back-link { display: inline-flex; margin: -6px 0 6px -10px; } /* above the profile, from a leaderboard */
/* On a market the arrow is the first thing in the title row, centred with the title like the
   picture and the balance beside it. */
.mk-title > .back-link { flex: none; margin: -1px -8px 0 -10px; }
.lb-page .lb-title, .lb-page > h1, .wallet-page > h1 { margin-top: 0; }
.post-page { position: relative; }
.post-page > .back-link { position: absolute; top: 1px; left: 6px; z-index: 2; width: 30px; height: 30px; border-radius: 8px; }
.post-page > .note { padding-top: 40px; } /* room for the arrow above the title */
@media (max-width: 640px) {
  /* A market on a phone: the question keeps most of the row (the balance drops to its own line
     underneath), and the byline gets a full row, with the volume and Resolve below it. */
  .mk-title::after { content: ""; flex-basis: 100%; order: 1; } /* a line break just before the balance */
  .mk-title .mk-balance { order: 2; margin-top: -2px; }
  .mk-meta { flex-wrap: wrap; row-gap: 8px; }
  .mk-meta > .byline { flex-basis: 100%; }
  .lb-page > .back-link, .wallet-page > .back-link { margin-right: 4px; }
  /* The title wraps beside the arrow; the Wins / Played / Win % switch goes full width below it. */
  .lb-page .lb-title { display: block; }
  .lb-page .lb-title .lb-sort { margin-top: 14px; }
}

/* ==========================================================================================
   LIFE AND COLOR (pictures, everyone's colors, motion, celebrations, reports)
   ========================================================================================== */

/* ---------- Pictures on recommendations ----------
   The link's preview picture across the top of the card, inset like a photo pinned to a note:
   always the same wide shape (so the board doesn't jump as pictures load), cropped to fit. */
.note-pic { display: block; margin: 0 0 12px; border-radius: 9px; overflow: hidden; background: var(--hover); aspect-ratio: 1.91 / 1; }
.note-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.note-pic:hover img { opacity: .94; }
.note.hub-item .note-pic { margin-top: 2px; }
.note:has(.note-pic):has(.note-tools .icon-btn) .note-pic { margin-top: 4px; }

/* ---------- Everyone's colors ----------
   A letter circle is filled with its person's color (users.css), and pictures in chats get a thin
   ring in that color with a hairline gap ("outline" with an offset leaves the gap see-through). */
.av.ur { outline: 1.5px solid var(--ring, transparent); outline-offset: 1.5px; }
/* Your game symbols in your own color, on a soft wash of it (the background is solid, so the
   cut-out holes in some symbols can match it exactly). */
.app .game-icon {
  --gi-bg: color-mix(in srgb, var(--uc, var(--text)) 13%, var(--surface));
  background: var(--hover); background: var(--gi-bg);
  color: var(--text); color: color-mix(in srgb, var(--uc, var(--text)) 85%, var(--text));
}
.app .game-icon .ic-hole { fill: var(--gi-bg); }

/* ---------- Birthdays ----------
   On someone's birthday their picture wears a small gold crown, tilted on its top right. */
.av-bday { position: relative; display: inline-flex; flex: none; }
.av-crown { position: absolute; top: -34%; right: -18%; width: 62%; transform: rotate(18deg); pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.av-crown svg { display: block; width: 100%; height: auto; }
.lb-row > .av-bday, .byline > .av-bday { align-self: center; }
.msg > .av-bday { margin-top: 2px; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 2px; margin-top: 2px; line-height: 20px; }
.profile-bday { display: inline-flex; align-items: center; gap: 5px; }
.profile-bday svg { flex: none; width: 15px; height: 15px; margin-top: -2px; } /* (centred on the digits, not the line) */
/* McHub's cards above the usual ones: birthdays, then the weekly recap */
.hub-top { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.hub-wide { border: 2.5px solid var(--border-strong); border-radius: 16px; background: var(--surface); }
.bday-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.bday-card > .bday-text > div:last-child { display: flex; align-items: center; min-width: 0; }
.bday-card .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bday-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bday-title { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.bday-title svg { width: 16px; height: 16px; }
/* Birthday banner: the name. */
.bday-text .name { font-size: 19px; font-weight: 700; }
.bday-amt { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: var(--text-2); font-size: 14px; vertical-align: 2px; }
.bday-amt svg { width: 15px; height: 15px; }
.bday-claim { flex: none; }
.bday-claimed { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-weight: 600; font-size: 14px; }
.bday-claimed svg { width: 16px; height: 16px; }
#birthday input[type="date"] { width: 200px; max-width: 100%; margin: 0; }

/* ---------- The weekly recap ---------- */
.recap-card { padding: 14px 16px 16px; }
.recap-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.recap-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.recap-range { color: var(--text-3); font-size: 13.5px; }
.recap-x { margin-left: auto; }
.recap-x .icon-btn { color: var(--text-3); }
.recap-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 10px; }
.recap-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 12px; background: var(--hover); color: var(--text); text-decoration: none; }
/* The weekly recap's tile labels. */
.recap-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.recap-label svg { width: 14px; height: 14px; }
.recap-main { font-size: 15.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.recap-person { display: flex; align-items: center; gap: 8px; font-size: 15.5px; }
.recap-quote { font-size: 14px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.recap-sub { margin-top: auto; padding-top: 2px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.recap-swing.up { color: var(--yes); } .recap-swing.down { color: var(--no); }

/* ---------- Podiums on leaderboards ----------
   Gold, silver and bronze rings (with a hairline gap) around the top three pictures, first place
   a size up, and the rank numbers in the same metals. */
:root { --gold: #c99a1e; --silver: #9aa3ad; --bronze: #b0703c; }
.lb-row.podium .av { outline: 2px solid var(--medal); outline-offset: 2px; }
.lb-row.p1 { --medal: var(--gold); } .lb-row.p2 { --medal: var(--silver); } .lb-row.p3 { --medal: var(--bronze); }
.lb-row.p1 .av { width: 34px; height: 34px; font-size: 14px; outline-width: 2.5px; }
.lb-row.podium .lb-rank { color: var(--medal); font-weight: 800; }

/* ---------- Markets: which way the price went in the last day ---------- */
.mk-chart.up:not(.big) .mk-line.yes { stroke: var(--yes); }
.mk-chart.down:not(.big) .mk-line.yes { stroke: var(--no); }

/* ---------- Profile banners ----------
   A wide strip across the top of a profile: the person's photo, or a band of their color. Their
   picture sits on its lower edge with a ring of page color around it. */
.profile-banner { height: 168px; border-radius: 18px; overflow: hidden; background-color: var(--active); }
.profile-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Under a banner: the picture overlaps the banner's lower edge; beside it, below the banner, the
   name with the join date and birthday underneath, and the message (or edit) button on the right. */
.profile-card.has-banner { align-items: flex-start; margin-top: -34px; padding: 0 2px 24px 18px; }
/* (34px of the picture overlaps the banner, so the words start 12px below the banner's edge) */
.profile-card.has-banner > div { min-width: 0; padding-top: 46px; }
.people-page .profile-card.has-banner > .icon-btn { margin-top: 44px; }
.profile-card.has-banner > .av, .profile-card.has-banner > .av-bday > .av { box-shadow: 0 0 0 4px var(--bg); }
.banner-pick { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.banner-preview { display: block; width: 100%; height: 96px; border-radius: 14px; object-fit: cover; }
.banner-tools { display: flex; align-items: center; gap: 8px; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  /* The profile banner (the picture or color strip at the top of a profile). */
  .profile-banner { height: 120px; border-radius: 14px; }
  .profile-card.has-banner { margin-top: -30px; padding-left: 12px; gap: 14px; }
  .profile-card.has-banner > div { padding-top: 40px; }
  .people-page .profile-card.has-banner > .icon-btn { margin-top: 38px; }
}

/* ---------- Articles: header pictures and the reading bar ---------- */
.article-cover { margin: 0 0 26px; border-radius: 16px; overflow: hidden; background: var(--hover); aspect-ratio: 2 / 1; }
.article-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.article-card-row { display: flex; gap: 18px; align-items: flex-start; }
.article-card-words { flex: 1; min-width: 0; }
.article-thumb { flex: none; width: 132px; aspect-ratio: 4 / 3; margin-top: 14px; border-radius: 10px; object-fit: cover; background: var(--hover); }
@media (max-width: 560px) { .article-thumb { width: 92px; margin-top: 12px; } .article-card-row { gap: 12px; } }
.hub-article .article-thumb { width: 96px; }
.read-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
/* The article editor's header picture. */
.editor-cover { display: flex; flex-direction: column; gap: 10px; }
.editor-cover-label { font-weight: 600; font-size: 14px; }
.editor-cover-img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
.editor-cover-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Reports ---------- */
.report-btn.on { color: var(--no) !important; }
.report-btn.on svg { fill: currentColor; }
.note-tools .report-btn { opacity: .55; }
.note:hover .note-tools .report-btn, .note-tools .report-btn:focus-visible, .note-tools .report-btn.on { opacity: 1; }
.cmt-actions .report-form { margin: 0; }
.mod-reports { margin: 0 0 26px; }
.mod-reports > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.mod-reports > summary::-webkit-details-marker { display: none; }
/* Moderation: the reports section. */
.mod-reports > summary .section-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.mod-chev { display: inline-flex; color: var(--text-3); transition: transform .2s; }
.mod-chev svg { width: 16px; height: 16px; }
.mod-reports:not([open]) .mod-chev { transform: rotate(-90deg); }
.mod-limit { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; flex-wrap: wrap; }
.mod-limit label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.mod-limit input { width: 76px; margin: 0; text-align: center; }
.mod-reports-list { list-style: none; margin: 6px 0 0; padding: 0; }
.mod-report { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
/* Moderation: one report. */
.mod-report-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mod-report-text { min-width: 0; color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-report-text:hover { text-decoration: underline; }
.mod-report-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mod-report-count { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; font-weight: 700; color: var(--text-2); }
.mod-report-count svg { width: 14px; height: 14px; }
.mod-tag.hidden-tag { background: var(--no-soft); color: var(--no); }
.mod-none { margin: 8px 0 0; }
.danger-text { color: var(--no); }

/* ---------- Chats: link previews and big emoji ---------- */
.link-card { display: flex; flex-direction: column; width: min(300px, 100%); margin-top: 4px; border-radius: 16px; overflow: hidden; background: var(--hover); color: var(--text); text-decoration: none; }
.msg.mine .link-card { margin-left: auto; background: var(--active); }
.link-card img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: var(--active); }
.link-card-text { display: flex; flex-direction: column; gap: 1px; padding: 9px 13px 10px; }
.link-card-title { font-size: 14px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.link-card-site { font-size: 12.5px; color: var(--text-3); }
.link-card:hover .link-card-title { text-decoration: underline; }
.big-emoji { font-size: 44px; line-height: 1.15; letter-spacing: 2px; padding: 2px 0; }
/* Big emoji messages from you sit on the right. */
.msg.mine .big-emoji { text-align: right; }

/* ---------- Hover life on cards ----------
   On a computer, cards lift a couple of pixels with a deeper shadow under the pointer; on a phone
   they press in slightly while touched. */
.note, .mk-card, .hub-item, .hub-wide, .game-tile, .recap-tile { transition: transform .18s ease, box-shadow .18s ease; }
@media (hover: hover) {
  .note:hover, .mk-card:hover, .hub-item:hover, .game-tile:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 12px 28px rgba(0, 0, 0, .09); }
  .recap-tile:hover { transform: translateY(-1px); background: var(--active); }
  :root[data-theme="dark"] .note:hover, :root[data-theme="dark"] .mk-card:hover, :root[data-theme="dark"] .hub-item:hover, :root[data-theme="dark"] .game-tile:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, .45); }
}
@media (hover: none) {
  .note:active, .mk-card:active, .hub-item:active, .game-tile:active, .recap-tile:active { transform: scale(.985); }
}

/* ---------- Little moments of motion ---------- */
/* pop: a reaction you just added, or a count that just went up */
.pop { animation: pop .34s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
/* a new chat message slides up into place */
.msg.arrive { animation: arrive .26s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* a recommendation you just pinned drops onto the board */
.note.arrive-drop { animation: drop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
/* the toast: a small note that drops in just under the top bar */
.toast {
  position: fixed; left: 50%; top: calc(var(--top-h) + 14px); z-index: 100;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  background: var(--primary); color: var(--primary-text); font-size: 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
  transform: translate(-50%, -14px); opacity: 0; transition: transform .3s cubic-bezier(.2, 1.3, .4, 1), opacity .25s;
}
.toast.in { transform: translate(-50%, 0); opacity: 1; }
/* confetti: small pieces bursting out from the middle of the page's main area */
.confetti { position: fixed; z-index: 99; width: 0; height: 0; pointer-events: none; }
.confetti i { position: absolute; left: 0; top: 0; width: 8px; height: 11px; border-radius: 2px; }
/* Reduced motion: none of the above moves (the toast just appears and fades). */
@media (prefers-reduced-motion: reduce) {
  .pop, .msg.arrive, .note.arrive-drop { animation: none; }
  .toast { transition: opacity .2s; transform: translate(-50%, 0); }
  .note, .mk-card, .hub-item, .hub-wide, .game-tile, .recap-tile, .mod-chev { transition: none; }
  .note:hover, .mk-card:hover, .hub-item:hover, .game-tile:hover, .recap-tile:hover,
  .note:active, .mk-card:active, .hub-item:active, .game-tile:active, .recap-tile:active { transform: none; }
}

/* ---------- Holidays ----------
   On each of these days the whole site takes a seasonal palette, in light and dark versions: the
   page, the sidebar and the board each take one of the season's colors, main buttons take its
   strongest color, the McNet logo another of its colors (solid colors only, never blended), and
   the page you're on in the sidebar is marked with its accent color.
   (server.js decides the day; see CELEBRATIONS.)
     --logo    the logo's color      --flair   the accent color */
:root[data-holiday] .brand { color: var(--logo); }
:root[data-holiday] .side-link.active, :root[data-holiday] .side-hub.active { box-shadow: inset 3px 0 0 var(--flair); }
:root[data-holiday] .tab.on { color: var(--flair); }
/* New Year's Eve: a fireworks night: violet, magenta, gold and electric blue */
:root[data-holiday="newyearseve"] { --bg: #f8f5fd; --side: #efe9fb; --board: #f6e7c2; --card-border: #e4cf95; --primary: #4b2a8a; --primary-text: #ffffff; --logo: #c7951f; --flair: #e0368f; }
:root[data-holiday="newyearseve"][data-theme="dark"] { --bg: #0e0b1f; --side: #090717; --surface: #16122c; --hover: #1f1a3a; --active: #282147; --border: #221c3e; --border-strong: #3a3160; --board: #1d1630; --card: #141029; --card-border: #3b2e57; --input: #18132f; --primary: #f2b33d; --primary-text: #0e0b1f; --logo: #f2b33d; --flair: #ff5fae; }
@media (prefers-color-scheme: dark) { :root[data-holiday="newyearseve"]:not([data-theme="light"]) { --bg: #0e0b1f; --side: #090717; --surface: #16122c; --hover: #1f1a3a; --active: #282147; --border: #221c3e; --border-strong: #3a3160; --board: #1d1630; --card: #141029; --card-border: #3b2e57; --input: #18132f; --primary: #f2b33d; --primary-text: #0e0b1f; --logo: #f2b33d; --flair: #ff5fae; } }
/* Lunar New Year: lantern red and gold */
:root[data-holiday="lunarnewyear"] { --bg: #fdf0ec; --side: #fbecc9; --board: #f6d9c8; --card-border: #e8b9a2; --primary: #b5161e; --primary-text: #ffffff; --logo: #c8102e; --flair: #d4a017; }
:root[data-holiday="lunarnewyear"][data-theme="dark"] { --bg: #260b0c; --side: #2b1f08; --surface: #321413; --hover: #40201d; --active: #4b2724; --border: #43221f; --border-strong: #613631; --board: #3a1612; --card: #2d1312; --card-border: #5a2d25; --input: #371916; --primary: #f0b84c; --primary-text: #260b0c; --logo: #ff4b45; --flair: #f0b84c; }
@media (prefers-color-scheme: dark) { :root[data-holiday="lunarnewyear"]:not([data-theme="light"]) { --bg: #260b0c; --side: #2b1f08; --surface: #321413; --hover: #40201d; --active: #4b2724; --border: #43221f; --border-strong: #613631; --board: #3a1612; --card: #2d1312; --card-border: #5a2d25; --input: #371916; --primary: #f0b84c; --primary-text: #260b0c; --logo: #ff4b45; --flair: #f0b84c; } }
/* St. Patrick's Day: clover green, with orange flair */
:root[data-holiday="stpatricks"] { --bg: #eef8f0; --side: #e1f2e4; --board: #dcefd9; --card-border: #b6d8b4; --primary: #147a3c; --primary-text: #ffffff; --logo: #147a3c; --flair: #ef7d22; }
:root[data-holiday="stpatricks"][data-theme="dark"] { --bg: #0b1d12; --side: #08170e; --surface: #12291a; --hover: #193522; --active: #20402a; --border: #1d3826; --border-strong: #2e5639; --board: #11291a; --card: #112418; --card-border: #2b4d35; --input: #15301e; --primary: #5fd38a; --primary-text: #0b1d12; --logo: #5fd38a; --flair: #ff9a45; }
@media (prefers-color-scheme: dark) { :root[data-holiday="stpatricks"]:not([data-theme="light"]) { --bg: #0b1d12; --side: #08170e; --surface: #12291a; --hover: #193522; --active: #20402a; --border: #1d3826; --border-strong: #2e5639; --board: #11291a; --card: #112418; --card-border: #2b4d35; --input: #15301e; --primary: #5fd38a; --primary-text: #0b1d12; --logo: #5fd38a; --flair: #ff9a45; } }
/* Easter: lavender and mint, on a butter-yellow board */
:root[data-holiday="easter"] { --bg: #f7f3fd; --side: #e8f6ee; --board: #fbf0c8; --card-border: #ecdca0; --primary: #6e52bd; --primary-text: #ffffff; --logo: #8a6fd3; --flair: #5fbf93; }
:root[data-holiday="easter"][data-theme="dark"] { --bg: #1c1827; --side: #13201b; --surface: #24202f; --hover: #2d2839; --active: #363044; --border: #312b3d; --border-strong: #493f5a; --board: #2d2a1c; --card: #211d2b; --card-border: #4a4430; --input: #29243a; --primary: #c9b8f2; --primary-text: #1c1827; --logo: #c9b8f2; --flair: #8fdcb7; }
@media (prefers-color-scheme: dark) { :root[data-holiday="easter"]:not([data-theme="light"]) { --bg: #1c1827; --side: #13201b; --surface: #24202f; --hover: #2d2839; --active: #363044; --border: #312b3d; --border-strong: #493f5a; --board: #2d2a1c; --card: #211d2b; --card-border: #4a4430; --input: #29243a; --primary: #c9b8f2; --primary-text: #1c1827; --logo: #c9b8f2; --flair: #8fdcb7; } }
/* Cinco de Mayo: the Mexican flag's green, white and red */
:root[data-holiday="cincodemayo"] { --bg: #ffffff; --side: #e6f3ec; --board: #fbe9e9; --card-border: #e8c3c3; --primary: #006847; --primary-text: #ffffff; --logo: #006847; --flair: #ce1126; }
:root[data-holiday="cincodemayo"][data-theme="dark"] { --bg: #0d1712; --side: #0a1d14; --surface: #151f1a; --hover: #1d2a23; --active: #24342c; --border: #203029; --border-strong: #334a3e; --board: #2a1416; --card: #131c18; --card-border: #4d2a2e; --input: #18231e; --primary: #3ccf8e; --primary-text: #0d1712; --logo: #3ccf8e; --flair: #ff5a64; }
@media (prefers-color-scheme: dark) { :root[data-holiday="cincodemayo"]:not([data-theme="light"]) { --bg: #0d1712; --side: #0a1d14; --surface: #151f1a; --hover: #1d2a23; --active: #24342c; --border: #203029; --border-strong: #334a3e; --board: #2a1416; --card: #131c18; --card-border: #4d2a2e; --input: #18231e; --primary: #3ccf8e; --primary-text: #0d1712; --logo: #3ccf8e; --flair: #ff5a64; } }
/* Earth Day: leaf green and sky blue */
:root[data-holiday="earthday"] { --bg: #eff6fb; --side: #e7f1e1; --board: #e6efd8; --card-border: #c9d9b4; --primary: #2b6b4a; --primary-text: #ffffff; --logo: #2f86c4; --flair: #2f86c4; }
:root[data-holiday="earthday"][data-theme="dark"] { --bg: #0f1b21; --side: #0f1a12; --surface: #18252c; --hover: #1f2f37; --active: #273a43; --border: #23333b; --border-strong: #374c56; --board: #17271c; --card: #172229; --card-border: #34503b; --input: #1b2a31; --primary: #8ccaa3; --primary-text: #0f1b21; --logo: #7ab9df; --flair: #7ab9df; }
@media (prefers-color-scheme: dark) { :root[data-holiday="earthday"]:not([data-theme="light"]) { --bg: #0f1b21; --side: #0f1a12; --surface: #18252c; --hover: #1f2f37; --active: #273a43; --border: #23333b; --border-strong: #374c56; --board: #17271c; --card: #172229; --card-border: #34503b; --input: #1b2a31; --primary: #8ccaa3; --primary-text: #0f1b21; --logo: #7ab9df; --flair: #7ab9df; } }
/* Fourth of July: navy and red, on white */
:root[data-holiday="july4"] { --bg: #f6f8fd; --side: #fbecee; --board: #e6edf9; --card-border: #c9d4ea; --primary: #1d3a78; --primary-text: #ffffff; --logo: #c8102e; --flair: #c8102e; }
:root[data-holiday="july4"][data-theme="dark"] { --bg: #0e1629; --side: #200d13; --surface: #16203a; --hover: #1e2a46; --active: #263353; --border: #212e48; --border-strong: #344467; --board: #152242; --card: #141e35; --card-border: #2d3d63; --input: #19243f; --primary: #f0f3fa; --primary-text: #0e1629; --logo: #ff5a6d; --flair: #ff5a6d; }
@media (prefers-color-scheme: dark) { :root[data-holiday="july4"]:not([data-theme="light"]) { --bg: #0e1629; --side: #200d13; --surface: #16203a; --hover: #1e2a46; --active: #263353; --border: #212e48; --border-strong: #344467; --board: #152242; --card: #141e35; --card-border: #2d3d63; --input: #19243f; --primary: #f0f3fa; --primary-text: #0e1629; --logo: #ff5a6d; --flair: #ff5a6d; } }
/* Halloween: pumpkin orange and witch purple */
:root[data-holiday="halloween"] { --bg: #fdf2e6; --side: #efe8f8; --board: #f8d8b0; --card-border: #e6b882; --primary: #2a1735; --primary-text: #ffffff; --logo: #e8650f; --flair: #6b3fa0; }
:root[data-holiday="halloween"][data-theme="dark"] { --bg: #130e18; --side: #1b1126; --surface: #1e1626; --hover: #291f32; --active: #32273d; --border: #2d2336; --border-strong: #453751; --board: #33200f; --card: #1c1522; --card-border: #5a3a1c; --input: #231a2b; --primary: #ff8a2b; --primary-text: #130e18; --logo: #ff8a2b; --flair: #b07ce8; }
@media (prefers-color-scheme: dark) { :root[data-holiday="halloween"]:not([data-theme="light"]) { --bg: #130e18; --side: #1b1126; --surface: #1e1626; --hover: #291f32; --active: #32273d; --border: #2d2336; --border-strong: #453751; --board: #33200f; --card: #1c1522; --card-border: #5a3a1c; --input: #231a2b; --primary: #ff8a2b; --primary-text: #130e18; --logo: #ff8a2b; --flair: #b07ce8; } }
/* Thanksgiving: harvest amber and cranberry */
:root[data-holiday="thanksgiving"] { --bg: #fbf3e9; --side: #f6e6e0; --board: #f2d6ad; --card-border: #ddb780; --primary: #8a2332; --primary-text: #ffffff; --logo: #c8701c; --flair: #8a2332; }
:root[data-holiday="thanksgiving"][data-theme="dark"] { --bg: #21150e; --side: #22100f; --surface: #2b1e15; --hover: #36271c; --active: #412f23; --border: #392a1f; --border-strong: #544030; --board: #36230f; --card: #271a12; --card-border: #56391f; --input: #302117; --primary: #e8a35a; --primary-text: #21150e; --logo: #e8a35a; --flair: #e2677a; }
@media (prefers-color-scheme: dark) { :root[data-holiday="thanksgiving"]:not([data-theme="light"]) { --bg: #21150e; --side: #22100f; --surface: #2b1e15; --hover: #36271c; --active: #412f23; --border: #392a1f; --border-strong: #544030; --board: #36230f; --card: #271a12; --card-border: #56391f; --input: #302117; --primary: #e8a35a; --primary-text: #21150e; --logo: #e8a35a; --flair: #e2677a; } }
/* Christmas: holly red and evergreen */
:root[data-holiday="christmas"] { --bg: #fbfaf6; --side: #e6f1e8; --board: #f7e0e0; --card-border: #e3c2c2; --primary: #a3172b; --primary-text: #ffffff; --logo: #1d6a42; --flair: #a3172b; }
:root[data-holiday="christmas"][data-theme="dark"] { --bg: #0d1913; --side: #0a1510; --surface: #15241c; --hover: #1c2f25; --active: #233a2d; --border: #203227; --border-strong: #324d3d; --board: #2a1416; --card: #14231b; --card-border: #4d2a2e; --input: #17281e; --primary: #e44a5e; --primary-text: #ffffff; --logo: #5fbf8a; --flair: #e44a5e; }
@media (prefers-color-scheme: dark) { :root[data-holiday="christmas"]:not([data-theme="light"]) { --bg: #0d1913; --side: #0a1510; --surface: #15241c; --hover: #1c2f25; --active: #233a2d; --border: #203227; --border-strong: #324d3d; --board: #2a1416; --card: #14231b; --card-border: #4d2a2e; --input: #17281e; --primary: #e44a5e; --primary-text: #ffffff; --logo: #5fbf8a; --flair: #e44a5e; } }
/* Glow with a page color: the same color, taken very deep and dark, so the glow still reads. */
:root[data-glow][data-theme="dark"][data-tint="brown"] { --bg: #181009; --side: #100a06; --surface: #1e1611; --hover: #2e2117; --active: #3c2c1e; --border: #2e231a; --border-strong: #513c2c; --card: #1b140e; --input: #211912; }
:root[data-glow][data-theme="dark"][data-tint="red"] { --bg: #170608; --side: #0f0406; --surface: #1b1112; --hover: #291619; --active: #371e21; --border: #2b1b1c; --border-strong: #4a3033; --card: #191011; --input: #1d1415; }
:root[data-glow][data-theme="dark"][data-tint="pink"] { --bg: #15090e; --side: #0e0609; --surface: #1b1115; --hover: #2a161e; --active: #381d29; --border: #2b1a21; --border-strong: #4a3039; --card: #191014; --input: #1d1418; }
:root[data-glow][data-theme="dark"][data-tint="orange"] { --bg: #160e07; --side: #0e0905; --surface: #1c1510; --hover: #2b1f15; --active: #3a2a1c; --border: #2c2219; --border-strong: #4c3b2d; --card: #191410; --input: #1e1813; }
:root[data-glow][data-theme="dark"][data-tint="yellow"] { --bg: #161307; --side: #0e0c05; --surface: #1c1a10; --hover: #2d2714; --active: #3b341b; --border: #2d2918; --border-strong: #4e462c; --card: #1a170f; --input: #1e1b13; }
:root[data-glow][data-theme="dark"][data-tint="lightgreen"] { --bg: #0e130a; --side: #090c07; --surface: #151a12; --hover: #1e2719; --active: #283521; --border: #21291c; --border-strong: #394733; --card: #141811; --input: #181c15; }
:root[data-glow][data-theme="dark"][data-tint="green"] { --bg: #0b120e; --side: #080c0a; --surface: #131916; --hover: #1b261f; --active: #23322a; --border: #1f2722; --border-strong: #35443c; --card: #121714; --input: #161b18; }
:root[data-glow][data-theme="dark"][data-tint="lightblue"] { --bg: #0a1214; --side: #060c0d; --surface: #12191a; --hover: #172729; --active: #203436; --border: #1b292a; --border-strong: #314648; --card: #111718; --input: #141c1d; }
/* Glow mode: each page color's deep, dark version. */
:root[data-glow][data-theme="dark"][data-tint="blue"] { --bg: #090e14; --side: #06090e; --surface: #11151b; --hover: #171e29; --active: #1e2837; --border: #1b212b; --border-strong: #30394a; --card: #111318; --input: #14181d; }
:root[data-glow][data-theme="dark"][data-tint="purple"] { --bg: #0e0a13; --side: #09060c; --surface: #15121a; --hover: #1f1828; --active: #2a2135; --border: #221c29; --border-strong: #3b3347; --card: #141118; --input: #18151c; }
/* A few more things glow: the page you're on in the sidebar and tab bar, your own reactions, the
   pressed choice in a switch, your McPoints, the toast, Claim Gift and the swipe-to-reply arrow. */
:root[data-glow] .side-link.active, :root[data-glow] .side-hub.active, :root[data-glow] .tab.on { box-shadow: 0 0 14px -2px rgba(255, 255, 255, .22); }
:root[data-glow] .react.mine { box-shadow: 0 0 10px -1px rgba(255, 255, 255, .35); }
:root[data-glow] .seg-btn[aria-pressed="true"], :root[data-glow] .theme-mode[aria-pressed="true"] { box-shadow: 0 0 12px -2px rgba(255, 255, 255, .4); }
:root[data-glow] .mk-balance { box-shadow: 0 0 14px -4px rgba(255, 255, 255, .45); }
:root[data-glow] .toast { box-shadow: 0 0 22px rgba(255, 255, 255, .35); }
:root[data-glow] .bday-claim { box-shadow: 0 0 18px -2px var(--glow, rgba(255, 255, 255, .5)); }
:root[data-glow] .swipe-hint.ready { box-shadow: 0 0 12px rgba(255, 255, 255, .5); }
:root[data-glow] .recap-swing.up, :root[data-glow] .recap-swing.down { text-shadow: 0 0 10px currentColor; }
/* (a color banner gets a soft sheen, so it reads as a surface rather than a flat block) */
.profile-banner:not(:has(img)), span.banner-preview { background-image: linear-gradient(120deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .14)); }
.mod-limit input { height: 38px; padding: 0 8px; border-radius: 10px; }
/* A group chat's row on the moderation page: the smaller member count is nudged down so it sits
   on the same line as the group's name. */
.mod-group > summary > b + .muted { margin-top: 3.4px; }

/* On McHub (no pin row) a recommendation with a picture keeps its buttons on the picture's top
   right corner, on a small frosted backing, so they never sit on the title or crowd the picture's
   edge; the title then needs no room kept for them. */
.note.hub-item:has(.note-pic) .note-tools { top: 24px; right: 24px; padding: 2px; border-radius: 10px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(6px); }
.note.hub-item:has(.note-pic) .note-tools:empty { display: none; }
:root[data-theme="dark"] .note.hub-item:has(.note-pic) .note-tools { background: rgba(30, 30, 30, .78); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note.hub-item:has(.note-pic) .note-tools { background: rgba(30, 30, 30, .78); } }
.note.hub-item:has(.note-pic) .note-tools .icon-btn { color: var(--text-2); opacity: 1; }
.note.hub-item:has(.note-pic) .note-title { padding-right: 0 !important; }
.note-tools:empty { display: none; }

/* ---------- Hover life in the games ----------
   Anything you can play lifts a little under the pointer (with a slightly deeper shadow) and
   presses in when tapped on a phone: cards in your hand, Rummikub tiles on your turn, Codenames
   cards, and the game buttons. */
.pk-card, .c8-card, .rk-tile, .cdn-card, .pk-btn { transition: transform .14s ease, box-shadow .14s ease; }
@media (hover: hover) {
  button.c8-slot.ok:hover .c8-card, button.sp-pick:hover .pk-card, label.bs-pick:hover .pk-card { box-shadow: 0 8px 16px rgba(0, 0, 0, .28); }
  form.rk-form .rk-tile[data-rk-tile]:not(.sel):hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px #fbf5e6, 0 6px 12px rgba(0, 0, 0, .28); }
  button.cdn-card:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(0, 0, 0, .18); }
  button.pk-btn:not(:disabled):hover { transform: translateY(-1px); }
}
@media (hover: none) {
  /* Pressing a card or tile shrinks it slightly, like a real press. */
  button.c8-slot:active .c8-card, button.sp-pick:active .pk-card, label.bs-pick:active .pk-card, button.cdn-card:active, form.rk-form .rk-tile[data-rk-tile]:active, button.pk-btn:active { transform: scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
  .pk-card, .c8-card, .rk-tile, .cdn-card, .pk-btn { transition: none; }
  button.cdn-card:hover, form.rk-form .rk-tile[data-rk-tile]:hover, button.pk-btn:hover { transform: none; }
}
.rk-ghost { transition: none !important; } /* (the tile being dragged follows the finger exactly) */

/* ---------- Glow ----------
   The fourth appearance mode. The page goes as close to black as stays readable, and the things
   that carry color softly light up the page around them: everyone's colored outlines, pins and
   picture rings, names, the McNet logo, the Yes and No pills and chances, the gold, silver and
   bronze podium rings, game symbols, main buttons and unread counts. (It sits on top of dark mode:
   the page carries data-theme="dark" and data-glow.) */
:root[data-glow][data-theme="dark"] {
  --bg: #000000; --side: #040404; --surface: #0a0a0a; --card: #0a0a0a; --hover: #151515; --active: #1e1e1e;
  --border: #1c1c1c; --border-strong: #2b2b2b; --input: #0c0c0c; --board: #0b0a08; --card-border: #24211b;
  --text: #f2f2f2; --text-2: #b6b6b6; --text-3: #858585;
}
:root[data-glow] .brand { color: #ffffff; text-shadow: 0 0 6px rgba(255, 255, 255, .55), 0 0 22px rgba(255, 255, 255, .28); }
:root[data-glow][data-holiday] .brand { text-shadow: none; filter: drop-shadow(0 0 8px var(--flair)); }
:root[data-glow] .hub-item, :root[data-glow] .hub-wide { box-shadow: 0 0 16px -3px var(--glow, rgba(255, 255, 255, .18)); }
/* Glow mode: pins glow in their color. */
:root[data-glow] .pin { box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .18), inset 2px 2px 0 rgba(255, 255, 255, .35), 0 0 12px var(--glow, transparent); }
:root[data-glow] .av.ur { box-shadow: 0 0 10px var(--ring, transparent); }
:root[data-glow] .name, :root[data-glow] .me-name, :root[data-glow] .profile-name, :root[data-glow] .person-name { text-shadow: 0 0 10px color-mix(in srgb, currentColor 55%, transparent); }
:root[data-glow] .mk-pill.yes { box-shadow: 0 0 14px -2px var(--yes); } :root[data-glow] .mk-pill.no { box-shadow: 0 0 14px -2px var(--no); }
:root[data-glow] .mk-chance, :root[data-glow] .mk-big-n, :root[data-glow] .recap-swing { text-shadow: 0 0 14px color-mix(in srgb, currentColor 60%, transparent); }
:root[data-glow] .mk-line { filter: drop-shadow(0 0 4px currentColor); }
:root[data-glow] .mk-line.yes { color: var(--yes); } :root[data-glow] .mk-chart:not(.big) .mk-line.yes { color: var(--mk-line); }
:root[data-glow] .mk-chart.up:not(.big) .mk-line.yes { color: var(--yes); } :root[data-glow] .mk-chart.down:not(.big) .mk-line.yes { color: var(--no); }
:root[data-glow] .lb-row.podium .av { box-shadow: 0 0 14px var(--medal); }
/* Glow mode: the top three on leaderboards glow. */
:root[data-glow] .lb-row.podium .lb-rank { text-shadow: 0 0 10px var(--medal); }
:root[data-glow] .app .game-icon { box-shadow: 0 0 16px -4px var(--uc, transparent); }
:root[data-glow] .btn.primary, :root[data-glow] .icon-btn.send { box-shadow: 0 0 16px -2px rgba(255, 255, 255, .45); }
:root[data-glow] .badge { box-shadow: 0 0 10px rgba(255, 255, 255, .5); }
:root[data-glow] .note:not(.hub-item) { box-shadow: 0 0 0 1px var(--card-border); }
:root[data-glow] .read-progress { box-shadow: 0 0 10px var(--glow, transparent); }
:root[data-glow] .av-crown { filter: drop-shadow(0 0 6px rgba(232, 185, 49, .8)); }
/* ---------- Glow: the logo and the games ----------
   In Glow mode (a near-black page) things light up in their own colors. "drop-shadow" glows
   around a shape's outline; "box-shadow" with no offset glows around a box; --glow is set to a
   person's color by their color class (ub-name or uo-name), so pieces glow in their owner's color. */
/* The McNet logo: each fish glows in its own color (blue, then orange). */
:root[data-glow] .brand-mark { overflow: visible; }
/* (The glow is drawn by filters inside the logo's own drawing, given plenty of room all round, so
   it fades out softly instead of stopping at the edge of a box.) */
:root[data-glow] .brand-mark g:first-of-type { filter: url(#mc-glow-b); }
:root[data-glow] .brand-mark g:last-of-type { filter: url(#mc-glow-o); }
/* Whose turn it is: the seat outline glows softly, in every game. */
:root[data-glow] :is(.kc-seat, .sm-seat, .co-seat, .c8-seat, .ttt-seat, .rk-seat, .ud-seat, .bj-spot, .pk-seat).on { box-shadow: 0 0 18px -4px rgba(255, 255, 255, .45); }
/* Cards (poker-style, Crazy 8s, Kings Corner): a faint white halo. */
:root[data-glow] .pk-card:not(.back), :root[data-glow] .c8-card:not(.back) { box-shadow: 0 0 12px -3px rgba(255, 255, 255, .35), 0 1px 3px rgba(0, 0, 0, .5); }
:root[data-glow] .kc-table { box-shadow: 0 0 34px -8px rgba(154, 91, 62, .9), inset 0 0 0 6px #55291a; }
:root[data-glow] .kc-cell:has(.kc-grab input:checked) .kc-stack { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }
/* Tic-Tac-Toe, Connect 4, Checkers: marks and pieces glow in their player's color. */
:root[data-glow] .ttt-mark { filter: drop-shadow(0 0 5px currentColor); }
:root[data-glow] .ttt-cell.win { box-shadow: inset 0 0 0 3px currentColor, 0 0 18px -2px currentColor; }
:root[data-glow] .c4-disc:not(.seat) { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 0 12px -1px var(--glow, transparent); }
:root[data-glow] .c4-disc.alt:not(.seat) { box-shadow: inset 0 0 0 5px currentColor, 0 0 12px -1px currentColor; }
:root[data-glow] .ck-piece { filter: drop-shadow(0 0 6px var(--glow, currentColor)); }
/* Go: white stones shine; Battleship: hits flare red-orange. */
:root[data-glow] .go-stone.white:not(.seat) { box-shadow: 0 0 12px rgba(255, 255, 255, .55); }
:root[data-glow] .sb-hit { filter: drop-shadow(0 0 4px rgba(255, 110, 60, .95)); }
/* Hangman, 20 Questions, Group Chat Quiz: right answers glow. */
:root[data-glow] .hm-key.right, :root[data-glow] .cq-dot.right { box-shadow: 0 0 12px -1px rgba(255, 255, 255, .6); }
:root[data-glow] .tq-answer.tq-pick { box-shadow: 0 0 14px -2px currentColor; }
/* Rummikub: tiles glow faintly; Codenames: uncovered cards glow in their team's color. */
:root[data-glow] .rk-tile:not(.back) { box-shadow: 0 0 10px -3px rgba(255, 255, 255, .35); }
:root[data-glow] .cdn-card.open.k-red { box-shadow: 0 0 16px -3px #d64545; }
:root[data-glow] .cdn-card.open.k-blue { box-shadow: 0 0 16px -3px #2f6fde; }
/* Shmoenopoly: tokens, owners' lines and dice glow; the board's rim glows faintly green. */
:root[data-glow] .sm-board { box-shadow: inset 0 0 0 1px color-mix(in srgb, #2e9b57 30%, var(--bg)), 0 0 28px -10px rgba(46, 155, 87, .7); }
:root[data-glow] .sm-tok-svg { filter: drop-shadow(0 0 4px currentColor); }
:root[data-glow] .sm-tok.now .sm-tok-svg { filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 6px currentColor); }
:root[data-glow] .sm-own { box-shadow: 0 0 6px var(--glow, transparent); }
:root[data-glow] .sm-die, :root[data-glow] .co-coins .co-ic { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .45)); }
/* Coup: each character card glows in its own color. */
:root[data-glow] .co-card:not(.back):not(.lost) { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85), 0 0 16px -2px var(--cc); }
:root[data-glow] .co-act:not(:disabled), :root[data-glow] .co-chip { box-shadow: 0 0 12px -3px var(--cc, rgba(255, 255, 255, .5)); }
/* Unread counts: where the browser can trim a line of text down to the height of its digits
   (Safari 18.2+, Chrome 133+), the digits are centred in the dot exactly, whatever the device's
   font rendering; elsewhere the padding above does it. */
@supports (text-box: trim-both cap alphabetic) {
  .badge { padding: 0 5.6px 0 6.4px; line-height: 1; text-box: trim-both cap alphabetic; }
}

/* The back arrow above an article (the same small arrow as elsewhere, tucked up to the left). */
.content > .article-back { display: flex; width: 38px; margin: -12px 0 4px; transform: translateX(-10px); }
@media (min-width: 760px) { .content > .article-back { margin-left: calc(50% - 350px); margin-right: 0; } }
/* The message / edit button on a profile: full size. */
.people-page .profile-card .people-act { width: 44px; height: 44px; flex: none; }
.people-page .profile-card .people-act svg { width: 24px; height: 24px; }

/* ---------- Phones: profile and Profile settings ----------
   The three numbers on a profile sit side by side as compact tiles (number on top, label under it)
   instead of three tall full-width boxes; the picture is a size smaller; on the Profile page the
   McPoints pill drops under the name, and each setting's box and button share one row. */
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; margin-bottom: 22px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 12px 11px; border-radius: 14px; min-width: 0; }
  .stat b { font-size: 20px; }
  .stat small { font-size: 12.5px; line-height: 1.25; }
  .stat .stat-coin svg { width: 17px; height: 17px; }
  .people-page .profile-card .av-xl, .settings .profile-card .av-xl { width: 72px; height: 72px; font-size: 28px; }
  .profile-card.has-banner > div { padding-top: 36px; }
  /* Profiles with a banner: the buttons sit over the banner. */
  .people-page .profile-card.has-banner > .icon-btn { margin-top: 32px; }
  .settings .profile-card { flex-wrap: wrap; row-gap: 12px; }
  .settings .profile-card .mk-balance { margin-left: 0; order: 3; }
  .settings .profile-card > div { flex: 1 1 calc(100% - 90px); min-width: 0; }
  .row-form { flex-wrap: nowrap; }
  .row-form input[name="username"], #birthday input[type="date"] { flex: 1; min-width: 0; width: auto; }
  .row-form .btn { flex: none; }
}

/* ---------- Flicks and bios ---------- */
/* A flick: a small pill across the middle of the chat. */
.msg.flick-line { align-self: center; max-width: 100%; margin: 14px 0 4px; }
.flick-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: var(--hover); color: var(--text-2); font-size: 13px; }
.flick-pill svg { width: 16px; height: 16px; flex: none; }
.flick-pill .name { font-weight: 700; }
.flick-pill time { color: var(--text-3); font-size: 12px; }
.chat-head .flick-form { margin-left: 2px; }
/* the flick itself: the hand cocks back, snaps forward with a little overshoot, and a ring of
   air pops out from it */
.flick-btn { position: relative; overflow: visible; }
.flick-btn.flicking svg { animation: flick-snap .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes flick-snap { 0% { transform: none; } 30% { transform: rotate(-28deg) scale(.85); } 55% { transform: rotate(22deg) scale(1.25); } 75% { transform: rotate(-8deg) scale(1.05); } 100% { transform: none; } }
.flick-btn.flicking::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; pointer-events: none; animation: flick-pop .55s ease-out .16s; }
@keyframes flick-pop { 0% { opacity: .7; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.7); } }
@media (prefers-reduced-motion: reduce) { .flick-btn.flicking svg, .flick-btn.flicking::after { animation: none; } }
:root[data-glow] .flick-pill { box-shadow: 0 0 12px -2px rgba(255, 255, 255, .3); }
/* A bio on a profile, under the name, above the numbers. */
.profile-bio { margin: -6px 0 22px; font-size: 15px; line-height: 1.5; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.bio-form textarea { min-height: 84px; }
/* Chat list rows are a whole number of pixels tall (fractional heights left the unread dot
   half a pixel off the grid, so its number could look a touch off centre). */
.side-chat-name { line-height: 18px; }
.side-chat-last { line-height: 16px; }
.side-chat-meta .badge { flex: none; }

/* WHAT JUST CHANGED in a game (see app.js): a piece that just appeared or changed lifts slightly
   and glows for a moment. (Drawn pieces inside a board picture turn about their own middle.) */
@keyframes fx-new { 0% { transform: scale(1.14); filter: drop-shadow(0 0 7px color-mix(in srgb, var(--text) 70%, transparent)); } 100% { transform: none; filter: none; } }
.fx-new { animation: fx-new 1.3s cubic-bezier(.2,.8,.3,1); transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { .fx-new { animation: none; } }

/* CHAT STATS (/messages/stats): a card for each chart. The charts are drawings: the line and dots
   and bars take the text color; the faint lines behind are the border color. */
.st-card + .st-card { margin-top: 14px; }
.st-card { padding: 16px 18px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.st-card > .section-label { margin: 0 0 12px; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.st-head .section-label { margin: 0; }
.st-total { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--hover); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.st-total svg { width: 16px; height: 16px; }
/* A chart: the numbers up the side (a narrow drawing) and the chart itself, filling the rest. */
.st-chart { display: flex; gap: 6px; }
.st-y { flex: none; width: 36px; height: 214px; }
.st-plot { flex: 1; min-width: 0; height: 214px; overflow: visible; }
.st-y text, .st-x, .st-top { font-family: inherit; font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.st-top { fill: var(--text-2); font-weight: 600; }
.st-grid { stroke: var(--border); stroke-width: 1; }
.st-area path { fill: color-mix(in srgb, var(--text) 8%, transparent); }
.st-line { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.st-dot { fill: var(--surface); stroke: var(--text); stroke-width: 2.5; }
.st-dot:hover { fill: var(--text); }
.st-bar { fill: var(--text); opacity: .85; }
.st-bar:hover { opacity: 1; }
/* The word list: rank, word, a bar for how often it's used compared with the top word, and the count. */
.st-words { list-style: none; margin: 0; padding: 0; }
.st-word { display: grid; grid-template-columns: 26px minmax(70px, 150px) 1fr 52px; align-items: center; gap: 10px; min-height: 38px; border-bottom: 1px solid var(--border); font-size: 15px; }
/* (The rank, word and count are written the same way as on the leaderboards.) */
.st-rank { color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; font-weight: 700; }
.st-w { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-wbar { width: 100%; height: 8px; }
.st-wbar rect { fill: color-mix(in srgb, var(--text) 75%, transparent); }
.st-n { text-align: right; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* The Everyday Words switch: a pill, filled while on. Only one of the two word lists shows. */
.st-switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.st-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.st-switch span { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; color: var(--text-2); box-sizing: border-box; }
.st-switch input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.st-switch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.st-plain { display: none; }
.st-card:has(.st-common:not(:checked)) .st-all { display: none; }
.st-card:has(.st-common:not(:checked)) .st-plain { display: block; }
.st-more > summary { list-style: none; }
.st-more > summary::-webkit-details-marker { display: none; }
.st-more-sum { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding: 8px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.st-more-sum:hover { background: var(--hover); color: var(--text); }
.st-more-sum svg { width: 15px; height: 15px; transition: transform .15s; }
.st-more[open] .st-more-sum svg { transform: rotate(180deg); }
.st-more[open] .st-more-sum { margin-bottom: 4px; }
/* (When the rest of the list is open, the toggle moves to the bottom so it closes from there.) */
.st-more[open] { display: flex; flex-direction: column-reverse; }
@media (max-width: 560px) {
  .st-card { padding: 14px 12px 12px; }
  .st-word { grid-template-columns: 22px minmax(60px, 110px) 1fr 44px; gap: 8px; font-size: 14.5px; }
  .st-y { width: 30px; } .st-y text { font-size: 10px; } .st-x, .st-top { font-size: 10px; }
}
:root[data-glow] .st-line { filter: drop-shadow(0 0 4px rgba(255, 255, 255, .55)); }
:root[data-glow] .st-dot, :root[data-glow] .st-bar { filter: drop-shadow(0 0 5px rgba(255, 255, 255, .35)); }

/* ANNOUNCEMENTS on McHub: a normal card with a megaphone beside the title and a heavier outline
   in the text color, so it reads as coming from the moderators. */
.hub-announce, .recap-card { border-color: var(--text); }
/* (The delete button sits level with the title's first line.) */
.hub-announce .note-tools { top: 13px; right: 12px; }
.announce-title { display: flex; align-items: flex-start; gap: 8px; }
.note.hub-announce:has(.note-tools) .note-title { padding-right: 34px; }
.announce-ic { display: inline-flex; flex: none; margin-top: 2px; }
.announce-ic svg { width: 20px; height: 20px; }
/* The Notify Everyone tick box in the composer. */
.announce-notify { position: relative; display: inline-flex; align-self: flex-start; cursor: pointer; }
.announce-notify input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.announce-notify span { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); font-weight: 600; color: var(--text-2); }
.announce-notify span svg { width: 16px; height: 16px; }
.announce-notify input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.announce-notify input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
:root[data-glow] :is(.hub-announce, .recap-card) { box-shadow: 0 0 22px -8px rgba(255, 255, 255, .5); }

/* ---------- Paper War ----------
   The map is one drawing (SVG): terrain, grid lines, pen lines, buildings, units and the tiles
   you can tap. Everything around it uses the same pills, buttons and fold-out lists as the other
   games. Terrain and resource colors are the game's own; players' pieces are in their colors. */
.pw-L { --tc: #9fbf7a; } .pw-W { --tc: #6fa8c9; } .pw-F { --tc: #2f6b3a; } .pw-S { --tc: #e0c26b; } .pw-D { --tc: #2a4d78; }
.pw-M { --tc: #8a8a86; } .pw-I { --tc: #dcefee; } .pw-T { --tc: #6b5842; } .pw-B { --tc: #c8862f; }
.pw-r-timber { --rc: #3f8f4f; } .pw-r-metal { --rc: #4f7fb0; } .pw-r-oil { --rc: #caa93a; }
.pw-t { fill: var(--tc); }
.pw-head { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pw-round { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pw-tools { display: flex; gap: 2px; }
.pw-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
.pw-seat { gap: 6px; padding-right: 10px; }
.pw-seat.sent { border-color: var(--text); }
.pw-seat .sm-seat-name { max-width: 110px; }
.pw-cards { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pw-seat-ic { width: 15px; height: 15px; flex: none; }
.pw-board { display: flex; justify-content: center; width: 100%; margin: 0; }
.pw-svg { display: block; width: auto; height: auto; max-width: 100%; max-height: 78vh; border-radius: 14px; box-shadow: 0 0 0 1px var(--border-strong); color: var(--text); background: #9fbf7a; }
.pw-grid { fill: none; stroke: rgba(0, 0, 0, .14); stroke-width: .6px; vector-effect: non-scaling-stroke; }
.pw-deco { fill: rgba(0, 0, 0, .16); stroke: rgba(0, 0, 0, .38); stroke-width: .035; stroke-linejoin: round; }
.pw-ink-under { fill: none; stroke: #1a1410; stroke-opacity: .13; stroke-width: .15; stroke-linecap: round; stroke-linejoin: round; }
.pw-ink { fill: none; stroke-opacity: .85; stroke-width: .09; stroke-linecap: round; stroke-linejoin: round; }
.pw-razed { fill: none; stroke-width: .06; stroke-linecap: round; }
.pw-con > :first-child, .pw-body { stroke: #fff; stroke-width: .05; paint-order: stroke; }
.pw-mark { fill: #fff; } .pw-mark-line { stroke: #fff; stroke-width: .07; stroke-linecap: round; } .pw-mark-ring { fill: none; stroke: #fff; stroke-width: .08; }
.pw-ring { fill: none; stroke: #fff; stroke-width: .035; }
.pw-notch { fill: none; stroke: #fff; stroke-width: .05; stroke-linecap: round; stroke-linejoin: round; }
.pw-sel > * { fill: none; stroke: currentColor; stroke-width: .05; stroke-dasharray: .1 .07; }
.pw-hit { fill: rgba(255, 255, 255, .3); stroke: #fff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: pointer; animation: pw-hint 1.6s ease-in-out infinite; }
.pw-hit:hover, .pw-hit:focus-visible { fill: rgba(255, 255, 255, .5); outline: none; }
.pw-hit.quiet { fill: transparent; stroke: none; animation: none; }
.pw-hit.quiet:hover { fill: rgba(255, 255, 255, .22); }
@keyframes pw-hint { 50% { fill: rgba(255, 255, 255, .14); } }
@media (prefers-reduced-motion: reduce) { .pw-hit { animation: none; } }
.pw-hand { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.pw-res { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 11px; box-sizing: border-box; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); font-size: 13px; font-weight: 600; color: var(--text-2); }
.pw-res i, .pw-resbtn i, .pw-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--rc); flex: none; }
.pw-res b { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.pw-pips { display: inline-flex; gap: 5px; margin-left: 4px; }
.pw-pips i { width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.pw-pips i.used { background: var(--border-strong); }
.pw-choices, .pw-turn { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.pw-choices .pk-btn, .pw-turn .pk-btn { min-width: 0; height: 42px; font-size: 14px; }
.pw-choices .pk-btn small { font-size: 12px; font-weight: 600; color: var(--text-3); }
.pw-choices .pk-btn b { font-weight: 800; }
.pw-choices .pk-btn:disabled { opacity: .4; cursor: default; }
.pw-cancel { width: 42px; padding: 0; }
.pw-cancel svg { width: 18px; height: 18px; }
.pw-foe .av { flex: none; }
.pw-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; max-width: 640px; }
.pw-acts:empty { display: none; }
.pw-act { width: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 76px; line-height: 1.2; text-align: center; padding: 10px 6px 9px; box-sizing: border-box; border-radius: 14px; border: 1.5px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.pw-act:hover { background: var(--hover); }
.pw-act svg { width: 22px; height: 22px; }
.pw-act[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.pw-goal { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.pw-goal-ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; box-sizing: border-box; border-radius: 50%; border: 1.5px dashed var(--border-strong); color: var(--text-3); }
.pw-goal-ic svg { width: 17px; height: 17px; }
/* Lit once the round is late enough for the Monument. */
.pw-goal-ic.lit { border: 1.5px solid var(--text); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }
.pw-goal-chip:has(.av) { width: 28px; padding: 0; justify-content: center; overflow: hidden; }
.pw-goal-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; box-sizing: border-box; border-radius: 999px; border: 1.5px dashed var(--border-strong); font-size: 12.5px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pw-goal-chip:has(.av) .av { width: 100%; height: 100%; flex: none; opacity: .45; filter: grayscale(1); }
/* (A person in the row fills their circle completely, edge to edge.) */
.pw-goal-chip.ok { border-style: solid; border-color: var(--text); color: var(--text); }
.pw-goal-chip.ok .av { opacity: 1; filter: none; }
.pw-result { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--text); font-weight: 700; font-size: 14px; }
.pw-result.lost { border-color: var(--border-strong); color: var(--text-2); }
.pw-result svg { width: 18px; height: 18px; }
.pw-fight { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 440px; padding: 14px; box-sizing: border-box; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.pw-fight-row { display: grid; grid-template-columns: 96px auto 26px; align-items: center; gap: 12px; }
.pw-fight-who { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.pw-cards3 { display: flex; gap: 8px; }
.pw-card { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 74px; padding: 0; box-sizing: border-box; border-radius: 10px; border: 1.5px solid var(--border-strong); background: var(--card); color: var(--text); font: inherit; }
.pw-card svg { width: 32px; height: 32px; }
.pw-card.back { background: repeating-linear-gradient(45deg, var(--hover) 0 6px, var(--active) 6px 12px); }
button.pw-card { cursor: pointer; }
button.pw-card:hover { border-color: var(--text); transform: translateY(-2px); }
.pw-card.struck { border-style: dashed; }
.pw-card.slot { border-style: dashed; color: var(--text-3); }
button.pw-card.slot:hover { color: var(--text); }
.pw-card.exposed.struck { background: var(--text); color: var(--bg); border-style: solid; border-color: var(--text); }
.pw-evs { display: flex; gap: 8px; justify-content: center; }
.pw-ev { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.pw-ev > svg { width: 16px; height: 16px; margin-left: 3px; }
.pw-ev.hit { border-color: var(--text); color: var(--text); }
.pw-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-segopt, .pw-brush { position: relative; display: inline-flex; }
.pw-segopt input, .pw-brush input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pw-segopt span, .pw-brush span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; box-sizing: border-box; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; }
.pw-segopt span:has(.av) { padding-left: 4px; }
.pw-segopt input:checked + span, .pw-brush input:checked + span { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.pw-segopt input:checked + span .name { color: inherit; }
.pw-segopt input:disabled + span { opacity: .4; }
.pw-segopt input:focus-visible + span, .pw-brush input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.sm-history li.pw-log-round { display: block; padding: 12px 4px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pw-log .sm-history:empty::after { content: ""; }
.pw-mapname { margin-top: -8px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.pw-lobby-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pw-bot-1 { color: #d64545; } .pw-bot-2 { color: #2f6fde; } .pw-bot-3 { color: #2e9b57; } .pw-bot-4 { color: #e08a1e; } .pw-bot-5 { color: #8a4fd6; } .pw-bot-6 { color: #d6458f; } .pw-bot-7 { color: #1a9aa0; } .pw-bot-8 { color: #8a5a2b; } .pw-bot-9 { color: #5b6472; } .pw-bot-10 { color: #b59a00; }
.pw-botbg-1 { background: #d64545; } .pw-botbg-2 { background: #2f6fde; } .pw-botbg-3 { background: #2e9b57; } .pw-botbg-4 { background: #e08a1e; } .pw-botbg-5 { background: #8a4fd6; } .pw-botbg-6 { background: #d6458f; } .pw-botbg-7 { background: #1a9aa0; } .pw-botbg-8 { background: #8a5a2b; } .pw-botbg-9 { background: #5b6472; } .pw-botbg-10 { background: #b59a00; }
[class*="pw-botbg-"] { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; flex: none; }
[class*="pw-botbg-"] svg { width: 64%; height: 64%; }
/* The host screen: the round in large type over the map, sized for a TV. */
.host-screen .pw-host { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.pw-host-round .game-status { font-size: clamp(30px, 5vw, 64px); font-weight: 800; letter-spacing: -.01em; }
.pw-host .pw-svg { max-height: calc(100vh - 230px); }
.pw-host-win { display: flex; align-items: center; gap: 10px; font-size: clamp(18px, 2.4vw, 30px); font-weight: 700; }
/* The setup page: the maps as picture cards, then the Map Editor and Debug buttons. */
.setup-cards { display: block; flex: 1 1 100%; margin: 0; padding: 0; border: 0; min-width: 0; }
.setup-cards legend { width: 100%; padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.setup-card { position: relative; display: flex; }
.setup-card input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.setup-card > span { display: flex; flex-direction: column; gap: 3px; width: 136px; padding: 8px 8px 9px; box-sizing: border-box; border-radius: 14px; border: 1.5px solid var(--border); background: var(--card); }
.setup-card input:checked + span { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.setup-card input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.setup-card b { margin-top: 4px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-card small { font-size: 12px; color: var(--text-3); font-weight: 600; }
.pw-thumb { display: block; width: 100%; height: 84px; border-radius: 8px; }
.pw-setup-tools { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
/* The Map Editor. */
.pw-editor { display: flex; flex-direction: column; gap: 14px; }
.pw-ed-fields .setup-text { flex: 1 1 220px; }
.pw-ed-fields input[type="number"] { width: 90px; }
.pw-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-sw { width: 14px; height: 14px; border-radius: 4px; background: var(--tc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.pw-ed-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 1px; width: 100%; max-width: 560px; margin: 0 auto; padding: 1px; box-sizing: border-box; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .14); box-shadow: 0 0 0 1px var(--border-strong); touch-action: none; user-select: none; -webkit-user-select: none; }
.pw-ed-grid i { display: block; aspect-ratio: 1; background: var(--tc); cursor: crosshair; }
.pw-ed-foot { display: flex; justify-content: flex-end; }
.pw-maplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pw-maprow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pw-maprow .pw-thumb { width: 72px; height: 48px; flex: none; }
.pw-maprow-name { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pw-maprow-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-maprow-name small { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.pw-maprow form { margin: 0; }
@media (max-width: 560px) {
  .pw-acts { gap: 6px; }
  .pw-act { width: calc((100% - 18px) / 4); height: 68px; font-size: 11.5px; padding: 8px 2px 7px; }
  .pw-fight-row { grid-template-columns: 64px auto 22px; gap: 8px; }
  .pw-card { width: 48px; height: 66px; }
  .pw-seat .sm-seat-name { display: none; }
  .setup-card > span { width: calc((100vw - 52px) / 2); max-width: 160px; }
}
/* Glow mode: pieces, pen lines and tappable tiles glow in their own colors. */
:root[data-glow] .pw-piece { filter: url(#pw-glow); }
:root[data-glow] .pw-hit:not(.quiet) { filter: url(#pw-glow); }
:root[data-glow] .pw-svg { box-shadow: 0 0 0 1px color-mix(in srgb, #9fbf7a 35%, var(--bg)), 0 0 30px -10px rgba(159, 191, 122, .75); }
:root[data-glow] .pw-act[aria-pressed="true"], :root[data-glow] .pw-seat.sent, :root[data-glow] .pw-goal-chip.ok, :root[data-glow] .pw-result:not(.lost) { box-shadow: 0 0 14px -3px rgba(255, 255, 255, .45); }
:root[data-glow] .pw-res i, :root[data-glow] .pw-dot, :root[data-glow] .pw-resbtn i { box-shadow: 0 0 8px var(--rc); }
:root[data-glow] .pw-card.exposed.struck, :root[data-glow] .pw-ev.hit { box-shadow: 0 0 14px -2px rgba(255, 255, 255, .55); }
:root[data-glow] .setup-card input:checked + span { box-shadow: 0 0 0 1px var(--text), 0 0 16px -3px rgba(255, 255, 255, .45); }
:root[data-glow] .pw-host-round .game-status { text-shadow: 0 0 18px rgba(255, 255, 255, .45); }
/* Paper War: a little wider for the map; the host screen as wide as the screen allows. */
.content > .game-page:has(.pw-board), .content > .game-page:has(.pw-editor) { max-width: 820px; }
.content > .game-page:has(.pw-host) { max-width: 1400px; }

/* Paper War: the base letters and the facility symbols on the map. */
.pw-letter { fill: #fff; font-size: .46px; font-weight: 800; text-anchor: middle; letter-spacing: -.01px; }
/* The Exchange: a button with the actions that opens the trade panel (the bank or another player). */
.pw-actarea { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.pw-ex-toggle { display: none; }
.pw-ex { display: none; max-width: 640px; }
.pw-actarea:has(.pw-ex-toggle:checked) .pw-ex { display: flex; }
.pw-actarea:has(.pw-ex-toggle:checked) .pw-ex-btn { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.pw-ex-btn { cursor: pointer; user-select: none; }
.pw-ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.pw-ex .sm-side.pw-get { padding-left: 18px; border-left: 1px solid var(--border); }
.pw-ex .pw-ex-trade { display: none; }
.pw-ex:has(input[name="to"]:not([value="bank"]):checked) .pw-ex-trade { display: flex; }
.pw-ex:has(input[name="to"]:not([value="bank"]):checked) .pw-ex-bank { display: none; }
.pw-bankpick { padding-left: 4px; }
.pw-bank-ic { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--hover); }
.pw-bank-ic svg { width: 15px; height: 15px; }
.pw-money { gap: 6px; padding-left: 11px; }
.pw-money input { width: 44px; }
.sm-chip .pw-dot { margin-right: 2px; }
.pw-offers { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
@media (max-width: 560px) {
  .pw-ex-grid { grid-template-columns: 1fr; }
  .pw-ex .sm-side.pw-get { padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px solid var(--border); }
}
/* The map's animations: pieces that are gone fade away; on the host screen each battle shows a
   ring in the winner's color with crossed swords, and a bomb blast a ring spreading out. */
.pw-ghost { pointer-events: none; transform-box: fill-box; transform-origin: center; }
.pw-fx { opacity: 0; pointer-events: none; transform-box: fill-box; transform-origin: center; }
.pw-fx-ring { fill: none; stroke-width: .07; }
.pw-fx-disc { fill: rgba(20, 20, 20, .72); }
.pw-fx-swords { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pw-blast circle { fill: none; stroke-width: .12; }
.pw-clash.go { animation: pw-clash 1.9s cubic-bezier(.2,.8,.3,1) .6s both; }
.pw-blast.go { animation: pw-blast 1.2s ease-out .5s both; }
@keyframes pw-clash { 0% { opacity: 0; transform: scale(.4); } 18% { opacity: 1; transform: scale(1.08); } 30% { transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15); } }
@keyframes pw-blast { 0% { opacity: .95; transform: scale(.15); } 100% { opacity: 0; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pw-fx.go { animation: none; } }
:root[data-glow] .pw-fx-ring, :root[data-glow] .pw-blast circle { filter: url(#pw-glow); }
:root[data-glow] .pw-goal-ic.lit { box-shadow: 0 0 14px -2px rgba(255, 255, 255, .6); }
:root[data-glow] .pw-actarea:has(.pw-ex-toggle:checked) .pw-ex-btn { box-shadow: 0 0 14px -3px rgba(255, 255, 255, .45); }
/* The setup page's picture cards can fold up to their first row (the chosen card moves first). */
.setup-cards legend { display: flex; align-items: center; justify-content: space-between; }
.setup-cards-fold { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; color: var(--text-2); cursor: pointer; }
.setup-cards-fold:hover { background: var(--hover); color: var(--text); }
.setup-cards-fold input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.setup-cards-fold svg { transition: transform .15s; transform: rotate(180deg); }
.setup-cards-fold:has(input:checked) svg { transform: none; }
.setup-cards-fold:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.setup-cards-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px; margin: -2px; }
.setup-cards:has(.setup-cards-fold input:checked) .setup-cards-list { max-height: 156px; overflow: hidden; }
.setup-cards:has(.setup-cards-fold input:checked) .setup-card:has(input:checked) { order: -1; }
.setup-card > span { height: 152px; }
.setup-card > span > * { flex: none; }

/* Phones: a game with three buttons at the top right (like Paper War's pencil, link and flag) and
   the host screen button: slightly tighter spacing so everything stays on one line. */
@media (max-width: 480px) {
  .game-page:has(.game-resign button:nth-of-type(3)) .game-head { gap: 8px; padding-right: 108px; }
}
.pw-ex .sm-pick.off { opacity: .4; }
.pw-ex .sm-pick.off input { cursor: default; }
/* The way out of full screen: only shown while the host screen fills the screen. */
.full-exit { display: none; }
#game:fullscreen .full-exit, .game-full #game .full-exit { display: inline-flex; position: fixed; top: 16px; right: 16px; z-index: 1002; background: var(--surface); }
.game-full .full-btn { display: none; }
/* (The Exchange shares Shmoenopoly's trade panel, but only its Get column has the divider.) */
.pw-ex.sm-trade .sm-side:not(.pw-get) { padding: 0; border: 0; }
