/* Test play page: layout J with the real engine. Builds on lab.css (screen, cards, fan, life badges). */
body.playpage { margin: 0; height: 100vh; display: flex; flex-direction: column; background: #0f1312; color: #e8ece9; overflow: hidden; }
.bar { flex: none; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 14px; background: #1a201e; border-bottom: 1px solid #2c3431; font: 13px -apple-system, system-ui, sans-serif; }
.bar select, .bar input { font: inherit; background: #222a27; color: #e8ece9; border: 1px solid #38423e; border-radius: 6px; padding: 3px 6px; }
.bar .nb { font: inherit; font-weight: 700; padding: 4px 12px; border-radius: 7px; border: 0; background: #e0a526; color: #241600; cursor: pointer; }
.bar .help { color: #9aa6a1; font-size: 12px; }
.playmain { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 300px; }
.stagewrap { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.stagewrap .phone { margin: 0; }
.logpane { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid #2c3431; background: #141a18; }
.logpane h3 { margin: 10px 14px 4px; font: 600 12px system-ui; color: #9aa6a1; text-transform: uppercase; letter-spacing: .06em; }
#log { flex: 1; overflow: auto; margin: 0; padding: 4px 12px 20px 34px; font: 12px/1.45 -apple-system, system-ui, sans-serif; color: #c9d2ce; }
@media (max-width: 1100px) { .playmain { grid-template-columns: 1fr; } .logpane { display: none; } }

/* J with the hand raised (~85% of each card visible) */
.PLAY .board.acting { --fanH: 124px; }
.PLAY .board.idle { --fanH: 52px; }
.PLAY .topbar .feed { display: flex; flex-direction: column; justify-content: center; min-width: 0; font-size: 10px; line-height: 1.25; color: #d6dfdb; }
.PLAY .topbar .feed div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: fadein .4s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(-3px); } }

/* dragging a hand card to play it */
.PLAY .fanc { cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; }
.PLAY .fanc img { pointer-events: none; }
.PLAY .fanc.drag { transition: none; transform: translate(var(--dx, 0px), var(--ddy, 0px)) rotate(0deg) scale(1.07); z-index: 60 !important; cursor: grabbing; }
.PLAY .fanc.drag img { filter: none; box-shadow: 0 10px 26px rgba(0, 0, 0, .7); }
.PLAY .fanc.armed img { box-shadow: 0 0 0 3px var(--prio), 0 0 24px 7px rgba(255, 213, 74, .75), 0 10px 26px rgba(0, 0, 0, .7) !important; }
.playline { position: absolute; left: 4%; right: 4%; top: -58px; height: 0; border-top: 2px dashed rgba(255, 255, 255, .4); opacity: 0; transition: opacity .15s; pointer-events: none; z-index: 1; }
.playline span { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .6); padding: 2px 10px; border-radius: 10px; white-space: nowrap; }
.playline.show { opacity: 1; }
.playline.armed { border-top: 3px solid var(--prio); }
.playline.armed span { background: var(--prio); color: #231500; }
.playline.no.armed { border-top-color: #ff6b61; }
.playline.no.armed span { background: #ff6b61; color: #fff; }

/* picking objects for a decision */
.PLAY .fc.cand .in { outline: 2px dashed rgba(255, 255, 255, .75); outline-offset: 2px; }
.PLAY .fc.chosen .in { outline: 3px solid var(--prio); outline-offset: 2px; }
.PLAY .fc.chosen.side-you { --ty: -6px; }
.PLAY .fc.cand, .PLAY .fc.canblk { cursor: pointer; }
.PLAY .lifeb.cand { pointer-events: auto; cursor: pointer; outline: 2px dashed #fff; outline-offset: 4px; }
.PLAY .lifeb.chosen { outline: 3px solid var(--prio); outline-offset: 4px; }

/* decision dialogs */
.dlg { position: absolute; inset: 0; z-index: 45; display: none; pointer-events: none; }
.dlg.show, .dlg.peek { display: block; }
.dlg.show { background: rgba(0, 0, 0, .4); pointer-events: auto; }
.dlg .panel { position: absolute; left: 50%; top: 36px; transform: translateX(-50%); width: max-content; max-width: 700px; min-width: 300px; background: #1c2321; border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .12); }
.dlg h3 { margin: 0 0 3px; font-size: 15px; }
.dlg p { margin: 0 0 8px; font-size: 12px; color: #c9d2ce; max-width: 640px; }
.dlg .cards { display: flex; gap: 8px; flex-wrap: wrap; max-height: 210px; overflow: auto; margin-bottom: 8px; }
.dlg .pick { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: #c9d2ce; }
.dlg .pick img { height: 136px; border-radius: 7px; display: block; }
.dlg .pick.on img { box-shadow: 0 0 0 3px var(--play), 0 0 12px 3px rgba(69, 215, 255, .6); }
.dlg .acts, .dlg .chips2 { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.dlg .btn { min-height: 34px; padding: 4px 14px; font-size: 12.5px; }
.dlg .btn.primary { min-height: 34px; font-size: 13px; }
.dlg .btn.on { box-shadow: inset 0 0 0 2px var(--play); }
.dlg .btn[disabled] { opacity: .4; cursor: default; }
.dlg.peek .peekback { position: absolute; left: 50%; top: 36px; transform: translateX(-50%); pointer-events: auto; min-height: 32px; padding: 4px 14px; }
#log li.t-turn { margin-top: 8px; font-weight: 700; color: #fff; }
#log li.t-step, #log li.t-zone, #log li.t-pay, #log li.t-untap, #log li.t-mana, #log li.t-cleanup { color: #7d8984; font-size: 11px; }
#log li.t-gameover { color: #ffd54a; font-weight: 700; }
.bar .switch { color: #9cc3ff; text-decoration: none; font-weight: 600; }

/* phone view: hand ~90% visible */
.PLAY .board.acting { --fanH: 130px; }

/* ================================================================ PC view (play-pc.html): no phone frame */
.pc .stagewrap { padding: 0; }
.pc .phone { width: calc(var(--sw) * var(--s)); height: calc(var(--sh) * var(--s)); }
.pc .device { width: var(--sw); height: var(--sh); padding: 0; border-radius: 0; background: none; box-shadow: none; }
.pc .screen { width: var(--sw); height: var(--sh); border-radius: 0; }
.pc svg.arrows { width: 100%; height: 100%; }
.pc .stage { left: 14px; right: 14px; top: 0; bottom: 0; grid-template-columns: 1fr 118px; column-gap: 10px; }
.pc .rail { padding: 8px 0 12px; gap: 8px; }
.pc .rail .btn.primary { min-height: 64px; font-size: 16px; }
.pc .rail .btn.secondary { min-height: 36px; font-size: 12.5px; }
.pc .board { grid-template-rows: 38px 1fr 22px 1fr 116px; row-gap: 6px; padding-top: 6px; }
.pc .board.acting { --fanH: 236px; }
.pc .board.idle { --fanH: 80px; }
.pc .topbar .hud { height: 32px; font-size: 12px; }
.pc .band .ph { font-size: 11px; padding: 3px 8px; }
.pc .prompt { font-size: 12.5px; }
.pc .lifeb.circle { width: 62px; height: 62px; }
.pc .lifeb.circle b { font-size: 28px; }
.pc .lifeb.circle small { font-size: 8.5px; }
.pc .lifeb.you { bottom: 16px; }
.pc .mybar { font-size: 12px; bottom: 16px; max-width: 150px; }
.pc .playline { top: -104px; }
.pc .playline span { font-size: 13px; }
.pc .fc .fpt { --pts: 14px; }
.pc .fc .fkw { font-size: 12px; }
.pc .bdg { font-size: 11px; line-height: 16px; }
.pc .dlg .panel { top: 60px; }
.pc .dlg .pick img { height: 170px; }
.pc .zoom img { height: 540px; }
.pc .zinfo { width: 320px; font-size: 14px; }
.pc .zinfo h3 { font-size: 20px; }
.pc .ov { padding: 20px 80px 30px; }
.pc .bighand .bh img, .pc .zc2 img { height: 170px; }

/* ================================================================ animations (animate.js) */
.fx { position: absolute; inset: 0; z-index: 36; pointer-events: none; overflow: hidden; }
.fx .flycard { border-radius: 5%; box-shadow: 0 10px 24px rgba(0, 0, 0, .6); transform-origin: 0 0; object-fit: cover; }
.fx .ghost { pointer-events: none; transform-origin: 50% 50%; }
.fx .floattext { display: grid; place-items: center; font: 900 22px/1 -apple-system, system-ui, sans-serif; text-shadow: 0 2px 6px rgba(0, 0, 0, .9), 0 0 2px #000; font-variant-numeric: tabular-nums; }
.fx .floattext.dmg, .fx .floattext.loss { color: #ff5a4f; }
.fx .floattext.gain { color: #6dff9e; }
.fx .spotlight { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fx .spotlight img { height: 250px; border-radius: 12px; box-shadow: 0 0 0 3px #ff6b61, 0 0 40px 10px rgba(255, 107, 97, .45), 0 16px 40px rgba(0, 0, 0, .7); }
.fx .spotlight div { font-size: 14px; color: #fff; background: rgba(0, 0, 0, .75); padding: 5px 14px; border-radius: 12px; white-space: nowrap; text-align: center; }
.fx .spotlight small { display: block; font-size: 11px; color: #d6dfdb; max-width: 380px; white-space: normal; }
.fx .banner { position: absolute; left: 50%; top: 42%; font-size: 17px; font-weight: 800; color: #fff; background: rgba(194, 59, 51, .92); padding: 8px 20px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); white-space: nowrap; }
.pc .fx .spotlight img { height: 380px; }
.pc .fx .spotlight div { font-size: 17px; }
.pc .fx .banner { font-size: 22px; }
.pc .fx .floattext { font-size: 30px; }
.stkc.spotlit { visibility: hidden; }
.fx .banner.story { background: rgba(120, 72, 200, .94); }
.railme .story { flex-basis: 100%; text-align: center; white-space: normal; line-height: 1.25; cursor: help; }
.hud .story { cursor: help; }
.fx .counterlabel { display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-shadow: 0 2px 6px rgba(0, 0, 0, .9), 0 0 2px #000; }
.fx .counterlabel b { font: 900 17px/1 -apple-system, system-ui, sans-serif; color: #111; background: #8fe3a4; padding: 4px 10px; border-radius: 999px; text-shadow: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .6); }
.fx .counterlabel.minus b { background: #c9a0ff; }
.fx .counterlabel span { margin-top: 4px; font: 700 12.5px/1.1 -apple-system, system-ui, sans-serif; color: #fff; background: rgba(0, 0, 0, .72); padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.pc .fx .counterlabel b { font-size: 20px; }
.pc .fx .counterlabel span { font-size: 14px; }

/* your library / graveyard / exile now sit in the rail, so the hand fan can use the whole width */
.railme { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 7px; padding: 5px 4px; border-radius: 10px; background: var(--hud); box-shadow: inset 0 0 0 1px var(--hudline); font-size: 10.5px; }
.railme b { flex-basis: 100%; text-align: center; font-size: 10.5px; }
.pc .railme { font-size: 12.5px; padding: 7px 6px; }
.pc .railme b { font-size: 12.5px; }

/* opening hand / mulligan / discard: every card whole, side by side */
.dlg .panel.wide { max-width: 94%; }
.dlg .panel.wide .cards { flex-wrap: nowrap; max-height: none; overflow: visible; }
.dlg .panel.wide .pick img { height: var(--ch); }
.dlg .pick[data-zoom] { cursor: zoom-in; }
.pc .dlg .panel.wide .pick img { height: var(--ch); }
.bar .errs { color: #ffb4a8; font-weight: 700; cursor: help; }

/* ================================================================ PC: floating hand in two sizes */
/* the hand floats over the bottom of the table; the board's rows never change size */
.pc .fanzone { position: absolute; left: 0; right: 0; bottom: 0; height: 300px; z-index: 5; pointer-events: none; }
.pc .fanzone .fanc { pointer-events: auto; }
.pc .fanzone.anim .fanc { transition: left .38s cubic-bezier(.2, .8, .2, 1), top .38s cubic-bezier(.2, .8, .2, 1), width .38s cubic-bezier(.2, .8, .2, 1), height .38s cubic-bezier(.2, .8, .2, 1), transform .38s cubic-bezier(.2, .8, .2, 1); }
.pc .fanzone.anim .fanc.drag { transition: none; }
.pc .board.hand-small .fanc img { box-shadow: -2px 0 5px rgba(0, 0, 0, .55); }
.pc .board.hand-small .fanc.playable img { box-shadow: 0 0 0 2px var(--play), 0 0 10px 2px rgba(69, 215, 255, .55), -2px 0 5px rgba(0, 0, 0, .55); }
.pc .handspace { pointer-events: none; }

/* turn change */
.fx .turnbanner { position: absolute; left: 50%; top: 46%; font: 900 64px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; letter-spacing: .08em; color: #fff; white-space: nowrap; text-shadow: 0 4px 18px rgba(0, 0, 0, .8), 0 0 2px #000; padding: 14px 40px; border-radius: 18px; }
.fx .turnbanner.you { background: radial-gradient(ellipse at center, rgba(45, 99, 200, .55), transparent 70%); text-shadow: 0 0 24px rgba(91, 155, 255, .9), 0 4px 18px rgba(0, 0, 0, .8); }
.fx .turnbanner.opp { background: radial-gradient(ellipse at center, rgba(194, 59, 51, .55), transparent 70%); text-shadow: 0 0 24px rgba(255, 107, 97, .9), 0 4px 18px rgba(0, 0, 0, .8); }
.pc .fx .turnbanner { font-size: 60px; letter-spacing: .02em; padding: 12px 30px; } /* ~60% of the old 92px/.08em width */

/* clicking a card shows only the card */
.zoom.bare img { height: 340px; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .7); }
.pc .zoom.bare img { height: 560px; border-radius: 22px; }
.screen[data-busy] .stage { cursor: progress; }

/* ================================================================ table backgrounds (play-pc.html) */
.screen[data-bg="shire"] { background: url(../images/backgrounds/shire-courtyard.webp) center / cover no-repeat, #3a2e1c; }
.screen[data-bg="temple"] { background: url(../images/backgrounds/sky-temple.webp) center / cover no-repeat, #25282b; }
.screen[data-bg="mirkwood"] { background: url(../images/backgrounds/mirkwood-ruins.webp) center / cover no-repeat, #1a211b; }
.screen[data-bg="whitecity"] { background: url(../images/backgrounds/white-city.webp) center / cover no-repeat, #d8cfbd; }
.screen[data-bg="erebor"] { background: url(../images/backgrounds/erebor-hall.webp) center / cover no-repeat, #25221e; }
.screen[data-bg="smaug"] { background: url(../images/backgrounds/smaugs-lair.webp) center / cover no-repeat, #2a1a12; }
/* keep cards and text readable on a picture: darker edges, a light overall dim */
.screen[data-bg]:not([data-bg="felt"])::before {
  background: radial-gradient(ellipse 75% 70% at 50% 48%, rgba(0, 0, 0, .05), rgba(0, 0, 0, .42)), linear-gradient(to bottom, rgba(0, 0, 0, .28), transparent 18%, transparent 75%, rgba(0, 0, 0, .35));
}
/* the white city is very bright: dim it more so white card frames stand out */
.screen[data-bg="whitecity"]::before {
  background: linear-gradient(rgba(20, 18, 14, .3), rgba(20, 18, 14, .3)), radial-gradient(ellipse 75% 70% at 50% 48%, rgba(0, 0, 0, .1), rgba(0, 0, 0, .45));
}
.screen[data-bg]:not([data-bg="felt"]) .band { justify-self: start; width: max-content; max-width: 100%; padding: 0 12px 0 4px; border-radius: 12px; background: rgba(8, 12, 11, .62); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.screen[data-bg]:not([data-bg="felt"]) .empty { color: rgba(255, 255, 255, .6); text-shadow: 0 1px 3px #000; }
.screen[data-bg]:not([data-bg="felt"]) .hud, .screen[data-bg]:not([data-bg="felt"]) .railme { background: rgba(8, 12, 11, .66); }

/* ================================================================ PC: cost badges above the hand (Arena style) */
.pc .costbadge { position: absolute; z-index: 30; display: flex; gap: 2px; align-items: center; padding: 3px 4px; border-radius: 14px; background: rgba(12, 12, 12, .78); box-shadow: 0 2px 6px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .18); font-size: 13.5px; pointer-events: none; transform: translate(-100%, -62%) rotate(var(--rot, 0deg)); transform-origin: 100% 50%; transition: opacity .15s; }
.pc .costbadge .ms-cost { box-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.pc .costbadge.playable { box-shadow: 0 0 0 1.5px var(--play), 0 0 10px 2px rgba(69, 215, 255, .5), 0 2px 6px rgba(0, 0, 0, .55); }
.pc .costbadge.hide { opacity: 0; }
.pc .board.hand-small .costbadge { font-size: 11px; padding: 2px 3px; }
.pc .fanzone.anim .costbadge { transition: left .38s cubic-bezier(.2, .8, .2, 1), top .38s cubic-bezier(.2, .8, .2, 1), transform .38s cubic-bezier(.2, .8, .2, 1), font-size .38s, padding .38s, opacity .15s; }

/* ================================================================ player view: what a player will see (V toggles) */
.bar .nb2 { background: #2f6db5; color: #fff; }
.devtoggle { display: none; }
body.playerview .bar, body.playerview .logpane, body.playerview .feed, body.playerview #errs,
body.playerview .rail [data-open="log"], body.playerview .dlg [data-dlg="auto"]:not(.keep) { display: none !important; }
body.playerview .playmain { grid-template-columns: 1fr; }
body.playerview .devtoggle { display: block; position: fixed; top: 8px; right: 10px; z-index: 200; font: 600 11px -apple-system, system-ui, sans-serif; color: #fff; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; padding: 4px 9px; cursor: pointer; opacity: .3; transition: opacity .2s; }
body.playerview .devtoggle:hover { opacity: 1; }
body.playerview .devtoggle.haserr { opacity: .8; }
body.playerview .devtoggle.haserr::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: #ff5a4f; }

/* ================================================================ targeting arrows, trigger order, damage split */
svg.arrows .tarrow { fill: none; stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 12 8; animation: arrowflow .8s linear infinite; }
svg.arrows .tarrow.mine { stroke: #5bc6ff; filter: drop-shadow(0 0 4px rgba(91, 198, 255, .9)) drop-shadow(0 0 1px #000); }
svg.arrows .tarrow.theirs { stroke: #ff6b61; filter: drop-shadow(0 0 5px rgba(255, 90, 80, .95)) drop-shadow(0 0 1px #000); }
svg.arrows .tarrow.blk { stroke: #42e08f; filter: drop-shadow(0 0 4px rgba(66, 224, 143, .9)) drop-shadow(0 0 1px #000); }
svg.arrows .tarrow.live { stroke-dasharray: 6 7; opacity: .8; }
svg.arrows .tarrow.live.locked { stroke-dasharray: none; opacity: 1; stroke-width: 5; }
svg.arrows .tah.mine { fill: #5bc6ff; } svg.arrows .tah.theirs { fill: #ff6b61; } svg.arrows .tah.blk { fill: #42e08f; }
@keyframes arrowflow { to { stroke-dashoffset: -20; } }
.castpreview { position: absolute; left: 86%; top: 42%; transform: translate(-50%, -50%); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; animation: castin .3s ease-out; }
.castpreview img { height: 160px; border-radius: 9px; box-shadow: 0 0 0 3px #5bc6ff, 0 0 26px 6px rgba(91, 198, 255, .55), 0 12px 30px rgba(0, 0, 0, .7); }
.pc .castpreview img { height: 250px; border-radius: 13px; }
.castpreview span { font-weight: 800; font-size: 13px; color: #fff; background: rgba(0, 0, 0, .7); padding: 3px 12px; border-radius: 10px; }
@keyframes castin { from { opacity: 0; transform: translate(-50%, -44%) scale(.85); } }
.fx .hitring { border-radius: 10px; box-shadow: 0 0 0 4px #ffd54a, 0 0 30px 10px rgba(255, 213, 74, .8); pointer-events: none; }
.dlg .chips2.long { flex-direction: column; align-items: stretch; }
.dlg .chips2.long .btn { white-space: normal; text-align: left; max-width: 640px; min-height: 40px; line-height: 1.3; justify-content: center; align-items: flex-start; padding: 6px 12px; }
.dlg .rows2 { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.dlg .r2 { display: grid; grid-template-columns: minmax(200px, 1fr) 40px 44px 40px; align-items: center; gap: 6px; font-size: 13px; }
.dlg .r2 b { text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.dlg .r2 .btn { min-height: 34px; padding: 0; font-size: 18px; }
.pc .dlg .r2 { font-size: 15px; }
.fanc.casting { opacity: .35; filter: grayscale(.6); }

/* ================================================================ PC: your graveyard and library, bottom-left */
.pc .mypiles { position: absolute; left: 4px; bottom: 12px; z-index: 6; display: flex; gap: 16px; align-items: flex-end; }
.pc .gypile, .pc .libpile { position: relative; width: 86px; height: 120px; border-radius: 6px; }
.pc .gypile img, .pc .libpile img { position: absolute; left: 0; top: 0; width: 86px; height: 120px; border-radius: 6px; box-shadow: 0 3px 8px rgba(0, 0, 0, .6); }
.pc .gypile { cursor: pointer; }
.pc .gypile img { filter: saturate(.85); }
.pc .gypile.empty, .pc .libpile.empty { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .25); }
/* the opponent's piles: land-sized, at the top of the rail */
.pc .opppiles { position: absolute; z-index: 8; display: flex; gap: 10px; align-items: flex-end; }
.pc .opppiles .gypile, .pc .opppiles .libpile, .pc .opppiles img { width: 42px; height: 58px; border-radius: 4px; }
.pc .opppiles .gypile::after { border-radius: 4px; }
.pc .gypile::after { content: ''; position: absolute; inset: 0; border-radius: 6px; background: rgba(40, 20, 60, .25); pointer-events: none; }
/* a drawn card flipping from the library into the hand */
.fx .flipcard { transform-origin: 0 0; perspective: 900px; }
.fx .flip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.fx .flip-in img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 5%; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 10px 26px rgba(0, 0, 0, .6); }
.fx .flip-in .back { transform: rotateY(180deg); }

/* choosing a target for an ability of a permanent: which ability, and its source highlighted */
.castpreview.ability { max-width: 300px; }
.castpreview.ability img { height: 150px; }
.pc .castpreview.ability img { height: 210px; }
.castpreview q { display: block; max-width: 290px; font: italic 13px/1.35 Georgia, serif; color: #f2efe6; background: rgba(0, 0, 0, .72); padding: 6px 10px; border-radius: 10px; text-align: center; quotes: '“' '”'; }
.fc.targeting-src .in { outline: 3px solid #5bc6ff; outline-offset: 3px; box-shadow: 0 0 22px 6px rgba(91, 198, 255, .55); border-radius: 8px; }

/* ================================================================ life counters (images/life-counter.png) */
.lifeb.coin { width: 66px; height: 66px; background: url(../images/small/life-counter.webp) center / contain no-repeat; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.lifeb.coin b { font-family: "Cinzel", "Palatino Linotype", Palatino, "Book Antiqua", "Times New Roman", serif; font-weight: 700; font-size: 25px; line-height: 1; color: #efe5cf;
  text-shadow: 0 -1px 0 rgba(255, 255, 255, .35), 0 2px 0 rgba(40, 30, 20, .9), 0 3px 6px rgba(0, 0, 0, .85); margin-top: 1px; }
.lifeb.coin.long b { font-size: 19px; }
.lifeb.coin.opp { top: 0; }
.lifeb.coin.you { bottom: 8px; }
.lifeb.coin.prio { filter: drop-shadow(0 0 7px rgba(255, 213, 74, .95)) drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.pc .lifeb.coin { width: 96px; height: 96px; }
.pc .lifeb.coin b { font-size: 36px; }
.pc .lifeb.coin.long b { font-size: 27px; }
.pc .lifeb.coin.opp { top: -4px; }
.pc .lifeb.coin.you { bottom: 10px; }
.PLAY .lifeb.coin.cand { outline: none; filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 12px rgba(255, 255, 255, .8)); }
.PLAY .lifeb.coin.chosen { outline: none; filter: drop-shadow(0 0 8px var(--prio)) drop-shadow(0 0 16px var(--prio)); }
.lifeb.coin, .lifeb.coin.prio { box-shadow: none !important; } /* the coin glows (filter) instead of the old square outline */
/* life counters centred on the whole screen, not just the table area left of the rail
   (rail 118 + gap 10 → the table's centre is 64 units left of the screen's centre) */
.pc .lifeb.coin { left: calc(50% + 64px); }

/* a card you can see but not choose (e.g. looked at, but not a Dwarf or Equipment) */
.dlg .pick.off { cursor: zoom-in; position: relative; }
.dlg .pick.off img { filter: grayscale(.85) brightness(.42); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15); }
.dlg .pick.off::before { content: '✕'; position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font: 800 34px/1 system-ui; color: rgba(255, 120, 110, .85); text-shadow: 0 2px 6px #000; pointer-events: none; z-index: 1; }
.dlg .pick.off em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #ff9a8f; }
.dlg .pick.off span { color: #9aa6a1; }

/* ---------------------------------------------------------------- online games (play-pc.html?game=…) */
body.online .localonly { display: none !important; }
.netbar { display: none; }
body.online .netbar { display: flex; position: fixed; top: 8px; right: 10px; z-index: 60; gap: 6px; align-items: center; pointer-events: none; }
body.online:not(.playerview) .netbar { top: 52px; }
.netbar > * { pointer-events: auto; }
.netbar .btn { padding: 5px 11px; font-size: 12.5px; }
.netbar .nb-chat b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: #ff5a4f; color: #fff; font-size: 11px; }
.netbar .nb-bits { position: fixed; left: 50%; top: 110px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: auto; } /* (online.js placeNetBar) */
.netbar .nb-bits:empty { display: none; }
.nb-warn, .nb-info, .nb-clock { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; background: rgba(160, 60, 40, .92); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); white-space: nowrap; }
.nb-info { background: rgba(40, 70, 110, .92); }
.nb-clock { background: rgba(60, 60, 60, .92); }
.nb-clock.hot { background: rgba(200, 50, 40, .95); animation: nbpulse 1s infinite; }
@keyframes nbpulse { 50% { transform: scale(1.06); } }

/* the end of a game, in the middle of the table (board.js resultCard) */
.gameover { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 40; width: 420px; max-width: 80%; padding: 22px 26px 18px; border-radius: 18px; text-align: center; color: #efe8da; background: linear-gradient(180deg, rgba(38, 33, 26, .96), rgba(20, 19, 17, .96)); border: 1px solid rgba(240, 180, 60, .45); box-shadow: 0 18px 60px rgba(0, 0, 0, .65); font: 14px/1.4 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.gameover.fresh { animation: castin .3s ease-out; }
.gameover h2 { margin: 0 0 6px; font: 900 34px/1.1 Cinzel, serif; color: #ffd36a; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.gameover.lose h2 { color: #e6dccd; }
.gameover p { margin: 0 0 8px; font-size: 16px; color: #e8e2d6; }
.gameover small { display: block; margin-bottom: 12px; color: #a9a293; font-size: 12.5px; }
.gameover small.note { color: #ffd36a; font-size: 14.5px; font-weight: 700; }
.gameover .gbtns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.gameover .gbtns .btn { min-width: 150px; min-height: 44px; font-size: 15px; }
.gameover .gbtns .btn.secondary { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.gameover .x { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: #a9a293; font-size: 15px; cursor: pointer; padding: 4px 6px; }
.gameover .x:hover { color: #fff; }

/* a question with a few answers: conceding, leaving (dialogs.js ask) */
.askov { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(0, 0, 0, .45); }
.askbox { width: 440px; max-width: calc(100vw - 32px); padding: 20px 22px 16px; border-radius: 16px; background: linear-gradient(180deg, rgba(38, 33, 26, .99), rgba(22, 20, 17, .99)); border: 1px solid rgba(240, 180, 60, .45); box-shadow: 0 18px 50px rgba(0, 0, 0, .7); color: #efe8da; font: 14px/1.45 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.askbox h3 { margin: 0 0 8px; font: 800 19px/1.2 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; color: #ffd36a; }
.askbox p { margin: 0 0 16px; color: #d9d2c4; }
.askbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.askbtns .btn { min-height: 38px; padding: 6px 14px; font-size: 13.5px; }
.askbtns .btn.secondary { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.askbtns .btn.danger, .opts .obtn.danger { background: linear-gradient(#e0574a, #b3362b); color: #fff; box-shadow: 0 2px 0 #6e1c15; border: 0; }

.chatpane { position: fixed; left: 10px; top: 60px; bottom: 10px; width: 300px; z-index: 55; display: flex; flex-direction: column; background: rgba(18, 20, 22, .94); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); color: #e8ece9; transition: transform .25s ease, opacity .25s ease; }
body.online:not(.playerview) .chatpane { top: 104px; }
.chatpane.closed { transform: translateX(-110%); opacity: 0; pointer-events: none; }
.chatpane header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.chatpane header .btn { padding: 2px 9px; }
.chatpane ol { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.35; }
.chatpane li { overflow-wrap: anywhere; }
.chatpane li b { color: #ffcf7a; margin-right: 4px; }
.chatpane li.me b { color: #8fd3ff; }
.chatpane li.sys { color: #9aa6a1; font-size: 12px; font-style: italic; }
.chatpane form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.chatpane input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #fff; font-size: 14px; }
.chatbubble { position: fixed; left: 50%; top: 150px; transform: translate(-50%, -10px); z-index: 58; max-width: 420px; padding: 9px 14px; border-radius: 14px 14px 14px 4px; background: rgba(255, 250, 235, .97); color: #1a1a1a; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; cursor: pointer; overflow-wrap: anywhere; }
.chatbubble.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.chatbubble b { margin-right: 4px; }
.netgone { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; color: #fff; background: rgba(0, 0, 0, .6); }
.netgone .btn { justify-self: center; }

.chatpane .quick { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.chatpane .quick button { padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); color: #dfe5e2; font: 600 12px/1.2 inherit; cursor: pointer; }
.chatpane .quick button:hover { background: rgba(240, 180, 60, .18); border-color: rgba(240, 180, 60, .5); }
.nb-watch { padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #dfe5e2; background: rgba(30, 34, 36, .9); }

/* PC: the phase as five icons at the right of the middle band (the text pills are gone there) */
/* absolutely positioned (it takes no grid cell): the right edge, at the height of the band (set by render) */
.pc .board { position: relative; }
.pc .phasebar { position: absolute; right: var(--phaseRight, 0); top: var(--bandMid, 50%); transform: translateY(-50%); z-index: 20; display: flex; gap: 2px; padding: 2px 8px; border-radius: 14px; background: #242424; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 14px rgba(0, 0, 0, .45); pointer-events: auto; }
.pc .phasebar .pi { position: relative; width: 44px; height: 44px; background: url(../images/small/phase-icons.webp) calc(var(--i) * -44px) 0 / 220px 88px no-repeat; }
.pc .phasebar .pi.cur { background-position-y: -44px; }
.pc .phasebar .pi.cur::after { content: ''; position: absolute; left: 13px; right: 13px; bottom: 1px; height: 2px; border-radius: 1px; background: var(--you); }
.pc .phasebar.opp .pi.cur::after { background: var(--opp); top: 1px; bottom: auto; } /* the opponent's line runs above the icons, yours below */
.pc .band, .pc .screen[data-bg]:not([data-bg="felt"]) .band { max-width: calc(100% - 270px); }

/* the opponent's hand: face-down cards, upside down, loosely piled at the right end of their name box */
.pc .opphand { position: absolute; z-index: 8; width: var(--w); height: 50px; pointer-events: auto; }
.pc .opphand img { position: absolute; width: 34px; height: 47px; border-radius: 3px; box-shadow: 0 2px 5px rgba(0, 0, 0, .55); transform-origin: 50% 50%; }

.railicons { display: flex; gap: 6px; }
/* Options, sound and the pause switch stay reachable while a decision dialog covers the table (the mulligan, a
   chooser): above .dlg (z-index 45), below the Options panel (60) */
.pc .railicons { position: relative; z-index: 46; }
.railicons .btn { flex: 1; }

/* no prompt to show: the middle band stays empty (its row keeps its height) */
.pc .band.empty { visibility: hidden; }

/* your exile: a badge just above your graveyard's top-left corner */
.pc .mypiles .exbadge { position: absolute; left: 0; bottom: calc(100% + 6px); display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--hud); box-shadow: inset 0 0 0 1px var(--hudline); font-size: 13px; color: #fff; cursor: pointer; }
.pc .mypiles .exbadge:hover { box-shadow: inset 0 0 0 1px rgba(240, 180, 60, .7); }

/* a card in exile you may play, at the right end of your hand: dotted outline, a little see-through */
.pc .fanc.fromexile img { opacity: .78; outline: 4px dotted #c28bff; outline-offset: 1px; }
.pc .fanc.fromexile.playable img { opacity: .88; outline-color: #e0c2ff; }

/* whose turn it is: their life counter turns gold and glows */
.lifeb.coin.turn { background-image: url(../images/small/life-counter-gold.webp); filter: drop-shadow(0 0 7px rgba(255, 213, 74, .95)) drop-shadow(0 0 16px rgba(255, 190, 60, .55)) drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.lifeb.coin.turn b { color: #fff8e6; text-shadow: 0 2px 3px rgba(60, 30, 0, .85), 0 0 2px rgba(60, 30, 0, .9); }

/* a button whose action isn't allowed yet (it explains why when pressed) */
.rail .btn.off { filter: grayscale(.85) brightness(.75); cursor: not-allowed; }

/* the actions menu: one row per action, its card on the left */
.dlg .actlist { display: grid; gap: 8px; max-height: 62vh; overflow-y: auto; margin: 4px 0 10px; }
.dlg .actrow { display: flex; align-items: center; gap: 14px; padding: 8px 12px 8px 8px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(255, 255, 255, .05); color: #fff; font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s; }
.dlg .actrow:hover { border-color: rgba(255, 201, 74, .8); background: rgba(255, 201, 74, .1); }
.dlg .actrow img { height: 104px; border-radius: 6px; box-shadow: 0 3px 10px rgba(0, 0, 0, .6); flex: none; }
.pc .dlg .actrow img { height: 132px; }
.dlg .actrow .at { display: grid; gap: 4px; }
.dlg .actrow .at b { font-size: 13px; color: #ffcf7a; }
.dlg .actrow .at > span { font-size: 16px; font-weight: 700; line-height: 1.3; }
.dlg .actrow .ms { font-size: .85em; margin: 0 1px; }
.pc .dlg .panel:has(.actlist) { width: min(820px, 92%); max-width: none; }
.pc .dlg .actlist { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

/* pre-play: a card queued for your turn rises a little out of the hand, pulses gold, and says when it plays */
.PLAY .fanc.queued { --dy: calc(var(--lift, -60px) * .42) !important; --rot: 0deg !important; z-index: 45 !important; cursor: pointer; }
.PLAY .fanc.queued img { filter: none; opacity: .92; outline: 3px dashed rgba(255, 207, 90, .95); outline-offset: 2px; animation: queuedGlow 1.6s ease-in-out infinite; }
@keyframes queuedGlow { 0%, 100% { box-shadow: 0 0 10px 2px rgba(255, 190, 60, .35), 0 8px 20px rgba(0, 0, 0, .6); } 50% { box-shadow: 0 0 26px 8px rgba(255, 200, 70, .75), 0 8px 20px rgba(0, 0, 0, .6); } }
.PLAY .fanc.queued::before { content: '⏳ your turn'; position: absolute; left: 4px; top: -14px; z-index: 2; padding: 3px 10px; border-radius: 999px; background: linear-gradient(#ffd466, #e0960a); color: #2a1a00; font: 800 12px/1.2 -apple-system, system-ui, sans-serif; white-space: nowrap; box-shadow: 0 3px 10px rgba(0, 0, 0, .55); pointer-events: none; }
.PLAY .fanc.queued[data-q]::before { content: '⏳ ' attr(data-q); } /* several queued: numbered, in the order they'll play */
.PLAY .fanc.queued:hover::after { content: 'click to cancel'; position: absolute; left: 50%; bottom: 36%; transform: translateX(-50%); padding: 3px 9px; border-radius: 8px; background: rgba(0, 0, 0, .8); color: #fff; font: 700 12px/1.2 -apple-system, system-ui, sans-serif; white-space: nowrap; pointer-events: none; }
.playline.queue.armed { border-top: 3px dashed #ffcf5a; }
.playline.queue.armed span { background: linear-gradient(#ffd466, #e0960a); color: #2a1a00; }
.playline.queue span { background: rgba(60, 40, 0, .75); }

/* the enduring story badge (the user's artwork): full width in the rail, big in the middle when you get it */
.railme:has(.storyimg) { background: none; box-shadow: none; padding: 0; }
.storyimg { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); cursor: help; }
.fx .imgbanner { position: absolute; left: 50%; top: 44%; width: 460px; max-width: 70%; pointer-events: none; filter: drop-shadow(0 0 22px rgba(255, 200, 90, .55)) drop-shadow(0 10px 24px rgba(0, 0, 0, .7)); z-index: 70; }

/* auto-pass: the plain arrow says it; no extra ring */

/* drag-to-target: the permanent or player under a dragged spell that it can target */
/* (.fc is position: relative already, the life counter absolute: the reticle is placed inside either) */
.PLAY .fc.droptarget { outline: 3px solid #ff6b52; outline-offset: 3px; border-radius: 8px; box-shadow: 0 0 22px 6px rgba(255, 107, 82, .6); }
.PLAY .lifeb.droptarget { filter: drop-shadow(0 0 10px #ff6b52) drop-shadow(0 0 20px rgba(255, 107, 82, .8)); }
.PLAY .droptarget::after { content: ''; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); z-index: 20; pointer-events: none;
  background: radial-gradient(circle, transparent 38%, #ff6b52 39% 45%, transparent 46%), linear-gradient(#ff6b52, #ff6b52) center / 4px 100% no-repeat, linear-gradient(#ff6b52, #ff6b52) center / 100% 4px no-repeat;
  -webkit-mask: radial-gradient(circle, #000 0 8%, transparent 9% 24%, #000 25%); mask: radial-gradient(circle, #000 0 8%, transparent 9% 24%, #000 25%);
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, .9)); animation: reticle 1s ease-in-out infinite; }
@keyframes reticle { 50% { transform: translate(-50%, -50%) scale(1.12) rotate(45deg); } }

/* the opponent's exile badge: a flex item just left of their graveyard */
.pc .opppiles .exbadge { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--hud); box-shadow: inset 0 0 0 1px var(--hudline); font-size: 13px; color: #fff; cursor: pointer; }

/* a long choice list (every creature type): likely picks, a search box, and the rest scrolling */
.dlg .suggested { margin-bottom: 2px; }
.dlg .flt { display: block; width: 100%; box-sizing: border-box; margin: 8px 0 6px; padding: 7px 10px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(0, 0, 0, .35); color: #fff; font: inherit; font-size: 13px; }
.dlg .longlist { display: flex; flex-wrap: wrap; gap: 5px; max-height: min(38vh, 260px); overflow-y: auto; padding-right: 4px; margin-bottom: 6px; }
.dlg .longlist .btn { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.dlg .longlist .btn[hidden] { display: none; }

/* ---- the Options panel (the cog in the rail): a centered card, grouped rows, switches, segmented choices, sliders */
.ov.settingsov { z-index: 60; } /* above a pending decision dialog */
.railicons .cog img, .railicons .snd img, .railicons .stops img { width: 24px; height: 24px; display: block; margin: auto; pointer-events: none; }
.opts { width: 600px; max-width: 94%; max-height: 94%; overflow: auto; background: linear-gradient(180deg, rgba(34, 30, 24, .97), rgba(20, 19, 17, .97)); border: 1px solid rgba(240, 180, 60, .35); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 240, 200, .08); color: #efe8da; font: 13px/1.35 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.opts header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px 10px; background: rgba(28, 25, 21, .98); border-bottom: 1px solid rgba(240, 180, 60, .22); }
.opts header img { width: 30px; height: 30px; }
.opts header h3 { flex: 1; margin: 0; font: 700 20px/1 Cinzel, Georgia, serif; letter-spacing: .04em; color: #f3c65a; }
.opts .x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #e9e2d2; font-size: 14px; cursor: pointer; }
.opts .x:hover { background: rgba(255, 255, 255, .14); }
.opts section { padding: 6px 16px 8px; }
.opts section + section { border-top: 1px solid rgba(255, 255, 255, .07); }
.opts h4 { margin: 6px 0 2px; font: 700 11px/1 -apple-system, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: rgba(243, 198, 90, .8); }
.opts .orow { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 14px; padding: 7px 0; }
.opts .olabel b { display: block; font-weight: 650; font-size: 13.5px; }
.opts .olabel small { display: block; margin-top: 2px; font-size: 11.5px; color: rgba(239, 232, 218, .55); }
.opts .octl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* segmented choice: one pill, the chosen part in gold */
.opts .segc { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .1); }
.opts .segc button { border: 0; background: transparent; color: rgba(239, 232, 218, .8); font: 600 12.5px/1 inherit; font-family: inherit; padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.opts .segc button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.opts .segc button.on { background: linear-gradient(180deg, #f6cb5a, #d99a1b); color: #221606; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
/* switch */
.opts .tgl { position: relative; flex: none; width: 42px; height: 24px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .12); cursor: pointer; transition: background .15s; }
.opts .tgl span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #e9e2d2; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); transition: left .15s; pointer-events: none; }
.opts .tgl.on { background: linear-gradient(180deg, #f6cb5a, #d99a1b); border-color: transparent; }
.opts .tgl.on span { left: 20px; background: #fff; }
/* volume slider */
.opts .vol { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; }
.opts .vol input { flex: 1; accent-color: #e9aa2c; cursor: pointer; }
.opts .vol output { width: 38px; text-align: right; font-variant-numeric: tabular-nums; color: rgba(239, 232, 218, .75); }
.opts .vol.off { opacity: .35; }
.opts select.track { font: inherit; color: #efe8da; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; padding: 6px 8px; min-width: 170px; }
.opts select.track option { background: #1b1916; }
/* backgrounds: small scene thumbnails */
.opts .bgs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; }
.opts .bgpick { position: relative; height: 44px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .15); background-size: cover; background-position: center; cursor: pointer; overflow: hidden; padding: 0; }
.opts .bgpick:hover { border-color: rgba(255, 255, 255, .4); }
.opts .bgpick.on { border-color: #f3c65a; box-shadow: 0 0 0 2px rgba(243, 198, 90, .35); }
.opts .bgpick span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; font-size: 9.5px; line-height: 1.15; color: #fff; background: rgba(0, 0, 0, .6); text-align: left; }

/* a replay of one of your games (play-pc.html?replay=<id>): the table plus a control bar */
body.replay .localonly { display: none !important; }
body.replay .playmain { margin-bottom: 58px; } /* room for the control bar under the table */
body.replay .devtoggle { display: none !important; }
.replaybar { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 55; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 14px; background: linear-gradient(180deg, rgba(34, 30, 24, .95), rgba(20, 19, 17, .95)); border: 1px solid rgba(240, 180, 60, .35); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); color: #efe8da; font: 13px/1.2 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; white-space: nowrap; }
.replaybar .rtitle { padding: 0 8px; }
.replaybar .rtitle b { font-family: Cinzel, Georgia, serif; color: #f3c65a; letter-spacing: .04em; }
.replaybar .rmove { padding: 0 6px; color: rgba(239, 232, 218, .6); font-variant-numeric: tabular-nums; }
.replaybar .rb { min-width: 34px; height: 32px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .07); color: #efe8da; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 8px; }
.replaybar .rb:hover:not([disabled]) { background: rgba(255, 255, 255, .15); }
.replaybar .rb[disabled] { opacity: .35; cursor: default; }
.replaybar .rb.main { min-width: 46px; background: linear-gradient(180deg, #f6cb5a, #d99a1b); color: #221606; border-color: transparent; }
.replaybar .rb.back { font-size: 13px; font-weight: 600; }
.opts .obtn { border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .07); color: #efe8da; font: 600 12.5px/1 inherit; font-family: inherit; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.opts .obtn:hover { background: rgba(255, 255, 255, .14); }

/* ---- the guide for new players: the table dimmed except the part being explained, and a note beside it */
.guide { position: fixed; inset: 0; z-index: 300; }
.guide.nohole { background: rgba(0, 0, 0, .55); }
.guide .ghole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58), 0 0 0 2px rgba(243, 198, 90, .9), 0 0 24px rgba(243, 198, 90, .45); transition: all .25s ease; pointer-events: none; }
.guide .gtip, .guideoffer { position: fixed; width: 340px; padding: 14px 16px 12px; border-radius: 14px; background: linear-gradient(180deg, rgba(38, 33, 26, .98), rgba(22, 20, 17, .98)); border: 1px solid rgba(240, 180, 60, .45); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); color: #efe8da; font: 13.5px/1.45 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.guide .gstep { font-size: 11px; letter-spacing: .1em; color: rgba(243, 198, 90, .75); font-weight: 700; }
.guide h4 { margin: 4px 0 4px; font: 700 17px/1.2 Cinzel, Georgia, serif; color: #f3c65a; }
.guide p { margin: 0 0 12px; color: rgba(239, 232, 218, .9); }
.guide .gacts { display: flex; align-items: center; gap: 8px; }
.guide .gacts span { flex: 1; }
.guide button, .guideoffer button { border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .07); color: #efe8da; font: 600 12.5px/1 inherit; font-family: inherit; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.guide button.gskip { border: 0; background: none; padding: 8px 0; color: rgba(239, 232, 218, .55); font-weight: 500; }
.guide button.gnext, .guideoffer button.gnext { background: linear-gradient(180deg, #f6cb5a, #d99a1b); color: #221606; border-color: transparent; }
.guideoffer { top: 64px; left: 50%; transform: translateX(-50%); width: auto; display: flex; align-items: center; gap: 12px; z-index: 250; padding: 10px 12px 10px 16px; }
.guideoffer b { font-family: Cinzel, Georgia, serif; color: #f3c65a; }
.toast .ticon { width: 20px; height: 20px; vertical-align: -5px; margin-right: 8px; }
/* ---- "Preparing the table…" (play/prepare.js): while your cards load at the start of a game, a few seconds at most */
.preparing { position: absolute; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(12, 10, 8, .72); animation: prepIn .25s ease-out; }
.preparing .pcard { width: 320px; padding: 18px 22px 16px; border-radius: 16px; text-align: center; background: linear-gradient(180deg, rgba(38, 33, 26, .98), rgba(22, 20, 17, .98)); border: 1px solid rgba(240, 180, 60, .45); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); color: #efe8da; font: 13.5px/1.45 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.preparing h3 { margin: 0 0 12px; font: 700 19px/1.2 Cinzel, Georgia, serif; letter-spacing: .04em; color: #f3c65a; }
.preparing .pbar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.preparing .pbar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #d99a1b, #f6cb5a); transition: width .2s ease-out; }
.preparing p { margin: 10px 0 0; color: rgba(239, 232, 218, .75); }
.preparing b { font-weight: 600; color: #efe8da; font-variant-numeric: tabular-nums; }
@keyframes prepIn { from { opacity: 0; } }
