/* Match geometry lives here. Component art and game-state cues live in board.css.
   Use available viewport height, intrinsic grid rows and one board scroller. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.match-active {
  --match-height: 100vh;
  --control-size: 34px;
  --hand-art-height: 100px;
  height: var(--match-height);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@supports (height: 100dvh) {
  body.match-active { --match-height: 100dvh; }
}
body.match-active *, body.match-active *::before, body.match-active *::after { box-sizing: border-box; }
body.match-active > .site-header {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  min-height: 42px;
  padding: calc(2px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 2px max(8px, env(safe-area-inset-left, 0px));
  z-index: 60;
}
body.match-active > .site-header .site-brand { flex: 1; min-width: 0; padding: 0; }
body.match-active > .site-header .site-brand h1 { font-size: clamp(16px, 1.7vw, 20px); margin: 0; }
body.match-active > .site-header .eyebrow,
body.match-active > .site-header .site-brand h1 span { display: none; }
/* A match header is a HUD, not a profile card: keep identity on one line and
   return vertical space to the board. Full cosmetics remain in Profile. */
body.match-active > .site-header .menu-toggle,
body.match-active .match-settings > summary { min-height: 36px; padding-block: 5px; }
body.match-active > .site-header .profile-corner { margin: 0; width: auto; max-width: 190px; height: 36px; min-height: 36px; overflow: hidden; padding: 2px 7px; }
body.match-active > .site-header .profile-corner .identity-badge { flex-wrap: nowrap; gap: 6px; }
body.match-active > .site-header .profile-corner .identity-badge > span:last-child { display: block; }
body.match-active > .site-header .profile-corner .equipped-calling-card { display: none; }
body.match-active > .site-header .portrait-image { width: 24px; height: 30px; flex-basis: 24px; }
body.match-active > main {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 4px max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
}
body.match-active footer { display: none; }
body.match-active #notice:not(:empty) { flex: none; max-height: 36px; overflow: auto; margin: 0; padding: 4px 8px; font-size: 12px; }
body.match-active #match:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  gap: 6px;
  padding: 0;
  overflow: hidden;
}
#match .match-layout {
  display: block;
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding: 14px;
  -webkit-overflow-scrolling: touch;
}
#match #board { display: flex; flex-direction: column; width: 100%; height: auto; min-height: 100%; min-width: 0; }
#match .mat-heading, #match .board-hand-dock, #match #manualBanner { display: none; }
#match .playmat {
  display: grid;
  flex: 1 0 auto;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(144px, 170px) minmax(0, 1fr) minmax(0, 1fr) minmax(144px, 170px);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: 'opponent rival friendly player' 'opponent field field player';
  gap: 16px 10px;
  padding: 15px 8px 8px;
  overflow: visible;
}
#match .mat-zone { min-width: 0; min-height: 0; padding: 14px 7px 7px; }
#match .mat-label { font-size: 10px; line-height: 1.2; min-height: 20px; top: -10px; padding: 3px 8px; }
#match .resources-own { grid-area: player; }
#match .resources-rival { grid-area: opponent; }
#match .player-resources {
  display: grid;
  min-height: 0;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(60px, 1fr) auto;
  grid-template-areas: 'fixer fixer' 'legends legends' 'eddies eddies' 'deck trash';
  gap: 16px 6px;
}
#match .player-resources > .mat-zone { grid-column: auto; align-self: stretch; }
#match .player-resources > .mat-fixer { grid-area: fixer; }
#match .player-resources > .mat-legends { grid-area: legends; }
#match .player-resources > .mat-eddies { grid-area: eddies; }
#match .player-resources > .mat-deck { grid-area: deck; }
#match .player-resources > .mat-trash { grid-area: trash; }
#match .player-resources .mat-fixer .mat-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; height: auto; }
#match .player-resources .fixer-die {
  width: 100%; min-width: 0; max-width: none; height: var(--control-size); min-height: var(--control-size); padding: 0;
  display: flex; align-items: center; justify-content: center;
}
#match .fixer-die strong { font-size: 12px; }
#match .fixer-die span { display: none; }
#match .gig-roll-source .fixer-die.can-roll { transform: none; }
#match .gig-summary { font-size: 12px; line-height: 1.35; margin: 0 0 5px; overflow-wrap: anywhere; }
#match .mat-dice { min-height: 28px; gap: 5px; flex-wrap: wrap; }
#match .mat-die { position: relative; flex: 0 0 42px; width: 42px; min-width: 42px; height: 40px; min-height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; }
#match .mat-die b { font-size: 18px; }
#match .mat-die span { position: absolute; right: 2px; bottom: 0; font-size: 9px; }
#match .mat-legend-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
#match .mat-legend-slot { padding: 3px; min-height: 0; gap: 3px; }
#match .legend-art { height: 68px; min-height: 0; display: flex; justify-content: center; align-items: center; overflow: hidden; }
#match .legend-art .card-art { width: 100%; height: 68px; object-fit: contain; }
#match .legend-back { min-height: 68px; height: 68px; }
#match .legend-back .card-back-visual { min-height: 0; height: 68px; width: 100%; }
#match .legend-name { display: none; }
#match .legend-state { font-size: 10px; }
#match .solo-button, #match .mat-call, #match .removed-link { min-height: var(--control-size); font-size: 11px; padding: 4px; white-space: normal; overflow-wrap: anywhere; }
#match .mat-call { margin-top: 5px; }
#match .legend-gear-stack { max-height: none; }
#match .bank-total { font-size: 12px; margin: 0 0 4px; }
#match .bank-total strong { font-size: 22px; }
#match .eddie-cards { gap: 4px; min-height: 0; max-height: 100px; overflow: auto; margin: 0; }
#match .eddie-card { width: 34px; min-height: 0; gap: 2px; }
#match .eddie-card .card-back-visual { width: 30px; height: 43px; }
#match .spent-eddie { width: 44px; }
#match .back-caption { font-size: 9px; line-height: 1.3; padding: 2px 0; }
#match .mat-eddies .mat-content { min-height: 0; }
#match .mat-eddies .mat-content > .mat-empty, #match .eddie-cards > .mat-empty { display: none; }
#match .deck-back { min-height: 0; height: 83px; gap: 3px; }
#match .deck-back .card-back-visual { height: 60px; min-height: 0; width: 43px; }
#match .trash-pile { min-height: 58px; height: 58px; padding: 0 0 17px; }
#match .trash-pile .card-art { height: 41px; width: 100%; }
#match .trash-pile .mat-empty { font-size: 11px; }
#match .pile-count { bottom: 0; font-size: 9px; }
#match .mat-field { padding: 12px 8px 6px; min-height: 0; }
#match .mat-field > .mat-content { display: flex; flex-direction: column; height: auto; min-height: 0; gap: 12px; }
#match .field-lane { position: relative; display: flex; flex-direction: column; flex: none; min-height: 112px; padding: 0; overflow: visible; }
#match .field-lane + .field-lane { margin: 0; padding-top: 12px; }
#match .lane-title { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin: 0 0 5px; padding: 0; }
#match .lane-title h3 { font-size: 14px; }
#match .lane-title > span { font-size: 11px; }
#match .lane-title .identity-badge > .portrait-image { width: 24px; height: 30px; flex-basis: 24px; }
#match .lane-title .identity-badge strong { font-size: 13px; }
#match .hidden-hand { display: none; }
#match .field-cards { display: flex; flex: none; flex-wrap: wrap; min-width: 0; min-height: 0; gap: 8px; padding: 5px 2px 7px; overflow: visible; align-items: flex-start; }
#match .field-cards .mat-empty { margin: 10px 0; font-size: 13px; }
#match .field-cards .game-card { flex: 0 0 126px; width: 126px; min-width: 0; padding: 5px; }
#match .field-cards .card-art-button { display: flex; align-items: center; justify-content: center; width: 100%; height: 102px; min-height: 0; padding: 0; overflow: hidden; }
#match .field-cards .thumb { width: 68px; height: 102px; object-fit: contain; }
#match .field-cards h3 { font-size: 15px; min-height: 0; line-height: 1.15; margin: 5px 0; }
#match .field-cards .card-meta, #match .field-cards .status { font-size: 11px; }
#match .field-cards .mini-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
#match .field-cards .mini-actions button { flex: 1 1 auto; min-height: var(--control-size); font-size: 12px; padding: 4px; white-space: normal; overflow-wrap: anywhere; }

