.question-card {
  padding: clamp(12px, 2.2vw, 26px);
  container-type: inline-size;
}
.table {
  width: min(100%, 900px);
  max-width: none;
  container-type: inline-size;
  min-height: 0;
  margin: 18px auto 0;
  padding: clamp(4px, 1.8cqi, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4cqi, 16px);
  color: #fff;
  border: clamp(6px, 1.2cqi, 12px) solid #533822;
  border-radius: 22px;
  background: radial-gradient(ellipse at center, #347d98 0, #286b87 65%, #205b77 100%);
  box-shadow: inset 0 0 0 2px #a88652, inset 0 0 35px #092e2580, 0 12px 28px #182c2633;
  overflow: hidden;
}
.table-board {
  --board-gap: clamp(16px, 3cqi, 30px);
  --panel-width: clamp(132px, 42cqi, 340px);
  --side-width: calc((100cqi - var(--panel-width) - 2 * var(--board-gap)) / 2);
  --tile-aspect: 1.36;
  --river-gap: clamp(1px, .22cqi, 2px);
  --meld-gap: clamp(2px, .5cqi, 5px);
  /* Both side columns must accommodate their rivers and corner melds. */
  --river-tiles-wide: calc(var(--river-rows, 3) * var(--tile-aspect));
  --meld-tiles-wide: calc(var(--side-meld-count, 1) * var(--tile-aspect) + var(--side-added-count, 0) * (2 - var(--tile-aspect)));
  --river-tile-limit: calc((var(--side-width) - (var(--river-rows, 3) - 1) * var(--river-gap)) / var(--river-tiles-wide));
  --meld-tile-limit: calc((var(--side-width) - (var(--side-meld-count, 1) - 1) * var(--meld-gap)) / var(--meld-tiles-wide));
  --corner-tile-limit: calc((var(--side-width) - 3px) / (3 + var(--tile-aspect)));
  --table-tile-width: min(4.9cqi, 36px, var(--river-tile-limit), var(--meld-tile-limit), var(--corner-tile-limit));
  --table-tile-height: calc(var(--tile-aspect) * var(--table-tile-width));
  --river-width: calc(5 * (var(--table-tile-width) + var(--river-gap)) + var(--table-tile-height));
  --river-depth: calc(var(--river-rows, 3) * (var(--table-tile-height) + var(--river-gap)) - var(--river-gap));
  display: grid;
  min-height: 480px;
  grid-template-columns: minmax(0, 1fr) var(--panel-width) minmax(0, 1fr);
  grid-template-rows: minmax(min-content, 1fr) auto minmax(min-content, 1fr);
  grid-template-areas:
    "north-melds north east-melds"
    "west center east"
    "west-melds south south-melds";
  gap: var(--board-gap);
}
.seat { display: contents; }
.seat-north .river-slot { grid-area: north; place-self: end center; }
.seat-west .river-slot { grid-area: west; place-self: center end; }
.seat-east .river-slot { grid-area: east; place-self: center start; }
.seat-south .river-slot { grid-area: south; place-self: start center; }
.river-slot {
  position: relative;
  width: var(--river-width);
  height: var(--river-depth);
  flex: none;
  overflow: visible;
}
.seat-west .river-slot,.seat-east .river-slot {
  width: var(--river-depth);
  height: var(--river-width);
}
/* Leave the six tiles in seat order and rotate their shared coordinate system. */
.river {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--river-width);
  height: var(--river-depth);
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--river-gap);
  overflow: visible;
  transform: translate(-50%,-50%) rotate(var(--river-angle, 0deg));
}
.seat-north { --river-angle: 180deg; }
.seat-west { --river-angle: 90deg; }
.seat-east { --river-angle: -90deg; }
.river-row { display: flex; flex:0 0 auto; align-items: flex-end; gap: var(--river-gap); width:max-content; }
.river-cell {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--table-tile-width);
  height: var(--table-tile-height);
}
.river .tile, .meld .tile { width: var(--table-tile-width); height: var(--table-tile-height); }
.river .tile-image, .meld .tile-image { padding: clamp(0px, .22cqi, 2px); }
.river-cell.tedashi .tile { background: linear-gradient(110deg, #d0d0d0, #bfbfbf); }
.river-cell.riichi-discard { width: var(--table-tile-height); }
.river-cell.riichi-discard .tile {
  transform: rotate(90deg);
  outline: 1px solid #edcb59;
  outline-offset: -1px;
}
.river-cell:is(.claimed-discard, .response-discard) {
  position: relative;
  z-index: 1;
}
.river-cell:is(.claimed-discard, .response-discard)::after {
  --red-frame-width: clamp(4px, calc(.18 * var(--table-tile-width)), 6px);
  content: "";
  position: absolute;
  inset: 0;
  border: var(--red-frame-width) dashed #258de0;
  border-radius: 5px;
  pointer-events: none;
}
.river-cell.response-discard::after {
  inset: calc(-1 * var(--red-frame-width));
  border-color: #d52a26;
  border-style: solid;
}
.seat .melds {
  display: flex;
  flex-direction: column-reverse;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: var(--meld-gap);
  min-height: 0;
}
.seat .melds:empty { display: none; }
.seat-south .melds { grid-area: south-melds; place-self: end end; }
.seat-north .melds {
  grid-area: north-melds;
  place-self: start start;
  direction: rtl;
  flex-direction: column;
}
.seat-west .melds {
  grid-area: west-melds;
  place-self: end start;
  writing-mode: vertical-rl;
}
.seat-east .melds {
  grid-area: east-melds;
  place-self: start end;
  writing-mode: vertical-lr;
  direction: rtl;
}
.meld {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  border: 0;
  padding: 0;
  margin: 0;
}
.seat-north .meld { align-items: flex-start; }
.meld-cell {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: none;
  inline-size: var(--table-tile-width);
  min-block-size: var(--table-tile-height);
}
.seat-north .meld-cell { flex-direction: column-reverse; }
.meld-face {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  flex: none;
  inline-size: 100%;
  block-size: var(--table-tile-height);
}
.meld .tile { transform: rotate(var(--river-angle, 0deg)); }
.meld-called { inline-size: var(--table-tile-height); }
.meld-called .meld-face { block-size: var(--table-tile-width); }
.meld-called .tile { transform: rotate(calc(var(--river-angle, 0deg) + 90deg)); }
.table-center {
  grid-area: center;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  grid-template-rows: auto 1fr auto auto;
  align-items: center;
  gap: clamp(2px, 1cqi, 8px);
  padding: clamp(3px, 1.1cqi, 10px);
  border: 2px solid #b28a46;
  border-radius: 12px;
  background: linear-gradient(145deg,#123a36f2,#102f31f2);
  box-shadow: inset 0 0 0 3px #102f3180,0 4px 10px #08271f80;
  text-align: center;
}
.score-seat { display:flex; align-items:center; justify-content:center; gap:4px; color:#ecebd9; white-space:nowrap; font-size:11px; }
.score-seat .score-value { display:inline-flex; align-items:baseline; gap:1px; color:inherit; line-height:1; font-variant-numeric:tabular-nums; }
.score-value span { font-size:clamp(12px, 4.1cqi, 32px); font-weight:850; }
.score-value small { font-size:clamp(7px, 1.8cqi, 14px); font-weight:750; }
.score-seat.active { color:#f4d786; }
.score-wind {
  display: inline-grid;
  place-items: center;
  inline-size: 2.1em;
  block-size: 2.1em;
  border: 4px solid transparent;
  border-radius: 4px;
  font-size: clamp(15px, 2.5cqi, 22px);
  font-weight: 750;
  line-height: 1;
}
.score-wind.is-dealer { border-color: #ff6b62; }
.score-north { grid-row:1; grid-column:1 / -1; }
.score-west { grid-row:1 / -1; grid-column:1; flex-direction:column; gap:2px; }
.score-east { grid-row:1 / -1; grid-column:3; flex-direction:column; gap:2px; }
.score-south { grid-row:4; grid-column:1 / -1; }
.center-main { grid-row:2; grid-column:2; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; }
.round-badge { display:flex; flex-direction:column; align-items:center; gap:1px; padding:3px 9px; border:2px solid #ddd2a5; border-radius:6px; color:#f3f0d7; line-height:1.15; white-space:nowrap; }
.round-title { font-size:23px; font-weight:800; }
.round-wind { color:#f0d778; }
.round-honba { font-size:12px; font-weight:700; }
.sticks-row { display:flex; align-items:center; justify-content:center; gap:6px; color:#e9e7d2; font-size:14px; line-height:1; }
.sticks-row strong { font-size:14px; font-variant-numeric:tabular-nums; }
.stick-multiply { font-size:12px; font-weight:750; }
.stick-icon { position:relative; display:block; width:34px; height:10px; overflow:hidden; }
.stick-icon img { position:absolute; top:50%; left:50%; display:block; width:500%; max-width:none; height:auto; transform:translate(-50%,-50%); }
.stick-icon.seat-riichi {
  --stick-height: clamp(9px, 1.8cqi, 15px);
  position: absolute;
  bottom: calc(100% + (var(--board-gap) - var(--stick-height)) / 2);
  left: 50%;
  width: clamp(39px, 10.5cqi, 72px);
  height: var(--stick-height);
  transform: translateX(-50%);
}
.remaining-draws { color:#e4efdf; font-size:clamp(9px, 1.7cqi, 13px); font-weight:700; white-space:nowrap; }
.table-center .dora-indicator {
  grid-row: 3;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, .8cqi, 7px);
  margin: 0;
  color: #e4efdf;
  font-size: clamp(8px, 1.5cqi, 11px);
}
.table-center .dora-indicator .tile {
  width: var(--table-tile-width);
  height: var(--table-tile-height);
  transform: none;
}
.action-list { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin:0 0 10px; }
.action-list[hidden] { display:none; }
.action-list.has-riichi { justify-content:center; }
.action-choice { min-height:45px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:6px 12px; border:1px solid #c7a75c; border-radius:8px; background:linear-gradient(#fffdf4,#e8dfc5); color:#563b20; box-shadow:0 3px 0 #987342; font:700 17px system-ui,sans-serif; cursor:pointer; }
.riichi-toggle { order:99; min-height:54px; padding:8px 16px; border:2px solid #f1c84b; border-radius:10px; background:linear-gradient(180deg,#fff6cc,#e7c45d); color:#49320b; box-shadow:0 4px 0 #8d671c,0 0 0 3px #f1d47745; font-size:19px; font-weight:900; }
.riichi-toggle .action-label { color:inherit; font-size:inherit; font-weight:inherit; }
.riichi-toggle input { display:block; flex:none; width:1.2em; height:1.2em; margin:0; accent-color:#16824f; cursor:pointer; }
.riichi-toggle:has(input:checked) { background:linear-gradient(180deg,#e45a50,#b82e2e); border-color:#ffe071; color:#fffbe8; box-shadow:0 4px 0 #741b20,0 0 0 3px #ff8c8175,0 0 14px #ff625880; }
.riichi-toggle:has(input:checked) input { accent-color:#b51f2b; }
.action-choice, .tile-choice { position:relative; }
.tile-choice-stack { position:relative; display:flex; flex:0 0 auto; align-items:flex-end; justify-content:center; }
.tile-choice-stack .tile-choice { z-index:1; }
.tile-choice-stack .tile-kan-choice { position:absolute; z-index:5; left:50%; bottom:calc(100% + var(--rating-chart-height) + 16px); min-height:40px; gap:4px; padding:4px 8px; font-size:14px; white-space:nowrap; transform:translateX(-50%); }
.tile-choice-stack .tile-kan-choice:hover { transform:translate(-50%,-1px); }
.tile-choice-stack .tile-kan-choice .tile { width:22px; height:31px; }
#hand.riichi-mode .tile-choice-stack:not(.riichi-eligible) .tile-choice { opacity:.22; filter:brightness(.5) grayscale(.8); }
#hand.riichi-mode .tile-choice-stack.riichi-eligible .tile-choice { outline:2px solid #f1d477; outline-offset:2px; }
.rating-choice-selected { outline:4px solid #f04747; outline-offset:3px; border-radius:4px; }
.answer-grade-splash { position:absolute; z-index:20; inset:0; display:grid; place-items:center; background:#061b1659; pointer-events:auto; }
.answer-grade-splash img { display:block; width:min(34vmin, 300px); height:min(34vmin, 300px); object-fit:contain; filter:drop-shadow(0 5px 12px #061b1699); }
.rating-chart-pair { position:absolute; z-index:4; left:50%; bottom:calc(100% + 2px); display:flex; width:var(--hand-tile-width); height:var(--rating-chart-height); padding:0 1px; border-radius:6px; background:#061b16d9; box-shadow:0 2px 8px #061b1680; transform:translateX(-50%); pointer-events:none; }
.drawn-choice-stack .rating-chart-pair { left:calc(50% + var(--draw-gap) / 2); }
.rating-chart-column { position:relative; flex:1 1 50%; min-width:0; height:100%; border-radius:3px; }
.rating-chart-column:first-child { border-right:1px solid #f4f5e955; }
.rating-chart-pair-label { position:absolute; z-index:2; left:50%; width:max(100%, 52px); height:var(--rating-label-slot); display:grid; place-items:center; padding:0 2px; border-radius:3px; background:#153e36f2; font:800 14px/var(--rating-label-slot) system-ui,sans-serif; font-variant-numeric:tabular-nums; text-shadow:0 1px 2px #10251f; transform:translateX(-50%); white-space:nowrap; }
.rating-chart-pair-label.top.slot-0 { top:0; }
.rating-chart-pair-label.top.slot-1 { top:var(--rating-label-slot); }
.rating-chart-pair-label.bottom.slot-0 { bottom:var(--rating-label-slot); }
.rating-chart-pair-label.bottom.slot-1 { bottom:0; }
.rating-chart-pair-label.top { color:#a6ffbf; }
.rating-chart-pair-label.bottom { color:#ffb4af; }
.rating-chart-pair-label.rating-selected-label { outline:3px solid #f04747; outline-offset:0; }
.rating-chart-pair .rating-chart-bar { left:50%; }
.rating-chart-pair .rating-chart-bar.positive { top:calc(var(--rating-chart-zero) - var(--bar-height)); height:var(--bar-height); }
.rating-chart-pair .rating-chart-bar.negative { top:var(--rating-chart-zero); height:var(--bar-height); }
.rating-chart-pair .rating-chart-bar.zero { display:none; }
.rating-chart-pair-zero { position:absolute; top:var(--rating-chart-zero); left:1px; width:calc(100% - 2px); border-top:2px solid #f4f5e9e8; }
.rating-chart-column.rating-best .rating-chart-bar.positive { background:#25e66e; box-shadow:0 0 5px #25e66e99; }
.rating-chart-column.rating-selected { outline:3px solid #f04747; outline-offset:1px; }
.table.gap-quality-mode { --rating-chart-zero:calc(var(--rating-chart-height) - 2px); }
.rating-chart-pair.gap-quality { background:transparent; box-shadow:none; }
.rating-chart-pair.gap-quality .rating-chart-column:not(.gap-cross-column) { background:#061b16e8; box-shadow:0 2px 8px #061b1680; }
.rating-chart-pair.gap-quality .rating-chart-column:not(.gap-cross-column)::after { content:""; position:absolute; right:0; bottom:0; left:0; border-top:2px solid #f4f5e9e8; }
.rating-chart-pair.gap-quality .rating-chart-column.gap-cross-column { border-color:transparent; background:transparent; box-shadow:none; }
.rating-chart-pair.gap-quality .rating-chart-pair-zero { display:none; }
.rating-chart-pair.gap-quality .rating-chart-bar { background:#45ce78; }
.rating-chart-pair.gap-quality .rating-chart-column.rating-best .rating-chart-bar { background:#25e66e; box-shadow:0 0 5px #25e66e99; }
.rating-chart-pair.gap-quality .rating-chart-column.gap-cross-column::after { display:none; }
.rating-chart-pair.gap-quality .rating-chart-pair-label { z-index:3; }
.rating-chart-pair.gap-quality .rating-chart-pair-label.top { color:#a6ffbf; }
.rating-chart-pair.gap-quality .rating-chart-column .rating-gap-cross { position:absolute; z-index:4; left:50%; bottom:-3px; transform:translateX(-50%); color:#ff514d; font:1000 46px/1 system-ui,sans-serif; text-shadow:0 2px 3px #061b16; }
.rating-chart {
  position:absolute;
  z-index:4;
  left:0;
  bottom:calc(100% + 2px);
  display:block;
  width:100%;
  height:var(--rating-chart-height);
  border-radius:6px;
  background:#061b16d9;
  box-shadow:0 2px 8px #061b1680;
  color:#e9f2ea;
  pointer-events:none;
}
.rating-chart-zero { position:absolute; top:var(--rating-chart-zero); left:0; width:100%; border-top:2px solid #f4f5e9e8; }
.rating-chart-bar { position:absolute; left:50%; display:block; width:clamp(8px, 46%, 16px); transform:translateX(-50%); }
.rating-chart-bar.positive { top:calc(var(--rating-chart-zero) - var(--bar-height)); height:var(--bar-height); border-radius:4px 4px 0 0; background:#45ce78; }
.rating-chart-bar.negative { top:var(--rating-chart-zero); height:var(--bar-height); border-radius:0 0 4px 4px; background:#ed625d; }
.rating-chart-bar.zero, .rating-chart-bar.gap-cross { display:none; }
.gap-cross-label { color:#ff7770 !important; font-weight:900 !important; }
.rating-chart.gap-quality { background:#061b16e8; }
.rating-chart.gap-quality .rating-chart-bar.positive { background:#25e66e; box-shadow:0 0 5px #25e66e99; }
.rating-chart.gap-quality .rating-chart-label { color:#a6ffbf; }
.rating-chart.community-share .rating-chart-bar.positive { background:#ffd447; box-shadow:0 0 6px #ffd44799; }
.rating-chart.community-share .rating-chart-label { color:#ffe889; }
.rating-chart-pair.community-share .rating-chart-bar { background:#ffd447; box-shadow:0 0 6px #ffd44799; }
.rating-chart-pair.community-share .rating-chart-pair-label.top { color:#ffe889; }
.rating-gap-cross { position:absolute; z-index:5; left:50%; bottom:calc(100% + 2px); transform:translateX(-50%); color:#ff514d; font:1000 48px/1 system-ui,sans-serif; text-shadow:0 2px 4px #061b16; pointer-events:none; }
.rating-chart-label { position:absolute; left:50%; z-index:1; width:max(100%, 52px); height:var(--rating-label-slot); min-height:var(--rating-label-slot); display:grid; place-items:center; padding:0 2px; border-radius:3px; background:#153e36f2; font:800 14px/var(--rating-label-slot) system-ui,sans-serif; font-variant-numeric:tabular-nums; text-shadow:0 1px 2px #10251f; transform:translateX(-50%); white-space:nowrap; }
.rating-chart-label.positive { top:0; color:#a6ffbf; }
.rating-chart-label.negative { bottom:0; color:#ffb4af; }
.rating-chart-label.zero { top:0; color:#f3f0d7; }
.rating-best .rating-chart-bar.positive { background:#25e66e; box-shadow:0 0 5px #25e66e99; }
.rating-best .rating-chart-label.positive { color:#c6ffd5; }
.rating-choice-frame { position:absolute; z-index:3; inset:calc(0px - var(--rating-chart-height) - 6px) -4px -4px; border:4px solid #f04747; border-radius:7px; pointer-events:none; }
.answered-result .tile-choice:focus-visible, .answered-result .action-choice:focus-visible { outline:none; }
.answered-result .tile-choice:disabled, .answered-result .action-choice:disabled { opacity:1; filter:none; }
.answered-result .riichi-toggle { display:none !important; }
.answered-result #action-list:has(>.riichi-toggle:only-child) { display:none !important; }
.action-choice .action-label { font-size: inherit; color: inherit; }
.action-choice:hover { transform:translateY(-1px); background:#fff8d9; }
.action-choice .tile { width:24px; height:33px; }
.action-choice small { font-size:10px; color:#8a5b27; }
.hand-area {
  container-type: inline-size;
  padding: 0;
  border: 0;
}
.hand-area > div.hand { gap:var(--hand-gap); font-size:inherit; }
.hand {
  --hand-gap: clamp(1px, .4cqi, 4px);
  --draw-gap: clamp(4px, 1.5cqi, 12px);
  /* Reserve space for all 14 tiles, including the gap before the draw. */
  --hand-tile-width: min(60px, calc((100cqi - 13 * var(--hand-gap) - var(--draw-gap) - 6px) / 14));
  min-height: 0;
  flex-wrap: nowrap;
  justify-content: center;
  gap: var(--hand-gap);
  margin: 0;
  padding: 8px 3px 4px;
}
#hand { position:relative; }
.tile-choice { display:flex; flex:none; padding:0; border:0; background:transparent; cursor:pointer; transition:transform .12s ease; }
.tile-choice:hover:not(:disabled) { transform:translateY(-5px); }
.tile-choice:focus-visible { outline:2px solid #f4d786; outline-offset:1px; }
.tile-choice:disabled { cursor:default; opacity:.8; }
.tile-choice .tile { width:var(--hand-tile-width); height:calc(1.4 * var(--hand-tile-width)); }
.drawn-choice { margin-left:var(--draw-gap); }
.hand .drawn { margin-left:0; }
.tile.image-tile { flex:0 0 auto; border:1px solid #c9c4b1; border-radius:4px; background:linear-gradient(110deg,#fff 0%,#fffef6 58%,#eee9d7 100%); box-shadow:0 2px 2px #061e1760; overflow:hidden; }
.tile-image { width:100%; height:100%; padding:2px; object-fit:contain; }
@media(max-width:700px) {
  .table-board { min-height:370px; }
  .score-seat { gap:2px; font-size:8px; }
  .center-main { gap:2px; }
  .round-badge { padding:2px 4px; border-width:1px; }
  .round-title { font-size:13px; }
  .round-honba { font-size:8px; }
  .sticks-row { gap:4px; font-size:10px; }
  .sticks-row strong { font-size:10px; }
  .stick-multiply { font-size:9px; }
  .stick-icon { width:25px; height:8px; }
  .rating-chart-label, .rating-chart-pair-label { width:max(100%, 42px); font-size:11px; line-height:15px; min-height:15px; }
  .riichi-toggle { min-height:48px; padding:7px 12px; font-size:17px; }
}

/* The table is the full page canvas below the navigation. */
[hidden] { display: none !important; }
:root, body, main { background:#1e7652; }
html, body { height:100%; overflow:hidden; }
body { height:100dvh; display:flex; flex-direction:column; user-select:none; -webkit-user-select:none; }
.site-header { background:#34495e; }
main { width:100%; height:calc(100dvh - 44px); max-width:none; min-height:0; flex:1 1 auto; overflow:hidden; margin:0; padding:0; }
#game { height:100%; min-height:0; display:flex; flex-direction:column; }
#question.question-card { height:auto; min-height:0; flex:1 1 0; display:flex; flex-direction:column; overflow:hidden; position:relative; margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.site-header { flex:0 0 auto; }
.table { --rating-label-slot:18px; --rating-chart-height:116px; --rating-chart-zero:calc(var(--rating-chart-height) / 2); position:relative; width:100%; max-width:none; height:auto; min-height:0; flex:1 1 0; margin:0; border:0; border-radius:0; background:radial-gradient(ellipse at center,#2b8a60 0%,#1e7652 66%,#176344 100%); box-shadow:none; }
.answer-timer { position:absolute; z-index:3; top:68%; right:15%; display:block; width:max-content; padding:0; border:0; border-radius:0; background:transparent; color:#fff4c8; font:950 clamp(84px,12vmin,136px)/.9 system-ui,sans-serif; font-variant-numeric:tabular-nums; opacity:.58; text-shadow:0 3px 10px #071c17; transform:translateY(-50%); pointer-events:none; }
.answer-timer.in-grace { color:#ff8c78; opacity:.3; }
.table-board { position:relative; z-index:2; }
.table-controls { position:relative; z-index:3; }
.table.share-mode .result-rank, .table.share-mode .result-rating-line { display:none; }
.result-timeout { color:#ff8a80; font-size:clamp(30px,5vmin,54px); font-weight:950; line-height:1.1; text-shadow:0 2px 5px #000a; }
.table.double-rating-labels { --rating-chart-height:152px; }
.table-board { flex:1 1 0; min-height:0; grid-template-rows:minmax(0,1fr) auto minmax(0,1fr); }
.table-controls { flex:0 0 auto; }
.answer-overlay { position:absolute; inset:0; z-index:2; isolation:isolate; pointer-events:none; }
.answer-overlay::before { content:""; position:absolute; z-index:-1; inset:0; background:rgba(0,0,0,.66); pointer-events:none; }
.table.hide-rating-results .answer-overlay::before { display:none; }
.table.hide-rating-results .answer-overlay-controls { display:none; }
.table.hide-rating-results #action-list { visibility:hidden; }
.table.answered-result:not(.hide-rating-results) #hand,
.table.answered-result:not(.hide-rating-results) #action-list { position:relative; z-index:1; }
.answer-result-summary { position:absolute; z-index:2; top:12px; left:50%; display:flex; flex-direction:column; align-items:center; gap:6px; color:#f6f3e4; transform:translateX(-50%); pointer-events:none; white-space:nowrap; }
.result-rank { color:#f5d77b; font-size:clamp(52px,8vmin,88px); font-weight:950; line-height:1.08; text-shadow:0 2px 4px #0008; }
.result-rating-line { display:flex; align-items:baseline; justify-content:center; gap:12px; font-variant-numeric:tabular-nums; }
.result-rating-caption { color:#d4ddd6; font-size:24px; font-weight:650; }
.result-rating-before { color:#d4ddd6; font-size:32px; line-height:1.15; }
.result-rating-arrow { color:#f1d477; font-size:36px; font-weight:900; line-height:1; }
.result-rating-after { color:#fff4c8; font-size:56px; line-height:1.1; font-weight:900; }
.result-rating-before small, .result-rating-after small { font-size:.58em; vertical-align:baseline; }
.answer-overlay-controls { position:absolute; top:14px; right:14px; display:flex; align-items:center; gap:10px; pointer-events:auto; }
.results-toggle { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:8px 14px; border:1px solid #e2dfcb; border-radius:10px; background:#153e36eF; color:#f3f0d7; font:700 14px system-ui,sans-serif; cursor:pointer; }
.right-click-icon { width:15px; height:18px; flex:none; }
.results-toggle:hover { background:#205446; }
.chart-metric-toggle { position:absolute; z-index:12; top:calc(-1 * var(--rating-chart-height) - 64px); right:0; min-height:54px; padding:10px 18px; border:2px solid #a6ffbf; border-radius:12px; background:#092d25f2; color:#d9ffe3; font-size:18px; font-weight:850; white-space:nowrap; pointer-events:auto; }
.chart-metric-toggle:hover { background:#14533f; }
.next-button { display:block; width:auto; min-width:320px; min-height:76px; max-width:440px; margin:12px 0 0; padding:14px 24px; border:2px solid #f1d477; border-radius:13px; background:#197b55; box-shadow:0 5px 16px #10251f70; font-size:30px; font-weight:850; pointer-events:auto; }
.next-button:hover { background:#229466; }
.share-button { display:flex; align-items:center; justify-content:center; gap:10px; min-width:320px; min-height:54px; max-width:440px; margin:0; padding:10px 22px; border:1px solid #b8d9eb; border-radius:11px; background:#166b91; color:#f5fbff; font:750 21px/1.2 system-ui,sans-serif; text-align:center; text-decoration:none; cursor:pointer; pointer-events:auto; }
.share-button svg { width:24px; height:24px; flex:none; fill:currentColor; }
.share-button:hover { background:#2085b0; }
.hide-rating-results .rating-chart, .hide-rating-results .rating-chart-pair, .hide-rating-results .rating-choice-frame, .hide-rating-results .rating-gap-cross, .hide-rating-results .answer-grade-icon { visibility:hidden; }
.hide-rating-results .tile-kan-choice { visibility:hidden; }
.hide-rating-results .rating-choice-selected { outline:none; }
#game-message:empty { display:none; margin:0; }
#game-message:not(:empty) { position:absolute; z-index:5; inset:auto 14px 6px; width:auto; margin:0; text-align:center; pointer-events:none; }
.profile-link { color:inherit; text-decoration:none; border-radius:6px; padding:5px 7px; }
.profile-link:hover { background:#ffffff12; text-decoration:underline; text-underline-offset:3px; }
.profile-page { width:100%; max-width:none; height:100%; overflow-y:auto; overscroll-behavior:contain; margin:0; padding:clamp(20px,4vw,48px); background:#fff; color:#24343c; scrollbar-color:#b7c4ca #f2f5f6; user-select:text; -webkit-user-select:text; }
.profile-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-bottom:20px; border-bottom:1px solid #dce3e6; }
.profile-heading-actions { display:flex; align-items:center; gap:10px; flex:none; }
.profile-eyebrow { margin:0 0 5px; color:#637780; font-size:13px; }
.profile-name-line { display:flex; align-items:baseline; gap:18px; flex-wrap:wrap; }
.profile-heading h1 { margin:0; font-size:clamp(30px,5vw,48px); overflow-wrap:anywhere; }
.profile-rank-badge { color:inherit; font-size:clamp(30px,5vw,48px); font-weight:700; white-space:nowrap; }
.profile-rename-tooltip { display:inline-flex; flex:none; }
.profile-rename-button,.profile-rename-cancel,.profile-rename-submit { min-height:42px; padding:9px 16px; border:1px solid #d3e6d7; border-radius:9px; background:#123e32; color:#f5f4e7; font:700 15px system-ui,sans-serif; cursor:pointer; }
.profile-rename-button:disabled { cursor:not-allowed; opacity:.55; }
.profile-share-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; padding:8px 13px; border:1px solid #b8d9eb; border-radius:9px; background:#166b91; color:#f5fbff; font:700 14px system-ui,sans-serif; white-space:nowrap; cursor:pointer; }
.profile-share-button:hover { background:#2085b0; }
.profile-share-button svg { width:22px; height:22px; fill:currentColor; }
.profile-rename-note { margin:12px 0 0; color:#f5d98b; font-size:13px; }
.profile-message { min-height:22px; margin-bottom:8px; color:#735417; }
.profile-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:22px 0 26px; }
.page-ad { display:flex; width:100%; min-height:90px; align-items:center; justify-content:center; overflow:hidden; margin:18px auto; }
.profile-stat { min-height:104px; display:flex; flex-direction:column; justify-content:center; gap:7px; padding:16px 20px; border:1px solid #dce3e6; border-radius:12px; background:#f5f7f8; }
.profile-stat > span { color:#637780; font-size:13px; }
.profile-stat strong { color:#24343c; font-size:clamp(21px,3vw,30px); font-variant-numeric:tabular-nums; }
.profile-ranking-value{color:inherit;text-decoration:none}
.profile-ranking-value:hover{text-decoration:underline;text-underline-offset:3px}
.profile-stat strong .profile-ranking-position{margin-left:8px;color:#637780;font-size:.46em;font-weight:600;white-space:nowrap}
.profile-stat strong small { font-size:.58em; font-weight:650; }
.profile-history-section { margin:0 0 36px; }
.profile-history-section h2 { margin:0 0 14px; color:#24343c; font-size:21px; }
.profile-rating-chart-section { margin:0 0 34px; padding:18px 20px 12px; border:1px solid #dce3e6; border-radius:12px; background:#f8f9fa; }
.profile-rating-chart-section h2 { margin:0 0 12px; color:#24343c; font-size:19px; }
.profile-rating-chart-wrap { position:relative; width:100%; height:clamp(190px,30vw,300px); }
.profile-rating-chart { display:block; width:100% !important; height:100% !important; }
.answer-history-filters { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px; }
.answer-history-filter { min-width:46px; min-height:40px; display:inline-grid; place-items:center; padding:5px 10px; border:1px solid #cbd5d9; border-radius:8px; background:#fff; color:#34495e; font:700 15px system-ui,sans-serif; cursor:pointer; }
.answer-history-filter img { display:block; width:27px; height:27px; object-fit:contain; }
.answer-history-filter-clock { display:block; width:25px; height:25px; }
.answer-history-filter:hover { background:#eef3f4; }
.answer-history-filter.active { border-color:#34495e; background:#34495e; color:#fff; }
.answer-history-list { display:grid; grid-template-columns:minmax(0,1fr); gap:9px; margin:14px 0 0; padding:0; list-style:none; }
.answer-history-row { min-width:0; border:1px solid #dce3e6; border-radius:8px; background:#f8f9fa; }
.answer-history-link { display:block; padding:8px 10px; color:#24343c; text-decoration:none; }
.answer-history-link:hover { background:#eef2f4; }
.answer-history-head { min-height:50px; display:grid; grid-template-columns:30px 76px max-content max-content max-content minmax(0,1fr); align-items:center; column-gap:10px; overflow-x:auto; white-space:nowrap; scrollbar-width:thin; }
.answer-history-result { display:flex; align-items:center; justify-content:center; width:30px; flex:none; font-size:19px; font-weight:900; text-align:center; }
.answer-history-result-icon { display:block; width:25px; height:25px; object-fit:contain; }
.answer-history-result.is-timeout { display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:#fff0e5; color:#a04a13; }
.answer-history-result.is-timeout svg { display:block; width:18px; height:18px; }
.outcome-best .answer-history-result { color:#167345; }
.outcome-positive .answer-history-result { color:#8a6200; }
.outcome-negative .answer-history-result { color:#c62828; }
.answer-history-action { color:#435861; font-size:13px; white-space:nowrap; }
.answer-history-action-tiles { display:inline-flex; align-items:center; gap:2px; }
.answer-history-head .tile { flex:none; width:18px; height:25px; padding:0; }
.answer-history-selected-tile { outline:3px solid #f04b4b !important; outline-offset:-2px; border-radius:3px !important; }
.answer-history-delta { margin:0; font-size:17px; font-variant-numeric:tabular-nums; }
.answer-history-delta.positive { color:#0b5732; }
.answer-history-delta.negative { color:#c62828; }
.answer-history-date { grid-column:6; justify-self:end; color:#637780; font-size:11px; }
.answer-history-delta-placeholder { width:76px; height:1px; }
.answer-history-state { display:flex; align-items:center; gap:10px; flex:none; min-width:0; }
.answer-history-hand { display:flex; align-items:center; flex:none; gap:3px; }
.answer-history-state .tile { flex:none; width:25px; height:35px; padding:0; }
.answer-history-melds { display:flex; align-items:center; flex:none; gap:5px; margin-left:5px; }
.answer-history-melds .meld { flex:none; height:36px; }
.answer-history-melds .meld-cell { inline-size:24px; min-block-size:35px; }
.answer-history-melds .meld-face { block-size:35px; }
.answer-history-melds .meld-called { inline-size:35px; }
.answer-history-melds .meld-called .meld-face { block-size:24px; }
.profile-empty { margin:14px 0 0; color:#637780; }
.profile-rename-dialog { width:min(440px,calc(100vw - 32px)); padding:0; border:1px solid #9bbbab; border-radius:14px; background:#123e32; color:#f2f4e6; box-shadow:0 18px 60px #0009; }
.profile-rename-dialog::backdrop { background:#0009; }
.profile-rename-dialog form { padding:24px; }
.profile-rename-dialog h2 { margin:0 0 18px; color:#fff1bd; font-size:22px; }
.profile-rename-dialog label { display:block; font-weight:700; }
.profile-rename-dialog input { color:#18332c; background:#fffef4; }
.profile-rename-error { min-height:20px; margin:10px 0 0; color:#ff938d; }
.profile-dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:16px; }
.profile-rename-submit { border-color:#f1d477; background:#197b55; }
.profile-rename-submit:disabled { opacity:.6; }
@media(max-width:700px) {
  .profile-page { padding:20px 14px; }
  .profile-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:16px 0 20px; }
  .profile-stat { min-height:86px; padding:12px; }
  .profile-heading { align-items:flex-start; }
  .profile-heading-actions { gap:7px; }
  .profile-share-button { min-height:40px; padding:7px 10px; font-size:13px; }
  .profile-name-line { gap:12px; }
  .profile-rating-chart-section { padding:14px 10px 9px; }
  .profile-rename-button { min-height:38px; padding:7px 10px; font-size:13px; white-space:nowrap; }
  .answer-history-list { grid-template-columns:1fr; }
  .answer-history-head { grid-template-columns:28px 68px max-content max-content max-content minmax(0,1fr); column-gap:7px; }
  .answer-history-date { margin-left:auto; }
  .answer-history-state { gap:7px; }
  .answer-history-delta-placeholder { width:68px; }
}
@media(max-width:700px) {
  main { height:calc(100dvh - 42px); }
  .answer-overlay-controls { top:8px; right:8px; gap:6px; flex-wrap:wrap; justify-content:flex-end; max-width:calc(100vw - 16px); }
  .answer-timer { top:68%; right:10%; font-size:clamp(68px,16vmin,104px); }
  .answer-result-summary { top:8px; gap:4px; }
  .result-rank { font-size:clamp(38px,10vw,58px); }
  .result-rating-line { gap:7px; }
  .result-rating-caption { font-size:17px; }
  .result-rating-before { font-size:23px; }
  .result-rating-arrow { font-size:26px; }
  .result-rating-after { font-size:40px; }
  .results-toggle { min-height:38px; padding:6px 9px; font-size:12px; }
  .chart-metric-toggle { min-height:48px; padding:8px 14px; font-size:16px; }
  .next-button { min-width:220px; min-height:60px; margin-top:8px; padding:10px 18px; font-size:23px; }
  .share-button { min-width:220px; min-height:48px; padding:9px 18px; font-size:19px; }
  .answer-grade-splash img { width:min(58vw, 240px); height:min(58vw, 240px); }
}
.leaderboard-page{width:100%;max-width:none;height:100%;overflow-y:auto;overscroll-behavior:contain;margin:0;padding:clamp(20px,4vw,48px);background:#fff;color:#24343c;scrollbar-color:#b7c4ca #f2f5f6;user-select:text;-webkit-user-select:text}
.leaderboard-heading{display:flex;align-items:end;justify-content:space-between;gap:20px;padding-bottom:20px;border-bottom:1px solid #dce3e6}
.leaderboard-heading h1{margin:0;font-size:clamp(28px,4vw,38px)}
.leaderboard-eyebrow{margin:0 0 5px;color:#637780;font-size:13px}
.leaderboard-updated{margin:0;color:#637780;font-size:13px;white-space:nowrap}
.leaderboard-switch{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 8px}
.leaderboard-switch a{display:inline-flex;align-items:center;min-height:38px;padding:7px 14px;border:1px solid #d4dfe3;border-radius:8px;background:#f8fafb;color:#34495e;font-weight:700;text-decoration:none}
.leaderboard-switch a:hover{background:#eef3f5}
.leaderboard-switch a.active{border-color:#34495e;background:#34495e;color:#fff}
.leaderboard-message{margin:18px 0;color:#637780}
.leaderboard-table-wrap{overflow-x:auto}
.leaderboard-table{width:100%;table-layout:fixed;border-collapse:collapse;margin-top:16px;font-variant-numeric:tabular-nums}
.leaderboard-col-position{width:9%}.leaderboard-col-rank{width:13%}.leaderboard-col-value{width:17%}.leaderboard-col-name{width:35%}.leaderboard-col-last-played{width:26%}
.leaderboard-table th,.leaderboard-table td{padding:12px 14px;border-bottom:1px solid #e3e8ea;text-align:left;white-space:nowrap}
.leaderboard-table th{background:#f2f5f6;color:#52636b;font-size:13px;font-weight:700}
.leaderboard-table tbody tr:hover{background:#f6f9fa}
.leaderboard-table tbody .leaderboard-ad-row:hover{background:transparent}
.leaderboard-table .leaderboard-ad-row td{height:106px;padding:8px 0;border-bottom:1px solid #e3e8ea}
.leaderboard-ad{display:flex;min-height:90px;align-items:center;justify-content:center;overflow:hidden;margin:0 auto}
.leaderboard-table .numeric{text-align:right}
.leaderboard-position{width:90px;color:#34495e;font-weight:750}
.leaderboard-user-link{color:#24343c;font-weight:650;text-decoration:none}
.leaderboard-user-link:hover{text-decoration:underline;text-underline-offset:3px}
.leaderboard-table .last-played{text-align:right;color:#52636b}
.leaderboard-table .last-played-heading{text-align:right}
@media(max-width:800px){.page-ad{min-height:60px}.leaderboard-table .leaderboard-ad-row td{height:76px}}
@media(max-width:680px){.leaderboard-page{padding:20px 14px}.leaderboard-heading{align-items:flex-start;flex-direction:column;gap:8px}.leaderboard-table th,.leaderboard-table td{padding:10px 8px;font-size:13px}.leaderboard-position{width:auto}.leaderboard-col-position{width:9%}.leaderboard-col-rank{width:14%}.leaderboard-col-value{width:19%}.leaderboard-col-name{width:32%}.leaderboard-col-last-played{width:26%}}
@media(max-width:500px){.page-ad{min-height:50px;margin:14px auto}.leaderboard-table .leaderboard-ad-row td{height:66px}}
.settings-page{width:100%;height:100%;overflow-y:auto;overscroll-behavior:contain;margin:0;padding:clamp(20px,4vw,48px);background:#fff;color:#24343c;scrollbar-color:#b7c4ca #f2f5f6;user-select:text;-webkit-user-select:text}
.settings-heading,.settings-section{width:min(100%,900px);margin-right:auto;margin-left:auto}
.settings-heading{padding-bottom:18px;border-bottom:1px solid #dce3e6}
.settings-heading h1{margin:0;font-size:clamp(30px,4vw,40px)}
.settings-section{margin-top:24px;padding:22px 24px;border:1px solid #dce3e6;border-radius:12px;background:#f8f9fa}
.settings-section h2{margin:0 0 14px;font-size:22px}
.settings-section p{color:#52636b;line-height:1.65}
.settings-checkbox{display:flex;align-items:center;gap:12px;min-height:44px;font-weight:650;cursor:pointer}
.settings-checkbox input{width:22px;height:22px;accent-color:#197b55}
.account-restore-form{margin-top:18px}
.settings-section label:not(.settings-checkbox){display:block;margin-bottom:7px;font-weight:700}
.settings-input-row{display:flex;align-items:stretch;gap:9px;max-width:760px}
.settings-input-row input{flex:1;min-width:0;min-height:44px;padding:9px 12px;border:1px solid #b9c8cd;border-radius:8px;background:#fff;color:#24343c;font:15px ui-monospace,monospace}
.settings-button{min-height:44px;padding:8px 17px;border:1px solid #34495e;border-radius:8px;background:#34495e;color:#fff;font:700 15px system-ui,sans-serif;white-space:nowrap;cursor:pointer}
.settings-button:hover{background:#405a73}
.settings-button.secondary{border-color:#aebdc3;background:#fff;color:#34495e}
.settings-button.secondary:hover{background:#eef3f5}
.settings-button.danger{display:block;margin-top:10px;border-color:#a63333;background:#a63333}
.settings-button.danger:hover{background:#bd3c3c}
.settings-button:disabled{opacity:.55;cursor:wait}
.settings-message{min-height:1.4em;margin:8px 0 0;color:#167345!important;font-size:14px}
.account-id-rotation-note{margin:14px 0 8px!important;font-size:14px}
.table.tile-highlight-enabled .tile.tile-hover-highlight{z-index:8;outline:5px solid #ff9d26;outline-offset:1px;box-shadow:0 0 12px 5px #ff9d268c;filter:brightness(1.08)}
.table.dora-sparkle-enabled .actual-dora-tile{overflow:visible;z-index:4}
.table.dora-sparkle-enabled .actual-dora-tile::before,.table.dora-sparkle-enabled .actual-dora-tile::after{content:"✦";position:absolute;z-index:5;color:#fff5a6;font:bold 16px/1 system-ui,sans-serif;text-shadow:0 0 4px #fff,0 0 9px #ffd52e,0 0 14px #ff9d18;pointer-events:none;animation:dora-twinkle 1.35s ease-in-out infinite}
.table.dora-sparkle-enabled .actual-dora-tile::before{top:-7px;right:-5px}
.table.dora-sparkle-enabled .actual-dora-tile::after{bottom:-5px;left:-5px;font-size:12px;animation-delay:.65s}
@keyframes dora-twinkle{0%,100%{opacity:.18;transform:scale(.45) rotate(0)}50%{opacity:1;transform:scale(1.15) rotate(35deg)}}
@media(prefers-reduced-motion:reduce){.table.dora-sparkle-enabled .actual-dora-tile::before,.table.dora-sparkle-enabled .actual-dora-tile::after{animation:none;opacity:.8}}
@media(max-width:680px){.settings-page{padding:20px 14px}.settings-section{margin-top:16px;padding:17px 14px}.settings-section h2{font-size:19px}.settings-input-row{flex-wrap:wrap}.settings-input-row input{flex-basis:100%}.settings-input-row .settings-button{flex:1}}
