/* ==========================================================================
   Joker Table — styles
   Performance: moving things animate transform/opacity only; no backdrop-filter,
   no animated filters/shadows; the background is static.
   ========================================================================== */

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }

:root {
  --cw: 64px; --ch: 90px; --jw: 56px; --jh: 78px;
  --blue: #1f8ef1;
  --red: #f2463f;
  --gold: #ffcf3d;
  --green: #2fae69;
  --orange: #ff9a2e;
  --purple: #7a4fd6;
  --panel: rgba(8, 18, 22, .42);
  --panel2: rgba(8, 18, 22, .3);
  --ink: #1e2b33;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  --blind: #3d7fd9;
  background: #10221f;
  color: #fff;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  font-variant-numeric: tabular-nums;
}
button { font-family: inherit; }

/* ------------------------------------------------------------ background */
#bg {
  position: fixed;
  inset: 0;
  background-color: color-mix(in srgb, var(--blind) 28%, #0e201d);
  background-image:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--blind) 45%, transparent), transparent 70%),
    radial-gradient(90% 60% at 100% 100%, rgba(255, 90, 70, .18), transparent 70%),
    radial-gradient(90% 60% at 0% 100%, rgba(40, 160, 140, .25), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 9px);
  transition: background-color .8s;
}
#bg .swirl { display: none; }

/* ---------------------------------------------------------------- app */
#app {
  position: fixed;
  inset: 0;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + 6px) 8px calc(var(--safe-b) + 6px);
}

