/* The default table keeps its existing layout. Compact is a personal, opt-in view. */
.r-market-zone { display: contents; }
.r-seat-laid { display: none; }
.is-compact .r-discard-event .r-latest-card-value { display: none; }
.r-sheet-error { color: var(--text); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: 12px; margin-bottom: 14px; font-size: 14px; }
.r-layout-tools { display: flex; align-items: center; gap: 9px; }
.r-layout-switch { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.r-layout-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 13px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; }
.r-layout-switch button[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--accent) 28%,transparent); }
.r-expand-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-raised); }
.r-expand-button:hover { color: var(--text); border-color: var(--accent); }
.r-info-button { font-size: 13px; padding-inline: 12px; }
.rummy-board.is-compact { --r-compact-gap: 12px; padding-bottom: 20px; }
.is-compact > .table-header { padding: 18px 0 16px; }
.is-compact > .game-layout { display: block; }
.is-compact .table-column { display: grid; grid-template-columns: 250px minmax(0,1fr); grid-template-areas: 'status status' 'players players' 'goal goal' 'market melds' 'hand hand' 'pause pause'; gap: var(--r-compact-gap); align-items: start; }
.is-compact .table-status { grid-area: status; margin: 0; font-size: 12px; }
.is-compact .r-seating { grid-area: players; display: flex; gap: 8px; padding: 3px 1px 6px; border: 0; border-radius: 0; background: none; margin: 0; overflow-x: auto; scrollbar-width: thin; }
.is-compact .r-seat { flex: 1 0 175px; min-width: 0; gap: 10px; padding: 10px 12px; min-height: 72px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.is-compact .r-seat.active { border-color: var(--accent); background: linear-gradient(105deg,var(--accent-soft),var(--surface)); box-shadow: none; }
.is-compact .r-seat-avatar { flex-basis: 32px; }
.is-compact .r-seat-avatar img { width: 32px; height: 32px; }
.is-compact .r-seat-identity > strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-compact .r-seat-identity > small { font-size: 12px; margin-top: 3px; }
.is-compact .r-seat-collecting, .is-compact .r-opened { min-height: 40px; }
.is-compact .r-seat-collecting strong, .is-compact .r-opened small { display: none; }
.is-compact .r-opened strong { font-size: 12px; }
.is-compact .r-opened-label > svg:last-child { display: none; }
.is-compact .r-goal { grid-area: goal; margin: 0; padding: 11px 16px; border-radius: 19px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 18px; align-items: center; }
.is-compact .r-goal-heading { gap: 12px; grid-column: 1; grid-row: 1 / 3; }
.is-compact .r-goal .eyebrow { font-size: 9px; }
.is-compact .r-goal h2 { font-size: 19px; margin-top: 3px; }
.is-compact .r-round-number { font-size: 27px; }
.is-compact .r-goal-chips { display: none; }
.is-compact .r-goal-meta { display: flex; justify-content: flex-end; gap: 6px 12px; margin: 0; border: 0; padding: 0; }
.is-compact .r-goal-meta > span { font-size: 11px; }
.is-compact .r-progress { grid-column: 2; margin: 0; min-width: 185px; }
.is-compact .r-hand-panel { display: contents; }
.is-compact .r-hand-panel > .hand-heading { display: none; }
.is-compact .r-market-zone { grid-area: market; display: flex; flex-direction: column; padding: 13px; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); min-width: 0; }
.r-compact-turn { display: flex; align-items: center; gap: 7px; min-height: 29px; font-size: 13px; }
.r-compact-turn strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.r-compact-turn > span:last-child { color: var(--muted); font-size: 11px; white-space: nowrap; }
.r-compact-turn.is-mine { color: var(--accent); }
.is-compact .r-piles { margin: 0; padding: 13px 0; gap: 14px; }
.is-compact .r-pile { min-width: 0; flex: 1; padding: 4px; gap: 6px; }
.is-compact .r-pile .playing-card, .is-compact .r-empty-card { width: 64px; height: 96px; }
.is-compact .r-pile strong { font-size: 12px; margin: 4px 0 0; }
.is-compact .r-pile small, .is-compact .r-discard-author { font-size: 11px; line-height: 1.4; }
.is-compact .r-buy-interest { margin: 7px 0 0; padding: 9px; gap: 7px; flex-wrap: wrap; }
.is-compact .r-buy-interest > svg { display: none; }
.is-compact .r-buy-interest strong { font-size: 12px; }
.is-compact .r-buy-interest small { font-size: 11px; margin-top: 2px; }
.is-compact .r-buy-interest .button { font-size: 12px; padding: 7px 10px; }
.is-compact .r-discard-recap { margin: 11px 0 0; }
.is-compact .r-discard-recap > .eyebrow { font-size: 9px; letter-spacing: .7px; }
.is-compact .r-discard-event { padding: 7px 9px; gap: 9px; }
.is-compact .r-discard-event > .playing-card { flex-basis: 30px; width: 30px; height: 45px; }
.is-compact .r-discard-event small { display: none; }
.is-compact .r-discard-event strong { font-size: 12px; }
.r-table-overview { grid-area: melds; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); overflow: hidden; min-width: 0; }
.r-table-overview > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line); }
.r-table-overview > header > div { display: flex; gap: 9px; align-items: center; min-width: 0; }
.r-table-overview > header > div > svg { color: var(--r-mint); }
.r-table-overview header strong { font: 700 17px Manrope,sans-serif; }
.r-table-overview header span { color: var(--muted); font-size: 12px; }
/* Let vertical swipes continue on the page at either end of the embedded board.
   Full containment belongs to the expanded dialog, not this in-page preview. */
