/* 醉好運・餐桌賭場 — Art Deco Speakeasy 主題
   色彩系統集中於變數（playbook §2：換膚只改這裡） */
:root {
  --felt: #0d3b2e;          /* 賭桌絨布墨綠 */
  --felt-deep: #082a20;
  --bg: #14100c;            /* 暗胡桃木底 */
  --bg-card: #1e1812;
  --gold: #cfa84a;          /* 黃銅金 */
  --gold-bright: #f0d48a;
  --cream: #f3e9d2;         /* 米白字 */
  --burgundy: #7b2d3b;      /* 酒紅 */
  --burgundy-bright: #a8455a;
  --ink: #0a0805;
  --win: #4caf7d;
  --lose: #d9596d;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,.45);
  --img-table-hero: url('/img/bg-table-hero.png');
  --img-dicecup: url('/img/prop-dicecup.png');
  --img-dice-set: url('/img/prop-dice-set.png');
  --img-chip-pile: url('/img/chip-stack-pile.png');
  --img-wheel-frame: url('/img/wheel-frame.png');
  --img-wheel-hub: url('/img/wheel-hub.png');
  --img-card-table-arc: url('/img/card-table-arc.png');
  --img-card-back: url('/img/card-back.png');
  --img-logo: url('/img/logo-mark.png');
  --img-curtain: url('/img/bg-stage-curtain.png');
  --img-polaroid: url('/img/frame-polaroid.png');
  --img-chip-10: url('/img/chip-10.png');
  --img-chip-50: url('/img/chip-50.png');
  --img-chip-100: url('/img/chip-100.png');
  --img-chip-500: url('/img/chip-500.png');
  --img-drink: url('/img/card-drink-penalty.png');
  --img-cheers: url('/img/card-cheers-all.png');
  --img-gift: url('/img/card-gift-drink.png');
  --img-comeback: url('/img/badge-comeback.png');
  --img-lounge: url('/img/bg-lounge-blur.png');
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #241b12 0%, var(--bg) 60%);
  color: var(--cream);
  font-family: 'Noto Serif TC', 'PingFang TC', 'Microsoft JhengHei', serif;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }

/* ── Art Deco 邊框/標題 ── */
.deco-frame {
  border: 1px solid rgba(207,168,74,.55);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(207,168,74,.08), rgba(0,0,0,.25));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0,0,0,.4);
  position: relative;
}
.deco-frame::before {
  content: ''; position: absolute; inset: 5px; pointer-events: none;
  border: 1px solid rgba(207,168,74,.25); border-radius: calc(var(--radius) - 5px);
}
.deco-title {
  font-weight: 700; letter-spacing: .35em; text-indent: .35em;
  color: var(--gold-bright); text-align: center;
  text-shadow: 0 0 18px rgba(207,168,74,.35);
}
.deco-divider {
  display: flex; align-items: center; gap: 10px; color: var(--gold); opacity: .8;
  font-size: 12px; letter-spacing: .3em; margin: 10px 0;
}
.deco-divider::before, .deco-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

/* ── 按鈕 ── */
.btn {
  border-radius: 10px; padding: 12px 18px; font-size: 16px; font-weight: 700;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--ink); letter-spacing: .1em;
  box-shadow: 0 3px 0 #8a6d28, 0 6px 14px rgba(0,0,0,.4);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6d28; }
.btn:disabled { filter: grayscale(.7) brightness(.6); cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid var(--gold); color: var(--gold-bright); box-shadow: none; }
.btn-danger { background: linear-gradient(180deg, var(--burgundy-bright), var(--burgundy)); color: var(--cream); box-shadow: 0 3px 0 #4a1b24; }
.btn-sm { padding: 8px 12px; font-size: 13px; }

/* ── 籌碼 ── */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  font-weight: 800; font-size: 15px; color: #fff; user-select: none;
  background-size: cover; background-position: center;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.55));
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  transition: transform .1s;
}
.chip:active { transform: scale(.92); }
.chip-10  { background-image: var(--img-chip-10); }
.chip-50  { background-image: var(--img-chip-50); }
.chip-100 { background-image: var(--img-chip-100); }
.chip-500 { background-image: var(--img-chip-500); }
.chip.selected { outline: 3px solid var(--gold-bright); outline-offset: 3px; transform: scale(1.08); }

/* ── 撲克牌 ── */
.pcard {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 52px; height: 74px; border-radius: 7px; background: #f7f2e6; color: #1a1a1a;
  font-weight: 800; font-size: 19px; box-shadow: 0 3px 8px rgba(0,0,0,.45);
  border: 1px solid #c9c1ab; position: relative;
}
.pcard.red { color: #b3303c; }
.pcard.back {
  background: var(--burgundy) var(--img-card-back) center/cover no-repeat;
  border: 1px solid var(--gold); color: transparent;
}
.pcard .suit { font-size: 15px; line-height: 1; }
@keyframes cardIn { from { transform: translateY(-26px) rotate(-7deg); opacity: 0; } to { transform: none; opacity: 1; } }
.pcard.dealt { animation: cardIn .35s ease-out; }

/* ── 骰子 ── */
.die {
  width: 56px; height: 56px; border-radius: 12px; background: #f7f2e6;
  display: grid; place-items: center; font-size: 40px; color: #1a1a1a;
  box-shadow: 0 4px 10px rgba(0,0,0,.5), inset 0 -4px 0 rgba(0,0,0,.12);
}
@keyframes shake {
  0%,100% { transform: translate(0,0) rotate(0); }
  20% { transform: translate(-7px,4px) rotate(-9deg); }
  40% { transform: translate(6px,-5px) rotate(7deg); }
  60% { transform: translate(-5px,-4px) rotate(-6deg); }
  80% { transform: translate(5px,5px) rotate(8deg); }
}
.shaking { animation: shake .35s linear infinite; }

/* ── 通用 ── */
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%);
  background: rgba(10,8,5,.92); border: 1px solid var(--gold); color: var(--cream);
  padding: 10px 20px; border-radius: 999px; font-size: 14px; z-index: 999;
  animation: toastIn .25s ease-out; max-width: 86vw; text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--gold); color: var(--gold-bright); }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.win-text { color: var(--win); } .lose-text { color: var(--lose); }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pop-in { animation: popIn .3s cubic-bezier(.2,1.6,.4,1); }
@keyframes flyUp { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-90px); opacity: 0; } }
.fly-up { animation: flyUp 1.1s ease-out forwards; position: absolute; pointer-events: none; font-weight: 800; }
