@font-face { font-family: "YD Sans"; src: url(../fonts/yd-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "YD Sans"; src: url(../fonts/yd-sans-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "YD Serif"; src: url(../fonts/yd-serif.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --bg: #0b0806;
  --ink: #f1e8d6;
  --ink-dim: #b9ab92;
  --brass: #c9a25a;
  --brass-hi: #ecd096;
  --brass-lo: #8a6a33;
  --paper: #f3ebda;
  --paper-2: #e9dec7;
  --paper-ink: #2b2219;
  --pencil: #8c7f6c;
  --red: #a3241c;
  --felt: #1c5539;
  --chip-red: #a3241c;
  --chip-black: #1e1b18;
  --chip-ivory: #efe5cf;
  --chip-gold: #c39433;
  --sans: "YD Sans", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "YD Serif", "Noto Serif KR", "AppleMyungjo", serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-snap: cubic-bezier(.34, 1.56, .64, 1);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 90% at 40% 30%, #2a1b11 0%, #120c08 55%, #070504 100%);
  color: var(--ink); font-family: var(--sans); font-size: 15px;
  word-break: keep-all; overflow-wrap: break-word; overflow: hidden;
  -webkit-font-smoothing: antialiased; user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
input { font: inherit; }

#app { display: grid; grid-template-columns: 1fr minmax(360px, 420px); height: 100dvh; }
#stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(90% 80% at 50% 48%, transparent 55%, rgba(5, 3, 2, .55) 100%); }

/* ---------- top bar ---------- */
#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 14px 0; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.tag { font-family: var(--serif); letter-spacing: .18em; font-size: 13px; color: var(--brass-hi); padding: 7px 11px 6px; border: 1px solid rgba(201, 162, 90, .45); border-radius: 3px; background: rgba(12, 8, 5, .55); backdrop-filter: blur(6px); }
.tag:hover { border-color: var(--brass); }
#players { flex: 1; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tools { display: flex; gap: 6px; }
.icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(12, 8, 5, .55); border: 1px solid rgba(201, 162, 90, .3); color: var(--brass-hi); backdrop-filter: blur(6px); }
.icon svg { width: 18px; height: 18px; }

.seat { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; background: rgba(12, 8, 5, .62); border: 1px solid rgba(241, 232, 214, .08); backdrop-filter: blur(6px); transition: border-color .3s, box-shadow .3s, transform .3s var(--ease-out); }
.seat.turn { border-color: var(--brass); box-shadow: 0 0 0 1px rgba(201, 162, 90, .35), 0 6px 22px rgba(201, 162, 90, .18); transform: translateY(1px); }
.seat.off { opacity: .55; }
.seat .nm { font-size: 13.5px; font-weight: 600; max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .pt { font-size: 12.5px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.seat .kick { margin-left: 2px; font-size: 11px; color: var(--ink-dim); border: 1px solid rgba(241, 232, 214, .2); border-radius: 999px; padding: 1px 7px; }
.seat .me { font-size: 10.5px; color: var(--brass-hi); letter-spacing: .05em; }

/* casino chip */
.chip { --c: var(--chip-red); width: 28px; height: 28px; border-radius: 50%; flex: none; position: relative; display: grid; place-items: center; font-family: var(--serif); font-size: 12px; font-weight: 700; color: #fff;
  background: radial-gradient(circle at 50% 50%, var(--c) 0 50%, transparent 51%), repeating-conic-gradient(var(--c) 0 22.5deg, #f4ecdc 22.5deg 45deg);
  box-shadow: inset 0 0 0 2px var(--c), inset 0 0 0 3.5px rgba(255, 255, 255, .25), 0 2px 4px rgba(0, 0, 0, .5); }
.chip::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .45); }
.chip.red { --c: var(--chip-red); }
.chip.black { --c: var(--chip-black); }
.chip.ivory { --c: var(--chip-ivory); color: var(--paper-ink); }
.chip.ivory::after { border-color: rgba(43, 34, 25, .35); }
.chip.gold { --c: var(--chip-gold); color: #2b2219; }
.seat.turn .chip { animation: chipSpin 3.2s linear infinite; }
@keyframes chipSpin { to { transform: rotate(360deg); } }
.online-dot { position: absolute; left: 25px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: #58b37d; border: 2px solid #120c08; }
.seat.off .online-dot { background: #6d6257; }

/* ---------- banner & bursts ---------- */
#banner { position: absolute; left: 50%; top: 68px; transform: translate(-50%, -8px); opacity: 0; pointer-events: none; font-family: var(--serif); font-size: 15px; letter-spacing: .06em; color: var(--ink); padding: 8px 18px; border-radius: 3px; background: rgba(12, 8, 5, .7); border: 1px solid rgba(201, 162, 90, .4); transition: opacity .35s, transform .5s var(--ease-out); white-space: nowrap; }
#banner.on { opacity: 1; transform: translate(-50%, 0); }
#banner.mine { color: var(--brass-hi); border-color: var(--brass); }

#burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
#burst .word { font-family: var(--serif); font-weight: 800; font-size: clamp(54px, 11vw, 132px); letter-spacing: .08em; color: var(--brass-hi);
  text-shadow: 0 1px 0 #f7e4b5, 0 2px 0 #b8893f, 0 3px 0 #8a6a33, 0 4px 0 #5e4520, 0 14px 30px rgba(0, 0, 0, .55);
  animation: stampIn 1.9s var(--ease-out) forwards; }
#burst .word small { display: block; text-align: center; font-size: .2em; letter-spacing: .3em; color: var(--ink); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); margin-top: -.2em; }
@keyframes stampIn { 0% { transform: scale(2.2) rotate(-8deg); opacity: 0; } 14% { transform: scale(.94) rotate(-4deg); opacity: 1; } 22% { transform: scale(1.02) rotate(-4deg); } 30% { transform: scale(1) rotate(-4deg); } 82% { opacity: 1; transform: scale(1) rotate(-4deg); } 100% { opacity: 0; transform: scale(1.04) rotate(-4deg); } }

#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.float { position: absolute; font-size: 30px; animation: floatUp 1.8s var(--ease-out) forwards; }
.float.pts { font-family: var(--serif); font-weight: 800; font-size: 26px; color: var(--paper-ink); }
.float.pts.zero { color: var(--pencil); }
@keyframes floatUp { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -18px) scale(1.1); } 100% { transform: translate(-50%, -90px) scale(1); opacity: 0; } }

/* ---------- actions ---------- */
#actions { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 14px max(16px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; pointer-events: none; }
#actions > * { pointer-events: auto; }
#hint { justify-self: start; font-size: 13px; color: var(--ink-dim); line-height: 1.5; max-width: 22em; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); pointer-events: none; }
#hint b { color: var(--ink); font-weight: 600; }
.roll { white-space: nowrap; position: relative; min-width: 180px; height: 58px; padding: 0 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .12em; color: #2a1d0c;
  background: linear-gradient(180deg, #f0d79f 0%, #d4ac62 48%, #b88b40 52%, #c99d52 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(90, 60, 20, .5), 0 0 0 1px #6b4f22, 0 10px 24px rgba(0, 0, 0, .55);
  transition: transform .18s var(--ease-snap), filter .2s, opacity .2s; }
.roll:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.05); }
.roll:not(:disabled):active { transform: translateY(1px) scale(.98); }
.roll:disabled { filter: grayscale(.7) brightness(.55); opacity: .75; }
.roll .pips { display: flex; gap: 5px; }
.roll .pips i { width: 8px; height: 8px; border-radius: 50%; background: #2a1d0c; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5); transition: background .3s, transform .3s var(--ease-snap); }
.roll .pips i.used { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(42, 29, 12, .45); transform: scale(.85); }
.roll.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(90, 60, 20, .5), 0 0 0 1px #6b4f22, 0 10px 24px rgba(0, 0, 0, .55); } 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(90, 60, 20, .5), 0 0 0 1px #6b4f22, 0 0 0 6px rgba(236, 208, 150, .16), 0 10px 30px rgba(0, 0, 0, .55); } }

#emotes { justify-self: end; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(12, 8, 5, .55); border: 1px solid rgba(241, 232, 214, .08); backdrop-filter: blur(6px); }
#emotes button { width: 34px; height: 34px; border-radius: 50%; font-size: 18px; transition: transform .15s var(--ease-snap), background .2s; }
#emotes button:hover { background: rgba(241, 232, 214, .08); transform: scale(1.12); }
#emotes button:active { transform: scale(.9); }

#assist { grid-column: 1 / -1; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#assist > * { pointer-events: auto; }
#advice:empty, #quick:empty { display: none; }
#advice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 7px 8px 7px 14px; border-radius: 999px; background: rgba(12, 8, 5, .72); border: 1px solid rgba(201, 162, 90, .35); backdrop-filter: blur(6px); font-size: 13.5px; color: var(--ink); animation: rise .4s var(--ease-out); }
#advice .k { font-family: var(--serif); font-size: 11px; letter-spacing: .14em; color: var(--brass-hi); }
#advice .faces { display: inline-flex; gap: 3px; vertical-align: -4px; }
#advice .faces svg { width: 18px; height: 18px; }
#advice .why { color: var(--ink-dim); font-size: 12.5px; }
#advice button { font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; color: #2a1d0c; background: linear-gradient(180deg, #f0d79f, #c99d52); }
#advice button:hover { filter: brightness(1.06); }
#quick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
#quick button { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 13px; border-radius: 3px; background: var(--paper); color: var(--paper-ink); font-size: 13px; font-weight: 600; box-shadow: 0 0 0 1px rgba(138, 106, 51, .5), 0 6px 14px rgba(0, 0, 0, .45); transition: transform .15s var(--ease-snap), box-shadow .2s; animation: rise .45s var(--ease-out) backwards; }
#quick button:nth-child(2) { animation-delay: .05s; } #quick button:nth-child(3) { animation-delay: .1s; }
#quick button b { font-family: var(--serif); font-size: 17px; font-weight: 800; }
#quick button.rec { background: linear-gradient(180deg, #fbf3df, #f0dfb6); box-shadow: 0 0 0 1.5px var(--brass), 0 8px 18px rgba(0, 0, 0, .5); }
#quick button.rec::before { content: "추천"; font-size: 10px; letter-spacing: .1em; color: var(--red); font-weight: 700; }
#quick button.zero { color: #8c7f6c; }
#quick button:hover { transform: translateY(-2px); }
#quick button.armed { box-shadow: 0 0 0 2px var(--red), 0 8px 18px rgba(0, 0, 0, .5); }
.icon.off { opacity: .45; }

/* ---------- score card ---------- */
#card { min-height: 0; overflow: auto; padding: 18px 18px 22px 4px; scrollbar-width: thin; scrollbar-color: #5a4630 transparent; }
.sheet { position: relative; background: var(--paper); color: var(--paper-ink); border-radius: 3px; padding: 16px 14px 12px;
  box-shadow: 0 1px 0 #fff8e8 inset, 0 30px 60px rgba(0, 0, 0, .55), 0 6px 12px rgba(0, 0, 0, .35);
  background-image: radial-gradient(rgba(120, 90, 50, .06) 1px, transparent 1.2px), linear-gradient(180deg, #f6efe0, #efe5d0);
  background-size: 7px 7px, 100% 100%; transform: rotate(.35deg); }
.sheet::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(138, 106, 51, .55); outline: 1px solid rgba(138, 106, 51, .25); outline-offset: 3px; pointer-events: none; border-radius: 2px; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 8px 10px; border-bottom: 1.5px solid var(--paper-ink); margin: 0 4px; }
.brand { font-family: var(--serif); font-weight: 800; font-size: 26px; letter-spacing: .22em; line-height: 1; }
.brand small { display: block; font-size: 9.5px; letter-spacing: .42em; font-weight: 600; color: var(--brass-lo); margin-top: 4px; }
.round { font-family: var(--serif); font-size: 12px; letter-spacing: .16em; color: var(--pencil); }
.sheet-foot { margin: 10px 8px 2px; font-size: 11.5px; color: var(--pencil); text-align: center; }

table.score { width: calc(100% - 8px); margin: 6px 4px 0; border-collapse: collapse; table-layout: fixed; }
.score th, .score td { padding: 0; height: 34px; border-bottom: 1px solid rgba(43, 34, 25, .14); }
.score thead th { height: 46px; vertical-align: bottom; padding-bottom: 6px; border-bottom: 1.5px solid var(--paper-ink); }
.score col.cat { width: 44%; }
.score .ph { text-align: center; font-size: 11.5px; font-weight: 600; }
.score .ph .chip { width: 22px; height: 22px; margin: 0 auto 3px; font-size: 10px; }
.score .ph .chip::after { inset: 4.5px; }
.score .ph .n { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.score th.cat { text-align: left; font-weight: 400; }
.catname { display: flex; align-items: center; gap: 9px; padding-left: 6px; font-family: var(--serif); font-size: 14.5px; font-weight: 600; letter-spacing: .01em; }
.catname .sub { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 400; color: var(--pencil); letter-spacing: 0; margin-top: -2px; }
.mini { width: 19px; height: 19px; flex: none; }
.score td { text-align: center; font-family: var(--serif); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; position: relative; }
.score td.col-turn { background: linear-gradient(180deg, rgba(201, 162, 90, .16), rgba(201, 162, 90, .1)); }
.score td.prev { color: var(--pencil); font-weight: 400; font-family: var(--sans); font-size: 15px; }
.score td.prev.zero { color: rgba(140, 127, 108, .45); }
.score td.prev.best::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 14px; height: 2px; margin-left: -7px; background: var(--brass); border-radius: 2px; }
.score td.pick { cursor: pointer; }
.score td.rec::before { content: ""; position: absolute; left: 5px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--red); }
.par { font-size: 9.5px; font-weight: 600; margin-left: 2px; vertical-align: 5px; font-family: var(--sans); }
.par.up { color: #3f7a4f; } .par.dn { color: #a3241c; } .par.eq { color: var(--pencil); }
.score td.pick:hover, .score td.pick.armed { background: rgba(201, 162, 90, .38); color: var(--paper-ink); }
.score td.armed { box-shadow: inset 0 0 0 2px var(--brass-lo); }
.score td.zeroed { color: rgba(43, 34, 25, .35); }
.score td.fresh span { display: inline-block; animation: ink .7s var(--ease-out); }
@keyframes ink { 0% { transform: scale(2.4) rotate(-12deg); opacity: 0; filter: blur(2px); } 45% { transform: scale(.9) rotate(-3deg); opacity: 1; filter: none; } 100% { transform: scale(1) rotate(0); } }
.score tr.sub th, .score tr.sub td { height: 30px; background: rgba(43, 34, 25, .045); font-size: 13px; }
.score tr.sub .catname { font-size: 12.5px; font-weight: 400; color: #5a4c3c; }
.score tr.sub td { font-family: var(--sans); font-weight: 600; font-size: 12.5px; color: #5a4c3c; }
.score tr.sub td .bar { display: block; height: 3px; margin: 2px auto 0; width: 70%; background: rgba(43, 34, 25, .12); border-radius: 3px; overflow: hidden; }
.score tr.sub td .bar i { display: block; height: 100%; background: var(--brass); transition: width .6s var(--ease-out); }
.score tr.bonus td.got { color: var(--red); }
.score tr.gap th, .score tr.gap td { height: 8px; border-bottom: 1.5px solid var(--paper-ink); }
.score tr.total th, .score tr.total td { height: 46px; border-bottom: 0; border-top: 1.5px solid var(--paper-ink); }
.score tr.total .catname { font-size: 16px; letter-spacing: .2em; }
.score tr.total td { font-size: 22px; font-weight: 800; }

/* ---------- panel ---------- */
.panel-wrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(6, 4, 3, .42); backdrop-filter: blur(3px); transition: opacity .4s; }
.panel-wrap.hide { opacity: 0; pointer-events: none; }
.panel { width: min(430px, 100%); max-height: calc(100dvh - 40px); overflow: auto; position: relative; padding: 34px 30px 28px; border-radius: 4px; color: var(--paper-ink); text-align: center;
  background-image: radial-gradient(rgba(120, 90, 50, .06) 1px, transparent 1.2px), linear-gradient(180deg, #f6efe0, #ece1ca);
  background-size: 7px 7px, 100% 100%;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .5) inset; animation: rise .6s var(--ease-out); }
.panel::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(138, 106, 51, .55); outline: 1px solid rgba(138, 106, 51, .25); outline-offset: 3px; pointer-events: none; }
@keyframes rise { from { transform: translateY(18px) scale(.98); opacity: 0; } }
.mark { font-family: var(--serif); font-weight: 800; font-size: 54px; letter-spacing: .24em; margin-right: -.24em; line-height: 1; }
.mark-sub { font-family: var(--serif); font-size: 11px; letter-spacing: .5em; margin-right: -.5em; color: var(--brass-lo); margin-top: 10px; }
.rule { display: flex; align-items: center; gap: 10px; margin: 22px 0 18px; color: var(--brass-lo); font-size: 12px; letter-spacing: .1em; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: #6b5b48; margin-bottom: 6px; }
.field input { width: 100%; height: 48px; border-radius: 3px; border: 1px solid rgba(43, 34, 25, .3); background: rgba(255, 252, 244, .8); padding: 0 14px; font-size: 17px; color: var(--paper-ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--brass-lo); box-shadow: 0 0 0 3px rgba(201, 162, 90, .25); }
.field input.code { text-transform: uppercase; letter-spacing: .4em; font-family: var(--serif); font-weight: 700; text-align: center; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.btn { height: 50px; border-radius: 3px; font-weight: 600; font-size: 16px; letter-spacing: .02em; transition: transform .15s var(--ease-snap), filter .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn.gold { color: #2a1d0c; background: linear-gradient(180deg, #f0d79f 0%, #d4ac62 48%, #b88b40 52%, #c99d52 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 1px #6b4f22, 0 6px 14px rgba(60, 40, 10, .3); font-family: var(--serif); font-weight: 700; letter-spacing: .1em; }
.btn.gold:hover { filter: brightness(1.05); }
.btn.ghost { color: var(--paper-ink); box-shadow: inset 0 0 0 1px rgba(43, 34, 25, .35); }
.btn.ghost:hover { background: rgba(43, 34, 25, .05); }
.btn:disabled { filter: grayscale(.8); opacity: .5; }
.wide { width: 100%; }
.muted { font-size: 13px; color: #6b5b48; line-height: 1.6; }
.code-big { font-family: var(--serif); font-weight: 800; font-size: 46px; letter-spacing: .3em; margin: 6px -0.3em 4px 0; }
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.seats .s { height: 50px; border-radius: 3px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: rgba(43, 34, 25, .06); font-weight: 600; text-align: left; overflow: hidden; white-space: nowrap; }
.seats .s.empty { background: none; border: 1px dashed rgba(43, 34, 25, .3); color: #8c7f6c; font-weight: 400; font-size: 13px; justify-content: center; }
.seats .s .mine { font-size: 10.5px; color: #8c7f6c; font-weight: 400; }
.seats .s .host { flex: none; margin-left: auto; font-size: 10.5px; color: var(--brass-lo); letter-spacing: .1em; }
.results { margin: 18px 0 20px; text-align: left; }
.res { display: grid; grid-template-columns: 30px 28px 1fr auto; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid rgba(43, 34, 25, .14); animation: rise .6s var(--ease-out) backwards; }
.res .rk { font-family: var(--serif); font-weight: 800; font-size: 20px; text-align: center; color: #8c7f6c; }
.res.first .rk { color: var(--red); }
.res .nm { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res .nm small { display: block; font-weight: 400; font-size: 11.5px; color: #8c7f6c; }
.res .tt { font-family: var(--serif); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }
.res.first { background: linear-gradient(90deg, rgba(201, 162, 90, .22), transparent); }
.crown { display: block; width: 26px; margin: 0 auto -6px; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; z-index: 40; padding: 10px 16px; border-radius: 3px; background: #1c140e; color: var(--ink); border: 1px solid rgba(201, 162, 90, .4); font-size: 14px; transition: opacity .3s, transform .4s var(--ease-out); pointer-events: none; white-space: nowrap; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- portrait / phone ---------- */
@media (max-width: 860px), (max-aspect-ratio: 1/1) {
  body { overflow: auto; }
  #app { grid-template-columns: 1fr; grid-template-rows: 58dvh auto; height: auto; min-height: 100dvh; }
  #stage { height: 58dvh; position: sticky; top: 0; z-index: 2; }
  #card { padding: 10px 10px 30px; overflow: visible; }
  .sheet { transform: none; padding: 12px 8px 10px; }
  .brand { font-size: 20px; }
  .score th, .score td { height: 32px; }
  .catname { font-size: 13.5px; gap: 7px; padding-left: 4px; }
  .catname .sub { display: none; }
  .score td { font-size: 16px; }
  #actions { grid-template-columns: 1fr auto; grid-template-rows: auto auto; padding-bottom: 12px; gap: 8px; }
  #assist { grid-row: 1; gap: 6px; }
  #advice { font-size: 12px; padding: 5px 6px 5px 11px; gap: 7px; }
  #advice .why { display: none; }
  #quick button { padding: 6px 9px; font-size: 12px; } #quick button b { font-size: 15px; }
  #hint { grid-column: 1 / -1; grid-row: 2; justify-self: center; text-align: center; font-size: 12.5px; }
  #hint:empty { display: none; }
  .roll { grid-row: 3; min-width: 150px; height: 52px; font-size: 17px; justify-self: start; }
  #emotes { grid-row: 3; }
  #emotes button { width: 30px; height: 30px; font-size: 16px; }
  .seat { padding: 3px 9px 3px 3px; gap: 6px; }
  .seat .chip { width: 24px; height: 24px; font-size: 10.5px; }
  .seat .chip::after { inset: 5px; }
  .online-dot { left: 21px; }
  .seat .nm { font-size: 12.5px; max-width: 4.6em; }
  #topbar { padding-left: 10px; padding-right: 10px; gap: 6px; }
  .tag { font-size: 11px; padding: 6px 8px 5px; }
  .icon { width: 32px; height: 32px; }
  #banner { top: 56px; font-size: 13.5px; }
}
@media (min-width: 1700px) and (min-aspect-ratio: 1/1) {
  #app { grid-template-columns: 1fr 520px; }
  #card .sheet { zoom: 1.22; }
}
@media (max-width: 400px) { #emotes button:nth-child(n+5) { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
