/* ==========================================================================
   Legislate — Capitol chamber theme
   ========================================================================== */
:root {
    --navy: #0f1a33;
    --navy-2: #1b2a4d;
    --mahogany: #3a1c12;
    --mahogany-2: #24110b;
    --gold: #d4af37;
    --gold-2: #f3d77a;
    --gold-dim: #8a6d1f;
    --parchment: #f4ead2;
    --parchment-2: #e6d4ad;
    --ink: #2b2118;
    --d: #2563c9;
    --r: #c23b2e;
    --i: #8a49b0;
    --legal: #57e08a;
    --target: #ff9f43;
    --danger: #ff5a4e;
    --card-w: 118px;
    --card-h: 170px;
    --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --display: "Cinzel", "Trajan Pro", Georgia, serif;
}

/* The chamber fills the page under the nav; the footer is hidden on the play page. */
.chamber {
    min-height: calc(100vh - var(--nav-h, 57px));
    color: var(--parchment);
    background:
        radial-gradient(ellipse 70% 45% at 50% 0%, rgba(212, 175, 55, .16), transparent 70%),
        radial-gradient(ellipse 120% 60% at 50% 100%, rgba(0, 0, 0, .55), transparent 70%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 9px),
        linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 38%, var(--mahogany) 72%, var(--mahogany-2) 100%);
    position: relative;
    overflow: hidden;
    user-select: none;
}
body:has(.chamber) footer { display: none; }
body:has(.chamber) { margin-bottom: 0; overflow-x: hidden; }

