:root {
 --velvet: #161115;
 --gold-leaf: #dec68b;
 --parchment: #fff0cf;
 --brass: linear-gradient(135deg, #473320 0%, #d4bf89 16%, #65503a 26%, #ffe5a8 49%, #50372b 63%, #aa8a5a 80%, #3a2a20 100%);
 --card-reverse: url("./assets/compass-back.webp");
 --table: url("./assets/engraved-stone.webp");
}
body { background: #1d1713; }
body:has(.battle-room) {
 background: linear-gradient(#191410e8, #211914e8), var(--table) center / cover fixed;
}
.battle-room {
 display: grid;
 grid-template-columns: minmax(390px, 542px) minmax(210px, 245px);
 gap: clamp(22px, 4vw, 58px);
 align-items: start;
 justify-content: center;
 padding: 15px 22px 24px;
 min-height: 100svh;
 color: var(--parchment);
}
.ritual-table {
 --face: 86px;
 --reserve: 52px;
 position: relative;
 isolation: isolate;
 min-width: 0;
 padding: 6px 20px 8px;
 border: 2px ridge #a68a62;
 background: #654f3b;
 box-shadow: 0 10px 48px #090704ba, 0 0 0 1px #2c2016;
}
.ritual-table::before {
 content: '';
 position: absolute;
 inset: 0;
 z-index: -2;
 background: var(--table) center 46% / cover no-repeat;
 filter: saturate(.70) brightness(.88);
}
.ritual-table::after {
 content: '';
 position: absolute;
 inset: 4px;
 border: 1px solid #d5b57e88;
 box-shadow: inset 0 0 13px #38231266;
 pointer-events: none;
 z-index: -1;
}
.seat {
 display: grid;
 grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
 align-items: center;
 position: relative;
 min-height: 66px;
}
.seat::before {
 content: '';
 position: absolute;
 left: 0;
 right: 0;
 top: 50%;
 height: 1px;
 background: linear-gradient(90deg, transparent, #e8d4a0, #5d402c, #e8d4a0, transparent);
 z-index: -1;
}
.seat-tool:last-child { justify-self: end; }
.table-tool {
 display: inline-grid;
 place-items: center;
 position: relative;
 min-height: 30px;
 padding: 4px 9px;
 color: #f3e4c4;
 background: #231a12e8;
 border: 1px solid #c4a778;
 outline: 1px solid #412f1e;
 box-shadow: inset 0 0 0 2px #332b22, inset 0 0 0 3px #8d785066;
 font: 600 11px/1.4 var(--serif);
}
.table-tool:hover, .message-panel:hover { border-color: #ffe2a2; }
.regalia { display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 3px 3px #201408c0); }
.cameo {
 display: grid; place-items: center; position: relative; margin: 0 -2px; z-index: 1;
 background: var(--brass); border: 1px solid #6d5740;
 width: 65px; height: 65px; border-radius: 50%; padding: 4px;
 box-shadow: 0 0 0 1px #2c2018, inset 0 0 0 1px #dbcaad;
}
.cameo-portrait { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 1px solid #d0b48e; position: relative; background: #241a18; }
.cameo-portrait img { display: block; width: 168%; max-width: none; height: auto; margin-left: -34%; margin-top: -24%; }
.cameo strong {
 position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
 background: #27191b; color: #f3dfb4; border: 1px solid #bba176;
 padding: 1px 7px; white-space: nowrap; font: 600 9px/1.25 var(--serif);
}
.rank-tools { display: flex; align-items: center; justify-content: space-between; min-height: 21px; gap: 7px; }
.discard-seal, .fan-count {
 display: inline-flex; align-items: center; gap: 4px; padding: 2px 5px;
 color: #fff6d9; background: #291d14dc; outline: 1px solid #c5a57588;
 font: 600 10px/1.4 var(--serif);
}
.discard-seal i, .fan-count i {
 display: inline-block; position: relative; width: 11px; height: 15px;
 border: 1px solid #ccaf80; background: var(--card-reverse) center / 100% 100%; transform: rotate(-11deg);
}
.fan-count i { box-shadow: 2px 1px #4b3827, 3px 1px #cfb88c; }
.discard-seal b, .fan-count b { font: 13px/1 Georgia, serif; color: #ffe8ae; }
.reserve-row {
 display: grid; grid-template-columns: repeat(5, minmax(0, var(--reserve)));
 gap: clamp(6px, 2.2vw, 12px); justify-content: center;
 padding: 0 0 2px;
}
.reserve-card {
 position: relative; min-width: 0; width: 100%; aspect-ratio: 63/88; display: block;
 padding: 0; color: #fcecc5; border: 1px solid #c0a575; border-radius: 2px;
 box-shadow: 1px 3px 5px #1d110de0;
}
.card-reverse { display: block; width: 100%; height: 100%; object-fit: fill; background: #1d1916; border-radius: 1px; }
.reserve-card.in-duel { border-color: #fff1ba; box-shadow: 0 0 0 1px #b68e43, 0 0 8px #fbd06f85; }
.in-duel-tag {
 position: absolute; left: 50%; top: -4px; transform: translateX(-50%);
 padding: 1px 5px; white-space: nowrap; background: #34251b; color: #ffedc1;
 border: 1px solid #c8a36e; font: 600 8px/1.35 var(--serif);
}
.reserve-card.vacant:disabled { opacity: 1; background: #452e211c; border: 1px solid #d6c19466; box-shadow: inset 0 0 5px #3b2a1f77; }
.vacant-mark { color: #f1deb777; font: 17px/1 Georgia, serif; }
.encounter {
 display: grid;
 grid-template-columns: minmax(0,1fr);
 align-content: center;
 gap: 3px;
 padding: 7px 0 4px;
}
.duel-row {
 display: grid; grid-template-columns: minmax(0, .84fr) var(--face) minmax(0, 1.16fr);
 align-items: center; column-gap: clamp(6px, 1.5vw, 13px);
}
.duel-row[data-side="1"] {grid-row:1;}
.duel-row[data-side="0"] {grid-row:3;}
.message-panel {
 position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
 justify-content: center; min-height: 58px; width: 100%; padding: 7px 9px 8px; gap: 3px;
 background: linear-gradient(105deg, #17120ff7, #151012ec); color: #fff6dd; border: 1px solid #d1b785;
 box-shadow: inset 0 0 0 2px #28211a, inset 0 0 0 3px #967d525f, 1px 3px 6px #25170f91;
}
.message-panel::before, .message-panel::after, .battle-ledger::before, .battle-ledger::after {
 content: ''; pointer-events: none; position: absolute; z-index: 1; width: 8px; height: 8px;
 border-color: #d1b382; border-style: double;
}
.message-panel::before, .battle-ledger::before { top: 3px; left: 3px; border-width: 3px 0 0 3px; }
.message-panel::after, .battle-ledger::after { bottom: 3px; right: 3px; border-width: 0 3px 3px 0; }
.message-heading { font: 600 9px/1.4 var(--sans); color: #ddc89c; }
.message-heading i { display: inline-block; width: 4px; height: 4px; background: #b99b63; transform: rotate(45deg); margin: 0 4px 1px 0; }
.ability-callout { font: 600 14px/1.45 var(--serif); overflow-wrap: anywhere; }
.ability-callout b { color: #ffe29a; font: 700 16px/1 Georgia, serif; white-space: nowrap; }
.more-effects { font: 10px/1.4 var(--sans); color: #e7cf9f; }
.message-panel.just-activated { animation: ability-ink 1.15s ease-out; }
@keyframes ability-ink {
 from { border-color: #fff2c4; background-color: #70522a; box-shadow: inset 0 0 10px #e4bc6f5e, 0 0 6px #efc16d; }
 to { border-color: #d1b785; }
}
.message-reason, .message-empty { font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.message-empty { color: #cbbfa7; }

.duellist { width: var(--face); display: grid; justify-items: center; position: relative; }
.duel-face { display: block; position: relative; width: 100%; aspect-ratio: 63/88; padding: 0; border: 1px solid #ebd6a3; border-radius: 2px; background: #251c19; box-shadow: 0 0 0 1px #5f4829, 0 4px 10px #271b12b3; }
.duel-face .card-art { border-radius: 1px; }
.duel-power {
 display: grid;
 width: 100%;
 min-height: 33px;
 align-content: center;
 justify-items: center;
 row-gap: 1px;
 margin-top: 2px;
 padding: 2px 3px;
 border: 1px solid #c3a473;
 box-shadow: inset 0 0 0 2px #34271d, 0 2px 4px #261a1480;
 background: #271e18ed;
 color: #fff0cc;
}
.duel-power small { font: 600 9px/1.25 var(--sans); letter-spacing: .03em; }
.duel-power b { font: 700 21px/1 Georgia, serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.duel-power.forecast { border-color: #ffe09b; color: #ffe3a0; }
.ritual-table[data-round-winner="0"] .duellist[data-side="0"] .duel-power,
.ritual-table[data-round-winner="1"] .duellist[data-side="1"] .duel-power {border-color:#f6d589;}
.ritual-table[data-round-winner="0"] .duellist[data-side="0"] .duel-face,
.ritual-table[data-round-winner="1"] .duellist[data-side="1"] .duel-face {outline:1px solid #ffe8a4;box-shadow:0 0 0 3px #b28b4d,0 0 12px #ffd17f;}
.aid-zone {
 --ally-width: clamp(48px,12.4vw,57px);
 --aid-tint: #b8d5d2;
 position: relative; min-width: 0; padding: 3px 0 2px;
}
.aid-zone[data-side="1"] {--aid-tint:#e4b8a3;}
.aid-heading {
 display:flex; width:100%; min-height:22px; align-items:center; gap:7px; padding:0 2px 3px; color:#ffefd2;
 font:600 11px/1.3 var(--serif); text-shadow:0 1px 4px #201710,0 0 5px #201710;
}
.aid-heading::after {content:''; height:1px; flex:1; background:linear-gradient(90deg,var(--aid-tint),transparent);}
.aid-heading b {font:italic 13px/1 Georgia,serif; color:var(--aid-tint);}
.aid-cards {
 display:grid;
 grid-template-columns:repeat(auto-fill,minmax(min(100%,clamp(38px,10vw,48px)),1fr));
 justify-items:start;
 gap:6px 4px;
 padding:3px 2px 4px;
}
.field-ally {display:grid; align-content:start; gap:3px; width:100%; padding:0; min-width:0; text-align:center;}
.aid-cards > .field-ally {max-width:var(--ally-width);}
.field-print {display:block; position:relative; width:100%; aspect-ratio:63/88; border:1px solid #bea67d; border-radius:2px; background:#201a17; box-shadow:0 2px 4px #1b110ba6;}
.field-print .card-art {position:absolute; inset:0; border-radius:1px;}
.field-ally-name {display:block; overflow-wrap:anywhere; padding:1px 0; font:500 9px/1.35 var(--serif); color:#fff2d9; background:#251b16c9;}
.field-ally:hover .field-print,.field-ally:focus-visible .field-print {border-color:#ffdfa3;}
.field-ally.joining .field-print {border-color:#fff1c3;box-shadow:0 0 0 1px var(--aid-tint),0 0 7px #e5cd9c8c; animation:ally-arrival .34s ease-out both;}
.aid-zone[data-side="1"] .field-ally {--approach:-7px;}
.aid-empty {width:var(--ally-width); aspect-ratio:63/88; margin:3px 2px 4px; border:1px solid #decba34d; border-radius:2px; display:grid; place-items:center; background:#241b1422;}
.aid-empty i {width:8px; height:8px; transform:rotate(45deg); border:1px solid #e6cca36b;}
@keyframes ally-arrival {from {opacity:.45;transform:translateY(var(--approach,7px));}to {opacity:1;transform:none;}}
.seal-column {
 grid-row:2; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; column-gap:8px;
 position:relative; padding:3px 0; border-block:1px solid #dcc29575; margin:1px 0;
 background:linear-gradient(90deg,#2c211b90,#39291e50,#2c211b90);
}
.seal-column .round-plate {grid-column:1;grid-row:1;display:flex;align-items:baseline;gap:5px;min-width:0;margin:0;padding:2px 5px;border:0;box-shadow:none;background:transparent;}
.seal-column .round-plate small {font-size:10px;}
.seal-column .round-plate b {font:italic 20px/1 Georgia,serif;}
.seal-column .round-plate span {font-size:9px;color:#e3d2b4;}
.seal-column .turn-caption {grid-column:2;grid-row:1;margin:0;padding:0 3px;background:transparent;border:0;font-size:10px;color:#fff4d9;text-shadow:0 1px 3px #261a14;}
.seal-column .turn-seal {grid-column:3;grid-row:1;width:auto;min-width:80px;height:32px;margin-right:2px;padding:2px;border-radius:2px;box-shadow:0 1px 4px #2118119c;}
.seal-column .turn-seal>span {display:flex;align-items:center;justify-content:center;gap:5px;padding:1px 7px;border-radius:0;border-width:1px;height:100%;}
.seal-column .turn-seal .suit-icon {width:13px;height:16px;}
.round-plate {
 display: grid; justify-items: center; min-width: 52px; padding: 5px 10px 6px; margin-bottom: 15px;
 color: #fff1cc; border: 1px solid #ba9e71; background: #2b2019eb;
 box-shadow: inset 0 0 0 2px #342a22, inset 0 0 0 3px #ab946450;
}
.round-plate small { font: 600 9px/1.3 var(--serif); }
.round-plate b { font: 24px/1.1 Georgia, serif; }
.round-plate span { font: 9px/1.5 var(--sans); }
.turn-seal {
 height: 73px; width: 73px; padding: 5px; display: grid; border-radius: 50%;
 border: 1px solid #6a503b; background: var(--brass); color: #fff4da;
 box-shadow: 0 0 0 1px #dec8a5, 0 0 0 3px #423426, 0 4px 9px #23170fc4, inset 0 0 0 1px #c6b08b;
}
.turn-seal > span {
 display: grid; justify-items: center; align-content: center; gap: 1px; border-radius: 50%;
 background: radial-gradient(ellipse at 39% 26%, #bc6658, #8a302e 40%, #561b24 72%, #301820);
 border: 2px ridge #b49b84; box-shadow: inset 1px 2px 7px #220b12b0, inset 0 -1px 2px #d57b5b;
}
.turn-seal b { font: 700 11px/1.4 var(--serif); text-shadow: 0 1px 3px #220d0d; }
.turn-seal .suit-icon { width: 19px; height: 22px; color: #eecfa4; }
.turn-seal:hover:enabled > span { filter: brightness(1.17); }
.turn-seal:active:enabled { transform: translateY(1px); }
.turn-seal:disabled { opacity: 1; filter: saturate(.4); }
.turn-caption, .battle-status {
 margin-top: 6px; padding: 2px 6px; background: #302219df; border: 1px solid #bca173a3;
 color: #fff0cf; font: 600 10px/1.4 var(--serif); text-align: center;
}
.own-rank-tools { margin-bottom: 3px; }
.battle-status { margin: 0; }
.ritual-table .hand-zone { margin: 7px 0 1px; }
.hand-caption { display: flex; justify-content: space-between; align-items: center; min-height: 22px; }
.hand-caption strong { color: #fff1d1; background: #35251ae0; padding: 1px 6px; font: 600 11px/1.5 var(--serif); border-left: 2px solid #e1c38b; }
.hand-caption b { font: 13px Georgia, serif; padding-left: 3px; }
.hand-caption .table-tool { min-height: 22px; font-size: 10px; }
.ritual-table .hand-scroll { min-height: 0; gap: 7px; padding: 5px 3px 2px; align-items: stretch; scrollbar-color: #ceb48b #372a2180; }
.ritual-table .hand-item { flex: 0 0 60px; display:flex; flex-direction:column; }
.ritual-table .hand-card { width: 100%; height: auto; aspect-ratio: 63/88; transition: none; border-color: #cbb694; box-shadow: 0 2px 4px #21160e99; }
.ritual-table .hand-item.eligible .hand-card { box-shadow: 0 0 0 1px #ffdf83, 0 0 7px #fbd793; }
.ritual-table .hand-item.selected .hand-card { transform: none; box-shadow: 0 0 0 2px #fff2af, 0 0 8px #fcda80; }
.ritual-table .hand-detail { flex:1; justify-content:space-between; color: #fff4da; background: #2b1f14db; border: 1px solid #ab906855; margin-top: 3px; padding: 1px 3px; }
.ritual-table .hand-power { font-size: 14px; line-height: 1.18; padding-bottom: 2px; color: #fff3d9; }
.ritual-table .hand-detail-label { color: #e9d3a5; font-size: 8px; }
.ritual-table .hand-name { font-size: 9px; line-height: 1.25; white-space:normal; overflow-wrap:anywhere; text-wrap:balance; }
.ritual-table .hand-name .hand-partner {display:inline-block; margin-inline-start:2px;}
.hand-partner {padding:0 2px;color:#ffdfa1;border:1px solid #b89b66;border-radius:2px;font:600 9px/1 var(--serif);white-space:nowrap;}
.ritual-table .empty-hand { padding: 9px 0; color: #fff1d5; font-size: 12px; text-shadow: 0 1px 4px #24170c; }
.battle-ledger {
 position: sticky; top: 30px; align-self: start; padding: 22px 18px 16px; margin-top: 40px;
 border: 1px solid #af936a; color: #eee4ce; background: linear-gradient(120deg, #211b16, #15120f);
 box-shadow: inset 0 0 0 3px #2b241c, inset 0 0 0 4px #75603f99, 0 7px 15px #110d0a77;
}
.ledger-brand { display: block; width: 100%; margin-bottom: 23px; color: #e9d1a0; text-align: left; padding: 0; font: 26px/1.1 Georgia, serif; letter-spacing: .08em; }
.ledger-brand img { display: block; width: min(100%, 185px); height: auto; }
.battle-ledger h2 { font: 600 14px/1.6 var(--serif); color: #e4c99c; }
.ledger-character { display: grid; grid-template-columns: 39px minmax(0,1fr); gap: 9px; align-items: start; margin: 12px 0 16px; padding: 0; text-align: left; width: 100%; }
.ledger-character > span:first-child { aspect-ratio: 63/88; }
.ledger-character > span:last-child { display: grid; gap: 3px; }
.ledger-character small, .ledger-log small { color: #cbb38a; font: 10px/1.5 var(--sans); }
.ledger-character strong { font: 600 13px/1.5 var(--serif); }
.ledger-character span span, .ledger-log li { font: 11px/1.7 var(--sans); }
.ledger-heading { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid #8e764e77; }
.ledger-log { margin: 8px 0 0; list-style: none; padding: 0; }
.ledger-log li { padding: 8px 0; border-top: 1px solid #806e4c40; }
.ledger-log small { display: block; }
.effect-history { margin: 14px 0 0; padding: 0; list-style: none; }
.effect-history li { padding: 12px 0; border-top: 1px solid var(--line); }
.effect-history small { color: #d8c290; }
.effect-history li div { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0; }
.effect-history li b { color: #f6dba1; }
.effect-history p { font-size: 12px; line-height: 1.6; }
@media (min-width: 761px) and (max-height: 900px) {
 .ritual-table { --face: 73px; --reserve: 45px; }
 .battle-room { padding-top: 8px; }
 .seat { min-height: 58px; }
 .cameo { width: 56px; height: 56px; }
 .ritual-table .hand-item { flex-basis: 53px; }
 .ritual-table .hand-zone { margin-top: 4px; }
}
@media (max-width: 760px) {
 .battle-room { display: block; padding: 0; min-height: 100svh; }
 .ritual-table { --face: clamp(63px, 18.6vw, 83px); --reserve: clamp(40px, 11.8vw, 55px); max-width: 530px; margin: 0 auto; padding: max(5px, env(safe-area-inset-top)) 9px max(6px, env(safe-area-inset-bottom)); border: 0; }
 .battle-ledger { display: none; }
 .seat { min-height: 53px; }
 .cameo { width: 50px; height: 50px; }
 .table-tool { font-size: 10px; min-height: 27px; padding: 3px 6px; }
 .reserve-row { gap: clamp(8px, 2.6vw, 12px); }
 .encounter { gap: 5px; padding-top: 5px; padding-bottom: 4px; }
 .message-panel { min-height: 51px; gap: 2px; padding: 7px 7px 7px; }
 .message-heading { font-size: 9px; }
 .ability-callout { font-size: 13px; }
 .ability-callout b { font-size: 15px; }
 .round-plate { margin-bottom: 12px; padding: 2px 6px; min-width: 49px; }
 .round-plate b { font-size: 20px; }
 .turn-seal { width: 61px; height: 61px; padding: 4px; }
 .turn-caption { font-size: 10px; }
 .rank-tools { min-height: 20px; }
 .ritual-table .hand-item { flex-basis: clamp(47px, 13.6vw, 60px); }
 .ritual-table .hand-scroll { gap: 5px; }
 .ritual-table .hand-detail { margin-top: 2px; }
 .ritual-table .south { margin-top: 3px; }
}
/* Use the same engraved table for choosing the five protagonists. */
body:has(.lobby) { background: linear-gradient(#21180dc4,#251c13d9), var(--table) center / cover fixed; }
.shell:has(.lobby) { max-width: 850px; padding: 0 27px 30px; }
.shell:has(.lobby) .topbar { height: 63px; border-bottom-color: #bba070; }
.shell:has(.lobby) .wordmark, .shell:has(.lobby) .icon-button { color: #f0dfb7; }
.shell:has(.lobby) .wordmark img { border-radius: 50%; }
.lobby { display: block; padding: 19px 0 0; }
.preparation {
 border: 3px ridge #b09a73; box-shadow: 0 6px 24px #190f0ab5, inset 0 0 0 2px #443525;
 background: linear-gradient(#261a12d9, #241a12e3), var(--table) center / cover; color: #f4e7ca; padding: 22px 28px;
}
.preparation h1 { font: 600 25px/1.5 var(--serif); letter-spacing: .08em; }
.setup-instruction { font: 12px/1.7 var(--sans); color: #e3d3b2; }
.preparation .preset-tabs button { color: #d5c4a5; font-family: var(--serif); }
.preparation .preset-tabs button.active { color: #ffebba; }
.preparation .deck-stats, .preparation .zone-label { color: #ddd0b2; }
.preparation .zone-label small, .preparation .prep-footer p, .preparation .pool-card small { color: #cdbaa1; }
.preparation .setup-slot:not(.filled) { background: #221c16; border: 1px solid #ab8b5a; }
.preparation .slot-order { color: #f6deb3; background: #2d2217; }
.preparation .setup-name { color: #ffedc7; }
.gold-button { border: 2px ridge #beac85; color: #ffefce; background: linear-gradient(132deg, #7d4338, #5d2830 52%, #48202b); box-shadow: inset 0 0 0 2px #3e2422, inset 0 0 0 3px #b8976470, 0 2px 5px #1d110b77; font-family: var(--serif); }
dialog { background: linear-gradient(125deg,#2a221c,#1a1512); border: 3px ridge #b4996c; box-shadow: inset 0 0 0 2px #392e22, 0 14px 45px #0c0907a8; }
dialog::backdrop { background: #110b08b0; }
dialog .modal-close, dialog .janken-result, dialog .builder-total, dialog .stepper, dialog .builder-footer { background-color: #2d231c; }
dialog .janken-buttons button { font-family: var(--serif); border-color: #b3976c; background: #281d17; }
dialog .janken-buttons button span { display: grid; place-items: center; border: 2px ridge #bfac84; border-radius: 50%; background: radial-gradient(ellipse at 40% 27%,#835047,#4a2027); color: #f0d5aa; margin: auto auto 6px; width: 48px; height: 48px; font: 22px var(--serif); }
@media (max-width: 760px) {
 .shell:has(.lobby) { padding: 0 10px 14px; }
 .shell:has(.lobby) .topbar { height: 53px; margin: 0 3px; }
 .lobby { padding-top: 9px; }
 .preparation { padding: 16px 13px; }
 .preparation h1 { font-size: 22px; }
 .setup-instruction { font-size: 11px; }
}
@media (max-width: 760px) {
 .ritual-table { min-height: 100svh; display: flex; flex-direction: column; }
 .encounter { flex: 1 0 auto; }
 .ritual-table .seat, .ritual-table .rank-tools, .ritual-table .reserve-row, .ritual-table .hand-zone { flex-shrink: 0; }
}
@media (max-width: 760px) and (min-height: 770px) {
 .ritual-table { --face: clamp(73px, 20vw, 90px); --reserve: clamp(44px, 12.2vw, 57px); }
 .seat { min-height: 57px; }
 .cameo { width: 55px; height: 55px; }
 .ritual-table .hand-item { flex-basis: clamp(52px, 14.6vw, 64px); }
}

/* Reserve the printed card size while images decode, including during taps. */
:is(.hand-card, .duel-face, .reserve-card, .setup-slot) > :is(.card-art, .card-reverse) {
 position: absolute;
 inset: 0;
 width: 100%;
 height: 100%;
 pointer-events: none;
}
.large-card { aspect-ratio: 63/88; align-self: start; }
.ritual-table [hidden] { display: none; }
.ritual-table .selection-check { right: 2px; top: 2px; width: 15px; height: 15px; font-size: 10px; pointer-events: none; }
.ritual-table .hand-scroll { overflow-y: hidden; }
.screen-reader-only {
 position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
 overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (max-width: 760px) {
 .duel-power { min-height: 32px; padding: 2px; }
 .duel-power b { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
 .message-panel.just-activated { animation: none; border-color: #e8c581; }
}

.duel-symbol {font:600 9px/1.3 var(--sans);letter-spacing:.02em;color:#ebce8e;}

.field-ally{position:relative}.field-ally.hidden-partner{cursor:default}.hidden-partner .field-print img{display:block;width:100%;height:100%;object-fit:cover}.private-partner{position:absolute;right:1px;top:2px;background:#171826e8;color:#f4dbad;font-size:.58rem;padding:1px 3px;line-height:1.25;border:1px solid #a98d65}
.partner-opening{position:absolute;z-index:6;inset:0;display:grid;place-items:center;pointer-events:none;background:#11101950}.partner-flip{display:flex;align-items:center;justify-content:center;gap:1.25rem;pointer-events:auto;width:min(100%,32rem);padding:1rem 1.2rem;color:#ffedcd;border-block:1px solid #c2a77a;background:linear-gradient(90deg,#13171bed,#27232afc,#13171bed);box-shadow:0 10px 30px #09080a5e}.flip-print{width:clamp(58px,16vw,100px);animation:partner-turn .42s ease-out}.flip-caption{display:grid;gap:.38rem;text-align:left}.flip-caption small,.flip-caption span{font-size:.75rem;color:#d6c4ac}.flip-caption strong{font-size:clamp(1rem,4vw,1.55rem)}@keyframes partner-turn{from{transform:perspective(450px) rotateY(80deg);opacity:.2}to{transform:perspective(450px) rotateY(0);opacity:1}}@media(prefers-reduced-motion:reduce){.flip-print{animation:none}}
.aid-symbol{display:block;color:#ffdfa4;font-size:clamp(9px,2.6vw,12px);line-height:1.35;text-shadow:0 1px 3px #2e1710}.hidden-partner .field-print{overflow:hidden}.pile-grid .hidden-partner{width:100%;justify-self:center}
