/* Thren prototype styles. Placeholder card faces only; production art follows the M03 style choice. */
:root {
  --bg: #0d1220; --bg2: #151c2e; --panel: #1b2338; --line: #2c3650; --ink: #ece6d6; --dim: #a6a294; --faint: #6f7485;
  --gold: #e3b04b; --gold2: #f6d58b; --good: #6fcf97; --bad: #eb6f6f; --focus: #7cc4ff;
  --valcairn: #c9a646; --valcairn-bg: #3a3220; --veyne: #c23b52; --veyne-bg: #3a1a22; --neutral: #9aa3b5; --neutral-bg: #262c3a;
  --orsen: #7d9bb8; --orsen-bg: #1e2a38; --graven: #b8975a; --graven-bg: #33291a; --nacre: #4fb3a9; --nacre-bg: #14302e; --briar: #5f8f3e; --briar-bg: #1d2c15;
  --chip-w: 36px; --chip-h: 46px; --row-h: 50px; --card-w: 70px; --card-h: 98px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, .serif { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; font-weight: 600; letter-spacing: .01em; }
#app { min-height: 100dvh; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 16px; min-height: 44px; }
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn.primary { background: linear-gradient(#e9bb5a, #c8912c); color: #1b1407; border-color: #f0c66d; font-weight: 700; }
.btn.danger { border-color: #7a3640; color: #ffc9cf; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.muted { color: var(--dim); }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }

/* ── Home & setup ───────────────────────────────── */
.page { max-width: 760px; margin: 0 auto; padding: calc(24px + var(--safe-t)) calc(18px + var(--safe-r)) calc(32px + var(--safe-b)) calc(18px + var(--safe-l)); }
.hero { text-align: center; padding: 28px 0 18px; }
.hero h1 { font-size: clamp(44px, 12vw, 72px); margin: 0; color: var(--gold2); letter-spacing: .12em; }
.hero p { margin: 6px 0 0; color: var(--dim); }
.sun { width: 84px; height: 42px; margin: 0 auto 6px; border-radius: 84px 84px 0 0; background: radial-gradient(circle at 50% 100%, #ffe2a0, #e3b04b 45%, #7a4a12 70%); box-shadow: 0 -10px 50px #e3b04b44; border-bottom: 3px solid #7a4a12; }
.menu { display: grid; gap: 12px; margin-top: 18px; }
.menu .btn { text-align: left; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.menu .btn b { font-size: 18px; }
.menu .btn span { color: var(--dim); font-size: 14px; }
.menu .btn.primary span { color: #3b2a0c; }
.soon { opacity: .55; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; }
.panel h2 { margin: 0 0 10px; font-size: 20px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.choice { text-align: left; border: 2px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px; min-height: 64px; }
.choice[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.choice:disabled { opacity: .45; }
.choice small { display: block; color: var(--dim); margin-top: 2px; }
.crest { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font-weight: 700; margin-right: 6px; }
.crest.valcairn { background: var(--valcairn); color: #251b05; } .crest.veyne { background: var(--veyne); color: #fff; } .crest.neutral { background: var(--neutral); color: #111; }
.crest.orsen { background: var(--orsen); color: #0c1520; } .crest.graven { background: var(--graven); color: #22180a; } .crest.nacre { background: var(--nacre); color: #062220; } .crest.briar { background: var(--briar); color: #f1f7e8; }
.toprow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.back { background: none; border: 0; color: var(--dim); padding: 8px 0; min-height: 44px; }

/* Deck editor */
.decklist { display: grid; gap: 6px; }
.deckline { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.deckline .str { font-weight: 800; text-align: center; }
.deckline .nm { min-width: 0; }
.deckline .nm small { display: block; color: var(--dim); font-size: 12px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); font-size: 20px; }
.stepper output { width: 22px; text-align: center; font-weight: 700; }
.deckstats { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ok { color: var(--good); } .err { color: var(--bad); }

/* ── Table ─────────────────────────────────────── */
.table { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; grid-template-areas: "opp" "weather" "rows" "me" "hand" "actions";
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); background: radial-gradient(ellipse at 50% 45%, #1d2742 0%, var(--bg) 70%); overflow: hidden; position: relative; }
.status { display: flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 48px; min-width: 0; }
.status.opp { grid-area: opp; border-bottom: 1px solid var(--line); }
.status.me { grid-area: me; border-top: 1px solid var(--line); }
.status .who { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.status .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.status .who small { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gems { display: flex; gap: 3px; }
.gem { width: 13px; height: 13px; transform: rotate(45deg); border: 2px solid var(--gold); border-radius: 2px; }
.gem.on { background: var(--gold); box-shadow: 0 0 8px #e3b04b88; }
.count { font-size: 12px; color: var(--dim); text-align: center; line-height: 1.1; min-width: 34px; }
.count b { display: block; color: var(--ink); font-size: 15px; }
.total { min-width: 52px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; font-weight: 800; background: var(--panel); border: 2px solid var(--line); }
.total.lead { border-color: var(--gold); color: var(--gold2); }
.passed { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #1b1407; background: var(--dim); border-radius: 6px; padding: 2px 6px; }
.leaderbtn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; min-height: 40px; min-width: 40px; padding: 2px 8px; font-size: 13px; }
.leaderbtn.ready { border-color: var(--gold); box-shadow: 0 0 10px #e3b04b55; }
.leaderbtn.used { opacity: .5; text-decoration: line-through; }

.weatherbar { grid-area: weather; display: flex; gap: 6px; justify-content: center; align-items: center; min-height: 0; padding: 0 8px; flex-wrap: wrap; }
.weatherbar:not(:empty) { padding: 3px 8px; }
.wchip { font-size: 12px; border-radius: 999px; padding: 2px 10px; background: #2b3a5a; border: 1px solid #5a7bb5; }
.rows { grid-area: rows; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 6px; min-height: 0; overflow-y: auto; }
.divider { height: 2px; margin: 3px 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6; }
.row { flex: 1 1 0; max-height: calc(var(--row-h) * 1.5); display: grid; grid-template-columns: 44px 26px minmax(0, 1fr); gap: 4px; align-items: center; min-height: var(--row-h); border-radius: 10px; background: #ffffff08; border: 1px solid transparent; padding: 2px; position: relative; }
.row.weathered { background: linear-gradient(90deg, #4a6fa533, #4a6fa511); border-color: #4a6fa566; }
.row.legal { border: 2px dashed var(--gold); background: #e3b04b1a; cursor: pointer; }
.rowhead { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.rowhead .ic { font-size: 13px; color: var(--dim); }
.rowhead .rt { font-size: 17px; font-weight: 800; }
.rowhead .wx { font-size: 11px; color: #9cc2ff; }
.hornslot { width: 26px; height: 34px; border-radius: 6px; border: 1px dashed var(--line); display: grid; place-items: center; font-size: 14px; color: var(--faint); }
.hornslot.on { border: 1px solid var(--gold); color: var(--gold2); background: #e3b04b22; }
.units { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; min-height: var(--chip-h); align-items: center; }
.units::-webkit-scrollbar { display: none; }
.unit { flex: 0 1 var(--chip-w); min-width: 24px; width: var(--chip-w); height: var(--chip-h); border-radius: 7px; border: 2px solid #0007; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; position: relative; line-height: 1; }
.unit .v { font-weight: 800; font-size: 17px; }
.unit .ab { font-size: 11px; opacity: .9; }
.unit .nm { display: none; }
.unit.boosted .v { color: var(--good); } .unit.reduced .v { color: #9cc2ff; }
.unit.hero { border-color: var(--gold); box-shadow: 0 0 0 1px #000 inset, 0 0 6px #e3b04b66; }
.unit.special { opacity: .85; font-size: 12px; }
.unit.target { outline: 3px solid var(--gold); outline-offset: 1px; animation: pulse 1s infinite; }
.unit.fresh { animation: arrive .35s ease-out; }
.unit.dying { animation: burn .45s ease-in forwards; }
.unit.enemyorigin::after { content: '👁'; position: absolute; top: -6px; right: -6px; font-size: 11px; }
.f-valcairn { background: linear-gradient(160deg, #6b5a2c, var(--valcairn-bg)); }
.f-veyne { background: linear-gradient(160deg, #7a2636, var(--veyne-bg)); }
.f-neutral { background: linear-gradient(160deg, #4b5368, var(--neutral-bg)); }
.f-orsen { background: linear-gradient(160deg, #3c526b, var(--orsen-bg)); }
.f-graven { background: linear-gradient(160deg, #6b5835, var(--graven-bg)); }
.f-nacre { background: linear-gradient(160deg, #22625c, var(--nacre-bg)); }
.f-briar { background: linear-gradient(160deg, #3b5a26, var(--briar-bg)); }

.handwrap { grid-area: hand; border-top: 1px solid var(--line); background: #0a0f1acc; padding: 6px 0 4px; position: relative; }
.coach { margin: 0 8px 6px; padding: 8px 12px; border-radius: 10px; background: #2a2412; border: 1px solid #8a6a2a; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.coach button { margin-left: auto; background: none; border: 0; color: var(--dim); min-width: 32px; min-height: 32px; }
.hand { display: flex; gap: 6px; overflow-x: auto; padding: 4px 8px 6px; scroll-snap-type: x proximity; }
.card { flex: none; width: var(--card-w); height: var(--card-h); border-radius: 9px; border: 2px solid #0008; padding: 4px; display: flex; flex-direction: column; text-align: left; position: relative; scroll-snap-align: start; line-height: 1.1; transition: transform .12s; }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.card .str { width: 24px; height: 24px; border-radius: 50%; background: #0009; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.card.hero .str { background: var(--gold); color: #1b1407; }
.card .rowsic { font-size: 11px; color: #fffc; }
.card .nm { margin-top: auto; font-size: 11px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.card .abl { font-size: 13px; }
.card.hero { border-color: var(--gold); }
.card[aria-pressed="true"] { transform: translateY(-8px); border-color: var(--focus); box-shadow: 0 6px 18px #000a, 0 0 0 2px var(--focus); }
.card.unplayable { filter: saturate(.4) brightness(.75); }
.actions { grid-area: actions; display: flex; gap: 8px; padding: 6px 10px 8px; align-items: center; }
.actions .turn { flex: 1; font-weight: 700; font-size: 14px; min-width: 0; }
.actions .turn.mine { color: var(--gold2); }
.ticker { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 5; max-width: min(92vw, 520px); pointer-events: none; }
.ticker div { background: #000c; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-size: 14px; text-align: center; animation: fadein .2s; }
.skip { position: absolute; right: 10px; top: 52px; z-index: 6; }

/* Detail sheet: covers only the hand area on phones so the board stays visible. */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; background: #121a2c; border-top: 2px solid var(--gold); border-radius: 16px 16px 0 0; padding: 12px 14px calc(12px + var(--safe-b)); max-height: 52dvh; overflow-y: auto; box-shadow: 0 -10px 30px #000a; animation: slideup .18s ease-out; }
.sheet .head { display: flex; gap: 12px; align-items: flex-start; }
.bigcard { flex: none; width: 92px; height: 128px; border-radius: 10px; border: 2px solid #0008; padding: 6px; display: flex; flex-direction: column; }
.bigcard.hero { border-color: var(--gold); }
.bigcard .str { width: 32px; height: 32px; border-radius: 50%; background: #0009; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.bigcard.hero .str { background: var(--gold); color: #1b1407; }
.bigcard .crestbig { margin-top: auto; font-size: 28px; text-align: center; opacity: .6; }
.sheet h3 { margin: 0 0 4px; font-size: 19px; }
.sheet .meta { color: var(--dim); font-size: 13px; }
.sheet .txt { margin: 6px 0; }
.sheet .explain { font-size: 13px; color: var(--gold2); }
.sheet .flav { font-style: italic; color: var(--dim); font-size: 13px; }
.sheet .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sheet .acts .btn { flex: 1 1 140px; }
.sheet .close { position: absolute; right: 8px; top: 6px; background: none; border: 0; font-size: 22px; color: var(--dim); min-width: 44px; min-height: 44px; }
.pickgrid { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.overlay { position: fixed; inset: 0; z-index: 20; background: #05080fcc; display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
.modal { width: min(460px, 100%); background: var(--bg2); border: 1px solid var(--gold); border-radius: 16px; padding: 20px; text-align: center; }
.modal h2 { margin: 0 0 6px; font-size: 26px; color: var(--gold2); }
.modal .score { font-size: 34px; font-weight: 800; margin: 8px 0; }
.modal .acts { display: grid; gap: 8px; margin-top: 16px; }
.rounds { display: grid; gap: 4px; margin: 10px 0; font-size: 14px; }
.redrawbar { margin: 0 8px 6px; display: flex; gap: 8px; align-items: center; }
.redrawbar span { flex: 1; font-size: 14px; }
#toast { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); z-index: 40; }
#toast div { background: #3a1820; border: 1px solid var(--bad); padding: 10px 14px; border-radius: 10px; max-width: 90vw; }

@keyframes arrive { from { transform: translateY(-18px) scale(1.15); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes burn { 0% { filter: none; } 50% { filter: brightness(2) sepia(1) saturate(4) hue-rotate(-20deg); } 100% { transform: scale(.6); opacity: 0; } }
@keyframes pulse { 50% { outline-color: transparent; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes slideup { from { transform: translateY(30px); opacity: 0; } }
@keyframes bump { 50% { transform: scale(1.25); } }
.bump { animation: bump .3s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Short phones: tighten rows. */
@media (max-height: 700px) and (max-width: 600px) { :root { --row-h: 42px; --chip-h: 40px; --chip-w: 32px; --card-h: 84px; --card-w: 62px; } .status { min-height: 42px; padding: 3px 8px; } .total { height: 34px; font-size: 19px; } }

/* Tablet and desktop: wider cards, names on units, status beside the board. */
@media (min-width: 760px) {
  :root { --chip-w: 58px; --chip-h: 74px; --row-h: 80px; --card-w: 96px; --card-h: 134px; }
  .unit .nm { display: block; font-size: 9px; text-align: center; padding: 0 2px; max-height: 2.2em; overflow: hidden; margin-top: 2px; }
  .unit .v { font-size: 20px; }
  .row { grid-template-columns: 58px 34px minmax(0, 1fr); }
  .rowhead .rt { font-size: 22px; } .hornslot { width: 34px; height: 54px; font-size: 18px; }
  .card .nm { font-size: 12px; } .card .str { width: 30px; height: 30px; font-size: 16px; }
  .sheet { left: auto; right: 16px; bottom: 16px; width: 380px; border-radius: 16px; border: 2px solid var(--gold); max-height: 70dvh; }
}
@media (min-width: 1100px) {
  .table { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: 1fr auto 1fr auto auto; grid-template-areas: "opp rows" "weather rows" "me rows" "hand hand" "actions actions"; }
  .status { flex-wrap: wrap; align-content: center; border: 0 !important; padding: 16px; gap: 10px 12px; }
  .status .who { flex-basis: calc(100% - 40px); }
  .status .who b { font-size: 18px; } .status .who small { font-size: 13px; white-space: normal; }
  .status .total { margin-left: auto; min-width: 72px; height: 54px; font-size: 30px; }
  .gem { width: 16px; height: 16px; }
  .status.opp { align-self: end; } .status.me { align-self: start; }
  .weatherbar { flex-direction: column; }
  .rows { padding: 12px 18px; }
}

.table.busy .actions .turn::after { content: ' …'; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; align-items: center; }
.filters select { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 0 8px; }
.deckline.locked { opacity: .55; }

/* ── Card art (M03 proof) ─────────────────────────── */
.card, .unit, .bigcard { overflow: hidden; }
.card > *:not(.art), .unit > *:not(.art), .bigcard > *:not(.art) { position: relative; z-index: 1; }
.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
.has-art .nm { margin-top: auto; background: linear-gradient(transparent, #000d 40%); margin-left: -4px; margin-right: -4px; margin-bottom: -4px; padding: 10px 4px 4px; }
.unit.has-art::before { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle at 50% 30%, #0009, transparent 70%); }
.unit.has-art .v { text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.has-art .crestbig { display: none; }
.bigcard.has-art { position: relative; }
.card.has-art .str, .bigcard.has-art .str { box-shadow: 0 0 0 2px #0008; }

/* B: stained-glass interface frame around graphic-novel art */
body { --lead: #17120d; --glass-valcairn: #e8b545; --glass-veyne: #d2344f; --glass-neutral: #8fb7e6; --glass-orsen: #8fb0d6; --glass-graven: #dcc89b; --glass-nacre: #5fd0c4; --glass-briar: #7fb84e; }
.card, .unit, .bigcard { border: 3px solid var(--lead); box-shadow: inset 0 0 0 2px var(--g, var(--glass-neutral)), inset 0 0 0 4px var(--lead), 0 0 10px color-mix(in srgb, var(--g, #fff) 35%, transparent); border-radius: 10px; }
.f-valcairn { --g: var(--glass-valcairn); } .f-veyne { --g: var(--glass-veyne); } .f-neutral { --g: var(--glass-neutral); }
.f-orsen { --g: var(--glass-orsen); } .f-graven { --g: var(--glass-graven); } .f-nacre { --g: var(--glass-nacre); } .f-briar { --g: var(--glass-briar); }
.card.hero, .unit.hero, .bigcard.hero { box-shadow: inset 0 0 0 2px #ffe08a, inset 0 0 0 4px var(--lead), inset 0 0 0 6px #ffe08a55, 0 0 14px #ffd36a88; }
.gem { transform: none; border-radius: 50%; border: 2px solid var(--lead); background: #2a2430; box-shadow: 0 0 0 1px var(--gold); }
.gem.on { background: conic-gradient(#e8b545 0 25%, #d2344f 0 50%, #8fb7e6 0 75%, #6fcf97 0); box-shadow: 0 0 0 1px var(--gold), 0 0 10px #e3b04b99; }
.table { background:
  radial-gradient(ellipse 40% 30% at 20% 10%, #e8b54522, transparent 70%), radial-gradient(ellipse 35% 30% at 85% 90%, #d2344f22, transparent 70%),
  radial-gradient(ellipse 50% 40% at 70% 40%, #8fb7e618, transparent 70%), radial-gradient(ellipse at 50% 45%, #1d2742 0%, var(--bg) 70%); }
.row { border: 1px solid #ffffff10; box-shadow: inset 0 0 0 1px #0006; }
.divider { height: 4px; background: linear-gradient(90deg, transparent, #d2344f, #e8b545, #8fb7e6, transparent); opacity: .8; }

/* ── Premium stained-glass table (owner direction 1 Dec 2026) ── */
.table { background:
  linear-gradient(180deg, #05080fcc 0%, #05080f55 18%, #05080f40 50%, #05080f55 82%, #05080fcc 100%),
  url(/art/table/table-portrait.webp) center / cover no-repeat, #120d0a; }
@media (min-width: 760px) { .table { background:
  linear-gradient(180deg, #05080fbb 0%, #05080f40 25%, #05080f30 50%, #05080f40 75%, #05080fbb 100%),
  url(/art/table/table-landscape.webp) center / cover no-repeat, #120d0a; } }
.row { background: linear-gradient(90deg, #000b, #0008 30%, #0009), linear-gradient(#1a1410aa, #1a1410aa), url(/art/table/lane.webp) center / cover; border: 2px solid var(--lead);
  box-shadow: inset 0 0 0 1px #c9a64655, inset 0 8px 18px #0008, 0 2px 6px #0009; }
.row.weathered { background: linear-gradient(90deg, #4a6fa566, #4a6fa522), url(/art/table/lane.webp) center / cover; border-color: #2a3c5c; }
.row.legal { background: linear-gradient(90deg, #e3b04b33, #e3b04b11), url(/art/table/lane.webp) center / cover; }
.rowhead .rt { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: radial-gradient(circle at 35% 30%, #fff3, transparent 45%), conic-gradient(from 20deg, #8a6a1f, #e8b545, #8a6a1f, #5a4214, #8a6a1f); color: #1b1407; border: 2px solid var(--lead); box-shadow: 0 0 8px #e3b04b55; }
.hornslot { border: 2px solid var(--lead); background: #0006; }
.status { background: linear-gradient(90deg, #0b0f1acc, #0b0f1a88); backdrop-filter: blur(3px); }
.handwrap { background: linear-gradient(#0a0f1a99, #0a0f1aee); border-top: 2px solid var(--lead); box-shadow: 0 -1px 0 #c9a64655; }
.total { border: 2px solid var(--lead); box-shadow: inset 0 0 0 1px #c9a64666; background: #120d0acc; }
.total.lead { box-shadow: inset 0 0 0 1px var(--gold), 0 0 14px #e3b04b88; }
/* Board units become small framed cards with focal-cropped art. */
.unit { --cw: var(--chip-w); }
.unit.has-art .art { object-position: var(--fx, 50%) var(--fy, 30%); transform: scale(var(--fz, 1.7)); transform-origin: var(--fx, 50%) var(--fy, 30%); filter: contrast(1.12) saturate(1.1); }
.unit.has-art .v { margin-top: auto; margin-bottom: 2px; background: #000b; border-radius: 6px; padding: 0 4px; font-size: 14px; }
.unit.has-art .ab { position: absolute; top: 2px; right: 3px; }
.unit.fresh { animation: arrive .35s ease-out, glint .9s ease-out; }
@keyframes glint { 0% { box-shadow: 0 0 0 0 #ffe08a; } 40% { box-shadow: 0 0 18px 4px #ffe08acc; } 100% { box-shadow: none; } }

/* ── M05: account, private room, paused match ───────────── */
.acct { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.acct span { min-width: 0; overflow-wrap: anywhere; }
.acctform { display: grid; gap: 6px; }
.acctform input, .joinrow input, .linkbox { width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; }
.acctform .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.acctform .acts .btn { flex: 1 1 140px; }
.joinrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 12px; }
.joinrow input { text-transform: uppercase; letter-spacing: .2em; }
.lobby .code { font: 700 clamp(28px, 9vw, 40px)/1 Georgia, serif; letter-spacing: .18em; color: var(--gold2); padding: 6px 12px; border: 2px solid var(--lead, #2c3650); border-radius: 10px;
  background: linear-gradient(135deg, #3a322088, #3a1a2288); box-shadow: inset 0 0 0 1px #c9a64666; }
.linkbox { margin-top: 10px; font-size: 13px; color: var(--dim); }
.warn { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: #2a2412; border: 1px solid #8a6a2a; font-size: 14px; }
.seatcard { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); margin-top: 8px; }
.seatcard > div { min-width: 0; overflow-wrap: anywhere; }
.seatcard.ready { border-color: var(--good); }
.tag.ok { border-color: var(--good); color: var(--good); }
.check { display: flex; gap: 10px; align-items: center; margin-top: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; }
.status-line { text-align: center; color: var(--gold2); min-height: 1.4em; }
.paused { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 9; width: min(92vw, 420px); display: grid; gap: 6px; text-align: center;
  padding: 16px; border-radius: 14px; background: #0b0f1af2; border: 2px solid var(--gold); box-shadow: 0 10px 40px #000c; }
.paused b { font: 600 19px Georgia, serif; color: var(--gold2); }
.paused span { color: var(--dim); font-size: 14px; }

/* ── M07: career hub (phone-first, stained glass) ───────────── */
.crest.sm { width: 18px; height: 18px; font-size: 11px; border-radius: 4px; margin-right: 4px; vertical-align: -3px; }
.tight { margin: 6px 0; font-size: 14px; }
.career h3 { margin: 14px 0 6px; font-size: 16px; }
.divhead { display: flex; gap: 12px; align-items: center; margin: 6px 0 4px; }
.divhead h2 { margin: 0; font-size: clamp(20px, 5.6vw, 26px); }
.divnum { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font: 700 26px Georgia, serif; color: #1b1407; border: 3px solid var(--lead);
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6, transparent 45%), conic-gradient(from 20deg, #8a6a1f, #e8b545, #8a6a1f, #5a4214, #8a6a1f); box-shadow: 0 0 10px #e3b04b66; }
.panel.next, .panel.reward, .panel.seasonend { border: 2px solid var(--lead); box-shadow: inset 0 0 0 1px #c9a64666, 0 0 14px #e3b04b22; }
.panel.reward { border-color: var(--gold); }
.nextrow { display: flex; gap: 12px; align-items: center; }
.nextrow .who { display: grid; gap: 2px; min-width: 0; }
.nextrow .who b { font-size: 20px; overflow-wrap: anywhere; }
.nextrow .who small { color: var(--dim); }
.portrait { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--lead); box-shadow: 0 0 0 2px var(--gold), 0 0 12px #e3b04b55; object-fit: cover; }
span.portrait { display: grid; place-items: center; font: 700 22px Georgia, serif; margin: 0; }
.context { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--gold); background: #2a241244; font-style: italic; font-size: 14px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fm { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 2px; border-radius: 3px; font: 700 10px system-ui; font-style: normal; color: #111; }
.fm-W { background: var(--good); } .fm-D { background: #c9c3b0; } .fm-L { background: var(--bad); }
.tabs { display: flex; gap: 4px; margin: -4px 0 12px; border-bottom: 2px solid var(--lead); overflow-x: auto; }
.tab { flex: 1 0 auto; min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--dim); }
.tab[aria-selected="true"] { color: var(--gold2); border-bottom-color: var(--gold); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.seg .btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold2); }
.tablewrap { overflow-x: auto; }
.stable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.stable th, .stable td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.stable th { color: var(--dim); font-weight: 600; font-size: 12px; }
.stable .nm { text-align: left; max-width: 46vw; }
.stable td.nm small { display: block; }
.stable tr.me td { background: #e3b04b22; color: var(--gold2); }
.stable tr.up td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.stable tr.down td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.stable sup { color: var(--gold); font-size: 9px; }
@media (max-width: 420px) { .stable th:nth-child(4), .stable td:nth-child(4), .stable th:nth-child(5), .stable td:nth-child(5), .stable th:nth-child(6), .stable td:nth-child(6) { display: none; } }
.nextfx { border-color: var(--gold); }
.cupround { max-height: 360px; overflow-y: auto; }
.bars { display: grid; gap: 6px; }
.barrow { display: grid; grid-template-columns: 110px 1fr 56px; gap: 8px; align-items: center; min-height: 40px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; }
.barrow[aria-pressed="true"] { border-color: var(--gold); }
.bar { height: 10px; border-radius: 6px; background: #0006; border: 1px solid var(--lead); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a1f, #e8b545); }
.news .item { padding: 8px 0; border-top: 1px solid var(--line); }
.news .item:first-of-type { border-top: 0; }
.news .item p { margin: 4px 0; font-size: 14px; }
.btn.ghost { background: none; }
.seasonend .big, .review .big { font-size: 24px; margin: 4px 0; color: var(--gold2); }
.move { font-weight: 700; margin: 2px 0 8px; } .move.up { color: var(--good); } .move.down { color: var(--bad); } .move.stay { color: var(--dim); }
.career select { min-height: 40px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; margin-left: 6px; }

/* ── M10: dense play, every device ──────────────────────────────── */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.22em; }
.btn .ico { margin-right: 6px; }
.iconbtn { padding: 6px 10px; min-height: 44px; min-width: 48px; } .iconbtn .ico { margin: 0; width: 22px; height: 22px; }
.crest .ico { width: 72%; height: 72%; vertical-align: middle; }
.crest.sm .ico { width: 80%; height: 80%; }
@media (pointer: coarse) { .btn.small { min-height: 44px; } }
.coach { align-items: center; } .coach > .ico { color: var(--gold2); width: 20px; height: 20px; }
.coach button { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.coach button .ico { width: 18px; height: 18px; }

/* Status bar: name/leader is a button that opens the leader sheet (full names live there). */
.status .who { background: none; border: 0; padding: 0; text-align: left; min-height: 44px; justify-content: center; border-radius: 8px; }
.status .who small .ico { width: 12px; height: 12px; }
.status .crest { flex: none; }
.leaderbtn { min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; }
.leaderbtn .ico { width: 22px; height: 22px; }
.leaderbtn.used { text-decoration: none; } .leaderbtn.used .ico { opacity: .45; }
.leaderbtn.used::after { content: ''; position: absolute; width: 26px; height: 2px; background: var(--dim); transform: rotate(-35deg); }
.leaderbtn { position: relative; }
.passed { display: inline-flex; align-items: center; gap: 3px; }

/* Weather in play: shape + name + rows (never an emoji). */
.wchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; white-space: nowrap; flex: none; }
.wchip .ico { color: #b9d4ff; }
.wchip small { color: #b9c7dd; font-size: 11px; }

/* Rows: chips fill the row height with the focal crop; crowded rows overlap like a fanned stack. */
.rows { gap: 4px; }
.row { max-height: 136px; min-height: 0; grid-template-columns: 46px 22px minmax(0, 1fr); align-items: stretch; }
.row > .rowhead, .row > .hornslot { align-self: center; }
.rowhead { gap: 3px; }
.rowhead .ric { display: flex; gap: 3px; align-items: center; color: #cfc7b2; font-size: 13px; }
.rowhead .wx { color: #9cc2ff; display: inline-flex; }
.hornslot { width: 22px; height: min(46px, 80%); border-radius: 11px; border: 2px solid var(--lead); color: #c9a6465c; font-size: 13px;
  background: radial-gradient(ellipse 60% 35% at 50% 28%, #ffffff1f, transparent 70%), linear-gradient(#232c44, #0b0f1a); box-shadow: inset 0 0 0 1px #c9a64640, inset 0 3px 6px #000b; }
.hornslot.on { color: #2a1a05; border-color: var(--lead); background: radial-gradient(circle at 40% 28%, #fff9, transparent 50%), linear-gradient(#f6d58b, #c8912c); box-shadow: inset 0 0 0 1px #fff3, 0 0 12px #e3b04b99; }
.units { container-type: size; height: 100%; min-height: 0; align-items: center; gap: 0; padding: 2px 0; overflow-x: auto; overflow-y: hidden; }
.unit { --w: min(calc(100cqh * .72), 92px); flex: none; width: var(--w); min-width: 0; height: min(100cqh, calc(var(--w) * 1.39)); border-radius: 8px; justify-content: flex-start; }
.unit + .unit { margin-left: clamp(calc(var(--w) * -0.74), calc((100cqw - var(--n) * var(--w)) / max(1, var(--n) - 1)), 4px); }
.unit.has-art .v, .unit .v { position: absolute; left: 2px; top: 2px; margin: 0; z-index: 3; min-width: 1.55em; height: 1.55em; padding: 0 3px; display: grid; place-items: center; border-radius: 999px;
  font-size: clamp(11px, 17cqh, 17px); font-weight: 800; color: #fff; background: radial-gradient(circle at 35% 30%, #fff4, transparent 55%), #120d0aee; border: 2px solid var(--g, #8fb7e6); text-shadow: none; }
.unit.hero .v { color: #1b1407; background: radial-gradient(circle at 35% 30%, #fff9, transparent 50%), linear-gradient(#f6d58b, #c8912c); border-color: #fff3c4; }
.unit.boosted .v { color: #8ef0b4; } .unit.reduced .v { color: #a9c9ff; }
.unit.hero.boosted .v, .unit.hero.reduced .v { color: #1b1407; }
.unit.has-art .ab, .unit .ab { position: absolute; top: 2px; right: 2px; z-index: 3; display: flex; flex-direction: column; gap: 1px; font-size: 0; }
.unit .ab .ico { width: clamp(11px, 13cqh, 15px); height: clamp(11px, 13cqh, 15px); padding: 1px; border-radius: 50%; background: #000c; color: #fff; }
.unit .eye { position: absolute; left: 2px; bottom: 2px; z-index: 3; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #3a1820ee; color: #ffd9de; border: 1px solid #ff9aa8; }
.unit .eye .ico { width: 12px; height: 12px; }
.unit.enemyorigin::after { content: none; }
.unit.has-art::before { background: linear-gradient(#0006, transparent 35%, transparent 70%, #0008); }
.unit .nm { display: none; }
.unit.special .v .ico { width: 1em; height: 1em; }
@container (max-height: 52px) { .unit .ab { display: none; } }
@container (min-height: 92px) { .unit .nm { display: block; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; font-size: 9px; line-height: 1.1; padding: 8px 3px 3px;
  background: linear-gradient(transparent, #000d 45%); color: #fff; text-align: center; max-height: 3.4em; overflow: hidden; margin: 0; } }
.row.legal .projtag { position: absolute; right: 6px; top: 4px; z-index: 4; pointer-events: none; padding: 1px 9px; border-radius: 999px; font-weight: 800; font-size: 13px;
  background: var(--gold); color: #1b1407; box-shadow: 0 2px 8px #000a; }

/* Hand cards: leaded faction glass, art above a name plate (focal face stays clear), strength medallion, ability icons. */
:root { --card-w: 76px; --card-h: 108px; }
.card { padding: 0; }
.card.has-art .art { inset: 0 0 auto 0; height: 72%; object-position: var(--fx, 50%) var(--fy, 22%); }
.card .str { position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 35% 30%, #fff4, transparent 55%), #120d0a; border: 2px solid var(--g, #8fb7e6); box-shadow: 0 1px 4px #000c; z-index: 2; }
.card.hero .str { color: #1b1407; background: radial-gradient(circle at 35% 30%, #fffa, transparent 50%), linear-gradient(#f6d58b, #c8912c); border-color: #fff3c4; }
.card.special .str .ico { width: 16px; height: 16px; }
.card .abl { position: absolute; right: 4px; top: 4px; display: flex; flex-direction: column; gap: 2px; z-index: 2; font-size: 0; }
.card .abl .ico { width: 19px; height: 19px; padding: 2px; border-radius: 50%; background: #000d; color: #fff; box-shadow: 0 0 0 1px var(--g, #fff); }
.card .plate { position: absolute; left: 0; right: 0; bottom: 0; min-height: 28%; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 2px 5px 3px;
  background: linear-gradient(#17120df2, #0d0a08); border-top: 2px solid var(--lead); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--g, #fff) 70%, transparent); }
.card.hero .plate { box-shadow: inset 0 1px 0 #ffe08a; }
.card .rowsic { position: absolute; left: 4px; bottom: calc(30% + 3px); display: flex; flex-direction: column; gap: 2px; font-size: 0; }
.card .rowsic .ico { width: 17px; height: 17px; padding: 2px; border-radius: 4px; background: #000c; color: color-mix(in srgb, var(--g, #fff) 75%, #fff); }
.card .plate .nm, .card.has-art .plate .nm { margin: 0; padding: 0; background: none; font-size: 10.5px; line-height: 1.15; font-weight: 700; color: #fff; -webkit-line-clamp: 2; }
.hand { gap: 6px; align-items: flex-end; padding-top: 10px; }
.hand.many { gap: 4px; }
.card[aria-pressed="true"] { transform: translateY(-6px); }

/* Sheets: an opaque bottom sheet (phone) or side panel (tablet/desktop); animated only when it first opens. */
.sheet { position: fixed; animation: none; max-height: min(64dvh, 620px); padding: 14px 16px 0; background: #121a2c; overscroll-behavior: contain; }
.sheet.compact { max-height: 60dvh; }
.sheet.opening { animation: sheetup .18s ease-out; }
@keyframes sheetup { from { transform: translateY(28px); } }
.sheet .head { display: grid; grid-template-columns: minmax(104px, 36%) minmax(0, 1fr); gap: 14px; align-items: start; padding-right: 36px; }
.sheet .head .bigcard { width: 100%; height: auto; aspect-ratio: 5 / 7; max-width: 190px; padding: 6px; position: relative; }
.sheet .bigcard .str { position: relative; z-index: 2; }
.sheet .bigcard .str .ico { width: 20px; height: 20px; }
.sheet .bigcard .crestbig .ico { width: 34px; height: 34px; }
.sheet h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; display: flex; gap: 8px; align-items: center; }
.sheet .head h3 { display: block; }
.sheet h3 .ico { color: var(--gold2); }
.sheet .wholine { margin: 0 40px 8px 0; overflow-wrap: anywhere; }
.sheet .rowline { margin-top: 6px; }
.pill { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 13px; margin: 0 4px 4px 0; }
.sheet .abls { list-style: none; padding: 0; margin: 10px 0 4px; display: grid; gap: 7px; }
.sheet .abls li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.sheet .abls .ico { width: 20px; height: 20px; color: var(--gold2); margin-top: 1px; }
.proj { border: 1px solid #c9a64677; background: #2a241255; border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.proj h4 { margin: 0 0 4px; font-size: 14px; color: var(--gold2); }
.proj ul { margin: 0; padding-left: 18px; } .proj li { margin: 2px 0; }
.proj .warn { display: flex; gap: 6px; align-items: flex-start; }
.sheet .explain { font-size: 14px; }
.sheet .acts { position: sticky; bottom: 0; z-index: 3; background: #121a2c; margin: 10px -16px 0; padding: 10px 16px calc(12px + var(--safe-b)); box-shadow: 0 -12px 12px -10px #000c; }
.sheet .close { z-index: 4; display: grid; place-items: center; }
.sheet .close .ico { width: 22px; height: 22px; }
.sheet.pending .pickgrid { padding-bottom: calc(12px + var(--safe-b)); }
.sheet .pickgrid .card { width: var(--card-w); height: var(--card-h); }
.netbar { position: absolute; left: 8px; right: 8px; top: calc(54px + var(--safe-t)); z-index: 12; display: flex; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: #3a1820f5; border: 1px solid var(--bad); font-size: 14px; }
.netbar span { flex: 1; }
.passbtn { min-width: 96px; min-height: 48px; }
.skip .ico { margin: 0 0 0 4px; }
.m10-ask .modal .acts { display: grid; gap: 8px; }

@media (max-height: 700px) and (max-width: 600px) { :root { --card-w: 64px; --card-h: 92px; } .card .plate .nm { font-size: 9.5px; } .card .str { width: 22px; height: 22px; font-size: 12px; }
  .card .abl .ico { width: 16px; height: 16px; } .sheet { max-height: 70dvh; } .sheet .head { grid-template-columns: minmax(90px, 32%) minmax(0, 1fr); } }
@media (min-width: 760px) {
  :root { --card-w: 100px; --card-h: 140px; }
  .row { grid-template-columns: 60px 28px minmax(0, 1fr); max-height: 150px; }
  .hornslot { width: 28px; font-size: 16px; border-radius: 14px; }
  .card .plate .nm { font-size: 12.5px; } .card .str { width: 32px; height: 32px; font-size: 17px; } .card .abl .ico { width: 22px; height: 22px; }
  .sheet { left: auto; right: 16px; bottom: auto; top: calc(66px + var(--safe-t)); width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 290px); min-height: 0; border-radius: 16px; }
  .sheet .acts { margin-bottom: 0; border-radius: 0 0 14px 14px; }
}
/* Very narrow layouts (200% zoom on a phone): keep totals, gems, hand count, Pass; drop secondary counts. */
@media (max-width: 300px) {
  .status { gap: 4px; padding: 4px 6px; } .status .crest { display: none; } .status .count + .count { display: none; }
  .status .who small { font-size: 11px; } .gem { width: 11px; height: 11px; } .total { min-width: 40px; font-size: 18px; }
  .row { grid-template-columns: 34px 14px minmax(0, 1fr); } .rowhead .rt { width: 30px; height: 30px; font-size: 13px; } .rowhead .ric { display: none; }
  .hornslot { width: 14px; border-width: 1px; } .hornslot .ico { display: none; }
  .actions { gap: 4px; padding: 4px 6px; } .actions .turn { font-size: 12px; } .passbtn { min-width: 0; padding: 8px 10px; }
  .sheet .head { grid-template-columns: 1fr; padding-right: 30px; } .sheet .head .bigcard { max-width: 120px; }
  .wchip small { display: none; }
}

/* Short phones: one line of compact weather chips, compact row heads. */
@media (max-height: 700px) and (max-width: 600px) {
  .wchip { padding: 2px 8px; font-size: 12px; gap: 4px; } .wchip small { display: none; } .weatherbar { flex-wrap: nowrap; overflow-x: auto; }
  .rowhead { gap: 1px; } .rowhead .rt { width: 32px; height: 32px; font-size: 14px; } .rowhead .ric { font-size: 10px; }
  .row { grid-template-columns: 40px 20px minmax(0, 1fr); } .hornslot { width: 20px; }
  .card .rowsic .ico { width: 15px; height: 15px; }
}
/* Very short viewports (landscape phones, 200% zoom): the table scrolls instead of crushing the rows;
   the action bar stays on screen and sheets are fixed to the viewport. */
@media (max-height: 560px) {
  .table { height: auto; min-height: 100dvh; overflow: visible; grid-template-rows: auto auto auto auto auto auto; }
  .rows { overflow: visible; }
  .row { flex: none; height: 64px; max-height: none; }
  .actions { position: sticky; bottom: 0; z-index: 6; background: #0a0f1af2; border-top: 1px solid var(--line); padding-bottom: calc(6px + var(--safe-b)); }
  .sheet { max-height: 86dvh; } .sheet .head .bigcard { max-width: 120px; }
  .ticker, .skip, .netbar { position: fixed; }
  .status.opp { position: sticky; top: 0; z-index: 7; background: #0b0f1af5; }
  .status.me { position: sticky; bottom: 62px; z-index: 7; background: #0b0f1af5; }
}
@media (max-height: 560px) and (min-width: 700px) {
  .table { grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto auto 1fr auto auto; grid-template-areas: "opp rows" "me rows" "weather rows" "hand hand" "actions actions"; }
  .status { flex-wrap: wrap; border: 0 !important; padding: 6px 10px; gap: 2px 8px; align-content: center; } .status .who { flex-basis: calc(100% - 40px); min-height: 36px; }
  .status.opp { align-self: start; top: 0; } .status.me { align-self: start; top: 104px; bottom: auto; } .weatherbar { flex-direction: column; align-self: start; padding-top: 8px; }
  .sheet { top: 8px; max-height: calc(100dvh - 16px); }
  :root { --card-w: 74px; --card-h: 104px; }
}
@media (max-width: 300px) { :root { --card-w: 62px; --card-h: 88px; } .card .plate .nm { font-size: 9px; } .card .str { width: 22px; height: 22px; font-size: 12px; }
  .card .abl .ico, .card .rowsic .ico { width: 15px; height: 15px; } .weatherbar { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; } }
@media (max-width: 300px) {
  .actions .turn { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .count { font-size: 9px; min-width: 24px; } .count b { font-size: 14px; } .leaderbtn { min-width: 40px; }
  .status .who { min-width: 44px; } .passed { font-size: 0; padding: 2px 4px; } .passed .ico { width: 14px; height: 14px; }
  .status.me { bottom: 58px; }
}

/* Deck editor lines carry a small lazy-loaded art thumbnail (200 px webp, decoded off the main thread). */
.deckline.withthumb { grid-template-columns: 40px 30px minmax(0, 1fr) auto; }
.deckline .thumb { position: relative; width: 40px; height: 56px; border-radius: 6px; overflow: hidden; border: 2px solid var(--lead); box-shadow: inset 0 0 0 1px var(--g, #fff); background: #0b0f1a; }
.deckline .thumb.hero { box-shadow: 0 0 0 1px #ffe08a; }
.deckline .thumb .art { object-position: var(--fx, 50%) var(--fy, 25%); }
.deckline .str .ico { width: 18px; height: 18px; }
/* Phone portrait: the selected-card sheet keeps the upper rows (where legal targets glow) visible; details scroll. */
@media (max-width: 759px) and (min-height: 561px) {
  .sheet.cardsheet { max-height: 48dvh; }
  .sheet.cardsheet .head { grid-template-columns: minmax(84px, 28%) minmax(0, 1fr); }
}

/* M10: player portraits (account choice p1–p6, crest/initials fallback). */
.portrait.sm { width: 36px; height: 36px; font-size: 14px; border-width: 2px; box-shadow: 0 0 0 1px var(--gold); }
.portrait.xs { width: 20px; height: 20px; font-size: 9px; border-width: 1px; box-shadow: 0 0 0 1px var(--gold); vertical-align: -5px; margin-right: 6px; display: inline-grid; }
.status .portrait.sm { flex: none; }
.pp-pick { background: none; border: 0; padding: 0; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.acct { justify-content: flex-start; } .acct .btn { margin-left: auto; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin: 12px 0; }
.pp-opt { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 6px; min-height: 76px; display: grid; place-items: center; }
.pp-opt[aria-pressed="true"] { border-color: var(--gold); }
.seatcard .grow { flex: 1; }
.resportrait { display: grid; place-items: center; margin-bottom: 6px; }
