/* 豪彩城 — 玩家端樣式 */
:root {
  --bg: #0b0708;
  --bg2: #140c0d;
  --panel: #1b1112;
  --panel2: #241617;
  --line: rgba(232, 193, 120, 0.16);
  --line2: rgba(232, 193, 120, 0.32);
  --gold: #e8c178;
  --gold2: #f7dfa3;
  --gold3: #b8873a;
  --red: #b3122b;
  --red2: #e0303f;
  --text: #f3e9dc;
  --muted: #a8968a;
  --ok: #4fbf7f;
  --warn: #e0a43a;
  --radius: 14px;
  --nav-h: 64px;
  --head-h: 58px;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(179, 18, 43, 0.28), transparent 70%),
    radial-gradient(800px 400px at 100% 0, rgba(232, 193, 120, 0.08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--gold); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 頂部 ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--head-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(11, 7, 8, 0.96), rgba(11, 7, 8, 0.86));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand img { width: 34px; height: 34px; }
.brand .word {
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-weight: 900; font-size: 22px; letter-spacing: 3px;
  background: linear-gradient(180deg, var(--gold2), var(--gold) 55%, var(--gold3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top .grow { flex: 1; }
.top-nav { display: none; gap: 4px; }
.top-nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-size: 15px; }
.top-nav a.on, .top-nav a:hover { color: var(--gold2); background: rgba(232, 193, 120, 0.08); }

.wallet-pill {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 6px 0 12px;
  border-radius: 19px; border: 1px solid var(--line2);
  background: linear-gradient(180deg, #2a1a15, #1a100e);
  color: var(--gold2); font-weight: 700;
}
.wallet-pill .coin { width: 20px; height: 20px; }
.wallet-pill .plus {
  width: 26px; height: 26px; border-radius: 13px; border: 0;
  background: linear-gradient(180deg, var(--red2), var(--red)); color: #fff;
  display: grid; place-items: center; font-size: 18px; line-height: 1;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; letter-spacing: 1px; white-space: nowrap;
  transition: transform 0.08s ease, filter 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold { background: linear-gradient(180deg, var(--gold2), var(--gold) 50%, var(--gold3)); color: #2a1606; box-shadow: 0 6px 18px rgba(232, 193, 120, 0.18); }
.btn-red { background: linear-gradient(180deg, var(--red2), var(--red)); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line2); color: var(--gold2); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- 主體 ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 28px); }
.page-title { font-size: 22px; font-weight: 800; margin: 6px 0 16px; letter-spacing: 1px; }
.page-title small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 8px; letter-spacing: 0; }

.panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.panel + .panel, .panel + .grid2, .grid2 + .panel, .grid2 + .grid2 { margin-top: 14px; }
.grid2 > .panel { margin: 0; }
.panel h3 { margin: 0 0 12px; font-size: 16px; color: var(--gold2); letter-spacing: 1px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }

/* ---------- 公告跑馬燈 ---------- */
.marquee {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 14px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(27, 17, 18, 0.7);
  overflow: hidden; font-size: 14px;
}
.marquee .tag { flex: none; color: var(--gold); font-weight: 700; }
.marquee .track { flex: 1; overflow: hidden; white-space: nowrap; position: relative; }
.marquee .track span { display: inline-block; padding-left: 100%; animation: scroll 26s linear infinite; }
@keyframes scroll { to { transform: translateX(-100%); } }

/* ---------- 首頁橫幅 ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--line2);
  padding: 22px 20px; margin-bottom: 18px;
  background:
    radial-gradient(500px 220px at 85% 50%, rgba(232, 193, 120, 0.22), transparent 70%),
    linear-gradient(120deg, #3a0a12, #1c0b0c 60%, #120a0a);
}
.hero h1 {
  margin: 0 0 6px; font-family: "Noto Serif TC", serif; font-size: 28px; letter-spacing: 4px;
  background: linear-gradient(180deg, var(--gold2), var(--gold) 60%, var(--gold3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0 0 14px; color: #dcc9b4; font-size: 14px; }
.hero .daily { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero .daily .amt { font-size: 15px; color: var(--gold2); }
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px;
  background: url(/icons/coin-128.png) center/contain no-repeat; opacity: 0.16; transform: rotate(-12deg);
}

/* ---------- 分類頁籤 ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; height: 36px; padding: 0 16px; border-radius: 18px;
  border: 1px solid var(--line); background: rgba(27, 17, 18, 0.8); color: var(--muted); font-size: 14px;
}
.tabs button.on { color: #2a1606; border-color: transparent; background: linear-gradient(180deg, var(--gold2), var(--gold)); font-weight: 700; }

/* ---------- 遊戲卡 ---------- */
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.game {
  position: relative; aspect-ratio: 5 / 4; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #1a0f10 center/cover no-repeat;
  cursor: pointer; transition: transform 0.15s, border-color 0.15s;
}
.game:hover { transform: translateY(-2px); border-color: var(--line2); }
.game .shade { position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(transparent, rgba(0, 0, 0, 0.88)); }
.game .name { position: absolute; left: 10px; right: 10px; bottom: 8px; font-size: 14px; font-weight: 700; line-height: 1.3; text-shadow: 0 1px 2px #000; }
.game .badge {
  position: absolute; top: 6px; left: 6px; padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
}
.badge.hot { background: var(--red2); color: #fff; }
.badge.new { background: var(--gold); color: #2a1606; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.cat-head h2 { margin: 0; font-size: 17px; letter-spacing: 1px; }
.cat-head h2::before { content: ""; display: inline-block; width: 4px; height: 16px; margin-right: 8px; vertical-align: -2px; border-radius: 2px; background: var(--gold); }

/* ---------- 底部導覽 ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(14, 9, 10, 0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 12px; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.on { color: var(--gold2); }

/* ---------- 表單 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; color: #d9c6b2; }
.field input, .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line2); background: #120b0c; color: var(--text); outline: none;
}
.field textarea { height: auto; padding: 10px 14px; }
.field input:focus { border-color: var(--gold); }
.field .hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14px; line-height: 1.55; color: #d9c6b2; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); flex: none; }
.err { color: #ff7a7a; font-size: 14px; min-height: 20px; margin: 4px 0 8px; }

/* ---------- 對話框 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.7); }
.modal .box {
  width: 100%; max-width: 420px; max-height: 92vh; overflow: auto;
  background: linear-gradient(180deg, #2a1819, #170e0f); border: 1px solid var(--line2);
  border-radius: 18px; padding: 22px;
}
.modal .box h2 { margin: 0 0 16px; font-size: 20px; text-align: center; color: var(--gold2); letter-spacing: 2px; }
.modal .switch { text-align: center; margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ---------- 商城 ---------- */
.packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pack {
  position: relative; text-align: center; cursor: pointer;
  padding: 18px 10px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #2b1a17, #1a0f0f);
  transition: border-color 0.15s, transform 0.15s;
}
.pack:hover { border-color: var(--line2); transform: translateY(-2px); }
.pack.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 8px 24px rgba(232, 193, 120, 0.15); }
.pack img { width: 52px; height: 52px; }
.pack .coins { font-size: 20px; font-weight: 800; color: var(--gold2); margin: 6px 0 2px; }
.pack .bonus { font-size: 12px; color: var(--ok); min-height: 16px; }
.pack .price { margin-top: 8px; font-size: 16px; font-weight: 700; }
.pack .label { position: absolute; top: -1px; right: -1px; padding: 3px 8px; border-radius: 0 14px 0 10px; background: var(--red2); color: #fff; font-size: 11px; font-weight: 700; }
.notice { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(224, 164, 58, 0.4); background: rgba(224, 164, 58, 0.08); color: #f0d3a0; font-size: 13px; line-height: 1.6; }

/* ---------- 列表 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .main { flex: 1; min-width: 0; }
.list .t { font-size: 14px; }
.list .d { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .amt { font-weight: 700; font-size: 15px; }
.plus-amt { color: var(--ok); }
.minus-amt { color: #ff8a80; }
.empty { padding: 26px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- VIP ---------- */
.vip-card {
  border-radius: 18px; padding: 20px; margin-bottom: 14px;
  background: linear-gradient(135deg, #4a2a10, #2a170c 50%, #160d0a); border: 1px solid var(--line2);
}
.vip-card .lv { font-family: "Noto Serif TC", serif; font-size: 30px; font-weight: 900; color: var(--gold2); letter-spacing: 2px; }
.bar { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 12px 0 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold3), var(--gold2)); border-radius: 5px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-weight: 400; font-size: 13px; }
.tbl tr.me td { color: var(--gold2); font-weight: 700; }

/* ---------- 遊戲畫面 ---------- */
.player { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; }
.player .bar2 { flex: none; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: #120b0c; border-bottom: 1px solid var(--line); }
.player .bar2 .title { flex: 1; font-weight: 700; font-size: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player iframe { flex: 1; width: 100%; border: 0; background: #000; }
.demo-tip { flex: none; padding: 6px 12px; font-size: 12px; text-align: center; color: #f0d3a0; background: rgba(224, 164, 58, 0.12); }

/* ---------- 頁尾 ---------- */
.foot { margin-top: 30px; padding: 20px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.8; }
.foot .rating { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #d32f2f; color: #ff6b6b; font-weight: 900; font-size: 13px; margin-right: 10px; flex: none; }
.foot .links { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.doc h2 { font-size: 17px; color: var(--gold2); margin: 22px 0 10px; }
.doc p, .doc li { line-height: 1.8; font-size: 15px; color: #e6d8c8; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; top: 74px; z-index: 100; transform: translateX(-50%);
  max-width: 90vw; padding: 12px 18px; border-radius: 12px;
  background: #2a1a17; border: 1px solid var(--line2); color: var(--gold2); font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: pop 0.2s ease;
}
.toast.bad { color: #ffb3b3; border-color: rgba(255, 100, 100, 0.4); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -8px); } }

.spinner { width: 28px; height: 28px; margin: 30px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 大螢幕 ---------- */
@media (min-width: 700px) {
  .games { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .packs { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .hero { padding: 34px 36px; }
  .hero h1 { font-size: 36px; }
}
@media (min-width: 1000px) {
  :root { --nav-h: 0px; }
  .bottom-nav { display: none; }
  .top { padding: 0 28px; }
  .top-nav { display: flex; }
  .games { grid-template-columns: repeat(5, 1fr); }
  main { padding: 24px 28px 40px; }
}
