/* Chess UI - zero-build static styling. Layout: board left, side panel right.
   Design tokens follow DESIGN-ux-online §C (lichess-sourced values; board
   palette stays the verified lichess brown #f0d9b5/#b58863, chrome is the
   warm-shifted set). */

:root {
  /* Board sizing (DESIGN-ux-online P0-5, after lila _uniboard.scss): the
     board fits BOTH the viewport height (header + clocks + status ≈ 220px)
     and the space left beside the 340px panel (416px of chrome). */
  /* 300px reserved: topbar + two clock rows (~0.9*sq each) + status + padding;
     at sq=96 the old 220px term caused a few dozen px of page scroll (UX audit). */
  --sq-size: clamp(34px, min(9vmin, calc((100vh - 300px) / 8), calc((100vw - 416px) / 8)), 96px);
  --sq-light: #f0d9b5;
  --sq-dark: #b58863;
  --bg: hsl(37 10% 8%);      /* lichess page bg  */
  --panel: hsl(37 7% 14%);   /* lichess box bg  */
  --low: #1d1c18;            /* inputs, clock faces, move list */
  --edge: #423f38;           /* borders (lichess ~25% ink) */
  --ink: #d5d1c8;            /* primary text (warm 73%) */
  --ink-dim: #a09a8d;        /* secondary text (warm 58%) */
  --ink-faint: #767063;      /* move numbers, dt labels */
  --accent: #ffd34d;         /* warm yellow: brand hover + focus rings ONLY;
                                highlights use the green/red families below */
  --good: #629924;
  --warn: #d64f00;
  --danger: #ff5b5b;
  /* lichess clock states (_clock.scss): running = c-secondary over bg,
     <10s = c-bad 25%/50% over bg */
  --clock-active: #384822;
  --clock-urgent: #502832;
  --clock-urgent-active: #792c2a;
  /* coordinates (_boards.scss "brown" palette) */
  --coord-on-light: #946f51;
  --coord-on-dark: #f0d9b5;
  /* highlight set (_chessground.scss) */
  --hi-last-move: rgb(155 199 0 / .41);
  --hi-selected: rgb(20 85 30 / .5);
  --hi-legal-hover: rgb(20 85 30 / .3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 1.25rem;
}

.app {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  max-width: 1100px;
}

/* ------------------------------------------------------------ shell / router */

.shell { display: flex; flex-direction: column; gap: 1rem; width: 100%; align-items: center; }
.view { width: 100%; display: flex; flex-direction: column; align-items: center; }
.view[hidden] { display: none; }

.topbar {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { margin: 0; font-size: 1.35rem; }
.brand a { color: var(--ink); text-decoration: none; }
.brand a:hover { color: var(--accent); } /* warm-yellow brand hover is allowed */

.chip {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--low);
  color: var(--ink-dim);
}
.chip[hidden] { display: none; }
.chip-ok   { color: #9fe39a; border-color: #3f6f45; }
.chip-warn { color: #e58a3d; border-color: #7a4a1f; animation: pulse 1.4s ease-in-out infinite; }
.chip-bad  { color: #ff8d8d; border-color: #7a3b3b; }

.tagline { color: var(--ink-dim); margin: 0 0 1rem; text-align: center; }

/* Public live-activity pill under the landing tagline. */
.live-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: -0.25rem 0 1rem;
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: linear-gradient(180deg, #292620, var(--low));
  color: var(--ink-dim);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.03);
}
.live-stats[hidden] { display: none; }
.live-stats-knight { color: var(--accent); font-size: 1rem; line-height: 1; }
.live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: 0 0 0 3px rgb(255 255 255 / 0.04);
}
.live-stats #live-stats-text { color: var(--ink); }
.live-stats[data-state="live"] .live-dot {
  background: #79d19a;
  box-shadow: 0 0 0 3px rgb(121 209 154 / 0.15);
  animation: pulse 1.8s ease-in-out infinite;
}
.live-stats[data-state="waiting"] .live-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(255 211 77 / 0.15);
}

/* ------------------------------------------------------------ landing cards */

.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
}
.card {
  background: var(--panel);
  border-radius: 10px;
  padding: 1rem 1.2rem 1.2rem;
}
.card h2 { margin: 0 0 0.8rem; font-size: 1.1rem; }
.card hr { border: none; border-top: 1px solid var(--edge); margin: 1rem 0; }
/* #room-preview is in the aside .panel, not a .card - without this the
   nickname input fell through to the UA default white field (screenshot). */