/* The current decision and hand occupy real layout space, never cover the board. */
#match .match-bottom-dock {
  position: relative;
  bottom: auto;
  flex: 0 0 auto;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  grid-template-rows: auto auto;
  gap: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 40;
  max-height: 52%;
  overflow: auto;
}
#match #stepTracker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'steps title' 'context actions' 'effects effects';
  gap: 4px 12px;
  min-width: 0;
  max-height: 180px;
  overflow: auto;
  padding: 7px 10px;
  margin: 0;
  border-top: 0;
}
#match #stepTracker > h3 { grid-area: title; align-self: center; font-size: 12px; margin: 0; }
#match #stepTracker .turn-steps { grid-area: steps; min-width: 0; overflow: hidden; padding: 0; gap: 3px; }
#match .turn-steps li { flex: 1 1 0; min-width: 0; min-height: 24px; padding: 4px 12px; gap: 4px; grid-template-columns: auto minmax(0, 1fr); font-size: 11px; line-height: 1.2; }
#match .turn-steps li:first-child { padding-left: 6px; }
#match .turn-steps small { display: none; }
#match .step-number { grid-row: auto; }
.match-settings-panel .step-extra { margin-top: 12px; font-size: 12px; }
.match-settings-panel .step-extra summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
#match #stepTracker .match-context { grid-area: context; min-width: 0; padding: 0; margin: 0; align-self: center; }
#match #stepTracker .match-context > strong { font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
#match #stepTracker .match-context > small { font-size: 11px; line-height: 1.3; }
#match #stepTracker .tracker-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-content: center; gap: 5px; padding: 0; max-width: min(52vw, 700px); }
#match #stepTracker .tracker-actions:empty { display: none; }
#match #stepTracker .tracker-actions button { flex: 0 1 auto; min-width: 0; min-height: var(--control-size); font-size: 12px; padding: 5px 10px; white-space: normal; overflow-wrap: anywhere; }
#match #stepTracker .effect-queue { grid-area: effects; margin: 0; }
#match #stepTracker .effect-queue ol { max-height: 110px; overflow: auto; }
#match .match-bottom-dock .hand-area { display: flex !important; flex-direction: column; min-height: 0; min-width: 0; padding: 5px 0 0; overflow: hidden; }
#match .match-bottom-dock .hand-area .section-title { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 3px 12px; flex: none; margin: 0; padding: 0 10px; }
#match .hand-area h2 { margin: 0; font-size: 15px; }
#match #realWallet { font-size: 11px; line-height: 1.3; }
#match .match-bottom-dock #realHand {
  display: flex; flex: none; min-width: 0; min-height: 0; justify-content: flex-start; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden; padding: 8px 10px 7px; gap: 8px; scroll-padding-inline: 10px; scroll-snap-type: x proximity;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
