/* ════════════════════════════════════════════════════════════
   Dummy.io — Casino Noir Deco
   เขียว felt เข้ม × ทองอาร์ตเดโค × ไพ่งาช้าง
   ════════════════════════════════════════════════════════════ */
:root {
  --noir: #0c0f0d;
  --noir-2: #141815;
  --felt-1: #1a5c38;
  --felt-2: #0a3520;
  --felt-3: #062616;
  --gold: #d4af37;
  --gold-soft: #f0d78c;
  --gold-dim: #8a6f1f;
  --ivory: #faf5e9;
  --ivory-dim: #cfc7b4;
  --red: #c22a3a;
  --black: #23201c;
  --ruby: #8e1e33;
  --emerald: #1d7a4c;
  --shadow-card: 0 4px 10px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Athiti', sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(212,175,55,.08), transparent 60%),
    radial-gradient(ellipse 120% 100% at 50% 110%, rgba(20,90,50,.25), transparent 60%),
    var(--noir);
  color: var(--ivory);
  min-height: 100vh;
  overflow-x: hidden;
}
/* grain texture */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

button { font-family: inherit; cursor: pointer; }
input {
  font-family: inherit; font-size: 1rem;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 6px;
  color: var(--ivory);
  padding: .55rem .8rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.15); }
input::placeholder { color: rgba(250,245,233,.3); }
input.mono { letter-spacing: .35em; text-transform: uppercase; font-weight: 600; }

/* ── ปุ่ม ── */
.btn {
  border: none; border-radius: 8px;
  font-size: 1rem; font-weight: 600;
  padding: .65rem 1.4rem;
  letter-spacing: .02em;
  transition: transform .15s, box-shadow .2s, filter .2s, opacity .2s;
  position: relative;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.gold {
  background: linear-gradient(160deg, #f3dc8f, var(--gold) 45%, #a8811e);
  color: #241c05;
  box-shadow: 0 4px 14px rgba(212,175,55,.35);
}
.btn.emerald {
  background: linear-gradient(160deg, #2f9e66, var(--emerald) 55%, #10502e);
  color: #eafff2;
  box-shadow: 0 4px 14px rgba(29,122,76,.4);
}
.btn.ruby {
  background: linear-gradient(160deg, #c04361, var(--ruby) 55%, #5e0f20);
  color: #ffe9ee;
  box-shadow: 0 4px 14px rgba(142,30,51,.4);
}
.btn.ghost {
  background: transparent; color: var(--gold-soft);
  border: 1px solid rgba(212,175,55,.4);
}
.btn.big { font-size: 1.15rem; padding: .8rem 2.2rem; }
.btn.small { font-size: .85rem; padding: .35rem .9rem; }
.btn.tiny { font-size: .75rem; padding: .2rem .7rem; }

/* ── กรอบอาร์ตเดโค ── */
.deco-frame {
  margin: auto;
  width: min(920px, 94vw);
  padding: 2.5rem 3rem 2rem;
  border: 1px solid rgba(212,175,55,.5);
  border-radius: 4px;
  position: relative;
  background:
    linear-gradient(rgba(12,15,13,.6), rgba(12,15,13,.6)),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(212,175,55,.03) 14px 15px);
  box-shadow: 0 0 0 6px var(--noir), 0 0 0 7px rgba(212,175,55,.35), 0 30px 80px rgba(0,0,0,.6);
}
.deco-frame.narrow { width: min(560px, 94vw); text-align: center; }
.deco-frame::before, .deco-frame::after {
  content: '◆'; position: absolute; color: var(--gold); font-size: .8rem;
  top: -0.55rem; background: var(--noir); padding: 0 .5rem;
}
.deco-frame::before { left: 2rem; }
.deco-frame::after { right: 2rem; }

/* ── หน้าแรก ── */
.brand { text-align: center; margin-bottom: 2.2rem; }
.brand-suits {
  font-size: 1.3rem; letter-spacing: 1.6em; margin-left: 1.6em; margin-bottom: .5rem;
  color: var(--ivory);
  animation: floaty 4s ease-in-out infinite;
}
.brand-suits .rs { color: var(--red); }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.brand h1 {
  font-family: 'Chonburi', serif;
  font-size: clamp(2.8rem, 8vw, 4.6rem);
  background: linear-gradient(175deg, #f7e7ae 20%, var(--gold) 55%, #97741a 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 12px rgba(212,175,55,.3));
  line-height: 1.1;
}
.brand h1 .dot { -webkit-text-fill-color: var(--red); }
.tagline { color: var(--ivory-dim); letter-spacing: .3em; margin-top: .4rem; font-weight: 300; }

.panels { display: flex; gap: 2rem; align-items: stretch; }
.panel { flex: 1; display: flex; flex-direction: column; gap: .8rem; }
.panel h2 {
  font-size: 1.15rem; font-weight: 600; color: var(--gold-soft);
  border-bottom: 1px solid rgba(212,175,55,.25); padding-bottom: .5rem; margin-bottom: .3rem;
}
.chip-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em; border-radius: 50%;
  background: var(--ivory); color: var(--black);
  font-size: .8em; margin-right: .4em;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px rgba(212,175,55,.2);
}
.chip-ico.red { color: var(--red); }
.panel label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--ivory-dim); }
.panel .btn { margin-top: .5rem; }
.panel-divider { display: flex; align-items: center; color: rgba(212,175,55,.5); }
.panel-divider span {
  writing-mode: vertical-rl; letter-spacing: .3em; font-size: .8rem;
  border-left: 1px solid rgba(212,175,55,.2); border-right: 1px solid rgba(212,175,55,.2);
  padding: 0 .6rem;
}

.home-rules { margin-top: 2rem; font-size: .9rem; }
.home-rules summary { cursor: pointer; color: var(--gold-soft); }
.rules-body { margin-top: .8rem; color: var(--ivory-dim); line-height: 1.8; padding-left: 1.4rem; }
.rules-body b { color: var(--gold-soft); }

/* ── ห้องรอ ── */
.lobby-title { font-family: 'Chonburi', serif; font-size: 2rem; color: var(--gold-soft); }
.lobby-sub { color: var(--ivory-dim); margin: .3rem 0 1.2rem; }
.room-code-box {
  display: inline-flex; align-items: center; gap: 1rem;
  padding: .6rem 1.4rem; margin-bottom: 1.5rem;
  border: 1px dashed rgba(212,175,55,.5); border-radius: 8px;
  background: rgba(212,175,55,.06);
}
.room-code {
  font-size: 2rem; font-weight: 700; letter-spacing: .35em;
  color: var(--gold); text-shadow: 0 0 18px rgba(212,175,55,.5);
}
.lobby-players { list-style: none; display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.2rem; }
.lobby-players li {
  display: flex; align-items: center; gap: .8rem;
  background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,55,.15);
  padding: .6rem 1rem; border-radius: 8px; text-align: left;
  animation: slide-in .3s ease both;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(-12px); } }
