@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,500;9..144,700&display=swap');
:root {
 --ink:#f2e8d5;--muted:#97adb1;--paper:#fffef8;--base:#081923;--accent:#ddb77a;--line:#ffffff20;
 --session-background:#102732;--session-text:#f6e7cb;--session-muted:#a8c0bf;--session-control-bg:#21414a;--session-control-border:#41616b;
 --session-bg:#102732;--session-color:#f6e7cb;--session-accent:#e6c58b;--session-border:#41616b;
 font:15px 'DM Sans',system-ui,sans-serif;color:var(--ink);background:var(--base);
}
*{box-sizing:border-box}
body{margin:0;min-width:760px;min-height:100vh;color:var(--ink);background:radial-gradient(ellipse at 50% -9%,#26504b 0%,transparent 45%),radial-gradient(ellipse at 110% 60%,#122f43 0%,transparent 60%),#081923}
button{font:inherit;cursor:pointer}button:focus-visible,summary:focus-visible{outline:3px solid #ffe39a;outline-offset:3px}
#shell{max-width:1530px;margin:auto;padding:16px 27px 24px}
#notice{padding:11px 15px;border-radius:5px;background:#633739;color:#ffebdb;margin-bottom:9px}
#room-controls>.games-room-controls{display:none}
.regicide-table{display:flex;flex-direction:column;gap:13px;max-width:1475px;margin:auto}
.battle-headline{display:flex;align-items:baseline;justify-content:space-between;gap:10px;min-height:25px;letter-spacing:.13em;font-weight:800;font-size:12px;color:#d7bd8f}
.realm-sub{font-size:11px;color:#829e9d;letter-spacing:.12em}
.section-kicker{font-size:11px;font-weight:800;letter-spacing:.16em;color:#9bb3ab}
.arena{position:relative;display:grid;grid-template-columns:minmax(220px,.87fr) minmax(265px,1.04fr) minmax(250px,1fr);align-items:stretch;gap:18px;min-height:306px}
.arena:before{content:'';position:absolute;inset:8px 15% 18px;border-radius:50%;background:radial-gradient(ellipse at 50% 45%,#56877d1c,transparent 64%);pointer-events:none}
.castle-wing,.enemy-zone,.combat-wing{position:relative;min-width:0}
.castle-wing{display:flex;flex-direction:column;gap:17px;padding:12px 0 13px 12px}
.castle-wing:after{content:'♜';font:400 190px/1 Georgia,serif;color:#769e8120;position:absolute;right:12px;top:50px;z-index:0;pointer-events:none}
.castle-wing>*{z-index:1}
.royal-progress{display:grid;grid-template-columns:repeat(4,38px);gap:9px 10px;margin-top:3px}
.royal-dot{height:38px;display:grid;place-items:center;border:1px solid #56736a7d;background:#18323b90;color:#69837f;font:700 16px/1 'Fraunces',Georgia,serif;border-radius:4px;box-shadow:inset 0 0 0 2px #132631}
.royal-dot.down{background:#d1af76;color:#173139;border-color:#f3d7a0;box-shadow:0 0 10px #c8a97329}
.royal-dot.current{border-color:#efdcac;color:#fff7ce;box-shadow:inset 0 0 0 2px #273e42,0 0 0 2px #debf7f50}
.deck-info{display:flex;gap:35px;margin-top:auto;flex-wrap:wrap}
.stat{display:flex;flex-direction:column;gap:2px;min-width:0}
.stat-name{font-size:11px;font-weight:700;letter-spacing:.09em;color:#90a9ac;text-transform:uppercase}
.stat-value{font:700 34px/1.15 'Fraunces',Georgia,serif;color:#f6e4b9;font-variant-numeric:tabular-nums}
.stat-extra{font-size:12px;color:#9cb1b0}
.enemy-zone{display:flex;flex-direction:column;align-items:center;gap:7px;isolation:isolate}
.enemy-zone:before{content:'';position:absolute;width:310px;height:290px;border:1px solid #c2a47125;border-radius:50%;top:-10px;left:50%;transform:translateX(-50%);z-index:-1;pointer-events:none}
.enemy-heading{width:100%;display:flex;justify-content:center;gap:10px;align-items:baseline}
.enemy-tier{font-size:12px;color:#e9c78f;font-weight:800;letter-spacing:.1em}
.reg-card{--art:none;--card-red:#bc3147;position:relative;display:block;flex:0 1 140px;width:140px;max-width:140px;aspect-ratio:5 / 7;border-radius:7px;overflow:hidden;padding:0;border:2px solid #ddceaf;background:#fffdf8;color:#1c242b;box-shadow:0 3px 0 #8d7c5b,0 6px 17px #0008;isolation:isolate;text-align:left;container-type:inline-size;transition:transform .17s ease,box-shadow .17s ease,border-color .17s ease}
.reg-card .card-illustration{position:absolute;inset:8% 4% 5%;background-image:var(--art);background-repeat:no-repeat;background-position:center 51%;background-size:contain;filter:saturate(1.06)}
.reg-card.suit-hearts,.reg-card.suit-diamonds{--symbol-color:#a93648}
.reg-card.suit-clubs,.reg-card.suit-spades{--symbol-color:#283e4c}
.reg-card.suit-jester{--symbol-color:#8e6b33;background:#fffaf0}
.card-corner{position:absolute;top:4%;left:6%;display:flex;flex-direction:column;align-items:center;gap:0;z-index:2;color:var(--symbol-color)}
.card-corner.bottom{top:auto;left:auto;bottom:4%;right:6%;transform:rotate(180deg)}
.card-rank{font:700 clamp(24px,23cqw,33px)/.95 'Fraunces',Georgia,serif}
.card-suit{font:800 clamp(23px,22cqw,32px)/1 Georgia,serif}
.card-court,.card-caption{position:absolute;left:18%;right:18%;bottom:5%;display:block;text-align:center;font:800 clamp(7px,9cqw,10px)/1.1 'DM Sans',system-ui,sans-serif;letter-spacing:.13em;color:#5b5447}
.card-caption{font-size:11px}
.reg-card.large{flex:0 0 169px;width:169px;max-width:169px;box-shadow:0 5px 0 #8a744d,0 10px 25px #000a;border-color:#eddec0}
.reg-card.mini{flex:0 0 73px;width:73px;max-width:73px;border-width:1px;border-radius:4px;box-shadow:0 3px 9px #0008}
.reg-card.mini .card-corner{left:6%;top:4%}.reg-card.mini .card-corner.bottom{left:auto;top:auto;right:6%;bottom:4%}
.reg-card.mini .card-court{display:none}
.reg-card.back{background:repeating-linear-gradient(45deg,#243c42 0 10px,#1c363c 10px 13px,#244248 13px 22px);border-color:#c6ad7c;display:grid;place-items:center}
.reg-card.back:before{content:'';position:absolute;inset:7px;border:1px solid #bd9f6c;border-radius:3px}
.back-symbol{font:900 63px Georgia,serif;color:#cfbc91}.back-ornament{position:absolute;bottom:12%;font-size:18px;color:#d6c399}
button.reg-card{cursor:pointer}
button.reg-card:hover{transform:translateY(-10px);border-color:#fff2c6;box-shadow:0 9px 0 #8d7c5b,0 17px 28px #0008}
button.reg-card.selected{transform:translateY(-13px);border-color:#f7d27b;box-shadow:0 5px 0 #bda163,0 0 0 3px #f0c977,0 18px 32px #000b}
.reg-card.not-your-turn{filter:saturate(.88)}
.enemy-card{filter:drop-shadow(0 0 12px #e3c68b27)}
.health-track{display:flex;align-items:center;gap:9px;width:260px;max-width:100%;margin-top:8px}
.health-label{font-size:11px;font-weight:800;letter-spacing:.11em;color:#a9babb}
.health-meter{flex:1;height:10px;border-radius:7px;background:#081419;border:1px solid #7180787a;overflow:hidden}
.health-fill{height:100%;background:linear-gradient(90deg,#c58454,#e8bf7b);transition:width .45s ease}
.health-value{font:700 15px 'Fraunces',Georgia,serif;color:#f5e5b9;white-space:nowrap}
.immunity-tag{font:700 11px/1 'DM Sans',sans-serif;letter-spacing:.1em;color:#e9bf84;border:1px solid #c29e624e;background:#5a443121;padding:6px 11px;border-radius:3px}
.immunity-tag.broken{color:#8ed3b9;border-color:#659e8770;background:#26544731}
.royal-complete{font:700 29px/1.2 'Fraunces',Georgia,serif;color:#ebdcb5;padding:95px 15px}
.combat-wing{padding:12px 7px 12px 10px;display:flex;flex-direction:column;gap:12px}
.battle-numbers{display:flex;gap:27px;justify-content:space-between;max-width:350px}
.battle-numbers .stat-value{font-size:39px}
.played-stack{display:flex;align-items:center;min-height:137px;padding-left:4px;isolation:isolate}
.played-stack .reg-card+.reg-card{margin-left:-22px}
.played-stack .reg-card:nth-child(2){z-index:2}.played-stack .reg-card:nth-child(3){z-index:3}.played-stack .reg-card:nth-child(4){z-index:4}.played-stack .reg-card:nth-child(5){z-index:5}
.played-empty{height:110px;border:1px dashed #6780805b;border-radius:7px;display:grid;place-items:center;padding:15px;color:#88a5a4;font:italic 17px 'Fraunces',Georgia,serif;min-width:205px}
.pile-summary{display:flex;gap:20px;align-items:center;color:#c3c8bc;font-size:11px;letter-spacing:.08em;font-weight:800}
.battle-history{position:relative;margin-top:auto;align-self:flex-start}
.battle-history summary{cursor:pointer;color:#d5ba87;font-size:12px;font-weight:700;padding:6px 0}
.battle-events{position:absolute;z-index:20;right:auto;left:0;top:100%;width:335px;max-height:290px;overflow:auto;border:1px solid #51706f;background:#122d36;color:#e1e5d8;border-radius:5px;padding:12px;box-shadow:0 16px 33px #000b}
.battle-event{padding:6px 4px;border-bottom:1px solid #ffffff14;font-size:12px;line-height:1.45}
.battle-event:last-child{border:0}
.crew-rail{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;padding:4px 0 10px;border-bottom:1px solid #ffffff22;min-height:66px}
.crew-member{min-width:0;display:flex;align-items:center;gap:11px;padding:7px 12px;border-left:3px solid #567e7860;border-radius:2px;background:#ffffff07;transition:background .17s}
.crew-member.acting{border-left-color:#f1c47b;background:#c6994340}
.crew-member.you:not(.acting){border-left-color:#7fb9a7}
.crew-avatar{flex:none;display:grid;place-items:center;height:34px;width:34px;border:1px solid #668d83;border-radius:50%;background:#29464a;color:#f1e0be;font:700 18px 'Fraunces',Georgia,serif}
.crew-text{display:flex;flex-direction:column;min-width:0}
.crew-name{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.crew-holding{font-size:12px;color:#b5c2b8}
.crew-active{margin-left:auto;font-size:10px;letter-spacing:.11em;font-weight:800;color:#efd4a8}
.turn-bar{display:flex;align-items:center;justify-content:space-between;gap:17px;min-height:79px;padding:5px 0}
.turn-message{display:flex;flex-direction:column;gap:5px;min-width:0}
.turn-title{font:700 21px/1.1 'Fraunces',Georgia,serif;color:#f4dfb3}
.turn-sub,.turn-reason{font-size:12px;color:#b4c5c3}
.turn-reason{color:#edceac}
.turn-controls{display:flex;gap:9px;justify-content:flex-end;align-items:center;flex-wrap:wrap;flex:none}
.turn-controls button,.decision-actions button,.inspect-dialog button{min-height:41px;padding:9px 16px;border:1px solid #6d9691;border-radius:5px;background:#234c50;color:#e7e9d9;font-weight:800;font-size:13px;white-space:nowrap}
.turn-controls button.primary,.decision-actions button[value=confirm]{background:#dfb873;border-color:#f3d49a;color:#112d31;box-shadow:0 2px 0 #8f714a}
.turn-controls button.ghost{background:transparent;border-color:#607875}
.turn-controls button:disabled{opacity:.28;cursor:not-allowed}
.turn-controls button:not(:disabled):hover,.decision-actions button:hover{filter:brightness(1.16)}
.turn-controls .draft-value{color:#d9d6bd;font-size:12px;white-space:nowrap}
.draft-effects{display:flex;gap:6px;flex-wrap:wrap}
.effect-pill{display:flex;align-items:center;gap:5px;padding:4px 8px;background:#19343b;border:1px solid #4c7373;border-radius:3px;color:#dee9df;font-size:11px}
.effect-pill.immune{opacity:.43;text-decoration:line-through}
.effect-icon{font-size:17px;color:#e9b28c}
.effect-value{font-size:13px;color:#f4e2ae}
.effect-name{font-size:11px}
.hand-region{display:flex;flex-direction:column;gap:7px;padding-bottom:8px}
.hand-heading{display:flex;justify-content:space-between;align-items:baseline;gap:15px;font-size:12px;color:#a6bab7}
.hand-heading strong{font-weight:800;letter-spacing:.14em;color:#e6c58e}
.hand-row{display:flex;justify-content:center;align-items:flex-start;gap:12px;min-height:204px;width:100%;padding:10px 5px 4px;overflow:visible}
.hand-row .reg-card{flex:0 1 140px;min-width:0}
.empty-hand,.spectator-hand{width:100%;min-height:140px;display:grid;place-items:center;color:#88a2a0;border:1px dashed #4269685e;border-radius:5px}
.regicide-table.settling[data-recent="attack"] .enemy-card{animation:royal-shudder .4s cubic-bezier(.16,.6,.28,1.1)}
.regicide-table.settling[data-recent="defeat"] .enemy-card{animation:royal-entrance .48s ease both}
.regicide-table.settling[data-recent="discard"] .hand-region{animation:turn-pulse .3s ease}
.regicide-table.settling[data-recent="jester"] .immunity-tag{animation:glow-pulse .5s ease}
.regicide-table.settling[data-recent="solo_jester"] .hand-region{animation:turn-pulse .5s ease}
@keyframes royal-shudder{0%,100%{transform:translateX(0)}23%{transform:translateX(-6px) rotate(-2deg)}50%{transform:translateX(5px) rotate(2deg)}75%{transform:translateX(-3px)}}
@keyframes royal-entrance{from{opacity:.1;transform:translateY(-18px) scale(.96)}to{opacity:1;transform:none}}
@keyframes turn-pulse{from{opacity:.5;transform:translateY(5px)}to{opacity:1;transform:none}}
@keyframes glow-pulse{50%{box-shadow:0 0 18px #72efc685}}
dialog{color:#f6e8cd;background:#112934;border:1px solid #688b80;border-radius:9px;box-shadow:0 25px 90px #000c;max-width:min(860px,94vw)}
dialog::backdrop{background:#020c12bc}
#card-inspector .inspect-dialog{display:flex;gap:27px;align-items:center;justify-content:space-between;min-width:min(480px,83vw);padding:27px;margin:0}
.inspect-body{order:-1}.inspect-body .reg-card{width:215px;max-width:215px;flex-basis:215px}
.inspect-copy{flex:1;max-width:300px}
.inspect-copy h2{font:700 29px/1.2 'Fraunces',Georgia,serif;color:#f3d8a3}
.inspect-copy p{font-size:14px;line-height:1.65;color:#bfd0c9}
.decision-content{min-width:min(440px,83vw);padding:22px 28px;margin:0}
.decision-content h2{font:700 28px 'Fraunces',Georgia,serif;color:#f4dfb3;margin:0 0 8px}
.decision-content p{line-height:1.5;color:#c7d6cc}
.decision-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}
.games-lobby-shell,.games-lobby-dialog{--surface:#142e38;--surface-soft:#1e434a;--ink:#f6e8cf;--muted:#b4c7c3;--border:#557b78;--action:#e4bd7c;--action-ink:#112d31}
@media (max-width:1220px){
 #shell{padding:10px 16px 20px}
 .arena{grid-template-columns:minmax(190px,.8fr) minmax(230px,1fr) minmax(215px,.8fr);gap:9px}
 .reg-card.large{width:152px;max-width:152px;flex-basis:152px}
 .hand-row{gap:8px}.hand-row .reg-card{flex-basis:122px}
 .crew-rail{gap:7px}.crew-member{padding:6px 8px}
 .turn-title{font-size:19px}.turn-controls button{padding:9px 11px}
}
/* Keep the entire tabletop, turn decision and hand visible on short desktop screens. */
@media (max-height:840px){
 #shell{padding-top:8px;padding-bottom:9px}
 .regicide-table{gap:7px}
 .battle-headline{min-height:19px}
 .arena{min-height:258px}
 .castle-wing{gap:10px;padding:5px 0 5px 10px}
 .royal-progress{gap:6px 9px}
 .royal-dot{height:34px}
 .enemy-zone{gap:4px}
 .enemy-zone:before{height:254px}
 .reg-card.large{flex-basis:149px;width:149px;max-width:149px}
 .health-track{margin-top:3px}
 .combat-wing{padding-top:5px;padding-bottom:4px;gap:7px}
 .played-stack{min-height:105px}
 .crew-rail{min-height:53px;padding:2px 0 5px}
 .turn-bar{min-height:65px;padding:2px 0}
 .hand-region{gap:5px;padding-bottom:0}
 .hand-row{min-height:182px;padding:5px 5px 2px}
 .hand-row .reg-card{flex-basis:127px}
}
