/* 섯다. A night table: ink-navy room, deep green lacquer felt, cream hwatu with red lacquer backs,
   gold for chips and wins. Pixel type (Silkscreen / Galmuri) for numbers and titles, clean type for
   reading. One fixed screen for a phone held upright; wide screens get an oval table. */
:root {
  --bg: #0a0d14; --surface: #11161f; --raised: #182030; --edge: rgba(255,255,255,.12); --edge2: rgba(255,255,255,.22);
  --ink: #f3f6fb; --ink-soft: #a0aabb; --faint: #687387;
  --gold: #ffb547; --gold-ink: #241500; --danger: #ff5a4d; --turn: #5fd4e6; --rare: #c58bff; --good: #5fd88f;
  --felt: #12402f; --felt2: #0a2219; --lacquer: #b3261e; --cream: #f6e9c9;
  --pixel: 'Silkscreen', 'Galmuri11', monospace;
  --ui: 'Inter', 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', system-ui, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.56,.64,1);
  --bw: clamp(82px, 23vw, 128px);   /* your cards */
  --mw: clamp(22px, 6.4vw, 40px);   /* opponents' cards */
  color-scheme: dark;
}
html:lang(ko) { --pixel: 'Galmuri11', 'Silkscreen', monospace; }
@media (min-width: 900px) and (min-height: 700px) { :root { --bw: 132px; --mw: 46px; } }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; }
body { background: var(--bg); color: var(--ink); overflow: hidden; font: 500 16px/1.35 var(--ui);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255,181,71,.07), transparent 60%), radial-gradient(90% 60% at 50% 100%, rgba(95,212,230,.05), transparent 70%); }
#app { position: relative; z-index: 1; height: 100vh; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--turn); outline-offset: 2px; }
a { color: var(--gold); }
h2 { font: 700 26px/1.1 var(--pixel); margin: 0; letter-spacing: .01em; text-wrap: balance; }
h3 { font: 700 12px/1 var(--pixel); letter-spacing: .08em; color: var(--ink-soft); margin: 10px 0 0; text-transform: uppercase; }
p { margin: 0; }
.k { font: 700 11px/1 var(--pixel); letter-spacing: .08em; color: var(--ink-soft); text-transform: uppercase; }
.soft { color: var(--ink-soft); } .small { font-size: 14px; } .center { text-align: center; }
.mono { font: 12px/1.4 ui-monospace, Menlo, monospace; word-break: break-all; color: var(--ink-soft); user-select: text; }
.ok { color: var(--good); font-weight: 700; }
.err { color: #ffc2bb; background: rgba(255,90,77,.12); border-left: 3px solid var(--danger); padding: 8px 10px; }

/* pixel buttons: a hard inset bevel, sinking on press */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 10px 16px 9px;
  background: var(--raised); border: 0; border-radius: 0; font: 700 15px/1 var(--pixel); letter-spacing: .03em; text-transform: uppercase;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.08), 0 0 0 2px #05070b; transition: transform 60ms; }