.lobby-players .seat {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--felt-2); border: 1px solid var(--gold-dim);
  font-weight: 700; color: var(--gold-soft); font-size: .9rem;
}
.lobby-players .host-tag { margin-left: auto; font-size: .78rem; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 99px; padding: .1rem .6rem; }
.lobby-hint { color: var(--ivory-dim); font-size: .9rem; min-height: 1.4em; }
.lobby-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

/* ── โต๊ะเกม ── */
#screen-game { height: 100vh; }
#screen-game.active { display: grid; grid-template-rows: auto 1fr auto; }

.table-top { padding: .5rem 1rem 0; }
.table-info { display: flex; align-items: center; gap: 1rem; font-size: .85rem; color: var(--ivory-dim); }
.ti-brand { font-family: 'Chonburi', serif; color: var(--gold); letter-spacing: .05em; }
.ti-room { flex: 1; }

.opponents { display: flex; justify-content: center; gap: 2.5rem; padding: .4rem 0 .6rem; min-height: 84px; }
.opp {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  padding: .4rem 1.1rem; border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.opp.turn {
  border-color: var(--gold);
  background: rgba(212,175,55,.08);
  box-shadow: 0 0 24px rgba(212,175,55,.25);
  animation: pulse-gold 1.6s ease-in-out infinite;
}
@keyframes pulse-gold {
  0%,100% { box-shadow: 0 0 14px rgba(212,175,55,.2); }
  50% { box-shadow: 0 0 30px rgba(212,175,55,.45); }
}
.opp.gone { opacity: .4; }
.opp-name { font-weight: 600; font-size: .95rem; }
.opp-name .off { color: var(--red); font-size: .75rem; }
.opp-cards { display: flex; }
.opp-cards .mini-back {
  width: 22px; height: 32px; border-radius: 3px; margin-left: -12px;
  background: linear-gradient(135deg, #7d1f2e, #4a0d18);
  border: 1px solid rgba(240,215,140,.6);
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.opp-cards .mini-back:first-child { margin-left: 0; }
.opp-meta { font-size: .78rem; color: var(--ivory-dim); }
.opp-meta .pts { color: var(--gold-soft); font-weight: 600; }

/* felt */
.felt {
  position: relative; margin: 0 1rem;
  border-radius: 200px / 90px;
  border: 10px solid #241a10;
  box-shadow:
    inset 0 0 60px rgba(0,0,0,.6),
    inset 0 0 0 3px rgba(212,175,55,.35),
    0 20px 60px rgba(0,0,0,.5);
  background:
    radial-gradient(ellipse at 50% 30%, var(--felt-1), var(--felt-2) 60%, var(--felt-3));
  display: flex;
  overflow: hidden;
  min-height: 0;
}
.felt::before {
  content: 'DUMMY.IO'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Chonburi', serif; font-size: 5rem; color: rgba(255,255,255,.035);
  letter-spacing: .2em; pointer-events: none;
}
.felt-inner {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 1.2rem 1rem .8rem; gap: .8rem; min-width: 0; overflow-y: auto;
}

.center-piles { display: flex; align-items: flex-start; gap: 2.2rem; }
.stock-wrap, .discard-wrap { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.pile-label { font-size: .78rem; color: rgba(250,245,233,.55); letter-spacing: .05em; }
.pile-hint { color: rgba(250,245,233,.35); }

/* ── การ์ด ── */
.card {
  width: 62px; height: 88px; border-radius: 7px;
  background: linear-gradient(160deg, #fffdf5, var(--ivory) 60%, #efe6d0);
  box-shadow: var(--shadow-card);
  position: relative; user-select: none;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 5px 6px;
  color: var(--black);
  font-weight: 700;
  transition: transform .18s, box-shadow .18s, outline .18s;
  flex-shrink: 0;
}
.card.red { color: var(--red); }
.card .corner { font-size: .95rem; line-height: 1; text-align: left; }
.card .corner .suit-s { display: block; font-size: .85rem; }
.card .pip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; opacity: .85; }
.card .corner.bottom { transform: rotate(180deg); }
.card.speto::after {
  content: '50'; position: absolute; top: 4px; right: 5px;
  font-size: .58rem; background: var(--gold); color: #241c05;
  border-radius: 99px; padding: 0 4px; font-weight: 700;
}
.card.head-card { outline: 2px solid var(--gold); outline-offset: 2px; box-shadow: 0 0 16px rgba(212,175,55,.55), var(--shadow-card); }

.card.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(240,215,140,.18) 0 8%, transparent 8%),
    repeating-linear-gradient(45deg, #6e1b29 0 8px, #58131f 8px 16px),
    #58131f;
  border: 2px solid #f0d78c;
}
.stock { cursor: pointer; }
.stock-count {
  position: absolute; bottom: -8px; right: -8px;
  background: var(--noir-2); border: 1px solid var(--gold-dim);
  color: var(--gold-soft); font-size: .7rem; font-weight: 700;
  border-radius: 99px; padding: .05rem .45rem;
}
.stock.can-act { animation: glow 1.5s ease-in-out infinite; cursor: pointer; }
@keyframes glow {
  0%,100% { box-shadow: 0 0 8px rgba(212,175,55,.4), var(--shadow-card); }
  50% { box-shadow: 0 0 26px rgba(212,175,55,.8), var(--shadow-card); }
}

.discard-row { display: flex; min-height: 88px; max-width: 46vw; flex-wrap: wrap; gap: 2px; }
.discard-row .card { margin-left: -34px; }
.discard-row .card:first-child { margin-left: 0; }
.discard-row .card.can-act { cursor: pointer; }
.discard-row .card.can-act:hover { transform: translateY(-12px); z-index: 5; box-shadow: 0 0 18px rgba(212,175,55,.7), var(--shadow-card); }

/* melds */
.melds-board {
  display: flex; flex-wrap: wrap; gap: .9rem; justify-content: center;
  width: 100%; padding: .4rem .2rem;
}
.meld {
  display: flex; padding: .45rem .55rem .3rem; border-radius: 10px;
  background: rgba(0,0,0,.25); border: 1px solid rgba(212,175,55,.2);
  flex-direction: column; align-items: center; gap: .15rem;
  transition: border-color .2s, box-shadow .2s;
}
.meld-cards { display: flex; }
.meld .card { width: 46px; height: 66px; padding: 3px 4px; margin-left: -18px; }
.meld .card:first-child { margin-left: 0; }
.meld .card .pip { font-size: 1.3rem; }
.meld .card .corner { font-size: .78rem; }
.meld-label { font-size: .68rem; color: rgba(250,245,233,.5); }
.meld.can-act { cursor: pointer; border-color: var(--gold); }
.meld.can-act:hover { box-shadow: 0 0 18px rgba(212,175,55,.5); }
.empty-melds { color: rgba(250,245,233,.35); font-size: .85rem; padding: 1rem; }

/* scoreboard */
.scoreboard {
  padding: .3rem 0 .6rem;
  border-bottom: 1px solid rgba(212,175,55,.15);
}
.sb-row {
  display: grid; grid-template-columns: 1fr 3.4rem 3.2rem;
  gap: .3rem; align-items: center;
  padding: .3rem .8rem; font-size: .84rem;
  border-left: 2px solid transparent;
  transition: background .3s, border-color .3s;
}
.sb-head { color: rgba(250,245,233,.45); font-size: .72rem; letter-spacing: .05em; }
.sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-round, .sb-total { text-align: right; font-weight: 600; }
.sb-round.pos { color: #8fe3b0; }
.sb-total { color: var(--gold-soft); }
.sb-turn { background: rgba(212,175,55,.1); border-left-color: var(--gold); }
.sb-you .sb-name { color: var(--gold-soft); }
.sb-round.bump { animation: score-bump .7s cubic-bezier(.2,.9,.3,1.4); }
@keyframes score-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.5); color: var(--gold); text-shadow: 0 0 12px rgba(212,175,55,.9); }
  100% { transform: scale(1); }
}

/* ปุ่มลบบอท */
.remove-bot {
  margin-left: .6rem; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 1px solid rgba(194,42,58,.6); background: transparent;
  color: #e8899a; font-size: .8rem; line-height: 1;
  transition: background .2s, color .2s;
}
.remove-bot:hover { background: var(--ruby); color: #ffe9ee; }
.lobby-players .host-tag { margin-left: auto; }
.lobby-players .host-tag + .remove-bot { margin-left: .6rem; }
.lobby-players li > span:nth-child(2) { margin-right: auto; }

/* log */
.game-log-wrap {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
  border-left: 1px solid rgba(212,175,55,.2);
  background: rgba(0,0,0,.3); backdrop-filter: blur(4px);
}
.game-log-title {
  font-size: .8rem; letter-spacing: .1em; color: var(--gold-soft);
  padding: .5rem .8rem; border-bottom: 1px solid rgba(212,175,55,.15);
}
.game-log { flex: 1; overflow-y: auto; padding: .5rem .8rem; font-size: .8rem; line-height: 1.7; color: var(--ivory-dim); }
.game-log div { animation: slide-in .25s ease both; }

/* bottom bar */
.bottom-bar { padding: .4rem 1.2rem .9rem; display: flex; flex-direction: column; gap: .4rem; }
.status-line { text-align: center; min-height: 1.5em; font-size: .95rem; color: var(--gold-soft); }
.status-line .urgent { color: #ffd980; font-weight: 600; }

.hand { display: flex; justify-content: center; min-height: 100px; padding-top: 12px; }
.hand .card { margin-left: -26px; cursor: pointer; }
.hand .card:first-child { margin-left: 0; }
.hand .card:hover { transform: translateY(-10px); z-index: 5; }
.hand .card.selected {
  transform: translateY(-16px);
  outline: 2px solid var(--gold);
  box-shadow: 0 0 16px rgba(212,175,55,.6), var(--shadow-card);
  z-index: 6;
}
.hand .card.must-use { outline: 2px dashed var(--red); outline-offset: 2px; }
.hand .card.dealt { animation: deal .4s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(6deg); } }

.actions { display: flex; justify-content: center; align-items: center; gap: .8rem; flex-wrap: wrap; }
.me-chip {
  display: flex; align-items: center; gap: .6rem; margin-right: 1rem;
  padding: .35rem 1rem; border-radius: 99px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(212,175,55,.25);
  font-weight: 600;
}
.me-score { color: var(--gold); }
.action-btn { min-width: 108px; }

/* ── แชท ── */
.chat-box {
  border: 1px solid rgba(212,175,55,.2); border-radius: 10px;
  background: rgba(0,0,0,.25); overflow: hidden;
}
.lobby-chat { margin: 0 auto 1.2rem; max-width: 420px; text-align: left; }
.chat-msgs {
  height: 130px; overflow-y: auto; padding: .5rem .7rem;
  font-size: .84rem; line-height: 1.7; color: var(--ivory-dim);
}
.chat-msgs:empty::before { content: 'ยังไม่มีข้อความ — ทักทายกันหน่อย!'; opacity: .4; font-size: .8rem; }
.chat-msg .chat-avatar { margin-right: .25rem; }
.chat-msg .chat-name { color: var(--gold-soft); font-weight: 600; }
.chat-msg.mine .chat-name { color: #8fe3b0; }
.chat-form { display: flex; gap: .4rem; padding: .45rem; border-top: 1px solid rgba(212,175,55,.15); }
.chat-form input { flex: 1; min-width: 0; font-size: .85rem; padding: .35rem .6rem; }
.game-chat { height: 120px; flex-shrink: 0; }
.game-log-wrap .chat-form { flex-shrink: 0; }

/* ── avatar ── */
.opp-head { display: flex; align-items: center; gap: .45rem; }
.opp-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; border-radius: 50%; font-size: 1.25rem;
  background: rgba(0,0,0,.35); border: 2px solid var(--gold-dim);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.opp.turn .opp-avatar { border-color: var(--gold); box-shadow: 0 0 12px rgba(212,175,55,.5); }
.me-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; font-size: 1.1rem;
  background: rgba(0,0,0,.35); border: 2px solid var(--gold-dim);
}
.meld-owners { font-size: .85rem; letter-spacing: .05em; margin-right: .15rem; }

/* ── emoji reactions ── */
.react-bar { display: flex; gap: .2rem; margin-left: 1rem; flex-wrap: wrap; }
.react-bar button {
  background: rgba(255,255,255,.05); border: 1px solid rgba(212,175,55,.25);
  border-radius: 99px; font-size: 1rem; padding: .22rem .42rem;
  transition: transform .15s, background .15s;
}
.react-bar button:hover { transform: scale(1.3); background: rgba(212,175,55,.15); }
.float-emoji {
  position: fixed; z-index: 300; font-size: 2.1rem; pointer-events: none;
  transform: translateX(-50%);
  animation: float-up 1.5s ease-out forwards;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.5));
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(.5); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -80px) scale(1.35); }
}