.card input[type="text"], .card input:not([type]), #room-preview input {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: var(--low);
  color: var(--ink);
  font: inherit;
}
.linkrow { display: flex; gap: 0.4rem; margin: 0.2rem 0 0.7rem; }
.linkrow[hidden] { display: none; } /* author `display:flex` would otherwise beat the UA [hidden] rule (P0-4 fallback state) */
.linkrow input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.78rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: var(--low);
  color: var(--ink);
}
.code-line { margin: 0.4rem 0; color: var(--ink-dim); }
.code-line code { color: var(--accent); font-size: 1.05rem; letter-spacing: 0.08em; }

.error { color: #ff8d8d; font-size: 0.85rem; margin: 0.5rem 0 0; }
.error[hidden] { display: none; }
.muted { color: var(--ink-dim); font-size: 0.9rem; }
.muted[hidden] { display: none; }

.btnlink {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: #37342c;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
}
.btnlink:hover { background: #46423a; }
.btnlink.big { font-size: 1.05rem; }

/* ------------------------------------------------------------ clock bar */

.clock-slot { width: calc(100% - 8px); max-width: calc(var(--sq-size) * 8); margin: 0 auto; }
.clock-slot[hidden] { display: none; }

/* lichess .rclock hierarchy (DESIGN-ux-online P1-7): the time is the hero
   (scales with the board), the name is quiet, states carry color. */
.clock-face {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  background: var(--low);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  margin: 0.35rem 0;
}
.clock-name { color: var(--ink-dim); font-size: calc(var(--sq-size) * 0.2); }
.clock-time {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-size: calc(var(--sq-size) * 0.42);
}
.clock-face.clock-active { background: var(--clock-active); border-color: #55702f; }
.clock-face.clock-active .clock-time { color: #fff; font-weight: 700; }
/* idle clock reads as background chrome; the ticking one is the hero (lichess .rclock) */
.clock-face:not(.clock-active) .clock-time { color: var(--ink-dim); }
.clock-face.clock-urgent { background: var(--clock-urgent); border-color: #7a3b3b; }
.clock-face.clock-urgent .clock-time {
  color: #fff;
  font-weight: 700;
  animation: clock-pulse 1s ease-in-out infinite;
}
.clock-face.clock-urgent.clock-active { background: var(--clock-urgent-active); }
/* increment landed: one-shot green flash (clockface.js adds the class) */
.clock-face.clock-inc { animation: inc-flash 0.5s ease-out; }
@keyframes inc-flash { from { background: #4e7a3a; } to { background: transparent; } }
@keyframes clock-pulse { 50% { opacity: 0.45; } }

/* RULE 1 (PLAN §4 addendum): idle copy under a DORMANT clocked game's bar -
   both faces full and quiet until the first White move starts the clock. */
.clock-note { text-align: center; margin: 0.1rem 0 0.4rem; }

.tc-label { margin: 0 0 0.6rem; color: var(--ink-dim); font-size: 0.85rem; }
.tc-label[hidden] { display: none; }

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

.board {
  display: grid;
  grid-template-columns: repeat(8, var(--sq-size));
  grid-template-rows: repeat(8, var(--sq-size));
  border: 4px solid #33302a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  user-select: none;
  touch-action: manipulation;
}

.square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sq-light { background: var(--sq-light); }
.sq-dark  { background: var(--sq-dark); }

.square:hover { filter: brightness(1.06); }

.piece {
  font-size: calc(var(--sq-size) * 0.74);
  line-height: 1;
  z-index: 1;
  pointer-events: none;
}
.piece-white {
  color: #fafafa;
  text-shadow: 0 0 2px #000, 0 1px 2px rgba(0, 0, 0, 0.7);
}
.piece-black {
  color: #15181e;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Coordinates (P0-2, lichess "coords-in"): ranks on the left column, files
   on the bottom row, drawn inside the squares. */
.coord {
  position: absolute;
  font-size: calc(var(--sq-size) * 0.24);
  line-height: 1;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}
.coord-rank { top: 3%; left: 4%; }
.coord-file { bottom: 3%; left: 4%; }
.sq-light .coord { color: var(--coord-on-light); }
.sq-dark  .coord { color: var(--coord-on-dark); }

/* Highlights (P1-6 lichess set). Overlays use inset box-shadow spread so
   they compose and never cover the piece glyph (glyphs sit at z-index 1);
   the check radial uses background-image so it layers with the shadow
   markers. Order matters where two markers share a square: .check after
   .last-move so a king that moves into discovered check stays red. */
.square.last-move { box-shadow: inset 0 0 0 999px var(--hi-last-move); }
.square.selected  { box-shadow: inset 0 0 0 999px var(--hi-selected); }
.square.check {
  background-image: radial-gradient(circle,
    rgb(224 49 49 / .55) 0%, rgb(224 49 49 / .3) 25%, transparent 89%);
}

.square.legal::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  /* lichess move-dest dot */
  background: radial-gradient(rgb(20 85 30 / .5) 19%, transparent 20%);
  z-index: 1;
}
.square.legal:hover { background-image: linear-gradient(var(--hi-legal-hover), var(--hi-legal-hover)); }
.square.legal-capture::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 4px solid rgb(20 85 30 / .45);
  border-radius: 50%;
  z-index: 1;
}

/* P2 move arrival: board.js adds .mv-arrive to the destination square only
   when the rendered lastMove differs from what the container showed last
   (clock sweeps and selection repaints never re-animate). The landed glyph
   drops in from just above its square and settles - a slide into the cell
   without moving DOM nodes. */
.square.mv-arrive .piece { animation: piece-arrive 0.22s ease-out; }
@keyframes piece-arrive {
  from { transform: translateY(-30%) scale(1.1); opacity: 0.35; }
  60% { transform: translateY(0) scale(1.05); opacity: 1; }
  to { transform: none; opacity: 1; }
}

/* ------------------------------------------------------------ status / panel */

.board-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status {
  margin: 0.9rem 0 0;
  font-size: 1.15rem;
  min-height: 1.5em;
  text-align: center;
}

.thinking {
  margin: 0.4rem 0 0;
  color: var(--warn);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; } }

/* Waiting-room share block (P0-4). */
.share {
  margin: 1rem auto 0;
  width: calc(100% - 8px);
  max-width: calc(var(--sq-size) * 8);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 0.8rem 1rem 0.9rem;
}
.share[hidden] { display: none; }
.share-lead { margin: 0.4rem 0 0.1rem; font-size: 0.85rem; color: var(--ink-dim); }
.share .code-chip input {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--ink);
}

/* Structured join preview (P1-9). */
.preview-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.7rem;
  margin: 0.4rem 0 0.6rem;
}
.preview-dl dt { color: var(--ink-faint); font-size: 0.85rem; }
.preview-dl dd { margin: 0; font-size: 0.92rem; }

.panel {
  background: var(--panel);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  min-width: 280px;
  max-width: 340px;
  flex: 1;
}
.panel h1 { margin: 0 0 0.8rem; font-size: 1.4rem; }
.panel h2 { margin: 1.1rem 0 0.4rem; font-size: 1rem; color: var(--ink-dim); }

.controls { display: grid; gap: 0.45rem; }
.controls label { font-size: 0.85rem; color: var(--ink-dim); }
/* AI-level wrapper (main.js hides it in two-player mode): the inner grid
   keeps the .controls rhythm; the author display:grid would otherwise beat
   the UA [hidden] rule (same trap as .linkrow above). */
#level-row { display: grid; gap: 0.45rem; }
#level-row[hidden] { display: none; }
.controls select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: var(--low);
  color: var(--ink);
  font: inherit;
}
/* P2 TC quick-pick chips (landing.js mountTcChips): one click sets the
   select above - the select stays authoritative, so chips are pure input
   affordance. Highlight follows the select value (.on + aria-pressed). */
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip-tc {
  padding: 0.22rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 999px;
  background: var(--low);
  color: var(--ink-dim);
}
.chip-tc.on { background: var(--clock-active); color: var(--ink); border-color: var(--ink-dim); }

.buttons { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; justify-content: center; }
button {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: #37342c;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #46423a; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
/* Inline two-step confirm for destructive actions (room-client armConfirm):
   the first click recolors and relabels the button itself, the second fires. */
button.armed { background: var(--danger); border-color: var(--danger); color: #1c1a16; font-weight: 600; }

/* Two-column move list (P1-8): number + White + Black, current move
   highlighted, unconfirmed optimistic SAN dimmed. */
.moves {
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  max-height: 46vh;
  overflow-y: auto;
  font-variant-numeric: tabular-nums;
  background: var(--low);
  border-radius: 6px;
}
.mv { display: grid; grid-template-columns: 2.6em 1fr 1fr; align-items: baseline; }
.mv-no { color: var(--ink-faint); }
.mv-w, .mv-b { padding: 0.12rem 0.3rem; border-radius: 4px; }
.mv .cur { background: rgb(98 153 36 / .3); }
.mv .pending { opacity: 0.6; }
/* P2 review: the LOCAL move list doubles as a scrubber - confirmed SANs
   carry data-ply (movelist.js) and main.js delegates clicks on #moves-play.
   The room list renders the same rows but is never wired, so it gets no
   clickable affordance (room-view replay is the follow-up). */
#moves-play .mv-w[data-ply], #moves-play .mv-b[data-ply],
#room-moves .mv-w[data-ply], #room-moves .mv-b[data-ply] { cursor: pointer; }
#moves-play .mv-w[data-ply]:hover, #moves-play .mv-b[data-ply]:hover,
#room-moves .mv-w[data-ply]:hover, #room-moves .mv-b[data-ply]:hover { background: rgb(213 209 200 / .12); }
/* The review nav row (#review-bar) carries no author display of its own,
   so the UA [hidden] rule works without the wrapper guard (#level-row
   trap only applies when the hidden element itself gets display). */

/* ------------------------------------------------------------ promotion modal */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 8, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.overlay[hidden] { display: none; }

.overlay-box {
  background: var(--panel);
  padding: 1.1rem 1.3rem;
  border-radius: 10px;
  max-width: min(92vw, 640px);
  border: 1px solid var(--edge);
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.overlay-box p { margin: 0 0 0.8rem; font-size: 1.05rem; }
.end-buttons { justify-content: center; margin-top: 0; }

.promo-buttons { display: flex; gap: 0.5rem; }
.promo-buttons button {
  font-size: 2.6rem;
  line-height: 1;
  width: 4rem;
  height: 4rem;
  padding: 0.2rem;
}
#promo-cancel { margin-top: 0.8rem; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 720px) {
  :root { --sq-size: clamp(34px, calc((100vw - 48px) / 8), 52px); }
  .app { flex-direction: column; align-items: center; }
  .board-area { display: flex; flex-direction: column; align-items: center; width: 100%; }
  .panel { max-width: 100%; min-width: 0; width: 100%; }
  .moves { max-height: 30vh; }
}

@media (prefers-reduced-motion: reduce) {
  /* kill the looping pulses; the color changes carry the state instead.
     .mv-arrive is one-shot, but users asking for no motion get no motion:
     the .last-move tint already marks the destination (board.js keeps
     adding the class regardless of animation). */
  .clock-face.clock-urgent .clock-time, .chip-warn, .thinking,
  .live-stats[data-state="live"] .live-dot,
  .square.mv-arrive .piece { animation: none; }
}

/* ------------------------------------------------------------ icon polish */

.brand a { display: inline-flex; align-items: center; gap: 0.45rem; }
.brand-knight {
  color: var(--accent);
  font-size: 1.3em;
  line-height: 1;
  transform: rotate(-7deg);
  transition: transform 0.18s ease;
}
.brand a:hover .brand-knight { transform: rotate(7deg) scale(1.12); }

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.card[data-card="ai"]     { --card-accent: #b9a3ff; --icon-bg: #2f2a49; }
.card[data-card="local"]  { --card-accent: #79d19a; --icon-bg: #233b2e; }
.card[data-card="online"] { --card-accent: #ffd34d; --icon-bg: #453a1c; }
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--card-accent), transparent);
  opacity: 0.85;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--card-accent);
}
.card h2 { display: flex; align-items: center; gap: 0.55rem; }
.card-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--icon-bg);
  border: 1px solid color-mix(in srgb, var(--card-accent) 45%, transparent);
  font-size: 1.25rem;
  line-height: 1;
  transform: rotate(-4deg);
  transition: transform 0.18s ease;
}
.card:hover .card-icon { transform: rotate(6deg) scale(1.08); }

/* Decorative emoji prefixes: textContent stays untouched (tests/ARIA copy). */
:is(#go-ai, #go-local, #go-online, #go-join, #open-room, #btn-new, #btn-undo,
    #btn-resign, #btn-resign-room, #btn-flip, #btn-flip-room, #btn-mute, #btn-mute-room,
    #btn-draw, #btn-draw-accept, #btn-draw-decline, #btn-reclaim-seat,
    #btn-close-room, #btn-join, #end-review, #end-rematch, #end-rematch-local,
    #end-newroom, #rev-exit, #room-rev-exit, #promo-cancel)::before,
button[data-copy]::before,
.btnlink[href="#/"]::before {
  display: inline-block;
  margin-right: 0.4em;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 0.95em;
  line-height: 1;
  transition: transform 0.15s ease;
}
:is(#go-ai, #go-local, #go-online, #go-join, #open-room, #btn-new, #btn-undo,
    #btn-resign, #btn-resign-room, #btn-flip, #btn-flip-room, #btn-mute, #btn-mute-room,
    #btn-draw, #btn-draw-accept, #btn-draw-decline, #btn-reclaim-seat,
    #btn-close-room, #btn-join, #end-review, #end-rematch, #end-rematch-local,
    #end-newroom, #rev-exit, #room-rev-exit, #promo-cancel):hover:not(:disabled)::before,
button[data-copy]:hover::before,
.btnlink[href="#/"]:hover::before { transform: scale(1.16) rotate(-8deg); }

#go-ai::before             { content: "🎮"; }
#go-local::before          { content: "👥"; }
#go-online::before         { content: "✨"; }
#go-join::before,
#open-room::before,
#btn-join::before          { content: "🚪"; }
#btn-new::before           { content: "✨"; }
#btn-undo::before          { content: "↩️"; }
#btn-resign::before,
#btn-resign-room::before   { content: "🏳️"; }
#btn-flip::before,
#btn-flip-room::before     { content: "🔄"; }
#btn-mute::before, #btn-mute-room::before          { content: "🔊"; }
#btn-mute[aria-pressed="true"]::before,
#btn-mute-room[aria-pressed="true"]::before { content: "🔇"; }
#btn-draw::before          { content: "🤝"; }
#btn-draw-accept::before   { content: "✅"; }
#btn-draw-decline::before  { content: "❌"; }
#btn-reclaim-seat::before  { content: "🔑"; }
#btn-close-room::before    { content: "🗑️"; }
#end-review::before        { content: "🔍"; }
#end-rematch::before,
#end-rematch-local::before { content: "🔁"; }
#end-newroom::before       { content: "🆕"; }
#rev-exit::before,
#room-rev-exit::before     { content: "↩️"; }
#promo-cancel::before      { content: "✖️"; }
button[data-copy]::before  { content: "📋"; }
.btnlink[href="#/"]::before { content: "🏠"; }

.end-icon {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 0.7rem;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: radial-gradient(circle at 30% 25%, #4d4430, var(--low) 70%);
  font-size: 1.75rem;
  line-height: 1;
  animation: end-icon-pop 0.3s ease-out;
}
@keyframes end-icon-pop {
  from { transform: scale(0.55) rotate(-14deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .card-icon, .brand-knight,
  :is(#go-ai, #go-local, #go-online, #go-join, #open-room, #btn-new, #btn-undo,
      #btn-resign, #btn-resign-room, #btn-flip, #btn-flip-room, #btn-mute, #btn-mute-room,
      #btn-draw, #btn-draw-accept, #btn-draw-decline, #btn-reclaim-seat,
      #btn-close-room, #btn-join, #end-review, #end-rematch, #end-rematch-local,
      #end-newroom, #rev-exit, #room-rev-exit, #promo-cancel)::before,
  button[data-copy]::before,
  .btnlink[href="#/"]::before,
  .end-icon { transition: none; animation: none; }
}
