/* Shared styles for the play pages (lobby and table). */
:root {
  --felt: #2b2d31;
  --felt-2: #1e1f22;
  --felt-3: #3a3c42;
  --ink: #f3efe3;
  --ink-soft: #c9ccd1;
  --muted: #9a9ea6;
  --gold: #d4ae5a;
  --gold-2: #f0d48f;
  --red: #c9343c;
  --ok: #6fcf9f;
  --card: #fbf8f1;
  --card-ink: #16191a;
  --line: rgba(255,255,255,0.10);
  --panel: rgba(255,255,255,0.04);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--felt-2);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); }
button { font: inherit; }
html[data-lang="zh"] [lang="en"],
html[data-lang="en"] [lang="zh"] { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(30, 31, 34, 0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 16px; max-width: 1280px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: var(--felt-2);
}
.logo b { color: var(--gold); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip-btn {
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 0.85rem; white-space: nowrap;
  text-decoration: none;
}
.chip-btn:hover { color: var(--ink); border-color: rgba(255,255,255,0.3); }
.me-chip { display: none; align-items: center; gap: 8px; }
.me-chip img, .me-chip .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.me-chip .name { font-weight: 600; font-size: 0.9rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.signed-in .me-chip { display: inline-flex; }
@media (max-width: 560px) { .me-chip .name { display: none; } .logo span:last-child { display: none; } }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold); color: var(--felt-2); font-weight: 700; font-size: 0.8rem; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; font-weight: 600; cursor: pointer;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent;
}
.btn.primary { background: var(--gold); color: var(--felt-2); }
.btn.primary:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; color: var(--ink); border-color: rgba(255,255,255,0.22); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Playing cards ---------- */
/* Rank in the top-left and bottom-right corners, a large suit in the middle. */
.pc {
  --w: 44px; --h: 62px;
  position: relative;
  display: inline-grid; place-items: center;
  width: var(--w); height: var(--h); flex: none;
  background: var(--card); color: var(--card-ink);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.1);
  font-weight: 800; line-height: 1; user-select: none;
}
.pc .r { position: absolute; font-size: calc(var(--w) * 0.3); letter-spacing: -0.04em; }
.pc .r.tl { top: calc(var(--w) * 0.08); left: calc(var(--w) * 0.1); }
.pc .r.br { bottom: calc(var(--w) * 0.08); right: calc(var(--w) * 0.1); }
.pc .s { font-size: calc(var(--w) * 0.62); }
.pc.xs .r { font-size: calc(var(--w) * 0.36); }
.pc.xs .r.br { display: none; }
.pc.xs .s { font-size: calc(var(--w) * 0.5); margin-top: calc(var(--w) * 0.3); }
/* Four-color deck */
.pc.suit-s { color: #16191a; }
.pc.suit-h { color: #c9343c; }
.pc.suit-d { color: #1f5fbf; }
.pc.suit-c { color: #1f8a4c; }
.pc.joker { background: linear-gradient(150deg, #fff6db, #f0d48f); color: #5b2a86; }
.pc.back {
  background: repeating-linear-gradient(45deg, #7d1f27 0 6px, #6a1a21 6px 12px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3), inset 0 0 0 2px #f3e7c9;
}
.pc.slot { background: rgba(0,0,0,0.12); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.16); }
.pc.sm { --w: 32px; --h: 45px; border-radius: 5px; }
.pc.xs { --w: 28px; --h: 39px; border-radius: 4px; }

/* ---------- 2-7 game switch: SINGLE / TRIPLE draw, the selected one highlighted ---------- */
.game-switch {
  display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--line);
}
.game-switch .gs-opt {
  font: inherit; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; border: 0; background: none; color: var(--muted);
  white-space: nowrap; cursor: default;
}
.game-switch .gs-opt b { font-weight: 800; }
.game-switch button.gs-opt { cursor: pointer; }
.game-switch button.gs-opt:hover:not(.on) { color: var(--ink); background: rgba(255,255,255,0.06); }
.game-switch .gs-opt.on {
  background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: var(--felt-2);
  box-shadow: 0 0 0 1px rgba(240,212,143,0.5), 0 0 14px rgba(212,174,90,0.45);
}
.game-switch.big { padding: 4px; }
.game-switch.big .gs-opt { font-size: 0.95rem; padding: 10px 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--card); color: var(--card-ink);
  padding: 12px 18px; border-radius: 12px; font-size: 0.95rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4); transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