#match .match-bottom-dock #realHand .game-card {
  flex: 0 0 120px; width: 120px; min-width: 0; display: flex; flex-direction: column; margin: 0; padding: 4px;
  transform: none; scroll-snap-align: start; transition: border-color .15s ease, box-shadow .15s ease;
}
#match .match-bottom-dock #realHand .card-art-button { height: var(--hand-art-height); min-height: 0; width: 100%; padding: 0; }
#match .match-bottom-dock #realHand .thumb { width: 100%; height: 100%; object-fit: contain; transform: none; }
#match .match-bottom-dock #realHand h3 { font-size: 12px; line-height: 1.2; margin: 4px 0 0; min-height: 0; }
#match .match-bottom-dock #realHand .card-meta { display: none; }
#match .match-bottom-dock #realHand .mini-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin-top: 4px; }
#match .match-bottom-dock #realHand .mini-actions button { min-width: 0; min-height: var(--control-size); font-size: 11px; padding: 3px 2px; }
#match .match-bottom-dock #realHand .game-card:focus-within { transform: none; border-color: #f2f500; box-shadow: 0 0 0 1px #f2f500; }
#match .match-bottom-dock .turn-dock { min-width: 0; padding: 8px !important; gap: 5px; }
#match .match-bottom-dock .turn-dock button { min-height: 48px; font-size: 18px; padding: 8px 4px; }
#match .turn-dock-label { display: none; }
#match #endTurnHint { font-size: 10px; }

