/* DonutDeal — one accent, glass surfaces, 8px rhythm. */

:root {
  --bg: #06080c;
  --bg-2: #0a0d13;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-2: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.11);
  --text: #eef1f7;
  --muted: #8b93a5;
  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, 0.16);
  --accent-line: rgba(47, 107, 255, 0.45);
  --win: #35d39a;
  --loss: #ff5d73;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-float: 0 32px 80px rgba(0, 0, 0, 0.72), 0 4px 18px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(47, 107, 255, 0.16), transparent 62%),
    radial-gradient(760px 520px at 4% 6%, rgba(47, 107, 255, 0.07), transparent 58%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 "Inter", "SF Pro Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.15; font-weight: 650; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.02rem; letter-spacing: -0.015em; }
p { margin: 0; }

/* --------------------------------------------------------------- shell */

.app {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100vh;
  align-items: start;
}

.main { min-width: 0; display: flex; flex-direction: column; }

/* ----------------------------------------------------------------- chat */

.chat {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(12px);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 16px;
  font-size: 0.76rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.chat-head b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.chat-collapse {
  margin-left: auto;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 6px;
  color: var(--muted); font-size: 1rem; line-height: 1;
}
.chat-collapse:hover { color: var(--text); background: var(--glass-2); }

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.chat-empty { color: var(--muted); font-size: 0.82rem; }

.msg {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 4px;
  border-radius: 8px;
}
.msg:hover { background: rgba(255, 255, 255, 0.025); }
.msg img { width: 20px; height: 20px; border-radius: 4px; background: #151a24; image-rendering: pixelated; }
.msg-name { font-size: 0.76rem; font-weight: 600; color: #c6cedd; }
.msg-name.is-you { color: var(--accent); }
.msg-text { font-size: 0.85rem; color: #dfe5ef; overflow-wrap: anywhere; }
.msg-time { font-size: 0.64rem; color: #5d6674; margin-left: 6px; font-variant-numeric: tabular-nums; }

.chat-form { display: flex; gap: 8px; padding: 12px 16px 8px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; min-width: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.18s ease;
}
.chat-form input:focus { border-color: var(--accent-line); }
.chat-form input:disabled { opacity: 0.55; }
.chat-form button {
  width: 38px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  transition: opacity 0.18s ease;
}
.chat-form button:disabled { opacity: 0.4; }
.chat-note { padding: 0 16px 16px; font-size: 0.66rem; color: #5d6674; }

/* --------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1rem; letter-spacing: -0.02em; }
.brand-logo {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px;
  background: radial-gradient(circle at 34% 28%, rgba(47, 107, 255, 0.35), rgba(47, 107, 255, 0.05) 70%);
  box-shadow: inset 0 0 0 1px rgba(47, 107, 255, 0.35);
  padding: 3px;
  object-fit: contain;
  mix-blend-mode: screen;
}
.brand-word span { color: var(--accent); }
.brand:hover .brand-logo { box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 24px rgba(47, 107, 255, 0.35); }

.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500; color: var(--muted);
  transition: color 0.16s ease, background 0.16s ease;
}
.topnav a:hover { color: var(--text); background: var(--glass-2); }
.topnav a.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(47, 107, 255, 0.25); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.balance-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 11px;
  font-weight: 600; font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(12px);
}

.coin {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25);
  flex: none;
}
.coin-sm { width: 10px; height: 10px; }

.menu-wrap { position: relative; }

.wallet-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent);
  border: 0; border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em;
  color: #fff;
  transition: filter 0.16s ease, transform 0.16s ease;
}
.wallet-btn:hover { filter: brightness(1.08); }
.wallet-icon { font-size: 0.8rem; opacity: 0.85; }
.chev { font-size: 0.6rem; opacity: 0.75; }

.avatar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 8px 3px 3px;
}
.avatar-btn:hover { border-color: var(--line-2); }
.avatar-btn img { width: 26px; height: 26px; border-radius: 50%; background: #151a24; image-rendering: pixelated; }

.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 236px;
  background: rgba(12, 15, 21, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-float);
  z-index: 40;
}
.dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.85rem; text-align: left; color: #dfe5ef;
}
.dropdown button:hover { background: var(--glass-2); }

.dd-icon {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--glass-2);
  color: var(--muted); font-size: 0.8rem;
  flex: none;
}
.dd-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.dd-title {
  padding: 10px 10px 12px;
  font-size: 0.76rem; color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dd-rakeback { align-items: flex-start !important; }
.dd-rb-text { display: flex; flex-direction: column; line-height: 1.3; }
.dd-rb-text small { color: var(--muted); font-size: 0.7rem; }
.dd-rb-value { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- views */

main { padding: 32px clamp(16px, 3vw, 40px) 72px; }
.view { max-width: 1200px; margin: 0 auto; }

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.64rem; font-weight: 600; color: var(--accent);
  margin-bottom: 12px;
}

/* ------------------------------------------------------------------ home */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 32px;
  align-items: stretch;
}

.hero-copy {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background:
    linear-gradient(150deg, rgba(47, 107, 255, 0.18), rgba(255, 255, 255, 0.02) 58%),
    rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column; justify-content: center;
}
.hero-copy h1 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); margin-bottom: 8px; }
.hero-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; max-width: 46ch; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.hero-cards { display: grid; grid-template-columns: 1fr; gap: 8px; }
.promo {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 0;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.promo:hover { border-color: var(--line-2); background: var(--glass-2); }
.promo h3 { font-size: 0.9rem; font-weight: 600; }
.promo p { font-size: 0.78rem; color: var(--muted); }
.promo-tag {
  align-self: flex-start;
  font-size: 0.6rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px; padding: 2px 8px;
  margin-bottom: 2px;
}
.promo-soon { margin-top: 4px; font-size: 0.68rem; color: #6b7488; }
.promo-link { margin-top: 4px; font-size: 0.76rem; font-weight: 600; color: var(--accent); }

.section-title { font-size: 1.02rem; font-weight: 600; margin: 8px 0 16px; color: #cfd6e2; }
.section-banner {
  display: block;
  width: 100%;
  max-height: 104px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  margin: 8px 0 16px;
}

.originals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }

.orig {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  backdrop-filter: blur(12px);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.orig::after {
  content: "";
  position: absolute; inset: -40% 30% 55% -10%;
  background: radial-gradient(closest-side, rgba(47, 107, 255, 0.22), transparent);
  opacity: 0; transition: opacity 0.2s ease;
}
.orig:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.orig:hover::after { opacity: 1; }
.orig-art {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 2.6rem;
  opacity: 0.9;
  filter: saturate(0.65);
  transform: translateY(-14%);
}
.orig-name { position: relative; font-weight: 650; letter-spacing: -0.015em; font-size: 0.92rem; }
.orig-brand { position: relative; font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase; color: #626b7e; }

.strip { margin-top: 32px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.strip > div {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.strip-label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.strip-value { font-weight: 650; font-size: 1.02rem; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- games */

.game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.game-head h1 { font-size: 1.5rem; }
.head-pill {
  font-size: 0.7rem; color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px;
}
.round-tag { margin-left: auto; font-size: 0.66rem; letter-spacing: 0.1em; color: #5d6674; font-variant-numeric: tabular-nums; }

.game-layout { display: grid; grid-template-columns: 304px minmax(0, 1fr); gap: 16px; align-items: start; }

.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 24px;
}
.controls { display: flex; flex-direction: column; gap: 12px; }

.ctl-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); display: flex; justify-content: space-between; align-items: center;
}
.ctl-hint { color: var(--text); font-weight: 650; letter-spacing: 0; }

.amount-field {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: border-color 0.16s ease;
}
.amount-field:focus-within { border-color: var(--accent-line); }
.amount-field input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  font-size: 1rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.quick-bets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-bets button {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 0;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.quick-bets button:hover { color: var(--text); border-color: var(--line-2); background: var(--glass-2); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 10%), rgba(255, 255, 255, 0.09) var(--fill, 10%));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 4px solid var(--accent);
  cursor: pointer;
}
.range-scale { display: flex; justify-content: space-between; font-size: 0.62rem; color: #5d6674; }

.btn-primary, .btn-success, .btn-ghost {
  border: 0; border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-weight: 650; font-size: 0.86rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center;
  transition: filter 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.09); }
.btn-success { background: rgba(53, 211, 154, 0.16); color: var(--win); box-shadow: inset 0 0 0 1px rgba(53, 211, 154, 0.35); }
.btn-success:hover:not(:disabled) { background: rgba(53, 211, 154, 0.24); }
.btn-success:disabled, .btn-primary:disabled { opacity: 0.38; cursor: not-allowed; filter: none; }
.btn-ghost { background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--glass-2); }
.btn-block { width: 100%; }

.ctl-foot {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 0.72rem; color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.ctl-foot b { color: var(--text); font-variant-numeric: tabular-nums; }

.panel-copy { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented button {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 4px;
  font-size: 0.74rem; font-weight: 600;
  color: var(--muted);
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.segmented button small { font-size: 0.58rem; color: #5d6674; font-weight: 500; }
.segmented button:hover { color: var(--text); border-color: var(--line-2); }
.segmented button.active { color: var(--text); background: var(--accent-soft); border-color: var(--accent-line); }

/* ------------------------------------------------------------- art slots */

.brand-mark { position: relative; width: 46px; height: 46px; flex: none; }
.brand-img {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the emblem's near-black backdrop screens away into the dark header,
     so only the artwork and its glow sit on the bar */
  mix-blend-mode: screen;
  filter: saturate(1.08) drop-shadow(0 0 12px rgba(47, 107, 255, 0.4));
}
.brand-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.brand-mark.has-art .brand-img { display: block; }
.brand-mark.has-art .brand-fallback { display: none; }

.originals { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.orig { aspect-ratio: 5 / 6; }
.orig-img { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.orig-emoji {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 2.6rem; opacity: 0.9;
  filter: saturate(0.65);
  transform: translateY(-14%);
}
.orig.has-art { padding: 0; border-color: transparent; background: none; }
.orig.has-art .orig-img { display: block; }
.orig.has-art .orig-emoji,
.orig.has-art .orig-name,
.orig.has-art .orig-brand { display: none; }
.orig.has-art::after { display: none; }

/* ------------------------------------------------------------------ dice */

.table-dice { background: radial-gradient(120% 90% at 50% 0%, rgba(47, 107, 255, 0.12), transparent 64%), var(--glass); }
.dice-stage { display: flex; flex-direction: column; gap: 24px; padding: 16px 8px; }
.dice-value { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; text-align: center; }
.dice-value.win { color: var(--win); }
.dice-value.loss { color: var(--loss); }
.dice-track { position: relative; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
.dice-band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: rgba(47, 107, 255, 0.35); transition: left 0.2s ease, width 0.2s ease; }
.dice-marker { position: absolute; top: -6px; width: 3px; height: 24px; margin-left: -1px; border-radius: 2px; background: #fff; transition: left 0.35s ease; }

/* ------------------------------------------------------------------ table */

.table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(47, 107, 255, 0.09), transparent 62%),
    var(--glass);
  backdrop-filter: blur(12px);
  padding: 24px;
  min-height: 440px;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.table-note { text-align: center; font-size: 0.78rem; color: var(--muted); }

.mines-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 560px; width: 100%; margin: 0 auto; }
.mine-tile {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  font-size: 1.15rem;
  display: grid; place-items: center;
  transition: transform 0.12s ease, border-color 0.18s ease, background 0.18s ease;
}
.mine-tile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent-line); }
.mine-tile:disabled { cursor: default; }
.mine-tile.is-gem { background: rgba(47, 107, 255, 0.16); border-color: var(--accent-line); }
.mine-tile.is-mine { background: rgba(255, 93, 115, 0.08); border-color: rgba(255, 93, 115, 0.3); opacity: 0.7; }
.mine-tile.is-hit { background: rgba(255, 93, 115, 0.22); border-color: var(--loss); }

.tower { display: flex; flex-direction: column; gap: 6px; max-width: 560px; width: 100%; margin: 0 auto; }
.tower-row { display: grid; grid-template-columns: 24px repeat(5, minmax(0, 1fr)); gap: 6px; align-items: center; }
.tower-floor { font-size: 0.62rem; color: #5d6674; text-align: right; font-variant-numeric: tabular-nums; }
.tower-tile {
  height: 36px; border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  font-size: 0.9rem;
  display: grid; place-items: center;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.tower-row.active .tower-tile { border-color: rgba(47, 107, 255, 0.35); }
.tower-row.active .tower-tile:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.tower-tile.is-gem { background: var(--accent-soft); border-color: var(--accent-line); }
.tower-tile.is-bomb { background: rgba(255, 93, 115, 0.2); border-color: rgba(255, 93, 115, 0.5); }
.tower-tile:disabled { cursor: default; }

.coin-stage { display: grid; place-items: center; padding: 8px 0 4px; }
.big-coin {
  width: 168px; height: 168px; border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.22), rgba(47, 107, 255, 0.55) 52%, rgba(47, 107, 255, 0.9));
  display: grid; place-items: center;
  box-shadow: 0 24px 60px rgba(47, 107, 255, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 0.4s ease;
}
.big-coin-face { font-weight: 700; font-size: 1.4rem; color: #fff; letter-spacing: 0.08em; }
.big-coin.flipping { animation: flip 0.9s ease-in-out; }
@keyframes flip {
  0% { transform: rotateY(0) scale(1); }
  45% { transform: rotateY(540deg) scale(1.05); }
  100% { transform: rotateY(1080deg) scale(1); }
}
.big-coin.is-win { box-shadow: 0 24px 60px rgba(53, 211, 154, 0.28), inset 0 0 0 1px rgba(53, 211, 154, 0.5); }
.big-coin.is-loss { filter: grayscale(0.4) brightness(0.8); }
.coin-choices { display: flex; flex-direction: column; gap: 8px; }

/* ------------------------------------------------------------- blackjack */

.table-blackjack { background: radial-gradient(120% 90% at 50% 0%, rgba(47, 107, 255, 0.12), transparent 66%), var(--glass); }
.bj-table {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(47, 107, 255, 0.06), rgba(0, 0, 0, 0.25));
  padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
}
.bj-seat { display: flex; flex-direction: column; gap: 8px; }
.bj-seat-label { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.bj-seat-label b { color: var(--text); font-size: 0.78rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.bj-cards { display: flex; gap: 8px; min-height: 96px; flex-wrap: wrap; }
.bj-card {
  width: 68px; height: 96px; border-radius: 10px;
  background: linear-gradient(160deg, #f7f9ff, #dfe6f4);
  color: #0d1118;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 8px 9px;
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
  animation: card-in 0.18s ease;
}
.bj-card small { font-size: 0.66rem; font-weight: 600; opacity: 0.7; }
.bj-card.red { color: #c6243c; }
.bj-card.back {
  background: repeating-linear-gradient(45deg, #17233c, #17233c 6px, #101a2e 6px, #101a2e 12px);
  color: rgba(255, 255, 255, 0.35);
  align-items: center;
  justify-content: center;
}
@keyframes card-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.bj-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bj-actions .btn-primary, .bj-actions .btn-ghost, .bj-actions .btn-success { flex: 1; min-width: 110px; }

/* ----------------------------------------------------------- case battles */

.battle-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.case-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.case-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.case-card.is-picked { border-color: var(--accent-line); background: var(--accent-soft); }
.case-tier { font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.case-name { font-size: 0.92rem; font-weight: 600; }
.case-price { font-size: 0.8rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.case-blurb { font-size: 0.72rem; color: var(--muted); line-height: 1.45; }

.battle-room { display: flex; flex-direction: column; gap: 12px; }
.battle-seats { display: grid; gap: 8px; }
.battle-seat {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--glass);
}
.battle-seat img { width: 26px; height: 26px; border-radius: 6px; background: #151a24; image-rendering: pixelated; }
.battle-seat .seat-name { font-size: 0.84rem; font-weight: 600; }
.battle-seat .seat-tag { margin-left: auto; font-size: 0.68rem; color: var(--muted); }
.battle-seat.is-open { opacity: 0.5; border-style: dashed; }
.battle-drop { margin-left: auto; font-weight: 650; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.battle-drop.win { color: var(--win); }

/* --------------------------------------------------------------- profile */

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-avatar { position: relative; flex: none; }
.profile-avatar img { width: 56px; height: 56px; border-radius: 14px; background: #151a24; image-rendering: pixelated; display: block; }
.online-tick {
  position: absolute; right: -2px; bottom: -2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.profile-sub { margin-top: 4px; font-size: 0.8rem; color: var(--muted); }
.profile-head > button { margin-left: auto; }

#profileBody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
#profileBody > .card:nth-child(4),
#profileBody > .card:nth-child(5) { grid-column: span 2; }

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 24px;
  margin: 0;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.card h2 { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 16px; }

.level-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.level-name { font-weight: 650; font-size: 1.05rem; }
.level-next { font-size: 0.74rem; color: var(--muted); }
.level-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.level-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.level-note { margin-top: 10px; font-size: 0.74rem; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.stat-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-value { font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pos { color: var(--win); }
.neg { color: var(--loss); }

.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.83rem; }
.kv:last-child { border-bottom: 0; padding-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv b { font-variant-numeric: tabular-nums; text-align: right; }

.tx-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; table-layout: fixed; }
.tx-table th {
  text-align: left; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600; padding: 0 8px 8px;
}
.tx-table th.num, .tx-table td.num { text-align: right; width: 92px; }
.tx-table th:last-child, .tx-table td:last-child { width: 84px; }
.tx-table td { padding: 10px 8px; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-type { font-size: 0.62rem; font-weight: 650; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; background: var(--glass-2); }
.tx-BET { color: #ffb3c1; }
.tx-PAYOUT { color: var(--win); }
.tx-DEPOSIT, .tx-VERIFICATION { color: var(--accent); }
.tx-WITHDRAWAL { color: #ffd166; }
.tx-ADMIN_ADJUST { color: var(--text); }

.loading { color: var(--muted); font-size: 0.85rem; }

/* ---------------------------------------------------------------- modals */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 5, 9, 0.66);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 24px;
}
.modal {
  width: min(460px, 100%);
  background: rgba(14, 18, 26, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-float);
  animation: modal-in 0.16s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
.modal h2 { font-size: 1.12rem; margin-bottom: 8px; }
.modal p { margin-bottom: 16px; font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.modal .amount-field { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions > * { flex: 1; }

.code-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  word-break: break-all;
  margin-bottom: 12px;
  user-select: all;
}

.code-field {
  width: 100%;
  margin-top: 4px;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.16s ease;
}
.code-field:focus { border-color: var(--accent-line); }

/* ---------------------------------------------------------------- toasts */

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: rgba(16, 20, 28, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.84rem;
  max-width: 320px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  animation: toast-in 0.18s ease;
}
.toast.err { border-left-color: var(--loss); }
.toast.ok { border-left-color: var(--win); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------ sign-in bar */

.preview-auth { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.btn-sm { padding: 9px 15px; font-size: 0.8rem; border-radius: 9px; }

/* ----------------------------------------------------------- chat toggle */

.chat-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: none;
}
.chat-toggle:hover { color: var(--text); border-color: var(--line-2); }

/* ----------------------------------------------------------- responsive */

.app.chat-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app.chat-collapsed .chat { display: none; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .hero-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-layout { grid-template-columns: 1fr; }
  .battle-shell { grid-template-columns: 1fr; }
  .originals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #profileBody { grid-template-columns: 1fr; }
  #profileBody > .card:nth-child(4), #profileBody > .card:nth-child(5) { grid-column: span 1; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .chat {
    position: fixed; inset: 0 auto 0 0; z-index: 55;
    width: min(300px, 86vw);
    display: none;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
  }
  .app.chat-drawer .chat { display: flex; }
  .app.chat-collapsed .chat { display: none; }
  .chat-toggle { display: inline-flex; }
  .topnav { display: none; }
  .originals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-cards { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 12px; }
  .brand-word { display: none; }
  .wallet-btn { padding: 10px 12px; }
  .wallet-label { display: none; }
  .balance-pill { padding: 7px 10px; font-size: 0.8rem; }
  main { padding: 20px 12px 56px; }
  .hero-copy { padding: 24px; }
  .panel, .table, .card { padding: 16px; }
  .game-head { flex-wrap: wrap; gap: 8px; }
  .game-head h1 { font-size: 1.25rem; }
  .round-tag { margin-left: 0; width: 100%; }
  .modal { padding: 20px; }
  .case-grid { grid-template-columns: 1fr; }
  .bj-card { width: 56px; height: 80px; }
}
