/* =========================================================================
   十三張 Online — design system
   深綠檯布 + 金箔 + 米白。Mobile first。
   ========================================================================= */

:root {
  --bg: #06120e;
  --bg-2: #0a1a14;
  --felt: #0d2a20;
  --felt-2: #113528;
  --panel: #0f231b;
  --panel-2: #143026;
  --gold: #e9c86a;
  --gold-2: #f7e6b4;
  --gold-dim: rgba(233, 200, 106, .35);
  --cream: #f6efdf;
  --muted: rgba(246, 239, 223, .58);
  --muted-2: rgba(246, 239, 223, .38);
  --line: rgba(233, 200, 106, .18);
  --line-2: rgba(246, 239, 223, .12);
  --red: #e0524d;
  --green: #34c98a;
  --purple: #a78bfa;
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
  --r: 18px;
  --r-sm: 12px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang HK", "Noto Sans HK", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", Georgia, "Times New Roman", serif;
  --cw: clamp(40px, 11.2vw, 58px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(900px 500px at 50% -160px, rgba(233, 200, 106, .10), transparent 70%),
    radial-gradient(700px 500px at 90% 110%, rgba(52, 201, 138, .07), transparent 70%),
    var(--bg);
  min-height: 100dvh;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: var(--gold); }

#app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ------------------------------------------------------------- boot ---- */
.boot { flex: 1; display: grid; place-content: center; justify-items: center; gap: 14px; }
.boot__logo {
  width: 86px; height: 86px; border-radius: 26px; display: grid; place-items: center;
  font: 700 40px/1 var(--serif); color: #06120e;
  background: linear-gradient(145deg, #f9ecc2, #e9c86a 55%, #b8912f);
  box-shadow: 0 16px 40px rgba(233, 200, 106, .22);
  animation: bob 1.8s ease-in-out infinite;
}
.boot__txt { color: var(--muted); font-size: 14px; letter-spacing: .18em; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }

/* ------------------------------------------------------------ topbar --- */
.top {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--safe-t) + 10px) 14px 10px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(6, 18, 14, .96), rgba(6, 18, 14, .78));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top__brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.top__mark {
  width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; font: 700 15px/1 var(--serif); color: #06120e;
  background: linear-gradient(145deg, #f9ecc2, #e9c86a 60%, #b8912f);
}
.top__title { font-weight: 800; font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.top__sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__spacer { flex: 1; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(246, 239, 223, .04); color: var(--cream);
  transition: transform .15s, background .15s;
}
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 19px; height: 19px; }

/* ------------------------------------------------------------- shell --- */
.screen { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 14px calc(102px + var(--safe-b)); }
.screen--wide { max-width: 980px; }

/* ------------------------------------------------------------- text ---- */
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: .01em; }
.h-display { font-family: var(--serif); font-weight: 700; line-height: 1.02; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.gold { color: var(--gold); }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ button --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px; border-radius: 14px; font-weight: 800; font-size: 16px;
  background: rgba(246, 239, 223, .07); border: 1px solid var(--line-2); color: var(--cream);
  transition: transform .12s ease, filter .15s, background .15s;
  min-height: 50px;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .38; pointer-events: none; }