/* Pop-outs must fit the same usable viewport, including short landscape screens. */
body.match-active .match-settings { display: block; margin: 0; }
body.match-active .match-settings > summary { display: flex; align-items: center; justify-content: center; min-height: var(--control-size); padding: 6px 9px; }
body.match-active .match-settings-panel { max-width: calc(100vw - 20px); max-height: calc(var(--match-height) - 80px); }
body.match-active .match-settings-panel .match-actions { overflow: visible; width: 100%; }
body.match-active .match-settings-panel .match-actions button { min-width: 0; min-height: 44px; }
body.match-active .card-reading-preview { top: 62px; right: max(10px, env(safe-area-inset-right, 0px)); width: min(300px, calc(100vw - 20px)); max-height: calc(var(--match-height) - 84px); }
body.match-active .card-preview-controls { position: sticky; top: -12px; background: #08131b; padding: 4px 0; z-index: 1; }
body.match-active .card-preview-controls button { min-height: 44px; }
body.match-active dialog { max-width: calc(100vw - 20px); max-height: calc(var(--match-height) - 24px); overflow: auto; }
body.match-active button, body.match-active summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Narrow boards: Gigs and Fixer first, crews next, remaining resources below. */
@media (max-width: 1099px) {
  body.match-active { --control-size: 44px; }
  #match .playmat {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: auto minmax(220px, 1fr) auto auto auto;
    grid-template-areas: 'rival rival rival rival rival rival' 'field field field field field field' 'legends legends legends legends legends legends' 'eddies eddies deck deck trash trash' 'opponent opponent opponent opponent opponent opponent';
  }
  #match .resources-own { display: contents; }
  #match.choosing-gigs .resources-own > .mat-zone { opacity: .22; filter: saturate(.35); }
  #match .resources-own > .mat-fixer { grid-area: fixer; }
  #match .resources-own > .mat-legends { grid-area: legends; }
  #match .resources-own > .mat-eddies { grid-area: eddies; }
  #match .resources-own > .mat-deck { grid-area: deck; }
  #match .resources-own > .mat-trash { grid-area: trash; }
  #match .player-resources .mat-fixer .mat-content { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
  #match .resources-rival { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: auto auto auto; grid-template-areas: 'fixer fixer fixer fixer fixer fixer' 'legends legends legends legends legends legends' 'eddies eddies deck deck trash trash'; }
  #match .mat-legend-slot { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  #match .legend-art, #match .legend-back { width: 100%; }
  #match .legend-back .card-back-visual { width: 46px; margin: auto; }
  #match .mat-call { width: 100%; }
}
@media (max-width: 720px) {
  body.match-active { --control-size: 44px; --hand-art-height: 78px; }
  body.match-active > .site-header { min-height: 48px; gap: 6px; padding-block: 2px; padding-inline: max(6px, env(safe-area-inset-left, 0px)) max(6px, env(safe-area-inset-right, 0px)); }
  body.match-active > .site-header .menu-toggle { width: 44px; min-height: 44px; padding: 8px; justify-content: center; }
  body.match-active > .site-header .menu-toggle span:last-child { display: none; }
  body.match-active > .site-header .site-brand h1 { font-size: clamp(15px, 4vw, 20px); }
  body.match-active > .site-header .profile-corner { max-width: 44px; width: 44px; height: 44px; overflow: hidden; padding: 4px; }
  body.match-active > .site-header .profile-corner .identity-badge strong { display: none; }
  body.match-active .match-settings > summary { font-size: 0; width: 44px; height: 44px; padding: 0; }
  body.match-active .match-settings > summary::before { content: '⚙'; font: 24px/1 Arial, sans-serif; }
  body.match-active .match-settings-panel { position: fixed; right: max(6px, env(safe-area-inset-right, 0px)); top: calc(60px + env(safe-area-inset-top, 0px)); width: min(380px, calc(100vw - 12px)); }
  body.match-active > main { padding-inline: max(4px, env(safe-area-inset-left, 0px)) max(4px, env(safe-area-inset-right, 0px)) !important; }
  #match .playmat { gap: 16px 6px; padding: 13px 5px 7px; }
  #match .mat-zone { padding-inline: 5px; }
  #match .gig-summary { font-size: 11px; }
  #match .mat-die { flex-basis: 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  #match .lane-title { gap: 4px 8px; }
  #match .lane-title > span { flex-basis: 100%; }
  #match .field-cards { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding: 6px 3px 8px; }
  #match .field-cards .game-card { flex-basis: 124px; scroll-snap-align: start; }
  #match .match-bottom-dock { grid-template-columns: minmax(0, 1fr) 84px; max-height: 55%; }
  #match #stepTracker { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'steps' 'context' 'actions' 'effects'; padding: 6px; gap: 4px; max-height: 155px; }
  #match #stepTracker > h3, #match #stepTracker .match-context > small { display: none; }
  #match .turn-steps li { min-height: 22px; padding: 3px 8px 3px 12px; font-size: 10px; }
  #match .turn-steps li:first-child { padding-left: 4px; }
  #match #stepTracker .tracker-actions { max-width: none; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  #match #stepTracker .tracker-actions button { flex: 0 0 auto; max-width: 80%; }
  #match .match-bottom-dock .hand-area .section-title { padding-inline: 7px; gap: 2px; }
  #match .hand-area h2 { font-size: 13px; }
  #match #realWallet { font-size: 10px; }
  #match .match-bottom-dock #realHand { gap: 6px; padding: 6px; }
  #match .match-bottom-dock #realHand .game-card { flex-basis: 108px; width: 108px; }
  #match .match-bottom-dock .turn-dock { padding: 5px !important; }
  #match .match-bottom-dock .turn-dock button { font-size: 15px; min-height: 50px; }
  #match #endTurnHint { display: none; }
  body.match-active .card-reading-preview { max-height: calc(var(--match-height) * .56); }
  body.match-active input, body.match-active select, body.match-active textarea { font-size: 16px; }
}
@media (pointer: coarse) {
  body.match-active { --control-size: 44px; }
  #match .gear-list button, #match .legend-gear-stack button { min-height: 44px; }
}
@media (hover: hover) and (pointer: fine) {
  #match .match-bottom-dock #realHand .game-card:hover { transform: none; border-color: #f2f500; box-shadow: 0 0 0 1px #f2f500; }
}
body.match-active .brand-home { text-align: left; }
#match .mat-content, #match .mini-actions, #match .legend-gear-stack { min-width: 0; }
#match .field-cards h3, #match #realHand h3 { overflow-wrap: anywhere; }
#match .effect-queue { min-width: 0; }
#match .mat-tooltip { max-width: calc(100vw - 24px); }
@media (max-width: 359px) {
  body.match-active > .site-header { gap: 3px; }
  body.match-active > .site-header .site-brand h1 { font-size: 14px; letter-spacing: 0; }
  #match .turn-steps li { font-size: 9px; padding-right: 4px; }
  #match .match-bottom-dock { grid-template-columns: minmax(0, 1fr) 70px; }
}