.btn.primary { background: var(--gold); color: var(--gold-ink); box-shadow: inset -3px -3px 0 rgba(0,0,0,.22), inset 3px 3px 0 rgba(255,255,255,.35), 0 0 0 2px #05070b, 0 4px 0 #8a5a14; }
.btn.quiet { background: none; box-shadow: none; color: var(--ink-soft); min-height: 44px; font-size: 13px; }
.btn.small { width: auto; min-height: 38px; font-size: 12px; padding: 6px 12px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn:not(:disabled):active { transform: translateY(3px); }
.btn.primary:not(:disabled):active { box-shadow: inset -3px -3px 0 rgba(0,0,0,.22), inset 3px 3px 0 rgba(255,255,255,.35), 0 0 0 2px #05070b, 0 1px 0 #8a5a14; }
.field { width: 100%; height: 52px; padding: 0 14px; background: var(--surface); border: 2px solid var(--edge2); border-radius: 0; font-size: 19px; font-weight: 600; user-select: text; -webkit-user-select: text; }
.field.code { font-family: var(--pixel); letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.lang { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px; background: none; border: 2px solid var(--edge2); color: var(--ink-soft); font: 700 11px/1 var(--pixel); padding: 7px 9px 6px; z-index: 5; }

/* --- screens around the table --- */
.page { position: relative; height: 100%; max-width: 460px; margin: 0 auto; padding: 24px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.page.middle { justify-content: center; }
.page section { display: flex; flex-direction: column; gap: 8px; }
.lead { font-size: 17px; color: var(--ink-soft); text-wrap: pretty; }
.lead b { color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.joinrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.joinrow .btn { width: auto; min-width: 96px; }
.small-q { min-height: 36px; }
.sticky { position: sticky; bottom: 0; padding-top: 10px; background: linear-gradient(transparent, var(--bg) 30%); display: flex; flex-direction: column; gap: 8px; margin-top: auto; }

.logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 8px; }
.logo h1 { font: 400 clamp(76px, 25vw, 112px)/1 'Galmuri11', var(--pixel); margin: -6px 0 0; letter-spacing: .02em; color: var(--ink);
  text-shadow: 4px 4px 0 var(--lacquer), 8px 8px 0 #05070b; }
.logo-sub { font: 700 12px/1 var(--pixel); letter-spacing: .5em; color: var(--gold); margin-top: 10px; padding-left: .5em; }
.logo-cards { position: relative; width: 120px; height: 84px; }
.lc { position: absolute; left: 50%; top: 4px; width: 50px; height: 72px; background: var(--cream); border: 2px solid #05070b; box-shadow: 3px 3px 0 #05070b; }
.lc.a { transform: translateX(-90%) rotate(-12deg); background: var(--lacquer) repeating-linear-gradient(45deg, rgba(0,0,0,.18) 0 4px, transparent 4px 8px); animation: lc-a 3.2s steps(4) infinite; }
.lc.b { transform: translateX(-10%) rotate(10deg); background: var(--cream); }
.lc.b::after { content: '光'; position: absolute; inset: 10px; display: grid; place-items: center; background: #e2493b; color: var(--cream); font: 700 20px/1 serif; border-radius: 50%; }
@keyframes lc-a { 50% { transform: translateX(-92%) translateY(-3px) rotate(-14deg); } }

.rules { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-soft); }
.rules li::marker { font-family: var(--pixel); color: var(--gold); }

/* lobby */
.l-head { display: flex; justify-content: space-between; align-items: flex-end; padding-right: 54px; }
.roomcode { font: 700 40px/1 var(--pixel); letter-spacing: .14em; color: var(--gold); }
.l-btns { display: flex; gap: 6px; }
.l-seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.l-seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px; background: var(--surface); border: 2px solid var(--edge); }
.l-seat.off { opacity: .45; }
.l-seat.add { justify-content: center; color: var(--gold); font: 700 13px/1 var(--pixel); border-style: dashed; min-height: 104px; background: none; }
.l-seat b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-seat .tag { font-size: 11px; color: var(--ink-soft); }
.x-btn { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; background: none; border: 0; color: var(--ink-soft); font-size: 18px; }
.av { width: 42px; height: 42px; display: grid; place-items: center; font: 700 18px/1 var(--pixel); color: #05070b; background: var(--c, var(--turn)); box-shadow: inset -3px -3px 0 rgba(0,0,0,.25), inset 3px 3px 0 rgba(255,255,255,.3); position: relative; }
.c0 { --c: #ffb547; } .c1 { --c: #5fd4e6; } .c2 { --c: #ff7aa8; } .c3 { --c: #9be37a; } .c4 { --c: #c58bff; } .c5 { --c: #ff8a5b; }
.rules-grid { display: flex; flex-direction: column; gap: 8px; }
.rg { display: flex; flex-direction: column; gap: 5px; }
.rg > span { font-size: 13px; color: var(--ink-soft); }
.seg { display: flex; gap: 0; border: 2px solid var(--edge2); }
.seg button { flex: 1; min-height: 38px; background: none; border: 0; border-right: 2px solid var(--edge); font-size: 13px; font-weight: 600; color: var(--ink-soft); padding: 4px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--gold); color: var(--gold-ink); }
.seg button:disabled { cursor: default; }
.seg button:disabled:not(.on) { opacity: .5; }

/* --- cards --- */
.card { position: relative; width: var(--w, var(--bw)); aspect-ratio: 16 / 24; flex: none; background: var(--cream); border: 2px solid #05070b;
  box-shadow: 3px 3px 0 rgba(0,0,0,.55), inset 0 0 0 2px #fffaf0; padding: 3px; image-rendering: pixelated; }
.card .art { width: 100%; height: 100%; overflow: hidden; }
.card .art svg { display: block; width: 100%; height: 100%; }
.card .cn { position: absolute; top: -2px; left: -2px; min-width: 32%; padding: 3px 4px 2px; background: #05070b; color: var(--cream); font: 700 calc(var(--w, var(--bw)) * .2)/1 var(--pixel); text-align: center; }
.card .ck { position: absolute; bottom: -2px; right: -2px; padding: 3px 5px 2px; background: #05070b; color: var(--cream); font: 700 calc(var(--w, var(--bw)) * .11)/1 var(--ui); }
.card.k-gwang .ck { background: var(--lacquer); }
.card.k-gwang { box-shadow: 3px 3px 0 rgba(0,0,0,.55), inset 0 0 0 2px #ffd88a, 0 0 18px rgba(255,181,71,.35); }
.card.back { background: var(--lacquer); padding: 0; }
.card.back i { position: absolute; inset: 4px; border: 2px solid rgba(255,214,140,.45);
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.2) 0 3px, transparent 3px 7px), repeating-linear-gradient(-45deg, rgba(255,214,140,.12) 0 3px, transparent 3px 7px); }
.card.mini { --w: var(--mw); border-width: 1px; padding: 1px; box-shadow: 2px 2px 0 rgba(0,0,0,.55); }
.card.mini .cn { font-size: calc(var(--mw) * .3); padding: 1px 2px; }
.card.mini .ck { display: none; }
.card.mini.back i { inset: 2px; border-width: 1px; }
.deal-in { animation: deal-in .42s var(--spring) both; }
@keyframes deal-in { from { transform: translate(0, -60px) rotate(-14deg) scale(.6); opacity: 0; } }
.flip-in { animation: flip-in .5s var(--ease) both; }
@keyframes flip-in { from { transform: rotateY(90deg); } }

/* --- the table --- */
.table { height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; max-width: 1100px; margin: 0 auto; }
.t-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.t-room { display: flex; flex-direction: column; gap: 2px; }
.t-room b { font: 700 16px/1 var(--pixel); letter-spacing: .12em; color: var(--gold); }
.t-round { flex: 1; text-align: center; font: 700 12px/1 var(--pixel); color: var(--ink-soft); }
.t-round em { color: var(--rare); font-style: normal; }
.t-tools { display: flex; gap: 6px; }
.icon-btn, .lock { min-width: 38px; height: 34px; padding: 0 8px; background: var(--surface); border: 2px solid var(--edge2); color: var(--ink); font: 700 12px/1 var(--pixel); }
.lock { display: flex; align-items: center; gap: 5px; color: var(--good); font: 11px/1 ui-monospace, Menlo, monospace; }
.lock .pad { width: 9px; height: 8px; background: var(--good); position: relative; margin-top: 3px; }
.lock .pad::before { content: ''; position: absolute; left: 1px; top: -5px; width: 5px; height: 5px; border: 2px solid var(--good); border-bottom: 0; }
@media (max-width: 400px) { .lock { display: none; } }

.felt { position: relative; margin: 4px 10px; border: 3px solid #05070b; box-shadow: 0 0 0 3px #3b2a18, 0 0 0 6px #05070b, inset 0 0 60px rgba(0,0,0,.55);
  background: radial-gradient(70% 60% at 50% 55%, var(--felt), var(--felt2)); border-radius: 46% / 40%; min-height: 220px; }
.felt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .18;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px); }
.seats { position: absolute; inset: 0; }
.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; z-index: 2; transition: opacity .3s; }
.seat .av { width: 38px; height: 38px; font-size: 15px; }
.seat:nth-child(1) { --c: #5fd4e6; } .seat:nth-child(2) { --c: #ff7aa8; } .seat:nth-child(3) { --c: #9be37a; } .seat:nth-child(4) { --c: #c58bff; } .seat:nth-child(5) { --c: #ff8a5b; }
.seat .s-name { font-size: 12px; font-weight: 700; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 0 #000; }
.seat .s-chips { font: 700 11px/1 var(--pixel); color: var(--gold); }
.seat .s-cards { display: flex; gap: 2px; min-height: calc(var(--mw) * 1.5); margin-top: 2px; }
.seat .s-hand { font-size: 11px; font-weight: 800; padding: 2px 5px; background: rgba(5,7,11,.8); border: 1px solid var(--edge2); white-space: nowrap; }
.seat .s-hand.win { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.seat.folded { opacity: .45; } .seat.out { opacity: .3; }
.seat.turn .av { box-shadow: 0 0 0 3px var(--turn), 0 0 16px var(--turn); }
.seat .ring { position: absolute; top: -6px; left: 50%; width: 50px; height: 50px; transform: translateX(-50%) rotate(-90deg); pointer-events: none; z-index: 1; }
.seat .ring circle { fill: none; stroke: var(--turn); stroke-width: 3; stroke-dasharray: 113; stroke-dashoffset: 0; }
.seat.won .av { animation: bob .5s steps(2) 4; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.dealer { position: absolute; top: -8px; right: -12px; font: 700 10px/1 'Galmuri11', var(--pixel); padding: 3px 4px 2px; background: var(--gold); color: var(--gold-ink); box-shadow: 1px 1px 0 #05070b; }
.tag { font: 700 10px/1 var(--pixel); padding: 3px 5px 2px; background: rgba(255,255,255,.12); color: var(--ink-soft); }
.tag.hot { background: var(--danger); color: #fff; }
.said { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font: 700 11px/1 'Galmuri11', var(--pixel); padding: 4px 6px 3px; background: var(--ink); color: #05070b; white-space: nowrap; animation: said .3s var(--spring); }
.said::after { content: ''; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.said.s-die { background: #6b7385; color: #fff; } .said.s-die::after { border-top-color: #6b7385; }
.said.s-half, .said.s-ddadang { background: var(--gold); } .said.s-half::after, .said.s-ddadang::after { border-top-color: var(--gold); }
.said.s-allin { background: var(--danger); color: #fff; } .said.s-allin::after { border-top-color: var(--danger); }
@keyframes said { from { transform: translateX(-50%) scale(.4); } }
.won-n { font: 700 13px/1 var(--pixel); color: var(--gold); text-shadow: 2px 2px 0 #05070b; animation: rise 1.4s var(--ease) both; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

.center { position: absolute; left: 50%; top: 64%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: 90%; }
.pot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 18px 7px; background: rgba(5,7,11,.55); border: 2px solid rgba(255,181,71,.35); }
.pot-n { font: 700 clamp(22px, 7vw, 32px)/1 var(--pixel); color: var(--gold); text-shadow: 3px 3px 0 #05070b; }
.tocall { font-size: 11px; color: var(--ink-soft); }
.banner { position: absolute; top: -10px; left: 50%; translate: -50% -100%; width: max-content; max-width: min(92vw, 560px); text-wrap: balance; pointer-events: none; opacity: 0;
  font: 700 clamp(16px, 5vw, 24px)/1.15 'Galmuri11', var(--pixel); text-align: center; padding: 10px 16px 8px; background: #05070b; color: var(--ink);
  border: 2px solid var(--edge2); box-shadow: 4px 4px 0 rgba(0,0,0,.5); z-index: 5; }
.banner small { display: block; font-size: .62em; color: var(--gold); margin-bottom: 4px; }
.banner.round { color: var(--gold); }
.banner.ttaeng { border-color: var(--turn); box-shadow: 0 0 0 2px var(--turn), 4px 4px 0 rgba(0,0,0,.5); }
.banner.gwang { background: var(--gold); color: var(--gold-ink); border-color: #fff; font-size: clamp(20px, 6.5vw, 32px); }
.banner.gwang small { color: var(--lacquer); }
.banner.caught, .banner.special { background: var(--rare); color: #12061f; border-color: #fff; font-size: clamp(18px, 6vw, 28px); }
.banner.caught small, .banner.special small { color: #fff; }

.mine { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: 'info cards hand'; align-items: center; gap: 10px; padding: 10px 14px 6px; }
.mine.folded .my-cards { opacity: .45; filter: grayscale(.6); }
.my-info { grid-area: info; display: flex; flex-direction: column; gap: 6px; }
.my-name { position: relative; display: flex; align-items: center; gap: 6px; font-weight: 800; }
.my-name .dealer { position: static; }
.my-chips { display: flex; align-items: center; gap: 6px; font: 700 18px/1 var(--pixel); color: var(--gold); }
.chip-i { width: 14px; height: 14px; background: var(--gold); box-shadow: inset -2px -2px 0 #8a5a14, inset 2px 2px 0 #ffe2a8; border-radius: 50%; }
.my-cards { grid-area: cards; display: flex; gap: 10px; min-height: calc(var(--bw) * 1.5); }
.my-cards .card:first-child { transform: rotate(-4deg); }
.my-cards > :nth-child(2) { transform: rotate(4deg); }
.my-hand { grid-area: hand; font: 700 15px/1.2 'Galmuri11', var(--pixel); text-align: right; text-wrap: balance; }
.my-hand.big { color: var(--gold); font-size: 19px; text-shadow: 2px 2px 0 #05070b; animation: bob .6s steps(2) 3; }
.my-hand.won { color: var(--gold); }
.my-hand.won::before { content: '★ '; }
.peekable { position: relative; touch-action: none; cursor: grab; }
.peekable .cover { position: absolute; inset: 0; transition: transform .35s var(--ease), opacity .3s; display: grid; place-items: center; }
.peekable .cover .hint { position: relative; z-index: 1; font: 700 10px/1.3 'Galmuri11', var(--pixel); color: #fff3d6; text-align: center; padding: 4px; background: rgba(5,7,11,.6); }
.peekable .cover .hint small { font-size: 9px; opacity: .8; }
.mine.turn .my-cards::before { content: ''; }

.actions { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); min-height: 96px; }
.wait { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 18px; color: var(--ink-soft); font-size: 14px; }
.bar { height: 4px; width: 100%; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--turn); transform-origin: left; }
.bar.low i { background: var(--danger); }
.wait .bar { width: 60%; }
.mine-bar { margin-bottom: 6px; }
.btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 2px 5px; border: 0; background: var(--raised); color: var(--ink);
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.1), 0 0 0 2px #05070b, 0 3px 0 #05070b; transition: transform 60ms; }
.act b { font: 700 16px/1 'Galmuri11', var(--pixel); }
.act small { font: 600 11px/1 var(--ui); color: inherit; opacity: .75; }
.act:not(:disabled):active, .act.pressed { transform: translateY(3px); box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.1), 0 0 0 2px #05070b; }
.act:disabled { opacity: .28; cursor: default; }
.a-die { background: #3a4254; } .a-check { background: #24506a; } .a-call, .a-pping { background: #1f6f74; }
.a-ddadang, .a-half { background: var(--gold); color: var(--gold-ink); }
.a-allin { background: var(--danger); color: #fff; grid-column: span 2; }
@media (min-width: 760px) { .btns { grid-template-columns: repeat(7, 1fr); } .a-allin { grid-column: auto; } .act b { font-size: 17px; } }

.over { display: flex; flex-direction: column; gap: 10px; max-width: 520px; margin: 0 auto; padding-bottom: 4px; }
.over h2 { text-align: center; color: var(--gold); }
.standings { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings th { font: 700 10px/1 var(--pixel); color: var(--ink-soft); text-align: left; padding: 4px; }
.standings td { padding: 6px 4px; border-top: 1px solid var(--edge); }
.standings tr.you td { color: var(--gold); }

/* wide screens: the felt becomes a big oval with room for the seats */
@media (min-width: 900px) and (min-height: 700px) {
  .felt { margin: 8px 40px; }
  .seat { width: 120px; } .seat .av { width: 48px; height: 48px; font-size: 18px; } .seat .s-name { font-size: 14px; max-width: 120px; } .seat .s-chips { font-size: 13px; }
  .seat .ring { width: 62px; height: 62px; top: -7px; }
  .mine { padding: 14px 40px 8px; }
  .my-hand { font-size: 18px; } .my-hand.big { font-size: 24px; }
  .actions { max-width: 900px; width: 100%; margin: 0 auto; }
}
@media (max-height: 680px) { :root { --bw: clamp(70px, 19vw, 100px); --mw: 22px; } .act { min-height: 46px; } .felt { min-height: 180px; } }

/* sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(5,7,11,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; max-height: 86dvh; overflow-y: auto; background: var(--surface); border: 2px solid var(--edge2); border-bottom: 0; padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -6px 0 rgba(0,0,0,.4); }
@media (min-width: 760px) { .sheet-wrap { align-items: center; } .sheet { border-bottom: 2px solid var(--edge2); } }
.jokbo, .specials { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.jokbo li, .specials li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px; padding: 7px 10px; background: var(--raised); position: relative; }
.jokbo li b, .specials li b { font: 700 14px/1.2 'Galmuri11', var(--pixel); }
.jokbo .jc, .specials .jc { font-size: 12px; color: var(--ink-soft); }
.jokbo .jp { font: 700 11px/1 var(--pixel); color: var(--gold); min-width: 44px; text-align: right; }
.specials li { grid-template-columns: auto 1fr; }
.specials li p { grid-column: 1 / -1; font-size: 13px; color: var(--ink-soft); }
.jokbo li.mine, .specials li.mine { background: var(--gold); color: var(--gold-ink); }
.jokbo li.mine .jc, .jokbo li.mine .jp, .specials li.mine p, .specials li.mine .jc { color: var(--gold-ink); }
.jokbo li em { position: absolute; right: -4px; top: -8px; font: 700 9px/1 var(--pixel); font-style: normal; background: var(--danger); color: #fff; padding: 3px 4px 2px; }
.deckrow { display: flex; flex-wrap: wrap; gap: 3px; --mw: 26px; }
.emotes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.emotes button { font-size: 30px; min-height: 60px; background: var(--raised); border: 2px solid var(--edge); }
.emote-pop { position: fixed; z-index: 70; font-size: 38px; pointer-events: none; }

.fly-chip { position: fixed; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; z-index: 70; pointer-events: none; background: var(--gold); box-shadow: inset -2px -2px 0 #8a5a14, inset 2px 2px 0 #ffe2a8, 1px 1px 0 #05070b; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; background: var(--ink); color: #05070b; font-weight: 700; padding: 10px 16px; box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
.flash { position: fixed; inset: 0; z-index: 79; pointer-events: none; mix-blend-mode: screen; }
body.offline::after { content: attr(data-offline); position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 95; background: var(--danger); color: #fff; font: 700 12px/1 var(--pixel); padding: 7px 10px 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