/* HUD */
.blind-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 14px;
  background: var(--panel);
  border: 2px solid color-mix(in srgb, var(--blind) 70%, #fff 0%);
}
.bchip {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.45), transparent 45%), var(--bc, #3d7fd9);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 3px rgba(255,255,255,.12);
  cursor: pointer;
}
.bb-txt { min-width: 0; }
.bb-name { font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-target { font-size: 12px; opacity: .92; white-space: nowrap; }
.bb-target b { color: #ff6b62; font-size: 14px; }
.reward { color: var(--gold); letter-spacing: -1px; margin-left: 2px; }
.bb-score { margin-left: auto; text-align: right; line-height: 1.05; }
.bb-score span { display: block; font-size: 10px; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }
.bb-score b { display: inline-block; font-size: 23px; font-weight: 900; }

.hand-info {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 5px 6px 5px 10px;
  min-height: 42px;
  border-radius: 12px;
  background: var(--panel2);
}
.hi-name { min-width: 0; line-height: 1.05; }
.hi-name b { font-size: 16px; font-weight: 900; }
.hi-name small { margin-left: 6px; font-size: 11px; padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.9); color: #222; }
.hi-name small:empty { display: none; }
.hi-cm { display: flex; align-items: center; flex: none; }
.hi-cm i { font-style: normal; color: #ff6b62; font-weight: 900; margin: 0 4px; font-size: 18px; }
.cm {
  min-width: 58px;
  padding: 4px 10px;
  border-radius: 9px;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
}
.cm.chips { background: var(--blue); }
.cm.mult { background: var(--red); }
.hand-info::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  background: radial-gradient(80% 120% at 50% 100%, rgba(255,140,40,.75), rgba(255,60,40,.0) 70%);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.hand-info.fire::after { animation: flame .25s ease-in-out infinite alternate; }
@keyframes flame { from { opacity: .55; transform: scaleY(1); } to { opacity: 1; transform: scaleY(1.12); } }

.stats { display: flex; gap: 5px; margin-top: 6px; }
.stat {
  flex: 1;
  min-width: 0;
  background: var(--panel2);
  border-radius: 10px;
  padding: 3px 2px;
  text-align: center;
  display: flex; flex-direction: column; justify-content: center;
  line-height: 1.05;
}
.stat b { font-size: 17px; font-weight: 900; }
.stat span { font-size: 9.5px; opacity: .75; text-transform: uppercase; letter-spacing: .03em; }
.st-hands b { color: #5cb4ff; }
.st-discards b { color: #ff7a72; }
.st-money { flex: 1.2; }
.st-money b { color: var(--gold); font-size: 19px; }
.icon-btn {
  flex: none;
  width: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--panel);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}
.icon-btn:active { transform: translateY(1px); }

.top-row { display: flex; gap: 6px; margin-top: 6px; height: calc(var(--jh) + 14px); flex: none; }
.zone { position: relative; border-radius: 12px; background: rgba(0, 0, 0, .2); box-shadow: inset 0 2px 6px rgba(0,0,0,.25); }
.zone.jokers { flex: 2.45; }
.zone.conss { flex: 1; }
.zcount { position: absolute; right: 6px; bottom: 1px; font-size: 9.5px; opacity: .6; }

/* stage */
#stage { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; margin-top: 4px; }
#playZone { position: relative; flex: 1; min-height: calc(var(--ch) * 1.25); }
#handZone { flex: none; height: calc(var(--ch) + 30px); }
#controls { flex: none; height: 54px; display: flex; gap: 6px; align-items: center; }
#controls .btn { height: 46px; padding: 0 6px; }
#btnPlay { flex: 1.35; }
#btnDiscard { flex: 1; }
.sort { flex: 1.05; display: flex; flex-direction: column; align-items: stretch; gap: 2px; font-size: 9.5px; text-align: center; text-transform: uppercase; opacity: .9; }
.sort-btns { display: flex; gap: 3px; }
.btn.mini { flex: 1; height: 28px !important; font-size: 12px; background: #c67a1c; box-shadow: 0 3px 0 rgba(0,0,0,.3); border-radius: 8px; }
.btn.mini.on { background: var(--orange); }
#btnPackSkip { display: none; }
.deck-btn {
  flex: none;
  position: relative;
  width: 40px; height: 50px;
  border: 0; padding: 0;
  background: transparent;
  cursor: pointer;
}
.deck-stack {
  position: absolute; inset: 0 2px 4px 0;
  border-radius: 6px;
  border: 2px solid #fbf6ec;
  background: repeating-linear-gradient(45deg, #c8322c 0 4px, #9e2420 4px 8px);
  box-shadow: 2px 2px 0 #fbf6ec, 4px 4px 0 rgba(0,0,0,.3);
}
.deck-btn b {
  position: absolute; left: 50%; bottom: -2px;
  transform: translateX(-50%);
  font-size: 11px; background: rgba(0,0,0,.75);
  padding: 1px 5px; border-radius: 6px; color: #fff;
}
body:not(.phase-round) #btnPlay,
body:not(.phase-round) #btnDiscard,
body:not(.phase-round) .sort { visibility: hidden; }
.pack-hand #btnPlay, .pack-hand #btnDiscard, .pack-hand .sort { display: none; }
.pack-hand #btnPackSkip { display: block; flex: 1; background: var(--orange); }

.score-flash {
  position: fixed; left: 50%; top: 40%;
  width: min(520px, 92vw);
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 31;
}
.score-flash b { display: block; font-size: 30px; font-weight: 900; color: var(--gold); text-shadow: 0 3px 0 #9a5b00, 0 6px 14px rgba(0,0,0,.5); }
.score-flash small { display: block; font-size: 13px; margin-top: 2px; text-shadow: 0 2px 4px rgba(0,0,0,.8); }
.score-flash.show { animation: flash 2s ease-out forwards; }
@keyframes flash {
  0% { opacity: 0; transform: translateX(-50%) scale(.5); }
  12% { opacity: 1; transform: translateX(-50%) scale(1.12); }
  22% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* ------------------------------------------------------------ buttons */
.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .32);
  cursor: pointer;
  transition: transform .07s, filter .15s, box-shadow .07s;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .32); }
.btn:disabled, .btn.dis { filter: grayscale(.85) brightness(.65); cursor: default; }
.btn.big { font-size: 18px; padding: 14px; }
.btn.blue, .btn.play { background: var(--blue); }
.btn.red, .btn.discard { background: var(--red); }
.btn.green { background: var(--green); }
.btn.orange { background: var(--orange); }
.btn.gold { background: #f5b82e; color: #3a2600; text-shadow: none; }
.btn.ghost { background: rgba(255,255,255,.12); }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.danger { color: #ff9b94; }

/* ------------------------------------------------------------ the layer */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#layer > * {
  position: absolute; left: 0; top: 0;
  pointer-events: auto;
  touch-action: none;
  transition: transform .34s cubic-bezier(.2, .9, .28, 1.12), opacity .3s;
  will-change: transform;
}
#layer > .noanim, #layer > .drag { transition: none !important; }
#layer > .gone { opacity: 0; pointer-events: none; }
#layer > .drag .face, #layer > .drag .jin { box-shadow: 0 .6em 1.4em rgba(0,0,0,.5); }

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.pop {
  position: absolute;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
  color: #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,.3);
  will-change: transform, opacity;
}
.pop.big { font-size: 22px; padding: 3px 10px; }
.pop-chips { background: var(--blue); }
.pop-mult { background: var(--red); }
.pop-x { background: var(--red); outline: 2px solid #fff; }
.pop-money { background: var(--gold); color: #3a2600; }
.pop-plain { background: #fff; color: #222; }
.pop-level { background: #9b5de5; }

/* -------------------------------------------------------- playing cards */
.card {
  position: relative;
  width: calc(var(--cw) * var(--k, 1));
  height: calc(var(--ch) * var(--k, 1));
  font-size: calc(var(--cw) * var(--k, 1) * .2);
  perspective: 600px;
  cursor: pointer;
}
.card .pz, .joker .pz, .cons .pz, .voucher .pz, .pack .pz { width: 100%; height: 100%; }
.cin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .3s ease; }
.card.down .cin { transform: rotateY(180deg); }
.face, .back {
  position: absolute; inset: 0;
  border-radius: .55em;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.face {
  background: #fbf6ec;
  color: var(--sc);
  box-shadow: 0 .14em 0 rgba(0,0,0,.28), 0 .35em .8em rgba(0,0,0,.28);
}
.back {
  transform: rotateY(180deg);
  border: .22em solid #fbf6ec;
  background: repeating-linear-gradient(45deg, var(--dk) 0 .3em, color-mix(in srgb, var(--dk) 72%, #000) .3em .6em);
  box-shadow: 0 .14em 0 rgba(0,0,0,.28), 0 .35em .8em rgba(0,0,0,.28);
}
.deck-red { --dk: #c8322c; }
.deck-blue { --dk: #2f6fd1; }
.deck-yellow { --dk: #d89c0b; }
.deck-green { --dk: #2b9a5d; }
.deck-black { --dk: #34343f; }
.deck-abandoned { --dk: #6f7b8a; }
.deck-checkered { --dk: #c8322c; background: repeating-conic-gradient(#222 0 25%, #f2f2f2 0 50%) 0 0 / .9em .9em !important; }

.s-S { --sc: #34344f; }
.s-H { --sc: #e0393e; }
.s-C { --sc: #2c6db2; }
.s-D { --sc: #e98510; }

.crn {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  line-height: .92;
  font-weight: 900;
  z-index: 1;
}
.crn.tl { top: .22em; left: .26em; }
.crn.br { bottom: .22em; right: .26em; transform: rotate(180deg); }
.crn b { font-size: 1.15em; letter-spacing: -.04em; }
.crn i { font-style: normal; font-size: .85em; }
.pips { position: absolute; inset: 12% 21%; }
.pips i { position: absolute; font-style: normal; font-size: 1.05em; line-height: 1; transform: translate(-50%, -50%); }
.pips i.flip { transform: translate(-50%, -50%) rotate(180deg); }
.ace { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.9em; }
.court {
  position: absolute; inset: 15% 19%;
  border: .1em solid var(--sc);
  border-radius: .3em;
  background: color-mix(in srgb, var(--sc) 13%, #fff);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
.court .cg { font-size: 1.9em; }
.court .cl { font-size: 1.05em; font-weight: 900; }
.court .cs { font-size: .75em; }
.eb {
  position: absolute; left: 50%; bottom: .2em;
  transform: translateX(-50%);
  padding: 0 .3em;
  border-radius: .35em;
  font-size: .62em; font-weight: 900;
  background: rgba(0,0,0,.62); color: #fff;
  z-index: 2;
}
.enh-bonus .face { background: #d8eaff; }
.enh-mult .face { background: #ffd9d4; }
.enh-wild .face { background: linear-gradient(135deg, #ffd9d9, #fff3c2, #d4ffd6, #d6e8ff, #f1d8ff); }
.enh-glass .face { background: linear-gradient(135deg, rgba(235, 248, 255, .9), rgba(170, 210, 255, .55)); }
.enh-steel .face { background: linear-gradient(135deg, #eef1f5, #a9b3bf 55%, #e1e6ec); }
.enh-gold .face { background: linear-gradient(135deg, #fff2b5, #f0bd45 58%, #ffe48a); }
.enh-lucky .face { background: #dbf6d6; }
.enh-stone .face { background: radial-gradient(circle at 30% 25%, #b0b0ad, #6c6c69 70%); color: #fff; }
.stone-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; text-shadow: 0 .08em 0 rgba(0,0,0,.4); }
.stone-mid span { font-size: .75em; letter-spacing: .1em; opacity: .9; }
.stone-mid b { font-size: 1.2em; color: #a6d6ff; }
.seal {
  position: absolute; left: .18em; top: 50%;
  width: .78em; height: .78em;
  border-radius: 50%;
  transform: translateY(-50%);
  border: .08em solid rgba(0,0,0,.3);
  box-shadow: inset 0 -.1em 0 rgba(0,0,0,.25);
  z-index: 2;
}
.seal-gold { background: #f5c542; }
.seal-red { background: #e5383b; }
.seal-blue { background: #3d7be0; }
.seal-purple { background: #9b5de5; }
.edo { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.ed-foil .edo { background: linear-gradient(115deg, transparent 22%, rgba(140, 200, 255, .55) 42%, rgba(255,255,255,.75) 50%, rgba(140, 200, 255, .55) 58%, transparent 78%); }
.ed-holo .edo { background: repeating-linear-gradient(135deg, rgba(255, 80, 140, .26) 0 .45em, rgba(255, 210, 235, .12) .45em .9em); }
.ed-poly .edo { background: linear-gradient(135deg, rgba(255,0,60,.22), rgba(255,200,0,.22), rgba(0,230,120,.22), rgba(0,150,255,.22), rgba(190,0,255,.22)); }
.ed-neg .jin { filter: invert(.88) hue-rotate(180deg); }
.dbx { display: none; }
.debuff .dbx {
  display: block;
  position: absolute; inset: 0;
  z-index: 4;
  background:
    linear-gradient(45deg, transparent 46%, rgba(229, 56, 59, .9) 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(229, 56, 59, .9) 46% 54%, transparent 54%),
    rgba(40, 40, 40, .45);
}
.card.sel .face { box-shadow: 0 0 0 .14em #fff, 0 .5em 1em rgba(0,0,0,.4); }
.card.shatter .face { background: linear-gradient(135deg, rgba(220,240,255,.6), rgba(160,200,255,.2)); }

/* --------------------------------------------- jokers & other square cards */
.joker, .cons, .voucher, .pack {
  position: relative;
  width: calc(var(--jw) * var(--k, 1));
  height: calc(var(--jh) * var(--k, 1));
  font-size: calc(var(--jw) * var(--k, 1) * .2);
  cursor: pointer;
}
.jin {
  position: absolute; inset: 0;
  border-radius: .5em;
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 .14em 0 rgba(0,0,0,.3), 0 .35em .8em rgba(0,0,0,.3);
}
.jemo { font-size: 2.3em; line-height: 1; margin-top: -.25em; }
.jname {
  position: absolute; left: .2em; right: .2em; bottom: .28em;
  font-size: .56em; font-weight: 900;
  line-height: 1.05;
  text-align: center;
  color: #23232b;
}
.tiny #layer .jname { display: none; }
.tiny #layer .jemo { margin-top: 0; }
.joker .jin {
  background: linear-gradient(160deg, hsl(var(--h) 75% 91%), hsl(var(--h) 55% 72%));
  border: .17em solid var(--rc);
}
.joker.r1 { --rc: #2d9bf0; }
.joker.r2 { --rc: #38b27a; }
.joker.r3 { --rc: #e9433f; }
.joker.off .jin { filter: grayscale(1) brightness(.55); }

.cons.tarot .jin { background: linear-gradient(160deg, #a983f2, #5a33ad); border: .17em solid #f3d36b; }
.cons.tarot .jname { color: #fff; }
.tnum { position: absolute; top: .25em; font-size: .62em; font-weight: 900; color: #f3d36b; }
.cons.planet .jin { background: radial-gradient(circle at 50% 120%, #2d43a0, #0c1331 70%); border: .17em solid #86b6ff; }
.cons.planet .jname { color: #fff; }
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 22%, #fff, transparent), radial-gradient(1px 1px at 78% 18%, #fff, transparent),
    radial-gradient(1px 1px at 62% 72%, #fff, transparent), radial-gradient(1.5px 1.5px at 28% 66%, #cfe1ff, transparent),
    radial-gradient(1px 1px at 86% 52%, #fff, transparent);
}
.orb {
  position: relative;
  width: 1.95em; height: 1.95em;
  margin-top: -.3em;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--a), var(--b) 72%);
  box-shadow: 0 0 .5em color-mix(in srgb, var(--a) 55%, transparent);
}
.orb.ring::after {
  content: "";
  position: absolute; left: -.45em; right: -.45em; top: 42%;
  height: .5em;
  border-radius: 50%;
  border: .12em solid color-mix(in srgb, var(--a) 80%, #fff);
  transform: rotate(-14deg);
}
.voucher .jin { background: linear-gradient(160deg, #ffe7a0, #d99a1c); border: .17em dashed rgba(255,255,255,.7); }
.voucher .jname { color: #3a2600; }
.pack .jin { background: linear-gradient(165deg, color-mix(in srgb, var(--pc) 55%, #fff), var(--pc) 70%); border: .17em solid rgba(255,255,255,.55); }
.pack .jname { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.pack-jumbo .jin::before, .pack-mega .jin::before {
  content: "+";
  position: absolute; top: .15em; right: .3em;
  font-size: .8em; font-weight: 900;
}
.pack-mega .jin::before { content: "++"; }

/* ------------------------------------------------------------ panels */
.panel {
  position: absolute; inset: 0;
  z-index: 5;
  display: flex; flex-direction: column;
  opacity: 0;
  transform: translateY(26px);
  transition: transform .36s cubic-bezier(.2, .9, .3, 1.12), opacity .25s;
}
.panel.open { opacity: 1; transform: none; }
.pack-hand #packPanel { bottom: calc(var(--ch) + 30px + 54px); }

/* blind select */
.blinds { display: flex; gap: 6px; height: 100%; align-items: stretch; padding-top: 6px; }
.blind-col {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  padding: 0 5px 8px;
  border-radius: 14px;
  border: 2px solid var(--bc);
  background: var(--panel);
  text-align: center;
  overflow: hidden;
  transition: transform .3s;
}
.blind-col.st-next { box-shadow: 0 0 0 3px rgba(255,255,255,.15), 0 10px 24px rgba(0,0,0,.35); transform: translateY(-4px); }
.blind-col.st-up, .blind-col.st-done, .blind-col.st-skipped { opacity: .55; }
.bc-head { width: calc(100% + 10px); padding: 5px 2px; background: var(--bc); font-size: 12px; font-weight: 900; }
.bc-chip span {
  display: grid; place-items: center;
  width: 46px; height: 46px; margin: 4px auto 0;
  border-radius: 50%;
  font-size: 22px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.5), transparent 45%), var(--bc);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 3px rgba(255,255,255,.14);
}
.bc-name { font-size: 13px; font-weight: 900; }
.bc-desc { font-size: 11px; line-height: 1.2; opacity: .9; }
.bc-min { font-size: 10px; opacity: .75; margin-top: auto; }
.bc-target { font-size: 18px; font-weight: 900; color: #ff6b62; line-height: 1; }
.bc-reward { font-size: 11px; }
.bc-reward b { color: var(--gold); letter-spacing: -1px; }
.bc-state { font-size: 12px; opacity: .85; padding: 6px 0; }
.blind-col .btn { width: 100%; padding: 10px 2px; font-size: 14px; }
.bc-or { font-size: 10px; opacity: .7; }
.bc-skip { font-size: 12px !important; display: flex; align-items: center; justify-content: center; gap: 2px; }
.bc-tag { margin-top: 2px; }
.tagi {
  display: inline-grid; place-items: center;
  width: 1.75em; height: 1.75em;
  border-radius: 50%;
  font-style: normal;
  background: var(--tc);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.25);
  cursor: pointer;
}
.tagi.big { width: 64px; height: 64px; font-size: 30px; }
.tag-art { padding: 6px; }

/* cash out */
.cash-box {
  margin: auto;
  width: 100%; max-width: 400px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 2px solid var(--gold);
}
.cash-box h2 { margin: 0 0 10px; text-align: center; font-size: 22px; color: var(--gold); text-shadow: 0 3px 0 #9a5b00; }
.cash-line {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px dashed rgba(255,255,255,.15);
  font-size: 14px;
  animation: lineIn .3s ease-out;
}
.cash-line b { color: var(--gold); letter-spacing: -1px; white-space: nowrap; }
.cash-line.first { font-size: 15px; }
@keyframes lineIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.cash-btn { width: 100%; margin-top: 14px; }

/* shop */
.shop {
  display: flex; flex-direction: column;
  height: 100%;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: var(--panel);
  border: 2px solid var(--purple);
}
.shop-top { display: flex; gap: 8px; }
.shop-next { flex: 1.5; }
.shop-reroll { flex: 1; }
.shop-items {
  flex: 1;
  display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap;
  padding: 8px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  min-height: calc(var(--jh) * 1.3 + 30px);
}
.shop-items .empty { opacity: .6; }
.slot { --k: 1.28; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.slot > .joker, .slot > .cons, .slot > .voucher, .slot > .pack, .slot > .card { transition: transform .15s; }
.slot:active > :first-child { transform: scale(.95); }
.price { padding: 2px 9px; border-radius: 8px; background: var(--gold); color: #3a2600; font-weight: 900; font-size: 13px; box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.shop-bottom { display: flex; gap: 8px; }
.shop-v, .shop-p { padding: 6px; border-radius: 12px; background: rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.shop-v { flex: 1; }
.shop-p { flex: 2.1; }
.shop-v .slot, .shop-p .slot { --k: 1.05; }
.prow { display: flex; gap: 10px; justify-content: center; }
.shop-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }
.empty-slot { width: calc(var(--jw) * 1.05); height: calc(var(--jh) * 1.05); border-radius: 10px; border: 2px dashed rgba(255,255,255,.2); display: grid; place-items: center; opacity: .5; }

/* packs */
.pack-box {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: radial-gradient(80% 80% at 50% 40%, color-mix(in srgb, var(--pc) 40%, transparent), transparent 75%), var(--panel);
  border: 2px solid var(--pc);
}
.pack-title { text-align: center; }
.pack-title b { display: block; font-size: 18px; }
.pack-title span { font-size: 13px; opacity: .85; }
.pack-choices { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; perspective: 800px; }
.pack-choices .slot { --k: 1.12; }
.pack-choices .slot.taken { visibility: hidden; }
.pack-skip { min-width: 140px; }

/* ------------------------------------------------------------ sheet */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-box {
  position: absolute; left: 50%; bottom: 0;
  width: min(560px, 100%);
  max-height: 80%;
  overflow: auto;
  padding: 14px 14px calc(14px + var(--safe-b));
  border-radius: 20px 20px 0 0;
  background: var(--ink);
  box-shadow: 0 -8px 30px rgba(0,0,0,.45);
  transform: translate(-50%, 100%);
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.08);
}
.sheet.open .sheet-box { transform: translate(-50%, 0); }
.sh-head { display: flex; gap: 14px; align-items: flex-start; }
.sh-art { flex: none; --k: 1.45; }
.sh-art > * { position: relative; }
.sh-txt { flex: 1; min-width: 0; }
.sh-title { font-size: 20px; font-weight: 900; }
.chip { display: inline-block; margin: 4px 4px 0 0; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 900; background: var(--cc); }
.sh-body { margin-top: 8px; padding: 9px 11px; border-radius: 11px; background: #fff; color: #222; font-size: 15px; line-height: 1.35; font-weight: 700; }
.sh-body:empty { display: none; }
.sub { margin-top: 6px; font-size: 13px; color: #555; }
.sub.warn { color: #d0302c; font-weight: 900; }
.sh-foot { margin-top: 6px; font-size: 12px; opacity: .8; }
.sh-actions { display: flex; gap: 8px; margin-top: 14px; }
.sh-actions .btn { flex: 1; }
.card.solo { --k: 1.45; }

/* rich text */
.tc { color: #1679d6; font-weight: 900; }
.tm { color: #e2332c; font-weight: 900; }
.tx { background: var(--red); color: #fff; padding: 0 .25em; border-radius: .25em; font-weight: 900; }
.tmo { color: #c98d00; font-weight: 900; }
.tg { color: #8a8a8a; font-weight: 700; }
.tk { color: #6c3fd1; font-weight: 900; }

/* ------------------------------------------------------------ modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.modal-box {
  position: relative;
  width: min(430px, calc(100% - 28px));
  max-height: calc(100% - 40px);
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: var(--ink);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  transform: scale(.9);
  opacity: 0;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.2), opacity .2s;
}
.modal.open .modal-box { transform: none; opacity: 1; }
.modal-box h2 { margin: 0 0 10px; font-size: 20px; }
.modal-box h3 { margin: 14px 0 6px; font-size: 14px; opacity: .8; }
.muted { opacity: .65; font-size: 13px; }
.hands { display: flex; flex-direction: column; gap: 4px; }
.hrow { display: grid; grid-template-columns: 46px 1fr auto 34px; gap: 6px; align-items: center; padding: 5px 6px; border-radius: 9px; background: rgba(255,255,255,.06); font-size: 13px; }
.hl { padding: 1px 0; border-radius: 6px; background: #fff; color: #222; text-align: center; font-size: 11px; font-weight: 900; }
.hv b { display: inline-block; min-width: 30px; padding: 1px 5px; border-radius: 5px; color: #fff !important; text-align: center; }
.hv b.tc { background: var(--blue); }
.hv b.tm { background: var(--red); }
.hp { font-size: 11px; opacity: .7; text-align: right; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.1); font-size: 12px; }
.deckgrid { margin-top: 6px; }
.drow { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin: 5px 0; }
.drow > i { width: 18px; font-style: normal; color: var(--sc, #fff); font-size: 16px; }
.mc { min-width: 22px; padding: 3px 1px; border-radius: 4px; background: #fbf6ec; color: var(--sc, #333); font-size: 12px; font-weight: 900; text-align: center; }
.mc.used { opacity: .28; }
.mc.e-bonus { background: #cfe4ff; } .mc.e-mult { background: #ffd2cc; } .mc.e-wild { background: linear-gradient(135deg, #ffd9d9, #d4ffd6, #d6e8ff); }
.mc.e-glass { background: #e2f2ff; } .mc.e-steel { background: #b8c1cc; } .mc.e-gold { background: #f3c552; } .mc.e-lucky { background: #cdf3c6; } .mc.e-stone { background: #8b8b88; color: #fff; }
.mc.sl { box-shadow: inset 0 -3px 0 #9b5de5; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0; }
.seg { display: flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.08); }
.seg button { border: 0; padding: 7px 11px; border-radius: 8px; background: transparent; color: #fff; font-weight: 900; cursor: pointer; }
.seg button.on { background: var(--blue); }
.how p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; font-weight: 600; }
.how .tc { color: #5cb4ff; } .how .tm { color: #ff7a72; }
.ov-title { margin: 4px 0 2px !important; text-align: center; font-size: 32px !important; }
.ov-title.lose { color: #ff6b62; }
.ov-title.win { color: var(--gold); text-shadow: 0 3px 0 #9a5b00; }
.ov-sub { margin: 0 0 12px; text-align: center; opacity: .85; font-size: 14px; }
.ov-confetti { text-align: center; font-size: 30px; animation: bob 1.2s ease-in-out infinite alternate; }
.ov-stats { display: flex; gap: 6px; }
.ov-stats > div { flex: 1; padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.07); text-align: center; display: flex; flex-direction: column; gap: 2px; }
.ov-stats span { font-size: 10px; opacity: .7; text-transform: uppercase; }
.ov-stats b { font-size: 18px; }
.ov-stats small { font-size: 11px; opacity: .75; }
.ov-btns { display: flex; gap: 8px; margin-top: 16px; }
.ov-btns .btn { flex: 1; }

/* ------------------------------------------------------------ menu */
.menu {
  position: fixed; inset: 0;
  z-index: 45;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 20px);
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(242, 70, 63, .35), transparent 70%),
    radial-gradient(90% 60% at 50% 100%, rgba(31, 142, 241, .3), transparent 70%),
    #10221f;
}
.menu .home { position: absolute; left: 14px; top: calc(var(--safe-t) + 12px); color: #fff; opacity: .75; text-decoration: none; font-size: 14px; }
.menu-inner { width: min(420px, 100%); text-align: center; }
.logo-cards { display: flex; justify-content: center; margin-bottom: 4px; height: 70px; }
.logo-cards i {
  display: grid; place-items: center;
  width: 44px; height: 62px;
  margin: 0 -6px;
  border-radius: 7px;
  background: #fbf6ec;
  color: #e0393e;
  font-style: normal; font-size: 24px;
  box-shadow: 0 3px 0 rgba(0,0,0,.3), 0 6px 14px rgba(0,0,0,.35);
  animation: bob 2.4s ease-in-out infinite alternate;
}
.logo-cards i:nth-child(1) { transform: rotate(-20deg) translateY(10px); animation-delay: -.4s; }
.logo-cards i:nth-child(2) { transform: rotate(-10deg) translateY(3px); color: #34344f; animation-delay: -.8s; }
.logo-cards i:nth-child(3) { animation-delay: -1.2s; }
.logo-cards i:nth-child(4) { transform: rotate(10deg) translateY(3px); animation-delay: -1.6s; }
.logo-cards i:nth-child(5) { transform: rotate(20deg) translateY(10px); color: #e98510; animation-delay: -2s; }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -6px; } }
.logo {
  margin: 4px 0 6px;
  font-size: clamp(38px, 11vw, 58px);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 0 #b3261e, 0 8px 20px rgba(0,0,0,.5);
  transform: rotate(-2deg);
}
.tagline { margin: 0 0 22px; opacity: .8; font-size: 14px; }
.menu-btns { display: flex; flex-direction: column; gap: 10px; }
.menu-row { display: flex; gap: 8px; }
.menu-row .btn { flex: 1; }
.menu-best { min-height: 1em; font-size: 12px; opacity: .65; }
.deck-pick h2 { margin: 0 0 10px; }
.deck-list { display: flex; flex-direction: column; gap: 7px; max-height: 52vh; overflow: auto; margin-bottom: 12px; padding: 2px; }
.deck-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.deck-opt.on { border-color: var(--gold); background: rgba(255, 207, 61, .12); }
.mini-back {
  flex: none;
  width: 32px; height: 45px;
  border-radius: 5px;
  border: 2px solid #fbf6ec;
  background: repeating-linear-gradient(45deg, var(--dk) 0 4px, color-mix(in srgb, var(--dk) 72%, #000) 4px 8px);
}
.mini-back.deck-checkered { background: repeating-conic-gradient(#222 0 25%, #f2f2f2 0 50%) 0 0 / 10px 10px; }
.do-txt { display: flex; flex-direction: column; gap: 2px; }
.do-txt b { font-size: 15px; }
.do-txt small { font-size: 12px; opacity: .85; font-weight: 600; }
.deck-opt .tk { color: #c9a6ff; } .deck-opt .tmo { color: var(--gold); }

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; top: 42%;
  z-index: 60;
  max-width: 86%;
  padding: 9px 15px;
  border-radius: 12px;
  background: rgba(10, 10, 12, .88);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%); }

/* ------------------------------------------------------------ desktop */
@media (min-width: 700px) {
  #app { padding-top: 14px; padding-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-cards i, .ov-confetti { animation: none; }
}
