/* Six-rule lobby. The table's seven palettes supply all surface colors. */
body[data-screen=lobby] .scene { background-position: center 64px; background-size: auto max(430px, 70svh); opacity: .72; }
body[data-screen=lobby] .scene-shade { background: linear-gradient(0deg, var(--page) 0%, color-mix(in srgb, var(--page) 40%, transparent) 90%); }
.game-lobby {
  width: min(1140px, calc(100% - 64px));
  margin: 0 auto;
  padding: 22px 0 26px;
}
.lobby-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.lobby-heading h1 { margin: 0; color: #fff0d4; font-size: 36px; line-height: 1.25; font-weight: 600; letter-spacing: 3px; text-shadow: 2px 2px #07121b80; }
.lobby-heading p { margin: 0; color: #e6e1ce; font-size: 15px; line-height: 1.6; text-shadow: 1px 1px #07121b90; }
.resume-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 11px 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.resume-copy { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 15px; }
.resume-copy strong { font-size: 15px; font-weight: 600; line-height: 1.4; }
.resume-copy small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.resume-banner .button { flex: 0 0 auto; min-height: 36px; padding: 7px 17px; font-size: 13px; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 24px; align-items: stretch; }
.mode-selection { display: flex; flex-direction: column; min-width: 0; }
.mode-selection > h2 { margin: 0 0 15px; color: #f8ebd4; font-size: 17px; font-weight: 500; line-height: 1.5; text-shadow: 1px 1px #07121b90; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(180px, 1fr)); flex: 1; gap: 14px; }
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  min-height: 0;
  padding: 24px 20px;
  gap: 19px;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid color-mix(in srgb, var(--line) 68%, var(--surface));
  box-shadow: inset 1px 1px #ffffff12, 3px 3px var(--theme-shadow);
  text-align: left;
  border-radius: 0;
  transition: border-color .12s, background .12s, transform .12s;
}
.mode-card:hover:not(:disabled) { background: color-mix(in srgb, var(--surface-soft) 80%, var(--surface)); border-color: var(--line); filter: none; }
.mode-card[aria-pressed=true] { border-color: var(--gold); background: color-mix(in srgb, var(--button) 13%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent), 3px 3px var(--theme-shadow); }
.mode-symbol { display: grid; place-items: center; width: 42px; height: 44px; color: var(--gold); font: 36px/1 var(--pixel-font); }
.mode-symbol svg { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.mode-card-copy { display: block; min-width: 0; }
.mode-card-copy strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.4; }
.mode-card-copy small { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.mode-check { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--gold); background: var(--gold); color: var(--surface); font-size: 13px; line-height: 1; opacity: 0; }
.mode-card[aria-pressed=true] .mode-check { opacity: 1; }
.mode-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: start;
  gap: 10px 12px;
  min-width: 0;
  padding: 20px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 1px 1px #ffffff18, 4px 4px var(--theme-shadow);
}
.mode-details > h2 { grid-column: 1 / -1; margin: 0; color: var(--ink); font-size: 23px; line-height: 1.35; font-weight: 600; }
.mode-description { grid-column: 1 / -1; margin: 0; min-height: 39px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.mode-preview { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; height: 80px; padding: 4px 0; gap: 7px; pointer-events: none; }
.mode-preview .card { --card-w: 48px; --card-h: 72px; box-shadow: 0 2px var(--paper-edge), 2px 3px var(--theme-shadow); }
.mode-preview .card:first-child { transform: translateY(3px) rotate(-7deg); }
.mode-preview .card:last-child { transform: translateY(3px) rotate(7deg); }
.mode-facts { grid-column: 1 / -1; display: grid; gap: 5px; margin: 0; padding: 3px 0 8px; list-style: none; color: var(--ink); font-size: 13px; line-height: 1.45; }
.mode-facts li { position: relative; padding-left: 13px; }
.mode-facts li::before { content: ''; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; background: var(--gold); }
.lobby-options { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding-top: 11px; border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.lobby-options label { display: flex; flex-direction: column; min-width: 0; gap: 7px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.lobby-options select { min-width: 0; width: 100%; min-height: 36px; padding: 7px 9px; background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); border-radius: 0; font-size: 13px; }
.mode-details #start-button { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 44px; margin: 4px 0 0; padding: 10px 12px; font-size: 16px; }
.mode-details .mode-rules { min-width: 0; min-height: 32px; margin: 0; padding: 5px 2px; background: transparent; border: 0; color: var(--muted); font-size: 13px; font-weight: 500; box-shadow: none; text-align: left; }
.mode-details > .quiet, .mode-details > .text-button, .mode-details > .fairness-entry { display: flex; justify-content: flex-end; align-items: center; width: auto; min-width: 0; min-height: 32px; margin: 0; padding: 5px 2px; background: transparent; border: 0; color: var(--gold); font-size: 13px; font-weight: 500; box-shadow: none; text-decoration: none; }
.mode-details > .fairness-entry svg { width: 16px; height: 16px; flex: 0 0 16px; }
.mode-details > .mode-rules { grid-column: 1; justify-content: flex-start; }
.mode-details > .fairness-entry { grid-column: 2; }
.mode-details .mode-rules:hover, .mode-details > .quiet:hover, .mode-details > .text-button:hover, .mode-details > .fairness-entry:hover { color: var(--ink); background: transparent; }

/* The three jokers use the same cream paper and pixel geometry as the courts. */
.card.face.joker { color: #294c68; }
.card.face.joker-2 { color: #b8504a; }
.card.face.joker-3 { color: #95713b; }
.card.joker .joker-art { position: absolute; left: 18%; top: 9%; width: 64%; height: 82%; pointer-events: none; }
.card.joker .joker-corner { width: 25%; gap: 3px; }
.card.joker .joker-corner .suit-pixel { width: 100%; margin: 0; }
.card.joker .joker-index { display: block; width: 82%; height: auto; aspect-ratio: 3 / 1; flex: 0 0 auto; }
.card.joker.small .joker-corner { gap: 1px; }
.card.joker.small .joker-art { left: 17%; width: 66%; }

/* Rule cues stay quiet, while scores continue to own the right-hand panel. */
.score-panel .score-heading:has(+ .mode-table-label) { margin-bottom: 6px; }
.mode-table-label { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.knock-limit-note { margin-left: 10px; color: var(--table-ink); font-size: 12px; font-weight: 400; white-space: nowrap; }
.hollywood-board { display: grid; gap: 0; margin: 0 0 13px; border: 1px solid var(--line); color: var(--ink); }
.hollywood-board > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; align-items: center; min-height: 30px; padding: 5px 9px; font-size: 12px; line-height: 1.4; }
.hollywood-board > div + div { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.hollywood-board b, .hollywood-board strong { font: 16px/1.25 var(--pixel-font); color: var(--gold); }
.hollywood-board small { color: var(--muted); font-size: 11px; }
.hollywood-board strong i { font-style: normal; color: var(--muted); }
.hollywood-column.complete { background: var(--surface-soft); }
.mode-rule-list { margin: 20px 0; padding-left: 24px; color: var(--ink); font-size: 14px; line-height: 1.8; }
.mode-rule-list li { padding-left: 5px; margin: 9px 0; }
.mode-rule-list li::marker { color: var(--gold); font-weight: 600; }
dialog[data-kind=help] .mode-description { min-height: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

@media (min-width: 851px) and (max-height: 760px) {
  .game-lobby { padding-top: 17px; padding-bottom: 17px; }
  .lobby-heading { margin-bottom: 15px; }
  .lobby-heading h1 { font-size: 32px; }
  .resume-banner { margin-bottom: 12px; padding-block: 8px; }
  .mode-card { padding: 18px; gap: 16px; }
  .mode-grid { grid-template-rows: repeat(2, minmax(168px, 1fr)); }
  .mode-details { gap: 8px 10px; padding: 16px 18px; }
  .mode-details > h2 { font-size: 21px; }
  .mode-preview { height: 68px; }
  .mode-preview .card { --card-w: 42px; --card-h: 63px; }
  .mode-description { min-height: 36px; font-size: 12px; }
  .mode-facts { gap: 4px; padding-bottom: 5px; font-size: 12px; }
  .lobby-options { padding-top: 9px; }
  .mode-details #start-button { margin-top: 2px; }
}
@media (min-width: 851px) and (max-width: 1080px) {
  .game-lobby { width: calc(100% - 44px); }
  .lobby-grid { grid-template-columns: minmax(0, 1fr) 314px; gap: 18px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(120px, 1fr)); gap: 12px; }
  .mode-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 13px; padding: 16px 14px; }
  .mode-symbol { width: 30px; height: 36px; font-size: 28px; }
  .mode-card-copy strong { font-size: 15px; }
  .mode-card-copy small { font-size: 12px; }
  .mode-check { top: 7px; right: 7px; width: 15px; height: 15px; font-size: 11px; }
}
@media (max-width: 850px) {
  body[data-screen=lobby] .scene { background-position: center 56px; background-size: auto 540px; }
  .game-lobby { width: min(620px, calc(100% - 40px)); padding: 24px 0 28px; }
  .lobby-heading { display: block; margin-bottom: 22px; }
  .lobby-heading h1 { font-size: 32px; }
  .lobby-heading p { margin-top: 8px; font-size: 14px; }
  .resume-banner { padding: 12px; gap: 12px; }
  .resume-copy { display: block; }
  .resume-copy strong { display: block; font-size: 14px; }
  .resume-copy small { display: block; margin-top: 3px; font-size: 12px; }
  .resume-banner .button { min-height: 38px; padding-inline: 12px; }
  .lobby-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .mode-selection > h2 { font-size: 15px; margin-bottom: 12px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(130px, 1fr)); gap: 12px; }
  .mode-card { padding: 17px 16px; gap: 13px; }
  .mode-symbol { width: 30px; height: 30px; font-size: 28px; }
  .mode-card-copy strong { font-size: 16px; margin-bottom: 5px; }
  .mode-card-copy small { font-size: 12px; line-height: 1.5; }
  .mode-check { top: 10px; right: 10px; width: 17px; height: 17px; font-size: 12px; }
  .mode-details { padding: 22px; gap: 12px; }
  .mode-description { min-height: 0; font-size: 14px; line-height: 1.6; }
  .mode-preview { height: 86px; }
  .mode-preview .card { --card-w: 52px; --card-h: 78px; }
  .mode-facts { font-size: 13px; }
  .lobby-options label { font-size: 13px; }
  .lobby-options select { min-height: 42px; font-size: 14px; }
  .mode-details #start-button { min-height: 48px; }
  .score-panel:has(.mode-table-label) { grid-template-areas: 'heading ledger' 'mode ledger' 'score ledger' 'target ledger' 'art fairness'; }
  .score-panel .score-heading:has(+ .mode-table-label) { margin-bottom: 0; }
  .mode-table-label { grid-area: mode; align-self: start; margin: 0; font-size: 11px; }
  .score-panel .hand-ledger .head-row,
  .score-panel .hand-score-row,
  .score-panel .current-hand-row { grid-template-columns: 34% 26% 40%; }
  .hollywood-board { margin: 5px 0; }
  .score-panel:has(.hollywood-board) { grid-template-areas: 'heading ledger' 'mode ledger' 'score ledger' 'target ledger' 'hollywood hollywood' 'art fairness'; }
  .score-panel .hollywood-board { grid-area: hollywood; }
}
@media (max-width: 600px) {
  body[data-screen=lobby] .scene { background-position: center 88px; }
  .game-lobby { width: calc(100% - 32px); padding-top: 20px; }
  .lobby-heading h1 { font-size: 30px; }
  .lobby-heading p { font-size: 13px; }
  .mode-grid { gap: 10px; grid-template-rows: repeat(3, minmax(142px, 1fr)); }
  .mode-card { padding: 16px 13px; gap: 12px; }
  .mode-card-copy strong { font-size: 15px; }
  .mode-card-copy small { font-size: 12px; line-height: 1.55; }
  .mode-details { padding: 20px 18px; }
  .mode-details > h2 { font-size: 23px; }
  .lobby-options { gap: 10px; }
  .knock-limit-note { margin-left: 5px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .mode-card { transition: none; } }