/* ----- setup screen ----- */
.setup { max-width: 720px; margin: 0 auto; padding: 4rem 1.5rem 3rem; text-align: center; position: relative; }
.setup h1 {
    font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.2rem); letter-spacing: .12em;
    color: var(--gold-2); text-shadow: 0 2px 0 #6b4d10, 0 10px 30px rgba(0, 0, 0, .6); margin: 2.2rem 0 .8rem;
}
.setup-dome, .arena::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 210'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='2'%3E%3Cpath d='M197 8h6M200 8V0M200 8v14'/%3E%3Cpath d='M186 22h28v10h-28z'/%3E%3Cpath d='M150 70 Q200 10 250 70'/%3E%3Cpath d='M140 70h120v14H140z'/%3E%3Cpath d='M150 84v32M165 84v32M180 84v32M195 84v32M205 84v32M220 84v32M235 84v32M250 84v32'/%3E%3Cpath d='M110 116h180v12H110z'/%3E%3Cpath d='M30 210V150h340v60M30 150 L200 128 L370 150'/%3E%3Cpath d='M60 160v50M90 160v50M120 160v50M150 160v50M250 160v50M280 160v50M310 160v50M340 160v50'/%3E%3Cpath d='M176 210v-34a24 24 0 0 1 48 0v34'/%3E%3C/g%3E%3C/svg%3E") no-repeat center top / contain;
}
.setup-dome { width: 240px; height: 126px; margin: 0 auto; opacity: .55; }
.setup-lead { font-family: var(--serif); font-size: 1.15rem; color: var(--parchment); }
.setup-rules { font-family: var(--serif); color: #cdbf9d; }
.setup-buttons { display: flex; gap: 1.5rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.seal-button {
    display: flex; align-items: center; gap: .8rem; padding: .7rem 1.4rem .7rem .7rem; border-radius: 999px;
    font-family: var(--display); font-weight: 600; letter-spacing: .06em; color: #fff; cursor: pointer;
    border: 2px solid var(--gold); box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .15s, box-shadow .15s;
}
.seal-button:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0, 0, 0, .55), 0 0 0 4px rgba(212, 175, 55, .25); }
.seal-button.party-D { background: linear-gradient(180deg, #2f6fd8, #173f86); }
.seal-button.party-R { background: linear-gradient(180deg, #d24a3c, #7d1f17); }
.seal-button .seal {
    width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem;
    background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-dim)); color: #4a3405;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .35);
}
.setup-error { color: #ffb4a8; margin-top: 1.2rem; font-family: var(--serif); }
.setup-error a { color: var(--gold-2); }

/* ----- board layout ----- */
.board { display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: calc(100vh - var(--nav-h, 57px)); min-height: 700px; }
.arena {
    position: relative; display: grid; padding: 10px 24px 0;
    grid-template-rows: auto 52px minmax(0, 1fr) 26px minmax(0, 1.55fr) 200px;
}
.arena::before {
    content: ""; position: absolute; left: 50%; top: 40px; width: min(720px, 80%); height: 380px; transform: translateX(-50%);
    opacity: .09; pointer-events: none;
}
.chamber.their-turn .you-side { filter: saturate(.85); }

.hud { display: flex; align-items: center; gap: 18px; min-height: 64px; position: relative; z-index: 2; }
.you-side { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.seat { display: flex; flex-direction: column; gap: 4px; min-width: 170px; }
.plate {
    font-family: var(--display); font-weight: 600; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase;
    padding: 6px 14px; border-radius: 4px; color: #2c1f05;
    background: linear-gradient(180deg, #f6e08f, var(--gold) 55%, #a8831f);
    box-shadow: 0 2px 0 #5e4510, 0 4px 10px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .6);
    text-align: center;
}
.statuses { display: flex; gap: 4px; flex-wrap: wrap; min-height: 18px; }
.status-chip {
    font-family: var(--display); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
    background: #7a1d14; color: #ffe1d6; border: 1px solid #ff8a73; border-radius: 3px; padding: 1px 6px;
}

/* bills: parchment scrolls with a vote-tally meter */
.bill {
    flex: 1 1 auto; max-width: 480px; position: relative; padding: 8px 22px 9px; color: var(--ink);
    background:
        radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .55), transparent 55%),
        linear-gradient(180deg, var(--parchment), var(--parchment-2));
    border-radius: 3px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 0 18px rgba(120, 80, 20, .25);
}
.bill::before, .bill::after {
    content: ""; position: absolute; top: -4px; bottom: -4px; width: 14px; border-radius: 7px;
    background: linear-gradient(90deg, #7b5a2a, #d9b77a 45%, #6b4a1d);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.bill::before { left: -7px; }
.bill::after { right: -7px; }
.bill-label { font-family: var(--display); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: #7a5b22; }
.bill-name { font-family: var(--serif); font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter {
    height: 14px; margin: 5px 0 3px; border-radius: 7px; overflow: hidden; position: relative;
    background: #cdb98f; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35);
}
.meter::after {
    /* a tick every 5 Support (6 segments of 30) */
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 2px), rgba(60, 40, 10, .45) calc(100% / 6 - 2px) calc(100% / 6));
}
.fill { height: 100%; width: 0; transition: width .7s cubic-bezier(.2, .8, .2, 1); position: relative; }
.bill[data-party="D"] .fill { background: linear-gradient(180deg, #6aa4ff, var(--d) 60%, #173f86); box-shadow: 0 0 12px rgba(80, 150, 255, .8); }
.bill[data-party="R"] .fill { background: linear-gradient(180deg, #ff8b7d, var(--r) 60%, #7d1f17); box-shadow: 0 0 12px rgba(255, 110, 90, .8); }
.fill::after { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .45), transparent); }
.bill-count { font-family: var(--serif); font-size: .8rem; text-align: right; color: #5a4220; }
.bill-count b { font-size: 1.05rem; color: var(--ink); }
.bill.blocked { filter: sepia(.6) brightness(.85); }
.bill.target, .bill.drop-target { box-shadow: 0 0 0 3px var(--target), 0 0 26px 6px rgba(255, 159, 67, .55); cursor: pointer; }
.bill.drop-hover { transform: scale(1.04); box-shadow: 0 0 0 4px var(--gold-2), 0 0 40px 10px rgba(255, 215, 106, .75); }

/* capital: gold coins */
.capital { display: flex; flex-direction: column; gap: 3px; }
.capital-label { font-family: var(--display); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2); }
.capital-label b { font-size: .85rem; }
.coins { display: flex; gap: 3px; }
.coin { width: 15px; height: 15px; border-radius: 50%; }
.coin.full { background: radial-gradient(circle at 35% 30%, #fff3b8, var(--gold) 50%, #7e5d12); box-shadow: 0 0 6px rgba(255, 215, 106, .7); }
.coin.spent { background: #3a2e14; box-shadow: inset 0 0 0 1.5px #7e6526; }
.coin.locked { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }

/* decks: a stack of card backs */
.deck {
    width: 56px; height: 80px; border-radius: 6px; position: relative; flex: none; margin-left: auto;
    background: linear-gradient(135deg, #1c2d57, #0c1530);
    border: 2px solid var(--gold-dim);
    box-shadow: 2px 2px 0 #0a1227, 4px 4px 0 #1c2d57, 5px 5px 0 var(--gold-dim), 7px 7px 12px rgba(0, 0, 0, .6);
}
.deck::before { content: "⚖"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); opacity: .55; font-size: 1.4rem; }
.deck.empty { opacity: .3; box-shadow: none; }
.deck-count {
    position: absolute; bottom: -8px; right: -8px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px;
    background: var(--gold); color: #2c1f05; font: 700 .75rem/24px var(--serif); text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

/* opponent hand: fanned backs */
.opp-hand { position: relative; height: 52px; }
.opp-hand .card.back {
    position: absolute; left: 50%; top: 4px; margin-left: -24px; width: 48px; height: 70px;
    transform: translate(calc(var(--x) * .5), calc(var(--y) * -.6)) rotate(calc(var(--r) * -1));
}

/* floors: mahogany benches */
.floor {
    display: flex; gap: 14px; justify-content: center; align-items: center; padding: 10px; position: relative;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .05));
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .14), inset 0 8px 30px rgba(0, 0, 0, .35);
}
.you-side.drop-target .you-floor { box-shadow: inset 0 0 0 2px var(--legal), inset 0 0 40px rgba(87, 224, 138, .25); }
.you-side.drop-hover .you-floor { box-shadow: inset 0 0 0 3px var(--gold-2), inset 0 0 60px rgba(255, 215, 106, .35); }

.rail {
    position: relative; display: flex; align-items: center; justify-content: flex-end;
    background: linear-gradient(180deg, transparent 0 44%, #5e4510 44%, var(--gold-2) 50%, #8a6d1f 56%, transparent 56%);
}
.end-turn {
    position: relative; z-index: 5; width: 86px; height: 86px; border-radius: 50%; margin-right: 6px;
    font-family: var(--display); font-weight: 800; font-size: .82rem; letter-spacing: .08em; line-height: 1.15;
    color: #3b2805; cursor: pointer; border: 3px solid #6b4d10;
    background: radial-gradient(circle at 35% 30%, #fff1b0, var(--gold) 50%, #7e5d12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .6), inset 0 -4px 8px rgba(0, 0, 0, .35);
    transition: transform .15s, filter .15s;
}
.end-turn:hover:not(:disabled) { transform: scale(1.06); }
.end-turn:disabled { filter: grayscale(.9) brightness(.55); cursor: default; }
.end-turn.ready { animation: pulse-ready 1.4s ease-in-out infinite; }
@keyframes pulse-ready { 0%, 100% { box-shadow: 0 8px 18px rgba(0, 0, 0, .6), 0 0 0 0 rgba(87, 224, 138, .7); } 50% { box-shadow: 0 8px 18px rgba(0, 0, 0, .6), 0 0 0 12px rgba(87, 224, 138, 0); } }

/* hand: fanned along the bottom edge */
.hand { position: relative; }
.hand .card {
    position: absolute; left: 50%; bottom: 28px; margin-left: calc(var(--card-w) / -2);
    transform: translate(var(--x), var(--y)) rotate(var(--r));
    transform-origin: 50% 120%;
    transition: transform .18s ease-out, box-shadow .18s;
}
.hand .card:hover, .hand .card.selected {
    transform: translate(var(--x), -46px) rotate(0deg) scale(1.22);
    z-index: 50;
}

/* ----- cards: official placards ----- */
.card {
    width: var(--card-w); height: var(--card-h); border-radius: 10px; position: relative; flex: none;
    color: var(--ink); font-size: .72rem;
    background: linear-gradient(180deg, #fbf5e3, #ecdcb5);
    border: 2px solid var(--gold);
    box-shadow: inset 0 0 0 3px #fbf5e3, inset 0 0 0 4px rgba(170, 130, 40, .55), 0 8px 16px rgba(0, 0, 0, .5);
    touch-action: none;
}
.card.member.party-D { --party: var(--d); }
.card.member.party-R { --party: var(--r); }
.card.member.party-I { --party: var(--i); }
.card .portrait { position: absolute; left: 6px; right: 6px; top: 6px; height: 84px; border-radius: 6px 6px 0 0; overflow: hidden; background: #c9ced6; }
.card .portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
.card .portrait::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 18px rgba(30, 20, 5, .55); }
.card .band {
    position: absolute; left: 6px; right: 6px; top: 90px; height: 16px; padding: 0 6px;
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(180deg, color-mix(in srgb, var(--party) 80%, white), var(--party));
    color: #fff; font: 700 .58rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
}
.card .name {
    position: absolute; left: 6px; right: 6px; top: 108px; text-align: center;
    font: 700 .66rem/1.12 var(--serif); max-height: 2.24em; overflow: hidden;
}
.card .kws { position: absolute; left: 22px; right: 22px; top: 134px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.card .kw {
    font: 600 .5rem/1 var(--display); letter-spacing: .05em; text-transform: uppercase; padding: 2px 4px; border-radius: 2px;
    background: #3b2a12; color: var(--gold-2);
}
.card .kw-leader { background: #6b4d10; color: #fff4c4; }
.card .kw-gatekeeper { background: #24345e; color: #cfe0ff; }
.card .kw-bipartisan { background: #4b2a5e; color: #f0dcff; }
.card .cost {
    position: absolute; left: -9px; top: -9px; width: 30px; height: 30px; border-radius: 50%; z-index: 2;
    display: grid; place-items: center; font: 800 .95rem/1 var(--display); color: #fff;
    background: radial-gradient(circle at 35% 30%, #e05a4a, #9e1f17 60%, #5e0d09);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .55), inset 0 -2px 3px rgba(0, 0, 0, .4);
    text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
}
.card .stat {
    position: absolute; bottom: -8px; width: 30px; height: 30px; display: grid; place-items: center;
    font: 800 .95rem/1 var(--display); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .55);
}
.card .stat.inf { left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe48a, #c99212 60%, #6e4c05); }
.card .stat.res { right: -8px; border-radius: 6px 6px 50% 50%; background: radial-gradient(circle at 35% 30%, #7fe0a0, #23843f 60%, #0f4520); }
.card .stat.inf.buffed { color: #fff7c2; box-shadow: 0 0 10px 2px rgba(255, 220, 100, .9); }
.card .stat.res.hurt { background: radial-gradient(circle at 35% 30%, #ff9b8f, #c0392b 60%, #6b130c); }

.card.action { background: radial-gradient(ellipse at 50% 30%, #fff8e6, #ead6a6); }
.card .seal-art {
    position: absolute; left: 50%; top: 18px; width: 64px; height: 64px; margin-left: -32px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.8rem; color: #fbe6c8;
    background: radial-gradient(circle at 35% 30%, #d4594a, #8f1b13 60%, #4d0905);
    box-shadow: 0 3px 6px rgba(0, 0, 0, .45), inset 0 -3px 6px rgba(0, 0, 0, .35);
}
.card.action .name { top: 90px; font-family: var(--display); font-size: .74rem; }
.card .rules { position: absolute; left: 8px; right: 8px; top: 114px; text-align: center; font: .62rem/1.25 var(--serif); color: #4a3a25; }

.card.back {
    background: repeating-linear-gradient(45deg, rgba(212, 175, 55, .08) 0 4px, transparent 4px 8px), linear-gradient(135deg, #1f3263, #0b1430);
    border-color: var(--gold-dim); box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}
.card.back .back-seal { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: 1.6rem; opacity: .7; }

/* card states */
.card.legal { box-shadow: inset 0 0 0 3px #fbf5e3, 0 0 0 3px var(--legal), 0 0 22px 4px rgba(87, 224, 138, .5), 0 8px 16px rgba(0, 0, 0, .5); cursor: grab; }
.card.target, .card.drop-target { box-shadow: inset 0 0 0 3px #fbf5e3, 0 0 0 3px var(--target), 0 0 24px 6px rgba(255, 159, 67, .6); cursor: pointer; }
.card.drop-hover { transform: scale(1.08); box-shadow: inset 0 0 0 3px #fbf5e3, 0 0 0 4px var(--gold-2), 0 0 40px 10px rgba(255, 215, 106, .8); }
.card.selected { box-shadow: inset 0 0 0 3px #fbf5e3, 0 0 0 4px var(--gold-2), 0 0 30px 8px rgba(255, 215, 106, .65); }
.card.resting { filter: saturate(.55) brightness(.82); }
.floor .card { transition: transform .15s, filter .2s; }
.floor .card[data-friend].legal:hover { transform: translateY(-6px); }
.card.drag-source { opacity: .35; }
body.dragging, body.dragging * { cursor: grabbing !important; }

/* ----- the Congressional Record (side panel) ----- */
.record {
    display: flex; flex-direction: column; gap: 10px; padding: 14px; color: var(--ink);
    background: linear-gradient(180deg, #efe2c2, #e2cfa2);
    box-shadow: inset 6px 0 18px rgba(80, 50, 10, .35), -6px 0 18px rgba(0, 0, 0, .35);
    max-height: calc(100vh - var(--nav-h, 57px)); position: sticky; top: 0;
}
.record-head {
    font-family: var(--display); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-align: center;
    border-top: 3px double #7a5b22; border-bottom: 3px double #7a5b22; padding: 6px 0; color: #4a3410;
}
.hint { font: italic .82rem/1.35 var(--serif); color: #5a4220; margin: 0; min-height: 2.6em; }
.detail { background: #fbf4df; border: 1px solid #c9b07a; border-radius: 6px; padding: 10px; font-family: var(--serif); font-size: .8rem; min-height: 120px; }
.detail img { width: 100%; max-height: 210px; object-fit: cover; object-position: 50% 15%; border-radius: 4px; border: 2px solid var(--gold); }
.detail h3 { font-family: var(--display); font-size: 1rem; margin: 8px 0 4px; }
.detail ul { padding-left: 1.1rem; margin: 4px 0; }
.detail-stats { display: flex; gap: 8px; }
.detail-stats span { padding: 1px 8px; border-radius: 10px; color: #fff; font-weight: 700; font-size: .75rem; }
.d-cost { background: #9e1f17; } .d-inf { background: #b8860b; } .d-res { background: #23843f; }
.d-cost::before { content: "Cost "; } .d-inf::before { content: "Influence "; } .d-res::before { content: "Resolve "; }
.detail-rules { margin: 6px 0; }
.detail .explainer { color: #5e4a2a; font-style: italic; border-left: 3px solid var(--gold); padding-left: 8px; }
.detail .credit { color: #8a7650; font-size: .68rem; margin: 4px 0 0; }
.detail-empty { color: #8a7650; font-style: italic; margin: 0; }
.log {
    flex: 1; overflow-y: auto; margin: 0; padding: 8px 8px 8px 1.6rem; min-height: 120px;
    background: #fbf4df; border: 1px solid #c9b07a; border-radius: 6px; font: .76rem/1.4 var(--serif);
}
.log li { margin: 1px 0; }
.log li.turn-line { list-style: none; margin: 8px 0 3px -1rem; font-family: var(--display); font-weight: 600; color: #7a5b22; }

/* ----- banners ----- */
.turn-banner {
    position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) scaleX(0); opacity: 0; z-index: 60;
    padding: 14px 70px; pointer-events: none; white-space: nowrap;
    font-family: var(--display); font-weight: 800; font-size: 2rem; letter-spacing: .14em; text-transform: uppercase;
    color: #2c1f05; background: linear-gradient(90deg, transparent, var(--gold-2) 18%, var(--gold) 50%, var(--gold-2) 82%, transparent);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}
.turn-banner.opponent { color: #fff; background: linear-gradient(90deg, transparent, #4a1712 18%, #7d1f17 50%, #4a1712 82%, transparent); text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.banner {
    position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 70; text-align: center;
    min-width: 340px; padding: 26px 36px; border-radius: 10px; color: var(--ink);
    background: linear-gradient(180deg, var(--parchment), var(--parchment-2));
    border: 3px double var(--gold-dim); box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
}
.banner-seal {
    width: 64px; height: 64px; margin: -58px auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; color: #fbe6c8;
    background: radial-gradient(circle at 35% 30%, #d4594a, #8f1b13 60%, #4d0905); box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}
.banner-text { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: .06em; }
.btn-brass {
    margin-top: 14px; padding: 8px 22px; border-radius: 999px; border: 2px solid #6b4d10; cursor: pointer;
    font-family: var(--display); font-weight: 600; letter-spacing: .08em; color: #3b2805;
    background: linear-gradient(180deg, #fff1b0, var(--gold) 55%, #9a741a);
}

/* ----- effects layer ----- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1200; }
.fx-card { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; }
.fx-card > .card { margin: 0; }
.fx-card .card.legal, .fx-card .card.selected { box-shadow: inset 0 0 0 3px #fbf5e3, 0 18px 40px rgba(0, 0, 0, .6); }
.drag-ghost { z-index: 2; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .6)); }
.fx-float {
    position: absolute; font-family: var(--display); font-weight: 800; font-size: 1.7rem; white-space: nowrap;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .7), 0 0 12px rgba(0, 0, 0, .6);
}
.fx-float.damage { color: var(--danger); font-size: 2rem; }
.fx-float.gain { color: #8dffb3; }
.fx-float.loss { color: #ff8f80; }
.fx-float.buff { color: #fff1a6; }
.fx-stamp {
    position: absolute; padding: 6px 18px; border: 4px double #b0251a; border-radius: 6px; white-space: nowrap;
    font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: .14em; text-transform: uppercase;
    color: #b0251a; background: rgba(255, 245, 225, .85); mix-blend-mode: multiply;
}
.fx-stamp.passed { color: #1f6b2e; border-color: #1f6b2e; font-size: 2.2rem; }
.fx-stamp.status { font-size: 1.1rem; }
.fx-coin {
    position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3b8, var(--gold) 50%, #7e5d12);
    box-shadow: 0 0 14px 4px rgba(255, 215, 106, .8);
}
.fx-confetti { position: absolute; top: 0; width: 9px; height: 14px; border-radius: 2px; }

.arrow-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1201; display: none; }
.arrow-layer.on { display: block; }
#arrow-path {
    fill: none; stroke: #ffd76a; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 2 16;
    filter: drop-shadow(0 0 6px rgba(255, 200, 60, .9)); animation: march .5s linear infinite;
}
@keyframes march { to { stroke-dashoffset: -18; } }

@media (prefers-reduced-motion: reduce) {
    .fill, .hand .card, .floor .card { transition: none; }
    .end-turn.ready, #arrow-path { animation: none; }
}

@media (max-width: 1100px) {
    .board { grid-template-columns: 1fr; height: auto; }
    .record { position: static; max-height: none; }
}

/* Compact cards for narrow or short screens. */
@media (max-width: 1100px), (max-height: 920px) {
    .arena { grid-template-rows: auto 44px minmax(0, 1fr) 24px minmax(0, 1.55fr) 172px; }
    .hand .card { bottom: 32px; }
    .opp-hand { height: 44px; }
    .card .kws { top: 119px; }
    :root { --card-w: 100px; --card-h: 146px; }
    .card .portrait { height: 70px; }
    .card .band { top: 76px; }
    .card .name { top: 94px; }
    .card .rules { top: 100px; }
    .card.action .name { top: 78px; }
    .card .seal-art { width: 50px; height: 50px; margin-left: -25px; top: 14px; font-size: 1.4rem; }
    .card .ability-mark { top: 50px; }
}

/* ----- tutorial coach ----- */
.learn-button {
    margin-top: 1.4rem; background: none; border: 1px dashed rgba(212, 175, 55, .6); color: #e9dcb8;
    font-family: var(--serif); padding: .55rem 1.2rem; border-radius: 999px; cursor: pointer;
}
.learn-button strong { color: var(--gold-2); }
.learn-button:hover { border-style: solid; background: rgba(212, 175, 55, .08); }
.coach { position: fixed; inset: 0; z-index: 1100; pointer-events: none; }
.coach-ring {
    position: fixed; border-radius: 14px; pointer-events: none;
    box-shadow: 0 0 0 3px var(--gold-2), 0 0 26px 6px rgba(255, 215, 106, .55), 0 0 0 200vmax rgba(6, 9, 22, .62);
    transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease;
}
.coach-ring.none { box-shadow: 0 0 0 200vmax rgba(6, 9, 22, .62); }
.coach.free .coach-ring { display: none; }
.coach-bubble {
    position: fixed; width: 330px; pointer-events: auto; color: var(--ink);
    background: linear-gradient(180deg, var(--parchment), var(--parchment-2));
    border: 3px double var(--gold-dim); border-radius: 10px; padding: 14px 16px 12px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
    transition: left .3s ease, top .3s ease;
}
.coach-count { font: 600 .62rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: #7a5b22; }
.coach-bubble h4 { font: 800 1.05rem/1.2 var(--display); margin: 6px 0 6px; color: #3b2805; }
.coach-bubble p { font: .86rem/1.45 var(--serif); margin: 0 0 10px; }
.coach-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.coach-actions .btn-brass { margin-top: 0; padding: 5px 20px; }
.coach-do { margin-right: auto; font: italic .78rem var(--serif); color: #7a5b22; }
.coach-do::before { content: "👉 "; font-style: normal; }
.coach-target { animation: coach-pulse 1.3s ease-in-out infinite; }
@keyframes coach-pulse { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 215, 106, 0)); } 50% { filter: drop-shadow(0 0 14px rgba(255, 215, 106, .95)); } }
@media (prefers-reduced-motion: reduce) { .coach-target { animation: none; } .coach-ring, .coach-bubble { transition: none; } }

/* ----- rules dialog ----- */
.rules-button {
    position: relative; z-index: 5; margin-right: auto; padding: 5px 16px; border-radius: 999px; border: 2px solid #6b4d10; cursor: pointer;
    font: 700 .72rem/1.4 var(--display); letter-spacing: .12em; text-transform: uppercase; color: #3b2805;
    background: linear-gradient(180deg, #fff1b0, var(--gold) 55%, #9a741a); box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}
.rules-button:hover { filter: brightness(1.08); }
.rules-link {
    display: block; margin: .5rem auto 0; background: none; border: none; padding: 0; cursor: pointer;
    font: inherit; color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px;
}
.rules-dialog {
    width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; overflow: hidden;
    border: 3px double var(--gold-dim); border-radius: 10px; color: var(--ink);
    background: linear-gradient(180deg, var(--parchment), var(--parchment-2));
    box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
}
.rules-dialog::backdrop { background: rgba(6, 9, 22, .7); }
.rules-sheet { display: flex; flex-direction: column; max-height: calc(100vh - 54px); }
.rules-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px;
    border-bottom: 3px double #7a5b22;
}
.rules-head h2 { margin: 0; font: 800 1.3rem/1.2 var(--display); letter-spacing: .08em; color: #4a3410; }
.rules-close {
    width: 34px; height: 34px; flex: none; border-radius: 50%; border: 2px solid #6b4d10; cursor: pointer;
    font: 700 1.3rem/1 var(--serif); color: #3b2805; background: linear-gradient(180deg, #fff1b0, var(--gold) 55%, #9a741a);
}
.rules-body { overflow-y: auto; padding: 4px 20px 18px; font: .88rem/1.5 var(--serif); }
.rules-body h3 {
    margin: 16px 0 6px; font: 600 .82rem/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; color: #7a5b22;
}
.rules-body p { margin: 4px 0; }
.rules-body ul, .rules-body ol { margin: 4px 0; padding-left: 1.3rem; }
.rules-body li { margin: 2px 0; }
.rules-terms { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 6px 0; }
.rules-terms dt { font-weight: 700; }
.rules-terms dd { margin: 0; }
.rules-earned { color: #7a6440; font-style: italic; }
.rules-actions { width: 100%; border-collapse: collapse; font-size: .82rem; }
.rules-actions th { text-align: left; font: 600 .66rem/1.2 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #7a5b22; padding: 4px 6px; border-bottom: 1px solid #c9b07a; }
.rules-actions td { padding: 4px 6px; border-bottom: 1px solid rgba(201, 176, 122, .5); vertical-align: top; }
.rules-actions td:first-child { font-weight: 700; white-space: nowrap; }
.rules-actions td:nth-child(2) { text-align: center; }
@media (max-width: 560px) {
    .rules-terms { grid-template-columns: 1fr; gap: 0; }
    .rules-terms dd { margin-bottom: 6px; }
}

/* ----- Easy / Hard and personal abilities ----- */
.mode-switch { display: inline-flex; position: relative; gap: 0; margin: 1.4rem 0 .4rem; border: 1px solid rgba(212, 175, 55, .6); border-radius: 999px; padding: 3px; }
.mode-switch label { cursor: pointer; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch span { display: flex; flex-direction: column; align-items: center; padding: 6px 20px; border-radius: 999px; font: .78rem/1.2 var(--serif); color: #cdbf9d; }
.mode-switch b { font: 700 .82rem/1.2 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--parchment); }
.mode-switch input:checked + span { background: linear-gradient(180deg, #fff1b0, var(--gold) 55%, #9a741a); color: #4a3405; }
.mode-switch input:checked + span b { color: #3b2805; }
.mode-switch input:focus-visible + span { outline: 2px solid var(--gold-2); outline-offset: 2px; }
/* Bottom-left of the portrait: in the hand fan, each card's right edge sits under its neighbor. */
.card .ability-mark {
    position: absolute; left: 9px; top: 66px; z-index: 1; width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center; color: #4a3405;
    background: radial-gradient(circle at 35% 30%, #fff1b0, var(--gold) 55%, #8a6d1f);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.card .ability-mark svg { width: 13px; height: 13px; }
.card .ability-mark.signature { color: #fbe6c8; background: radial-gradient(circle at 35% 30%, #d4594a, #8f1b13 60%, #4d0905); }
.detail-ability { margin: 6px 0; padding: 6px 8px; background: #f3e4bd; border-radius: 4px; }
.detail .ability-label {
    display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 3px; background: #3b2a12; color: var(--gold-2);
    font: 600 .6rem/1.4 var(--display); letter-spacing: .08em; text-transform: uppercase;
}
.detail .flavor { margin: 6px 0; font-style: italic; color: #4a3a25; }
