/* Chess — parchment and umber, ink and cream. */

.chess-frame {
  width: min(560px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(12px, 2.4vw, 18px);
  align-items: center;
}
.status-line {
  margin: 0;
  text-align: center;
  font-family: var(--hand);
  font-style: italic;
  font-size: clamp(14px, 2.1vw, 16.5px);
  color: var(--ink-soft);
  min-height: 22px;
}
.status-line b { color: var(--oxblood); }

.captured {
  margin: 0;
  min-height: 18px;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--ink-light);
  align-self: flex-start;
}
.captured.mine { align-self: flex-end; }

/* ---- the board ---- */
.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(480px, 92vw);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(122, 104, 80, .6), 0 10px 26px rgba(58, 46, 34, .3);
}
.sq {
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: clamp(26px, 6.6vw, 40px);
  line-height: 1;
}
.sq.light { background: #ecdfbd; }
.sq.dark { background: #a98d5f; }
.sq.sel { box-shadow: inset 0 0 0 3px rgba(90, 26, 31, .75); }
.sq.was { box-shadow: inset 0 0 0 3px rgba(200, 156, 58, .55); }
.sq.sel.was { box-shadow: inset 0 0 0 3px rgba(90, 26, 31, .75); }
.sq.check { background: radial-gradient(circle at 50% 50%, rgba(214, 106, 96, .8), rgba(214, 106, 96, .35)); }
.sq.dot::after {
  content: '';
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(90, 26, 31, .4);
}
.sq.take::after {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 3px solid rgba(90, 26, 31, .55);
}
.lbl {
  position: absolute;
  font-family: var(--caps);
  font-style: normal;
  font-size: 9px;
  color: rgba(58, 46, 34, .55);
  pointer-events: none;
}
.lbl-r { top: 2px; left: 3px; }
.lbl-f { bottom: 1px; right: 3px; }

.pc { font-family: serif; }
.pc.w { color: var(--cream); text-shadow: 0 0 1.5px #1a1410, 0 0 1.5px #1a1410, 0 1px 2px rgba(26, 20, 16, .7); }
.pc.b { color: #241a12; text-shadow: 0 1px 1px rgba(246, 238, 214, .25); }

.move-strip {
  margin: 2px 0 0;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--body);
  font-size: 12.5px;
  color: var(--ink-light);
  padding-bottom: 3px;
}
.frame-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.frame-actions .btn:disabled { opacity: .45; cursor: default; }

/* ---- pickers ---- */
.pick-label {
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  color: var(--ink-light);
  margin: 12px 0 6px;
}
.pick-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pick {
  font-family: var(--body);
  font-size: 15px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1.5px solid rgba(122, 104, 80, .45);
  background: rgba(246, 238, 214, .6);
  cursor: pointer;
  color: var(--ink);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.pick:hover { border-color: var(--oxblood); }
.pick.picked { border-color: var(--oxblood); background: var(--cream); box-shadow: 0 0 0 2px rgba(90, 26, 31, .25); }
.pick .pc { font-size: 19px; vertical-align: -2px; }
.pick.promo { font-size: 30px; padding: 6px 18px; }

.help-body { text-align: left; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.help-body p { margin: 0 0 12px; }
.help-body b { color: var(--oxblood); }

/* ==== the rated tables (multiplayer + the line) =========================== */

/* flex would beat the hidden attribute; keep hidden meaning hidden */
.mode-row[hidden], .mode-pick[hidden], .mode-at[hidden], .mp-roster[hidden], .mp-banner[hidden] { display: none; }

/* mode row: the opposition for the night */
.mode-row { display: flex; justify-content: center; }
.mode-pick, .mode-at { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.mode-row__label {
  font-family: var(--caps); text-transform: uppercase; letter-spacing: .18em;
  font-size: 11px; color: var(--ink-light); margin-right: 2px;
}
.mode-btn { font-size: 13px; padding: 6px 12px; }
.mode-btn.is-on { box-shadow: inset 0 0 0 1.5px rgba(90, 26, 31, .45); }

/* while the reader waits in line, the held board rests */
.board.is-idle { opacity: .8; }
.board.is-idle .sq { cursor: default; }

/* connection word from the shore */
.mp-banner {
  margin: 0; text-align: center;
  font-family: var(--hand); font-style: italic; font-size: 14.5px;
  color: var(--parchment); background: rgba(90, 26, 31, .88);
  border-radius: 8px; padding: 7px 12px;
}

/* roster strip: the two chairs, and the turn clock */
.mp-roster { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mp-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 9px;
  background: rgba(26, 20, 16, .05);
  box-shadow: inset 0 0 0 1px rgba(122, 104, 80, .35);
}
.mp-chip b {
  font-family: var(--caps); text-transform: uppercase; letter-spacing: .08em;
  font-size: 11px; color: var(--ink-soft); font-weight: 600;
  max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-chip i { font-family: var(--hand); font-style: italic; font-size: 11px; color: var(--ink-light); }
.mp-chip .r { font-size: 11.5px; color: var(--ink-light); font-variant-numeric: tabular-nums; }
.mp-chip.is-me b { color: var(--oxblood); }
.mp-chip.is-turn { background: rgba(227, 183, 84, .2); box-shadow: inset 0 0 0 1.5px rgba(200, 156, 58, .8); }
.mp-chip.is-gone { opacity: .55; }
/* the taproom cast wear a small portrait frame */
.mp-chip.is-cast {
  background: rgba(246, 238, 214, .55);
  box-shadow:
    inset 0 0 0 1px rgba(156, 120, 38, .75),
    inset 0 0 0 3px rgba(246, 238, 214, .9),
    inset 0 0 0 4px rgba(156, 120, 38, .4);
}
.mp-chip.is-cast.is-turn { box-shadow: inset 0 0 0 1.5px rgba(200, 156, 58, .9), inset 0 0 0 3px rgba(246, 238, 214, .9), inset 0 0 0 4px rgba(156, 120, 38, .4); }
.mp-clock {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  font-family: var(--display); font-size: 10px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--ink-soft);
  background: conic-gradient(var(--gold) 1turn, rgba(26, 20, 16, .12) 0);
  box-shadow: inset 0 0 0 1px rgba(122, 104, 80, .35);
}
/* the flag falls on the first timeout: the warning must not whisper */
.mp-clock.is-warn {
  color: var(--oxblood-deep);
  box-shadow: inset 0 0 0 1px rgba(122, 34, 40, .7);
  animation: mp-flag-pulse .9s ease-in-out infinite;
}
@keyframes mp-flag-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
@media (prefers-reduced-motion: reduce) {
  .mp-clock.is-warn { animation: none; }
}

/* the rated-tables overlay panes */
.mp-note { font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 14px; }
.mp-note b { color: var(--oxblood); }
.mp-row { display: flex; gap: 8px; justify-content: center; margin: 0 0 6px; }
.mp-input {
  flex: 1; min-width: 0; max-width: 240px; padding: 9px 11px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(122, 104, 80, .55); border-radius: 8px;
}
.mp-input:focus { outline: 2px solid rgba(90, 26, 31, .4); }
.mp-input.code { max-width: 120px; text-align: center; text-transform: uppercase; letter-spacing: .3em; font-family: var(--display); font-weight: 600; }
.mp-err { color: var(--oxblood-bright); font-size: 14px; min-height: 1.2em; margin: 8px 0 0; }
.mp-code {
  font-family: var(--display); font-weight: 600; font-size: 38px;
  letter-spacing: .22em; color: var(--oxblood); margin: 2px 0 10px;
}
.mp-or { font-family: var(--caps); text-transform: uppercase; letter-spacing: .2em; font-size: 10.5px; color: var(--ink-light); margin: 12px 0; }

/* the reckoning of a rated match: result / name / the ladder's ink */
.mpr-row {
  display: grid; grid-template-columns: 58px 1fr 130px;
  gap: 8px; align-items: baseline;
  padding: 7px 10px; border-radius: 7px;
  font-size: 15px; color: var(--ink-soft); text-align: left;
}
.mpr-row.me { background: rgba(200, 156, 58, .16); }
.mpr-row .place { font-family: var(--caps); text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; color: var(--ink-light); }
.mpr-row .rate { text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--ink-light); white-space: nowrap; }
.mpr-row .rate b { color: var(--oxblood); font-weight: 600; }
.mpr-row .rate .up { color: var(--forest-bright); }
.mpr-row .rate .down { color: var(--oxblood-bright); }
.mp-result-note { font-family: var(--hand); font-style: italic; font-size: 14px; color: var(--ink-light); margin: 0 0 16px; }
@media (max-width: 560px) {
  .mpr-row { grid-template-columns: 48px 1fr 108px; font-size: 14px; }
  .mp-chip b { max-width: 9ch; }
}
