:root {
  --bg: #14112a; --bg2: #1d1938; --panel: #262046; --line: #3a3366;
  --text: #f2eefc; --dim: #a59fc7; --gold: #f2c14e; --red: #e5484d; --green: #46c37b;
  --magic: #8b5cf6; --brute: #e8642c; --cunning: #2fa36b; --royal: #f2c14e;
  --font: Inter, system-ui, sans-serif; --display: Cinzel, serif;
  --on-gold: #2a1d00; --glow1: #f2c14ecc; --glow2: #f2c14e33;
  --card: #fbf8f1; --card-fg: #1e1e1e; --card-line: #d8d2c4;
  --pc1: #221d40; --pc2: #1a1633; --well: #0e0b1e;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.35 var(--font); }
body { min-height: 100dvh; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
#app { max-width: 560px; margin: 0 auto; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); }
#app:has(.tray) { padding-bottom: 0; }

/* ---------- lobby ---------- */
.lobby { padding-top: 6vh; text-align: center; }
.logo { font-family: var(--display); font-weight: 900; font-size: 44px; letter-spacing: 1px; margin: 0;
  background: linear-gradient(180deg, #ffe08a, #e29a2d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { color: var(--dim); margin: 4px 0 28px; }
.suits { font-size: 22px; letter-spacing: 10px; margin-bottom: 18px; }
.suits .r { color: var(--red); }
.toplinks { margin: -6px 0 14px; }
.toplinks .link { margin-top: 0; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 12px 0; text-align: left; }
.box h3 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }
input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-size: 16px; }
input.code { text-transform: uppercase; letter-spacing: 6px; font-weight: 800; text-align: center; }
.btn { display: block; width: 100%; padding: 13px; border-radius: 12px; border: 0; background: var(--gold); color: var(--on-gold); font-weight: 800; margin-top: 10px; }
.btn.alt { background: #3a3366; color: var(--text); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--dim); }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: 8px; } .row > * { flex: 1; }
.link { background: none; border: 0; color: var(--dim); text-decoration: underline; margin-top: 14px; }
.bigcode { font-family: var(--display); font-size: 52px; font-weight: 900; letter-spacing: 10px; color: var(--gold); text-align: center; margin: 6px 0; }
.status { background: #3b2a12; border: 1px solid #7a5a20; color: #ffd99a; padding: 8px 12px; border-radius: 10px; margin: 6px 0; font-size: 13px; }
.muted { color: var(--dim); font-size: 13px; }

/* ---------- board ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: stretch; gap: 6px; padding: 6px 0 8px; background: var(--bg); }
.who { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line); color: var(--dim); }
.who b { display: block; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .clk { float: right; margin-left: 6px; font: 700 12px/20px 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .75; }
.who .clk.run { opacity: 1; }
.who.on { background: var(--gold); border-color: #fff2c4; color: #4a3500; box-shadow: 0 0 14px #f2c14e88; }
.who.on b { color: var(--on-gold); }
.vs { align-self: center; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }
.topbar .menu { margin: 0; text-decoration: none; font-size: 20px; padding: 0 4px; position: relative; }
.topbar .menu .dot { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: #4a3500; font: 800 10px/16px Inter, sans-serif; font-style: normal; text-align: center; }
.games.switch { max-width: none; margin: 0; }
.side { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.side.opp { margin-bottom: 8px; background: #2a1626; border-color: #8a3a4c; }
.side.mine { background: #14233d; border-color: #3d78b8; }
.tag { font-style: normal; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 2px 7px; border-radius: 99px; margin-right: 6px; }
.side.opp .tag { background: #8a3a4c; color: #ffe1e6; } .side.mine .tag { background: #3d78b8; color: #e6f2ff; }
.side.opp .bench-label { color: #e6a3b0; } .side.mine .bench-label { color: #9cc7f2; }
.side .bench { border-radius: 10px; padding: 5px; }
.side.opp .bench { background: #3a1c30; } .side.mine .bench { background: #1b3152; }
.sidehead { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin: 0 2px 6px; }
.sidehead b { color: var(--text); font-size: 13px; }
.arena-row { display: flex; gap: 8px; align-items: stretch; }
.bench { display: flex; gap: 6px; flex-wrap: wrap; align-content: flex-start; flex: 1; }
.bench-label, .ko-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); width: 100%; }

/* player card */
.pc { position: relative; border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 30%, var(--pc1)), var(--pc2) 70%);
  border: 2px solid var(--cc); padding: 6px; cursor: pointer; overflow: hidden; }
.pc.magic { --cc: var(--magic); } .pc.brute { --cc: var(--brute); } .pc.cunning { --cc: var(--cunning); } .pc.royal { --cc: var(--royal); }
.pc.big { width: 168px; flex: none; min-height: 196px; }
.pc.small { width: 70px; min-height: 86px; padding: 4px; border-width: 1.5px; }
.pc.ko { filter: grayscale(1); opacity: .35; }
.pc .ic { font-size: 30px; text-align: center; line-height: 1.1; margin: 2px 0 0; white-space: nowrap; letter-spacing: -2px; } /* nowrap + tight spacing: Twin Poppies shows two icons */
.pc.small .ic { font-size: 22px; }
.pc .nm { font-weight: 800; font-size: 13px; line-height: 1.1; }
.pc.small .nm { font-size: 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin: 2px 0 3px; }
/* drawn as one gradient on the bar itself, so nothing inside it can fail to render */
.hpbar { --c: var(--green); height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--c) 0, var(--c) var(--w, 0%), var(--well) var(--w, 0%), var(--well) 100%); border: 1px solid #ffffff22; }
.hpbar.mid { --c: var(--gold); } .hpbar.low { --c: var(--red); }
.hptxt { font-size: 11px; font-weight: 700; margin-top: 2px; }
.pc.small .hptxt { text-align: center; font-size: 10px; }
.clsb { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fbf8f1; color: #1e1e1e; font-size: 15px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 1px 3px #0008; }
.clsb.r { color: #c41d24; }
/* ability star: small and quiet, centered directly under the class suit, so the top right corner is free for status icons */
.abil { position: absolute; top: 25px; left: 4px; width: 22px; text-align: center; font-size: 15px; line-height: 1; padding: 2px 0 3px; cursor: help; color: #b07d12; z-index: 2; }
[data-cards="cb"] .abil { color: var(--gold); }
.pc.small .abil { font-size: 11px; top: 18px; left: 2px; width: 17px; padding: 1px 0 2px; }
.tip { position: fixed; z-index: 40; max-width: min(260px, 86vw); background: #000e; color: #fff; border: 1px solid var(--gold); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.3; pointer-events: none; box-shadow: 0 6px 18px #0008; }
.pc.small .clsb { width: 17px; height: 17px; font-size: 12px; top: 2px; left: 2px; }
.pc.pick { animation: pulse 1s infinite; cursor: pointer; }
.pc.drop-ok { outline: 3px dashed var(--gold); outline-offset: 1px; }
.pc.drop-hover { outline-style: solid; transform: scale(1.04); background: color-mix(in srgb, var(--gold) 30%, var(--pc1)); }
.board.drop-board { outline: 3px dashed var(--gold); outline-offset: 3px; border-radius: 18px; }
.float { position: absolute; left: 50%; top: 40%; font-weight: 900; font-size: 26px; color: #fff; text-shadow: 0 0 6px #c41d24, 0 2px 0 #7a0d12; pointer-events: none; z-index: 3; }
.pc.small .float { font-size: 18px; top: 30%; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--glow1); } 50% { box-shadow: 0 0 0 7px var(--glow2); } }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
/* status and power-up icons: stacked in the top right corner, to the right of the Player's icon, so a card never changes height.
   Arena card: two columns, filled from the corner. Bench card: one column of three down the edge, then a second. */
.stat { position: absolute; top: 5px; right: 6px; z-index: 2; display: grid; grid-template-columns: repeat(2, auto); direction: rtl; font-size: 12px; line-height: 1; }
.sti { display: block; padding: 2px 3px; cursor: help; }
.pc.big .sti { font-size: 15px; padding: 2px 3px; }
/* attack damage that differs from the printed number right now (hearts, class bonus, shields) */
.admg.up { color: #8dffb5; } .admg.down { color: #ff9c9c; }
.admg.up::after { content: '▲'; font-size: .45em; vertical-align: .5em; margin-left: 1px; }
.admg.down::after { content: '▼'; font-size: .45em; vertical-align: .5em; margin-left: 1px; }
.pc.small .stat { top: 3px; right: 4px; font-size: 9px; grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(3, auto); }
.pc.small .sti { padding: 0 1px; }
.en { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.chip { font-size: 11px; font-weight: 800; padding: 1px 5px; border-radius: 6px; background: #f3efe6; color: #222; }
.chip.r { color: #c41d24; } .chip.j { background: var(--gold); }
.entot { font-size: 10px; color: var(--dim); margin-top: 3px; }
.atk { font-size: 11px; margin-top: 4px; padding: 4px 6px; border-radius: 6px; background: #0e0b1e66; }
.atop { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.admg { font-weight: 900; font-size: 17px; line-height: 1; color: #fff; }
.admg.r { float: right; font-size: 20px; }
/* the condition an attack leaves behind (infect, poison, burn), small, just left of its damage */
.aff { font-size: .68em; font-weight: 400; margin-right: 3px; vertical-align: .14em; cursor: help; }
.detail .admg { font-size: 22px; }
.aneed { font-size: 10px; color: var(--dim); margin-top: 1px; }
.atk.ok { background: color-mix(in srgb, var(--green) 25%, transparent); }
.atk.off { opacity: .45; }
.atk.off b { text-decoration: line-through; }
.detail .atkd.off .cost, .detail .atkd.off .muted, .detail .atkd.off .admg { opacity: .45; }
.atk b { font-weight: 800; }

/* log */
.mid { display: flex; gap: 8px; align-items: stretch; margin: 8px 0; }
.deckpile { flex: none; width: 46px; border-radius: 8px; background: repeating-linear-gradient(45deg, #3b2f7a, #3b2f7a 5px, #2c2360 5px, #2c2360 10px); border: 2px solid #f3efe6;
  box-shadow: 2px 2px 0 #f3efe6aa, 4px 4px 0 #f3efe655; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; margin-right: 4px; align-self: center; height: 62px; }
.deckpile b { font-size: 17px; line-height: 1; }
.logstrip { flex: 1; min-width: 0; padding: 8px 10px; background: var(--panel); border-radius: 12px; font-size: 12px; color: var(--dim); cursor: pointer; }
.logstrip div:last-child { color: var(--text); }
.saybtn { flex: none; align-self: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; line-height: 1; padding: 0; cursor: pointer; }
.saybtn:disabled { opacity: .35; cursor: default; }

/* prompt */
.prompt { background: color-mix(in srgb, var(--gold) 18%, var(--panel)); border: 1px solid var(--gold); border-radius: 14px; padding: 10px; margin: 8px 0; }
.prompt h4 { margin: 0 0 6px; font-size: 14px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }

/* actions */
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 8px 0; }
.actions button { padding: 11px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 800; font-size: 13px; }
.actions button.primary { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.actions button.go { background: var(--gold); color: var(--on-gold); border-color: var(--gold); animation: pulse 1s infinite; }
.actions button small { display: block; font-size: 9px; font-weight: 600; opacity: .9; }
.actions button:disabled { opacity: .4; }
.playinfo { font-size: 12px; color: var(--dim); text-align: center; }

/* hand */
/* the tray (action buttons + your cards) stays pinned to the bottom of the screen while the board scrolls */
.tray { position: sticky; bottom: 0; z-index: 9; margin: 8px -12px 0; padding: 7px 12px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 16px #00000059; }
.tray .actions { margin: 0 0 4px; }
.tray .actions button { padding: 9px 4px; }
.tray .cards { padding: 5px 2px 2px; }
.hand { display: flex; gap: 8px; margin-top: 5px; }
.hgrp { min-width: 0; }
.hgrp + .hgrp { border-left: 1px solid var(--line); padding-left: 8px; }
.hand h5 { margin: 0 2px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); font-weight: 600; white-space: nowrap; }
.board, .hand, .actions { -webkit-user-select: none; user-select: none; }
.cards { display: flex; padding: 8px 2px 4px; }
.slot { flex: 1 1 0; min-width: 0; max-width: 62px; height: 80px; }
.slot:last-child { flex: 0 0 56px; }
/* a pile laid out to pick from (Treasure Map): cards wrap instead of overlapping */
.cards.grid { flex-wrap: wrap; gap: 8px 5px; }
.cards.grid .slot { flex: 0 0 56px; }
/* playing cards and Activity cards share one size and layout */
.card { position: relative; width: 56px; height: 80px; border-radius: 8px; background: var(--card); color: var(--card-fg); display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: -2px 2px 4px #0007; cursor: grab; border: 2px solid var(--card-line); touch-action: none; transition: transform .12s; }
.card .rk { position: absolute; top: 3px; left: 5px; font-weight: 900; font-size: 15px; line-height: 1; text-align: center; }
.card .rk i { display: block; font-style: normal; font-size: 13px; }
.card .pip { font-size: 28px; line-height: 1; margin-top: 8px; }
.card small { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .6; }
.card.r { color: #c41d24; } .card.j { background: linear-gradient(160deg, #ffe08a, #e29a2d); }
.card.actc { background: #d5e6ff; border-color: #9dbdf0; color: #14254d; }
.card.actc .rk { font-size: 16px; left: 3px; }
.card.actc .nmx { font-size: 9.5px; font-weight: 800; line-height: 1.1; text-align: center; padding: 0 3px; margin-top: 12px; overflow-wrap: anywhere; }
.card.sel { border-color: var(--gold); transform: translateY(-6px); }
.card.fresh { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 14px var(--glow1); z-index: 2; }
.card[data-nodrag] { cursor: pointer; }
@media (hover: hover) { .slot:hover .card { transform: translateY(-6px); z-index: 3; } }
.card.drag-src { opacity: .25; }
/* rearranging your hand: a gold bar shows where the card will land */
.card.ins-l { box-shadow: -5px 0 0 var(--gold), -2px 2px 4px #0007; transform: translateX(5px); }
.card.ins-r { box-shadow: 5px 0 0 var(--gold), -2px 2px 4px #0007; transform: translateX(-5px); }
.card.ghost { position: fixed; z-index: 40; pointer-events: none; transform: rotate(4deg) scale(1.12); box-shadow: 0 10px 24px #000b; transition: none; margin: 0; }
body.dragging { cursor: grabbing; }

/* overlays: turn start and attack results */
.overlay { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; background: #000b; padding: 20px; }
.overlay.light { background: #0007; }
.turnbox, .evbox { width: min(400px, 100%); background: var(--bg2); border: 2px solid var(--gold); border-radius: 20px; padding: 22px 18px; text-align: center; box-shadow: 0 12px 40px #000c; animation: pop .22s ease-out; }
.turnbox .big { font-family: var(--display); font-weight: 900; font-size: 34px; line-height: 1.1; margin-bottom: 10px;
  background: linear-gradient(180deg, #ffe08a, #e29a2d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bigbtn { font-size: 20px; padding: 16px; margin-top: 16px; }
.evbox { cursor: pointer; }
.evwho { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--dim); }
.evicon { font-size: 44px; line-height: 1.2; }
.evtitle { font-family: var(--display); font-weight: 900; font-size: 21px; color: var(--gold); margin-bottom: 8px; }
.evline { font-size: 15px; padding: 5px 0; border-top: 1px solid var(--line); }
.evline.warn { color: #ffd99a; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: #000a; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 82dvh; overflow-y: auto;
  background: var(--bg2); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line); padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-panel h3 { margin: 0 0 4px; font-family: var(--display); font-size: 20px; }
.sheet-panel p { margin: 4px 0 10px; color: var(--dim); font-size: 13px; }
.opt { display: block; width: 100%; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); margin-top: 6px; }
.opt small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.opt.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 20%, var(--panel)); }
.opt:disabled { opacity: .45; }
.detail .atkd { background: var(--panel); border-radius: 12px; padding: 10px; margin-top: 8px; }
.detail .atkd .h { display: flex; justify-content: space-between; font-weight: 800; }
.cost { font-size: 12px; color: var(--dim); }
.cost.ok { color: var(--green); }
.logfull div { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.logfull div { color: var(--dim); } .logfull div:last-child { color: var(--text); font-weight: 600; }
.toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); background: #000d; border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px; z-index: 30; max-width: 90vw; font-size: 14px; }
.winner { text-align: center; padding: 18px; }
.winner .logo { font-size: 36px; }

/* coin flips */
.coinbox { width: min(400px, 100%); background: var(--bg2); border: 2px solid var(--gold); border-radius: 20px; padding: 18px; text-align: center; cursor: pointer; animation: pop .2s ease-out; }
.coinset + .coinset { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.coins { display: flex; justify-content: center; gap: 16px; padding: 78px 0 10px; perspective: 600px; }
.coin { position: relative; width: 72px; height: 72px; transform-style: preserve-3d; animation: flipH 1.5s cubic-bezier(.3, .1, .3, 1) forwards; }
.coin.t { animation-name: flipT; }
.coin:nth-child(2) { animation-duration: 1.65s; } .coin:nth-child(3) { animation-duration: 1.8s; }
/* 4 or more coins at once (Reindeer Games flips 5): smaller coins so the row fits a phone */
.coins.many { gap: 8px; } .coins.many .coin { width: 50px; height: 50px; } .coins.many .cf { font-size: 22px; border-width: 3px; }
.coin:nth-child(4) { animation-duration: 1.7s; } .coin:nth-child(5) { animation-duration: 1.8s; }
.cf { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font: 900 32px var(--display); -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: radial-gradient(circle at 35% 30%, #fff0b8, #d79a22); color: #5a3a00; border: 4px solid #fff2c4; box-shadow: 0 4px 10px #0009; }
.ct { transform: rotateX(180deg); background: radial-gradient(circle at 35% 30%, #f1f1f6, #8f93a8); color: #2b2e3d; border-color: #fafafa; }
@keyframes flipH { 0% { transform: translateY(0) rotateX(0); } 50% { transform: translateY(-70px) rotateX(900deg); } 100% { transform: translateY(0) rotateX(1800deg); } }
@keyframes flipT { 0% { transform: translateY(0) rotateX(0); } 50% { transform: translateY(-70px) rotateX(990deg); } 100% { transform: translateY(0) rotateX(1980deg); } }
.coinres { font-weight: 800; font-size: 17px; color: var(--gold); opacity: 0; animation: pop .3s 1.85s ease-out forwards; }

/* character list */
.rhead { margin: 28px 0 2px; font-family: var(--display); font-size: 17px; color: var(--gold); }
.rhead small { font: 400 12px var(--font); color: var(--dim); margin-left: 6px; }
.rost { border-left: 4px solid var(--cc, var(--line)); }
.detail .rost { margin-top: 18px; padding: 12px 12px 12px 14px; }
.rhead + .rost { margin-top: 10px; }
.rost .h { align-items: center; gap: 10px; margin-bottom: 3px; }
.rname { color: color-mix(in srgb, var(--cc) 72%, #fff); font-size: 16px; }
.rhp { flex: none; padding: 2px 9px; border: 1.5px solid currentColor; border-radius: 999px; background: #00000038; color: color-mix(in srgb, var(--green) 80%, #fff); font-size: 12px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
/* ability text is always yellow, in every skin, so it stands out */
.rost .rabil { color: #ffd45e; font-size: 13px; margin: 2px 0; }
.abline, .sheet-panel p.abline { color: #ffd45e; }
.rost.actl { --cc: #7fb7e6; }
.rost .atxt { font-size: 13px; margin-top: 3px; }
.libtabs { margin: 10px 0 12px; }
.library { padding-top: 2vh; }
.library .logo { font-size: 30px; }
.library .tag { margin-bottom: 14px; }
.library .back { display: block; margin: 0 0 10px; }
.library .detail { text-align: left; }
.library .detail p { margin: 4px 0 10px; color: var(--dim); font-size: 13px; }
.rost.magic { --cc: var(--magic); } .rost.brute { --cc: var(--brute); } .rost.cunning { --cc: var(--cunning); } .rost.royal { --cc: var(--royal); }
.ratk { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

/* ---------- the table ----------
   The base values above are the fallback; the game always runs with data-theme="felt": every card
   (Players included) is a card sitting on a table. data-felt picks the table top (five felts,
   sage wool, candlelit tavern) and data-cards picks the card style (classic cream, or colorblind). */
:root[data-theme="felt"] {
  --bg: #1f6b48; --bg2: #164d34; --panel: #1b5c3e; --line: #3f8f68;
  --text: #f6f3e8; --dim: #b7d3c2;
  --magic: #7c4ddb; --brute: #d9571f; --cunning: #23875a; --royal: #c9921a;
  --well: #d9d2c2; --ink2: #6f6858;
  --fuzz: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='a' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 -.42'/%3E%3CfeGaussianBlur stdDeviation='.35'/%3E%3C/filter%3E%3Cfilter id='b' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 -.4'/%3E%3CfeGaussianBlur stdDeviation='.35'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23a)' opacity='.5'/%3E%3Crect width='240' height='240' filter='url(%23b)' opacity='.55'/%3E%3C/svg%3E");
  --nap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='a' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 -.18'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23a)' opacity='.5'/%3E%3C/svg%3E");
}
[data-theme="felt"][data-felt="purple"] { --bg: #3d3275; --bg2: #2a2256; --panel: #342a66; --line: #62569e; --dim: #c5bfe2; }
[data-theme="felt"][data-felt="blue"] { --bg: #1f5282; --bg2: #173c61; --panel: #1b4770; --line: #4b82b4; --dim: #bcd2e6; }
[data-theme="felt"][data-felt="red"] { --bg: #7c2736; --bg2: #5a1b27; --panel: #6b2130; --line: #ab4f5f; --dim: #e8c6cc; }

/* midnight felt: charcoal with gold stitching */
[data-theme="felt"][data-felt="midnight"] { --bg: #1b1d22; --bg2: #121317; --panel: #1d2026; --line: #4a4d57; --dim: #b9bcc6; }
[data-theme="felt"][data-felt="midnight"] .side, [data-theme="felt"][data-felt="midnight"] .side.opp, [data-theme="felt"][data-felt="midnight"] .side.mine { border-color: #f2c14e8c; }
/* sage wool: the one light table, so the lettering that sits on the table turns dark */
[data-theme="felt"][data-felt="sage"] { --bg: #a9bfa6; --bg2: #93ab90; --panel: #c9d8c6; --line: #6f8a6d; --text: #18241a; --dim: #3c4f3e; }
[data-theme="felt"][data-felt="sage"] .side { border-color: #2f4a3380; }
[data-theme="felt"][data-felt="sage"] .side.opp { border-color: #8a2a3aa6; }
[data-theme="felt"][data-felt="sage"] .side.mine { border-color: #1f4f8aa6; }
[data-theme="felt"][data-felt="sage"] .side.opp .bench-label { color: #7a1f2e; }
[data-theme="felt"][data-felt="sage"] .side.mine .bench-label { color: #1d4a80; }
[data-theme="felt"][data-felt="sage"] .who { border-color: #00000040; }
[data-felt="sage"] .logo, [data-felt="sage"] .turnbox .big { background-image: linear-gradient(180deg, #8a5a0a, #5e3a04); }
/* candlelit tavern: dark planks drawn as plain seams, lit by a warm pool of light */
:root { --planks: repeating-linear-gradient(90deg, transparent 0 94px, #00000059 94px 96px, #ffffff0a 96px 97px); }
[data-theme="felt"][data-felt="tavern"] { --bg: #3a2010; --bg2: #24130a; --panel: #33200f; --line: #8a6238; --dim: #e3c9a4; --text: #f8ecd6; --nap: none; }
[data-theme="felt"][data-felt="tavern"] .side { border-style: solid; border-color: #e8b96a66; }
html[data-theme="felt"][data-felt="tavern"] { background:
  radial-gradient(90% 55% at 50% 42%, #c9772a8c, #8a4f1e40 45%, transparent 75%),
  radial-gradient(120% 100% at 50% 45%, transparent 45%, #000000a6),
  var(--planks), var(--fuzz), var(--bg); background-attachment: fixed; }

html[data-theme="felt"] { min-height: 100%; background:
  radial-gradient(130% 70% at 50% 0%, #ffffff1c, transparent 60%),
  radial-gradient(120% 100% at 50% 45%, transparent 55%, #0000004d),
  var(--fuzz), var(--nap), var(--bg); }
[data-theme="felt"] body { background: transparent; }
[data-theme="felt"] .topbar { background: linear-gradient(#ffffff17, #ffffff12), var(--fuzz), var(--bg); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }

/* table zones: stitched outlines on the felt instead of colored panels */
[data-theme="felt"] .who { background: #0000003d; border-color: #ffffff33; }
[data-theme="felt"] .who.on { background: var(--gold); border-color: #fff2c4; }
[data-theme="felt"] .side { background: #0000001f; border: 1.5px dashed #ffffff59; box-shadow: inset 0 2px 10px #00000033; }
[data-theme="felt"] .side.opp { border-color: #ffb9c4a6; }
[data-theme="felt"] .side.mine { border-color: #b4daffa6; }
[data-theme="felt"] .side.opp .bench { background: #00000033; }
[data-theme="felt"] .side.mine .bench { background: #ffffff1a; }
[data-theme="felt"] .side.opp .bench-label { color: #ffd0d7; } [data-theme="felt"] .side.mine .bench-label { color: #d6eaff; }
[data-theme="felt"] .logstrip { background: #00000042; }
[data-theme="felt"] .saybtn { background: #00000042; border-color: #ffffff3d; }
[data-theme="felt"] .actions button:not(.primary):not(.go) { background: #00000047; border-color: #ffffff3d; }
[data-theme="felt"] .btn.alt { background: #00000047; border: 1px solid #ffffff3d; }

/* Player cards: the same cream card as the hand, with the class as a thin colored frame
   and the class suit in the corner like a card index */
[data-theme="felt"] .pc { background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 13%, var(--card)), var(--card) 34%); color: var(--card-fg);
  border: 2px solid var(--card-line); border-radius: 10px; padding: 9px 9px 8px; box-shadow: -2px 3px 5px #00000073; --green: #2fa15f; }
[data-theme="felt"] .pc::before { content: ''; position: absolute; inset: 3px; border: 1.5px solid var(--cc); border-radius: 6px; pointer-events: none; }
[data-theme="felt"] .pc.small { padding: 7px 5px 5px; border-width: 2px; border-radius: 8px; }
[data-theme="felt"] .pc.small::before { inset: 2px; border-width: 1px; border-radius: 5px; }
[data-theme="felt"] .pc.ko { opacity: .45; box-shadow: none; }
/* cards keep their own height: the Arena card never stretches to match the bench */
[data-theme="felt"] .arena-row { align-items: flex-start; }
[data-theme="felt"] .bench { align-self: stretch; }
[data-theme="felt"] .clsb { background: none; box-shadow: none; width: auto; height: auto; font-size: 18px; top: 7px; left: 9px; }
[data-theme="felt"] .pc.small .clsb { font-size: 12px; top: 4px; left: 5px; width: auto; height: auto; }
[data-theme="felt"] .pc .meta, [data-theme="felt"] .pc .aneed, [data-theme="felt"] .pc .entot, [data-theme="felt"] .pc .muted { color: var(--ink2); }
[data-theme="felt"] .hpbar { border-color: #00000030; }
[data-theme="felt"] .pc .atk { background: #1e1e1e0d; box-shadow: inset 0 0 0 1px #1e1e1e12; }
[data-theme="felt"] .pc .atk.ok { background: color-mix(in srgb, var(--green) 24%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 55%, var(--card)); }
[data-theme="felt"] .pc .admg { color: var(--card-fg); }
[data-theme="felt"] .pc .admg.up { color: #0c7f3d; } [data-theme="felt"] .pc .admg.down { color: #c41d24; }
[data-theme="felt"] .tray { background: linear-gradient(#ffffff17, #ffffff12), var(--fuzz), var(--bg); border-top-color: #ffffff40; }
[data-theme="felt"] .hgrp + .hgrp { border-left-color: #ffffff40; }
/* attached energy: tiny cards instead of chips */
[data-theme="felt"] .chip { background: #fff; border: 1px solid var(--card-line); border-radius: 3px; padding: 2px 4px; box-shadow: 0 1px 1px #00000040; }
[data-theme="felt"] .chip.j { background: var(--gold); }
[data-theme="felt"] .pc.drop-hover { background: color-mix(in srgb, var(--gold) 35%, var(--card)); }
[data-theme="felt"] .float { color: #c41d24; text-shadow: 0 0 5px #fff, 0 0 2px #fff; }
[data-theme="felt"] .card { box-shadow: -2px 3px 5px #00000073; }

/* table picker (home screen and in-game menu) */
.felts { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.fsw { width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid #ffffff66; }
.fsw.tavern { background: radial-gradient(circle at 50% 45%, #c9772a, #3a2010 70%, #170c05); }
.fsw.on { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold); }

/* card style picker (home screen and in-game menu) */
.themes { display: flex; gap: 8px; margin-top: 10px; }
.themes .opt { margin-top: 0; text-align: center; font-weight: 800; }

/* accounts, leaderboard and game history */
.sheet-panel input { margin-top: 8px; }
.ferr { color: #ff8f8f; font-size: 13px; min-height: 18px; margin-top: 8px; }
.acct .muted { margin: 0; }
.acctrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.acctrow b { font-size: 20px; }
.acctrow span { color: var(--gold); font-weight: 800; white-space: nowrap; }
.row2 { display: flex; gap: 8px; }
.row2 .btn { flex: 1; }
.lb { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 10px; }
.lb th { text-align: left; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 6px 4px; }
.lb td { padding: 9px 4px; border-top: 1px solid var(--line); }
.lb td:first-child { color: var(--dim); width: 28px; }
.lb td:nth-child(2) { font-weight: 800; }
.lb tr.me td { color: var(--gold); }
.hrow { display: flex; align-items: baseline; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hrow b { width: 42px; }
.hrow.w b { color: var(--gold); }
.hrow.l b { color: var(--dim); }
.hrow span { flex: 1; }
.hrow small { color: var(--dim); }

/* pick your team (draft) */
.draft .dlabel { margin: 10px 0 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }
.dteam { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.dchip { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 13px; }
.draft .choices .opt { width: auto; flex: 1 1 45%; margin-top: 0; }
.opt.taken { opacity: .4; }
.dpick, .dchip { border-left: 4px solid var(--cc, var(--line)); }
.dpick.magic, .dchip.magic { --cc: var(--magic); } .dpick.brute, .dchip.brute { --cc: var(--brute); } .dpick.cunning, .dchip.cunning { --cc: var(--cunning); } .dpick.royal, .dchip.royal { --cc: var(--royal); }
.dcols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.dcol { min-width: 0; }
.dcol .dteam { flex-direction: column; align-items: stretch; }
.dcol .dchip { text-align: left; border-radius: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcol + .dcol { border-left: 1px solid var(--line); padding-left: 10px; }
.dcol .dlabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* home screen: pitch, quick start, resume, footer links */
.pitch { max-width: 420px; margin: 0 auto 12px; font-size: 15px; line-height: 1.4; }
.btn.learn { width: auto; display: inline-block; margin: 0 0 14px; padding: 9px 16px; border-radius: 999px; font-size: 14px; }
.btn small { display: block; font-size: 11px; font-weight: 600; opacity: .8; margin-top: 1px; }
.box .row2 .btn { margin-top: 0; }
.box.resume { border-color: var(--gold); }
.box.resume .btn:first-of-type { margin-top: 0; }
.box.resume .link { display: block; margin: 10px auto 0; font-size: 13px; }
.footlinks { margin-top: 16px; color: var(--dim); font-size: 13px; line-height: 2; }
.footlinks .link { font-size: 13px; }
.footlinks .link { margin-top: 0; }
.qs { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.qs > b { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; font-size: 13px; }
textarea { width: 100%; margin-top: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-size: 16px; resize: vertical; }
[data-theme="felt"] .sheet-panel textarea { background: #00000040; }

/* turn pop-up: what the other player did on their turn */
.recap { max-height: 34dvh; overflow-y: auto; margin: 4px 0 8px; padding: 8px 12px 4px; border-radius: 12px; background: #00000038; text-align: left; }
.recap .evwho { margin-bottom: 4px; }
.recap .evline { font-size: 13.5px; padding: 4px 0; }

/* ---------- simple home: three buttons, and the Play sheet ---------- */
.home { max-width: 340px; margin: 0 auto 22px; }
.home .btn { padding: 15px; font-size: 17px; }
.home .btn.alt { font-size: 15px; }
.lobby .toplinks { margin: 0 0 6px; line-height: 2; }
.sheet-panel p.step { margin: 16px 0 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.sheet-panel .resume { border: 1px solid var(--gold); border-radius: 14px; padding: 12px; margin: 8px 0 12px; text-align: center; }
.sheet-panel .resume p { margin: 0; }
.sheet-panel .resume .link { display: block; margin: 10px auto 0; font-size: 13px; }
.sheet-panel .resume + input, .sheet-panel .resume + p { margin-top: 0; }
.sheet-panel .link.one { display: block; margin: 10px auto 0; font-size: 13px; }
.sheet-panel .link.one.on { color: var(--gold); text-decoration: none; font-weight: 800; }
.lobby .tag { margin-bottom: 18px; }
.lobby .pitch { margin-bottom: 18px; }
.home { margin-bottom: 18px; }

/* Your games: saved games on the home screen */
.games { max-width: 340px; margin: 0 auto 18px; text-align: left; }
.games h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); text-align: center; font-weight: 600; }
.games .opt { font-weight: 600; }
.games .opt.done { opacity: .7; }

/* Challenges: the button on the leaderboard and the Accept / Decline row under Your games */
.lb td.act { text-align: right; white-space: nowrap; width: 1%; }
.lb td.act .muted { font-size: 12px; font-weight: 400; }
.chalb { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--gold); font-size: 12px; font-weight: 800; }
.games .opt.chal .pair { display: flex; gap: 8px; margin-top: 10px; }
.games .opt.chal .pair .btn { margin-top: 0; padding: 10px; font-size: 14px; }

/* ---------- what's new ---------- */
.news .rhead:first-of-type { margin-top: 14px; }
.news .nline { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 14px; line-height: 1.35; }
.news .nline > span { flex: none; width: 24px; text-align: center; font-size: 18px; }
.news .btn { margin-top: 22px; }

/* ---------- colorblind cards ----------
   White lettering on dark cards, and no two suits share a color: diamonds (Magic) blue, clubs (Brute)
   green, spades (Cunning) amber, hearts (classless) white. Works on every table. */
:root[data-cards="cb"] {
  --card: #171b21; --card-fg: #f5f7fa; --card-line: #56616e; --well: #05070a; --ink2: #aab4bf;
  --magic: #4da3ff; --brute: #2fd693; --cunning: #f5a623; --royal: #f5f7fa;
}
[data-cards="cb"] .sD { color: var(--magic); } [data-cards="cb"] .sC { color: var(--brute); }
[data-cards="cb"] .sS { color: var(--cunning); } [data-cards="cb"] .sH { color: var(--royal); }
[data-cards="cb"] .card.j, [data-cards="cb"] .chip.j { color: #2a1d00; }
[data-cards="cb"] .card.actc { background: #18294a; border-color: #5b8fd9; color: #eaf2ff; }
[data-cards="cb"] .chip { background: #05070a; border-color: var(--card-line); }
[data-cards="cb"] .chip.j { background: var(--gold); }
[data-cards="cb"] .pc { --green: #3fd68a; }
[data-cards="cb"] .hpbar { border-color: #ffffff30; }
[data-cards="cb"] .pc .atk { background: #ffffff0f; box-shadow: inset 0 0 0 1px #ffffff14; }
[data-cards="cb"] .pc .admg.up { color: #8dffb5; } [data-cards="cb"] .pc .admg.down { color: #ff9c9c; }
[data-cards="cb"] .float { color: #fff; text-shadow: 0 0 6px #c41d24, 0 2px 0 #7a0d12; }
[data-cards="cb"] .card, [data-cards="cb"] .pc { box-shadow: -2px 3px 6px #000000a6; }

/* ---------- badges, statuses and profiles ---------- */
.who[data-tap] { cursor: pointer; }
.pname { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.sti2 { font-size: 12px; font-weight: 400; white-space: nowrap; }
.who b { display: flex; align-items: baseline; gap: 5px; }
.who .wn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* the name box: name, then the time on the right; rank and bragging icons get their own line underneath */
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }
.who b { flex: 1; min-width: 0; }
.who .wst { order: 3; flex: 0 0 100%; font-size: 13px; line-height: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.who .clk { order: 2; float: none; margin-left: 0; }
.stchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.stchip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); font-size: 12px; font-weight: 800; white-space: nowrap; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.pstats div { padding: 9px 4px; border-radius: 12px; border: 1px solid var(--line); text-align: center; min-width: 0; }
.pstats b { display: block; font-size: 17px; white-space: nowrap; }
.pstats small { display: block; color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.bdgs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 8px 0 10px; }
.bdg { padding: 9px 9px 9px 44px; border-radius: 12px; border: 1px solid var(--line); position: relative; min-height: 58px; opacity: .5; }
.bdg i { position: absolute; left: 9px; top: 10px; width: 28px; text-align: center; font-style: normal; font-size: 22px; line-height: 28px; filter: grayscale(1); }
.bdg b { display: block; font-size: 13px; }
.bdg small { display: block; color: var(--dim); font-size: 11px; line-height: 1.3; }
.bdg.on { opacity: 1; border-color: var(--gold); }
.bdg.on i { filter: none; }
.bdg.on b { color: var(--gold); }
.tros { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 10px; }
.tro { font-size: 46px; line-height: 1; cursor: pointer; border-radius: 10px; }
.tro img.emo { display: block; vertical-align: 0; }
.sheet-panel p.cabempty { margin: 6px 0 0; }
.podium { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.bdg.t1 { border-color: #c98a55; } .bdg.t1 b { color: #dfa06a; }
.bdg.t2 { border-color: #c9d1dc; } .bdg.t2 b { color: #dfe5ee; }
.newbdg, .sheet-panel p.newbdg { color: var(--gold); font-weight: 800; font-size: 15px; margin: 6px 0; }

/* ---------- Christmas Tournament ---------- */
.home .btn.xmasbtn, .games .btn.xmasbtn { border-color: #c0392b; box-shadow: inset 0 0 0 1px rgba(192, 57, 43, .35); }
.tourney { max-width: 720px; }
.tourney .box { text-align: left; }
.tourney .box.winner { text-align: center; }
.tourney .box .btn { margin-top: 10px; }
.trules p { margin: 0 0 8px; }
.tents { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tents .stchip { border-color: var(--line); color: var(--text); font-weight: 600; }
.tents .stchip.me { border-color: var(--gold); color: var(--gold); }
.tents .stchip.open { opacity: .45; border-style: dashed; }
.brk { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; -webkit-overflow-scrolling: touch; }
.rnd { flex: 0 0 150px; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.rnd h5 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); font-weight: 600; text-align: center; }
.mt { border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; font-size: 13px; text-align: left; background: rgba(0, 0, 0, .14); }
.mt.live { border-color: var(--gold); }
.mt.mine { box-shadow: inset 3px 0 0 var(--gold); }
.mt[data-h] { cursor: pointer; }
.mt small { display: block; color: var(--dim); font-size: 11px; margin-top: 2px; }
.mrow { display: flex; justify-content: space-between; gap: 6px; padding: 2px 0; white-space: nowrap; overflow: hidden; }
.mrow span { overflow: hidden; text-overflow: ellipsis; }
.mrow i { color: var(--dim); font-style: normal; opacity: .7; }
.mrow.won { font-weight: 800; }
.mrow.lost { opacity: .5; }
.mrow.me span { text-decoration: underline; text-underline-offset: 3px; }

/* Fluent Emoji images that stand in for device emoji (see emoji.js) */
img.emo{height:1em;width:1em;vertical-align:-.125em;display:inline-block;pointer-events:none;user-select:none}
/* bigger icon beside the name on the Characters and Activity cards lists */
.rname { display: inline-flex; align-items: center; gap: 9px; }
.rico { font-size: 32px; line-height: 1; white-space: nowrap; letter-spacing: -2px; flex: none; }

/* ---------- crests ---------- */
.crest { flex: none; vertical-align: middle; }
.who b .crest { align-self: center; }
.lb td .crest { margin-right: 6px; }
.crname { display: inline-flex; align-items: center; gap: 7px; }
.phead { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.phead h3 { margin: 0; }
.crlink { margin: 2px 0 0; padding: 0; font-size: 13px; }
.crbig { display: flex; justify-content: center; margin: 8px 0 4px; }
.crpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.crb { display: grid; place-items: center; min-height: 56px; padding: 6px 0; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); }
.crb.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 20%, var(--panel)); }
.fsw:disabled { opacity: .25; }
/* the deck in a game that began as a challenge: the challenger's crest pattern and colors, toned down a little */
.deckpile.cr { position: relative; overflow: hidden; background: #1c1b1a; color: var(--dk, #f1eada); }
.deckpile.cr .dkback { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .82; }
.deckpile.cr i { position: relative; display: flex; flex-direction: column; align-items: center; font-style: normal; font-weight: 800; paint-order: stroke fill; -webkit-text-stroke: 2.5px var(--do, #1c1b1a); }
.deckpile.cr b { font-size: 19px; font-weight: 900; -webkit-text-stroke-width: 3.5px; }

/* home screen: tournament button inside Your games, and the Add to home screen button */
.games .btn.xmasbtn { margin: 0 0 8px; padding: 13px; font-size: 15px; }
.install { max-width: 340px; margin: 6px auto 10px; }
.install .btn { margin-top: 0; padding: 11px; font-size: 14px; }
.install .link { display: block; margin: 6px auto 0; font-size: 13px; }
.sheet-panel ol.steps { text-align: left; padding-left: 22px; line-height: 1.5; }
.sheet-panel ol.steps li { margin: 0 0 8px; }
.lobby .toplinks .link { font-size: 14px; }
.lobby .toplinks { white-space: nowrap; }
/* update.js: shown when this copy of the game is older than the one on the site */
.updbar { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: 94vw; white-space: nowrap; padding: 9px 16px; border-radius: 999px;
  border: 1px solid #0006; background: #f2c94c; color: #1b1300; font: 800 13px/1.2 Inter, system-ui, sans-serif; box-shadow: 0 6px 18px #0008; cursor: pointer; }
/* invite link: the challenge sheet, and the Google button on it and on the sign-in sheet */
.invite { text-align: center; padding: 4px 0 8px; }
.invite .swords { font-size: 40px; line-height: 1; }
.invite h3 { font-family: 'UnifrakturCook', 'Cinzel', serif; font-size: 30px; line-height: 1.1; margin: 8px 0 6px; color: var(--gold); font-weight: 700; overflow-wrap: anywhere; }
.invite .olde { font-family: 'Cinzel', serif; font-weight: 700; font-size: 16px; line-height: 1.45; margin: 0; }
.btn.gbtn { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.glogo { width: 18px; height: 18px; flex: none; }
.or { display: flex; align-items: center; gap: 10px; margin: 12px 0 2px; color: var(--dim); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
/* chat lines in the log (last in the file so they beat the newest-line colour) */
.mid .logstrip div.say, .sheet-panel .logfull div.say, .recap .evline.say { color: var(--gold); font-weight: 600; overflow-wrap: anywhere; }

/* Nudge: the link under a game that is waiting on the other player */
.games .link.nudge, .games .nudged { display: block; margin: 2px 0 10px auto; font-size: 13px; text-align: right; }
.games .link.nudge { color: var(--gold); font-weight: 700; }
.nudged { margin: 8px 0 0; font-size: 13px; }
.welcome p { margin-top: 12px; line-height: 1.4; }
.welcome .btn { margin-top: 14px; }
.welcome .godspeed { margin-top: 18px; text-align: center; font-style: italic; opacity: .8; }