.r-overview-scroll { height: auto; max-height: 292px; overflow: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding: 10px; }
.r-overview-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.r-overview-meld { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px 8px; padding: 9px 10px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.r-overview-meld:hover { background: var(--surface-raised); border-color: color-mix(in srgb,var(--accent) 45%,var(--line)); }
.r-overview-owner { grid-column: 1; grid-row: 1; min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.r-overview-owner strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.r-overview-owner small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.r-overview-cards { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 6px; padding: 2px 1px 5px; min-width: 0; overflow-x: auto; scrollbar-width: thin; overscroll-behavior-x: contain; }
.r-overview-cards .playing-card { width: 52px; height: auto; aspect-ratio: 2/3; border-radius: 5px; flex-shrink: 0; }
.r-overview-meld > svg { grid-column: 2; grid-row: 1; color: var(--muted); }
.r-overview-empty { display: flex; align-items: center; justify-content: center; height: 100%; gap: 12px; color: var(--muted); font-size: 13px; }
.r-overview-empty > svg { color: var(--r-mint); opacity: .65; }
.is-compact .r-workbench { grid-area: hand; padding: 10px 15px 0; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); min-width: 0; }
.is-compact .your-turn .r-workbench { border-color: var(--accent); background: linear-gradient(150deg,var(--surface),color-mix(in srgb,var(--accent) 6%,var(--bg))); }
.is-compact .r-workbench-head { position: static; background: none; padding: 0 0 5px; margin: 0 0 5px; border: 0; }
.is-compact .r-workbench .r-hand-label strong { font-size: 20px; }
.is-compact .r-workbench .r-hand { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 10px 4px 15px; }
.is-compact .r-workbench .r-hand-card { flex: 0 0 88px; width: 88px; border-radius: 10px; }
.is-compact .r-workbench .r-hand-card.selected { z-index: 4; }
.is-compact .r-drafts { margin-top: 5px; padding-bottom: 6px; gap: 6px; }
.is-compact .r-drafts > button { min-height: 44px; min-width: 105px; padding: 6px 9px; gap: 7px; border-radius: 11px; }
.is-compact .r-drafts small { margin-top: 2px; }
.is-compact .r-draft-number { flex-basis: 22px; height: 22px; border-radius: 7px; }
.is-compact .r-hand-dock { position: static; margin: 0 -15px; padding: 0 15px 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 23px 23px; background: var(--surface-raised); }
.is-compact .r-selection-toolbar { min-height: 37px; }
.is-compact .r-selection-toolbar .text-button { min-height: 37px; }
.is-compact .r-hand-dock .r-hand-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.is-compact .is-opened .r-hand-dock .r-discard { grid-column: auto; }
.is-compact .r-hand-dock .button { min-height: 44px; font-size: 13px; }
.r-compact-decision { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.r-compact-decision strong { display: block; font-size: 14px; }
.r-compact-decision small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.r-compact-decision.r-buy-prompt { background: none; border: 0; border-radius: 0; margin: 0; flex-wrap: nowrap; padding-bottom: 0; }
.r-decision-card > .playing-card { width: 38px; height: 57px; flex-shrink: 0; }
.r-compact-decision .r-buy-actions { width: auto; }
.is-compact .r-compact-decision .button { flex: 0 0 auto; padding: 10px 18px; }
.r-draw-open .playing-card { width: 24px; height: 36px; border-radius: 4px; }
.r-draw-decision { border-bottom: 1px solid var(--line); }
.r-request-decision { flex-wrap: nowrap; border-bottom: 1px solid var(--line); }
.r-request-decision.is-requested strong { color: var(--r-mint); }
.is-compact .r-workbench { scroll-margin-block: calc(var(--header-height) + 12px) 85px; }
.is-compact .r-overview-empty { min-height: 60px; }
.is-compact .r-table-overview:has(.r-overview-empty) .r-overview-scroll { height: 75px; }
.is-compact .r-compact-turn button { display: inline-flex; gap: 7px; align-items: center; text-align: left; min-height: 36px; min-width: 0; flex: 1; padding: 0; }
body:has(.rummy-board.is-compact) .mobile-turn-guide { display: none; }
.is-compact .r-workbench.hand-expanded .r-hand { display: grid; grid-template-columns: repeat(auto-fill,minmax(85px,1fr)); gap: 13px 10px; }
.is-compact .r-workbench.hand-expanded .r-hand-card { width: 100%; }
.is-compact .r-pause-notice { grid-area: pause; margin: 0; position: static; }
.is-compact .r-hand-panel > .r-hint { grid-column: 1 / -1; margin: 0; }
/* Scale the printed details with each card, including tiny purchase previews. */
.is-compact .playing-card { container-type: inline-size; }
.is-compact .playing-card .card-corner { top: 6%; left: 7%; font-size: 14cqw; }
.is-compact .playing-card .card-corner b { font-size: 23cqw; }
.is-compact .playing-card .corner-bottom { top: auto; left: auto; right: 7%; bottom: 6%; }
.is-compact .r-hand-card .card-corner { font-size: 17cqw; }
.is-compact .r-hand-card .card-corner b { font-size: 27cqw; }
.is-compact .playing-card .joker-label { font-size: 8cqw; letter-spacing: .02em; }
.is-compact .playing-card .classic-court b { font-size: 36cqw; }
.is-compact .playing-card .classic-court > span { font-size: 25cqw; }
.is-compact .card-back .back-frame { position: absolute; inset: 7%; height: auto; grid-template-columns: minmax(0,1fr); container-type: inline-size; }
.is-compact .card-back .back-mark { font-size: 60cqw; }
.is-compact .card-back .back-mark > span { font-size: .45em; top: -.08em; right: -.3em; }
.app-shell[data-back=syntax] .is-compact .card-back:not([data-back]) .back-mark,
.is-compact .card-back[data-back=syntax] .back-mark { font-size: 0; }
.r-compact-sheet { width: min(920px,calc(100% - 40px)); max-width: none; max-height: min(850px,calc(100dvh - 48px)); padding: 0; border: 1px solid var(--line); border-radius: 25px; color: var(--text); background: var(--bg); overflow: auto; overscroll-behavior: contain; box-shadow: var(--shadow); }
.r-compact-sheet::backdrop { background: #070910b3; backdrop-filter: blur(5px); }
.r-sheet-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.r-sheet-header h2 { font-size: 24px; margin-top: 3px; }
.r-sheet-header .eyebrow { font-size: 9px; }
.r-sheet-header .round-button { width: 44px; height: 44px; }
.r-sheet-content { padding: 16px 22px 24px; }
.r-compact-sheet .r-table-melds { margin: 0; }
.r-compact-sheet .r-table-melds > .section-heading { display: none; }
.r-compact-sheet .game-sidebar { display: block; padding: 0; }
.r-compact-sheet .activity-panel { display: block; }
.r-compact-sheet .game-sidebar > section { margin-bottom: 16px; }
.r-sheet-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-raised); }
.r-sheet-selection > strong { font-size: 13px; }
.r-sheet-selection > div { display: flex; gap: 6px; overflow: auto; max-width: 100%; padding-bottom: 4px; }
.r-sheet-selection .playing-card { width: 37px; height: 55.5px; }
.r-sheet-selection > button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: auto; font-size: 13px; }
.r-compact-sheet .r-laid-card { flex-basis: 66px; }
.r-compact-sheet .r-meld-cards .playing-card { width: 66px; }
.r-compact-sheet .r-replace { min-height: 44px; font-size: 11px; }
@media (min-width: 1200px) { .r-overview-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 1000px) and (min-width: 761px) {
  .is-compact .table-column { grid-template-columns: 205px minmax(0,1fr); }
  .r-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .rummy-board .table-header:has(.r-layout-tools) { flex-wrap: wrap; }
  .r-layout-tools { flex-basis: 100%; justify-content: space-between; }
  .r-layout-switch { padding: 3px; }
  .r-layout-switch button { min-height: 44px; padding: 7px 12px; font-size: 12px; }
  .r-info-button { min-height: 44px; font-size: 12px; padding-inline: 10px; }
  .rummy-board.is-compact { --r-compact-gap: 9px; padding-bottom: 0; }
  .is-compact > .table-header { padding: 12px 0; gap: 8px; }
  .is-compact > .table-header h1 { font-size: 20px; }
  .is-compact .table-column { grid-template-columns: minmax(0,1fr); grid-template-areas: 'players' 'goal' 'market' 'melds' 'hand' 'pause'; }
  .is-compact .table-status { display: none; }
  .is-compact .r-seating { gap: 6px; padding-bottom: 4px; }
  .is-compact .r-seat { flex: 1 0 128px; min-height: 61px; padding: 8px; gap: 7px; position: relative; }
  .is-compact .r-seat-avatar { flex-basis: 28px; }
  .is-compact .r-seat-avatar img { width: 28px; height: 28px; }
  .is-compact .r-seat-identity > strong { font-size: 12px; max-width: 112px; }
  .is-compact .r-seat-identity > small { font-size: 11px; gap: 3px 6px; }
  .is-compact .r-seat-laid { display: inline-flex; gap: 4px; align-items: center; color: var(--r-mint); }
  .is-compact .r-seat-turn { font-size: 11px; }
  .is-compact .r-seat-turn::before { margin-right: 4px; }
  .is-compact .r-seat-collecting, .is-compact .r-opened { display: none; }
  .is-compact .r-seat.has-opened { border-bottom: 2px solid var(--r-mint); }
  .is-compact .r-goal { padding: 10px 12px; grid-template-columns: minmax(0,1fr); gap: 7px; border-radius: 18px; }
  .is-compact .r-goal-heading { grid-row: 1; }
  .is-compact .r-goal-heading h2 { font-size: 17px; margin: 0; }
  .is-compact .r-goal-heading .eyebrow { display: none; }
  .is-compact .r-round-number { font-size: 22px; flex-direction: row; align-items: baseline; }
  .is-compact .r-goal-meta { justify-content: space-between; gap: 6px; }
  .is-compact .r-goal-meta > span { font-size: 10px; }
  .is-compact .r-progress { display: none; }
  .is-compact .r-market-zone { display: grid; grid-template-columns: minmax(0,1fr) 90px; gap: 5px 12px; border-radius: 18px; padding: 8px 10px; }
  .r-compact-turn { grid-column: 1 / -1; min-height: 26px; padding-bottom: 5px; border-bottom: 1px solid var(--line); font-size: 13px; }
  .is-compact .r-piles { padding: 4px 0 0; border: 0; gap: 10px; justify-content: flex-start; }
  .is-compact .r-pile { flex: 0 0 auto; padding: 3px; gap: 3px; display: grid; grid-template-columns: 52px; align-content: start; }
  .is-compact .r-pile:nth-child(2) { grid-template-columns: 52px minmax(0,1fr); align-items: center; column-gap: 9px; flex: 1; min-width: 0; text-align: left; }
  .is-compact .r-pile .playing-card, .is-compact .r-empty-card { width: 52px; height: 78px; border-radius: 6px; grid-row: 1 / 4; }
  .is-compact .r-pile strong { display: none; }
  .is-compact .r-pile small { font-size: 11px; }
  .is-compact .r-pile:first-child small { display: none; }
  .is-compact .r-pile .r-discard-author { font-size: 11px; }
  .is-compact .r-buy-interest { grid-column: 1 / -1; grid-row: 3; margin: 3px 0 0; padding: 7px 8px; flex-wrap: nowrap; }
  .is-compact .r-discard-recap { margin: 0; padding: 4px 0 0 10px; border-left: 1px solid var(--line); align-self: center; }
  .is-compact .r-discard-recap .eyebrow { font-size: 8px; }
  .is-compact .r-discard-trail { margin: 4px 0 0; }
  .is-compact .r-discard-event { padding: 0; border: 0; background: none; gap: 6px; flex-wrap: wrap; }
  .is-compact .r-discard-event > .playing-card { display: none; }
  .is-compact .r-discard-event strong { font-size: 11px; }
  .is-compact .r-discard-event .r-latest-card-value { display: inline-flex; font-size: 16px; font-weight: 700; color: var(--text); }
  .is-compact .r-discard-event > div:last-child > span { font-size: 10px; }
  .r-table-overview { border-radius: 18px; }
  .r-table-overview > header { padding: 2px 7px 2px 12px; }
  .r-table-overview header strong { font-size: 14px; }
  .r-table-overview header span { font-size: 11px; }
  .r-table-overview > header .r-expand-button { border: 0; background: none; }
  .r-overview-scroll { max-height: 285px; padding: 7px; }
  .r-overview-grid { grid-template-columns: 1fr; gap: 7px; }
  .r-overview-meld { padding: 8px; border-radius: 11px; }
  .is-compact .r-workbench { padding: 7px 10px 0; border-radius: 19px; }
  .is-compact .r-workbench .r-hand-label strong { font-size: 16px; }
  .is-compact .r-workbench .r-hand-label > div:first-child { gap: 5px; flex-direction: row; align-items: baseline; }
  .is-compact .r-workbench .r-hand-label > div:first-child > span { font-size: 11px; }
  .is-compact .r-hand-tools { gap: 0; }
  .is-compact .r-hand-sort { padding: 2px; }
  .is-compact .r-hand-sort button { min-width: 38px; padding-inline: 6px; min-height: 40px; font-size: 11px; }
  .is-compact .r-hand-tools .r-expand-button { border: 0; background: none; min-width: 36px; }
  .is-compact .r-help-toggle { width: 36px; flex-basis: 36px; }
  .is-compact .r-workbench .r-hand { display: grid; grid-template-columns: repeat(var(--compact-hand-columns),52px); grid-template-rows: repeat(2,105px); gap: 11px 0; padding: 10px 22px 14px 4px; }
  .is-compact .r-workbench .r-hand-card { width: 70px; flex-basis: 70px; }
  .is-compact .r-hand-dock { margin: 0 -10px; padding: 1px 10px 10px; bottom: calc(73px + env(safe-area-inset-bottom)); border-radius: 0 0 19px 19px; }
  .is-compact .r-selection-toolbar, .is-compact .r-selection-toolbar .text-button { min-height: 40px; }
  .is-compact .r-selection-toolbar { gap: 8px; flex-wrap: wrap; }
  .is-compact .r-selection-toolbar .text-button { font-size: 11px; }
  .is-compact .r-selection-toolbar > span { font-size: 11px; }
  .is-compact .r-hand-dock .button { font-size: 12px; }
  .r-compact-decision { gap: 7px; flex-wrap: wrap; }
  .r-compact-decision strong { font-size: 13px; }
  .r-compact-decision small { font-size: 10px; }
  .r-decision-card > .playing-card { width: 29px; height: 43.5px; }
  .is-compact .r-compact-decision .button { padding: 9px 11px; }
  .r-compact-decision .r-buy-actions { gap: 6px; }
  .r-draw-decision > .grow { flex-basis: 100%; }
  .r-draw-decision > .button { flex: 1!important; }
  .is-compact .r-workbench.hand-expanded .r-hand { grid-template-columns: repeat(4,minmax(0,1fr)); grid-template-rows: none; gap: 12px 9px; padding-right: 4px; }
  .r-compact-sheet { width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - 16px); margin: auto 0 0; border-radius: 23px 23px 0 0; }
  .r-sheet-header { padding: 14px 16px; }
  .r-sheet-header h2 { font-size: 22px; }
  .r-sheet-content { padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
  .r-sheet-selection { padding: 8px 10px; gap: 8px; }
  .r-sheet-selection .playing-card { width: 32px; height: 48px; }
  .r-sheet-selection > strong { font-size: 12px; }
  .r-compact-sheet .r-meld-heading .button { min-height: 44px; }
}
@media (max-width: 360px) {
  .is-compact .r-workbench .r-hand-label { flex-wrap: wrap; }
  .is-compact .r-workbench .r-hand-label > div:first-child { flex: 1; }
  .is-compact .r-workbench.hand-expanded .r-hand { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .r-compact-decision.r-buy-prompt { flex-wrap: wrap; }
  .r-compact-decision.r-buy-prompt .r-buy-actions { width: 100%; }
  .r-compact-decision.r-buy-prompt .button { flex: 1; }
}
