/* Bầu Cua Tôm Cá — Tết theme: lacquer red, imperial gold */
:root {
  --red-deep: #7a0c0c;
  --red: #b71c1c;
  --red-bright: #d32f2f;
  --gold: #ffc107;
  --gold-deep: #ff8f00;
  --cream: #fff8e1;
  --ink: #3e2723;
  --mat: #fffdf5;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

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

html { height: 100%; }

body {
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--cream);
  background:
    radial-gradient(ellipse at 50% -20%, #e53935 0%, transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 193, 7, 0.05) 0 12px, transparent 12px 24px),
    linear-gradient(180deg, #8e1111 0%, var(--red-deep) 45%, #4a0606 100%);
  background-attachment: fixed;
  padding-bottom: 12px;
}

/* ---------- header ---------- */
header {
  text-align: center;
  padding: 8px 16px 2px;
  position: relative;
}

.lanterns {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 18px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
  animation: sway 4s ease-in-out infinite;
  transform-origin: top center;
}
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

h1 {
  font-size: clamp(24px, 4.5vw, 34px);
  letter-spacing: 1px;
  color: var(--gold);
  text-shadow: 0 2px 0 #7a4f00, 0 5px 14px rgba(0, 0, 0, 0.55);
  font-weight: 800;
}

.subtitle { color: #ffe082; opacity: 0.9; font-size: clamp(12px, 2.2vw, 14px); margin-top: 0; }

.topbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* bilingual inline labels */
.label-en { opacity: 0.75; font-weight: 500; }
.btn-en { display: block; opacity: 0.72; font-weight: 500; font-size: 0.78em; line-height: 1.2; }
.msg-sep { opacity: 0.5; margin: 0 4px; }
.vi { }
.en { opacity: 0.82; }
.vi-block { display: block; }
.en-block { display: block; opacity: 0.78; font-style: italic; margin-top: 2px; }

.icon-btn {
  border: 2px solid var(--gold); background: rgba(0,0,0,.25); color: var(--cream);
  border-radius: 999px; width: 36px; height: 36px; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255, 193, 7, 0.2); }

/* ---------- layout ---------- */
main { max-width: 960px; margin: 0 auto; padding: 4px 14px; }

.hud {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

.hud-card {
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.15));
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 4px 18px;
  text-align: center;
  min-width: 140px;
  box-shadow: var(--shadow);
}
.hud-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #ffe082; }
.hud-card .value { font-size: clamp(17px, 3vw, 21px); font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.hud-card .value.flash-win { animation: flashwin 0.9s ease; }
.hud-card .value.flash-lose { animation: flashlose 0.9s ease; }
@keyframes flashwin { 0% { color: #69f0ae; transform: scale(1.25); } 100% { color: #fff; } }
@keyframes flashlose { 0% { color: #ff8a80; transform: scale(1.15); } 100% { color: #fff; } }

/* ---------- dice bowl ---------- */
.bowl-zone { display: flex; flex-direction: column; align-items: center; margin-bottom: 8px; }

.bowl {
  position: relative;
  width: min(290px, 84vw);
  height: 92px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(180deg, #9c2007, #5e1003);
  border: 3px solid var(--gold);
  box-shadow: inset 0 4px 14px rgba(0,0,0,.5), var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.die {
  width: 64px; height: 64px;
  background: var(--mat);
  border-radius: 14px;
  border: 2px solid #e0c97f;
  box-shadow: 0 4px 8px rgba(0,0,0,.4), inset 0 -3px 0 rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}
.die img.piece { width: 100%; height: 100%; object-fit: contain; }

.bowl.shaking { animation: shake 0.18s linear infinite; }
@keyframes shake {
  0% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-6px, 3px) rotate(-2deg); }
  50% { transform: translate(5px, -4px) rotate(2deg); }
  75% { transform: translate(-4px, -2px) rotate(-1deg); }
  100% { transform: translate(4px, 3px) rotate(1deg); }
}
.die.pop { animation: pop 0.45s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.2) rotate(-180deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

.message {
  min-height: 24px;
  margin-top: 4px;
  font-size: clamp(15px, 3.4vw, 19px);
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* ---------- betting mat ---------- */
.mat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: linear-gradient(180deg, #c62828, #8e1111);
  border: 4px solid var(--gold);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--shadow);
}

.cell {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 30%, #fffef8, #f6ecd2);
  border: 3px solid var(--gold-deep);
  border-radius: 14px;
  padding: 6px 6px 5px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
  overflow: hidden;
}
.cell:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(0,0,0,.35); }
.cell:active { transform: scale(0.97); }
.cell img.piece { width: min(78px, 15vw); height: min(78px, 15vw); object-fit: contain; }

.cell .names { display: flex; flex-direction: column; line-height: 1.15; }
.cell .vi-name { font-weight: 800; color: var(--red); font-size: clamp(13px, 2.6vw, 16px); }
.cell .en-name { font-weight: 600; color: #8d6e63; font-size: clamp(10px, 2vw, 12px); }

.cell .bet-badge {
  position: absolute;
  top: 6px; right: 6px;
  background: linear-gradient(180deg, #ffd54f, #ff8f00);
  color: var(--ink);
  border: 2px solid #fff;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  padding: 3px 9px;
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
  display: none;
  font-variant-numeric: tabular-nums;
}
.cell.has-bet .bet-badge { display: block; }

.cell.winner { animation: winnerGlow 1.6s ease 2; border-color: #2e7d32; }
@keyframes winnerGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(105, 240, 174, 0); }
  50% { box-shadow: 0 0 26px 8px rgba(105, 240, 174, 0.85); }
}
.cell .hit-count {
  position: absolute;
  top: 6px; left: 6px;
  background: #2e7d32; color: #fff;
  border-radius: 999px; padding: 3px 9px;
  font-weight: 800; font-size: 13px;
  display: none;
}
.cell.winner .hit-count { display: block; }

/* ---------- chips ---------- */
.chip-rack {
  display: flex; justify-content: center; gap: 10px;
  margin: 8px 0 2px; flex-wrap: wrap;
}
.chip {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 4px dashed rgba(255,255,255,.85);
  outline: 4px solid var(--c, #1565c0);
  background: var(--c, #1565c0);
  color: #fff;
  font-weight: 800; font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,.4), inset 0 -4px 0 rgba(0,0,0,.25);
  transition: transform 0.12s ease;
  font-variant-numeric: tabular-nums;
}
.chip:hover { transform: translateY(-4px); }
.chip.selected { transform: translateY(-8px) scale(1.12); box-shadow: 0 0 0 4px var(--gold), 0 10px 16px rgba(0,0,0,.45); }

.chip-hint { text-align: center; font-size: 12px; color: #ffe082; opacity: 0.85; margin-bottom: 6px; }

/* ---------- action buttons ---------- */
.actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.btn {
  border: 0; border-radius: 999px;
  padding: 8px 22px;
  font-size: 15px; font-weight: 800;
  display: inline-flex; flex-direction: column; align-items: center;
  line-height: 1.12;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.3), var(--shadow);
  transition: transform 0.1s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn:disabled { filter: grayscale(0.7) brightness(0.7); cursor: not-allowed; }
.btn-roll { background: linear-gradient(180deg, #ffd54f, #ff8f00); color: var(--ink); font-size: 17px; padding: 11px 36px; }
.btn-ghost { background: rgba(0,0,0,.3); color: var(--cream); border: 2px solid var(--gold); font-size: 13px; padding: 8px 16px; }

footer { text-align: center; margin-top: 10px; font-size: 13px; }

/* ---------- game switcher ---------- */
.game-switcher-wrap {
  display: flex; justify-content: center;
  padding: 6px 14px 2px;
}
.game-switcher {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.game-tab {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.3);
  border: 2px solid rgba(255,193,7,.4);
  border-radius: 12px;
  color: var(--cream);
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  text-align: left;
  line-height: 1.2;
}
.game-tab:hover { background: rgba(255,193,7,.15); border-color: var(--gold); transform: translateY(-2px); }
.game-tab.active {
  background: linear-gradient(180deg, rgba(255,193,7,.25), rgba(255,143,0,.2));
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255,193,7,.35);
}
.game-tab-emoji { font-size: 22px; line-height: 1; }
.game-tab-name .vi { font-weight: 700; font-size: 13px; }
.game-tab-name .en { font-size: 11px; opacity: 0.7; }
footer a { color: var(--gold); font-weight: 700; }

/* ---------- help page ---------- */
.help-wrap {
  max-width: 760px; margin: 0 auto; padding: 10px 16px 40px;
}
.help-card {
  background: var(--mat); color: var(--ink);
  border: 4px solid var(--gold); border-radius: 20px;
  padding: 26px 28px; box-shadow: var(--shadow);
}
.help-card h2 { color: var(--red); margin: 18px 0 8px; font-size: 22px; }
.help-card h2:first-child { margin-top: 0; }
.help-card p, .help-card li { line-height: 1.65; font-size: 16px; }
.help-card ol, .help-card ul { padding-left: 24px; margin: 6px 0; }
.help-card li { margin-bottom: 6px; }
.symbol-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px; margin: 12px 0;
}
.symbol-tile {
  text-align: center; background: #fff;
  border: 2px solid var(--gold-deep); border-radius: 14px; padding: 10px 6px;
}
.symbol-tile img.piece { width: 72px; height: 72px; object-fit: contain; }

/* ---------- legal documents ---------- */
.legal-doc h2 { font-size: 19px; margin: 22px 0 8px; }
.legal-doc p, .legal-doc li { font-size: 15px; }
.legal-doc a { color: var(--red); font-weight: 700; }
.legal-updated { color: #8a7a5a; font-style: italic; font-size: 13px !important; margin-bottom: 8px; }
.legal-banner {
  background: #fff3cd; border: 2px solid var(--gold-deep); border-radius: 12px;
  padding: 14px 16px; text-align: center; font-size: 16px; line-height: 1.5;
  margin-bottom: 18px; color: #7a0c0c;
}
.legal-links {
  text-align: center; margin: 18px 0 14px; font-size: 14px;
}
.legal-links a { color: var(--gold); font-weight: 700; }

/* ---------- VIP badge ---------- */
.vip-badge {
  display: inline-block;
  background: linear-gradient(180deg, #ffd700, #ff8f00);
  color: #7a0c0c;
  font-size: 12px; font-weight: 900;
  padding: 2px 8px; border-radius: 999px;
  vertical-align: middle; margin-left: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.symbol-tile .vi-name { font-weight: 800; color: var(--red); }
.symbol-tile .en-name { font-size: 13px; color: #8d6e63; }
.back-link { display: inline-block; margin: 14px 0; color: var(--gold); font-weight: 800; text-decoration: none; font-size: 16px; }
.back-link:hover { text-decoration: underline; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti span {
  position: absolute; top: -20px;
  font-size: 22px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: 0.6; } }

/* ── Share sheet ─────────────────────────────────────────────── */
.share-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.25s;
}
.share-overlay.visible { opacity: 1; }
.share-sheet {
  background: linear-gradient(180deg, #3a0808, #200404);
  border: 3px solid var(--gold); border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px; width: 100%; max-width: 520px;
  text-align: center;
  transform: translateY(60px); transition: transform 0.3s cubic-bezier(.2,1,.4,1);
}
.share-overlay.visible .share-sheet { transform: translateY(0); }
.share-sheet h3 { color: var(--gold); font-size: 20px; margin-bottom: 18px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }
.share-social {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--sc, #333); color: #fff;
  border: none; border-radius: 14px;
  padding: 12px 16px; cursor: pointer; text-decoration: none;
  font-size: 13px; font-weight: 700; min-width: 80px;
  transition: transform 0.12s, filter 0.12s;
}
.share-social:hover { transform: translateY(-3px); filter: brightness(1.15); }
.share-social span { font-size: 12px; }
.share-close {
  border: 2px solid var(--gold); background: transparent; color: var(--cream);
  border-radius: 999px; padding: 9px 28px; cursor: pointer; font-size: 14px; font-weight: 700;
}

/* ── Win modal ───────────────────────────────────────────────── */
.win-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.3s;
}
.win-overlay.visible { opacity: 1; }
.win-modal {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #7a0c0c 0%, #3a0404 60%, #1a0202 100%);
  border: 4px solid var(--gold);
  border-radius: 28px; padding: 32px 28px 28px;
  text-align: center; max-width: 400px; width: 92%;
  box-shadow: 0 0 60px rgba(255,193,7,.4), var(--shadow);
  transform: scale(0.7); transition: transform 0.4s cubic-bezier(.2,1.6,.4,1);
}
.win-overlay.visible .win-modal { transform: scale(1); }
.win-overlay.jackpot .win-modal { border-color: #ffe082; box-shadow: 0 0 80px rgba(255,224,130,.6), 0 0 140px rgba(255,193,7,.25), var(--shadow); }
.win-title {
  font-size: clamp(22px, 5vw, 30px); font-weight: 900;
  color: var(--gold); text-shadow: 0 2px 0 #7a4f00, 0 0 30px rgba(255,193,7,.8);
  margin-bottom: 6px; line-height: 1.2;
  animation: titlePulse 0.8s ease infinite alternate;
}
@keyframes titlePulse { from { text-shadow: 0 2px 0 #7a4f00, 0 0 20px rgba(255,193,7,.6); } to { text-shadow: 0 2px 0 #7a4f00, 0 0 50px rgba(255,193,7,1), 0 0 80px rgba(255,143,0,.5); } }
.win-subtitle { color: #ffe082; font-size: 16px; margin-bottom: 18px; }
.win-symbols {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.win-sym {
  background: rgba(255,255,255,.12); border: 2px solid var(--gold);
  border-radius: 14px; padding: 8px 12px;
  color: #fff; font-weight: 700; font-size: 13px; text-align: center;
}
.win-sym img { width: 56px; height: 56px; object-fit: contain; display: block; margin: 0 auto 4px; }
.win-amount {
  font-size: clamp(36px, 8vw, 52px); font-weight: 900;
  color: #69f0ae; text-shadow: 0 0 24px rgba(105,240,174,.7);
  margin-bottom: 22px;
}
.win-amount span { font-size: 0.45em; color: #a5d6a7; display: block; }
.win-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-share-win {
  background: linear-gradient(180deg, #ff8f00, #e65100);
  color: #fff; border: none; border-radius: 999px;
  padding: 12px 24px; font-size: 15px; font-weight: 800;
  cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.3);
  transition: transform 0.12s;
}
.btn-share-win:active { transform: translateY(2px); }
.btn-play-on {
  background: rgba(255,255,255,.1); color: var(--cream);
  border: 2px solid var(--gold); border-radius: 999px;
  padding: 12px 24px; font-size: 15px; font-weight: 800;
  cursor: pointer; transition: transform 0.12s;
}
.btn-play-on:active { transform: translateY(2px); }
.win-fireworks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fireworks-canvas { width: 100%; height: 100%; }

/* ── Share game button ───────────────────────────────────────── */
.share-game-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.3); border: 2px solid var(--gold);
  color: var(--gold); border-radius: 999px;
  padding: 7px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: none; margin-left: 8px;
  transition: background 0.15s, transform 0.12s;
}
.share-game-btn:hover { background: rgba(255,193,7,.15); transform: translateY(-2px); }

/* ── Chip rack — compact for 9 chips ────────────────────────── */
.chip-rack { gap: 7px; }
.chip { width: 46px; height: 46px; font-size: 11px; }

/* ── Topbar auth area ────────────────────────────────────────── */
#authArea {
  display: flex; align-items: center; gap: 6px;
}
.auth-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--gold); object-fit: cover;
}
.auth-name {
  font-size: 12px; color: #ffe082; max-width: 80px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-btn {
  border: 2px solid var(--gold); background: rgba(0,0,0,.3);
  color: var(--cream); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.topbar-btn:hover { background: rgba(255,193,7,.2); }
.topbar-btn--ghost {
  border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.65);
}
.topbar-btn--google {
  background: #fff; color: #3e2723; border-color: #fff;
  display: inline-flex; align-items: center; gap: 6px;
}
.topbar-btn--google:hover { background: #f1f1f1; }

/* ── Topbar buy + profile chip ───────────────────────────────── */
.topbar-btn--buy {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #4a0606; border-color: var(--gold);
  font-weight: 800;
}
.topbar-btn--buy:hover { filter: brightness(1.08); background: linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.profile-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.3); border: 2px solid var(--gold);
  border-radius: 999px; padding: 3px 10px 3px 3px; cursor: pointer;
  transition: background 0.15s;
}
.profile-chip:hover { background: rgba(255,193,7,.2); }
.auth-avatar--ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: #4a0606; font-weight: 800; font-size: 13px;
}

/* ── Login gate (mandatory sign-in) ──────────────────────────── */
body.locked main,
body.locked .game-switcher-wrap { filter: blur(5px); pointer-events: none; user-select: none; }
body.locked { overflow: hidden; }

.login-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(229,57,53,.55), transparent 60%),
    rgba(40, 4, 4, 0.88);
  opacity: 0; transition: opacity 0.3s;
}
.login-gate.visible { opacity: 1; }

.login-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, #8e1111 0%, #5e0808 100%);
  border: 2px solid var(--gold);
  border-radius: 26px;
  padding: 30px 26px 24px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.1);
  transform: translateY(24px) scale(.97);
  transition: transform 0.35s cubic-bezier(.2,1,.3,1);
}
.login-gate.visible .login-card { transform: translateY(0) scale(1); }

.login-lanterns { font-size: 22px; letter-spacing: 6px; margin-bottom: 8px;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.5)); animation: sway 4s ease-in-out infinite; }
.login-title {
  font-size: 30px; font-weight: 900; color: var(--gold);
  text-shadow: 0 2px 0 #7a4f00, 0 6px 16px rgba(0,0,0,.5);
  margin-bottom: 4px;
}
.login-tagline { font-size: 13px; color: #ffe082; line-height: 1.5; margin-bottom: 20px; }
.login-tagline span { opacity: 0.7; font-style: italic; }

.login-perks {
  list-style: none; text-align: left;
  background: rgba(0,0,0,.25); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.login-perks li { font-size: 13px; color: #fff; display: flex; align-items: baseline; gap: 9px; line-height: 1.35; }
.login-perks li span { font-size: 16px; flex-shrink: 0; }
.login-perks li b { color: var(--gold); }
.login-perks li em { color: rgba(255,255,255,.6); font-style: normal; font-size: 12px; }

.login-google {
  flex-direction: row; line-height: 1.2; padding: 13px 20px;
  font-size: 15px;
}
.login-google small { display: block; font-size: 11px; opacity: .65; font-weight: 600; }
.login-google.loading { opacity: .6; pointer-events: none; }

.login-fineprint { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 16px; line-height: 1.5; }
.login-fineprint em { font-style: italic; }

/* ── Profile modal ───────────────────────────────────────────── */
.profile-modal { position: relative; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 18px; }
.profile-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  border: 3px solid var(--gold); object-fit: cover;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.profile-avatar--ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: #4a0606; font-size: 34px; font-weight: 900;
}
.profile-name { font-size: 19px; font-weight: 800; color: #fff; }
.profile-email { font-size: 12px; color: #ffe082; opacity: .8; }

.profile-stats { display: flex; gap: 12px; margin-bottom: 16px; }
.profile-stat {
  flex: 1; background: rgba(0,0,0,.28); border: 1px solid rgba(255,193,7,.4);
  border-radius: 14px; padding: 12px 6px;
}
.profile-stat-val { font-size: 22px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.profile-stat-lbl { font-size: 11px; color: #ffe082; margin-top: 2px; }
.profile-meta { font-size: 12px; color: rgba(255,255,255,.75); margin-bottom: 20px; }
.profile-meta b { color: #fff; }
.profile-buy-btn { width: 100%; margin-bottom: 10px; }
.profile-modal .btn-ghost { width: 100%; }

/* ── Modal close X (corner) ──────────────────────────────────── */
.modal-x {
  position: absolute; top: 12px; right: 14px;
  background: rgba(0,0,0,.3); border: none; color: rgba(255,255,255,.7);
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 15px; cursor: pointer; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.modal-x:hover { background: rgba(0,0,0,.5); color: #fff; }

/* ── Generic modal overlay ───────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; transition: opacity 0.25s;
}
.modal-overlay.visible { opacity: 1; }

.modal-box {
  background: linear-gradient(180deg, #7a0c0c 0%, #4a0606 100%);
  border: 2px solid var(--gold);
  border-radius: 22px;
  padding: 28px 22px 22px;
  max-width: 420px; width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.7);
  text-align: center;
  transform: translateY(20px); transition: transform 0.25s;
}
.modal-overlay.visible .modal-box { transform: translateY(0); }

.modal-title {
  font-size: clamp(20px, 5vw, 26px); font-weight: 900;
  color: var(--gold); margin-bottom: 10px;
}
.modal-sub {
  font-size: 13px; color: #ffe082; line-height: 1.6;
  margin-bottom: 20px;
}
.modal-sub em { color: #fff9; font-style: normal; }

.modal-close-btn {
  margin-top: 14px; font-size: 13px; padding: 8px 20px;
}

/* ── Daily grant modal (celebratory pop-up) ──────────────────────── */
.daily-grant-overlay {
  background: rgba(0,0,0,.85);
  z-index: 950;
}

.daily-grant-modal {
  background: linear-gradient(180deg, #d4af37 0%, #f0d000 50%, #d4af37 100%);
  border: 3px solid #fff;
  border-radius: 28px;
  padding: 32px 24px 28px;
  max-width: 380px;
  box-shadow: 0 0 60px rgba(255,193,7,.5), 0 24px 80px rgba(0,0,0,.8);
  animation: dailyGrantPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dailyGrantPop {
  0% { transform: scale(0.6) rotateZ(-5deg); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1) rotateZ(0); opacity: 1; }
}

.daily-grant-title {
  font-size: 24px; font-weight: 900;
  color: #7a0c0c; margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(255,255,255,.4);
}

.daily-grant-icon {
  font-size: 72px; margin: 16px 0;
  animation: dailyGrantBounce 0.8s ease-in-out infinite;
}

@keyframes dailyGrantBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.daily-grant-amount {
  font-size: 36px; font-weight: 900;
  color: #7a0c0c; margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(255,255,255,.4);
}

.daily-grant-amount span {
  font-size: 14px; display: block;
  color: #8b4513; opacity: 0.8;
}

.daily-grant-text {
  font-size: 14px; color: #7a0c0c;
  line-height: 1.5; margin-bottom: 20px;
  font-weight: 600;
}

.daily-grant-text em {
  color: #333; font-style: normal;
  opacity: 0.75;
}

.daily-grant-close {
  background: linear-gradient(180deg, #7a0c0c 0%, #4a0606 100%);
  border: 2px solid #fff;
  color: var(--gold);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.daily-grant-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.4);
}

.daily-grant-close:active {
  transform: translateY(1px);
}

/* ── Google sign-in button ───────────────────────────────────── */
.btn-google {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #3e2723;
  border: none; border-radius: 999px;
  padding: 12px 24px; font-size: 15px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.35);
  transition: transform 0.12s, box-shadow 0.12s;
  width: 100%;
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.btn-google:active { transform: translateY(1px); }

/* ── Coin icon (replaces unsupported 🪙 emoji) ───────────────── */
.coin-ico {
  width: 1.15em; height: 1.15em;
  vertical-align: -0.22em;
  display: inline-block;
}
.shop-tokens .coin-ico { width: 1.3em; height: 1.3em; vertical-align: -0.28em; }
.modal-title .coin-ico { width: 1.1em; height: 1.1em; }

/* ── Shop modal ──────────────────────────────────────────────── */
.shop-modal { position: relative; }
.shop-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 4px;
}
.shop-card {
  position: relative;
  background: rgba(255,255,255,.08);
  border: 2px solid var(--gold);
  border-radius: 16px; padding: 16px 8px 14px;
  cursor: pointer; color: var(--cream);
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.shop-card:hover { background: rgba(255,193,7,.15); transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.shop-card:active { transform: translateY(0); }
.shop-card--tagged { border-color: #69f0ae; }
.shop-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: #69f0ae; color: #0a3d1f;
  font-size: 9px; font-weight: 800; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.shop-tokens { font-size: 17px; font-weight: 900; color: var(--gold); }
.shop-label { font-size: 12px; line-height: 1.4; }
.shop-label .vi { font-weight: 700; }
.shop-label .en { font-size: 11px; color: #fff9; }
.shop-price {
  font-size: 19px; font-weight: 900;
  color: #69f0ae; margin-top: 4px;
}
.shop-processing { font-size: 12px; opacity: .7; line-height: 1.3; }

/* ── Toast notification ──────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #212121; color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 9999; opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  text-align: center; max-width: 88vw;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .mat { gap: 8px; padding: 10px; }
  .die { width: 60px; height: 60px; }
  .bowl { height: 100px; }
  .topbar { position: static; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
  .shop-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .chip { width: 40px; height: 40px; font-size: 10px; }
}