/* ไพ่ที่เพิ่งจั่ว */
.card.just-drawn {
  outline: 2px solid #38d47f; outline-offset: 2px;
  box-shadow: 0 0 16px rgba(56,212,127,.65), var(--shadow-card);
}

/* ── modal ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,8,6,.8); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal { max-height: 88vh; overflow-y: auto; animation: pop .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(20px); } }
.result-title { font-family: 'Chonburi', serif; text-align: center; color: var(--gold); font-size: 1.7rem; margin-bottom: 1.2rem; }
.result-table table { width: 100%; border-collapse: collapse; font-size: .95rem; }
#result-table table { width: 100%; border-collapse: collapse; }
#result-table th, #result-table td { padding: .5rem .7rem; text-align: right; border-bottom: 1px solid rgba(212,175,55,.15); }
#result-table th { color: var(--gold-soft); font-weight: 600; font-size: .82rem; }
#result-table td:first-child, #result-table th:first-child { text-align: left; }
#result-table .total { font-weight: 700; color: var(--gold); font-size: 1.05rem; }
#result-table .neg { color: #e8899a; }
#result-table .pos { color: #8fe3b0; }
#result-table .tag { font-size: .75rem; color: var(--gold); }
#result-table .grand { font-size: 1.1rem; font-weight: 700; }
.modal-actions { text-align: center; margin-top: 1.4rem; }

/* toast */
.toast {
  position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%) translateY(-150%);
  background: linear-gradient(160deg, #c04361, var(--ruby));
  color: #ffe9ee; padding: .7rem 1.6rem; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 200;
  font-weight: 600; transition: transform .3s cubic-bezier(.2,.9,.3,1.2), visibility .3s;
  max-width: 90vw; text-align: center;
  visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.toast.gold-toast { background: linear-gradient(160deg, #f3dc8f, var(--gold)); color: #241c05; }

/* ── responsive ── */
@media (max-width: 860px) {
  .panels { flex-direction: column; }
  .panel-divider span { writing-mode: horizontal-tb; border: none; }
  .panel-divider { justify-content: center; }
  .deco-frame { padding: 1.6rem 1.2rem; }
  .game-log-wrap { display: none; }
  .opponents { gap: .8rem; }
  .card { width: 52px; height: 74px; }
  .hand .card { margin-left: -22px; }
  .discard-row .card { margin-left: -30px; }
  .felt { border-radius: 40px; margin: 0 .4rem; }
  .actions .me-chip { margin-right: 0; }
}