.btn--gold {
  background: linear-gradient(145deg, #f9ecc2, #e9c86a 58%, #cfa945);
  color: #201803; border-color: transparent;
  box-shadow: 0 10px 26px rgba(233, 200, 106, .22);
}
.btn--green {
  background: linear-gradient(145deg, #1d8f63, #12694a); color: #eafff5; border-color: rgba(52, 201, 138, .35);
  box-shadow: 0 10px 26px rgba(18, 105, 74, .35);
}
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--sm { padding: 9px 14px; min-height: 40px; font-size: 13.5px; border-radius: 11px; }
.btn--block { width: 100%; }
.btn--danger { color: #ffb9b6; border-color: rgba(224, 82, 77, .35); background: rgba(224, 82, 77, .1); }

/* ------------------------------------------------------------- card ----- */
.card {
  position: relative; width: var(--cw); height: calc(var(--cw) * 1.4);
  border-radius: calc(var(--cw) * .13);
  background: linear-gradient(170deg, #fffdf7, #f2ecdd);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 6px 14px rgba(0, 0, 0, .3);
  color: #14110c; flex: 0 0 auto;
  display: block; padding: 0; overflow: hidden;
  transition: transform .16s cubic-bezier(.2, .9, .3, 1.2), box-shadow .16s;
  will-change: transform;
  user-select: none;
}
.card[data-red="1"] { color: #c8302b; }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  border: 1px solid rgba(0, 0, 0, .12); pointer-events: none;
}
.card__c {
  position: absolute; left: 6%; top: 4%; display: flex; flex-direction: column;
  align-items: center; line-height: .95; font-weight: 800;
  font-size: calc(var(--cw) * .29);
}
.card__c i { font-style: normal; font-size: calc(var(--cw) * .26); margin-top: -1px; }
.card__c--br { left: auto; right: 6%; top: auto; bottom: 4%; transform: rotate(180deg); }
.card__mid { position: absolute; inset: 12% 18%; }
.card__court {
  position: absolute; inset: 16% 14%;
  border: 1px solid currentColor; border-radius: 6%; opacity: .92;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.035) 6px 12px);
}
.card__court b { font: 700 calc(var(--cw) * .62)/1 var(--serif); }
.card__court span { position: absolute; font-size: calc(var(--cw) * .22); opacity: .75; }
.card__court span:nth-child(2) { top: 6%; left: 10%; }
.card__court span:nth-child(3) { bottom: 6%; right: 10%; transform: rotate(180deg); }
.pip {
  position: absolute; transform: translate(-50%, -50%);
  font-size: calc(var(--cw) * .30); line-height: 1; font-weight: 700;
}
.pip--flip { transform: translate(-50%, -50%) rotate(180deg); }
.pip--big { font-size: calc(var(--cw) * .78); }
.card--joker {
  background:
    radial-gradient(120% 90% at 20% 0%, #7c3aed, transparent 60%),
    radial-gradient(120% 90% at 90% 100%, #d97706, transparent 55%),
    linear-gradient(160deg, #2a1256, #120a24);
  color: #ffe9b0;
}
.card--joker .card__mid { inset: 10%; display: grid; place-items: center; text-align: center; }
.card--joker .jk { font: 800 calc(var(--cw) * .2)/1 var(--font); letter-spacing: .1em; }
.card--joker .jg { font-size: calc(var(--cw) * .5); line-height: 1; }
.card--joker .st { font-size: calc(var(--cw) * .19); opacity: .8; letter-spacing: .2em; }
.card--back {
  background:
    repeating-linear-gradient(45deg, rgba(233, 200, 106, .16) 0 3px, transparent 3px 9px),
    linear-gradient(160deg, #164734, #0a2a1f);
  color: var(--gold);
  display: grid; place-items: center;
}
.card--back span { font: 700 calc(var(--cw) * .42)/1 var(--serif); opacity: .85; }
.card--back::after { border: 1px solid var(--gold-dim); }
.card--sel { transform: translateY(calc(var(--cw) * -.3)); box-shadow: 0 0 0 2px var(--gold), 0 14px 26px rgba(0,0,0,.45); z-index: 3; }
.card--dim { opacity: .38; filter: grayscale(.5); }
.card--deal { animation: dealIn .42s cubic-bezier(.2, .9, .3, 1.15) backwards; animation-delay: calc(var(--i, 0) * 32ms); }
.card--flip { animation: flipIn .38s cubic-bezier(.2, .9, .3, 1.1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.card--win { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(233, 200, 106, .45); }

@keyframes dealIn {
  from { transform: translate(0, -60px) rotate(-12deg) scale(.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes flipIn {
  from { transform: perspective(600px) rotateY(-88deg); opacity: .2; }
  to { transform: none; opacity: 1; }
}

/* ------------------------------------------------------------- panel --- */
.panel {
  background: linear-gradient(165deg, rgba(20, 48, 38, .92), rgba(13, 32, 25, .96));
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.panel--pad { padding: 16px; }
.panel--gold { border-color: rgba(233, 200, 106, .45); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel__title { font-weight: 800; font-size: 15px; }

/* ------------------------------------------------------------- home ---- */
.hero { padding: 18px 4px 8px; }
.hero__eyebrow { color: var(--gold); font-size: 11.5px; letter-spacing: .34em; font-weight: 700; }
.hero__title { font-family: var(--serif); font-size: clamp(40px, 13vw, 62px); line-height: .98; margin-top: 8px; }
.hero__title em { font-style: normal; color: var(--gold); }
.hero__lede { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 34ch; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chip {
  font-size: 11.5px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--gold-2); background: rgba(233, 200, 106, .07);
}
.hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stat { text-align: center; padding: 12px 6px; border-radius: 14px; background: rgba(246, 239, 223, .04); border: 1px solid var(--line-2); }
.stat b { display: block; font: 700 20px/1 var(--serif); color: var(--gold); }
.stat span { font-size: 10.5px; color: var(--muted); }

.field { margin-top: 14px; }
.field__label { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: block; letter-spacing: .06em; }
.input {
  width: 100%; padding: 14px 14px; border-radius: 13px; font-size: 16px;
  background: rgba(6, 18, 14, .72); border: 1px solid var(--line-2); color: var(--cream);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233, 200, 106, .12); }
.input::placeholder { color: rgba(246, 239, 223, .3); }
.input--code { text-align: center; letter-spacing: .5em; font-size: 24px; font-weight: 800; padding-left: .5em; font-variant-numeric: tabular-nums; }

.seg { display: grid; grid-auto-flow: column; gap: 6px; background: rgba(6, 18, 14, .6); padding: 4px; border-radius: 13px; border: 1px solid var(--line-2); }
.seg button { padding: 9px 6px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: linear-gradient(145deg, #f9ecc2, #e9c86a 60%, #cfa945); color: #201803; }

.optrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.optrow:last-child { border-bottom: 0; }
.optrow__main b { display: block; font-size: 14px; }
.optrow__main span { font-size: 11.5px; color: var(--muted); }
.optrow__side { flex: 0 0 auto; }

.switch { position: relative; width: 50px; height: 30px; border-radius: 999px; background: rgba(246, 239, 223, .14); transition: background .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #f6efdf; transition: transform .18s; }
.switch[aria-pressed="true"] { background: linear-gradient(145deg, #2fbf7f, #158f5c); }
.switch[aria-pressed="true"]::after { transform: translateX(20px); }

.pickrow { display: flex; gap: 6px; }
.pick { padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); }
.pick[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: rgba(233, 200, 106, .12); }

/* ------------------------------------------------------------- room ---- */
.codecard { text-align: center; padding: 18px; }
.codecard__label { font-size: 11px; letter-spacing: .3em; color: var(--muted); }
.codecard__code { font: 700 clamp(38px, 12vw, 56px)/1 var(--serif); color: var(--gold); letter-spacing: .22em; margin: 6px 0 4px; padding-left: .22em; }
.codecard__row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

.seats { display: grid; gap: 8px; margin-top: 12px; }
.seat {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px;
  background: rgba(246, 239, 223, .035); border: 1px solid var(--line-2);
}
.seat--me { border-color: rgba(233, 200, 106, .45); background: rgba(233, 200, 106, .07); }
.seat--empty { opacity: .55; border-style: dashed; }
.seat__av {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #06120e; flex: 0 0 auto;
  background: linear-gradient(145deg, #f9ecc2, #e9c86a 60%, #c9a63f);
}
.seat__av--bot { background: linear-gradient(145deg, #9fd8c0, #3f9c78); }
.seat__body { flex: 1; min-width: 0; }
.seat__name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.seat__meta { font-size: 11.5px; color: var(--muted); }
.badge { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .04em; }
.badge--host { background: rgba(233, 200, 106, .16); color: var(--gold); }
.badge--bot { background: rgba(52, 201, 138, .14); color: #7ce3b6; }
.badge--ready { background: rgba(52, 201, 138, .16); color: #7ce3b6; }
.badge--wait { background: rgba(246, 239, 223, .08); color: var(--muted); }
.badge--me { background: rgba(233, 200, 106, .2); color: var(--gold-2); }

/* ------------------------------------------------------------- game ---- */
.gametop { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.gametop__phase { font: 700 13px/1 var(--font); letter-spacing: .16em; color: var(--gold); text-transform: uppercase; }
.gametop__round { font-size: 12px; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 13px; padding: 6px 11px; border-radius: 999px; background: rgba(246, 239, 223, .07); border: 1px solid var(--line-2); }
.timer--low { color: #ffb9b6; border-color: rgba(224, 82, 77, .4); background: rgba(224, 82, 77, .12); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.opps { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.opp { padding: 10px 11px; border-radius: 14px; background: rgba(246, 239, 223, .035); border: 1px solid var(--line-2); }
.opp--turn { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim); }
.opp__top { display: flex; align-items: center; gap: 8px; }
.opp__av { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #06120e; background: linear-gradient(145deg, #f9ecc2, #e9c86a); }
.opp__name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp__row { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.opp__money { font-variant-numeric: tabular-nums; font-weight: 800; }
.minicards { display: flex; margin-top: 7px; }
.minicards .card { width: 15px; height: 21px; border-radius: 3px; box-shadow: none; margin-right: -7px; }
.minicards .card--back span { font-size: 7px; }

.pile {
  border-radius: 16px; border: 1px solid var(--line-2); background: rgba(6, 18, 14, .42);
  padding: 10px 11px; margin-bottom: 9px; transition: border-color .15s, background .15s;
  display: block; width: 100%; text-align: left;
}
.pile--active { border-color: rgba(233, 200, 106, .55); }
.pile--over { border-color: var(--gold); background: rgba(233, 200, 106, .08); }
.pile--foul { border-color: rgba(224, 82, 77, .6); }
.pile__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pile__name { font-weight: 800; font-size: 13.5px; letter-spacing: .06em; }
.pile__cnt { font-size: 11.5px; color: var(--muted); }
.pile__ev { font-size: 11.5px; color: var(--gold); font-weight: 700; }
.pile__cards { display: flex; gap: 5px; margin-top: 8px; min-height: calc(var(--cw) * 1.4); align-items: center; flex-wrap: wrap; }
.pile__empty { font-size: 12px; color: var(--muted-2); }

.handwrap { margin-top: 4px; }
.hand {
  display: flex; flex-wrap: wrap; gap: 5px; justify-content: center;
  padding: 12px 6px; border-radius: 16px;
}
.hand--scroll { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 16px; scrollbar-width: none; }
.hand--scroll::-webkit-scrollbar { display: none; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  max-width: 760px; margin: 0 auto;
  padding: 12px 14px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, rgba(6, 18, 14, 0) 0%, rgba(6, 18, 14, .94) 34%, rgba(6, 18, 14, .99) 100%);
  display: flex; gap: 8px;
  pointer-events: none;
}
.actionbar > * { pointer-events: auto; }
.actionbar .btn { flex: 1; }

/* ------------------------------------------------------------- score --- */
.score-hero { text-align: center; padding: 16px 10px 6px; }
.score-hero__t { font: 700 13px/1 var(--font); letter-spacing: .3em; color: var(--gold); }
.score-hero__v { font-family: var(--serif); font-size: clamp(28px, 8vw, 40px); margin-top: 6px; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; border: 1px solid var(--line-2); }
table.score { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 480px; }
table.score th, table.score td { padding: 9px 8px; text-align: right; white-space: nowrap; }
table.score th:first-child, table.score td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; }
table.score thead th { font-size: 11px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); background: rgba(6, 18, 14, .6); }
table.score tbody tr { border-bottom: 1px solid rgba(246, 239, 223, .06); }
table.score tbody tr:last-child { border-bottom: 0; }
table.score .pos { color: #7ce3b6; font-weight: 800; }
table.score .neg { color: #ff9d99; font-weight: 800; }
table.score .zero { color: var(--muted-2); }
table.score .tot { font-weight: 800; }

.money { font-variant-numeric: tabular-nums; }
.money--pos { color: #7ce3b6; }
.money--neg { color: #ff9d99; }

.resultrow { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(246, 239, 223, .07); }
.resultrow:last-child { border: 0; }
.resultrow__rank { width: 22px; font: 700 14px/1 var(--serif); color: var(--gold); }
.resultrow__name { flex: 1; font-weight: 700; font-size: 14px; }
.resultrow__val { text-align: right; }

.paircard { font-size: 12px; padding: 9px 11px; border-radius: 11px; background: rgba(246, 239, 223, .035); margin-top: 7px; }
.paircard b { color: var(--gold-2); }
.paircard--sweep { border: 1px solid rgba(167, 139, 250, .45); background: rgba(167, 139, 250, .08); }

/* ------------------------------------------------------------- modal --- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; background: rgba(3, 9, 7, .72); backdrop-filter: blur(3px); }
.modal[hidden], .toast[hidden] { display: none !important; }
.modal__box {
  background: linear-gradient(170deg, #123128, #0a1c16);
  border: 1px solid var(--line); border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(18px + var(--safe-b));
  max-height: 86dvh; overflow-y: auto;
  animation: sheetUp .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: .6 } to { transform: none; opacity: 1 } }
@media (min-width: 640px) {
  .modal { place-items: center; }
  .modal__box { border-radius: 22px; width: min(560px, 92vw); max-height: 80dvh; }
}
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%);
  z-index: 80; background: rgba(20, 48, 38, .98); border: 1px solid var(--line);
  color: var(--cream); padding: 11px 16px; border-radius: 13px; font-size: 13.5px;
  box-shadow: var(--shadow); max-width: 88vw; text-align: center;
  animation: toastIn .22s ease;
  pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* ------------------------------------------------------------- misc ---- */
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.stack > * + * { margin-top: 10px; }

.stamp {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.stamp b {
  font: 800 clamp(28px, 10vw, 54px)/1 var(--serif); color: var(--gold);
  border: 3px solid var(--gold); padding: 6px 16px; border-radius: 12px;
  transform: rotate(-9deg); letter-spacing: .1em;
  background: rgba(6, 18, 14, .55);
  animation: stampIn .5s cubic-bezier(.2, 1.4, .4, 1) both;
  text-shadow: 0 2px 16px rgba(233, 200, 106, .5);
}
@keyframes stampIn { from { transform: scale(2.4) rotate(-9deg); opacity: 0 } to { transform: scale(1) rotate(-9deg); opacity: 1 } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

.rulelist { font-size: 13.5px; line-height: 1.75; color: rgba(246, 239, 223, .82); }
.rulelist li { margin-bottom: 5px; }
.rulelist b { color: var(--gold-2); }

.chat { max-height: 116px; overflow-y: auto; font-size: 12.5px; }
.chat p { margin: 0 0 3px; color: var(--muted); }
.chat b { color: var(--gold-2); }

.waiting { display: grid; place-items: center; gap: 10px; padding: 34px 10px; text-align: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(233, 200, 106, .25); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.sharebox { display: flex; gap: 6px; margin-top: 10px; }
.sharebox .input { font-size: 12px; padding: 11px 12px; }

@media (max-width: 380px) {
  :root { --cw: clamp(36px, 10.4vw, 50px); }
  .hero__title { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