/* A shallow card fan with an in-layout command dock for the selected card. */
#match .match-bottom-dock { grid-template-areas: 'tracker tracker' 'gigs gigs' 'focus turn' 'hand turn'; grid-template-rows: auto auto auto auto; max-height: 60%; }
#match #stepTracker { grid-area: tracker; }
#match .match-bottom-dock .hand-area { grid-area: hand; padding-top: 3px; min-height: 99px; }
#match .match-bottom-dock .turn-dock { grid-area: turn; }
#localGigsDock { grid-area: gigs; display: none; min-width: 0; }
#match .match-bottom-dock #realHand { height: 76px; flex: 0 0 76px; padding: 10px 12px 0; gap: 0; justify-content: safe center; scroll-snap-type: none; }
#match .match-bottom-dock #realHand .game-card { flex: 0 0 110px; width: 110px; margin: 0 0 0 -40px; padding: 3px; transform: rotate(var(--fan-angle,0deg)); transform-origin: 50% 130%; }
#match .match-bottom-dock #realHand .game-card:first-child { margin-left: 0; }
#match .match-bottom-dock #realHand .card-art-button { height: 130px; }
#match .match-bottom-dock #realHand h3, #match .match-bottom-dock #realHand .mini-actions, #realHand .hand-card-close, #realHand .hand-card-expand { display: none; }
#match .match-bottom-dock #realHand .hand-playable { border-color: #36d9ff; box-shadow: 0 0 7px #36d9ff55; }
#match .match-bottom-dock #realHand .game-card:hover, #match .match-bottom-dock #realHand .game-card:focus-within { transform: rotate(var(--fan-angle,0deg)); }
.hand-card-placeholder { opacity: .22; pointer-events: none; }
.hand-card-focus { grid-area: focus; position: relative; min-width: 0; margin: 5px 8px 0; padding-top: 18px; z-index: 2; }
.hand-card-focus[hidden] { display: none; }
.hand-card-focus .game-card { position: relative; display: grid; grid-template-columns: 86px minmax(120px,1fr) minmax(170px,220px); grid-template-rows: auto auto minmax(44px,1fr); column-gap: 10px; width: 100%; min-width: 0; margin: 0; padding: 7px 54px 7px 7px; border: 2px solid #e9ef25; background: linear-gradient(100deg,#0b1520,#071019); border-radius: 7px; box-shadow: 0 0 18px #efff0033; transform: none; }
.hand-card-focus .card-art-button { grid-column: 1; grid-row: 1 / 4; width: 86px; height: 104px; min-height: 0; padding: 0; align-self: stretch; }
.hand-card-focus .thumb { width: 100%; height: 104px; object-fit: contain; transform: none; }
.hand-card-focus h3 { grid-column: 2; grid-row: 1; min-height: 0; margin: 0; padding-right: 4px; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.hand-card-focus .card-meta { grid-column: 2; grid-row: 2; display: block; align-self: start; font-size: 11px; color: #a9bec4; }
.hand-card-focus .hand-action-state, .hand-card-focus .hand-lock-reason { grid-column: 2; }
.hand-card-focus .mini-actions { grid-column: 3; grid-row: 1 / 4; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: center; gap: 6px; margin: 0; }
.hand-card-focus .mini-actions button { min-width: 0; min-height: 48px; padding: 7px; font-size: 13px; }
.hand-card-focus .mini-actions button:first-child:not(:disabled) { background: #e9ef25; color: #111500; }
.hand-card-focus .hand-card-close, .hand-card-focus .hand-card-expand { position: absolute; right: 4px; top: 4px; z-index: 3; min-height: 44px; width: 44px; padding: 0; font-size: 22px; background: #071019ed; }
.hand-card-focus .hand-card-expand { top: 52px; }
#match .gig-roll-source .fixer-die.can-roll { transform: scale(1.12); filter: drop-shadow(0 0 9px #eaff00); }
@media (max-width: 1099px) {
 #localGigsDock { display: block; padding: 12px 6px 2px; }
 #match .resources-own > .mat-fixer { display: none; }
 #localGigsDock .mat-friendly, #localGigsDock .mat-rival { display: block; padding: 5px 6px 2px; border-color: #939b29; }
 #match.choosing-gigs #localGigsDock .mat-rival { border-color: #eff300; box-shadow: inset 4px 0 #eff300, 0 0 18px #eff3002b; }
 #localGigsDock .mat-content { display: flex; align-items: center; gap: 8px; }
 #localGigsDock .gig-summary { flex: 0 1 150px; margin: 0; font-size: 11px; }
 #localGigsDock .mat-dice { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 5px 4px; min-height: 50px; gap: 5px; }
 #localGigsDock .gigs-empty .mat-dice { min-height: 22px; }
 #match .match-bottom-dock .hand-area { min-height: 85px; }
 #localGigsDock .mat-die, #localGigsDock .fixer-die { flex: 0 0 44px; min-width: 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; }
 #localGigsDock .fixer-die strong { font-size: 13px; }
 #localGigsDock .fixer-die span { display: none; }
 #match.rolling-gig #stepTracker .match-context { display: none; }
 #match .match-bottom-dock #realHand { justify-content: flex-start; height: 64px; flex-basis: 64px; }
 #match .match-bottom-dock #realHand .game-card { flex-basis: 86px; width: 86px; margin-left: -38px; }
 #match .match-bottom-dock #realHand .card-art-button { height: 112px; }
}
@media (max-width: 720px) {
 /* Mobile card games keep the turn commit reachable while secondary status scrolls.
    Span one existing control through the dock instead of cloning it and risking split state. */
 #match .match-bottom-dock { grid-template-areas: 'tracker turn' 'gigs turn' 'focus turn' 'hand turn'; }
 #match .match-bottom-dock .turn-dock { position: sticky; top: 0; align-self: start; z-index: 3; }
 #localGigsDock { padding-inline: 3px; }
 #localGigsDock .mat-content { display: block; }
 #localGigsDock .gig-summary { font-size: 10px; line-height: 1.1; padding: 0 3px; }
 #localGigsDock .mat-dice { padding: 5px 3px; }
 #localGigsDock .mat-die, #localGigsDock .fixer-die { flex-basis: 44px; width: 44px; }
 .hand-card-focus .hand-card-close, .hand-card-focus .hand-card-expand { width: 44px; min-height: 44px; }
 .hand-card-focus { margin: 4px 3px 0; padding-top: 16px; }
 .hand-card-focus .game-card { grid-template-columns: 72px minmax(0,1fr); grid-template-rows: auto auto auto auto; column-gap: 8px; padding: 6px 54px 6px 6px; }
 .hand-card-focus .card-art-button { width: 72px; height: 96px; grid-row: 1 / 4; }
 .hand-card-focus .thumb { height: 96px; }
 .hand-card-focus h3 { font-size: 14px; }
 .hand-card-focus .mini-actions { grid-column: 1 / 3; grid-row: 4; margin-top: 6px; }
 .hand-card-focus .mini-actions button { min-height: 44px; }
 #match #stepTracker .match-context > strong { font-size: 12px; }
}
@media (max-height: 500px) {
 body.match-active > .site-header { min-height: 46px; padding-top: 2px; padding-bottom: 2px; }
 #match .match-bottom-dock { grid-template-areas: 'tracker turn' 'gigs turn' 'focus turn' 'hand turn'; }
 #match .match-bottom-dock .turn-dock { position: sticky; top: 0; align-self: start; z-index: 3; }
 #match .match-bottom-dock #realHand { height: 48px; flex-basis: 48px; padding-top: 7px; }
 #match .match-bottom-dock .hand-area { min-height: 66px; }
 #match .match-bottom-dock .hand-area .section-title { padding-block: 0; line-height: 1; }
 #match #stepTracker { padding-block: 3px; max-height: 105px; }
 #match #stepTracker .turn-steps, #match #stepTracker > h3, #match #stepTracker .match-context > small { display: none; }
 #match #endTurnHint { display: block; margin: 0; font-size: 9px; line-height: 1.2; overflow-wrap: anywhere; }
 #localGigsDock { padding-top: 9px; }
 #localGigsDock .gig-summary { display: none; }
 #localGigsDock .mat-dice { min-height: 46px; padding-block: 1px; }
 .hand-card-focus { padding-top: 14px; }
 .hand-card-focus .game-card { grid-template-columns: 60px minmax(0,1fr); }
 .hand-card-focus .card-art-button, .hand-card-focus .thumb { width: 60px; height: 74px; }
}
@media (prefers-reduced-motion: reduce) {
 #match .gig-roll-source, #match .gig-roll-source .fixer-die.can-roll { animation: none; }
}

