/* Approved September 15 layout: actions beside the hand, a separate score
   panel, and one readable fairness dialog. Theme colors remain in themes.css. */

/* Header and the simplified lobby */
.topbar {
  min-height: 64px;
  height: 64px;
  padding-inline: clamp(18px, 2.4vw, 38px);
  gap: 24px;
}
.topbar .brand { flex: 0 1 auto; min-width: 0; }
.topbar .brand > span:last-child { display: flex; align-items: baseline; gap: 14px; }
.topbar .brand small { margin: 0; white-space: nowrap; }
.topbar .header-tools { flex: 0 0 auto; gap: 8px; }
.topbar .header-tools .button { min-height: 40px; padding: 8px 13px; white-space: nowrap; }
.topbar .header-tools .button + .button { border-left: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.lobby-match-summary { margin: 0; color: var(--muted); font-size: 15px; }
.start-panel .fairness-entry { margin-top: 20px; }

/* One set of reserved row heights keeps the hand still as actions change. */
.game-layout {
  --stage-height: clamp(600px, calc(100svh - 100px), 720px);
  --hand-bottom: 28px;
  --hand-label-height: 28px;
  --hand-card-band: 158px;
  --hand-control-height: 48px;
  --hand-row-gap: 12px;
  --hand-stack: calc(var(--hand-label-height) + var(--hand-card-band) + var(--hand-control-height) + 2 * var(--hand-row-gap));
  --pile-width: 78px;
  --pile-height: 117px;
  --pile-label-height: 30px;
  --pile-hand-gap: 18px;
  width: min(1480px, calc(100% - 32px));
  padding: 12px 0 24px;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 18px;
  align-items: stretch;
}
.game-layout .play-room { min-width: 0; }
.game-layout .matchbar { display: none; }
.game-layout .game-stage { height: var(--stage-height); min-height: var(--stage-height); }
.game-layout .table-rail { inset: 0; padding: 9px; }
.game-layout .table-shadow { inset: 5px -3px -4px 5px; }
.game-layout .opponent-seat { top: 17px; }
.game-layout .opponent-seat .avatar { width: 23px; height: 23px; }
.game-layout .opponent-hand { top: 49px; width: calc(100% - 80px); }
.game-layout .opponent-hand .card { --card-w: 49px; --card-h: 73.5px; }
.game-layout .opponent-hand .card:not(:first-child),
.game-layout .opponent-hand.revealed .card:not(:first-child) { margin-left: 4px; }
.game-layout .table-status {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: calc(var(--hand-bottom) + var(--hand-stack) + var(--pile-hand-gap) + var(--pile-height) + var(--pile-label-height) + 8px);
  height: 22px;
  margin: 0;
  color: var(--table-ink);
  opacity: .86;
  text-align: center;
  font-size: 13px;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.game-layout .draw-zone {
  top: auto;
  bottom: calc(var(--hand-bottom) + var(--hand-stack) + var(--pile-hand-gap));
  gap: clamp(38px, 5vw, 70px);
  align-items: flex-start;
}
.game-layout .pile .card { --card-w: var(--pile-width); --card-h: var(--pile-height); }
.game-layout .pile-caption {
  height: var(--pile-label-height);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-top: 7px;
  color: var(--table-ink);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}
.game-layout .pile-caption b { font: 20px/1 var(--pixel-font); color: var(--table-number); }
.game-layout .hand-area {
  left: 30px;
  right: 30px;
  bottom: var(--hand-bottom);
  display: grid;
  grid-template-rows: var(--hand-label-height) var(--hand-card-band) var(--hand-control-height);
  gap: var(--hand-row-gap);
  container-type: inline-size;
}
.game-layout .hand-toolbar {
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 18px;
  align-items: center;
}
.game-layout .hand-label { flex: 0 0 auto; gap: 14px; color: var(--table-ink); font-size: 14px; }
.game-layout .deadwood-inline { color: var(--table-ink); font-size: 14px; gap: 7px; }
.game-layout .deadwood-inline b { color: var(--table-number); font: 23px/1 var(--pixel-font); }
.game-layout #turn-message {
  min-width: 0;
  min-height: 0;
  margin: 0;
  color: var(--table-ink);
  font-size: 14px;
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}
.game-layout .player-hand {
  height: var(--hand-card-band);
  min-height: 0;
  padding: 16px 0 0;
  overflow: visible;
}
.game-layout .player-hand .card {
  --card-w: clamp(60px, 9.8cqw, 94px);
  --card-h: calc(var(--card-w) * 1.5);
}
.game-layout .player-hand .card:not(:first-child) {
  margin-left: min(6px, calc((100cqw - var(--count) * var(--card-w)) / (var(--count) - 1)));
}
.game-layout .hand-controls {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: clamp(16px, 3cqw, 36px);
  min-width: 0;
  height: var(--hand-control-height);
}
.hand-controls .turn-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 clamp(168px, 28cqw, 240px);
  grid-column: auto;
  gap: 12px;
  margin: 0;
}
.hand-controls .turn-tools .button {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 8px 14px;
  font-size: 15px;
  line-height: 1.3;
}
.hand-controls .turn-actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  grid-column: auto;
  flex: 0 1 420px;
  min-width: 0;
  gap: 12px;
  margin: 0;
}
.hand-controls .turn-actions .button {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.hand-controls .turn-actions .button:only-child { flex: 0 1 240px; }

/* The score sheet stays the same height as the table; art uses the remainder. */
.game-layout .score-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: var(--stage-height);
  max-height: none;
  margin: 0;
  padding: 22px 17px 18px;
  gap: 0;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
}
.score-panel::before { content: none; }
.score-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.score-heading::before, .score-heading::after { content: ''; height: 1px; flex: 1 1 12px; background: var(--line); opacity: .65; }
.score-panel .panel-score {
  flex: 0 0 auto;
  min-width: 0;
  align-self: stretch;
  justify-content: center;
  gap: 9px;
  padding: 0;
  border: 0;
}
.score-panel .panel-score > span,
.score-panel .panel-score > div { min-width: 0; flex: 0 1 auto; flex-direction: row; align-items: baseline; gap: 8px; color: var(--ink); font-size: 13px; }
.score-panel .panel-score b,
.score-panel .panel-score strong { color: var(--gold); font: 34px/1.25 var(--pixel-font); }
.score-panel .panel-score i { color: var(--gold); font: 27px/1 var(--pixel-font); }
.score-target { margin: 10px 0 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }
.hand-ledger {
  min-width: 0;
  flex: 0 1 auto;
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line) var(--surface);
}
.hand-ledger .head-row, .hand-score-row, .current-hand-row {
  display: grid;
  grid-template-columns: 40% 30% 30%;
  align-items: center;
  position: relative;
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 0 10px;
  gap: 0;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.hand-ledger .head-row { position: sticky; top: 0; z-index: 1; min-height: 35px; background: var(--surface-soft); color: var(--muted); }
.hand-score-row { border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); background: transparent; color: var(--ink); }
.hand-score-row > span:not(:first-child) { font: 19px/1.2 var(--pixel-font); }
.hand-score-row > span:last-child { padding-right: 7px; }
.hand-score-row::after { content: '›'; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 19px; }
.hand-score-row:hover:not(:disabled), .hand-score-row:focus-visible { background: var(--surface-soft); filter: none; }
.current-hand-row { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-soft) 65%, transparent); color: var(--ink); }
.current-hand-row > span:nth-child(2):last-child { grid-column: 2 / 4; color: var(--gold); font-size: 13px; }
.history-gap { margin: 0; padding: 9px 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.score-panel .panel-art {
  display: block;
  flex: 1 1 140px;
  min-height: 100px;
  max-height: none;
  margin: 13px -9px 10px;
  background: var(--panel-art) center / contain no-repeat;
  image-rendering: pixelated;
}
.score-panel .fairness-entry { grid-column: auto; flex: 0 0 46px; min-height: 46px; margin: 0; padding: 9px 8px; font-size: 15px; }
.score-panel .fairness-entry svg { width: 22px; height: 22px; flex: 0 0 22px; }

/* One-column fairness dialog. All scrolling belongs to the dialog itself. */
dialog.proof-dialog.proof-single { width: min(850px, calc(100vw - 40px)); max-height: calc(100svh - 32px); }
.proof-single .dialog-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 18px; padding: 16px 24px; }
.proof-single .dialog-inner > h2 { grid-column: 1 / -1; margin: 0 0 12px; padding: 0 36px 8px 0; border-bottom: 1px solid var(--line); font-size: 24px; line-height: 1.3; }
.proof-single .dialog-inner > .icon-button:first-child { top: 13px; right: 20px; width: 31px; height: 31px; border: 1px solid var(--line); color: var(--ink); }
.proof-hand-selector { display: flex; align-items: center; gap: 14px; min-width: 0; }
.proof-hand-selector label { color: var(--muted); font-size: 14px; flex: 0 0 auto; }
.proof-hand-selector select { min-width: 0; width: min(255px, 100%); min-height: 38px; padding: 7px 10px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.proof-score-context { align-self: center; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.proof-main { grid-column: 1 / -1; min-width: 0; margin-top: 12px; container-type: inline-size; }
.proof-single #proof-form { margin: 0; }
.proof-single #proof-form > label { display: block; margin: 0 0 7px; color: var(--ink); font-size: 13px; line-height: 18px; }
.proof-seed-controls { display: grid; grid-template-columns: minmax(0, 1fr) 146px; gap: 14px; }
.proof-single .proof-seed-controls input { min-width: 0; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); font: 16px/1.4 ui-monospace, monospace; border-radius: 0; }
.proof-single .proof-seed-controls input::placeholder { color: var(--muted); opacity: .8; }
.proof-single .proof-seed-controls .button { min-width: 0; min-height: 42px; margin: 0; padding: 8px 12px; font-size: 15px; }
.proof-single #proof-result { height: auto; min-height: 0; max-height: none; margin-top: 12px; overflow: visible; }
.proof-single .proof-empty { min-height: 98px; padding: 20px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); background: var(--surface-soft); color: var(--muted); text-align: center; }
.proof-single .proof-result-card { min-height: 0; align-items: center; gap: 4px; padding: 8px 0 2px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: center; }
.proof-single .proof-result-card > strong { color: var(--ink); font-size: 22px; font-weight: 600; line-height: 1.3; }
.proof-single .proof-result-card > span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.proof-single .proof-result-card.fail { background: color-mix(in srgb, #a24750 12%, var(--surface)); border-top-color: #a96c72; }
.proof-single .proof-hand { min-width: 0; margin-top: 8px; }
.proof-single .proof-hand > span { display: block; color: var(--muted); font-size: 13px; line-height: 18px; }
.proof-single .proof-card-row { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 3px; margin-top: 8px; padding-bottom: 4px; }
.proof-single .proof-card-row .card { --card-w: min(56px, calc((100cqw - 27px) / 10)); --card-h: calc(var(--card-w) * 1.5); flex: 0 0 auto; margin: 0; }
.proof-full-deck { margin-top: 6px; }
.proof-full-deck > summary { padding: 4px 0; color: var(--gold); font-size: 13px; line-height: 20px; cursor: pointer; text-align: right; }
.proof-deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 10px 6px; padding: 14px 0 4px; }
.proof-deck-grid > div { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.proof-deck-grid small { color: var(--muted); font: 12px/1.2 var(--pixel-font); }
.proof-deck-grid .card { --card-w: 39px; --card-h: 58.5px; }
.proof-technical { grid-column: 1 / -1; margin-top: 12px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); }
.proof-technical > summary { min-height: 40px; padding: 9px 13px; color: var(--ink); font-size: 14px; line-height: 20px; cursor: pointer; }
.proof-technical[open] > summary { border-bottom: 1px solid var(--line); }
.proof-single #proof-math { min-width: 0; height: auto; min-height: 0; max-height: none; padding: 17px 17px 0; border: 0; overflow: visible; }
.proof-single #proof-math h3 { margin: 0 0 5px; color: var(--ink); font-size: 16px; }
.proof-single #proof-math p, .proof-technical > p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.proof-single .algorithm-name { margin-bottom: 15px; }
.proof-single .fingerprint-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
.proof-single .fingerprint-pair code, .proof-single .compactcode, .proof-single .audit-fields dd, .proof-single .proof-details > code { background: var(--surface); color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.proof-single .proof-equation { margin: 15px 0; background: var(--surface); color: var(--ink); }
.proof-single .proof-equation > strong { color: var(--gold); }
.proof-single .proof-details { margin: 14px 0; font-size: 13px; }
.proof-single .proof-details summary { color: var(--ink); cursor: pointer; }
.proof-single .proof-details label { display: block; margin: 12px 0 5px; color: var(--muted); font-size: 12px; }
.proof-single .proof-details > code { display: block; padding: 10px; font: 12px/1.65 ui-monospace, monospace; }
.proof-technical > .audit-fields { margin: 0; padding: 0 17px 15px; }
.proof-technical > p { margin: 0; padding: 0 17px 17px; }
.proof-single .proof-locked { min-height: 132px; padding: 20px; gap: 9px; background: var(--surface-soft); color: var(--ink); }
.proof-single .proof-locked svg { width: 30px; height: 30px; flex: 0 0 30px; color: var(--gold); }
.proof-single .proof-locked strong { color: var(--ink); font-size: 18px; }
.proof-single .proof-locked p { max-width: none; color: var(--muted); font-size: 14px; }
.proof-single .sealed-seed { margin-top: 15px; }
.proof-portable { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.proof-portable > div:first-child { min-width: 0; flex: 1; }
.proof-portable strong { display: block; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.5; }
.proof-portable p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.portable-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.portable-actions .button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 9px 12px; font-size: 13px; text-align: center; text-decoration: none; }
.portable-actions .quiet { color: var(--gold); }
dialog[data-kind=seed] .seed-row { margin: 20px 0 16px; }
dialog[data-kind=seed] .sealed-seed { margin-top: 0; }
dialog[data-kind=seed] .muted { font-size: 14px; }

/* Narrow desktops retain the full score panel, with smaller hand controls. */
@media (min-width: 851px) and (max-width: 1120px) {
  .game-layout { width: calc(100% - 24px); grid-template-columns: minmax(0, 1fr) clamp(288px, 31.61vw, 354px); gap: 14px; }
  .game-layout .hand-area { left: 24px; right: 24px; }
  .game-layout .opponent-hand .card { --card-w: 43px; --card-h: 64.5px; }
  .game-layout .opponent-hand .card:not(:first-child), .game-layout .opponent-hand.revealed .card:not(:first-child) { margin-left: 2px; }
  .game-layout .hand-label { font-size: 13px; gap: 10px; }
  .game-layout #turn-message { font-size: 13px; }
  .hand-controls .turn-tools { flex-basis: 146px; gap: 9px; }
  .hand-controls .turn-tools .button { padding-inline: 8px; font-size: 14px; }
  .hand-controls .turn-actions { gap: 9px; }
  .hand-controls .turn-actions .button { padding-inline: 9px; font-size: 14px; }
}

/* Phones and tablets: keep actions on the table, move the score sheet below. */
@media (max-width: 850px) {
  .topbar { height: 56px; min-height: 56px; padding-inline: 18px; gap: 12px; }
  .topbar .brand > span:last-child { gap: 8px; }
  .topbar .header-tools { gap: 4px; }
  .topbar .header-tools .button { padding-inline: 9px; font-size: 13px; }
  .game-layout {
    --stage-height: 520px;
    --hand-bottom: 26px;
    --hand-label-height: 30px;
    --hand-card-band: 129px;
    --hand-control-height: 44px;
    --hand-row-gap: 12px;
    --pile-width: 66px;
    --pile-height: 99px;
    --pile-label-height: 28px;
    --pile-hand-gap: 17px;
    width: calc(100% - 24px);
    padding: 9px 0 18px;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .game-layout .table-rail { padding: 7px; }
  .game-layout .opponent-seat { top: 15px; }
  .game-layout .opponent-hand { top: 43px; width: calc(100% - 50px); }
  .game-layout .opponent-hand .card { --card-w: 40px; --card-h: 60px; }
  .game-layout .opponent-hand .card:not(:first-child), .game-layout .opponent-hand.revealed .card:not(:first-child) { margin-left: 2px; }
  .game-layout .hand-area { left: 22px; right: 22px; }
  .game-layout .player-hand .card { --card-w: clamp(54px, 9.8cqw, 76px); --card-h: calc(var(--card-w) * 1.5); }
  .game-layout .table-status { left: 22px; right: 22px; font-size: 12px; }
  .game-layout .pile-caption { font-size: 13px; }
  .game-layout .score-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas: 'heading ledger' 'score ledger' 'target ledger' 'art fairness';
    height: auto;
    max-height: none;
    padding: 16px 18px;
    gap: 7px 18px;
  }
  .score-panel .score-heading { grid-area: heading; align-self: center; margin: 0; font-size: 17px; }
  .score-panel .panel-score { grid-area: score; justify-content: center; gap: 8px; }
  .score-panel .panel-score > span { font-size: 12px; gap: 7px; }
  .score-panel .panel-score b { font-size: 28px; }
  .score-panel .panel-score i { font-size: 22px; }
  .score-panel .score-target { grid-area: target; align-self: start; margin: 0; padding: 0; border: 0; font-size: 13px; }
  .score-panel .hand-ledger { grid-area: ledger; max-height: 128px; align-self: start; }
  .score-panel .panel-art { grid-area: art; height: 78px; min-height: 78px; margin: 3px 0 0; background-position: center; }
  .score-panel .fairness-entry { grid-area: fairness; align-self: center; min-height: 44px; margin: 0; font-size: 14px; }
  .hand-ledger .head-row, .hand-score-row, .current-hand-row { min-height: 33px; padding-inline: 8px; font-size: 12px; }
  .hand-score-row > span:not(:first-child) { font-size: 17px; }
  .current-hand-row > span:nth-child(2):last-child { font-size: 12px; }
}

@media (max-width: 600px) {
  .topbar { height: auto; min-height: 88px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 9px 14px 7px; }
  .topbar .brand { justify-self: start; gap: 8px; font-size: 15px; }
  .topbar .brand-suit { width: 21px; height: 23px; }
  .topbar .brand small { font-size: 12px; letter-spacing: 1px; }
  .topbar .header-tools { width: 100%; justify-content: space-between; gap: 0; }
  .topbar .header-tools .button { flex: 1; min-height: 34px; padding: 6px 8px; font-size: 13px; }
  .game-layout {
    --stage-height: 500px;
    --hand-bottom: 23px;
    --hand-label-height: 38px;
    --hand-card-band: 103px;
    --hand-control-height: 44px;
    --hand-row-gap: 12px;
    --pile-width: 64px;
    --pile-height: 96px;
    --pile-label-height: 29px;
    --pile-hand-gap: 18px;
    width: calc(100% - 16px);
    gap: 10px;
    padding-top: 8px;
  }
  .game-layout .hand-area { left: 17px; right: 17px; }
  .game-layout .opponent-hand { top: 43px; width: calc(100% - 40px); }
  .game-layout .opponent-hand .card { --card-w: 31px; --card-h: 46.5px; }
  .game-layout .opponent-hand .card:not(:first-child), .game-layout .opponent-hand.revealed .card:not(:first-child) { margin-left: 1px; }
  .game-layout .opponent-seat .avatar { width: 19px; height: 19px; }
  .game-layout .opponent-seat strong { font-size: 12px; }
  .game-layout .hand-toolbar { gap: 8px; align-items: center; }
  .game-layout .hand-label { font-size: 12px; gap: 8px; }
  .game-layout .deadwood-inline { font-size: 12px; gap: 5px; }
  .game-layout .deadwood-inline b { font-size: 21px; }
  .game-layout #turn-message { font-size: 12px; line-height: 1.4; }
  .game-layout .player-hand { padding-top: 18px; }
  .game-layout .player-hand .card { --card-w: 54px; --card-h: 81px; }
  .game-layout .hand-controls { gap: 12px; }
  .hand-controls .turn-tools { flex-basis: 112px; gap: 7px; }
  .hand-controls .turn-tools .button { padding: 7px 6px; font-size: 13px; }
  .hand-controls .turn-actions { flex: 1 1 0; gap: 8px; }
  .hand-controls .turn-actions .button { padding: 7px 5px; font-size: 13px; line-height: 1.25; }
  .hand-controls .turn-actions .button:only-child { flex: 1 1 0; }
  .game-layout .score-panel { padding: 14px 12px; gap: 7px 12px; }
  .score-panel .score-heading { font-size: 15px; gap: 6px; }
  .score-panel .panel-score { gap: 4px; }
  .score-panel .panel-score > span { gap: 4px; font-size: 12px; }
  .score-panel .panel-score b { font-size: 25px; }
  .score-panel .panel-score i { font-size: 20px; }
  .score-panel .fairness-entry { font-size: 13px; gap: 7px; }
  .score-panel .fairness-entry svg { width: 18px; height: 18px; flex-basis: 18px; }
  .proof-single .dialog-inner { grid-template-columns: minmax(0, 1fr); padding: 22px 17px 20px; }
  dialog.proof-dialog.proof-single { width: calc(100vw - 24px); max-height: calc(100svh - 24px); }
  .proof-single .dialog-inner > h2 { font-size: 23px; margin-bottom: 16px; padding-bottom: 13px; }
  .proof-single .dialog-inner > .icon-button:first-child { top: 17px; right: 14px; width: 31px; height: 31px; }
  .proof-hand-selector { gap: 10px; }
  .proof-hand-selector label { font-size: 12px; }
  .proof-hand-selector select { flex: 1; width: auto; padding-inline: 9px; font-size: 14px; }
  .proof-score-context { font-size: 13px; margin-top: 10px; }
  .proof-main { margin-top: 15px; }
  .proof-seed-controls { grid-template-columns: minmax(0, 1fr) 94px; gap: 9px; }
  .proof-single .proof-seed-controls .button { padding-inline: 7px; font-size: 13px; }
  .proof-single .proof-seed-controls input { padding-inline: 9px; font-size: 16px; }
  .proof-single #proof-result { margin-top: 16px; }
  .proof-single .proof-result-card { min-height: 80px; padding: 15px 0 10px; }
  .proof-single .proof-result-card > strong { font-size: 21px; }
  .proof-single .proof-result-card > span { font-size: 12px; }
  .proof-single .proof-hand > span { font-size: 13px; }
  .proof-single .proof-card-row { gap: 2px; }
  .proof-single .proof-card-row .card { --card-w: calc((100cqw - 18px) / 10); }
  .proof-single .fingerprint-pair { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .proof-single #proof-math { padding: 14px 12px 0; }
  .proof-technical > .audit-fields { padding-inline: 12px; }
  .proof-technical > p { padding-inline: 12px; }
  .proof-portable { flex-direction: column; align-items: stretch; gap: 13px; margin-top: 16px; padding-top: 16px; }
  .portable-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .portable-actions .button { padding-inline: 7px; font-size: 12px; }
  .proof-deck-grid { grid-template-columns: repeat(auto-fill, minmax(35px, 1fr)); gap: 9px 5px; }
  .proof-deck-grid .card { --card-w: 33px; --card-h: 49.5px; }
}

@media (max-width: 370px) {
  .game-layout .hand-area { left: 15px; right: 15px; }
  .game-layout .hand-label { font-size: 11px; gap: 5px; }
  .hand-controls .turn-tools { flex-basis: 100px; gap: 6px; }
  .game-layout .hand-controls { gap: 8px; }
  .hand-controls .turn-actions { gap: 6px; }
  .hand-controls .turn-actions .button { font-size: 12px; }
  .score-panel .panel-score > span { flex-direction: column; align-items: center; gap: 0; }
  .game-layout .opponent-hand .card { --card-w: 28px; --card-h: 42px; }
}
