/* Senkuro Casino Mini App — "HoYoverse soft anime" theme.
 * Deep indigo canvas, glassy lavender panels, soft large radii, purple-gradient
 * accents. All class/ID hooks match index.html + app.js. */

:root {
  --app-height: 100dvh;
  --tg-safe-top: 0px;
  --tg-safe-right: 0px;
  --tg-safe-bottom: 0px;
  --tg-safe-left: 0px;
  /* canvas */
  --bg: #0a0b1e;
  --bg2: #14163a;

  /* glass surfaces */
  --surface: rgba(40, 42, 92, 0.55);
  --surface-2: rgba(54, 56, 116, 0.6);
  --surface-solid: #1b1d44;
  --stroke: rgba(168, 158, 255, 0.16);
  --stroke-strong: rgba(168, 158, 255, 0.34);

  /* text */
  --text: #f3f0ff;
  --muted: #9b9bd0;

  /* accents */
  --accent: #a78bfa;
  --accent-2: #7c6cf5;
  --accent-grad: linear-gradient(135deg, #b9a6ff 0%, #7d6cf5 55%, #6a4ff0 100%);
  --accent-soft: rgba(140, 120, 255, 0.18);

  --gold: #ffd479;
  --green: #4ade80;
  --red: #fb7185;
  --blue: #60a5fa;

  --radius: 22px;
  --radius-sm: 16px;
  --shadow: 0 18px 40px rgba(6, 6, 26, 0.55);
  --shadow-sm: 0 8px 20px rgba(6, 6, 26, 0.4);
  --glow: 0 0 28px rgba(140, 110, 255, 0.45);

  /* Shared design-system scale. Theme blocks continue to own the palette;
   * components consume these semantic aliases for consistent geometry. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --control-sm: 36px;
  --control-md: 44px;
  --control-lg: 52px;
  --radius-xs: 10px;
  --radius-control: 14px;
  --radius-panel: var(--radius);
  --border-ui: 1px solid var(--stroke);
  --duration-fast: 120ms;
  --duration-ui: 200ms;
  --ease-ui: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-width: 0;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; }

/* The HTML `hidden` attribute must always win over the `display:flex/grid` rules
 * below (an author `display` overrides the UA `[hidden]{display:none}`, which
 * would otherwise force-show the modal, back button, action rows, etc.). */
[hidden] {
  display: none !important;
}

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100dvh;
  min-height: var(--app-height);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100dvh;
  min-height: var(--app-height);
  overflow-x: hidden;
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overscroll-behavior: none;
  background:
    radial-gradient(120% 70% at 50% -8%, rgba(140, 110, 255, 0.28), transparent 46%),
    radial-gradient(90% 60% at 100% 0%, rgba(90, 200, 255, 0.10), transparent 50%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 60%);
  background-attachment: fixed;
}

.muted {
  color: var(--muted);
}

/* ---- HEADER -------------------------------------------------------------- */

#topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + var(--tg-safe-top)) calc(16px + var(--tg-safe-right)) 12px calc(16px + var(--tg-safe-left));
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(12, 12, 36, 0.92), rgba(12, 12, 36, 0.5));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stroke);
}

.brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  color: var(--accent);
  text-shadow: var(--glow);
  font-size: 18px;
}

.brand-name {
  font-size: 17px;
  background: linear-gradient(90deg, #d9ccff, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ghost {
  width: var(--control-md);
  height: var(--control-md);
  flex: 0 0 auto;
  border-radius: 13px;
  cursor: pointer;
  font-size: 20px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.2s ease;
}

.ghost:active {
  transform: scale(0.92);
  background: var(--accent-soft);
}

.ghost:disabled { cursor: wait; opacity: 0.62; }
.ghost.is-loading { animation: refreshSpin 0.8s linear infinite; }
@keyframes refreshSpin { to { transform: rotate(360deg); } }

.connection-banner {
  position: sticky;
  top: 56px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text);
  background: rgba(120, 45, 65, 0.94);
  border-bottom: 1px solid rgba(251, 113, 133, 0.38);
  font-size: 13px;
  text-align: center;
  backdrop-filter: blur(14px);
}
.connection-banner.loading { background: rgba(35, 37, 84, 0.94); border-bottom-color: var(--stroke); }
.connection-banner button {
  min-height: 32px;
  padding: 5px 12px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 10px;
  color: inherit;
  background: rgba(255,255,255,0.1);
  font: inherit;
  font-weight: 700;
}
.connection-banner.loading button { display: none; }

/* ---- SIDEBAR ------------------------------------------------------------- */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 4, 18, 0.60);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 280px;
  max-width: 82vw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(18px + var(--tg-safe-top)) calc(18px + var(--tg-safe-right)) calc(18px + var(--tg-safe-bottom)) calc(18px + var(--tg-safe-left));
  background:
    radial-gradient(circle at 20% 0%, rgba(140, 110, 255, 0.3), transparent 40%),
    #0c0d26;
  border-right: 1px solid var(--stroke);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  will-change: transform;
}

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 620px) {
  input, select, textarea { font-size: 16px; }
  .connection-banner { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  #horrorFx, #lightningFlash, .blood-drip,
  .yinyang-bg-video, .dragon-bg-video { display: none !important; }
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.sidebar-head>div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-head strong {
  font-size: 15px;
}

.sidebar-head span {
  font-size: 12px;
}

.side-link {
  width: 100%;
  min-height: var(--control-lg);
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}

.side-link:active {
  transform: scale(0.98);
  background: var(--accent-soft);
}

.side-link.danger {
  color: var(--red);
  border-color: rgba(251, 113, 133, 0.3);
}

/* avatars (shared) */
.top-avatar,
.side-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.4), transparent 35%),
    linear-gradient(135deg, #a78bfa, #5ad1ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14), 0 6px 18px rgba(120, 90, 255, 0.4);
}

.side-avatar {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.top-avatar img,
.side-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar edit overlay */
.top-avatar {
  position: relative;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.top-avatar:hover { filter: brightness(1.15); }

.avatar-edit-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 13px;
  background: var(--surface-solid);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stroke-strong);
  line-height: 1;
}

/* Profile edit modal */
.profile-edit-modal {
  max-width: 340px;
  width: 90%;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-edit-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto;
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.4), transparent 35%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--stroke-strong), 0 6px 18px rgba(0,0,0,0.35);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-cam-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.prof-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: -8px;
}

.prof-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}

.prof-input:focus { border-color: var(--accent); }

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .primary { flex: 1; }
.modal-actions .ghost-btn { flex: 0 0 auto; }

/* ---- VIEWS --------------------------------------------------------------- */

#app {
  padding: 18px 16px 110px;
  max-width: 720px;
  margin: 0 auto;
}

.view > h1,
.view > h2 {
  margin: 0 0 var(--space-4);
  letter-spacing: -0.015em;
}

.view > h2:not(:first-child) {
  margin-top: var(--space-6);
}

.view {
  display: none;
  animation: fade 0.28s ease;
}

.view.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  text-align: center;
  margin: 10px 0 18px;
}

.hero h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #f7f2ff;
  text-shadow: 0 0 24px rgba(140, 110, 255, 0.5);
}

h2 {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  margin: 22px 4px 12px;
}

/* ---- PROFILE + BALANCE CARD (lobby hero) -------------------------------- */

.profile-card {
  position: relative;
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(140, 110, 255, 0.28), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-id {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.profile-id strong {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-id span {
  font-size: 13px;
}

.lvl-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 4px 14px rgba(120, 90, 255, 0.45);
}

.lvl-badge b {
  font-size: 13px;
}

/* XP progress under the profile row */
.xp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.xp-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(8, 8, 24, 0.6);
  border: 1px solid var(--stroke);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(140, 110, 255, 0.7);
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.xp-text {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.balance-card {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: linear-gradient(160deg, rgba(10, 10, 30, 0.6), rgba(20, 20, 50, 0.4));
  border: 1px solid var(--stroke);
}

.bal-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.bal-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 14px;
  flex-wrap: wrap;
}

.bal-main strong {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #fff, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bal-main .muted {
  font-size: 14px;
}

.topup-btn {
  width: 100%;
  border: none;
  border-radius: 13px;
  padding: 13px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: var(--accent-grad);
  box-shadow: 0 10px 24px rgba(120, 90, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.12s ease, filter 0.2s ease;
}

.topup-btn:active {
  transform: scale(0.98);
  filter: brightness(1.08);
}

.free-line {
  text-align: center;
  font-size: 12px;
  margin: 12px 0 0;
}

/* ---- GAME MENU (vertical list of games) --------------------------------- */

.game-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 88px;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(58, 50, 116, 0.7), rgba(26, 26, 60, 0.7));
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Dark gradient overlay for text readability over full-bleed game art */
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.75) 10%, rgba(0,0,0,0.48) 62%, rgba(0,0,0,0.22) 100%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.game-card::after {
  display: none; /* suppressed — full-bleed art replaces the thumbnail glow */
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--stroke-strong);
  box-shadow: var(--shadow), 0 0 22px rgba(140, 110, 255, 0.25);
}

.game-card:active {
  transform: scale(0.985);
}

.gc-info {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gc-info b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

.gc-info span {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.gc-art {
  display: none; /* image is now the full card background */
}

/* The card art is the focal point now that the taglines are gone — give the row
 * room and vertically center the image. */
.game-card {
  min-height: 116px;
}

.gc-info {
  justify-content: center;
}

.game-card.coin {
  background-image: url("assets/coinflip.webp");
  background-size: 185%;
  background-position: 71% 30%;
}

.game-card.bj {
  background-image: url("assets/blackjeck.webp");
}

.game-card.uno {
  background-image: url("assets/uno.webp");
}

.game-card.holdem {
  background-image: url("assets/Holdem.webp");
}

.game-card.roulette {
  background-image: url("assets/r.webp");
}

.game-card.slots {
  background-image: url("assets/banner-slots.webp");
}

.game-card.dice-game {
  background-image: url("assets/banner-dice.webp");
  background-position: center;
  background-repeat: no-repeat;
}

/* ---- Dragon & Yin-Yang only: ink painting full-bleed for game catalog ----- */
/* All other themes keep the .gc-art thumbnail; only dragon/yinyang go full-bleed */
[data-theme="dragon"] .game-card,
[data-theme="yinyang"] .game-card {
  min-height: 116px;
}

[data-theme="dragon"] .game-card.coin,
[data-theme="dragon"] .game-card.bj,
[data-theme="dragon"] .game-card.uno,
[data-theme="dragon"] .game-card.holdem,
[data-theme="dragon"] .game-card.roulette,
[data-theme="dragon"] .game-card.slots,
[data-theme="dragon"] .game-card.dice-game,
[data-theme="yinyang"] .game-card.coin,
[data-theme="yinyang"] .game-card.bj,
[data-theme="yinyang"] .game-card.uno,
[data-theme="yinyang"] .game-card.holdem,
[data-theme="yinyang"] .game-card.roulette,
[data-theme="yinyang"] .game-card.slots,
[data-theme="yinyang"] .game-card.dice-game {
  background-size: cover;
  background-position: center;
}

/* Overlay for ink paintings — matches game-row readability at compact height */
[data-theme="dragon"] .game-card.coin::before,
[data-theme="dragon"] .game-card.bj::before,
[data-theme="dragon"] .game-card.uno::before,
[data-theme="dragon"] .game-card.holdem::before,
[data-theme="dragon"] .game-card.roulette::before,
[data-theme="dragon"] .game-card.slots::before,
[data-theme="dragon"] .game-card.dice-game::before,
[data-theme="yinyang"] .game-card.coin::before,
[data-theme="yinyang"] .game-card.bj::before,
[data-theme="yinyang"] .game-card.uno::before,
[data-theme="yinyang"] .game-card.holdem::before,
[data-theme="yinyang"] .game-card.roulette::before,
[data-theme="yinyang"] .game-card.slots::before,
[data-theme="yinyang"] .game-card.dice-game::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.80) 10%, rgba(0,0,0,0.50) 65%, rgba(0,0,0,0.28) 100%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  animation: none;
}

/* (text readability and gc-art hidden are now global — see base .game-card rules) */

/* Ink image backgrounds */
[data-theme="dragon"] .game-card.coin,
[data-theme="yinyang"] .game-card.coin    { background-image: url('assets/coinflip-ink.webp'); background-position: center; }
[data-theme="dragon"] .game-card.bj,
[data-theme="yinyang"] .game-card.bj      { background-image: url('assets/blackjack-ink.webp'); background-position: center 40%; }
[data-theme="dragon"] .game-card.uno,
[data-theme="yinyang"] .game-card.uno     { background-image: url('assets/uno-ink.webp'); background-position: center 60%; }
[data-theme="dragon"] .game-card.holdem,
[data-theme="yinyang"] .game-card.holdem  { background-image: url('assets/holdem-ink.webp'); background-position: center 50%; }
[data-theme="dragon"] .game-card.roulette,
[data-theme="yinyang"] .game-card.roulette { background-image: url('assets/roulette-ink.webp'); background-position: center 50%; }
[data-theme="dragon"] .game-card.slots,
[data-theme="yinyang"] .game-card.slots   { background-image: url('assets/slots-ink.webp'); background-position: center 50%; }
[data-theme="dragon"] .game-card.dice-game,
[data-theme="yinyang"] .game-card.dice-game { background-image: url('assets/dice-ink.webp'); background-position: center 50%; }

/* Upgrader has no photo asset — give it a full-bleed gradient so it matches the
   other cards' new background style, with its own readability overlay + glyph. */
.game-card.upgrader {
  --gc-glow: rgba(120, 230, 160, 0.45);
  background: radial-gradient(circle at 72% 28%, #1d4a33 0%, #0a1f16 72%);
  background-size: cover;
  background-position: center;
}
.game-card.upgrader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.80) 10%, rgba(0,0,0,0.45) 65%, rgba(0,0,0,0.22) 100%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}
.game-card.upgrader .gc-info b {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.game-card.upgrader .gc-info span {
  color: rgba(255,255,255,0.72);
}
.game-card.upgrader .gc-art {
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-card.upgrader .gc-art::after {
  content: "⬆️";
  font-size: 32px;
  filter: drop-shadow(0 0 8px rgba(120, 230, 160, 0.7));
}

/* ---- UPGRADER PLAY STAGE + INVITE --------------------------------------- */
.upg-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
}
.upg-wheel {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 6px solid rgba(120, 230, 160, 0.25);
  border-top-color: #5fe39a;
  box-shadow: 0 0 22px rgba(120, 230, 160, 0.4);
}
.upg-wheel.spinning {
  animation: upgSpin 0.7s linear infinite;
}
@keyframes upgSpin {
  to { transform: rotate(360deg); }
}
.tier.upg-target small {
  color: #6fe6a4;
}

.invite-link-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 12px;
}
.invite-link-row .auc-input {
  flex: 1;
  min-width: 0;
}
.invite-stats {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.invite-stat {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.invite-stat b {
  display: block;
  font-size: 22px;
}
.invite-stat small {
  color: #8b93a7;
  font-size: 12px;
}

/* ---- OPEN / MY GAMES LIST ------------------------------------------------ */

.games-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: var(--surface);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 80px;
}

.game-row:active {
  transform: scale(0.98);
}

.game-row .icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: rgba(140, 110, 255, 0.16);
  border: 1px solid var(--stroke);
}

.game-row .info {
  flex: 1;
  min-width: 0;
}

.game-row .info b {
  display: block;
  font-size: 15px;
  color: var(--text);
}

.game-row .info .muted {
  font-size: 12px;
}

.game-row .join {
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}

.game-row.mine {
  border-left: 3px solid var(--accent);
}

.game-row .cancel-lobby {
  background: transparent;
  border: 1px solid rgba(251, 113, 133, 0.5);
  color: var(--red);
  border-radius: 10px;
  padding: 6px 11px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* LIVE badge: marks a game that's already in progress (you can rejoin it). */
.live-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--red, #fb7185);
  vertical-align: middle;
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.game-row.live {
  border-left: 3px solid var(--red, #fb7185);
}

/* ---- Game-row full-card background images --------------------------------- */
.game-row[data-kind]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.80) 10%, rgba(0,0,0,0.50) 65%, rgba(0,0,0,0.28) 100%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.game-row > * {
  position: relative;
  z-index: 1;
}

.game-row[data-kind] .icon { display: none; }

.game-row[data-kind] .info b   { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.game-row[data-kind] .info .muted { color: rgba(255,255,255,0.72); }
.game-row[data-kind] .join      { color: #fff; font-weight: 800; }

/* Per-kind images (default themes) */
.game-row[data-kind="coinflip"]  { background-image: url('assets/coinflip.webp'); }
.game-row[data-kind="blackjack"] { background-image: url('assets/blackjeck.webp'); }
.game-row[data-kind="slots"]     { background-image: url('assets/slots-ink.webp'); }
.game-row[data-kind="dice"]      { background-image: url('assets/dice-ink.webp'); }
.game-row[data-kind="uno"]       { background-image: url('assets/uno.webp'); }
.game-row[data-kind="holdem"]    { background-image: url('assets/Holdem.webp'); }

/* Dragon & Yin-Yang: ink painting variants */
/* Yin-Yang: ink paintings */
[data-theme="yinyang"] .game-row[data-kind="coinflip"]  { background-image: url('assets/coinflip-ink.webp'); }
[data-theme="yinyang"] .game-row[data-kind="blackjack"] { background-image: url('assets/blackjack-ink.webp'); }
[data-theme="yinyang"] .game-row[data-kind="slots"]     { background-image: url('assets/slots-ink.webp'); }
[data-theme="yinyang"] .game-row[data-kind="dice"]      { background-image: url('assets/dice-ink.webp'); }
[data-theme="yinyang"] .game-row[data-kind="uno"]       { background-image: url('assets/uno-ink.webp'); }
[data-theme="yinyang"] .game-row[data-kind="holdem"]    { background-image: url('assets/holdem-ink.webp'); }

/* Dragon: imperial gold banners — same art as the game selection cards */
[data-theme="dragon"]  .game-row[data-kind="coinflip"]  { background-image: url('assets/dragon-banner-coin.webp'); }
[data-theme="dragon"]  .game-row[data-kind="blackjack"] { background-image: url('assets/dragon-banner-bj.webp'); }
[data-theme="dragon"]  .game-row[data-kind="slots"]     { background-image: url('assets/dragon-banner-slots.webp'); }
[data-theme="dragon"]  .game-row[data-kind="dice"]      { background-image: url('assets/dragon-banner-dice.webp'); }
[data-theme="dragon"]  .game-row[data-kind="uno"]       { background-image: url('assets/dragon-banner-uno.webp'); }
[data-theme="dragon"]  .game-row[data-kind="holdem"]    { background-image: url('assets/dragon-banner-holdem.webp'); }

/* Royal/Суверен: custom banners */
[data-theme="royal"] .game-row[data-kind="coinflip"]  { background-image: url('assets/limitka-banner-coin.webp'); }
[data-theme="royal"] .game-row[data-kind="blackjack"] { background-image: url('assets/limitka-banner-bj.webp'); }
[data-theme="royal"] .game-row[data-kind="slots"]     { background-image: url('assets/limitka-banner-slots.webp'); }
[data-theme="royal"] .game-row[data-kind="dice"]      { background-image: url('assets/limitka-banner-dice.webp'); }
[data-theme="royal"] .game-row[data-kind="uno"]       { background-image: url('assets/limitka-banner-uno.webp'); }
[data-theme="royal"] .game-row[data-kind="holdem"]    { background-image: url('assets/limitka-banner-holdem.webp'); }
[data-theme="royal"] .game-row[data-kind="roulette"]  { background-image: url('assets/limitka-banner-roulette.webp'); }
/* ---- RULES CARD (waiting lobby) ----------------------------------------- */
.rules-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 14px 0;
  box-shadow: var(--shadow-sm);
}

.rules-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
}

.rules-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rules-list li {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-dim, #b9b6d6);
}

/* ---- HISTORY LIST (game history + deposit history) ---------------------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
}

.history-row .icon {
  font-size: 20px;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(140, 110, 255, 0.16);
  border: 1px solid var(--stroke);
}

.history-row .info {
  flex: 1;
  min-width: 0;
}

.history-row .info b {
  display: block;
  font-size: 14px;
}

.history-row .info .muted {
  font-size: 12px;
}

.history-row .outcome {
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.history-row .outcome.won { color: var(--green, #34d399); }
.history-row .outcome.lost { color: var(--red, #fb7185); }
.history-row .outcome.push { color: var(--text-dim, #b9b6d6); }
.history-row .amount.in { color: var(--green, #34d399); font-weight: 800; }

/* ---- SETTINGS ----------------------------------------------------------- */
.setting-label {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
}

.lang-opt {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.lang-opt.active {
  border-color: var(--accent);
  background: rgba(140, 110, 255, 0.18);
}

.lang-opt:active {
  transform: scale(0.98);
}

.music-settings-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.feedback-settings-panel {
  display: grid;
  gap: 0;
  min-width: 0;
}

.feedback-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 3px 0 15px;
}

.feedback-setting-row + .feedback-setting-row {
  padding: 15px 0 3px;
  border-top: 1px solid var(--stroke);
}

.feedback-setting-row > div {
  min-width: 0;
}

.feedback-setting-row .setting-label {
  margin-bottom: 3px;
}

.onboarding-settings-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.onboarding-settings-panel > div {
  min-width: 0;
}

.onboarding-settings-panel .setting-label {
  margin-bottom: 3px;
}

.onboarding-modal {
  max-width: 420px;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.onboarding-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-size: 24px;
  background: var(--accent-grad);
  box-shadow: var(--glow);
}

.onboarding-modal .modal-title,
.onboarding-intro {
  text-align: center;
}

.onboarding-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.onboarding-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.onboarding-list li > span {
  font-size: 20px;
  line-height: 1.3;
  text-align: center;
}

.onboarding-list strong {
  display: block;
  color: var(--text);
  line-height: 1.3;
}

.onboarding-list p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.onboarding-modal .modal-actions {
  flex: 0 0 auto;
}

.risk-confirm-modal {
  max-width: 380px;
}

.risk-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.32);
  font-size: 24px;
}

.danger-confirm {
  background: linear-gradient(135deg, #fb7185, #c92f50);
  box-shadow: 0 8px 22px rgba(201, 47, 80, 0.25);
}

.music-settings-head,
.music-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.music-settings-head > div,
.music-field > span {
  min-width: 0;
}

.music-settings-head .setting-label {
  margin-bottom: 3px;
}

.music-settings-hint {
  margin: 0;
  font-size: 12px;
}

.music-credit {
  margin: -7px 0 0;
  min-height: 16px;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.music-credit a {
  color: var(--accent);
}

.music-switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
  cursor: pointer;
}

.music-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.music-switch-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.music-switch-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}

.music-switch input:checked + .music-switch-track {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.music-switch input:checked + .music-switch-track::after {
  background: var(--accent);
  transform: translateX(22px);
}

.music-switch input:focus-visible + .music-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.music-field {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.music-field select {
  min-width: 168px;
  max-width: 66%;
  border: 1px solid var(--stroke-strong);
  border-radius: 10px;
  padding: 9px 32px 9px 11px;
  color: var(--text);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a78bfa' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

.music-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.music-field output {
  min-width: 42px;
  color: var(--accent);
  text-align: right;
  font-weight: 700;
}

/* Chevron arrow per theme — can't use CSS vars in data URIs */
[data-theme="dragon"]    .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c8a840' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="cyberpunk"] .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300c8a0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="horror"]    .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23cc1a2a' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="steamdeck"] .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a8fe0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="jade"]      .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300b874' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="crimson"]   .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23e03050' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="yinyang"]   .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c8c8c8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="royal"]     .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c8a840' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="light"]     .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a4ff0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="dark"]      .music-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0a0c0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* ---- Range slider (volume) ---- */
.music-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2, rgba(60,60,120,0.55));
  border: 1px solid var(--stroke);
  cursor: pointer;
  outline: none;
  transition: background 0.15s;
  min-width: 0;
}

@media (max-width: 420px) {
  .music-settings-panel {
    gap: 14px;
  }

  .music-field[for="musicTrack"] {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .music-field[for="musicTrack"] select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

/* Filled track (webkit) */
.music-volume::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--val, 20%),
    var(--surface-2, rgba(60,60,120,0.55)) var(--val, 20%),
    var(--surface-2, rgba(60,60,120,0.55)) 100%
  );
  border: 1px solid var(--stroke);
}

/* Thumb (webkit) */
.music-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  margin-top: -8px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.music-volume::-webkit-slider-thumb:active {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

/* Thumb (moz) */
.music-volume::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  cursor: pointer;
}

/* Track (moz) */
.music-volume::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2, rgba(60,60,120,0.55));
  border: 1px solid var(--stroke);
}

.music-volume::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.music-settings-panel.music-disabled .music-field,
.music-settings-panel.music-disabled .music-volume {
  opacity: 0.5;
}

.music-settings-panel.music-disabled select,
.music-settings-panel.music-disabled .music-volume {
  pointer-events: none;
}

/* ---- ROULETTE WHEEL ----------------------------------------------------- */
.roulette-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 12px;
}

.wheel-wrap {
  position: relative;
  width: 290px;
  height: 290px;
  max-width: 84vw;
  max-height: 84vw;
}

/* Pointer at 12 o'clock — the segment under it when the wheel stops is hit. */
.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--gold, #ffd479);
  z-index: 3;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

/* Canvas roulette wheel — fills the wheel-wrap, all rendering done in JS */
.wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  position: relative;
  z-index: 1;
}

/* Each segment's label: anchored at the wheel center, rotated out to its slice;
   the inner span is counter-rotated so the text stays upright. */
.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}

.wheel-label > span {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.wheel-label.out > span {
  opacity: 0.35;
  text-decoration: line-through;
}

/* ---- STAKES -------------------------------------------------------------- */

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tier {
  min-height: var(--control-lg);
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: var(--radius-control);
  padding: 18px 8px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.tier:active {
  transform: scale(0.95);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tier small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  margin-top: 2px;
}

.side-pick {
  margin-top: 24px;
  text-align: center;
}

.side-pick>p {
  font-weight: 700;
  margin-bottom: 12px;
}

.side-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.side {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 24px 16px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: #2a2768;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.side::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 1;
  z-index: 0;
  /* Default fill for plain .side buttons (e.g. the player-count picker). Without
   * this they fall back to the UA's white button background → white-on-white.
   * The .heads/.tails modifiers below override it with their own colours. */
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(160deg, #5b4bd6, #2a2768);
}

.side>* {
  position: relative;
  z-index: 1;
}

.side.heads::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(160deg, #3b82f6, #1e40af);
}

.side.tails::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(160deg, #fb7185, #b91c43);
}

.side:active {
  transform: scale(0.96);
}

.side:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 212, 121, 0.4), var(--shadow-sm);
}

/* Mini gold coin on each side button — echoes the flip coin. */
.mini-coin {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  color: #7a4a10;
  background: radial-gradient(circle at 38% 30%, #fff3c4, #ffd36b 46%, #c8851e 100%);
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.4),
    inset 0 0 0 3px rgba(120, 70, 16, 0.55),
    inset 0 2px 4px rgba(255, 255, 255, 0.65);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.mini-coin.h::before {
  content: "✦";
}

.mini-coin.t::before {
  content: "♠";
}

/* ---- COINFLIP ------------------------------------------------------------ */

.coin-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 260px;
  perspective: 1000px;
}

/* The toss wrapper handles the vertical arc + idle bob; #coin handles the 3D
 * rotateX flip (driven by JS). Keeping them on separate elements means the two
 * transforms never fight. */
.coin-toss {
  position: relative;
  transform-style: preserve-3d;
  animation: coinFloat 3.2s ease-in-out infinite;
}

.coin-toss.tossing {
  animation: coinToss 2.65s cubic-bezier(0.2, 0.7, 0.25, 1);
}

/* Scoped to #coin so these don't leak onto the lobby's `.game-card.coin`. */
#coin {
  width: 152px;
  height: 152px;
  position: relative;
  transform-style: preserve-3d;
  filter:
    drop-shadow(0 16px 22px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 24px rgba(255, 200, 90, 0.4));
}

#coin .face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}

#coin .face.tails {
  transform: rotateX(180deg);
}

.coin-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* SVG coin parts (themed via class so both faces share the look). */
.coin-rim {
  fill: #74460e;
}

.coin-mill {
  fill: none;
  stroke: #5e3a0d;
  stroke-width: 2.4;
  stroke-dasharray: 2.1 2.1;
  opacity: 0.8;
}

.coin-ring {
  fill: none;
  stroke: #9a6a1c;
  stroke-width: 1.6;
  opacity: 0.75;
}

.coin-emblem {
  fill: #fff6d8;
  stroke: #9a6a1c;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

/* Glossy light sweep across the upturned face while idle. */
#coin .face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(118deg,
      transparent 36%, rgba(255, 255, 255, 0.6) 49%, transparent 63%);
  transform: translateX(-130%);
}

.coin-toss:not(.tossing) #coin .face.heads::after {
  animation: coinShine 3.2s ease-in-out 0.5s infinite;
}

@keyframes coinShine {
  0% { transform: translateX(-130%); }
  55%, 100% { transform: translateX(130%); }
}

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

@keyframes coinToss {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(-86px) scale(1.07); }
  50% { transform: translateY(-104px) scale(1.09); }
  82% { transform: translateY(-44px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.big-status {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  min-height: 24px;
  margin: 8px 0;
}

/* ---- CARD TABLE (blackjack / holdem) ------------------------------------ */

.felt {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(140, 110, 255, 0.14), transparent 60%),
    linear-gradient(160deg, #1c2f4a, #0f1c33);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px 14px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.felt.poker {
  min-height: 200px;
  justify-content: center;
}

.seat-label {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}

.table-center {
  text-align: center;
}

.hand {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 92px;
}

.hand.board {
  justify-content: center;
}

.pcard {
  width: 62px;
  height: 88px;
  border-radius: 11px;
  background: linear-gradient(160deg, #ffffff, #e9ecf6);
  color: #14163a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7px 8px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: deal 0.38s cubic-bezier(0.34, 1.2, 0.64, 1) backwards;
}

.pcard.red {
  color: #e0335a;
}

.pcard .r {
  font-size: 18px;
  line-height: 1;
}

.pcard .s {
  font-size: 22px;
  text-align: right;
}

.pcard.back {
  background:
    repeating-linear-gradient(45deg, #6a4ff0 0 7px, #5040c4 7px 14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: transparent;
}

@keyframes deal {
  from {
    opacity: 0;
    transform: translateY(-50px) translateX(30px) rotate(-15deg) scale(0.8);
    filter: blur(2px);
  }

  80% { filter: none; }

  to   { opacity: 1; transform: none; filter: none; }
}

.pcard.flip {
  animation: flip 0.5s ease;
}

@keyframes flip {
  0% {
    transform: rotateY(90deg);
  }

  100% {
    transform: rotateY(0);
  }
}

/* ---- ACTION BUTTONS ------------------------------------------------------ */

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.action {
  min-height: var(--control-lg);
  /* A bare `.action` (poker Call/Check) carries no modifier class, so it needs a
   * visible default background — otherwise its white text sits on the browser's
   * default light button face (white-on-white). */
  background: linear-gradient(160deg, #3a3e72, #272a52);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-control);
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, filter 0.2s ease;
}

.action.hit {
  background: var(--accent-grad);
  box-shadow: 0 10px 22px rgba(120, 90, 255, 0.4);
}

.action.stand {
  background: linear-gradient(160deg, #3a3e72, #272a52);
  border: 1px solid var(--stroke);
}

.action:active {
  transform: scale(0.96);
  filter: brightness(1.08);
}

.action:disabled {
  opacity: 0.5;
}

.primary {
  display: block;
  width: 100%;
  min-height: var(--control-lg);
  margin-top: 16px;
  border: none;
  border-radius: var(--radius-control);
  padding: 16px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(120, 90, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, filter 0.2s ease;
}

.primary:active {
  transform: scale(0.98);
  filter: brightness(1.08);
}

@media (hover: hover) and (pointer: fine) {
  .primary:hover,
  .action:hover,
  .tier:hover {
    filter: brightness(1.08);
    border-color: var(--stroke-strong);
  }
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--muted);
  box-shadow: none;
}

.primary.inline {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  flex: 0 0 auto;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: 0 6px 16px rgba(120, 90, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ---- RESULTS ------------------------------------------------------------- */

.result-card {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(6px);
}

.result-card.win {
  border-color: rgba(74, 222, 128, 0.6);
  box-shadow: 0 0 26px rgba(74, 222, 128, 0.3), var(--shadow);
}

.result-card.lose {
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 0 26px rgba(251, 113, 133, 0.25), var(--shadow);
}

.result-card.push {
  border-color: var(--stroke-strong);
}

.result-card .verdict {
  font-size: 23px;
  font-weight: 900;
  margin-bottom: 6px;
}

.result-card .seed {
  font-size: 10px;
  color: var(--muted);
  word-break: break-all;
  margin-top: 10px;
}

/* ---- WALLET -------------------------------------------------------------- */

.wallet-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.wallet-balance {
  text-align: center;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(140, 110, 255, 0.25), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

/* Free-games count as its own pill, clearly detached from the card balance. */
.free-pill {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim, #b9b6d6);
  background: rgba(140, 110, 255, 0.14);
  border: 1px solid var(--stroke);
}

.wallet-balance strong {
  display: block;
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(90deg, #fff, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-panel);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.deposit-how {
  font-size: 14px;
  line-height: 1.5;
  margin: 10px 0;
}

.deposit-how code,
.deposit-how a {
  color: var(--accent);
  word-break: break-all;
}

.deposit-how .badge {
  display: inline-block;
  background: rgba(74, 222, 128, 0.16);
  color: var(--green);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.deposit-how .acct-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  word-break: break-all;
}

.profile-edit {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.profile-edit input {
  flex: 1;
  /* Without this a flex item won't shrink below its content's intrinsic width,
   * so the long placeholder pushed the "Link" button past the panel edge. */
  min-width: 0;
  background: rgba(8, 8, 24, 0.7);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
}

.profile-edit input:focus {
  outline: none;
  border-color: var(--accent);
}

.vault-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.vault-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.vault-row .vthumb {
  width: 34px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--stroke);
}

.vault-row .vname {
  flex: 1;
}

.vault-row .vrarity {
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--accent-grad);
  box-shadow: 0 4px 12px rgba(120, 90, 255, 0.4);
}

.vault-row .vlock {
  color: var(--muted);
  font-size: 12px;
}

.vault-row .vval {
  font-weight: 800;
  color: var(--gold);
}

/* ---- MULTIPLAYER LOBBY --------------------------------------------------- */

.lr-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.lr-player {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  border-left: 3px solid transparent;
}

.lr-player.ready {
  border-left-color: var(--green);
}

.player-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0;
  margin: 10px 0;
}

.pchip {
  flex: 0 0 auto;
  min-width: 92px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 9px 11px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  line-height: 1.3;
}

.pchip.turn {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(140, 110, 255, 0.4);
}

.pchip.folded {
  opacity: 0.45;
}

.pchip b {
  display: block;
  font-size: 13px;
}

.pchip span {
  color: var(--muted);
}

/* ---- UNO ----------------------------------------------------------------- */

/* Poker-style round table: discard pile in the centre, players seated around. */
.uno-table {
  position: relative;
  margin: 6px 0 14px;
}

.uno-felt {
  position: relative;
  min-height: 290px;
  border-radius: 150px / 108px;
  background:
    radial-gradient(120% 100% at 50% 40%, rgba(140, 110, 255, 0.16), transparent 62%),
    linear-gradient(160deg, #221a40, #14122e);
  border: 2px solid var(--stroke);
  box-shadow: var(--shadow), inset 0 2px 20px rgba(0, 0, 0, 0.5);
}

.uno-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.uno-color {
  font-size: 13px;
  font-weight: 700;
}

.uno-seats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.uno-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
}

.useat-pod {
  background: var(--surface-solid);
  border: 1px solid var(--stroke);
  border-radius: 13px;
  padding: 7px 11px;
  box-shadow: var(--shadow-sm);
  min-width: 74px;
}

.uno-seat .nm {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}

.uno-seat .cc {
  font-size: 13px;
  color: var(--gold);
  margin-top: 2px;
}

.uno-seat.turn .useat-pod {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(140, 110, 255, 0.55);
}

.uno-seat.me .useat-pod {
  border-color: var(--gold);
}

.ucard {
  width: 72px;
  height: 102px;
  flex: 0 0 auto;
  border-radius: 18px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -18px 30px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  padding: 0 6px;
  isolation: isolate;
}

.ucard::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  opacity: 0.85;
  z-index: -1;
}

.ucard::after {
  content: "";
  position: absolute;
  width: 56px;
  height: 84px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(28deg);
  z-index: -1;
}

.ucard.cR {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(145deg, #5f1018, #c92c3d 55%, #7a0e18);
}

.ucard.cG {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(145deg, #0b3b2c, #16875f 55%, #082b20);
}

.ucard.cB {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(145deg, #0b2548, #286fb8 55%, #081a34);
}

.ucard.cY {
  color: #241700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.38), transparent 30%),
    linear-gradient(145deg, #8c5d00, #f4c430 55%, #b77b00);
}

.ucard.cW {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.22), transparent 30%),
    conic-gradient(from 45deg, #c92c3d, #f4c430, #16875f, #286fb8, #c92c3d);
}

.uno-hand {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0;
  min-height: 110px;
}

.ucard.btn {
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.ucard.btn:hover {
  transform: translateY(-6px);
  filter: brightness(1.08);
}

.ucard.btn:active {
  transform: scale(0.94);
}

.ucard.btn.disabled {
  opacity: 0.38;
  filter: grayscale(0.35);
  pointer-events: none;
}

.color-pick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.color-pick .color {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 18px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.color-pick .color.R {
  background: linear-gradient(145deg, #5f1018, #c92c3d);
}

.color-pick .color.G {
  background: linear-gradient(145deg, #0b3b2c, #16875f);
}

.color-pick .color.B {
  background: linear-gradient(145deg, #0b2548, #286fb8);
}

.color-pick .color.Y {
  background: linear-gradient(145deg, #8c5d00, #f4c430);
}

/* ---- TEXAS HOLD'EM TABLE ------------------------------------------------- */

.poker-table {
  position: relative;
  margin: 8px 0 16px;
}

.table-felt {
  position: relative;
  min-height: 300px;
  border-radius: 140px / 96px;
  background:
    radial-gradient(120% 100% at 50% 40%, rgba(140, 110, 255, 0.16), transparent 62%),
    linear-gradient(160deg, #1c2f4a, #0f1c33);
  border: 2px solid var(--stroke);
  box-shadow: var(--shadow), inset 0 2px 18px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 14px;
}

.community {
  justify-content: center;
  min-height: 92px;
}

.center-badges {
  text-align: center;
}

.pot-badge,
#phPot {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  margin: 6px 0 2px;
}

.blinds-badge,
#phBlinds {
  font-size: 12px;
  color: var(--muted);
}

.seats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Scoped to `.seats` (the poker table) so these don't hit blackjack's
 * `.seat.opponent` / `.seat.you`, which are flex-column items, not positioned. */
.seats .seat {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
}

.seats .seat .pod {
  position: relative;
  z-index: 2;            /* name pod always reads above any nearby cards */
  background: var(--surface-solid);
  border: 1px solid var(--stroke);
  border-radius: 13px;
  padding: 6px 9px;
  box-shadow: var(--shadow-sm);
  min-width: 70px;
}

.seats .seat.active .pod {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(140, 110, 255, 0.5);
}

.seats .seat.me .pod {
  border-color: var(--gold);
}

.seats .seat.folded {
  opacity: 0.45;
}

.seats .seat .nm {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.seats .seat .ch {
  font-size: 12px;
  color: var(--gold);
}

.seats .seat .tag {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.seat-cards {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 3px;
}

.seat-cards .mb {
  width: 16px;
  height: 22px;
  border-radius: 4px;
  background: repeating-linear-gradient(45deg, #6a4ff0 0 4px, #5040c4 4px 8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Revealed hole cards shown in a seat at showdown. */
.seat-cards .scard {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  min-width: 18px;
  height: 24px;
  padding: 0 3px;
  border-radius: 4px;
  background: #fff;
  color: #14163a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.seat-cards .scard.red {
  color: #d11a4a;
}

.seat-cards .scard i {
  font-style: normal;
  font-size: 11px;
}

.bet-chip {
  margin-top: 4px;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #14163a;
  background: var(--gold);
  border-radius: 999px;
  padding: 2px 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.your-area {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.your-hole {
  justify-content: center;
}

.poker-actions {
  margin-top: 8px;
}

#phActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pa-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.pa-row .action {
  flex: 1;
}

.action.danger {
  background: linear-gradient(160deg, #fb7185, #b91c43);
}

.action.accent {
  background: var(--accent-grad);
}

.raise-panel {
  width: 100%;
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.raise-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.raise-head input {
  width: 90px;
  background: rgba(8, 8, 24, 0.7);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.raise-panel input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.raise-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 12px 0;
}

.raise-quick button {
  background: rgba(140, 110, 255, 0.14);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.raise-quick button:active {
  transform: scale(0.95);
  background: var(--accent-soft);
}

/* ---- BOTTOM NAVIGATION --------------------------------------------------- */

.bottomnav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(12, 12, 36, 0.6), rgba(10, 10, 28, 0.95));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--stroke);
  border-radius: 22px 22px 0 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.12s ease;
}

.nav-item .ni {
  font-size: 20px;
  line-height: 1;
  filter: grayscale(0.4);
  opacity: 0.7;
  transition: filter 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active .ni {
  filter: none;
  opacity: 1;
  transform: translateY(-1px);
}

.nav-item:active {
  transform: scale(0.92);
}

/* raised centre action */
.nav-item.center {
  flex: 0 0 auto;
  margin-top: -22px;
}

.nav-item.center .ni {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 24px;
  color: #fff;
  filter: none;
  opacity: 1;
  background: var(--accent-grad);
  border: 3px solid var(--bg);
  box-shadow: 0 8px 22px rgba(120, 90, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ---- TOAST / MODAL / CONFETTI ------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: rgba(8, 8, 24, 0.92);
  border: 1px solid var(--stroke);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 60;
  max-width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    16px
    max(16px, env(safe-area-inset-bottom, 0px));
  background: rgba(4, 4, 18, 0.6);
  backdrop-filter: blur(6px);
}

.modal {
  width: 100%;
  max-width: 360px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(140, 110, 255, 0.28), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface-solid));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-panel);
  padding: 22px;
  box-shadow: var(--shadow), var(--glow);
  text-align: center;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.modal-msg {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  margin: 0 0 16px;
}

.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 14px;
  z-index: 50;
  pointer-events: none;
  border-radius: 2px;
  contain: layout paint style;
  will-change: transform, opacity;
}

.fairness-panel {
  margin-top: 14px;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-control);
  background: rgba(0, 0, 0, 0.16);
  text-align: left;
  overflow: hidden;
}

.fairness-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.fairness-panel summary::-webkit-details-marker {
  display: none;
}

.fairness-panel summary::before {
  content: "▸";
  color: var(--accent);
  transition: transform var(--duration-ui) var(--ease-ui);
}

.fairness-panel[open] summary::before {
  transform: rotate(90deg);
}

.fairness-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.fairness-status.valid { color: var(--green); }
.fairness-status.invalid { color: var(--red); }

.fairness-hint {
  margin: 0;
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.fairness-panel label {
  display: block;
  padding: 9px 12px;
  border-top: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.fairness-panel code {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
  user-select: text;
}

.fairness-verify {
  width: calc(100% - 24px);
  min-height: var(--control-md);
  margin: 11px 12px 12px;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-control);
  color: #fff;
  background: var(--accent-grad);
  font-weight: 800;
  cursor: pointer;
}

.confetti-disc { border-radius: 50%; }
.confetti-shard { clip-path: polygon(50% 0, 100% 32%, 68% 100%, 8% 72%); }
.confetti-spark { clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%); }
.confetti-ribbon { border-radius: 2px; }

@keyframes drop {
  to {
    transform: translate3d(var(--drift, 0), 110vh, 0) rotate(var(--spin, 540deg));
    opacity: 0;
  }
}

/* ---- RESPONSIVE ---------------------------------------------------------- */

@media (max-width: 620px) {
  #app {
    padding: 14px 12px 104px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .bal-main strong {
    font-size: 26px;
  }
}

/* --- VIP + auctions ------------------------------------------------------- */
.hero-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.hero-chip {
  min-width: 0;
  min-height: var(--control-md);
  border: 1px solid var(--stroke);
  background: rgba(8, 8, 24, 0.55);
  color: var(--text);
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease;
}

@media (max-width: 420px) {
  .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-chip { padding-inline: 12px; }
}

.hero-chip:active {
  transform: scale(0.98);
  border-color: var(--accent);
}

.auc-input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  background: rgba(8, 8, 24, 0.7);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  margin: 6px 0;
}

.auc-input:focus {
  outline: none;
  border-color: var(--accent);
}

.auc-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Custom duration input row */
.auc-duration-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.auc-duration-custom input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(8, 8, 24, 0.7);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.auc-duration-custom input:focus { border-color: var(--accent); }
.auc-duration-custom label {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.auc-duration-custom input.custom-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.auc-row .auc-input {
  flex: 1;
}

/* The auction leaderboard reuses .history-row; mark the leading bid. */
.history-row.leader {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.auc-rank {
  font-weight: 800;
  opacity: 0.7;
  margin-right: 4px;
}

/* Selected duration preset stays highlighted (not just on hover). */
.side.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 8px 22px rgba(120, 90, 255, 0.35);
  filter: brightness(1.12);
}

/* Breathing room between the auction panels (create / VIP notice / join). */
#view-auctions .panel {
  margin-bottom: 14px;
}

/* Lot-card picker: tap the exact card(s) from your vault to auction. */
.card-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.card-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
  padding: 9px 11px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(8, 8, 24, 0.55);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.card-chip .chip-thumb {
  width: 40px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 5px;
  border: 1px solid var(--stroke);
}

/* Auction lot gallery — the card(s) up for sale, shown in the auction detail. */
.auc-lot-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 14px;
}
.auc-lot-cards .lot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 92px;
}
.auc-lot-cards .lot-thumb {
  width: 92px;
  height: 124px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
}
.auc-lot-cards .lot-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  background: var(--accent-grad);
}
.auc-lot-cards .lot-name {
  font-size: 12px;
  margin-top: 5px;
  text-align: center;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auc-lot-cards .lot-val {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}

.card-chip b {
  font-size: 15px;
  font-weight: 800;
}

.card-chip small {
  opacity: 0.6;
  font-size: 11px;
}

.card-chip.sel {
  border-color: var(--accent);
  background: rgba(120, 90, 255, 0.22);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.card-chip:active {
  transform: scale(0.96);
}

/* ---- VIP GIVEAWAYS ------------------------------------------------------- */
.raffle-hero {
  background: linear-gradient(145deg, rgba(255, 184, 77, .20), rgba(137, 92, 255, .16));
  border: 1px solid rgba(255, 211, 137, .28);
  box-shadow: 0 0 24px rgba(255, 190, 70, .12);
}

.raffle-summary {
  min-height: 22px;
  color: var(--accent2);
  font-weight: 700;
}

#raffleDuration .side {
  min-height: 72px;
  margin-top: 0;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}

#raffleDuration .side > span {
  position: relative;
  z-index: 2;
  display: block;
  font-size: 18px;
  font-weight: 900;
}

[data-theme="light"] #raffleDuration .side {
  color: #241d3d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .65);
}

[data-theme="light"] .raffle-card {
  background: linear-gradient(170deg, #fdf7e8 0%, #f5ecce 100%);
  border-color: rgba(180, 120, 20, .38);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .14), 0 0 0 1px rgba(180, 120, 20, .10);
}

[data-theme="light"] .raffle-card-head {
  background: linear-gradient(135deg, rgba(212, 140, 20, .20) 0%, rgba(196, 26, 40, .12) 100%);
  border-bottom-color: rgba(180, 120, 20, .22);
}

[data-theme="light"] .raffle-card-head b {
  color: #7a4a00;
  text-shadow: none;
}

[data-theme="light"] .raffle-timer {
  background: rgba(180, 120, 20, .12);
  border-color: rgba(180, 120, 20, .28);
  color: #7a4a00;
}

[data-theme="light"] .raffle-prizes {
  background: rgba(0, 0, 0, .04);
}

[data-theme="light"] .rp-card-bg {
  background: linear-gradient(145deg, rgba(240, 220, 180, .9), rgba(220, 195, 140, .95));
}

[data-theme="light"] .raffle-card-foot {
  background: rgba(180, 120, 20, .04);
  border-top-color: rgba(180, 120, 20, .14);
}

[data-theme="light"] .raffle-ticket-btn.owned {
  background: linear-gradient(135deg, rgba(180, 120, 20, .22), rgba(140, 90, 10, .18));
  border-color: rgba(180, 120, 20, .50);
  color: #7a4a00;
}

.raffle-list {
  display: grid;
  gap: 12px;
}

.raffle-card {
  overflow: hidden;
  border: 1px solid rgba(255, 211, 137, .30);
  border-radius: 20px;
  background: linear-gradient(170deg, rgba(24, 18, 56, .98) 0%, rgba(10, 7, 28, 1) 100%);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 200, 80, .10),
    inset 0 1px 0 rgba(255, 220, 100, .14);
}

.raffle-card-head {
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, rgba(255, 190, 70, .20) 0%, rgba(120, 90, 255, .16) 100%);
  border-bottom: 1px solid rgba(255, 211, 137, .16);
}

.raffle-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.raffle-card-head b {
  font-size: 17px;
  font-weight: 800;
  color: #ffe8a0;
  text-shadow: 0 1px 10px rgba(255, 190, 70, .40);
  line-height: 1.2;
}

.raffle-timer {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 220, 130, .80);
  white-space: nowrap;
  background: rgba(255, 190, 70, .12);
  border: 1px solid rgba(255, 190, 70, .22);
  border-radius: 100px;
  padding: 2px 8px;
}

.raffle-meta {
  font-size: 12px;
}

/* ── Prizes area ────────────────────────────────────────────────────────── */
.raffle-prizes {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 16px 14px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 110%, rgba(255, 195, 70, .14) 0%, transparent 70%),
    radial-gradient(ellipse at 50% 40%, rgba(110, 70, 200, .13) 0%, transparent 70%),
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.04) 1.5px, transparent 1.5px),
    radial-gradient(circle at 88% 12%, rgba(255,255,255,.04) 1px,   transparent 1px),
    radial-gradient(circle at 55% 82%, rgba(255,255,255,.03) 1px,   transparent 1px),
    radial-gradient(circle at 22% 72%, rgba(255,255,255,.03) 1.5px, transparent 1.5px),
    radial-gradient(circle at 78% 65%, rgba(255,255,255,.025) 1px,  transparent 1px),
    rgba(0, 0, 0, .28);
  justify-content: center;
  align-items: flex-end;
}

/* ----- Prize item (trading-card style) ----- */
.raffle-prize {
  flex: 0 0 auto;
  width: 100px;
  text-align: center;
}

.raffle-prize.solo        { width: 160px; }

/* Dual layout (2 prizes) */
.raffle-prizes.dual       { overflow-x: visible; }
.raffle-prize.dual        { width: 130px; }

/* Podium layout (3+ prizes) – base container already has align-items: flex-end */
.raffle-prizes.podium     { overflow-x: visible; padding-top: 22px; padding-bottom: 0; }
.raffle-prize.podium-center { width: 130px; }
/* push side cards down so center appears raised (no translateY → no clipping) */
.raffle-prize.podium-side { width: 86px; margin-top: 26px; }

/* More row for 4th+ prizes */
.raffle-prizes-more {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 16px 14px;
  background: rgba(0, 0, 0, .28);
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.raffle-prize.more-item   { width: 70px; }

/* The card itself */
.rp-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(160, 160, 200, .35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .60);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: default;
}

.raffle-prize.solo .rp-card           { border-radius: 18px; border-width: 2.5px; }
.raffle-prize.podium-center .rp-card  { border-radius: 16px; border-width: 2.5px; }
.raffle-prize.dual .rp-card           { border-radius: 16px; }

/* Podium place borders — override rarity border for 1st/2nd/3rd */
.raffle-prize.place-1 .rp-card {
  border-color: #ffd460;
  border-width: 2.5px;
  box-shadow: 0 0 28px rgba(255, 212, 96, .75), 0 8px 28px rgba(0,0,0,.65);
}
.raffle-prize.place-2 .rp-card {
  border-color: #b8ccd8;
  border-width: 2px;
  box-shadow: 0 0 18px rgba(184, 204, 216, .55), 0 8px 24px rgba(0,0,0,.60);
}
.raffle-prize.place-3 .rp-card {
  border-color: #c87840;
  border-width: 2px;
  box-shadow: 0 0 18px rgba(200, 120, 64, .50), 0 8px 24px rgba(0,0,0,.60);
}

.rp-card:hover { transform: translateY(-4px) scale(1.03); }

/* Card art — z-index:1 so it sits above the bg placeholder (z-index:0) */
.rp-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

/* Placeholder shown when there is no image or it failed to load */
.rp-card-bg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: linear-gradient(145deg, rgba(40, 30, 80, .9), rgba(20, 15, 50, .95));
  z-index: 0;
}

.raffle-prize.solo .rp-card-bg         { font-size: 56px; }
.raffle-prize.more-item .rp-card-bg    { font-size: 24px; }

/* Dark gradient overlay at bottom */
.rp-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, .88) 0%,
    rgba(0, 0, 0, .30) 42%,
    rgba(0, 0, 0, 0)   65%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7px 7px 8px;
}

/* Rarity badge – top-left corner */
.rp-rar-badge {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  line-height: 1.4;
}

/* Card name – bottom of card */
.rp-card-bottom { display: flex; flex-direction: column; gap: 0; }

.rp-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.9);
  line-height: 1.3;
}

.raffle-prize.solo .rp-name           { font-size: 13px; }
.raffle-prize.dual .rp-name           { font-size: 12px; }
.raffle-prize.podium-center .rp-name  { font-size: 12px; }
.raffle-prize.more-item .rp-name      { font-size: 9px; }

/* Value label under the card */
.rp-value-label {
  display: inline-block;
  margin-top: 7px;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  border: 1px solid transparent;
}

/* ── Place badges (podium + more row) ───────────────────────────────────── */
.rp-place-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  border: 1.5px solid rgba(120, 120, 170, .50);
  background: rgba(50, 50, 90, .88);
  color: #b8b8e0;
}

/* more-item cards are smaller — shrink the badge too */
.raffle-prize.more-item .rp-place-badge {
  width: 17px;
  height: 17px;
  font-size: 9px;
  bottom: 4px;
  right: 4px;
}

.rp-place-1 { background: #ffd460; border-color: #ffb300; color: #3a2800; }
.rp-place-2 { background: #c8d8e8; border-color: #8fa8c0; color: #1a2a3a; }
.rp-place-3 { background: #d4874a; border-color: #a05c28; color: #2a1200; }

/* ── Rarity color tokens ────────────────────────────────────────────────── */
.rar-s .rp-card {
  border-color: #ffd460;
  box-shadow: 0 0 22px rgba(255, 212, 96, .50), 0 8px 28px rgba(0,0,0,.65);
}
.rar-s .rp-rar-badge, .rar-s.rp-rar-badge {
  background: rgba(180, 130, 0, .82); border-color: rgba(255, 212, 60, .80); color: #ffe87a;
}
.rar-s .rp-value-label, .rar-s.rp-value-label {
  background: rgba(255, 212, 60, .18); border-color: rgba(255, 212, 60, .50); color: #ffd460;
}

.rar-a .rp-card {
  border-color: #ff9a60;
  box-shadow: 0 0 18px rgba(255, 154, 96, .45), 0 8px 28px rgba(0,0,0,.65);
}
.rar-a .rp-rar-badge, .rar-a.rp-rar-badge {
  background: rgba(180, 75, 10, .82); border-color: rgba(255, 140, 60, .75); color: #ffb880;
}
.rar-a .rp-value-label, .rar-a.rp-value-label {
  background: rgba(255, 140, 60, .16); border-color: rgba(255, 140, 60, .45); color: #ff9a60;
}

.rar-b .rp-card {
  border-color: #c880ff;
  box-shadow: 0 0 18px rgba(200, 128, 255, .42), 0 8px 28px rgba(0,0,0,.65);
}
.rar-b .rp-rar-badge, .rar-b.rp-rar-badge {
  background: rgba(100, 30, 160, .82); border-color: rgba(200, 128, 255, .75); color: #d8a0ff;
}
.rar-b .rp-value-label, .rar-b.rp-value-label {
  background: rgba(200, 128, 255, .16); border-color: rgba(200, 128, 255, .45); color: #c880ff;
}

.rar-c .rp-card {
  border-color: #60b8ff;
  box-shadow: 0 0 16px rgba(96, 184, 255, .40), 0 8px 28px rgba(0,0,0,.65);
}
.rar-c .rp-rar-badge, .rar-c.rp-rar-badge {
  background: rgba(20, 80, 160, .82); border-color: rgba(96, 184, 255, .75); color: #90d0ff;
}
.rar-c .rp-value-label, .rar-c.rp-value-label {
  background: rgba(96, 184, 255, .14); border-color: rgba(96, 184, 255, .42); color: #60b8ff;
}

.rar-d .rp-card {
  border-color: #60e890;
  box-shadow: 0 0 14px rgba(96, 232, 144, .38), 0 8px 28px rgba(0,0,0,.65);
}
.rar-d .rp-rar-badge, .rar-d.rp-rar-badge {
  background: rgba(10, 100, 50, .82); border-color: rgba(96, 232, 144, .75); color: #80f0a8;
}
.rar-d .rp-value-label, .rar-d.rp-value-label {
  background: rgba(96, 232, 144, .12); border-color: rgba(96, 232, 144, .38); color: #60e890;
}

.rar-f .rp-card {
  border-color: rgba(160, 160, 200, .45);
  box-shadow: 0 8px 24px rgba(0,0,0,.60);
}
.rar-f .rp-rar-badge, .rar-f.rp-rar-badge {
  background: rgba(60, 60, 90, .85); border-color: rgba(160, 160, 200, .65); color: #c8c8e8;
}
.rar-f .rp-value-label, .rar-f.rp-value-label {
  background: rgba(160, 160, 200, .10); border-color: rgba(160, 160, 200, .28); color: #a0a0c8;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.raffle-card-foot {
  padding: 12px 16px 14px;
  background: rgba(255, 200, 80, .03);
  border-top: 1px solid rgba(255, 211, 137, .12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.raffle-stats {
  font-size: 13px;
  color: var(--muted);
}

.raffle-ticket-btn { width: 100%; }

.raffle-ticket-btn.owned {
  background: linear-gradient(135deg, rgba(255, 200, 60, .28), rgba(255, 160, 30, .22));
  border: 1.5px solid rgba(255, 200, 60, .45);
  color: #ffd060;
  opacity: 1;
}

/* ---- THEME PICKER (settings) --------------------------------------------- */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.theme-tile {
  position: relative;
  border: 2px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  transition: transform 0.12s ease, border-color 0.2s ease;
}

.theme-tile.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 14px var(--accent-soft);
}

.theme-tile:active {
  transform: scale(0.97);
}

.theme-swatch {
  height: 34px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.theme-tile small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
}

/* ========================================================================== */
/* THEME: HORROR GOTHIC                                                         */
/* Dark crimson / bone-white / gothic serif. Matches the horror playing-card    */
/* aesthetic (skulls, blood red, midnight black).                               */
/* ========================================================================== */

[data-theme="horror"] {
  --bg: #060306;
  --bg2: #0c0205;
  --surface: rgba(28, 4, 8, 0.88);
  --surface-2: rgba(45, 6, 12, 0.92);
  --surface-solid: #150304;
  --stroke: rgba(155, 15, 25, 0.32);
  --stroke-strong: rgba(185, 20, 32, 0.65);
  --text: #e8d5c4;
  --muted: #a88080;
  --accent: #c41a28;
  --accent-2: #941018;
  --accent-grad: linear-gradient(135deg, #dd2035 0%, #9a1020 55%, #680c18 100%);
  --accent-soft: rgba(180, 20, 30, 0.20);
  --gold: #c49a10;
  --green: #3d7a45;
  --red: #dd2035;
  --blue: #4a6a99;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.88);
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.78);
  --glow: 0 0 32px rgba(180, 20, 30, 0.55);
}

/* ---- Horror: keyframe animations ----------------------------------------- */

@keyframes horrorFlicker {
  0%, 100%  { opacity: 1;    text-shadow: 0 0 18px rgba(180, 20, 30, 0.95); }
  20%       { opacity: 0.88; text-shadow: 0 0 10px rgba(180, 20, 30, 0.55); }
  40%       { opacity: 1;    text-shadow: 0 0 28px rgba(200, 30, 40, 1.0);  }
  65%       { opacity: 0.92; text-shadow: 0 0 14px rgba(180, 20, 30, 0.70); }
  80%       { opacity: 1;    text-shadow: 0 0 22px rgba(190, 25, 35, 0.85); }
}

@keyframes horrorGlowPulse {
  0%, 100% { box-shadow: 0 0 22px rgba(180, 20, 30, 0.55), inset 0 1px 0 rgba(255,255,255,0.15); }
  50%      { box-shadow: 0 0 38px rgba(200, 30, 40, 0.80), inset 0 1px 0 rgba(255,255,255,0.20); }
}

@keyframes horrorBorderPulse {
  0%, 100% { border-color: rgba(155, 15, 25, 0.32); }
  50%      { border-color: rgba(200, 30, 40, 0.65);  }
}

[data-theme="horror"] body {
  font-family: "Cinzel", "Times New Roman", "Palatino Linotype", Georgia, serif;
  background:
    radial-gradient(ellipse 110% 55% at 50% 0%, rgba(155, 15, 25, 0.24), transparent 52%),
    radial-gradient(ellipse 70% 45% at 88% 12%, rgba(90, 5, 5, 0.14), transparent 50%),
    radial-gradient(ellipse 55% 45% at 12% 82%, rgba(70, 0, 5, 0.10), transparent 50%),
    linear-gradient(180deg, #0c0205 0%, #060306 70%);
  background-attachment: fixed;
}

/* Screen-edge vignette — subtle darkening of the corners for cinematic depth */
[data-theme="horror"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 85% 85% at 50% 50%,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* Custom scrollbar — dark red track */
[data-theme="horror"] ::-webkit-scrollbar { width: 5px; }
[data-theme="horror"] ::-webkit-scrollbar-track { background: #060306; }
[data-theme="horror"] ::-webkit-scrollbar-thumb {
  background: #6b0c14;
  border-radius: 999px;
}
[data-theme="horror"] ::-webkit-scrollbar-thumb:hover { background: #c41a28; }

[data-theme="horror"] .brand-name {
  font-family: "Cinzel Decorative", "Cinzel", serif;
  font-weight: 900;
  font-size: 16px;
  background: linear-gradient(90deg, #e8d5c4, #c41a28);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.06em;
}

[data-theme="horror"] .brand-mark {
  color: #c41a28;
  animation: horrorFlicker 5s ease-in-out infinite;
}

/* Gothic h2 section headers — ornamental lines flanking the label */
[data-theme="horror"] h2 {
  color: #7a5a5a;
  letter-spacing: 0.22em;
  font-family: "Cinzel", serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
}

[data-theme="horror"] h2::before,
[data-theme="horror"] h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 15, 25, 0.50));
}

[data-theme="horror"] h2::after {
  background: linear-gradient(270deg, transparent, rgba(155, 15, 25, 0.50));
}

/* Game card titles use Cinzel */
[data-theme="horror"] .gc-info b {
  font-family: "Cinzel", serif;
  letter-spacing: 0.04em;
}

/* Profile name */
[data-theme="horror"] .profile-id strong,
[data-theme="horror"] #sideName {
  font-family: "Cinzel", serif;
}

/* LVL badge */
[data-theme="horror"] .lvl-badge {
  font-family: "Cinzel", serif;
  letter-spacing: 0.06em;
}

/* Nav labels */
[data-theme="horror"] .nl {
  font-family: "Cinzel", serif;
  font-size: 9px;
  letter-spacing: 0.08em;
}

[data-theme="horror"] .hero h1 {
  font-family: "Cinzel Decorative", "Cinzel", serif;
  font-weight: 900;
  color: #e8d5c4;
  text-shadow: 0 0 28px rgba(180, 20, 30, 0.55);
  letter-spacing: 0.05em;
}

/* Pulsing glow on the nav centre button */
[data-theme="horror"] .nav-item.center .ni {
  animation: horrorGlowPulse 3.5s ease-in-out infinite;
}

/* Game card border breathes */
[data-theme="horror"] .game-card {
  animation: horrorBorderPulse 4s ease-in-out infinite;
}

/* Action buttons — primary crimson glow */
[data-theme="horror"] .action.hit,
[data-theme="horror"] .topup-btn,
[data-theme="horror"] .primary:not(.ghost-btn) {
  font-family: "Cinzel", serif;
  letter-spacing: 0.06em;
}

/* Result verdict text */
[data-theme="horror"] .result-card .verdict {
  font-family: "Cinzel Decorative", serif;
  letter-spacing: 0.08em;
}

[data-theme="horror"] h2 {
  color: #7a5a5a;
  letter-spacing: 0.16em;
}

[data-theme="horror"] #topbar {
  background: linear-gradient(180deg, rgba(6, 2, 3, 0.96), rgba(6, 2, 3, 0.62));
  border-bottom-color: rgba(155, 15, 25, 0.38);
}

[data-theme="horror"] .sidebar {
  background:
    radial-gradient(circle at 20% 0%, rgba(155, 15, 25, 0.22), transparent 40%),
    #0a0203;
  border-right-color: rgba(155, 15, 25, 0.30);
}

[data-theme="horror"] .sidebar-head {
  border-bottom-color: rgba(155, 15, 25, 0.28);
}
[data-theme="horror"] .side-link {
  background: rgba(10, 2, 3, 0.90);
  border-color: rgba(155, 15, 25, 0.20);
  color: #e8c8c8;
}
[data-theme="horror"] .side-link:hover,
[data-theme="horror"] .side-link:focus {
  background: rgba(155, 15, 25, 0.18);
  color: #ff9090;
}
[data-theme="horror"] .side-link.danger { color: #ff4444; }

[data-theme="horror"] .top-avatar,
[data-theme="horror"] .side-avatar {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.35), transparent 35%),
    linear-gradient(135deg, #8b1a1a, #3d0a0a);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.10), 0 6px 18px rgba(140, 20, 20, 0.5);
}

[data-theme="horror"] .lvl-badge {
  background: var(--accent-grad);
  box-shadow: 0 4px 14px rgba(155, 15, 25, 0.5);
}

[data-theme="horror"] .profile-card {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(155, 15, 25, 0.25), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

[data-theme="horror"] .xp-fill {
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(180, 20, 30, 0.7);
}

[data-theme="horror"] .topup-btn {
  box-shadow: 0 10px 24px rgba(155, 15, 25, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

[data-theme="horror"] .primary {
  box-shadow: 0 12px 26px rgba(155, 15, 25, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

[data-theme="horror"] .action.hit {
  box-shadow: 0 10px 22px rgba(155, 15, 25, 0.42);
}

[data-theme="horror"] .game-card {
  background: linear-gradient(135deg, rgba(45, 6, 8, 0.80), rgba(15, 4, 5, 0.80));
  border-color: rgba(155, 15, 25, 0.28);
}

[data-theme="horror"] .game-card:hover {
  border-color: rgba(180, 20, 30, 0.60);
  box-shadow: var(--shadow), 0 0 22px rgba(155, 15, 25, 0.30);
}

[data-theme="horror"] .game-card::after {
  background: radial-gradient(circle, rgba(155, 15, 25, 0.38), transparent 68%);
}

[data-theme="horror"] .game-card.coin { --gc-glow: rgba(180, 120, 20, 0.4); }
[data-theme="horror"] .game-card.bj   { --gc-glow: rgba(155, 15, 25, 0.45); }
[data-theme="horror"] .game-card.uno  { --gc-glow: rgba(155, 15, 25, 0.40); }
[data-theme="horror"] .game-card.holdem { --gc-glow: rgba(120, 80, 20, 0.38); }
[data-theme="horror"] .game-card.roulette { --gc-glow: rgba(155, 15, 25, 0.42); }

[data-theme="horror"] .game-row .icon {
  background: rgba(155, 15, 25, 0.14);
}

[data-theme="horror"] .game-row.mine {
  border-left-color: var(--accent);
}

[data-theme="horror"] .felt {
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(55, 5, 5, 0.30), transparent 60%),
    linear-gradient(160deg, #180606, #090303);
}

[data-theme="horror"] .table-felt {
  background:
    radial-gradient(120% 100% at 50% 40%, rgba(55, 5, 5, 0.28), transparent 62%),
    linear-gradient(160deg, #1a0808, #0a0404);
}

[data-theme="horror"] .uno-felt {
  background:
    radial-gradient(120% 100% at 50% 40%, rgba(55, 5, 5, 0.24), transparent 62%),
    linear-gradient(160deg, #180606, #090303);
  border-color: rgba(155, 15, 25, 0.32);
}

/* Playing cards — keep white face but add aged tint */
[data-theme="horror"] .pcard {
  background: linear-gradient(160deg, #f5ece0, #e8d9c6);
  color: #1a0808;
}

[data-theme="horror"] .pcard.red { color: #b0102a; }

[data-theme="horror"] .pcard.back {
  background: repeating-linear-gradient(45deg, #4a0a10 0 7px, #360808 7px 14px);
  border-color: rgba(155, 15, 25, 0.45);
}

/* Coin — gothic dark gold */
[data-theme="horror"] .coin-rim   { fill: #5a1a08; }
[data-theme="horror"] .coin-mill  { stroke: #4a1208; }
[data-theme="horror"] .coin-ring  { stroke: #7a3510; }
[data-theme="horror"] .coin-emblem { fill: #f5e8d5; stroke: #7a3510; }

[data-theme="horror"] .mini-coin {
  background: radial-gradient(circle at 38% 30%, #f5e8d5, #c49a10 46%, #7a3510 100%);
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 3px rgba(80, 30, 10, 0.55),
    inset 0 2px 4px rgba(255, 255, 255, 0.5);
  color: #5a1a08;
}

[data-theme="horror"] .nav-item.active { color: #c41a28; }

[data-theme="horror"] .nav-item.center .ni {
  background: var(--accent-grad);
  border-color: var(--bg);
  box-shadow: 0 8px 22px rgba(155, 15, 25, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="horror"] .bottomnav {
  background: linear-gradient(180deg, rgba(5, 1, 2, 0.62), rgba(4, 1, 1, 0.97));
  border-top-color: rgba(155, 15, 25, 0.35);
}

[data-theme="horror"] .modal {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(155, 15, 25, 0.25), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface-solid));
}

[data-theme="horror"] .wallet-balance {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(155, 15, 25, 0.22), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

[data-theme="horror"] .result-card.win {
  border-color: rgba(61, 122, 69, 0.65);
  box-shadow: 0 0 26px rgba(61, 122, 69, 0.30), var(--shadow);
}

[data-theme="horror"] .result-card.lose {
  border-color: rgba(221, 32, 53, 0.60);
  box-shadow: 0 0 26px rgba(221, 32, 53, 0.28), var(--shadow);
}

[data-theme="horror"] .lang-opt.active,
[data-theme="horror"] .tier:active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

[data-theme="horror"] .pchip.turn {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(180, 20, 30, 0.40);
}

[data-theme="horror"] .seats .seat.active .pod {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(180, 20, 30, 0.50);
}

[data-theme="horror"] .uno-seat.turn .useat-pod {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(180, 20, 30, 0.55);
}

[data-theme="horror"] .seat-cards .mb {
  background: repeating-linear-gradient(45deg, #4a0a10 0 4px, #360808 4px 8px);
}

[data-theme="horror"] .history-row.leader {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

[data-theme="horror"] .side.heads::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(160deg, #5a0808, #2a0303);
}

[data-theme="horror"] .side.tails::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(160deg, #7a1020, #3a0810);
}

[data-theme="horror"] .side:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(196, 154, 16, 0.40), var(--shadow-sm);
}

[data-theme="horror"] .raise-panel input[type="range"] {
  accent-color: var(--accent);
}

/* ========================================================================== */
/* THEME: CYBERPUNK TERMINAL                                                    */
/* Neon teal on deep void-black. Monospace feel, zero border-radius.            */
/* ========================================================================== */

@keyframes cyberNeonPulse {
  0%, 100% { text-shadow: 0 0 8px #00e8c0, 0 0 24px rgba(0, 200, 160, 0.55), 0 0 48px rgba(0, 200, 160, 0.18); }
  50%       { text-shadow: 0 0 4px #00e8c0, 0 0 12px rgba(0, 200, 160, 0.35), 0 0 22px rgba(0, 200, 160, 0.08); }
}

@keyframes cyberBorderPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 200, 160, 0.45), 0 0 16px rgba(0, 200, 160, 0.18); }
  50%       { box-shadow: 0 0 0 1px rgba(0, 200, 160, 0.18), 0 0 6px rgba(0, 200, 160, 0.06); }
}

@keyframes cyberGlitch {
  0%        { clip-path: inset(0 0 100% 0); transform: translate(0); }
  5%        { clip-path: inset(10% 0 78% 0); transform: translate(-3px, 1px); }
  12%       { clip-path: inset(42% 0 38% 0); transform: translate(3px, -2px); }
  18%       { clip-path: inset(78% 0 8% 0); transform: translate(-2px, 2px); }
  22%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
}

[data-theme="cyberpunk"] {
  --bg: #060d1a;
  --bg2: #091220;
  --surface: rgba(0, 35, 65, 0.72);
  --surface-2: rgba(0, 45, 80, 0.78);
  --surface-solid: #060f1e;
  --stroke: rgba(0, 200, 160, 0.18);
  --stroke-strong: rgba(0, 200, 160, 0.42);
  --text: #c8ffe8;
  --muted: #68b0a0;
  --accent: #00c8a0;
  --accent-2: #009878;
  --accent-grad: linear-gradient(135deg, #00e8c0 0%, #00c8a0 55%, #009878 100%);
  --accent-soft: rgba(0, 200, 160, 0.14);
  --gold: #e0c040;
  --green: #00e890;
  --red: #ff3060;
  --blue: #00a8e0;
  --radius: 0px;
  --radius-sm: 0px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.75);
  --glow: 0 0 30px rgba(0, 200, 160, 0.5);
}

/* neon grid behind everything */
[data-theme="cyberpunk"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 200, 160, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 160, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* CRT scanlines above everything */
[data-theme="cyberpunk"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.07) 3px,
    rgba(0, 0, 0, 0.07) 4px
  );
}

[data-theme="cyberpunk"] body {
  font-family: "Share Tech Mono", "Courier New", monospace;
  background:
    radial-gradient(ellipse 100% 50% at 50% 0%, rgba(0, 200, 160, 0.12), transparent 52%),
    radial-gradient(ellipse 60% 40% at 90% 15%, rgba(0, 80, 60, 0.10), transparent 50%),
    linear-gradient(180deg, #091220 0%, #060d1a 70%);
  background-attachment: fixed;
}

[data-theme="cyberpunk"] ::-webkit-scrollbar { width: 4px; }
[data-theme="cyberpunk"] ::-webkit-scrollbar-track { background: #020608; }
[data-theme="cyberpunk"] ::-webkit-scrollbar-thumb { background: #00c8a0; border-radius: 0; }

[data-theme="cyberpunk"] .brand { position: relative; }

[data-theme="cyberpunk"] .brand::after {
  content: "STATUS: ONLINE";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #00c8a0;
  opacity: 0.55;
  font-family: "Share Tech Mono", monospace;
  white-space: nowrap;
}

[data-theme="cyberpunk"] .brand-name {
  font-family: "Orbitron", monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: linear-gradient(90deg, #00e8c0, #00c8a0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cyberNeonPulse 2.8s ease-in-out infinite;
}

[data-theme="cyberpunk"] .brand-name.glitching {
  animation: cyberGlitch 0.35s steps(1) forwards;
}

[data-theme="cyberpunk"] .brand-mark {
  color: #00c8a0;
  text-shadow: 0 0 18px rgba(0, 200, 160, 0.9);
}

[data-theme="cyberpunk"] h2 {
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.18em;
  color: #00c8a0;
  text-transform: uppercase;
}

[data-theme="cyberpunk"] h2::before {
  content: "// ";
  color: rgba(0, 200, 160, 0.45);
}

[data-theme="cyberpunk"] .hero h1 {
  font-family: "Orbitron", monospace;
  color: #00e8c0;
  text-shadow: 0 0 24px rgba(0, 200, 160, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[data-theme="cyberpunk"] .sidebar {
  background: rgba(2, 6, 8, 0.98);
  border-right: 1px solid rgba(0, 200, 160, 0.25);
}
[data-theme="cyberpunk"] .sidebar-head {
  border-bottom-color: rgba(0, 200, 160, 0.20);
}
[data-theme="cyberpunk"] .side-link {
  background: rgba(0, 15, 12, 0.85);
  border-color: rgba(0, 200, 160, 0.18);
  color: #e0fff8;
}
[data-theme="cyberpunk"] .side-link:hover,
[data-theme="cyberpunk"] .side-link:focus {
  background: rgba(0, 200, 160, 0.12);
  color: #00e8c0;
}

/* HUD corner brackets on panels */
[data-theme="cyberpunk"] .panel,
[data-theme="cyberpunk"] .game-card,
[data-theme="cyberpunk"] .profile-card,
[data-theme="cyberpunk"] .wallet-card,
[data-theme="cyberpunk"] .stat-card,
[data-theme="cyberpunk"] .modal-inner {
  position: relative;
  border-radius: 0 !important;
  border-color: rgba(0, 200, 160, 0.20);
}

[data-theme="cyberpunk"] .panel::before,
[data-theme="cyberpunk"] .game-card::before,
[data-theme="cyberpunk"] .profile-card::before,
[data-theme="cyberpunk"] .modal-inner::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 14px; height: 14px;
  border-top: 2px solid #00c8a0;
  border-left: 2px solid #00c8a0;
  pointer-events: none;
  z-index: 1;
  animation: none;
}

/* bottom-right bracket — reset game-card::after hover gradient */
[data-theme="cyberpunk"] .panel::after,
[data-theme="cyberpunk"] .game-card::after,
[data-theme="cyberpunk"] .profile-card::after,
[data-theme="cyberpunk"] .modal-inner::after {
  content: "";
  position: absolute;
  inset: auto;
  bottom: -1px; right: -1px;
  width: 14px; height: 14px;
  border-bottom: 2px solid #00c8a0;
  border-right: 2px solid #00c8a0;
  pointer-events: none;
  z-index: 1;
  background: none;
  border-radius: 0;
  opacity: 1;
}

[data-theme="cyberpunk"] .game-card {
  background: linear-gradient(135deg, rgba(0, 22, 44, 0.90), rgba(2, 8, 20, 0.90));
  border-color: rgba(0, 200, 160, 0.22);
  animation: cyberBorderPulse 3.2s ease-in-out infinite;
}

[data-theme="cyberpunk"] .game-card:hover {
  border-color: rgba(0, 200, 160, 0.55);
  box-shadow: var(--shadow), 0 0 22px rgba(0, 200, 160, 0.22);
}

[data-theme="cyberpunk"] #topbar {
  background: linear-gradient(180deg, rgba(3, 6, 14, 0.96), rgba(3, 6, 14, 0.62));
  border-bottom-color: rgba(0, 200, 160, 0.28);
}

[data-theme="cyberpunk"] .top-avatar,
[data-theme="cyberpunk"] .side-avatar {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.3), transparent 35%),
    linear-gradient(135deg, #00c8a0, #006050);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 6px 18px rgba(0, 180, 140, 0.4);
  border-radius: 0 !important;
}

[data-theme="cyberpunk"] .profile-card {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(0, 200, 160, 0.18), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

[data-theme="cyberpunk"] .nav-item.active { color: #00c8a0; }

[data-theme="cyberpunk"] .nav-item.center .ni {
  background: var(--accent-grad);
  border-color: var(--bg);
  border-radius: 0 !important;
  box-shadow: 0 8px 22px rgba(0, 200, 160, 0.60), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

[data-theme="cyberpunk"] .bottomnav {
  background: linear-gradient(180deg, rgba(2, 5, 12, 0.62), rgba(2, 4, 10, 0.97));
  border-top-color: rgba(0, 200, 160, 0.28);
}

[data-theme="cyberpunk"] .felt,
[data-theme="cyberpunk"] .table-felt,
[data-theme="cyberpunk"] .uno-felt {
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(0, 60, 44, 0.25), transparent 60%),
    linear-gradient(160deg, #040e1a, #020810);
}

/* circuit board card back */
[data-theme="cyberpunk"] .pcard.back {
  background-color: #020c18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%23020c18'/%3E%3Cpath d='M0 20h12M28 20h12M20 0v12M20 28v12' stroke='%2300c8a0' stroke-width='1.5' stroke-opacity='0.4'/%3E%3Ccircle cx='20' cy='20' r='3' fill='none' stroke='%2300c8a0' stroke-width='1.5' stroke-opacity='0.6'/%3E%3Ccircle cx='12' cy='20' r='2' fill='%2300c8a0' fill-opacity='0.3'/%3E%3Ccircle cx='28' cy='20' r='2' fill='%2300c8a0' fill-opacity='0.3'/%3E%3Ccircle cx='20' cy='12' r='2' fill='%2300c8a0' fill-opacity='0.3'/%3E%3Ccircle cx='20' cy='28' r='2' fill='%2300c8a0' fill-opacity='0.3'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}

/* coin teal hue-shift */
[data-theme="cyberpunk"] #coin {
  filter: hue-rotate(160deg) saturate(1.2) brightness(1.1);
}

/* square corners everywhere */
[data-theme="cyberpunk"] .btn,
[data-theme="cyberpunk"] button {
  border-radius: 0 !important;
}

[data-theme="cyberpunk"] input,
[data-theme="cyberpunk"] select,
[data-theme="cyberpunk"] textarea {
  border-radius: 0 !important;
  font-family: "Share Tech Mono", monospace;
}

/* result states */
[data-theme="cyberpunk"] .result-card.win {
  border-color: rgba(0, 232, 144, 0.6);
  box-shadow: 0 0 28px rgba(0, 200, 160, 0.35);
}

[data-theme="cyberpunk"] .result-card.lose {
  border-color: rgba(255, 48, 96, 0.5);
  box-shadow: 0 0 28px rgba(255, 48, 96, 0.22);
}

/* matrix rain canvas — also visible for cyberpunk */
[data-theme="cyberpunk"] #horrorFx { opacity: 0.45; }

/* ── Cyberpunk game list rows ─────────────────────────────────────────────── */
[data-theme="cyberpunk"] .game-row {
  background: rgba(0, 200, 160, 0.05);
  border: 1px solid rgba(0, 200, 160, 0.22);
  border-left: 3px solid rgba(0, 200, 160, 0.7);
  border-radius: 0 !important;
  font-family: "Share Tech Mono", monospace;
}

[data-theme="cyberpunk"] .game-row:hover {
  background: rgba(0, 200, 160, 0.1);
  border-color: rgba(0, 200, 160, 0.5);
  box-shadow: 0 0 12px rgba(0, 200, 160, 0.2);
  transform: translateX(4px);
}

[data-theme="cyberpunk"] .game-row .icon {
  background: rgba(0, 200, 160, 0.12);
  border-radius: 0 !important;
  box-shadow: 0 0 8px rgba(0, 200, 160, 0.2);
}

[data-theme="cyberpunk"] .game-row .join {
  color: #00c8a0;
  text-shadow: 0 0 8px rgba(0, 200, 160, 0.7);
}

[data-theme="cyberpunk"] .game-row.mine {
  border-left-color: #00c8a0;
  background: rgba(0, 200, 160, 0.08);
}

[data-theme="cyberpunk"] .game-row.live {
  border-left-color: rgba(255, 48, 96, 0.8);
}

/* ========================================================================== */
/* THEME: STEAM DECK                                                            */
/* Clean, functional dark-blue. No gimmicks — just clarity.                    */
/* ========================================================================== */

[data-theme="steamdeck"] {
  --bg: #0a0c10;
  --bg2: #10141c;
  --surface: rgba(20, 26, 40, 0.82);
  --surface-2: rgba(26, 34, 52, 0.88);
  --surface-solid: #121825;
  --stroke: rgba(90, 130, 190, 0.18);
  --stroke-strong: rgba(90, 130, 190, 0.42);
  --text: #dce4f0;
  --muted: #6888a8;
  --accent: #1a8fe0;
  --accent-2: #1270b8;
  --accent-grad: linear-gradient(135deg, #28a8f8 0%, #1878d0 55%, #0e58a8 100%);
  --accent-soft: rgba(26, 143, 224, 0.15);
  --gold: #f0b430;
  --green: #28c060;
  --red: #e02848;
  --blue: #1a8fe0;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.72);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.62);
  --glow: 0 0 22px rgba(26, 143, 224, 0.40);
}

[data-theme="steamdeck"] body {
  background:
    radial-gradient(120% 60% at 50% -8%, rgba(26, 143, 224, 0.15), transparent 46%),
    linear-gradient(180deg, #10141c 0%, #0a0c10 60%);
  background-attachment: fixed;
}

[data-theme="steamdeck"] .sidebar {
  background: rgba(4, 8, 18, 0.98);
  border-right: 1px solid rgba(26, 143, 224, 0.22);
}
[data-theme="steamdeck"] .sidebar-head {
  border-bottom-color: rgba(26, 143, 224, 0.18);
}
[data-theme="steamdeck"] .side-link {
  background: rgba(6, 12, 22, 0.85);
  border-color: rgba(26, 143, 224, 0.18);
  color: #e0eeff;
}
[data-theme="steamdeck"] .side-link:hover,
[data-theme="steamdeck"] .side-link:focus {
  background: rgba(26, 143, 224, 0.12);
  color: #8cc8ff;
}

[data-theme="steamdeck"] .brand-name {
  background: linear-gradient(90deg, #d0e8ff, #1a8fe0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="steamdeck"] .brand-mark {
  color: #1a8fe0;
  text-shadow: 0 0 16px rgba(26, 143, 224, 0.8);
}

[data-theme="steamdeck"] .top-avatar,
[data-theme="steamdeck"] .side-avatar {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.3), transparent 35%),
    linear-gradient(135deg, #1a8fe0, #0e58a8);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.10), 0 6px 18px rgba(26, 143, 224, 0.35);
}

[data-theme="steamdeck"] .profile-card {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(26, 143, 224, 0.18), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

[data-theme="steamdeck"] .nav-item.active { color: #1a8fe0; }

[data-theme="steamdeck"] .nav-item.center .ni {
  background: var(--accent-grad);
  border-color: var(--bg);
  box-shadow: 0 8px 22px rgba(26, 143, 224, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

[data-theme="steamdeck"] .game-card {
  background: linear-gradient(135deg, rgba(26, 34, 52, 0.80), rgba(12, 16, 26, 0.80));
}

[data-theme="steamdeck"] .game-card:hover {
  border-color: rgba(90, 130, 190, 0.42);
  box-shadow: var(--shadow), 0 0 20px rgba(26, 143, 224, 0.18);
}

[data-theme="steamdeck"] .game-card::after {
  background: radial-gradient(circle, rgba(26, 143, 224, 0.28), transparent 68%);
}

/* ========================================================================== */
/* THEME: DAY (LIGHT)                                                           */
/* Warm parchment background, dark text, crimson accent.                        */
/* ========================================================================== */

[data-theme="light"] {
  --bg: #f0ece4;
  --bg2: #e8e2d8;
  --surface: rgba(255, 250, 244, 0.90);
  --surface-2: rgba(250, 244, 235, 0.92);
  --surface-solid: #fdf8f0;
  --stroke: rgba(140, 100, 60, 0.16);
  --stroke-strong: rgba(140, 100, 60, 0.36);
  --text: #1a1008;
  --muted: #7a6a58;
  --accent: #c41a28;
  --accent-2: #941018;
  --accent-grad: linear-gradient(135deg, #dd2035 0%, #9a1020 55%, #680c18 100%);
  --accent-soft: rgba(196, 26, 40, 0.10);
  --gold: #b87a10;
  --green: #287a38;
  --red: #c41a28;
  --blue: #1a60b8;
  --radius: 22px;
  --radius-sm: 16px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.10);
  --glow: 0 0 20px rgba(196, 26, 40, 0.22);
}

[data-theme="light"] body {
  background:
    radial-gradient(120% 60% at 50% -8%, rgba(196, 26, 40, 0.08), transparent 46%),
    linear-gradient(180deg, #e8e2d8 0%, #f0ece4 60%);
  background-attachment: fixed;
  color: #1a1008;
}

[data-theme="light"] #topbar {
  background: linear-gradient(180deg, rgba(240, 236, 228, 0.96), rgba(240, 236, 228, 0.72));
  border-bottom: 1px solid rgba(140, 100, 60, 0.16);
  backdrop-filter: blur(16px);
}

[data-theme="light"] .ghost {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(140, 100, 60, 0.18);
  color: #1a1008;
}

[data-theme="light"] .brand-name {
  background: linear-gradient(90deg, #3a2010, #c41a28);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-mark {
  color: #c41a28;
  text-shadow: 0 0 14px rgba(196, 26, 40, 0.35);
}

[data-theme="light"] .sidebar {
  background: #f5f0e8;
  border-right: 1px solid rgba(140, 100, 60, 0.16);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .sidebar-overlay {
  background: rgba(80, 60, 40, 0.35);
}

[data-theme="light"] .side-link {
  background: rgba(240, 236, 228, 0.8);
  border-color: rgba(140, 100, 60, 0.16);
  color: #1a1008;
}

[data-theme="light"] .top-avatar,
[data-theme="light"] .side-avatar {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.6), transparent 35%),
    linear-gradient(135deg, #c41a28, #7a1018);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08), 0 6px 18px rgba(196, 26, 40, 0.28);
}

[data-theme="light"] .profile-card {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(196, 26, 40, 0.10), transparent 55%),
    linear-gradient(150deg, #fdf8f0, #f8f2e8);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .balance-card {
  background: linear-gradient(160deg, rgba(240, 236, 228, 0.8), rgba(248, 242, 232, 0.6));
  border-color: rgba(140, 100, 60, 0.14);
}

[data-theme="light"] .bal-main strong {
  background: linear-gradient(90deg, #1a1008, #b87a10);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .game-card {
  background: linear-gradient(135deg, rgba(255, 250, 244, 0.92), rgba(245, 240, 228, 0.88));
  border-color: rgba(140, 100, 60, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .game-card:hover {
  border-color: rgba(196, 26, 40, 0.40);
  box-shadow: var(--shadow), 0 0 18px rgba(196, 26, 40, 0.14);
}

[data-theme="light"] .game-card::after {
  background: radial-gradient(circle, rgba(196, 26, 40, 0.18), transparent 68%);
}

[data-theme="light"] .gc-info b { color: #1a1008; }
[data-theme="light"] .gc-info span { color: #7a6a58; }

[data-theme="light"] .game-row {
  background: rgba(255, 250, 244, 0.90);
}

[data-theme="light"] .game-row .icon {
  background: rgba(196, 26, 40, 0.10);
}

[data-theme="light"] .panel {
  background: rgba(255, 250, 244, 0.90);
}

[data-theme="light"] .tier {
  background: rgba(255, 250, 244, 0.90);
  color: #1a1008;
}

[data-theme="light"] .felt {
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(0, 60, 30, 0.14), transparent 60%),
    linear-gradient(160deg, #1c4030, #0f2820);
}

[data-theme="light"] .table-felt {
  background:
    radial-gradient(120% 100% at 50% 40%, rgba(0, 60, 30, 0.14), transparent 62%),
    linear-gradient(160deg, #1c4030, #0f2820);
}

[data-theme="light"] .uno-felt {
  background:
    radial-gradient(120% 100% at 50% 40%, rgba(0, 60, 30, 0.12), transparent 62%),
    linear-gradient(160deg, #1c4030, #0f2820);
}

[data-theme="light"] .toast {
  background: rgba(26, 16, 8, 0.92);
  color: #f0ece4;
}

[data-theme="light"] .modal {
  background: linear-gradient(150deg, #fdf8f0, #f5f0e8);
}

[data-theme="light"] .modal-title { color: #1a1008; }
[data-theme="light"] .modal-msg   { color: #7a6a58; }

[data-theme="light"] .modal-overlay {
  background: rgba(80, 60, 40, 0.45);
}

[data-theme="light"] .wallet-balance {
  background: linear-gradient(150deg, #fdf8f0, #f5f0e8);
}

[data-theme="light"] .wallet-balance strong {
  background: linear-gradient(90deg, #1a1008, #b87a10);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .profile-edit input,
[data-theme="light"] .auc-input,
[data-theme="light"] .raise-head input {
  background: rgba(255, 255, 255, 0.8);
  color: #1a1008;
  border-color: rgba(140, 100, 60, 0.20);
}

[data-theme="light"] .nav-item { color: #7a6a58; }
[data-theme="light"] .nav-item.active { color: #c41a28; }

[data-theme="light"] .nav-item.center .ni {
  background: var(--accent-grad);
  border-color: var(--bg);
  box-shadow: 0 8px 22px rgba(196, 26, 40, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

[data-theme="light"] .bottomnav {
  background: linear-gradient(180deg, rgba(240, 236, 228, 0.72), rgba(240, 236, 228, 0.97));
  border-top: 1px solid rgba(140, 100, 60, 0.16);
}

[data-theme="light"] .sidebar-head { border-bottom-color: rgba(140, 100, 60, 0.16); }

[data-theme="light"] .lang-opt {
  background: rgba(255, 250, 244, 0.90);
  color: #1a1008;
}

[data-theme="light"] .lang-opt.active {
  border-color: var(--accent);
  background: rgba(196, 26, 40, 0.10);
}

[data-theme="light"] .history-row {
  background: rgba(255, 250, 244, 0.90);
}

[data-theme="light"] .vault-row {
  background: rgba(255, 250, 244, 0.90);
}

[data-theme="light"] .action {
  background: linear-gradient(160deg, #e8e0d0, #d8d0c0);
  color: #1a1008;
}

[data-theme="light"] .action.hit {
  background: var(--accent-grad);
  color: #fff;
}

[data-theme="light"] .side-row .side {
  background: #d8d0be;
}

[data-theme="light"] .side::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.28), transparent 55%),
    linear-gradient(160deg, #c8c0a8, #b8b098);
}

[data-theme="light"] .side.heads::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.28), transparent 55%),
    linear-gradient(160deg, #3b82f6, #1e40af);
}

[data-theme="light"] .side.tails::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.28), transparent 55%),
    linear-gradient(160deg, #c41a28, #7a1018);
}

[data-theme="light"] .xp-fill {
  background: var(--accent-grad);
}

[data-theme="light"] .pcard.back {
  background: repeating-linear-gradient(45deg, #c41a28 0 7px, #9a1018 7px 14px);
}

/* scrollbar */
[data-theme="light"] ::-webkit-scrollbar { width: 6px; }
[data-theme="light"] ::-webkit-scrollbar-track { background: #e8e2d8; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(196, 26, 40, 0.45); border-radius: 6px; }

/* headings */
[data-theme="light"] h2 {
  color: #7a6a58;
  letter-spacing: 0.06em;
}

[data-theme="light"] .hero h1 {
  color: #c41a28;
  text-shadow: 0 2px 12px rgba(196, 26, 40, 0.15);
}

/* result cards */
[data-theme="light"] .result-card.win {
  border-color: rgba(40, 122, 56, 0.55);
  box-shadow: 0 0 22px rgba(40, 122, 56, 0.15), var(--shadow);
}

[data-theme="light"] .result-card.lose {
  border-color: rgba(196, 26, 40, 0.55);
  box-shadow: 0 0 22px rgba(196, 26, 40, 0.14), var(--shadow);
}

[data-theme="light"] .result-card .verdict { color: #1a1008; }

/* stat & wallet cards */
[data-theme="light"] .stat-card {
  background: rgba(255, 250, 244, 0.90);
  border-color: rgba(140, 100, 60, 0.16);
}

[data-theme="light"] .wallet-card {
  background: rgba(255, 250, 244, 0.90);
  border-color: rgba(140, 100, 60, 0.16);
}

/* level badge */
[data-theme="light"] .level-badge {
  background: rgba(196, 26, 40, 0.10);
  color: #c41a28;
  border-color: rgba(196, 26, 40, 0.25);
}

/* face-up playing cards */
[data-theme="light"] .pcard:not(.back) {
  background: #fdfaf5;
  border-color: rgba(140, 100, 60, 0.25);
}

/* row text inside history/vault/game */
[data-theme="light"] .htype,
[data-theme="light"] .hamt { color: #1a1008; }
[data-theme="light"] .hdate { color: #7a6a58; }

[data-theme="light"] .history-row,
[data-theme="light"] .vault-row { border-color: rgba(140, 100, 60, 0.14); }

/* inline table borders */
[data-theme="light"] .game-row { border-color: rgba(140, 100, 60, 0.14); }

/* poker / roulette chip-like elements */
[data-theme="light"] .chip {
  background: rgba(255, 250, 244, 0.90);
  color: #1a1008;
  border-color: rgba(140, 100, 60, 0.22);
}

/* VIP / badge tiers */
[data-theme="light"] .vip-card {
  background: linear-gradient(135deg, rgba(255, 250, 244, 0.95), rgba(245, 240, 228, 0.90));
  border-color: rgba(184, 122, 16, 0.30);
}

/* modal inner */
[data-theme="light"] .modal-inner {
  background: #fdf8f0;
  border-color: rgba(140, 100, 60, 0.18);
}

/* seed / provably-fair code boxes */
[data-theme="light"] .seed-box,
[data-theme="light"] code {
  background: rgba(232, 226, 216, 0.70);
  color: #3a2010;
  border-color: rgba(140, 100, 60, 0.20);
}

/* notification dot */
[data-theme="light"] .badge-dot { background: #c41a28; }

/* ========================================================================== */
/* THEME: JADE (НЕФРИТ)                                                         */
/* Deep forest-green canvas, emerald accents. No FX — clean and calm.          */
/* ========================================================================== */

[data-theme="jade"] {
  --bg: #071a12;
  --bg2: #0d2418;
  --surface: rgba(15, 42, 28, 0.75);
  --surface-2: rgba(20, 54, 36, 0.82);
  --surface-solid: #102218;
  --stroke: rgba(0, 184, 116, 0.18);
  --stroke-strong: rgba(0, 184, 116, 0.40);
  --text: #d4f0e2;
  --muted: #5a9e7a;
  --accent: #00b874;
  --accent-2: #008c58;
  --accent-grad: linear-gradient(135deg, #00d888 0%, #009a60 55%, #007040 100%);
  --accent-soft: rgba(0, 184, 116, 0.15);
  --gold: #c8d840;
  --green: #00d888;
  --red: #e04858;
  --blue: #40b8e0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.72);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.60);
  --glow: 0 0 22px rgba(0, 184, 116, 0.42);
}

[data-theme="jade"] body {
  background:
    radial-gradient(120% 60% at 50% -8%, rgba(0, 184, 116, 0.14), transparent 46%),
    linear-gradient(180deg, #0d2418 0%, #071a12 60%);
  background-attachment: fixed;
}

[data-theme="jade"] .sidebar {
  background: rgba(4, 18, 10, 0.98);
  border-right: 1px solid rgba(0, 184, 116, 0.20);
}
[data-theme="jade"] .sidebar-head {
  border-bottom-color: rgba(0, 184, 116, 0.18);
}
[data-theme="jade"] .side-link {
  background: rgba(6, 22, 14, 0.85);
  border-color: rgba(0, 184, 116, 0.18);
  color: #e0f8ec;
}
[data-theme="jade"] .side-link:hover,
[data-theme="jade"] .side-link:focus {
  background: rgba(0, 184, 116, 0.12);
  color: #60f0b0;
}

[data-theme="jade"] .brand-name {
  background: linear-gradient(90deg, #a0f0cc, #00b874);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="jade"] .brand-mark {
  color: #00b874;
  text-shadow: 0 0 16px rgba(0, 184, 116, 0.8);
}

[data-theme="jade"] .top-avatar,
[data-theme="jade"] .side-avatar {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.25), transparent 35%),
    linear-gradient(135deg, #00b874, #007040);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 6px 18px rgba(0, 184, 116, 0.35);
}

[data-theme="jade"] .profile-card {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(0, 184, 116, 0.16), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

[data-theme="jade"] .nav-item.active { color: #00b874; }

[data-theme="jade"] .nav-item.center .ni {
  background: var(--accent-grad);
  border-color: var(--bg);
  box-shadow: 0 8px 22px rgba(0, 184, 116, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

[data-theme="jade"] .game-card {
  background: linear-gradient(135deg, rgba(15, 42, 28, 0.82), rgba(7, 20, 12, 0.82));
}

[data-theme="jade"] .game-card:hover {
  border-color: rgba(0, 184, 116, 0.42);
  box-shadow: var(--shadow), 0 0 20px rgba(0, 184, 116, 0.18);
}

[data-theme="jade"] .game-card::after {
  background: radial-gradient(circle, rgba(0, 184, 116, 0.25), transparent 68%);
}

/* ========================================================================== */
/* THEME: CRIMSON (БАГРЯНЫЙ)                                                    */
/* Dark red-black canvas, vivid crimson accents. No gothic FX — sleek & bold.  */
/* ========================================================================== */

[data-theme="crimson"] {
  --bg: #180409;
  --bg2: #220610;
  --surface: rgba(40, 8, 18, 0.78);
  --surface-2: rgba(54, 10, 24, 0.84);
  --surface-solid: #200510;
  --stroke: rgba(224, 48, 80, 0.18);
  --stroke-strong: rgba(224, 48, 80, 0.42);
  --text: #f4d0d8;
  --muted: #a05068;
  --accent: #e03050;
  --accent-2: #b82040;
  --accent-grad: linear-gradient(135deg, #f04060 0%, #c02840 55%, #901830 100%);
  --accent-soft: rgba(224, 48, 80, 0.15);
  --gold: #f0c040;
  --green: #40d880;
  --red: #e03050;
  --blue: #5080e0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.78);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.65);
  --glow: 0 0 22px rgba(224, 48, 80, 0.44);
}

[data-theme="crimson"] body {
  background:
    radial-gradient(120% 60% at 50% -8%, rgba(224, 48, 80, 0.14), transparent 46%),
    linear-gradient(180deg, #220610 0%, #180409 60%);
  background-attachment: fixed;
}

[data-theme="crimson"] .sidebar {
  background: rgba(12, 4, 4, 0.98);
  border-right: 1px solid rgba(180, 20, 40, 0.22);
}
[data-theme="crimson"] .sidebar-head {
  border-bottom-color: rgba(180, 20, 40, 0.20);
}
[data-theme="crimson"] .side-link {
  background: rgba(18, 6, 6, 0.85);
  border-color: rgba(160, 20, 36, 0.18);
  color: #f8e0e4;
}
[data-theme="crimson"] .side-link:hover,
[data-theme="crimson"] .side-link:focus {
  background: rgba(180, 20, 40, 0.14);
  color: #ff8090;
}

[data-theme="crimson"] .brand-name {
  background: linear-gradient(90deg, #f4c0cc, #e03050);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="crimson"] .brand-mark {
  color: #e03050;
  text-shadow: 0 0 16px rgba(224, 48, 80, 0.8);
}

[data-theme="crimson"] .top-avatar,
[data-theme="crimson"] .side-avatar {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.22), transparent 35%),
    linear-gradient(135deg, #e03050, #901830);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 6px 18px rgba(224, 48, 80, 0.35);
}

[data-theme="crimson"] .profile-card {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(224, 48, 80, 0.16), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

[data-theme="crimson"] .nav-item.active { color: #e03050; }

[data-theme="crimson"] .nav-item.center .ni {
  background: var(--accent-grad);
  border-color: var(--bg);
  box-shadow: 0 8px 22px rgba(224, 48, 80, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

[data-theme="crimson"] .game-card {
  background: linear-gradient(135deg, rgba(40, 8, 18, 0.85), rgba(20, 4, 10, 0.85));
}

[data-theme="crimson"] .game-card:hover {
  border-color: rgba(224, 48, 80, 0.42);
  box-shadow: var(--shadow), 0 0 20px rgba(224, 48, 80, 0.18);
}

[data-theme="crimson"] .game-card::after {
  background: radial-gradient(circle, rgba(224, 48, 80, 0.25), transparent 68%);
}

[data-theme="steamdeck"] .pcard.back {
  background:
    linear-gradient(90deg, rgba(26, 143, 224, 0.14) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(0deg,  rgba(26, 143, 224, 0.14) 1px, transparent 1px) 0 0 / 14px 14px,
    #091828;
  border-color: rgba(26, 143, 224, 0.30);
}

[data-theme="jade"] .pcard.back {
  background: repeating-linear-gradient(60deg, #062010 0 6px, #0a2c1a 6px 12px, #072214 12px 18px);
  border-color: rgba(0, 184, 116, 0.28);
}

[data-theme="crimson"] .pcard.back {
  background: repeating-linear-gradient(45deg, #280510 0 7px, #1a0308 7px 14px);
  border-color: rgba(224, 48, 80, 0.28);
}

/* ========================================================================== */
/* GAME ANIMATIONS                                                             */
/* ========================================================================== */

/* Result card: bounce reveal */
@keyframes resultReveal {
  0%   { opacity: 0; transform: scale(0.78) translateY(22px); }
  65%  { opacity: 1; transform: scale(1.05) translateY(-4px); }
  82%  { transform: scale(0.97) translateY(2px); }
  100% { transform: scale(1) translateY(0); }
}

.result-card:not([hidden]) {
  animation: resultReveal 0.44s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Coin landing thud on toss wrapper */
@keyframes coinThud {
  0%   { transform: translateY(0)    scale(1);    }
  22%  { transform: translateY(8px)  scale(0.93); }
  50%  { transform: translateY(-5px) scale(1.06); }
  74%  { transform: translateY(3px)  scale(0.98); }
  100% { transform: translateY(0)    scale(1);    }
}

.coin-toss.thud {
  animation: coinThud 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Lobby card shimmer sweep */
.game-card::before {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.07) 50%,
    transparent 80%
  );
  pointer-events: none;
  animation: shimmer 5s ease-in-out infinite;
}

.game-card:nth-child(2)::before { animation-delay: 0.9s; }
.game-card:nth-child(3)::before { animation-delay: 1.8s; }
.game-card:nth-child(4)::before { animation-delay: 2.7s; }
.game-card:nth-child(5)::before { animation-delay: 3.6s; }

@keyframes shimmer {
  0%    { left: -80%; opacity: 0; }
  8%    { opacity: 1; }
  48%   { left: 120%; opacity: 0.6; }
  49%, 100% { left: -80%; opacity: 0; }
}

/* Hover lift enhancement — override the base -3px */
.game-card {
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.game-card:hover { transform: translateY(-7px); }

.game-row {
  transition: transform 0.18s ease, background 0.15s ease, border-color 0.15s ease;
}

.game-row:hover { transform: translateX(4px); }

/* Button ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0);
  animation: rippleOut 0.55s linear;
  pointer-events: none;
  z-index: 10;
}

@keyframes rippleOut {
  to { transform: scale(4.5); opacity: 0; }
}

/* Balance pulse on update */
@keyframes balPulse {
  0%   { transform: scale(1);    }
  35%  { transform: scale(1.14); color: var(--gold); }
  65%  { transform: scale(0.97); }
  100% { transform: scale(1);    }
}

.bal-pulse {
  animation: balPulse 0.52s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes valueIncrease {
  0% { transform: translateY(5px) scale(0.96); opacity: 0.72; }
  42% { transform: translateY(-2px) scale(1.12); color: var(--green); text-shadow: 0 0 16px color-mix(in srgb, var(--green) 58%, transparent); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes valueDecrease {
  0% { transform: translateY(-3px) scale(1.04); }
  45% { transform: translateY(2px) scale(0.94); color: var(--red); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes valueChanged {
  0% { transform: scale(0.96); opacity: 0.72; }
  50% { transform: scale(1.08); color: var(--gold); }
  100% { transform: scale(1); opacity: 1; }
}

.value-increased,
.value-decreased,
.value-changed {
  display: inline-block;
  transform-origin: center;
}

.value-increased { animation: valueIncrease 0.68s var(--ease-ui); }
.value-decreased { animation: valueDecrease 0.58s var(--ease-ui); }
.value-changed { animation: valueChanged 0.52s var(--ease-ui); }

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rewardEnter {
  0% { opacity: 0; transform: translateY(16px) scale(0.92); box-shadow: none; }
  62% { opacity: 1; transform: translateY(-3px) scale(1.025); box-shadow: 0 0 22px var(--accent-soft); }
  100% { transform: translateY(0) scale(1); }
}

.vault-row.card-enter { animation: cardEnter 0.34s var(--ease-ui) both; }
.vault-row.reward-enter { animation: rewardEnter 0.62s var(--ease-ui) both; }

/* XP bar smooth width transition */
.xp-fill {
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========================================================================== */
/* HORROR FX — canvas overlay, lightning flash, blood drips, card back,       */
/* coin face toggle                                                             */
/* ========================================================================== */

/* Canvas for ash particles (fixed full-screen, above content, below modals) */
#horrorFx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.6s ease;
}
[data-theme="horror"] #horrorFx { opacity: 1; }
[data-theme="dragon"] #horrorFx { z-index: -1; opacity: 0.82; }

/* Lightning flash overlay */
#lightningFlash {
  position: fixed;
  inset: 0;
  background: #fff;
  pointer-events: none;
  opacity: 0;
  z-index: 95;
  display: none;
}
[data-theme="horror"] #lightningFlash { display: block; }

/* ---- Blood drip ---------------------------------------------------------- */

@keyframes bloodDrip {
  0%   { height: 0;                opacity: 0.92; border-radius: 0 0 60% 60%; }
  35%  { height: var(--drip-h);    opacity: 1;    border-radius: 0 0 50% 50%; }
  75%  { height: var(--drip-h);    opacity: 0.9;  }
  100% { height: var(--drip-h);    opacity: 0;    }
}

.blood-drip {
  position: fixed;
  top: 56px;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(180deg, #8b0000 0%, #5a0000 60%, #3a0000 100%);
  border-radius: 0 0 50% 50%;
  transform-origin: top center;
  animation: bloodDrip var(--drip-dur, 2.2s) ease-in forwards;
}

/* ---- Blood splatter on result-card lose ---------------------------------- */

@keyframes splatterIn {
  from { opacity: 0; transform: scale(0.7) rotate(-4deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

[data-theme="horror"] .result-card.lose {
  position: relative;
  overflow: hidden;
}

[data-theme="horror"] .result-card.lose::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 25% 20%, rgba(180, 10, 20, 0.35), transparent 65%),
    radial-gradient(ellipse 55% 45% at 78% 72%, rgba(150, 8, 16, 0.28), transparent 65%),
    radial-gradient(ellipse 40% 35% at 55% 40%, rgba(120, 6, 12, 0.20), transparent 65%);
  animation: splatterIn 0.45s ease forwards;
}

/* ---- Gothic card back (skull tile) --------------------------------------- */

[data-theme="horror"] .pcard.back {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='9' r='7' fill='%235a0a10'/%3E%3Cellipse cx='8' cy='9' rx='2.2' ry='2.6' fill='%23200305'/%3E%3Cellipse cx='14' cy='9' rx='2.2' ry='2.6' fill='%23200305'/%3E%3Cpolygon points='10,14 12,14 11,17' fill='%23200305'/%3E%3Crect x='7' y='15' width='8' height='6' rx='1.5' fill='%235a0a10'/%3E%3Crect x='8.5' y='15' width='1' height='6' fill='%23200305'/%3E%3Crect x='11' y='15' width='1' height='6' fill='%23200305'/%3E%3Crect x='13.5' y='15' width='1' height='6' fill='%23200305'/%3E%3C/svg%3E")
    center / 28px 28px,
    linear-gradient(160deg, #1e0306, #120204);
  border: 1px solid rgba(155, 15, 25, 0.55);
}

/* ---- Horror coin face toggle --------------------------------------------- */

/* Standard coin faces hidden in horror theme; horror faces hidden otherwise */
.horror-face { display: none; }
[data-theme="horror"] .horror-face { display: block; }
[data-theme="horror"] .standard-face { display: none; }

/* The tails horror face must start rotated (same rule as .face.tails) */
#coin .horror-face.tails { transform: rotateX(180deg); }

/* ---- Dragon coin face toggle --------------------------------------------- */
.dragon-face { display: none; }
[data-theme="dragon"] .dragon-face { display: block; }
[data-theme="dragon"] .standard-face { display: none; }
[data-theme="dragon"] .horror-face   { display: none; }
#coin .dragon-face.tails { transform: rotateX(180deg); }

/* ========================================================================== */
/* CARD FRAMES                                                                  */
/* Card frames: applied via data-card-frame on <html>.                         */
/* Avatar frames: applied via data-frame on <html>.                            */
/* ========================================================================== */

/* Gold card frame */
[data-card-frame="gold"] .pcard {
  border: 2px solid #c8a050 !important;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(255, 212, 121, 0.7),
    0 0 14px rgba(255, 200, 80, 0.45) !important;
}
[data-card-frame="gold"] .pcard.back {
  border-color: #c8a050 !important;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 212, 121, 0.5),
    0 0 12px rgba(255, 200, 80, 0.35) !important;
}

/* Shadow card frame */
[data-card-frame="shadow"] .pcard {
  border: 2px solid rgba(0, 0, 0, 0.72) !important;
  box-shadow:
    5px 5px 0 rgba(0, 0, 0, 0.65),
    0 8px 18px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  transform: translate(-2px, -2px);
}
[data-card-frame="shadow"] .pcard.back {
  border-color: rgba(0, 0, 0, 0.72) !important;
}

/* Neon card frame */
[data-card-frame="neon"] .pcard {
  border: 2px solid var(--accent) !important;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px var(--accent),
    0 0 16px var(--accent-soft),
    0 0 32px var(--accent-soft) !important;
}
[data-card-frame="neon"] .pcard.back {
  border-color: var(--accent) !important;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.5),
    0 0 0 1px var(--accent),
    0 0 14px var(--accent-soft) !important;
}

/* Card frames for classic/obsidian/ruby/horror_f/cyber_f (kept before frame preview reset) */
[data-card-frame="classic"] .pcard {
  border: 2px solid #b0a090 !important;
  box-shadow: 0 2px 8px rgba(176,160,144,0.35) !important;
}
[data-card-frame="obsidian"] .pcard {
  border: 2px solid #1a1a2e !important;
  box-shadow: 0 0 12px rgba(80,0,120,0.55), inset 0 1px 0 rgba(255,255,255,0.06) !important;
}
[data-card-frame="ruby"] .pcard {
  border: 2px solid #c0182c !important;
  box-shadow: 0 0 14px rgba(220,30,50,0.55) !important;
}
[data-card-frame="horror_f"] .pcard {
  border: 2px solid #7a0010 !important;
  box-shadow: 0 0 16px rgba(180,0,20,0.6), inset 0 1px 0 rgba(255,60,60,0.08) !important;
}
[data-card-frame="cyber_f"] .pcard {
  border: 2px solid #00c8a0 !important;
  box-shadow: 0 0 12px rgba(0,200,160,0.5) !important;
}
[data-card-frame="dragon_f"] .pcard {
  border: 2px solid #c8a050 !important;
  box-shadow: 0 0 0 1px #7a2800, 0 0 14px rgba(200,130,0,0.55), inset 0 1px 0 rgba(255,220,100,0.4) !important;
}
[data-card-frame="dragon_f"] .pcard.back {
  border-color: #c8a050 !important;
  box-shadow: 0 0 0 1px #7a2800, 0 0 12px rgba(200,130,0,0.45) !important;
}
[data-card-frame="yinyang_f"] .pcard {
  border: 2px solid transparent !important;
  background:
    linear-gradient(160deg, #ffffff, #e9ecf6) padding-box,
    conic-gradient(from 45deg, #111 50%, #e8e8e8 50%) border-box !important;
  box-shadow: 0 0 8px rgba(180,180,180,0.3) !important;
}

/* ========================================================================== */
/* SETTINGS EXTRAS                                                              */
/* ========================================================================== */

/* Profile row */
.settings-profile-panel { padding-bottom: 14px; }
.settings-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.settings-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}
.settings-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.settings-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-profile-info strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-action-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--accent-soft);
  border: 1px solid var(--stroke-strong);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s;
}
.settings-action-btn:active { background: var(--accent); color: #fff; }

/* Theme head row */
.settings-theme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.settings-shop-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--stroke-strong);
  border-radius: 8px;
  padding: 4px 11px;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-shop-link:active { background: var(--accent); color: #fff; }

/* Coming soon panel */
.settings-soon-panel {
  text-align: center;
  padding: 24px 20px 20px;
}
.settings-soon-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  animation: soonPulse 2.4s ease-in-out infinite;
}
@keyframes soonPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}
.settings-soon-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}
.settings-soon-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.settings-soon-list li {
  font-size: 0.87rem;
  color: var(--muted);
  padding: 7px 14px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--stroke);
  text-align: left;
}
.settings-soon-hint {
  font-size: 0.78rem;
  margin: 0;
}

/* ========================================================================== */
/* SHOP                                                                         */
/* ========================================================================== */

/* Coins row inside the profile/balance card */
.coins-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0 2px;
  font-size: 0.86rem;
  overflow: hidden;
}
.coins-icon { font-size: 1rem; line-height: 1; flex-shrink: 0; }
.coins-label { color: var(--muted); flex-shrink: 0; }
#coinsDisplay { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.coins-shop-btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: 4px 14px;
  font-size: 0.78rem;
  border-radius: 20px;
  font-weight: 700;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.03em;
  line-height: 1.4;
  box-shadow: 0 2px 8px var(--accent-soft);
}

/* Shop view header */
.shop-coins-line {
  font-size: 1.15rem;
  margin: 4px 0 2px;
  font-weight: 700;
}
.shop-coins-hint { font-size: 0.8rem; margin: 0; }

/* Convert cards → coins (one-way top-up) */
.convert-hint { font-size: 0.8rem; margin: 0 16px 8px; }
#convertEmpty { margin: 0 16px 12px; }
.shop-convert-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
}
.convert-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 16px 4px;
}
.convert-summary { font-size: 0.85rem; opacity: 0.8; }
.convert-btn:disabled { opacity: 0.5; }

/* Shop item grid */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 20px;
}

.shop-item {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.shop-item.owned {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-soft);
}

/* Theme preview swatch in shop */
.shop-thumb {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border-radius: 0;
}

/* Profile-frame thumb: neutral bg, ring centered */
.shop-frame-thumb {
  background: rgba(255,255,255,0.04) !important;
  position: relative;
}
.shop-frame-thumb .avatar-ring-preview {
  width: 44px;
  height: 44px;
}
.shop-frame-thumb .shop-owned-check,
.shop-frame-thumb .shop-vip-icon {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.75rem;
}

.shop-meta {
  padding: 9px 11px 4px;
  flex: 1;
}
.shop-meta b {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}
.shop-meta small {
  display: block;
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
}

.shop-price {
  padding: 7px 11px 11px;
}
.buy-btn {
  width: 100%;
  padding: 7px 0;
  border: none;
  border-radius: 8px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.buy-btn:active { opacity: 0.75; }
.owned-badge {
  display: block;
  text-align: center;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 0;
}

/* "Coming soon" placeholders */
.shop-soon-grid .shop-soon { opacity: 0.45; pointer-events: none; }
.shop-soon-thumb {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--surface-2);
}

/* VIP badge on shop items */
.shop-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #a78bfa, #7c6cf5);
  border-radius: 6px;
  padding: 2px 7px;
  margin-bottom: 5px;
  letter-spacing: 0.03em;
}

/* ── Rarity badges ──────────────────────────────────────────────────────── */
.rarity-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1.5;
  margin-bottom: 4px;
  white-space: nowrap;
}
/* In shop cards the badge sits in .shop-meta — give it block display */
.shop-meta .rarity-badge { display: block; margin-bottom: 6px; }
/* In settings tiles the badge is smaller */
.theme-tile .rarity-badge,
.frame-tile .rarity-badge,
.card-frame-tile .rarity-badge {
  font-size: 0.58rem;
  padding: 1px 5px;
  margin-bottom: 2px;
}

.rarity-free      { background: rgba(120,120,140,0.18); color: #8a8aaa; border: 1px solid rgba(120,120,140,0.28); }
.rarity-common    { background: rgba(50,180,100,0.14); color: #3eb87a; border: 1px solid rgba(50,180,100,0.28); }
.rarity-epic      { background: rgba(150,80,255,0.14); color: #a060ff; border: 1px solid rgba(150,80,255,0.28); }
.rarity-legendary { background: rgba(240,160,30,0.14); color: #e8920a; border: 1px solid rgba(240,160,30,0.28); }
.rarity-exclusive {
  background: linear-gradient(90deg, rgba(200,160,60,0.16), rgba(180,80,30,0.14));
  color: #c8a050;
  border: 1px solid rgba(200,150,50,0.35);
  animation: rarity-exclusive-shimmer 3s ease-in-out infinite;
}
.rarity-limited {
  background: linear-gradient(90deg, rgba(200,50,60,0.14), rgba(200,150,50,0.14));
  color: #d06040;
  border: 1px solid rgba(200,80,60,0.32);
}

@keyframes rarity-exclusive-shimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.72; }
}

/* buy button disabled (not VIP) */
.buy-btn.vip-gate {
  background: linear-gradient(135deg, #a78bfa, #7c6cf5);
}

/* owned check-mark color on VIP items */
.shop-item.owned.vip-item {
  border-color: #a78bfa;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.25);
}

/* VIP-locked items (not owned, VIP required) */
.shop-item.vip-item-locked {
  opacity: 0.85;
}

/* owned check-mark color on exclusive items */
.shop-item.owned.exclusive-item {
  border-color: #c8a050;
  box-shadow: 0 0 12px rgba(200,160,80,0.25);
}
.shop-item.exclusive-item-locked { opacity: 0.85; }

/* Shop thumb overlay icons */
.shop-owned-check {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.shop-vip-icon {
  font-size: 26px;
}

/* Theme tile lock state */
.theme-tile.theme-locked { opacity: 0.55; }
.theme-lock-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.78rem;
  line-height: 1;
}
.theme-tile.unlocked { opacity: 1; }
.theme-tile.unlocked .theme-lock-badge { display: none; }

/* ========================================================================== */
/* FRAME TILES (settings)                                                      */
/* ========================================================================== */

.frame-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.frame-tile {
  position: relative;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 8px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
}

.frame-tile.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 14px var(--accent-soft);
}

.frame-tile:active { transform: scale(0.97); }

.frame-tile > span:not(.frame-lock-badge) {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.frame-tile small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

/* ---- Avatar ring preview inside profile frame tiles ----------------------- */
.avatar-ring-preview-wrap {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-ring-preview {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft, rgba(130,100,200,0.3)), var(--surface-2, #2a2a40));
  border: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition: box-shadow 0.15s;
}

.arp-gold   { border-color: #c8a050; box-shadow: 0 0 0 2px #7a5c18, 0 0 14px rgba(255,200,80,0.55); }
.arp-shadow { border-color: #1a1a1a; box-shadow: 4px 4px 0 rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.07); transform: translate(-2px,-2px); }
.arp-neon   { border-color: var(--accent, #a060ff); box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 12px var(--accent, #a060ff), 0 0 24px var(--accent-soft, rgba(160,96,255,0.3)); }
.arp-classic { border-color: #c0b8a8; box-shadow: 0 0 0 2px #6a6058, 0 0 12px rgba(192,184,168,0.4); }
.arp-obsidian { border-color: #2a1040; box-shadow: 0 0 0 2px #8840d0, 0 0 16px rgba(136,64,208,0.65); }
.arp-ruby   { border-color: #9b1a3a; box-shadow: 0 0 0 2px rgba(180,30,60,0.3), 0 0 14px rgba(160,20,50,0.55); }
.arp-horror { border-color: #8b1a2a; box-shadow: 0 0 0 2px rgba(155,15,30,0.5), 0 0 14px rgba(155,0,20,0.5); }
.arp-cyber  { border-color: #00c8a0; box-shadow: 0 0 0 2px rgba(0,200,160,0.3), 0 0 12px rgba(0,200,160,0.5); }
.arp-dragon {
  border-color: #c8a050;
  box-shadow: 0 0 0 2px #7a2800, 0 0 18px rgba(200,130,0,0.7), 0 0 32px rgba(180,80,0,0.3);
}
.arp-yinyang {
  border: 3px solid transparent;
  background:
    linear-gradient(135deg, rgba(30,20,40,0.5), rgba(20,15,35,0.8)) padding-box,
    conic-gradient(from 45deg, #111 50%, #eee 50%) border-box;
  box-shadow: 0 0 8px rgba(200,200,200,0.2);
}

/* Mini card preview inside a frame tile */
.frame-preview-wrap {
  width: 46px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.frame-preview-wrap .pcard {
  width: 40px;
  height: 58px;
  border-radius: 7px;
  padding: 4px 6px;
  animation: none;
  background: linear-gradient(160deg, #ffffff, #e9ecf6) !important;
  color: #14163a !important;
  /* Reset any global data-card-frame border so each preview shows its own style */
  border: 1px solid rgba(180, 180, 200, 0.5) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22) !important;
  transform: none !important;
}

.frame-preview-wrap .pcard .r { font-size: 13px; }
.frame-preview-wrap .pcard .s { font-size: 16px; }

/* Per-frame preview overrides — !important to beat the reset above */
.frame-preview-gold .pcard {
  border: 2px solid #c8a050 !important;
  box-shadow:
    0 3px 8px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 0 0 1px rgba(255,212,121,0.7),
    0 0 10px rgba(255,200,80,0.45) !important;
}

.frame-preview-shadow .pcard {
  border: 2px solid rgba(0,0,0,0.72) !important;
  box-shadow:
    3px 3px 0 rgba(0,0,0,0.65),
    0 5px 12px rgba(0,0,0,0.85),
    inset 0 1px 0 rgba(255,255,255,0.9) !important;
  transform: translate(-1px,-1px) !important;
}

.frame-preview-neon .pcard {
  border: 2px solid var(--accent) !important;
  box-shadow:
    0 3px 8px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 0 0 1px var(--accent),
    0 0 10px var(--accent-soft),
    0 0 20px var(--accent-soft) !important;
}

.frame-preview-classic .pcard {
  border: 2px solid #b0a090 !important;
  box-shadow: 0 2px 8px rgba(176,160,144,0.35), inset 0 1px 0 rgba(255,255,255,0.9) !important;
}

.frame-preview-obsidian .pcard {
  border: 2px solid #1a1a2e !important;
  box-shadow: 0 0 12px rgba(80,0,120,0.55), inset 0 1px 0 rgba(255,255,255,0.06) !important;
}

.frame-preview-ruby .pcard {
  border: 2px solid #c0182c !important;
  box-shadow: 0 0 14px rgba(220,30,50,0.55), inset 0 1px 0 rgba(255,200,200,0.08) !important;
}

.frame-preview-horror_f .pcard {
  border: 2px solid #7a0010 !important;
  box-shadow: 0 0 16px rgba(180,0,20,0.6), inset 0 1px 0 rgba(255,60,60,0.08) !important;
}

.frame-preview-cyber_f .pcard {
  border: 2px solid #00c8a0 !important;
  box-shadow: 0 0 12px rgba(0,200,160,0.5), inset 0 1px 0 rgba(0,255,200,0.06) !important;
}

.frame-preview-dragon_f .pcard {
  border: 2px solid #c8a050 !important;
  box-shadow: 0 0 0 1px #7a2800, 0 0 16px rgba(200,130,0,0.6), inset 0 1px 0 rgba(255,220,100,0.3) !important;
}

.frame-preview-yinyang_f .pcard {
  border: 2px solid transparent !important;
  background:
    linear-gradient(160deg, #ffffff, #e9ecf6) padding-box,
    conic-gradient(from 45deg, #111 50%, #e8e8e8 50%) border-box !important;
  box-shadow: 0 0 8px rgba(180,180,180,0.3) !important;
}

/* Frame tile lock state */
.frame-tile.frame-locked { opacity: 0.55; }
.frame-lock-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.78rem;
  line-height: 1;
}
.frame-tile.unlocked { opacity: 1; }
.frame-tile.unlocked .frame-lock-badge { display: none; }

/* Card-frame tile — mirrors frame-tile styles */
.card-frame-tile {
  position: relative;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 8px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
}
.card-frame-tile.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 14px var(--accent-soft);
}
.card-frame-tile:active { transform: scale(0.97); }
.card-frame-tile > span:not(.frame-lock-badge) { font-size: 13px; font-weight: 600; color: var(--text); }
.card-frame-tile small { display: block; font-size: 11px; color: var(--muted); }
.card-frame-tile.card-frame-locked { opacity: 0.55; }
.card-frame-tile.unlocked { opacity: 1; }
.card-frame-tile.unlocked .frame-lock-badge { display: none; }

/* ========================================================================== */
/* DARK THEME — Minimal neutral dark, free                                    */
/* ========================================================================== */
[data-theme="dark"] {
  --bg:           #0d0d0d;
  --bg2:          #141414;
  --surface:      #1c1c1c;
  --surface-2:    #242424;
  --surface-solid:#1c1c1c;
  --stroke:       rgba(255,255,255,0.10);
  --stroke-strong:rgba(255,255,255,0.18);
  --text:         #e8e8e8;
  --muted:        #888;
  --accent:       #a060ff;
  --accent-2:     #7b2fff;
  --accent-grad:  linear-gradient(135deg,#7b2fff,#a060ff);
  --accent-soft:  rgba(160,96,255,0.16);
  --green:        #4ade80;
  --red:          #f87171;
  --blue:         #60a5fa;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 8px 24px rgba(0,0,0,0.55);
  --shadow-sm:    0 2px 10px rgba(0,0,0,0.40);
  --glow:         0 0 20px rgba(160,96,255,0.25);
}
html[data-theme="dark"] { background: #0d0d0d; }

/* ========================================================================== */
/* DRAGON THEME — Imperial Chinese · Black · Gold · White                     */
/* ========================================================================== */
[data-theme="dragon"] {
  --bg:          #0a0800;
  --panel:       #100d02;
  --panel2:      #1a1500;
  --accent:      #c8a840;
  --accent-dark: #8a7020;
  --accent-soft: rgba(200,168,64,0.22);
  --text:        #f8f4e8;
  --muted:       #c8aa68;
  --border:      #3a2e12;
  --card-bg:     #131008;
}

html[data-theme="dragon"] {
  background: #050400;
}
[data-theme="dragon"] body {
  background: transparent !important;
  color: var(--text);
  font-family: "Cinzel", Georgia, serif;
}
html[data-theme="dragon"] #app {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* Golden dragon art — fixed full-screen background at low opacity */
[data-theme="dragon"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url('assets/dragon-art.webp') center/cover no-repeat;
  opacity: 0.13;
  z-index: -1;
  pointer-events: none;
}

/* Subtle diamond lattice overlay — evokes Chinese brocade */
[data-theme="dragon"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(-45deg, transparent 0px, transparent 36px,
      rgba(200,168,64,0.018) 36px, rgba(200,168,64,0.018) 37px),
    repeating-linear-gradient( 45deg, transparent 0px, transparent 36px,
      rgba(200,168,64,0.018) 36px, rgba(200,168,64,0.018) 37px);
  pointer-events: none;
  z-index: 0;
}

/* ─── Brand ─────────────────────────────────────────────────────────────── */
[data-theme="dragon"] .brand-name {
  font-family: "Cinzel Decorative", serif;
  font-weight: 900;
  background: linear-gradient(90deg, #c8a840 0%, #f8e898 40%, #c8a840 70%, #f0d060 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(200,168,64,0.55));
  letter-spacing: 0.04em;
}
[data-theme="dragon"] .brand-mark {
  color: #c8a840;
  filter: drop-shadow(0 0 4px rgba(200,168,64,0.7));
  animation: dragonPulse 3s ease-in-out infinite;
  will-change: filter;
}
@keyframes dragonPulse {
  0%, 100% { filter: drop-shadow(0 0 4px  rgba(200,168,64,0.7)); }
  50%       { filter: drop-shadow(0 0 12px rgba(248,220,80,0.95)); }
}

/* ─── Headings ───────────────────────────────────────────────────────────── */
[data-theme="dragon"] h2 {
  font-family: "Cinzel Decorative", serif;
  font-weight: 700;
  color: #c8a840;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
}
[data-theme="dragon"] h2::before,
[data-theme="dragon"] h2::after {
  content: "❧";
  color: rgba(200,168,64,0.4);
  margin: 0 6px;
  font-size: 0.7em;
  vertical-align: middle;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
[data-theme="dragon"] #topbar {
  background: linear-gradient(180deg, #100d02 0%, rgba(10,8,0,0.93) 100%);
  border-bottom: 1px solid rgba(200,168,64,0.25);
  box-shadow: 0 2px 14px rgba(0,0,0,0.65), inset 0 1px 0 rgba(200,168,64,0.1);
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
[data-theme="dragon"] .sidebar {
  background:
    linear-gradient(180deg, rgba(16,13,2,0.82) 0%, rgba(6,5,0,0.88) 100%),
    url('assets/dragon-sidebar-bg.webp') center / cover no-repeat;
  border-right: 1px solid rgba(200,168,64,0.2);
}
[data-theme="dragon"] .sidebar-head {
  border-bottom: 1px solid rgba(200,168,64,0.18);
}
[data-theme="dragon"] .side-link {
  background: rgba(20,16,2,0.85);
  border-color: rgba(200,168,64,0.14);
  color: #e8d890;
}
[data-theme="dragon"] .side-link:hover,
[data-theme="dragon"] .side-link:focus {
  background: rgba(200,168,64,0.12);
  color: #f8e898;
}
[data-theme="dragon"] .side-link.danger { color: #ff8080; }

/* ─── Profile card ───────────────────────────────────────────────────────── */
/* ─── Golden profile card ───────────────────────────────────────────────── */
[data-theme="dragon"] .profile-card {
  background:
    linear-gradient(135deg, rgba(60,44,0,0.92) 0%, rgba(28,20,0,0.96) 45%, rgba(48,34,0,0.92) 100%);
  border: 2px solid rgba(200,168,64,0.7);
  box-shadow:
    0 0 0 1px rgba(248,220,80,0.18),
    0 6px 32px rgba(0,0,0,0.8),
    0 0 48px rgba(200,168,64,0.18),
    inset 0 1px 0 rgba(248,220,80,0.35),
    inset 0 -1px 0 rgba(200,168,64,0.15);
  overflow: visible;
  padding-top: 28px;
  transform: translateZ(0);
  will-change: box-shadow, border-color;
  animation: dragonCardBorderPulse 3.5s ease-in-out infinite;
}
/* prevent profile-top from clipping the crown */
[data-theme="dragon"] .profile-top {
  overflow: visible;
}
/* Gold shimmer sweep across the card */
[data-theme="dragon"] .profile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(248,220,80,0.08) 50%,
    rgba(255,240,120,0.13) 55%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: dragonCardShimmer 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes dragonCardBorderPulse {
  0%, 100% { border-color: rgba(200,168,64,0.7); box-shadow: 0 0 0 1px rgba(248,220,80,0.18), 0 6px 32px rgba(0,0,0,0.8), 0 0 48px rgba(200,168,64,0.18), inset 0 1px 0 rgba(248,220,80,0.35), inset 0 -1px 0 rgba(200,168,64,0.15); }
  50%       { border-color: rgba(248,220,80,0.95); box-shadow: 0 0 0 1px rgba(248,220,80,0.3),  0 6px 32px rgba(0,0,0,0.8), 0 0 64px rgba(200,168,64,0.32), inset 0 1px 0 rgba(248,220,80,0.5),  inset 0 -1px 0 rgba(200,168,64,0.25); }
}
@keyframes dragonCardShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Avatar ─────────────────────────────────────────────────────────────── */
[data-theme="dragon"] .top-avatar,
[data-theme="dragon"] #settingsAvatar {
  border: 3px solid rgba(200,168,64,0.85);
  box-shadow: 0 0 0 1px rgba(248,220,80,0.25), 0 0 18px rgba(200,168,64,0.55);
}
/* Crown above avatar — dragon theme only */
[data-theme="dragon"] .top-avatar::before {
  content: "👑";
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  line-height: 1;
  z-index: 10;
  pointer-events: none;
  will-change: transform, filter;
  animation: dragonCrownFloat 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(248,220,80,0.9));
}
@keyframes dragonCrownFloat {
  0%, 100% { transform: translateX(-50%) translateY(0px);  filter: drop-shadow(0 0 6px  rgba(248,220,80,0.9)); }
  50%       { transform: translateX(-50%) translateY(-4px); filter: drop-shadow(0 0 10px rgba(255,240,100,1));   }
}
[data-theme="dragon"] .profile-id strong,
[data-theme="dragon"] #sideName {
  background: linear-gradient(90deg, #f8e898, #c8a840);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dragon"] .lvl-badge {
  background: linear-gradient(135deg, #2a2000, #1a1500);
  border: 1px solid rgba(200,168,64,0.5);
  color: #c8a840;
  font-family: "Cinzel", serif;
}

/* ─── XP bar ─────────────────────────────────────────────────────────────── */
[data-theme="dragon"] .xp-bar {
  background: #1a1500;
  border: 1px solid rgba(200,168,64,0.2);
}
[data-theme="dragon"] .xp-fill {
  background: linear-gradient(90deg, #7a5818, #c8a840, #f0d060);
  box-shadow: 0 0 8px rgba(200,168,64,0.5);
}

/* ─── Balance card ───────────────────────────────────────────────────────── */
[data-theme="dragon"] .balance-card {
  background: linear-gradient(160deg, rgba(30,24,0,0.8), rgba(10,8,0,0.9));
  border: 1px solid rgba(200,168,64,0.2);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
[data-theme="dragon"] .topup-btn,
[data-theme="dragon"] .primary:not(.ghost-btn) {
  background: linear-gradient(135deg, #a88020, #c8a840);
  border: 1px solid rgba(248,220,80,0.5);
  color: #0a0800;
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 10px rgba(200,168,64,0.3);
}
[data-theme="dragon"] .topup-btn:hover,
[data-theme="dragon"] .primary:not(.ghost-btn):hover {
  background: linear-gradient(135deg, #c8a840, #f0d060);
  box-shadow: 0 4px 18px rgba(200,168,64,0.5);
}
[data-theme="dragon"] .action.hit,
[data-theme="dragon"] .coins-shop-btn {
  background: rgba(200,168,64,0.15);
  border: 1px solid rgba(200,168,64,0.35);
  color: #c8a840;
}

/* ─── Game cards ─────────────────────────────────────────────────────────── */
/* ─── Game cards — imperial gold border ──────────────────────────────────── */
[data-theme="dragon"] .game-card {
  background: linear-gradient(160deg, rgba(26,21,0,0.76), rgba(14,10,0,0.72));
  border: 1.5px solid rgba(200,168,64,0.55);
  box-shadow: 0 2px 16px rgba(0,0,0,0.55), 0 0 0 1px rgba(200,168,64,0.1);
}
[data-theme="dragon"] .game-card:hover {
  border-color: rgba(248,220,80,0.9);
  box-shadow: 0 4px 28px rgba(200,168,64,0.35), 0 0 0 1px rgba(248,220,80,0.2);
}
[data-theme="dragon"] .gc-info b {
  font-family: "Cinzel", serif;
  color: #c8a840;
  letter-spacing: 0.05em;
}

/* ---- Dragon & Yin-Yang: ink painting game art ----------------------------- */
[data-theme="dragon"] .game-card.coin .gc-art,
[data-theme="yinyang"] .game-card.coin .gc-art {
  background-image: url("assets/coinflip-ink.webp");
  background-size: cover;
  background-position: center;
}

[data-theme="dragon"] .game-card.bj .gc-art,
[data-theme="yinyang"] .game-card.bj .gc-art {
  background-image: url("assets/blackjack-ink.webp");
  background-size: cover;
  background-position: center;
}

[data-theme="dragon"] .game-card.slots .gc-art,
[data-theme="yinyang"] .game-card.slots .gc-art {
  background-image: url("assets/slots-ink.webp");
  background-size: cover;
  background-position: center;
}

[data-theme="dragon"] .game-card.dice-game .gc-art,
[data-theme="yinyang"] .game-card.dice-game .gc-art {
  background-image: url("assets/dice-ink.webp");
  background-size: cover;
  background-position: center;
}

[data-theme="dragon"] .game-card.holdem .gc-art,
[data-theme="yinyang"] .game-card.holdem .gc-art {
  background-image: url("assets/holdem-ink.webp");
  background-size: cover;
  background-position: center;
}

[data-theme="dragon"] .game-card.uno .gc-art,
[data-theme="yinyang"] .game-card.uno .gc-art {
  background-image: url("assets/uno-ink.webp");
  background-size: cover;
  background-position: center;
}

[data-theme="dragon"] .game-card.roulette .gc-art,
[data-theme="yinyang"] .game-card.roulette .gc-art {
  background-image: url("assets/roulette-ink.webp");
  background-size: cover;
  background-position: center;
}

/* ─── Panels ─────────────────────────────────────────────────────────────── */
[data-theme="dragon"] .panel {
  background: linear-gradient(160deg, rgba(19,15,2,0.80), rgba(10,8,0,0.82));
  border: 1px solid rgba(200,168,64,0.18);
  box-shadow: 0 2px 14px rgba(0,0,0,0.4);
}

/* ─── Bottom nav ─────────────────────────────────────────────────────────── */
/* ─── Bottom navigation — Imperial Gold ─────────────────────────────────── */
[data-theme="dragon"] .bottomnav {
  background: linear-gradient(180deg, rgba(14,10,0,0.85) 0%, rgba(6,4,0,0.98) 100%);
  border-top: 2px solid rgba(200,168,64,0.55);
  box-shadow: 0 -2px 24px rgba(200,168,64,0.18), inset 0 1px 0 rgba(248,220,80,0.22);
  backdrop-filter: blur(24px);
}
/* All inactive nav items: dim gold (not gray) */
[data-theme="dragon"] .nav-item {
  color: rgba(200,168,64,0.45);
}
/* Nav icon images — 4 regular nav icons */
[data-theme="dragon"] .nav-item[data-nav="home"] .ni,
[data-theme="dragon"] .nav-item[data-nav="inventory"] .ni,
[data-theme="dragon"] .nav-item[data-nav="play"] .ni,
[data-theme="dragon"] .nav-item[data-nav="profile"] .ni {
  font-size: 0;
  width: 30px;
  height: 30px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
  opacity: 0.65;
}
[data-theme="dragon"] .nav-item.active[data-nav="home"] .ni,
[data-theme="dragon"] .nav-item.active[data-nav="inventory"] .ni,
[data-theme="dragon"] .nav-item.active[data-nav="play"] .ni,
[data-theme="dragon"] .nav-item.active[data-nav="profile"] .ni {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(248,220,80,0.7));
}
[data-theme="dragon"] .nav-item[data-nav="home"] .ni      { background-image: url('assets/dragon-nav-home.webp'); }
[data-theme="dragon"] .nav-item[data-nav="inventory"] .ni { background-image: url('assets/dragon-nav-inventory.webp'); }
[data-theme="dragon"] .nav-item[data-nav="play"] .ni      { background-image: url('assets/dragon-nav-games.webp'); }
[data-theme="dragon"] .nav-item[data-nav="profile"] .ni   { background-image: url('assets/dragon-nav-profile.webp'); }
/* Active nav item: bright imperial gold label */
[data-theme="dragon"] .nav-item.active {
  color: #f0d060;
}
/* Nav labels: Cinzel font for all items */
[data-theme="dragon"] .nl {
  font-family: "Cinzel", serif;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}
/* Active label glow */
[data-theme="dragon"] .nav-item.active .nl {
  color: #f0d060;
  text-shadow: 0 0 8px rgba(248,220,80,0.7);
}
/* Center button — custom dragon star image */
[data-theme="dragon"] .nav-item.center .ni {
  font-size: 0;
  width: 52px;
  height: 52px;
  display: inline-flex;
  background-image: url('assets/dragon-nav-center.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: none;
  box-shadow: 0 0 24px rgba(200,168,64,0.4);
  filter: drop-shadow(0 0 10px rgba(248,220,80,0.55));
  opacity: 1;
  animation: dragonOrbPulse 3s ease-in-out infinite;
}
@keyframes dragonOrbPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(200,168,64,0.5)); }
  50%       { filter: drop-shadow(0 0 18px rgba(248,220,80,0.85)); }
}

/* ─── Hero sections ──────────────────────────────────────────────────────── */
[data-theme="dragon"] .hero h1 {
  font-family: "Cinzel Decorative", serif;
  background: linear-gradient(90deg, #c8a840, #f8e898, #c8a840);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(200,168,64,0.4));
}

/* ─── Felt (blackjack table) ─────────────────────────────────────────────── */
[data-theme="dragon"] .felt {
  background: radial-gradient(ellipse 90% 70% at 50% 50%, #1a1200 0%, #0a0800 100%);
  border: 1px solid rgba(200,168,64,0.2);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

/* ─── Result cards ───────────────────────────────────────────────────────── */
[data-theme="dragon"] .result-card .verdict {
  font-family: "Cinzel Decorative", serif;
  letter-spacing: 0.06em;
}
[data-theme="dragon"] .result-card.win {
  border-color: rgba(200,168,64,0.6);
  background: linear-gradient(160deg, rgba(30,24,0,0.95), rgba(10,8,0,0.98));
  box-shadow: 0 0 32px rgba(200,168,64,0.22);
}
[data-theme="dragon"] .result-card.lose {
  border-color: rgba(80,60,10,0.5);
  background: linear-gradient(160deg, rgba(16,12,0,0.95), rgba(6,5,0,0.98));
}

/* ─── Playing cards — ivory face, Chinese lattice back ───────────────────── */
[data-theme="dragon"] .pcard {
  background: linear-gradient(160deg, #fdf8ec 0%, #f0e8d0 100%);
  border: 1px solid rgba(200,168,64,0.6);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(200,168,64,0.2);
  color: #1a0800;
}
[data-theme="dragon"] .pcard.back {
  background:
    repeating-linear-gradient(-45deg, transparent 0px, transparent 4px,
      rgba(200,168,64,0.18) 4px, rgba(200,168,64,0.18) 5px),
    repeating-linear-gradient( 45deg, transparent 0px, transparent 4px,
      rgba(200,168,64,0.18) 4px, rgba(200,168,64,0.18) 5px),
    #100d02;
  border-color: rgba(200,168,64,0.5);
}

/* ─── Coin overrides ─────────────────────────────────────────────────────── */
[data-theme="dragon"] .coin-rim   { fill: #7a5808; stroke: #c8a840; stroke-width: 1; }
[data-theme="dragon"] .coin-mill  { fill: none; stroke: rgba(200,168,64,0.35); stroke-width: 1.5; stroke-dasharray: 3,3; }
[data-theme="dragon"] .coin-ring  { fill: none; stroke: rgba(200,168,64,0.5); stroke-width: 1.2; }
[data-theme="dragon"] .coin-emblem { fill: #c8a840; }

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
[data-theme="dragon"] input,
[data-theme="dragon"] .auc-input {
  background: #100d02;
  border-color: rgba(200,168,64,0.3);
  color: #f8f4e8;
}
[data-theme="dragon"] input:focus,
[data-theme="dragon"] .auc-input:focus {
  border-color: #c8a840;
  box-shadow: 0 0 0 2px rgba(200,168,64,0.2);
}
[data-theme="dragon"] input::placeholder,
[data-theme="dragon"] .auc-input::placeholder { color: #6a5838; }

/* ─── History items ──────────────────────────────────────────────────────── */
[data-theme="dragon"] .history-item {
  border-left-color: rgba(200,168,64,0.35);
  background: rgba(20,16,0,0.6);
}

/* ─── VIP / shop badges ──────────────────────────────────────────────────── */
[data-theme="dragon"] .shop-vip-badge { color: #f0d060; }
[data-theme="dragon"] .owned-badge    { color: #c8a840; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
[data-theme="dragon"] ::-webkit-scrollbar { width: 5px; }
[data-theme="dragon"] ::-webkit-scrollbar-track { background: #0a0800; }
[data-theme="dragon"] ::-webkit-scrollbar-thumb { background: #4a3808; border-radius: 3px; }
[data-theme="dragon"] ::-webkit-scrollbar-thumb:hover { background: #c8a840; }

/* ─── Wallet / vault ─────────────────────────────────────────────────────── */
[data-theme="dragon"] .wallet-balance { background: linear-gradient(160deg, rgba(26,21,0,0.80), rgba(10,8,0,0.82)); }
[data-theme="dragon"] .tier-card {
  background: linear-gradient(160deg, rgba(26,21,0,0.76), rgba(16,13,2,0.80));
  border: 1px solid rgba(200,168,64,0.2);
}
[data-theme="dragon"] .vault-card {
  background: rgba(19,15,2,0.78);
  border: 1px solid rgba(200,168,64,0.18);
}

/* ─── Settings ───────────────────────────────────────────────────────────── */
[data-theme="dragon"] .settings-soon-panel {
  background: linear-gradient(160deg, rgba(26,21,0,0.80), rgba(10,8,0,0.82));
  border: 1px solid rgba(200,168,64,0.15);
}
[data-theme="dragon"] .settings-soon-icon { filter: drop-shadow(0 0 6px rgba(200,168,64,0.4)); }

/* ========================================================================== */
/* PROMO CODE                                                                   */
/* ========================================================================== */

.promo-panel { padding: 12px 14px; overflow: hidden; }

.promo-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.promo-input {
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.promo-input:focus { border-color: var(--accent); }
.promo-input::placeholder { text-transform: none; letter-spacing: 0; color: var(--muted); }

/* ========================================================================== */
/* AVATAR FRAMES                                                                */
/* Applied via data-frame on <html>; mirrors the card frame style on avatars.  */
/* ========================================================================== */

/* Gold — warm gilded ring */
[data-frame="gold"] .top-avatar,
[data-frame="gold"] .side-avatar,
[data-frame="gold"] #settingsAvatar {
  border: 4px solid #c8a050 !important;
  box-shadow:
    0 0 0 2px #7a5c18,
    0 0 0 4px rgba(255,212,100,0.25),
    0 0 18px rgba(255,200,80,0.6),
    inset 0 1px 2px rgba(255,240,180,0.4) !important;
}

/* Shadow — dark offset with depth */
[data-frame="shadow"] .top-avatar,
[data-frame="shadow"] .side-avatar,
[data-frame="shadow"] #settingsAvatar {
  border: 4px solid #1a1a1a !important;
  box-shadow:
    5px 5px 0 rgba(0,0,0,0.75),
    0 0 0 2px rgba(255,255,255,0.08),
    inset 0 1px 2px rgba(255,255,255,0.12) !important;
  transform: translate(-3px, -3px);
}

/* Neon — glowing ring matching active theme */
[data-frame="neon"] .top-avatar,
[data-frame="neon"] .side-avatar,
[data-frame="neon"] #settingsAvatar {
  border: 4px solid var(--accent) !important;
  box-shadow:
    0 0 0 2px rgba(0,0,0,0.5),
    0 0 14px var(--accent),
    0 0 32px var(--accent-soft),
    inset 0 0 8px rgba(255,255,255,0.06) !important;
}

/* ---- avatar frames (classic, obsidian, ruby, horror_f, cyber_f) ---------- */

/* Classic — silver double ring, metallic sheen */
[data-frame="classic"] .top-avatar,
[data-frame="classic"] .side-avatar,
[data-frame="classic"] #settingsAvatar {
  border: 4px solid #c0b8a8 !important;
  box-shadow:
    0 0 0 2px #6a6058,
    0 0 0 5px rgba(192,184,168,0.2),
    0 0 14px rgba(192,184,168,0.4),
    inset 0 1px 3px rgba(255,248,230,0.5) !important;
}

/* Obsidian — dark volcanic glass with purple iridescence */
[data-frame="obsidian"] .top-avatar,
[data-frame="obsidian"] .side-avatar,
[data-frame="obsidian"] #settingsAvatar {
  border: 4px solid #2a1040 !important;
  box-shadow:
    0 0 0 2px #8840d0,
    0 0 0 5px rgba(136,64,208,0.15),
    0 0 20px rgba(136,64,208,0.7),
    0 0 40px rgba(136,64,208,0.25) !important;
}

/* Ruby — deep red gem with crimson glow */
[data-frame="ruby"] .top-avatar,
[data-frame="ruby"] .side-avatar,
[data-frame="ruby"] #settingsAvatar {
  border: 4px solid #c0182c !important;
  box-shadow:
    0 0 0 2px #6a000e,
    0 0 0 5px rgba(220,30,50,0.2),
    0 0 20px rgba(220,30,50,0.75),
    0 0 40px rgba(220,30,50,0.3) !important;
}

/* Gothic (horror_f) — blood-red with dark menacing glow */
[data-frame="horror_f"] .top-avatar,
[data-frame="horror_f"] .side-avatar,
[data-frame="horror_f"] #settingsAvatar {
  border: 5px solid #8a0012 !important;
  box-shadow:
    0 0 0 1px #200006,
    0 0 0 4px rgba(180,0,20,0.25),
    0 0 18px rgba(180,0,20,0.85),
    0 0 36px rgba(180,0,20,0.45),
    inset 0 0 10px rgba(200,0,20,0.2) !important;
  animation: horror-frame-pulse 3s ease-in-out infinite;
}

@keyframes horror-frame-pulse {
  0%, 100% { box-shadow: 0 0 0 1px #200006, 0 0 0 4px rgba(180,0,20,0.25), 0 0 18px rgba(180,0,20,0.85), 0 0 36px rgba(180,0,20,0.45), inset 0 0 10px rgba(200,0,20,0.2); }
  50%       { box-shadow: 0 0 0 1px #200006, 0 0 0 4px rgba(180,0,20,0.35), 0 0 28px rgba(200,0,20,1.0), 0 0 56px rgba(180,0,20,0.65), inset 0 0 14px rgba(200,0,20,0.3); }
}

/* Cyber (cyber_f) — neon teal electric ring with pulse */
[data-frame="cyber_f"] .top-avatar,
[data-frame="cyber_f"] .side-avatar,
[data-frame="cyber_f"] #settingsAvatar {
  border: 4px solid #00d4a0 !important;
  box-shadow:
    0 0 0 2px rgba(0,0,0,0.6),
    0 0 0 5px rgba(0,212,160,0.2),
    0 0 18px rgba(0,212,160,0.9),
    0 0 40px rgba(0,212,160,0.4) !important;
  animation: cyber-frame-pulse 2s ease-in-out infinite;
}

@keyframes cyber-frame-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(0,0,0,0.6), 0 0 0 5px rgba(0,212,160,0.2), 0 0 18px rgba(0,212,160,0.9), 0 0 40px rgba(0,212,160,0.4); }
  50%       { box-shadow: 0 0 0 2px rgba(0,0,0,0.6), 0 0 0 5px rgba(0,212,160,0.3), 0 0 28px rgba(0,212,160,1.0), 0 0 60px rgba(0,212,160,0.6); }
}


/* ========================================================================== */
/* YIN-YANG VIDEO BACKGROUND                                                    */
/* ========================================================================== */

.yinyang-bg-video {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.38;
  pointer-events: none;
}

/* When yinyang theme is active: show video, make html/body transparent,
   lift content above the video layer */
html[data-theme="yinyang"] {
  background: #000 !important;
}

html[data-theme="yinyang"] body {
  background: transparent !important;
}

html[data-theme="yinyang"] .yinyang-bg-video {
  display: block;
}

html[data-theme="yinyang"] #app {
  position: relative;
  z-index: 1;
}

/* topbar is already z-index:5 — no change needed */
/* sidebar/overlay are already z-index 80/90 — no change needed */

/* ========================================================================== */
/* YIN-YANG THEME                                                               */
/* ========================================================================== */

[data-theme="yinyang"] {
  --bg: rgba(14, 14, 14, 0.6);
  --bg2: rgba(24, 24, 24, 0.6);
  --surface: rgba(255, 255, 255, 0.07);
  --surface-2: rgba(255, 255, 255, 0.12);
  --surface-solid: rgba(12, 12, 12, 0.72);
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke-strong: rgba(255, 255, 255, 0.30);
  --text: #e8e8e8;
  --muted: #888888;
  --accent: #e0e0e0;
  --accent-2: #bbbbbb;
  --accent-grad: linear-gradient(135deg, #ffffff 0%, #cccccc 55%, #999999 100%);
  --accent-soft: rgba(255, 255, 255, 0.12);
  --gold: #e0c040;
  --green: #60d080;
  --red: #e05060;
  --blue: #60a0e0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.65);
  --glow: 0 0 24px rgba(255, 255, 255, 0.25);
}

[data-theme="yinyang"] body {
  background:
    radial-gradient(circle 60vw at 15% 25%, rgba(255, 255, 255, 0.055) 0%, transparent 70%),
    radial-gradient(circle 60vw at 85% 75%, rgba(255, 255, 255, 0.04) 0%, transparent 70%),
    linear-gradient(180deg, #181818 0%, #0e0e0e 100%);
  background-attachment: fixed;
}

/* Concentric circles decorative background */
[data-theme="yinyang"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% 50%, transparent 28%, rgba(255,255,255,0.025) 28.5%, rgba(255,255,255,0.025) 29%, transparent 29.5%),
    radial-gradient(circle at 50% 50%, transparent 48%, rgba(255,255,255,0.02) 48.5%, rgba(255,255,255,0.02) 49%, transparent 49.5%),
    radial-gradient(circle at 50% 50%, transparent 68%, rgba(255,255,255,0.015) 68.5%, rgba(255,255,255,0.015) 69%, transparent 69.5%);
}

[data-theme="yinyang"] ::-webkit-scrollbar { width: 4px; }
[data-theme="yinyang"] ::-webkit-scrollbar-track { background: #0a0a0a; }
[data-theme="yinyang"] ::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

[data-theme="yinyang"] .topbar {
  background: rgba(10, 10, 10, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

[data-theme="yinyang"] .brand {
  color: #f0f0f0;
  letter-spacing: 0.08em;
}

[data-theme="yinyang"] .side-profile,
[data-theme="yinyang"] .top-profile {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="yinyang"] .action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
}

[data-theme="yinyang"] .action:active {
  background: rgba(255, 255, 255, 0.16);
}

[data-theme="yinyang"] .action.primary {
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  border-color: transparent;
}

[data-theme="yinyang"] .action.primary:active {
  background: rgba(220, 220, 220, 0.95);
}

[data-theme="yinyang"] .game-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="yinyang"] .game-card:active {
  background: rgba(255, 255, 255, 0.10);
}

[data-theme="yinyang"] .panel,
[data-theme="yinyang"] .wallet-section,
[data-theme="yinyang"] .card-panel {
  background: var(--surface);
  border: 1px solid var(--stroke);
}

[data-theme="yinyang"] .nav-bar {
  background: rgba(10, 10, 10, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

[data-theme="yinyang"] .nav-item.active {
  color: #ffffff;
}

[data-theme="yinyang"] input,
[data-theme="yinyang"] textarea,
[data-theme="yinyang"] select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
}

[data-theme="yinyang"] input:focus,
[data-theme="yinyang"] textarea:focus {
  border-color: rgba(255, 255, 255, 0.40);
  outline: none;
}

[data-theme="yinyang"] .sidebar {
  background-image: url('assets/yinyang-sidebar-bg.webp');
  background-size: cover;
  background-position: center top;
  background-color: #080604;
  border-right: 1px solid rgba(200, 168, 64, 0.28);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.75);
}
[data-theme="yinyang"] .sidebar-head {
  border-bottom: 1px solid rgba(200, 168, 64, 0.22);
}
[data-theme="yinyang"] .side-link {
  background: rgba(8, 6, 3, 0.62);
  border-color: rgba(200, 168, 64, 0.22);
  color: #d4c090;
  backdrop-filter: blur(6px);
}
[data-theme="yinyang"] .side-link:hover,
[data-theme="yinyang"] .side-link:focus {
  background: rgba(200, 168, 64, 0.14);
  border-color: rgba(200, 168, 64, 0.50);
  color: #f8e898;
}
[data-theme="yinyang"] .side-link.danger { color: #ff6060; }

/* Playing cards */
[data-theme="yinyang"] .pcard {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

[data-theme="yinyang"] .pcard.red { color: #e05060; }
[data-theme="yinyang"] .pcard.black { color: #e8e8e8; }

/* Result cards */
[data-theme="yinyang"] .result-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Felt / game table */
[data-theme="yinyang"] .felt,
[data-theme="yinyang"] .bj-area {
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* History rows */
[data-theme="yinyang"] .hist-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* Wallet / tier chips */
[data-theme="yinyang"] .tier {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Vault cards */
[data-theme="yinyang"] .vault-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Stake / join actions */
[data-theme="yinyang"] .stake-row {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

/* ---- Profile card background ---- */
[data-theme="yinyang"] .profile-card {
  background-image: url('assets/yinyang-profile-bg.webp');
  background-size: cover;
  background-position: center top;
  border: 1px solid rgba(200, 168, 64, 0.40);
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(200, 168, 64, 0.18);
}

/* ---- LVL badge ---- */
[data-theme="yinyang"] .lvl-badge {
  background: linear-gradient(135deg, rgba(200, 168, 64, 0.22), rgba(248, 220, 80, 0.12));
  border: 1px solid rgba(200, 168, 64, 0.55);
  color: #c8a840;
}

/* ---- XP bar ---- */
[data-theme="yinyang"] .xp-bar {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(200, 168, 64, 0.18);
}
[data-theme="yinyang"] .xp-fill {
  background: linear-gradient(90deg, rgba(180, 140, 40, 0.85), rgba(248, 220, 80, 1));
}

/* ---- Balance card ---- */
[data-theme="yinyang"] .balance-card {
  background: rgba(8, 6, 3, 0.52);
  border: 1px solid rgba(200, 168, 64, 0.30);
  backdrop-filter: blur(10px);
}

/* ---- Top-up button ---- */
[data-theme="yinyang"] .topup-btn {
  background: linear-gradient(135deg, #a07820 0%, #d4a830 40%, #f0d060 100%);
  color: #0d0800;
  box-shadow: 0 6px 20px rgba(200, 168, 64, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.30);
}
[data-theme="yinyang"] .topup-btn:active {
  filter: brightness(0.92);
}

/* ---- Hero chips (VIP / Аукционы / …) ---- */
[data-theme="yinyang"] .hero-chip {
  background: rgba(8, 6, 3, 0.60);
  border: 1px solid rgba(200, 168, 64, 0.38);
  color: rgba(200, 168, 64, 0.90);
}
[data-theme="yinyang"] .hero-chip:active {
  border-color: rgba(248, 220, 80, 0.80);
  color: #f8e040;
}

/* ---- Custom nav icons — replace emoji with medallion artwork ---- */
[data-theme="yinyang"] .nav-item[data-nav="home"] .ni,
[data-theme="yinyang"] .nav-item[data-nav="inventory"] .ni,
[data-theme="yinyang"] .nav-item[data-nav="play"] .ni,
[data-theme="yinyang"] .nav-item[data-nav="profile"] .ni {
  font-size: 0;
  width: 30px;
  height: 30px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
  opacity: 0.65;
}
[data-theme="yinyang"] .nav-item.active[data-nav="home"] .ni,
[data-theme="yinyang"] .nav-item.active[data-nav="inventory"] .ni,
[data-theme="yinyang"] .nav-item.active[data-nav="play"] .ni,
[data-theme="yinyang"] .nav-item.active[data-nav="profile"] .ni {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.55));
}
[data-theme="yinyang"] .nav-item[data-nav="home"] .ni     { background-image: url('assets/yinyang-nav-home.webp'); }
[data-theme="yinyang"] .nav-item[data-nav="inventory"] .ni { background-image: url('assets/yinyang-nav-inventory.webp'); }
[data-theme="yinyang"] .nav-item[data-nav="play"] .ni      { background-image: url('assets/yinyang-nav-games.webp'); }
[data-theme="yinyang"] .nav-item[data-nav="profile"] .ni   { background-image: url('assets/yinyang-nav-profile.webp'); }

/* ========================================================================== */
/* COLLAPSIBLE DEPOSIT HISTORY                                                  */
/* ========================================================================== */

.collapsible-section { margin-bottom: 8px; }

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.collapsible-header h2 { margin: 0; }

.collapse-arrow {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.22s ease;
  line-height: 1;
}

.collapsible-section.collapsed .collapse-arrow {
  transform: rotate(-90deg);
}

.collapsible-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 1;
}

.collapsible-section.collapsed .collapsible-body {
  max-height: 0;
  opacity: 0;
}


/* ========================================================================== */
/* ROYAL / SOVEREIGN THEME — Limited edition, promo-code only                  */
/* ========================================================================== */

[data-theme="royal"] {
  --bg:           rgba(8, 0, 20, 0.72);
  --bg2:          rgba(16, 0, 36, 0.72);
  --surface:      rgba(123, 47, 255, 0.10);
  --surface-2:    rgba(123, 47, 255, 0.18);
  --surface-solid:rgba(12, 0, 32, 0.85);
  --stroke:       rgba(123, 47, 255, 0.30);
  --stroke-strong:rgba(200, 150, 255, 0.55);
  --text:         #f0e8ff;
  --muted:        #9878cc;
  --accent:       #a060ff;
  --accent-2:     #7b2fff;
  --accent-grad:  linear-gradient(135deg, #9b5fff 0%, #ffd700 100%);
  --accent-soft:  rgba(160, 96, 255, 0.20);
  --gold:         #ffd700;
  --green:        #60d880;
  --red:          #ff5080;
  --blue:         #80b0ff;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 8px 32px rgba(100, 20, 255, 0.45);
  --shadow-sm:    0 4px 16px rgba(100, 20, 255, 0.30);
  --glow:         0 0 32px rgba(160, 96, 255, 0.55);
}

/* ---- Base background ---- */
html[data-theme="royal"] { background: #060012; }
html[data-theme="royal"] body { background: transparent; }

/* ---- Aurora + deep space gradient ---- */
[data-theme="royal"] body {
  background:
    radial-gradient(ellipse 90% 50% at 15% 10%, rgba(100, 20, 255, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 85% 85%, rgba(180, 60, 255, 0.30) 0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(40, 0, 100, 0.50) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 70% 20%, rgba(255, 215, 0, 0.10) 0%, transparent 50%),
    linear-gradient(180deg, #0a0018 0%, #060010 100%);
  background-attachment: fixed;
}

/* ---- Animated aurora overlay ---- */
[data-theme="royal"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 40% at 30% 30%, rgba(120, 40, 255, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 70% 70%, rgba(200, 80, 255, 0.25) 0%, transparent 55%);
  animation: royal-aurora 14s ease-in-out infinite;
}

@keyframes royal-aurora {
  0%, 100% { transform: translate(0, 0) scale(1);      opacity: 0.85; }
  25%       { transform: translate(6%, 12%) scale(1.08); opacity: 1;    }
  50%       { transform: translate(-4%, 6%) scale(0.96); opacity: 0.90; }
  75%       { transform: translate(10%, -6%) scale(1.04); opacity: 1;   }
}

/* ---- Starfield particles ---- */
[data-theme="royal"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle 1.5px at  8% 12%, rgba(255,215,0,0.9) 0%, transparent 60%),
    radial-gradient(circle 1px  at 18% 55%, rgba(255,255,255,0.7) 0%, transparent 60%),
    radial-gradient(circle 2px  at 28%  8%, rgba(190,120,255,0.9) 0%, transparent 60%),
    radial-gradient(circle 1px  at 38% 72%, rgba(255,255,255,0.5) 0%, transparent 60%),
    radial-gradient(circle 1.5px at 48% 30%, rgba(255,215,0,0.7)  0%, transparent 60%),
    radial-gradient(circle 1px  at 55% 90%, rgba(255,255,255,0.6) 0%, transparent 60%),
    radial-gradient(circle 2px  at 63% 20%, rgba(160,80,255,0.8)  0%, transparent 60%),
    radial-gradient(circle 1px  at 72% 48%, rgba(255,255,255,0.5) 0%, transparent 60%),
    radial-gradient(circle 1.5px at 80% 15%, rgba(255,215,0,0.8) 0%, transparent 60%),
    radial-gradient(circle 1px  at 88% 65%, rgba(220,180,255,0.7) 0%, transparent 60%),
    radial-gradient(circle 2px  at 95% 35%, rgba(255,255,255,0.6) 0%, transparent 60%),
    radial-gradient(circle 1px  at 12% 80%, rgba(160,80,255,0.6)  0%, transparent 60%),
    radial-gradient(circle 1.5px at 33% 42%, rgba(255,255,255,0.4) 0%, transparent 60%),
    radial-gradient(circle 1px  at 58% 60%, rgba(255,215,0,0.5)  0%, transparent 60%),
    radial-gradient(circle 2px  at 77% 85%, rgba(200,120,255,0.7) 0%, transparent 60%);
  animation: royal-stars 6s ease-in-out infinite;
}

@keyframes royal-stars {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ---- Content above background layers ---- */
[data-theme="royal"] #app { position: relative; z-index: 1; }

/* ---- Topbar ---- */
[data-theme="royal"] #topbar {
  background: linear-gradient(180deg, rgba(12, 0, 30, 0.95), rgba(12, 0, 30, 0.70));
  border-bottom: 1px solid rgba(160, 96, 255, 0.35);
  box-shadow: 0 2px 20px rgba(100, 20, 255, 0.25);
}

/* ---- Sidebar ---- */
[data-theme="royal"] .sidebar {
  background:
    linear-gradient(180deg, rgba(8,0,22,0.85) 0%, rgba(4,0,14,0.90) 100%),
    url('assets/royal-sidebar-bg.webp') center / cover no-repeat;
  border-right: 1px solid rgba(160, 96, 255, 0.30);
}
[data-theme="royal"] .sidebar-head {
  border-bottom-color: rgba(160, 96, 255, 0.25);
}
[data-theme="royal"] .side-link {
  background: rgba(20, 0, 50, 0.70);
  border-color: rgba(160, 96, 255, 0.25);
  color: #f0e8ff;
}
[data-theme="royal"] .side-link:hover,
[data-theme="royal"] .side-link:focus {
  background: rgba(160, 96, 255, 0.18);
  color: #d8b0ff;
}

/* ---- Brand gradient text ---- */
[data-theme="royal"] .brand-name {
  background: linear-gradient(90deg, #c090ff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

/* ---- Section headings ---- */
[data-theme="royal"] h2,
[data-theme="royal"] .section-heading {
  background: linear-gradient(90deg, #b070ff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Panels & surfaces ---- */
[data-theme="royal"] .panel,
[data-theme="royal"] .card-panel {
  background: rgba(14, 0, 36, 0.78) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(160, 96, 255, 0.28) !important;
  box-shadow: 0 8px 32px rgba(80, 0, 200, 0.22), inset 0 1px 0 rgba(200, 150, 255, 0.10);
}

/* ---- Buttons: shimmer sweep ---- */
[data-theme="royal"] .primary,
[data-theme="royal"] button.primary {
  background: linear-gradient(135deg, #6a18e0, #a060ff) !important;
  border: 1px solid rgba(255, 215, 0, 0.35) !important;
  box-shadow: 0 4px 20px rgba(120, 40, 255, 0.45) !important;
  position: relative;
  overflow: hidden;
}

[data-theme="royal"] .primary::after,
[data-theme="royal"] button.primary::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: royal-shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes royal-shimmer {
  0%        { left: -60%; }
  40%, 100% { left: 120%; }
}

/* ---- Stake / side buttons ---- */
[data-theme="royal"] .side {
  background: rgba(50, 10, 120, 0.55) !important;
  border: 1px solid rgba(160, 96, 255, 0.30) !important;
  color: var(--text) !important;
  backdrop-filter: blur(8px);
}

[data-theme="royal"] .side.sel,
[data-theme="royal"] .side:active {
  background: rgba(100, 30, 220, 0.75) !important;
  border-color: #ffd700 !important;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.40) !important;
  color: #ffd700 !important;
}

/* ---- Bottom nav ---- */
[data-theme="royal"] #bottomNav {
  background: linear-gradient(0deg, rgba(8, 0, 22, 0.97), rgba(12, 0, 28, 0.88));
  border-top: 1px solid rgba(160, 96, 255, 0.25);
  box-shadow: 0 -4px 24px rgba(80, 0, 200, 0.20);
}

[data-theme="royal"] .tab-btn.active .tab-icon,
[data-theme="royal"] .tab-btn.active .tab-label {
  color: #ffd700 !important;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.55);
}

/* ---- Playing cards: dark royal style ---- */
[data-theme="royal"] .pcard {
  background: linear-gradient(155deg, #1a0840, #0d0528);
  border: 1px solid rgba(160, 96, 255, 0.40);
  color: #f0e0ff;
  position: relative;
  overflow: hidden;
}

[data-theme="royal"] .pcard.red { color: #ff7090; }

/* Holographic shimmer on cards */
[data-theme="royal"] .pcard::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(180, 100, 255, 0.22) 48%,
    rgba(255, 215, 0, 0.15) 52%,
    transparent 70%);
  animation: royal-card-shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes royal-card-shimmer {
  0%        { transform: translateX(-120%) skewX(-15deg); }
  40%, 100% { transform: translateX(200%)  skewX(-15deg); }
}

[data-theme="royal"] .pcard.back {
  background:
    repeating-linear-gradient(45deg, #2a0870 0 7px, #1e0558 7px 14px);
  border: 1px solid rgba(160, 96, 255, 0.45);
}

/* ---- Avatar: rotating gold+purple ring ---- */
[data-theme="royal"] .top-avatar,
[data-theme="royal"] .side-avatar,
[data-theme="royal"] #settingsAvatar,
[data-theme="royal"] .settings-avatar {
  position: relative;
  border: 3px solid transparent !important;
  background-clip: padding-box;
  box-shadow:
    0 0 0 3px transparent,
    0 0 20px rgba(160, 96, 255, 0.7),
    0 0 40px rgba(160, 96, 255, 0.35) !important;
}

[data-theme="royal"] .top-avatar::before,
[data-theme="royal"] .side-avatar::before,
[data-theme="royal"] #settingsAvatar::before,
[data-theme="royal"] .settings-avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #7b2fff, #ffd700, #ff80ff, #00cfff, #ffd700, #7b2fff);
  animation: royal-ring-spin 3s linear infinite;
  z-index: -1;
}

@keyframes royal-ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- Game row cards ---- */
[data-theme="royal"] .game-row {
  background-color: rgba(20, 0, 50, 0.70);
  border: 1px solid rgba(160, 96, 255, 0.25);
  backdrop-filter: blur(10px);
}

[data-theme="royal"] .game-row:hover,
[data-theme="royal"] .game-row:active {
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.20);
}

/* ---- Balance / coins glow ---- */
[data-theme="royal"] #coinsDisplay,
[data-theme="royal"] .coins-amount {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ---- Settings tile: animated gradient swatch ---- */
.royal-swatch {
  background: linear-gradient(135deg, #0a0018, #7b2fff, #ffd700, #ff80ff);
  background-size: 300% 300%;
  animation: royal-swatch-anim 5s ease infinite;
  border-radius: inherit;
}

@keyframes royal-swatch-anim {
  0%   { background-position: 0% 50%;   }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%;   }
}

/* ---- Shop: limited badge ---- */
.shop-limited-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #7b2fff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.promo-only-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffd700;
  opacity: 0.85;
}

.shop-item.promo-item .shop-thumb {
  border: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 12px rgba(123, 47, 255, 0.5);
}

/* ---- Royal theme tile in settings ---- */
.royal-tile {
  border: 1px solid rgba(160, 96, 255, 0.4) !important;
  box-shadow: 0 0 16px rgba(123, 47, 255, 0.25) !important;
}

/* ======================================================================== */
/* ROYAL — MAXIMUM EDITION extra effects                                     */
/* ======================================================================== */

/* ---- Crown floating above avatar ---- */
[data-theme="royal"] .top-avatar::after,
[data-theme="royal"] .side-avatar::after,
[data-theme="royal"] #settingsAvatar::after,
[data-theme="royal"] .settings-avatar::after {
  content: "👑";
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  line-height: 1;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.95));
  animation: royal-crown-float 2.8s ease-in-out infinite;
}

@keyframes royal-crown-float {
  0%, 100% { transform: translateX(-50%) translateY(0)   rotate(-4deg); filter: drop-shadow(0 0  8px rgba(255,215,0,0.75)); }
  50%       { transform: translateX(-50%) translateY(-6px) rotate( 4deg); filter: drop-shadow(0 0 18px rgba(255,215,0,1.00)); }
}

/* ---- Avatar ring — thicker rainbow + faster ---- */
[data-theme="royal"] .top-avatar::before,
[data-theme="royal"] .side-avatar::before,
[data-theme="royal"] #settingsAvatar::before,
[data-theme="royal"] .settings-avatar::before {
  inset: -6px;
  background: conic-gradient(from 0deg,
    #4400cc, #7b2fff, #ff44dd, #ffd700,
    #ff4400, #ffd700, #00ccff, #7b2fff, #4400cc);
  animation: royal-ring-spin 1.6s linear infinite;
  filter: blur(0.5px);
}

/* ---- Screen edge purple/gold vignette ---- */
[data-theme="royal"] #app::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(100, 20, 255, 0.45) 0%, transparent 18%),
    linear-gradient(to top,    rgba(70,   0, 200, 0.40) 0%, transparent 20%),
    linear-gradient(to right,  rgba(100, 30, 255, 0.28) 0%, transparent 14%),
    linear-gradient(to left,   rgba(130, 50, 255, 0.28) 0%, transparent 14%);
  animation: royal-vignette-pulse 9s ease-in-out infinite;
}

@keyframes royal-vignette-pulse {
  0%, 100% { opacity: 0.65; }
  50%       { opacity: 1.00; }
}

/* ---- Second aurora — moves opposite direction ---- */
[data-theme="royal"] #app::after {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 82% 12%, rgba(255, 215, 0, 0.13) 0%, transparent 60%),
    radial-gradient(ellipse 55% 38% at  8% 82%, rgba(200,  60, 255, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 48% 28% at 50% 55%, rgba(80,    0, 255, 0.14) 0%, transparent 60%);
  animation: royal-aurora 18s ease-in-out infinite reverse;
}

/* ---- Section headings — animated shimmer sweep ---- */
[data-theme="royal"] h2,
[data-theme="royal"] .section-heading {
  background: linear-gradient(90deg,
    #c090ff 0%, #ffd700 28%, #ff90ff 50%, #ffd700 72%, #c090ff 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: royal-heading-sweep 5s linear infinite;
}

@keyframes royal-heading-sweep {
  0%   { background-position:   0% 50%; }
  100% { background-position: 260% 50%; }
}

/* ---- Brand name — same shimmer, stronger glow ---- */
[data-theme="royal"] .brand-name {
  background: linear-gradient(90deg, #d0a0ff 0%, #ffd700 30%, #ff90ff 55%, #ffd700 75%, #d0a0ff 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: royal-heading-sweep 3.5s linear infinite;
  filter: drop-shadow(0 0 10px rgba(200, 150, 255, 0.7));
}

/* ======================================================================== */
/* PREVIEW BANNER                                                             */
/* ======================================================================== */
.preview-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card, #1a1830);
  border-top: 1px solid rgba(255,255,255,0.14);
  padding: 12px 16px 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.55);
  transform: translateY(110%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.preview-banner.visible {
  transform: translateY(0);
  pointer-events: auto;
}

.preview-banner-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--muted);
}

.preview-banner-title {
  color: var(--text);
  font-size: 0.93rem;
}

.preview-banner-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pbtn {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.pbtn:active { opacity: 0.7; transform: scale(0.96); }

.pbtn-buy {
  background: var(--accent, #a060ff);
  color: #fff;
  flex: 1;
}

.pbtn-trial {
  background: rgba(255,200,80,0.14);
  color: #c8a050;
  border: 1px solid rgba(200,160,80,0.28);
  flex: 1;
}

.pbtn-exit {
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.12);
  flex: 0 0 auto;
  min-width: 40px;
}

/* Trial-active badge in shop */
.trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #c8a050;
  background: rgba(255,200,80,0.12);
  border: 1px solid rgba(200,160,80,0.28);
  border-radius: 6px;
  padding: 4px 8px;
}

/* Preview button inside shop item price slot */
.preview-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.preview-btn:active { opacity: 0.6; }

.shop-price-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* ---- Balance / coins — triple gold glow pulse ---- */
[data-theme="royal"] #coinsDisplay,
[data-theme="royal"] .coins-amount,
[data-theme="royal"] .coins-value {
  color: #ffd700 !important;
  text-shadow:
    0 0  8px rgba(255, 215, 0, 0.95),
    0 0 22px rgba(255, 215, 0, 0.60),
    0 0 48px rgba(255, 215, 0, 0.30),
    0 0 90px rgba(200, 100, 255, 0.18) !important;
  animation: royal-gold-pulse 2.2s ease-in-out infinite;
}

@keyframes royal-gold-pulse {
  0%, 100% {
    text-shadow:
      0 0  8px rgba(255,215,0,0.90),
      0 0 22px rgba(255,215,0,0.55),
      0 0 48px rgba(255,215,0,0.28);
  }
  50% {
    text-shadow:
      0 0 14px rgba(255,215,0,1.00),
      0 0 32px rgba(255,215,0,0.80),
      0 0 65px rgba(255,215,0,0.45),
      0 0 110px rgba(200,100,255,0.28);
  }
}

/* ---- Game home-page cards — dark royal polish ---- */
[data-theme="royal"] .game-card {
  background: linear-gradient(155deg, rgba(18, 0, 46, 0.94), rgba(8, 0, 24, 0.96));
  border: 1px solid rgba(160, 96, 255, 0.32) !important;
  box-shadow: 0 6px 30px rgba(80, 0, 220, 0.32), inset 0 1px 0 rgba(200, 150, 255, 0.10) !important;
  min-height: 116px;
}

[data-theme="royal"] .game-card:hover {
  border-color: rgba(255, 215, 0, 0.55) !important;
  box-shadow: 0 12px 44px rgba(80, 0, 220, 0.50), 0 0 0 1px rgba(255, 215, 0, 0.28) !important;
  transform: translateY(-10px);
}

/* ---- Panels on hover — gold border flare ---- */
[data-theme="royal"] .panel:hover,
[data-theme="royal"] .card-panel:hover {
  border-color: rgba(255, 215, 0, 0.42) !important;
  box-shadow:
    0 10px 44px rgba(80, 0, 200, 0.40),
    0 0 0 1px rgba(255, 215, 0, 0.20),
    inset 0 1px 0 rgba(200, 150, 255, 0.14) !important;
  transition: all 0.28s ease !important;
}

/* ---- Hero chips (VIP / Shop / Auctions) — shimmer + glow ---- */
[data-theme="royal"] .hero-chip {
  background: linear-gradient(135deg, rgba(40, 0, 100, 0.82), rgba(70, 20, 160, 0.72)) !important;
  border: 1px solid rgba(200, 150, 255, 0.42) !important;
  box-shadow: 0 4px 16px rgba(100, 20, 255, 0.38) !important;
  position: relative;
  overflow: hidden;
}

[data-theme="royal"] .hero-chip::after {
  content: "";
  position: absolute;
  top: 0; left: -110%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.22), transparent);
  animation: royal-shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}

/* ---- All regular buttons — subtle royal aura ---- */
[data-theme="royal"] button:not(.primary):not([class*="cancel"]):not(.tab-btn):not(.hero-chip):not([class*="theme"]) {
  box-shadow: 0 0 10px rgba(120, 40, 255, 0.22) !important;
  border-color: rgba(160, 96, 255, 0.32) !important;
}

[data-theme="royal"] button:not(.primary):not([class*="cancel"]):not(.tab-btn):not(.hero-chip):not([class*="theme"]):hover {
  box-shadow: 0 0 22px rgba(160, 96, 255, 0.55), 0 0 8px rgba(255, 215, 0, 0.22) !important;
  border-color: rgba(255, 215, 0, 0.48) !important;
}

/* ---- VIP badge — pulsing gold ---- */
[data-theme="royal"] .vip-badge,
[data-theme="royal"] .vip-label,
[data-theme="royal"] [class*="vip-chip"] {
  animation: royal-vip-pulse 2.5s ease-in-out infinite;
}

@keyframes royal-vip-pulse {
  0%, 100% { filter: brightness(1.0) drop-shadow(0 0  4px rgba(255,215,0,0.55)); }
  50%       { filter: brightness(1.5) drop-shadow(0 0 16px rgba(255,215,0,0.98)); }
}

/* ---- Active nav tab indicator — animated gold line ---- */
[data-theme="royal"] .tab-btn {
  position: relative;
}

[data-theme="royal"] .tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7b2fff, #ffd700, #7b2fff);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
  animation: royal-tab-bar 2.2s ease-in-out infinite;
}

@keyframes royal-tab-bar {
  0%, 100% { width: 18px; box-shadow: 0 0  7px rgba(255,215,0,0.55); }
  50%       { width: 34px; box-shadow: 0 0 18px rgba(255,215,0,1.00); }
}

/* ---- Stat numbers / level / XP — gold gradient ---- */
[data-theme="royal"] .stat-value,
[data-theme="royal"] .level-num,
[data-theme="royal"] .xp-val {
  background: linear-gradient(90deg, #ffd700, #e0b0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.45));
}

/* ---- Input focus — gold ring ---- */
[data-theme="royal"] input:focus,
[data-theme="royal"] textarea:focus {
  border-color: rgba(255, 215, 0, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.14), 0 0 16px rgba(180, 96, 255, 0.25) !important;
  outline: none;
}

/* ---- Game rows (open games) — royal border on hover ---- */
[data-theme="royal"] .game-row:hover,
[data-theme="royal"] .game-row:active {
  border-color: rgba(255, 215, 0, 0.55) !important;
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.22), 0 0 8px rgba(160, 96, 255, 0.30) !important;
}

/* =========================================================================
 * GAME BANNERS — high-specificity rules that survive all theme overrides
 * ========================================================================= */
html:not([data-theme="dragon"]):not([data-theme="yinyang"]):not([data-theme="royal"]) .game-card.coin {
  background-image: url("assets/coinflip.webp");
  background-size: 185%;
  background-position: 71% 30%;
}
html:not([data-theme="dragon"]):not([data-theme="yinyang"]):not([data-theme="royal"]) .game-card.bj {
  background-image: url("assets/blackjeck.webp");
  background-size: cover;
  background-position: center 40%;
}
html:not([data-theme="dragon"]):not([data-theme="yinyang"]):not([data-theme="royal"]) .game-card.uno {
  background-image: url("assets/uno.webp");
  background-size: cover;
  background-position: center;
}
html:not([data-theme="dragon"]):not([data-theme="yinyang"]):not([data-theme="royal"]) .game-card.holdem {
  background-image: url("assets/Holdem.webp");
  background-size: cover;
  background-position: center 40%;
}
html:not([data-theme="dragon"]):not([data-theme="yinyang"]):not([data-theme="royal"]) .game-card.roulette {
  background-image: url("assets/banner-roulette.webp");
  background-size: cover;
  background-position: center;
}
html:not([data-theme="dragon"]):not([data-theme="yinyang"]):not([data-theme="royal"]) .game-card.slots {
  background-image: url("assets/banner-slots.webp");
  background-size: cover;
  background-position: center;
}
html:not([data-theme="dragon"]):not([data-theme="yinyang"]):not([data-theme="royal"]) .game-card.dice-game {
  background-image: url("assets/banner-dice.webp");
  background-size: cover;
  background-position: center;
}

/* =========================================================================
 * PROFILE FRAMES — dragon_f & yinyang_f avatar border
 * ========================================================================= */
[data-frame="dragon_f"] .top-avatar,
[data-frame="dragon_f"] .side-avatar,
[data-frame="dragon_f"] #settingsAvatar {
  border: 4px solid #c8a050 !important;
  box-shadow:
    0 0 0 2px #7a2800,
    0 0 18px rgba(200, 130, 0, 0.7),
    0 0 32px rgba(180, 80, 0, 0.3) !important;
}

[data-frame="yinyang_f"] .top-avatar,
[data-frame="yinyang_f"] .side-avatar,
[data-frame="yinyang_f"] #settingsAvatar {
  border: 3px solid #aaa !important;
  box-shadow:
    0 0 0 2px #111,
    0 0 0 4px #eee,
    0 0 0 6px #111,
    0 0 10px rgba(200, 200, 200, 0.2) !important;
}

/* =========================================================================
 * DICE GAME VIEW
 * ========================================================================= */
.dice-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px 20px 24px;
}
.dice-arena {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
}
.dice-player-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dice-vs {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  padding-top: 38px;
}
.dice-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}
.dice-score {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  min-height: 32px;
  text-align: center;
}
.dice-scene {
  width: 100px;
  height: 100px;
  perspective: 500px;
}
.dice-cube {
  width: 100px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.17,0.89,0.32,1.28);
}
.dice-cube.rolling {
  animation: diceRoll 0.38s linear infinite;
  transition: none;
}
@keyframes diceLand {
  0% { filter: brightness(1.45); }
  42% { filter: brightness(1.12) drop-shadow(0 10px 13px rgba(0,0,0,.48)); }
  100% { filter: none; }
}
.dice-cube.landed { animation: diceLand 0.46s var(--ease-ui); }
@keyframes diceRoll {
  0%   { transform: rotateX(0deg)   rotateY(0deg); }
  25%  { transform: rotateX(90deg)  rotateY(60deg); }
  50%  { transform: rotateX(180deg) rotateY(120deg); }
  75%  { transform: rotateX(270deg) rotateY(180deg); }
  100% { transform: rotateX(360deg) rotateY(240deg); }
}
.dice-face {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(70,55,130,0.95), rgba(30,22,70,0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.12);
}
.dice-face.d1 { transform: rotateY(0deg)   translateZ(50px); }
.dice-face.d2 { transform: rotateY(180deg) translateZ(50px); }
.dice-face.d3 { transform: rotateY(90deg)  translateZ(50px); }
.dice-face.d4 { transform: rotateY(-90deg) translateZ(50px); }
.dice-face.d5 { transform: rotateX(-90deg) translateZ(50px); }
.dice-face.d6 { transform: rotateX(90deg)  translateZ(50px); }
/* show face N: orient so that face N is in front */
.dice-cube[data-face="1"] { transform: rotateY(0deg);   }
.dice-cube[data-face="2"] { transform: rotateY(180deg); }
.dice-cube[data-face="3"] { transform: rotateY(-90deg); }
.dice-cube[data-face="4"] { transform: rotateY(90deg);  }
.dice-cube[data-face="5"] { transform: rotateX(90deg);  }
.dice-cube[data-face="6"] { transform: rotateX(-90deg); }

/* =========================================================================
 * SLOTS GAME VIEW
 * ========================================================================= */
.slots-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 36px 20px 24px;
}
.slots-machine {
  background: linear-gradient(145deg, rgba(20,15,50,0.95), rgba(8,5,25,0.98));
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  padding: 18px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.slots-players {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.slots-player-col {
  flex: 1;
  text-align: center;
}
.slots-player-name {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.slots-player-score {
  font-size: 15px;
  font-weight: 800;
  color: rgba(255,255,255,0.85);
  min-height: 20px;
}
.slots-player-col.winner .slots-player-name { color: #ffd86b; }
.slots-player-col.winner .slots-player-score { color: #ffd86b; }
.slots-divider {
  width: 1px;
  height: 44px;
  background: rgba(255,255,255,0.1);
}
.slots-window {
  display: flex;
  gap: 6px;
  height: 110px;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  padding: 0 4px;
}
.slots-window::before,
.slots-window::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 30px;
  z-index: 3;
  pointer-events: none;
}
.slots-window::before { top: 0;    background: linear-gradient(to bottom, rgba(8,5,25,0.95), transparent); }
.slots-window::after  { bottom: 0; background: linear-gradient(to top,   rgba(8,5,25,0.95), transparent); }
.slots-win-line {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,200,80,0.6), transparent);
  z-index: 4;
  pointer-events: none;
}
.slot-reel {
  flex: 1;
  overflow: hidden;
  height: 110px;
  position: relative;
}
.slot-reel-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.slot-reel-inner.spinning {
  animation: reelSpin 0.1s linear infinite;
}
@keyframes reelSettle {
  0% { transform: translateY(-20px) scaleY(1.08); filter: blur(1.5px); }
  58% { transform: translateY(4px) scaleY(0.97); filter: blur(0); }
  100% { transform: translateY(0) scaleY(1); }
}
.slot-reel-inner.settling { animation: reelSettle 0.34s var(--ease-ui); }

@keyframes slotsWinGlow {
  0%, 100% { box-shadow: 0 8px 40px rgba(0,0,0,.4); }
  50% { box-shadow: 0 8px 40px rgba(0,0,0,.4), 0 0 34px color-mix(in srgb, var(--gold) 62%, transparent); }
}
.slots-machine.win-celebration { animation: slotsWinGlow 0.9s var(--ease-ui) 2; }
@keyframes reelSpin {
  from { transform: translateY(0); }
  to   { transform: translateY(-110px); }
}
.slot-symbol {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
}
.slots-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,200,80,0.35), transparent);
  margin-top: 10px;
  border-radius: 1px;
}

/* =========================================================================
 * PRIVATE GAME TOGGLE (Stake Picker)
 * ========================================================================= */
.private-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px 6px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.private-toggle-row input[type="checkbox"] { display: none; }
.toggle-pill {
  width: 46px;
  height: 26px;
  background: rgba(255,255,255,0.12);
  border-radius: 13px;
  position: relative;
  transition: background 0.22s;
  flex-shrink: 0;
}
.toggle-pill::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.private-toggle-row.on .toggle-pill { background: var(--accent, #7c5cff); }
.private-toggle-row.on .toggle-pill::after { transform: translateX(20px); }
.private-toggle-label {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}

/* =========================================================================
 * INVITE CODE OVERLAY
 * ========================================================================= */
.invite-code-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}
.invite-code-card {
  background: var(--bg-card, #1a1a3a);
  border: 1px solid var(--stroke, rgba(255,255,255,0.1));
  border-radius: 22px;
  padding: 28px 22px;
  max-width: 320px;
  width: 88%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}
.invite-code-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #fff;
}
.invite-code-card p {
  margin: 0 0 18px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.invite-code-display {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #ffd86b;
  background: rgba(255,200,50,0.08);
  border: 1px solid rgba(255,200,50,0.25);
  border-radius: 14px;
  padding: 14px 12px;
  margin-bottom: 18px;
  font-family: 'Courier New', monospace;
}
.invite-code-card .btn-copy-code {
  width: 100%;
  margin-bottom: 8px;
}
.invite-code-card .btn-close-code {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.55);
}
.join-code-wrap {
  margin-top: 6px;
}
.join-code-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  margin-bottom: 6px;
}
.join-code-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.join-code-input {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  outline: none;
  font-family: monospace;
}
.join-code-input::placeholder {
  color: rgba(255,255,255,0.22);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  font-size: 14px;
}
.join-code-input:focus { border-color: rgba(124,92,255,0.6); }

/* =========================================================================
 * GAME BANNERS — remove overlay animations (shimmer + theme color overlays)
 * Banner art should show clean; only a static readability gradient on left.
 * ========================================================================= */
/* Stop shimmer animation; restore static dark-left gradient for text contrast */
html:not([data-theme="dragon"]):not([data-theme="yinyang"]) .game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.24) 52%, transparent 85%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  animation: none;
}
/* Remove colored radial overlays from all themes (cyberpunk keeps corner brackets via ::after) */
html:not([data-theme="cyberpunk"]) .game-card::after {
  display: none;
}

/* =========================================================================
 * CARD GLOWS — vault card border highlights (purchasable cosmetic)
 * ========================================================================= */
.vault-row { transition: box-shadow 0.25s; }
.vault-row[data-glow="gold"]    { box-shadow: 0 0 9px 2px rgba(220,175,50,0.6),  inset 0 0 0 1px rgba(220,175,50,0.35); border-radius: 10px; }
.vault-row[data-glow="neon"]    { box-shadow: 0 0 9px 2px rgba(0,230,200,0.6),   inset 0 0 0 1px rgba(0,230,200,0.35);  border-radius: 10px; }
.vault-row[data-glow="crimson"] { box-shadow: 0 0 9px 2px rgba(224,48,80,0.6),   inset 0 0 0 1px rgba(224,48,80,0.35);  border-radius: 10px; }
.vault-row[data-glow="rainbow"] { border-radius: 10px; animation: cardRainbow 3s linear infinite; }
@keyframes cardRainbow {
  0%   { box-shadow: 0 0 10px 2px rgba(255,80,80,0.65);  }
  25%  { box-shadow: 0 0 10px 2px rgba(80,220,100,0.65); }
  50%  { box-shadow: 0 0 10px 2px rgba(80,130,255,0.65); }
  75%  { box-shadow: 0 0 10px 2px rgba(255,200,60,0.65); }
  100% { box-shadow: 0 0 10px 2px rgba(255,80,80,0.65);  }
}

/* Shop preview thumbs for card glows */
.glow-preview-thumb {
  width: 100%; height: 100%;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: rgba(20,15,40,0.85);
}
.glow-preview-thumb.glow-gold    { box-shadow: 0 0 14px 3px rgba(220,175,50,0.7), inset 0 0 0 2px rgba(220,175,50,0.5); }
.glow-preview-thumb.glow-neon    { box-shadow: 0 0 14px 3px rgba(0,230,200,0.7),  inset 0 0 0 2px rgba(0,230,200,0.5);  }
.glow-preview-thumb.glow-crimson { box-shadow: 0 0 14px 3px rgba(224,48,80,0.7),  inset 0 0 0 2px rgba(224,48,80,0.5);  }
.glow-preview-thumb.glow-rainbow { animation: cardRainbow 3s linear infinite; }
.equipped-btn { background: rgba(100,220,120,0.18) !important; border: 1px solid rgba(100,220,120,0.4) !important; color: #7fe896 !important; }

/* =========================================================================
 * YIN-YANG THEMED PLAYING CARDS
 * .pcard.yy-card uses image assets instead of text rank/suit
 * ========================================================================= */
.pcard.yy-card {
  background-size: cover;
  background-position: center;
  background-color: #f0e8d0;
  border: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.35);
  padding: 0;
}
.pcard.yy-card.back {
  background-size: cover;
  background-position: center;
  background-color: #2a1f10;
}
.pcard.yy-card .r,
.pcard.yy-card .s { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Dragon theme — animated video background                                   */
/* ═══════════════════════════════════════════════════════════════════════════ */
.dragon-bg-video {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.65;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Settings — card glow tiles (match card-frame-tile style)                   */
/* ═══════════════════════════════════════════════════════════════════════════ */
.glow-settings-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 2px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.18s, transform 0.12s;
  position: relative;
  text-align: center;
}
.glow-settings-tile:active { transform: scale(0.96); }
.glow-settings-tile.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.glow-settings-tile > span:not(.frame-lock-badge):not(.rarity-badge) {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.glow-settings-tile small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.glow-settings-tile .glow-preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg);
  border: 1px solid var(--stroke);
}
.glow-settings-tile.glow-settings-locked { opacity: 0.55; }
.glow-settings-tile.unlocked { opacity: 1; }
.glow-settings-tile.unlocked .frame-lock-badge { display: none; }


/* =========================================================================
 * GAME BANNERS — remove ALL dark overlay pseudo-elements
 * Banners show clean full-bleed art; text uses shadow for readability.
 * ========================================================================= */
.game-card::before {
  display: none !important;
}

/* Stronger text shadow so game titles remain readable on all backgrounds */
.gc-info b {
  text-shadow:
    0 1px 3px rgba(0,0,0,0.95),
    0 2px 10px rgba(0,0,0,0.85),
    0 0 22px rgba(0,0,0,0.7);
}
.gc-info span {
  text-shadow:
    0 1px 3px rgba(0,0,0,0.95),
    0 2px 8px rgba(0,0,0,0.8);
}

/* =========================================================================
 * DRAGON THEME — Imperial Gold overhaul (by Emperor's request)
 * ========================================================================= */

/* Hero action chips (VIP / Auctions / Shop / Invite) */
[data-theme="dragon"] .hero-chip {
  background: linear-gradient(160deg, rgba(50,36,0,0.92), rgba(30,20,0,0.96));
  border: 1.5px solid rgba(200,168,64,0.6);
  color: #c8a840;
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(248,220,80,0.15);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}
[data-theme="dragon"] .hero-chip:hover {
  border-color: rgba(248,220,80,0.9);
  color: #f8e898;
  box-shadow: 0 4px 18px rgba(200,168,64,0.35), inset 0 1px 0 rgba(248,220,80,0.25);
}
[data-theme="dragon"] .hero-chip:active {
  transform: scale(0.96);
  border-color: rgba(248,220,80,0.9);
}

/* Balance card — deeper gold */
[data-theme="dragon"] .balance-card {
  background: linear-gradient(160deg, rgba(40,28,0,0.88), rgba(14,10,0,0.94));
  border: 1.5px solid rgba(200,168,64,0.45);
  box-shadow: inset 0 1px 0 rgba(248,220,80,0.12);
}
[data-theme="dragon"] .bal-label {
  color: rgba(200,168,64,0.65);
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.1em;
}
[data-theme="dragon"] .bal-main strong {
  background: linear-gradient(90deg, #c8a840, #f8e898, #c8a840);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(200,168,64,0.4));
}
[data-theme="dragon"] .coins-row {
  color: rgba(200,168,64,0.75);
}

/* Games section label */
[data-theme="dragon"] .section-label,
[data-theme="dragon"] .games-section-label,
[data-theme="dragon"] .view-title,
[data-theme="dragon"] .section-title {
  font-family: "Cinzel Decorative", serif;
  color: #c8a840;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(200,168,64,0.4);
}

/* Panels / surfaces */
[data-theme="dragon"] .panel {
  background: linear-gradient(160deg, rgba(32,24,0,0.85), rgba(14,10,0,0.9));
  border-color: rgba(200,168,64,0.3);
}

/* Scrollbar gold */
[data-theme="dragon"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a87820, #c8a840);
}

/* =========================================================================
 * DRAGON THEME — Imperial Profile Card: gold dragon art background
 * ========================================================================= */
[data-theme="dragon"] .profile-card {
  background:
    linear-gradient(160deg, rgba(8,6,0,0.68) 0%, rgba(18,12,0,0.60) 50%, rgba(8,6,0,0.72) 100%),
    url('assets/dragon-profile-bg.webp') center 22% / cover no-repeat;
  overflow: visible;
  padding-top: 28px;
  border: 2px solid rgba(200,168,64,0.7);
  box-shadow:
    0 0 0 1px rgba(248,220,80,0.18),
    0 6px 32px rgba(0,0,0,0.8),
    0 0 48px rgba(200,168,64,0.18),
    inset 0 1px 0 rgba(248,220,80,0.35),
    inset 0 -1px 0 rgba(200,168,64,0.15);
  animation: dragonCardBorderPulse 3.5s ease-in-out infinite;
}

/* ── Imperial seal 龍 — slow rotation behind content ─────────────────────── */
.dragon-seal {
  display: none;
}
[data-theme="dragon"] .dragon-seal {
  display: block;
  position: absolute;
  right: -8px;
  bottom: -8px;
  font-size: 130px;
  line-height: 1;
  color: rgba(200,168,64,0.1);
  font-family: serif;
  pointer-events: none;
  z-index: 0;
  animation: dragonSealSpin 18s linear infinite;
  user-select: none;
}
@keyframes dragonSealSpin {
  0%   { transform: rotate(0deg)   scale(1);    opacity: 0.10; }
  25%  { transform: rotate(90deg)  scale(1.04); opacity: 0.14; }
  50%  { transform: rotate(180deg) scale(1);    opacity: 0.10; }
  75%  { transform: rotate(270deg) scale(1.04); opacity: 0.16; }
  100% { transform: rotate(360deg) scale(1);    opacity: 0.10; }
}

/* ── Floating gold sparkles ──────────────────────────────────────────────── */
.dragon-sparkles {
  display: none;
}
[data-theme="dragon"] .dragon-sparkles {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}
/* Two waves of particles using box-shadow trick on 1×1px elements */
[data-theme="dragon"] .dragon-sparkles::before,
[data-theme="dragon"] .dragon-sparkles::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(248,220,80,0.9);
}
[data-theme="dragon"] .dragon-sparkles::before {
  bottom: 0;
  left: 50%;
  box-shadow:
    -120px 0   rgba(248,220,80,0.8),  -85px 10px rgba(255,240,100,0.6),
     -50px -5px rgba(200,168,64,0.7),  -20px 8px  rgba(248,220,80,0.5),
      15px  0   rgba(255,240,100,0.8),  45px -8px  rgba(200,168,64,0.6),
      78px  5px rgba(248,220,80,0.7),  105px 0    rgba(255,240,100,0.5),
     -100px 15px rgba(200,168,64,0.4),  60px 12px rgba(248,220,80,0.9);
  animation: dragonSparkleRise1 4.5s ease-in infinite;
}
[data-theme="dragon"] .dragon-sparkles::after {
  bottom: 0;
  left: 30%;
  box-shadow:
    -90px  5px rgba(255,240,100,0.7), -60px -5px rgba(248,220,80,0.5),
    -30px  0   rgba(200,168,64,0.8),   10px  8px rgba(255,240,100,0.6),
     40px -4px rgba(248,220,80,0.7),   70px  2px rgba(200,168,64,0.5),
    100px  6px rgba(248,220,80,0.8),  130px -6px rgba(255,240,100,0.4),
    -10px 12px rgba(200,168,64,0.6),   55px 10px rgba(248,220,80,0.9);
  animation: dragonSparkleRise2 5.8s ease-in infinite 2.1s;
}
@keyframes dragonSparkleRise1 {
  0%   { transform: translateY(0)      scale(1);    opacity: 0; }
  8%   { opacity: 1; }
  60%  { transform: translateY(-160px) scale(0.7);  opacity: 0.7; }
  100% { transform: translateY(-220px) scale(0.3);  opacity: 0; }
}
@keyframes dragonSparkleRise2 {
  0%   { transform: translateY(0)      scale(1);    opacity: 0; }
  10%  { opacity: 1; }
  55%  { transform: translateY(-140px) scale(0.6);  opacity: 0.6; }
  100% { transform: translateY(-200px) scale(0.2);  opacity: 0; }
}

/* =========================================================================
 * DRAGON THEME — Custom imperial gold game banners
 * Banners already contain the game title text, so gc-info b is hidden.
 * ========================================================================= */
[data-theme="dragon"] .game-card.coin      { background-image: url('assets/dragon-banner-coin.webp');    background-position: center; }
[data-theme="dragon"] .game-card.bj        { background-image: url('assets/dragon-banner-bj.webp');      background-position: center; }
[data-theme="dragon"] .game-card.slots     { background-image: url('assets/dragon-banner-slots.webp');   background-position: center; }
[data-theme="dragon"] .game-card.dice-game { background-image: url('assets/dragon-banner-dice.webp');    background-position: center; }
[data-theme="dragon"] .game-card.roulette  { background-image: url('assets/dragon-banner-roulette.webp'); background-position: center; }
[data-theme="dragon"] .game-card.holdem    { background-image: url('assets/dragon-banner-holdem.webp');  background-position: center; }
[data-theme="dragon"] .game-card.uno      { background-image: url('assets/dragon-banner-uno.webp');     background-position: center; }

/* Hide HTML title — already baked into the banner art */
[data-theme="dragon"] .game-card.coin .gc-info b,
[data-theme="dragon"] .game-card.bj .gc-info b,
[data-theme="dragon"] .game-card.slots .gc-info b,
[data-theme="dragon"] .game-card.dice-game .gc-info b,
[data-theme="dragon"] .game-card.roulette .gc-info b,
[data-theme="dragon"] .game-card.holdem .gc-info b,
[data-theme="dragon"] .game-card.uno .gc-info b {
  display: none;
}
/* Keep subtitle/status info visible, push to bottom-right so it doesn't clash */
[data-theme="dragon"] .game-card.coin .gc-info,
[data-theme="dragon"] .game-card.bj .gc-info,
[data-theme="dragon"] .game-card.slots .gc-info,
[data-theme="dragon"] .game-card.dice-game .gc-info,
[data-theme="dragon"] .game-card.roulette .gc-info,
[data-theme="dragon"] .game-card.holdem .gc-info,
[data-theme="dragon"] .game-card.uno .gc-info {
  align-self: flex-end;
  margin-left: auto;
}

/* =========================================================================
 * ROYAL/СУВЕРЕН THEME — Custom game banners
 * Banners already contain the game title text, so gc-info b is hidden.
 * ========================================================================= */
[data-theme="royal"] .game-card.coin      { background-image: url('assets/limitka-banner-coin.webp');     background-size: cover; background-position: center; }
[data-theme="royal"] .game-card.bj        { background-image: url('assets/limitka-banner-bj.webp');       background-size: cover; background-position: center; }
[data-theme="royal"] .game-card.slots     { background-image: url('assets/limitka-banner-slots.webp');    background-size: cover; background-position: center; }
[data-theme="royal"] .game-card.dice-game { background-image: url('assets/limitka-banner-dice.webp');     background-size: cover; background-position: center; }
[data-theme="royal"] .game-card.roulette  { background-image: url('assets/limitka-banner-roulette.webp'); background-size: cover; background-position: center; }
[data-theme="royal"] .game-card.holdem    { background-image: url('assets/limitka-banner-holdem.webp');   background-size: cover; background-position: center; }
[data-theme="royal"] .game-card.uno       { background-image: url('assets/limitka-banner-uno.webp');      background-size: cover; background-position: center; }

/* Hide HTML title — already baked into the banner art */
[data-theme="royal"] .game-card.coin .gc-info b,
[data-theme="royal"] .game-card.bj .gc-info b,
[data-theme="royal"] .game-card.slots .gc-info b,
[data-theme="royal"] .game-card.dice-game .gc-info b,
[data-theme="royal"] .game-card.roulette .gc-info b,
[data-theme="royal"] .game-card.holdem .gc-info b,
[data-theme="royal"] .game-card.uno .gc-info b {
  display: none;
}
/* Keep subtitle/status info visible */
[data-theme="royal"] .game-card.coin .gc-info,
[data-theme="royal"] .game-card.bj .gc-info,
[data-theme="royal"] .game-card.slots .gc-info,
[data-theme="royal"] .game-card.dice-game .gc-info,
[data-theme="royal"] .game-card.roulette .gc-info,
[data-theme="royal"] .game-card.holdem .gc-info,
[data-theme="royal"] .game-card.uno .gc-info {
  align-self: flex-end;
  margin-left: auto;
}

/* ---- Profile card — city skyline background ---- */
[data-theme="royal"] .profile-card {
  background-image: url('assets/royal-profile-bg.webp');
  background-size: cover;
  background-position: center top;
  border: 1px solid rgba(160, 96, 255, 0.45);
  box-shadow: 0 6px 32px rgba(80, 0, 220, 0.40), inset 0 1px 0 rgba(200, 150, 255, 0.15);
}

/* =========================================================================
 * DRAGON THEME — Header buttons (menu ☰ and refresh ⟳)
 * ========================================================================= */
[data-theme="dragon"] #menuBtn,
[data-theme="dragon"] #refreshBtn {
  font-size: 0;
  background-color: rgba(20,16,2,0.7);
  border-color: rgba(200,168,64,0.3);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
[data-theme="dragon"] #menuBtn {
  background-image: url('assets/dragon-menu-btn.webp');
}
[data-theme="dragon"] #refreshBtn {
  background-image: url('assets/dragon-refresh-btn.webp');
}
[data-theme="dragon"] #menuBtn:active,
[data-theme="dragon"] #refreshBtn:active {
  background-color: rgba(200,168,64,0.12);
}

/* =========================================================================
 * DRAGON THEME — Top-up / wallet button
 * ========================================================================= */
[data-theme="dragon"] .topup-btn {
  font-size: 0;
  height: 52px;
  background-image: url('assets/dragon-topup-btn.webp');
  background-size: cover;
  background-position: center;
  background-color: transparent;
  box-shadow: 0 4px 18px rgba(200,168,64,0.35);
  border: 1.5px solid rgba(200,168,64,0.5);
  border-radius: 13px;
}
[data-theme="dragon"] .topup-btn:active {
  filter: brightness(1.1);
}

/* =========================================================================
 * DRAGON THEME — Hero chips (VIP / Auctions / Giveaways / Shop)
 * ========================================================================= */
[data-theme="dragon"] #homeVipBtn,
[data-theme="dragon"] #homeAuctionsBtn,
[data-theme="dragon"] #homeRafflesBtn,
[data-theme="dragon"] #shopQuickBtn {
  font-size: 0;
  height: 64px;
  border: 1.5px solid rgba(200,168,64,0.4);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  padding: 0;
  overflow: hidden;
}
[data-theme="dragon"] #homeVipBtn      { background: url('assets/dragon-chip-vip.webp')     center/cover no-repeat; }
[data-theme="dragon"] #homeAuctionsBtn { background: url('assets/dragon-chip-auction.webp') center/cover no-repeat; }
[data-theme="dragon"] #homeRafflesBtn  { background: url('assets/dragon-chip-raffle.webp')  center/cover no-repeat; }
[data-theme="dragon"] #shopQuickBtn    { background: url('assets/dragon-chip-shop.webp')    center/cover no-repeat; }
[data-theme="dragon"] #homeVipBtn:active,
[data-theme="dragon"] #homeAuctionsBtn:active,
[data-theme="dragon"] #homeRafflesBtn:active,
[data-theme="dragon"] #shopQuickBtn:active {
  transform: scale(0.96);
  filter: brightness(1.1);
}

/* =========================================================================
 * ROYAL/СУВЕРЕН THEME — Nav icons, header buttons, hero chips
 * ========================================================================= */

/* Nav icon images — 4 regular nav icons */
[data-theme="royal"] .nav-item[data-nav="home"] .ni,
[data-theme="royal"] .nav-item[data-nav="inventory"] .ni,
[data-theme="royal"] .nav-item[data-nav="play"] .ni,
[data-theme="royal"] .nav-item[data-nav="profile"] .ni {
  font-size: 0;
  width: 30px;
  height: 30px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
  opacity: 0.65;
}
[data-theme="royal"] .nav-item.active[data-nav="home"] .ni,
[data-theme="royal"] .nav-item.active[data-nav="inventory"] .ni,
[data-theme="royal"] .nav-item.active[data-nav="play"] .ni,
[data-theme="royal"] .nav-item.active[data-nav="profile"] .ni {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(180,100,255,0.7));
}
[data-theme="royal"] .nav-item[data-nav="home"] .ni      { background-image: url('assets/royal-nav-home.webp'); }
[data-theme="royal"] .nav-item[data-nav="inventory"] .ni { background-image: url('assets/royal-nav-inventory.webp'); }
[data-theme="royal"] .nav-item[data-nav="play"] .ni      { background-image: url('assets/royal-nav-games.webp'); }
[data-theme="royal"] .nav-item[data-nav="profile"] .ni   { background-image: url('assets/royal-nav-profile.webp'); }

/* Center button — royal star image */
[data-theme="royal"] .nav-item.center .ni {
  font-size: 0;
  width: 52px;
  height: 52px;
  display: inline-flex;
  background-image: url('assets/royal-nav-center.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 0 12px rgba(160,96,255,0.6));
  opacity: 1;
}

/* Header buttons — menu ☰ and refresh ⟳ */
[data-theme="royal"] #menuBtn,
[data-theme="royal"] #refreshBtn {
  font-size: 0;
  background-color: rgba(12,0,30,0.7);
  border-color: rgba(160,96,255,0.35);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
[data-theme="royal"] #menuBtn    { background-image: url('assets/royal-menu-btn.webp'); }
[data-theme="royal"] #refreshBtn { background-image: url('assets/royal-refresh-btn.webp'); }
[data-theme="royal"] #menuBtn:active,
[data-theme="royal"] #refreshBtn:active {
  background-color: rgba(160,96,255,0.15);
}

/* Top-up / wallet button */
[data-theme="royal"] .topup-btn {
  font-size: 0;
  height: 52px;
  background-image: url('assets/royal-topup-btn.webp');
  background-size: cover;
  background-position: center;
  background-color: transparent;
  box-shadow: 0 4px 18px rgba(120,0,255,0.4);
  border: 1.5px solid rgba(160,96,255,0.5);
  border-radius: 13px;
}
[data-theme="royal"] .topup-btn:active {
  filter: brightness(1.1);
}

/* Hero chips — VIP / Auctions / Giveaways / Shop */
[data-theme="royal"] #homeVipBtn,
[data-theme="royal"] #homeAuctionsBtn,
[data-theme="royal"] #homeRafflesBtn,
[data-theme="royal"] #shopQuickBtn {
  font-size: 0;
  height: 64px;
  border: 1.5px solid rgba(160,96,255,0.4) !important;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  padding: 0;
  overflow: hidden;
}
/* suppress the shimmer ::after overlay on chips with images */
[data-theme="royal"] #homeVipBtn::after,
[data-theme="royal"] #homeAuctionsBtn::after,
[data-theme="royal"] #homeRafflesBtn::after,
[data-theme="royal"] #shopQuickBtn::after { display: none !important; }

[data-theme="royal"] #homeVipBtn      { background: url('assets/royal-chip-vip.webp')     center/cover no-repeat !important; }
[data-theme="royal"] #homeAuctionsBtn { background: url('assets/royal-chip-auction.webp') center/cover no-repeat !important; }
[data-theme="royal"] #homeRafflesBtn  { background: url('assets/royal-chip-raffle.webp')  center/cover no-repeat !important; }
[data-theme="royal"] #shopQuickBtn    { background: url('assets/royal-chip-shop.webp')    center/cover no-repeat !important; }
[data-theme="royal"] #homeVipBtn:active,
[data-theme="royal"] #homeAuctionsBtn:active,
[data-theme="royal"] #homeRafflesBtn:active,
[data-theme="royal"] #shopQuickBtn:active {
  transform: scale(0.96);
  filter: brightness(1.1);
}

/* =========================================================================
 * YIN-YANG THEME — Full UI asset set
 * ========================================================================= */

/* ── Center nav button ─────────────────────────────────────────────────── */
[data-theme="yinyang"] .nav-item.center .ni {
  font-size: 0;
  width: 52px;
  height: 52px;
  display: inline-flex;
  background: url('assets/yinyang-nav-center.webp') center/contain no-repeat;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 0 10px rgba(200,168,64,0.45));
  opacity: 1;
}

/* ── Header buttons ────────────────────────────────────────────────────── */
[data-theme="yinyang"] #menuBtn,
[data-theme="yinyang"] #refreshBtn {
  font-size: 0;
  background-color: rgba(8,6,2,0.70);
  border-color: rgba(200,168,64,0.30);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
[data-theme="yinyang"] #menuBtn    { background-image: url('assets/yinyang-menu-btn.webp'); }
[data-theme="yinyang"] #refreshBtn { background-image: url('assets/yinyang-refresh-btn.webp'); }
[data-theme="yinyang"] #menuBtn:active,
[data-theme="yinyang"] #refreshBtn:active { background-color: rgba(200,168,64,0.12); }

/* ── Top-up button ─────────────────────────────────────────────────────── */
[data-theme="yinyang"] .topup-btn {
  font-size: 0;
  height: 52px;
  background: url('assets/yinyang-topup-btn.webp') center/cover no-repeat;
  box-shadow: 0 4px 18px rgba(200,168,64,0.30);
  border: 1.5px solid rgba(200,168,64,0.45);
  border-radius: 13px;
}
[data-theme="yinyang"] .topup-btn:active { filter: brightness(1.08); }

/* ── Hero chips ────────────────────────────────────────────────────────── */
[data-theme="yinyang"] #homeAuctionsBtn,
[data-theme="yinyang"] #homeRafflesBtn,
[data-theme="yinyang"] #shopQuickBtn {
  font-size: 0;
  height: 64px;
  border: 1.5px solid rgba(200,168,64,0.35);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  padding: 0;
  overflow: hidden;
}
[data-theme="yinyang"] #homeAuctionsBtn { background: url('assets/yinyang-chip-auction.webp') center/cover no-repeat; }
[data-theme="yinyang"] #homeRafflesBtn  { background: url('assets/yinyang-chip-raffle.webp')  center/cover no-repeat; }
[data-theme="yinyang"] #shopQuickBtn    { background: url('assets/yinyang-chip-shop.webp')    center/cover no-repeat; }
[data-theme="yinyang"] #homeAuctionsBtn:active,
[data-theme="yinyang"] #homeRafflesBtn:active,
[data-theme="yinyang"] #shopQuickBtn:active { transform: scale(0.96); filter: brightness(1.08); }

/* ── Sidebar links ─────────────────────────────────────────────────────── */
[data-theme="yinyang"] #sideCatalogBtn,
[data-theme="yinyang"] #sideWalletBtn,
[data-theme="yinyang"] #sideHistoryBtn,
[data-theme="yinyang"] #sideSettingsBtn,
[data-theme="yinyang"] #sideInviteBtn,
[data-theme="yinyang"] #sideExitBtn {
  font-size: 0;
  height: 60px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(200,168,64,0.30);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
[data-theme="yinyang"] #sideCatalogBtn  { background-image: url('assets/yinyang-side-catalog.webp'); }
[data-theme="yinyang"] #sideWalletBtn   { background-image: url('assets/yinyang-side-wallet.webp'); }
[data-theme="yinyang"] #sideHistoryBtn  { background-image: url('assets/yinyang-side-history.webp'); }
[data-theme="yinyang"] #sideSettingsBtn { background-image: url('assets/yinyang-side-settings.webp'); }
[data-theme="yinyang"] #sideInviteBtn   { background-image: url('assets/yinyang-side-invite.webp'); }
[data-theme="yinyang"] #sideExitBtn     { background-image: url('assets/yinyang-side-exit.webp'); }
[data-theme="yinyang"] #sideCatalogBtn:active,
[data-theme="yinyang"] #sideWalletBtn:active,
[data-theme="yinyang"] #sideHistoryBtn:active,
[data-theme="yinyang"] #sideSettingsBtn:active,
[data-theme="yinyang"] #sideInviteBtn:active,
[data-theme="yinyang"] #sideExitBtn:active { transform: scale(0.98); filter: brightness(1.06); }

/* ── Nav icons v2: full image (icon+label baked in) applied to whole nav-item ── */
[data-theme="yinyang"] .nav-item[data-nav="home"] .ni,
[data-theme="yinyang"] .nav-item[data-nav="inventory"] .ni,
[data-theme="yinyang"] .nav-item[data-nav="play"] .ni,
[data-theme="yinyang"] .nav-item[data-nav="profile"] .ni,
[data-theme="yinyang"] .nav-item[data-nav="home"] .nl,
[data-theme="yinyang"] .nav-item[data-nav="inventory"] .nl,
[data-theme="yinyang"] .nav-item[data-nav="play"] .nl,
[data-theme="yinyang"] .nav-item[data-nav="profile"] .nl {
  display: none !important;
}
[data-theme="yinyang"] .nav-item[data-nav="home"],
[data-theme="yinyang"] .nav-item[data-nav="inventory"],
[data-theme="yinyang"] .nav-item[data-nav="play"],
[data-theme="yinyang"] .nav-item[data-nav="profile"] {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.65;
}
[data-theme="yinyang"] .nav-item.active[data-nav="home"],
[data-theme="yinyang"] .nav-item.active[data-nav="inventory"],
[data-theme="yinyang"] .nav-item.active[data-nav="play"],
[data-theme="yinyang"] .nav-item.active[data-nav="profile"] {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(200,168,64,0.5));
}
[data-theme="yinyang"] .nav-item[data-nav="home"]      { background-image: url('assets/yinyang-nav-home.webp'); }
[data-theme="yinyang"] .nav-item[data-nav="inventory"] { background-image: url('assets/yinyang-nav-inventory.webp'); }
[data-theme="yinyang"] .nav-item[data-nav="play"]      { background-image: url('assets/yinyang-nav-games.webp'); }
[data-theme="yinyang"] .nav-item[data-nav="profile"]   { background-image: url('assets/yinyang-nav-profile.webp'); }

/* ── VIP hero chip ─────────────────────────────────────────────────────────── */
[data-theme="yinyang"] #homeVipBtn {
  font-size: 0;
  height: 64px;
  border: 1.5px solid rgba(200,168,64,0.35);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  padding: 0;
  overflow: hidden;
  background: url('assets/yinyang-chip-vip.webp') center/cover no-repeat;
}
[data-theme="yinyang"] #homeVipBtn:active { transform: scale(0.96); filter: brightness(1.08); }

/* ── Sidebar links v2: Магазин, Аукционы, Розыгрыши ──────────────────────── */
[data-theme="yinyang"] #sideShopBtn,
[data-theme="yinyang"] #sideAuctionsBtn,
[data-theme="yinyang"] #sideRafflesBtn {
  font-size: 0;
  height: 60px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(200,168,64,0.30);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
[data-theme="yinyang"] #sideShopBtn     { background-image: url('assets/yinyang-side-shop.webp'); }
[data-theme="yinyang"] #sideAuctionsBtn { background-image: url('assets/yinyang-side-auction.webp'); }
[data-theme="yinyang"] #sideRafflesBtn  { background-image: url('assets/yinyang-side-raffle.webp'); }
[data-theme="yinyang"] #sideShopBtn:active,
[data-theme="yinyang"] #sideAuctionsBtn:active,
[data-theme="yinyang"] #sideRafflesBtn:active { transform: scale(0.98); filter: brightness(1.06); }

/* Sidebar menu: the original per-button artwork has mixed aspect ratios
 * (square, 4:3 and 3:1), which crops unpredictably in one fixed-height list.
 * Keep the illustrated sidebar canvas, but use one readable control style. */
[data-theme="yinyang"] .sidebar {
  padding: 18px 16px calc(104px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}
.join-code-row > .primary {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  padding-inline: 0;
}

[data-theme="yinyang"] .sidebar .side-link {
  min-height: 54px;
  height: auto;
  margin-top: 9px;
  padding: 13px 15px;
  border: 1px solid rgba(205, 174, 91, 0.30);
  border-radius: var(--radius-control);
  background-image:
    linear-gradient(90deg, rgba(5, 5, 3, 0.38), rgba(5, 5, 3, 0.10)),
    url('assets/yinyang-sidebar-button-v2.webp') !important;
  background-color: #0b0a07;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 190, 0.06),
    0 5px 16px rgba(0, 0, 0, 0.28);
  color: #ead9a8;
  font-size: 15px;
  line-height: 1.25;
  text-shadow: 0 1px 2px #000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="yinyang"] .sidebar .side-link:hover,
[data-theme="yinyang"] .sidebar .side-link:focus-visible {
  border-color: rgba(232, 205, 125, 0.62);
  background-color: #17130b;
  color: #fff1bd;
}

[data-theme="yinyang"] .sidebar .side-link:active {
  transform: scale(0.98);
  filter: brightness(1.08);
}

[data-theme="yinyang"] .sidebar .side-link.danger {
  margin-top: 16px;
  border-color: rgba(210, 72, 72, 0.30);
  color: #ff9b91;
}

/* ===================================================================== */
/* Electric — pure black + electric blue neon                            */
/* ===================================================================== */
[data-theme="electric"] {
  --bg: #050912;
  --bg2: #070d1a;
  --surface: rgba(5, 18, 42, 0.82);
  --surface-2: rgba(8, 24, 52, 0.88);
  --surface-solid: #060e1e;
  --stroke: rgba(0, 112, 255, 0.18);
  --stroke-strong: rgba(0, 112, 255, 0.46);
  --text: #e8f2ff;
  --muted: #6090c8;
  --accent: #0080ff;
  --accent-2: #005ecc;
  --accent-grad: linear-gradient(135deg, #00aaff 0%, #0080ff 55%, #005ecc 100%);
  --accent-soft: rgba(0, 128, 255, 0.14);
  --gold: #f0d060;
  --green: #00e890;
  --red: #ff3060;
  --blue: #0080ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.90);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.80);
  --glow: 0 0 28px rgba(0, 128, 255, 0.52);
}

/* subtle blue radial glow at top + nearly-pure-black base */
[data-theme="electric"] body {
  background:
    radial-gradient(ellipse 80% 42% at 50% 0%, rgba(0, 100, 255, 0.13), transparent 56%),
    radial-gradient(ellipse 50% 30% at 80% 8%, rgba(0, 60, 180, 0.08), transparent 50%),
    linear-gradient(180deg, #070d1a 0%, #050912 70%);
  background-attachment: fixed;
}

/* subtle dot-grid overlay */
[data-theme="electric"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(0, 112, 255, 0.07) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* very faint CRT scanlines */
[data-theme="electric"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.04) 3px,
    rgba(0, 0, 0, 0.04) 4px
  );
}

[data-theme="electric"] ::-webkit-scrollbar { width: 4px; }
[data-theme="electric"] ::-webkit-scrollbar-track { background: #030609; }
[data-theme="electric"] ::-webkit-scrollbar-thumb { background: #0080ff; border-radius: 4px; }
[data-theme="electric"] ::-webkit-scrollbar-thumb:hover { background: #00aaff; }

/* ── Brand / header ─────────────────────────────────────────────────── */
[data-theme="electric"] .brand-name {
  background: linear-gradient(90deg, #00aaff, #0070ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="electric"] .brand-mark {
  color: #0088ff;
  text-shadow: 0 0 16px rgba(0, 136, 255, 0.95);
}

[data-theme="electric"] h2 {
  color: #0088ff;
  letter-spacing: 0.05em;
}

[data-theme="electric"] .hero h1 {
  color: #00aaff;
  text-shadow: 0 0 22px rgba(0, 128, 255, 0.55);
}

[data-theme="electric"] .gc-info b { color: #00aaff; }

[data-theme="electric"] .nl { color: #0080ff; }

[data-theme="electric"] .profile-id strong,
[data-theme="electric"] #sideName { color: #00aaff; }

/* ── Topbar ─────────────────────────────────────────────────────────── */
[data-theme="electric"] #topbar {
  background: linear-gradient(180deg, rgba(3, 7, 16, 0.97), rgba(3, 7, 16, 0.62));
  border-bottom-color: rgba(0, 112, 255, 0.26);
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
[data-theme="electric"] .sidebar {
  background: rgba(3, 6, 16, 0.98);
  border-right: 1px solid rgba(0, 112, 255, 0.22);
}

[data-theme="electric"] .sidebar-head {
  border-bottom-color: rgba(0, 112, 255, 0.18);
}

[data-theme="electric"] .side-link {
  background: rgba(0, 10, 28, 0.85);
  border-color: rgba(0, 112, 255, 0.16);
  color: #d8edff;
}

[data-theme="electric"] .side-link:hover,
[data-theme="electric"] .side-link:focus {
  background: rgba(0, 112, 255, 0.12);
  color: #00aaff;
}

[data-theme="electric"] .side-link.danger { color: #ff4444; }

/* ── Profile card ────────────────────────────────────────────────────── */
[data-theme="electric"] .profile-card {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(0, 128, 255, 0.16), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

[data-theme="electric"] .top-avatar,
[data-theme="electric"] .side-avatar {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.22), transparent 35%),
    linear-gradient(135deg, #0080ff, #003888);
  box-shadow: 0 0 0 2px rgba(0, 128, 255, 0.38), 0 6px 18px rgba(0, 100, 255, 0.38);
}

[data-theme="electric"] .lvl-badge {
  background: rgba(5, 18, 44, 0.92);
  border: 1px solid rgba(0, 128, 255, 0.46);
  color: #80c8ff;
}

[data-theme="electric"] .xp-fill {
  background: linear-gradient(90deg, #0060cc, #0094ff);
  box-shadow: 0 0 8px rgba(0, 128, 255, 0.52);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
[data-theme="electric"] .topup-btn {
  background: var(--accent-grad);
  box-shadow: 0 4px 18px rgba(0, 128, 255, 0.46);
}

[data-theme="electric"] .primary:not(.ghost-btn) {
  background: var(--accent-grad);
  box-shadow: 0 4px 16px rgba(0, 128, 255, 0.36);
}

[data-theme="electric"] .action.hit {
  background: var(--accent-grad);
}

/* ── Bottom nav ──────────────────────────────────────────────────────── */
[data-theme="electric"] .bottomnav {
  background: linear-gradient(180deg, rgba(2, 5, 14, 0.62), rgba(2, 4, 12, 0.97));
  border-top-color: rgba(0, 112, 255, 0.26);
}

[data-theme="electric"] .nav-item.active { color: #0080ff; }

[data-theme="electric"] .nav-item.center .ni {
  background: var(--accent-grad);
  border-color: var(--bg);
  box-shadow: 0 6px 24px rgba(0, 128, 255, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ── Panels / cards ──────────────────────────────────────────────────── */
[data-theme="electric"] .panel,
[data-theme="electric"] .wallet-card,
[data-theme="electric"] .stat-card {
  border-color: rgba(0, 112, 255, 0.17);
}

[data-theme="electric"] .game-card {
  background: linear-gradient(135deg, rgba(5, 18, 42, 0.90), rgba(3, 10, 26, 0.90));
  border-color: rgba(0, 112, 255, 0.20);
}

[data-theme="electric"] .game-card:hover {
  border-color: rgba(0, 148, 255, 0.52);
  box-shadow: var(--shadow), 0 0 20px rgba(0, 128, 255, 0.20);
}

/* ── Modal ───────────────────────────────────────────────────────────── */
[data-theme="electric"] .modal {
  background: rgba(0, 6, 18, 0.86);
}

[data-theme="electric"] .modal-inner {
  border-color: rgba(0, 112, 255, 0.28);
}

/* ── Game table felt ─────────────────────────────────────────────────── */
[data-theme="electric"] .felt,
[data-theme="electric"] .table-felt,
[data-theme="electric"] .uno-felt {
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(0, 50, 120, 0.22), transparent 60%),
    linear-gradient(160deg, #040a1c, #03070e);
}

/* ── Playing cards ───────────────────────────────────────────────────── */
[data-theme="electric"] .pcard.back {
  background-color: #020814;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%23020814'/%3E%3Ccircle cx='20' cy='20' r='9' fill='none' stroke='%230080ff' stroke-width='1' stroke-opacity='0.35'/%3E%3Ccircle cx='20' cy='20' r='4' fill='none' stroke='%230080ff' stroke-width='1' stroke-opacity='0.25'/%3E%3Cpath d='M20 2v8M20 30v8M2 20h8M30 20h8' stroke='%230080ff' stroke-width='1' stroke-opacity='0.28'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}

/* ── Coin art ─────────────────────────────────────────────────────────── */
[data-theme="electric"] #coin {
  filter: hue-rotate(205deg) saturate(1.4) brightness(1.1);
}

/* ── Balance display ─────────────────────────────────────────────────── */
[data-theme="electric"] .wallet-balance {
  color: #00aaff;
  text-shadow: 0 0 12px rgba(0, 160, 255, 0.40);
}

/* ── Result states ───────────────────────────────────────────────────── */
[data-theme="electric"] .result-card.win {
  border-color: rgba(0, 180, 255, 0.56);
  box-shadow: 0 0 28px rgba(0, 128, 255, 0.32);
}

[data-theme="electric"] .result-card.lose {
  border-color: rgba(255, 48, 96, 0.50);
  box-shadow: 0 0 28px rgba(255, 48, 96, 0.22);
}

[data-theme="electric"] .result-card .verdict {
  color: #00aaff;
}

/* ── Game list rows — banners to be added when assets are ready ──────── */
/* [data-theme="electric"] .game-row[data-kind="coinflip"]  { background-image: url('assets/electric-banner-coin.webp'); }  */
/* [data-theme="electric"] .game-row[data-kind="blackjack"] { background-image: url('assets/electric-banner-bj.webp'); }    */
/* [data-theme="electric"] .game-row[data-kind="slots"]     { background-image: url('assets/electric-banner-slots.webp'); } */
/* [data-theme="electric"] .game-row[data-kind="dice"]      { background-image: url('assets/electric-banner-dice.webp'); }  */
/* [data-theme="electric"] .game-row[data-kind="uno"]       { background-image: url('assets/electric-banner-uno.webp'); }   */
/* [data-theme="electric"] .game-row[data-kind="holdem"]    { background-image: url('assets/electric-banner-holdem.webp'); }*/

/* ===================================================================== */
/* Moonlit — dark fantasy: deep violet black, full moon, gold ornaments  */
/* One-of-one owner theme: hidden until its global single-use code is claimed. */
/* ===================================================================== */

/* ── Keyframes ─────────────────────────────────────────────────────────── */
@keyframes moonlitPulse {
  0%, 100% { text-shadow: 0 0 18px rgba(155, 48, 255, 0.55), 0 0 38px rgba(155, 48, 255, 0.22); }
  50%       { text-shadow: 0 0 28px rgba(190, 90, 255, 0.88), 0 0 58px rgba(155, 48, 255, 0.40); }
}
@keyframes moonlitGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(155, 48, 255, 0.36); }
  50%       { box-shadow: 0 0 26px rgba(180, 80, 255, 0.60); }
}
@keyframes moonlitBorderPulse {
  0%, 100% { border-color: rgba(138, 43, 226, 0.22); }
  50%       { border-color: rgba(168, 80, 255, 0.42); }
}
@keyframes moonlitGoldShimmer {
  0%, 100% { box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.22), 0 0 14px rgba(155, 48, 255, 0.32); }
  50%       { box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.42), 0 0 24px rgba(180, 80, 255, 0.52); }
}

/* ── CSS variables ─────────────────────────────────────────────────────── */
[data-theme="moonlit"] {
  --bg: #090614;
  --bg2: #0e0a1e;
  --surface: rgba(18, 8, 40, 0.84);
  --surface-2: rgba(24, 10, 52, 0.90);
  --surface-solid: #0e0920;
  --stroke: rgba(138, 43, 226, 0.22);
  --stroke-strong: rgba(168, 70, 255, 0.52);
  --text: #ede0ff;
  --muted: #9270c8;
  --accent: #9b30ff;
  --accent-2: #7318cc;
  --accent-grad: linear-gradient(135deg, #c060ff 0%, #9b30ff 55%, #7318cc 100%);
  --accent-soft: rgba(155, 48, 255, 0.14);
  --gold: #d4af37;
  --green: #00e890;
  --red: #e83060;
  --blue: #6030ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.92);
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.82);
  --glow: 0 0 28px rgba(155, 48, 255, 0.52);
}

/* ── Body: near-black violet + moon atmosphere ─────────────────────────── */
[data-theme="moonlit"] body {
  background:
    radial-gradient(ellipse 52% 32% at 72% -4%, rgba(190, 110, 255, 0.18), transparent 54%),
    radial-gradient(ellipse 38% 26% at 14% 8%,  rgba(100, 30, 200, 0.10), transparent 48%),
    radial-gradient(ellipse 70% 48% at 50% 108%, rgba(80, 0, 130, 0.09), transparent 55%),
    linear-gradient(180deg, #0e0a1e 0%, #090614 65%);
  background-attachment: fixed;
}

/* Star field — tiny white + violet dots */
[data-theme="moonlit"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    radial-gradient(circle, rgba(200, 140, 255, 0.32) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 0.5px, transparent 0.5px);
  background-size: 73px 73px, 110px 110px, 47px 47px;
  background-position: 0 0, 36px 36px, 18px 18px;
}

/* Very faint violet vignette at bottom */
[data-theme="moonlit"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse 100% 40% at 50% 110%, rgba(80, 0, 130, 0.22), transparent 60%);
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
[data-theme="moonlit"] ::-webkit-scrollbar { width: 4px; }
[data-theme="moonlit"] ::-webkit-scrollbar-track { background: #04020a; }
[data-theme="moonlit"] ::-webkit-scrollbar-thumb { background: #7318cc; border-radius: 4px; }
[data-theme="moonlit"] ::-webkit-scrollbar-thumb:hover { background: #9b30ff; }

/* ── Brand / header ────────────────────────────────────────────────────── */
[data-theme="moonlit"] .brand-name {
  background: linear-gradient(90deg, #c060ff, #9b30ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: moonlitPulse 4s ease-in-out infinite;
}

[data-theme="moonlit"] .brand-mark {
  color: #b040ff;
  text-shadow: 0 0 18px rgba(155, 48, 255, 0.95), 0 0 36px rgba(120, 0, 220, 0.45);
}

[data-theme="moonlit"] h2 {
  color: #b040ff;
  letter-spacing: 0.05em;
}

[data-theme="moonlit"] .hero h1 {
  color: #c060ff;
  text-shadow: 0 0 24px rgba(155, 48, 255, 0.58);
}

[data-theme="moonlit"] .gc-info b { color: #c060ff; }
[data-theme="moonlit"] .nl { color: #9b30ff; }
[data-theme="moonlit"] .profile-id strong,
[data-theme="moonlit"] #sideName { color: #c060ff; }

/* ── Topbar ────────────────────────────────────────────────────────────── */
[data-theme="moonlit"] #topbar {
  background: linear-gradient(180deg, rgba(6, 2, 18, 0.97), rgba(6, 2, 18, 0.62));
  border-bottom: 1px solid rgba(138, 43, 226, 0.26);
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
[data-theme="moonlit"] .sidebar {
  background: rgba(5, 2, 14, 0.98);
  border-right: 1px solid rgba(138, 43, 226, 0.24);
}
[data-theme="moonlit"] .sidebar-head {
  border-bottom-color: rgba(138, 43, 226, 0.20);
}
[data-theme="moonlit"] .side-link {
  background: rgba(8, 2, 22, 0.86);
  border-color: rgba(138, 43, 226, 0.18);
  color: #e8d8ff;
}
[data-theme="moonlit"] .side-link:hover,
[data-theme="moonlit"] .side-link:focus {
  background: rgba(155, 48, 255, 0.13);
  color: #c060ff;
}
[data-theme="moonlit"] .side-link.danger { color: #e83060; }

/* ── Profile card — dark with purple radial + gold top border ──────────── */
[data-theme="moonlit"] .profile-card {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(155, 48, 255, 0.16), transparent 55%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  border-top: 1px solid rgba(212, 175, 55, 0.30);
  animation: moonlitGoldShimmer 5s ease-in-out infinite;
  overflow: hidden;
  position: relative;
}

/* Ambient character art in the top-right corner of the profile card */
[data-theme="moonlit"] .profile-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 140px; height: 100%;
  background: url('assets/moonlit-profile-bg.webp') right top / cover no-repeat;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.8) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.8) 0%, transparent 100%);
}

/* ── Avatar — purple ring with glow ───────────────────────────────────── */
[data-theme="moonlit"] .top-avatar,
[data-theme="moonlit"] .side-avatar {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.20), transparent 35%),
    linear-gradient(135deg, #9b30ff, #50008a);
  box-shadow: 0 0 0 2px rgba(155, 48, 255, 0.42), 0 6px 20px rgba(120, 0, 200, 0.42);
}

/* ── Level badge — dark with gold border ──────────────────────────────── */
[data-theme="moonlit"] .lvl-badge {
  background: rgba(12, 4, 30, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.50);
  color: #d4af37;
}

/* ── XP bar — violet fill ─────────────────────────────────────────────── */
[data-theme="moonlit"] .xp-fill {
  background: linear-gradient(90deg, #7318cc, #b040ff);
  box-shadow: 0 0 10px rgba(155, 48, 255, 0.56);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
[data-theme="moonlit"] .topup-btn {
  background: var(--accent-grad);
  box-shadow: 0 4px 20px rgba(155, 48, 255, 0.48);
}
[data-theme="moonlit"] .primary:not(.ghost-btn) {
  background: var(--accent-grad);
  box-shadow: 0 4px 16px rgba(155, 48, 255, 0.36);
}
[data-theme="moonlit"] .action.hit {
  background: var(--accent-grad);
}

/* ── Bottom nav ─────────────────────────────────────────────────────────── */
[data-theme="moonlit"] .bottomnav {
  background: linear-gradient(180deg, rgba(4, 1, 12, 0.62), rgba(4, 1, 10, 0.97));
  border-top: 1px solid rgba(138, 43, 226, 0.28);
}
[data-theme="moonlit"] .nav-item.active { color: #9b30ff; }
[data-theme="moonlit"] .nav-item.center .ni {
  background: var(--accent-grad);
  border-color: var(--bg);
  box-shadow:
    0 6px 24px rgba(155, 48, 255, 0.70),
    0 0 0 2px rgba(212, 175, 55, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  animation: moonlitGlow 3.5s ease-in-out infinite;
}

/* ── Panels / game cards ────────────────────────────────────────────────── */
[data-theme="moonlit"] .panel,
[data-theme="moonlit"] .wallet-card,
[data-theme="moonlit"] .stat-card {
  border-color: rgba(138, 43, 226, 0.18);
}
[data-theme="moonlit"] .game-card {
  background: linear-gradient(135deg, rgba(18, 8, 42, 0.90), rgba(10, 4, 26, 0.90));
  border-color: rgba(138, 43, 226, 0.22);
  animation: moonlitBorderPulse 4s ease-in-out infinite;
}
[data-theme="moonlit"] .game-card:hover {
  border-color: rgba(168, 70, 255, 0.55);
  box-shadow: var(--shadow), 0 0 22px rgba(155, 48, 255, 0.22);
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
[data-theme="moonlit"] .modal {
  background: rgba(4, 1, 14, 0.88);
}
[data-theme="moonlit"] .modal-inner {
  border-color: rgba(138, 43, 226, 0.32);
  border-top: 1px solid rgba(212, 175, 55, 0.28);
}

/* ── Game table felt ────────────────────────────────────────────────────── */
[data-theme="moonlit"] .felt,
[data-theme="moonlit"] .table-felt,
[data-theme="moonlit"] .uno-felt {
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(100, 0, 180, 0.22), transparent 60%),
    linear-gradient(160deg, #08041a, #04020e);
}

/* ── Playing cards ──────────────────────────────────────────────────────── */
/* Card back: dark + gold baroque frame + violet diamond — echoes the arts */
[data-theme="moonlit"] .pcard.back {
  background-color: #08031a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='84'%3E%3Crect width='60' height='84' rx='4' fill='%2308031a'/%3E%3Crect x='2.5' y='2.5' width='55' height='79' rx='3' fill='none' stroke='%23d4af37' stroke-width='1.2' stroke-opacity='0.68'/%3E%3Crect x='5.5' y='5.5' width='49' height='73' rx='2' fill='none' stroke='%23d4af37' stroke-width='0.4' stroke-opacity='0.26'/%3E%3Cpolygon points='30,22 43,42 30,62 17,42' fill='none' stroke='%239b30ff' stroke-width='1.2' stroke-opacity='0.62'/%3E%3Cpolygon points='30,27 39,42 30,57 21,42' fill='%239b30ff' fill-opacity='0.10'/%3E%3Ccircle cx='30' cy='42' r='4.5' fill='%239b30ff' fill-opacity='0.26'/%3E%3Ccircle cx='30' cy='42' r='2' fill='%23c060ff' fill-opacity='0.55'/%3E%3Ccircle cx='7' cy='7' r='2' fill='none' stroke='%23d4af37' stroke-width='1' stroke-opacity='0.60'/%3E%3Ccircle cx='53' cy='7' r='2' fill='none' stroke='%23d4af37' stroke-width='1' stroke-opacity='0.60'/%3E%3Ccircle cx='7' cy='77' r='2' fill='none' stroke='%23d4af37' stroke-width='1' stroke-opacity='0.60'/%3E%3Ccircle cx='53' cy='77' r='2' fill='none' stroke='%23d4af37' stroke-width='1' stroke-opacity='0.60'/%3E%3Cpath d='M30 15L30.6 19.5L35 20.5L30.6 21.5L30 26L29.4 21.5L25 20.5L29.4 19.5Z' fill='%23d4af37' fill-opacity='0.42'/%3E%3Cpath d='M30 58L30.5 62L34 63L30.5 64L30 68L29.5 64L26 63L29.5 62Z' fill='%23d4af37' fill-opacity='0.42'/%3E%3C/svg%3E");
  background-size: 60px 84px;
}

/* Red suits → amethyst purple in moonlit */
[data-theme="moonlit"] .pcard.red { color: #a040e8; }

/* ── Coin — hue-shifted to violet ──────────────────────────────────────── */
[data-theme="moonlit"] #coin {
  filter: hue-rotate(270deg) saturate(1.6) brightness(0.95);
}

/* ── Balance ────────────────────────────────────────────────────────────── */
[data-theme="moonlit"] .wallet-balance {
  color: #c060ff;
  text-shadow: 0 0 14px rgba(155, 48, 255, 0.42);
}

/* ── Result states ──────────────────────────────────────────────────────── */
[data-theme="moonlit"] .result-card.win {
  border-color: rgba(190, 80, 255, 0.58);
  box-shadow: 0 0 30px rgba(155, 48, 255, 0.34);
}
[data-theme="moonlit"] .result-card.lose {
  border-color: rgba(232, 48, 96, 0.50);
  box-shadow: 0 0 28px rgba(232, 48, 96, 0.22);
}
[data-theme="moonlit"] .result-card .verdict {
  color: #c060ff;
}

/* ── Game list rows — plug in banner assets when ready ─────────────────── */
[data-theme="moonlit"] .game-card,
[data-theme="moonlit"] .game-row { background-size: cover; background-position: center; }

[data-theme="moonlit"] .game-row[data-kind="dice"]     { background-image: url('assets/moonlit-banner-dice.webp'); }
[data-theme="moonlit"] .game-row[data-kind="roulette"] { background-image: url('assets/moonlit-banner-roulette.webp'); }
[data-theme="moonlit"] .game-row[data-kind="holdem"]   { background-image: url('assets/moonlit-banner-holdem.webp'); }

/* User-selectable low-cost rendering path for slower Telegram WebViews. */
[data-effects="lite"] #horrorFx,
[data-effects="lite"] #lightningFlash,
[data-effects="lite"] .blood-drip,
[data-effects="lite"] .yinyang-bg-video,
[data-effects="lite"] .dragon-bg-video { display: none !important; }
[data-effects="lite"] *,
[data-effects="lite"] *::before,
[data-effects="lite"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 100ms !important;
}
[data-theme="moonlit"] .game-row[data-kind="coinflip"]  { background-image: linear-gradient(rgba(32,8,62,.34), rgba(8,2,20,.72)), url('assets/coinflip-ink.webp'); }
[data-theme="moonlit"] .game-row[data-kind="blackjack"] { background-image: linear-gradient(rgba(32,8,62,.34), rgba(8,2,20,.72)), url('assets/blackjack-ink.webp'); }
[data-theme="moonlit"] .game-row[data-kind="slots"]     { background-image: linear-gradient(rgba(32,8,62,.34), rgba(8,2,20,.72)), url('assets/banner-slots.webp'); }
[data-theme="moonlit"] .game-row[data-kind="uno"]       { background-image: linear-gradient(rgba(32,8,62,.34), rgba(8,2,20,.72)), url('assets/uno-ink.webp'); }
/* ========================================================================== */
/* SHARED COMPONENT NORMALIZATION                                               */
/* Kept at low specificity so every theme can still replace colors and art.     */
/* ========================================================================== */

:where(.prof-input, .auc-input, .promo-input, .join-code-input, .profile-edit input) {
  width: 100%;
  min-width: 0;
  min-height: var(--control-md);
  padding: 10px 13px;
  border: var(--border-ui);
  border-radius: var(--radius-control);
  background-color: var(--surface-2);
  color: var(--text);
  outline: none;
  transition:
    border-color var(--duration-ui) var(--ease-ui),
    box-shadow var(--duration-ui) var(--ease-ui),
    background-color var(--duration-ui) var(--ease-ui);
}

/* Geometry is intentionally stronger than legacy component rules. Theme rules
   still own colors, borders and artwork. */
.prof-input,
.auc-input,
.promo-input,
.join-code-input,
.profile-edit input {
  min-height: var(--control-md);
  border-radius: var(--radius-control);
}

:where(.prof-input, .auc-input, .promo-input, .join-code-input, .profile-edit input)::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

:where(.prof-input, .auc-input, .promo-input, .join-code-input, .profile-edit input):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

:where(.panel, .wallet-card, .stat-card, .invite-stat) {
  border-radius: var(--radius-panel);
}

:where(.games-list, .history-list, .auction-list, .raffle-list) {
  gap: var(--space-3);
}

:where(#noGames, #aucPickEmpty, #aucEmpty, #rafflePickEmpty, #raffleEmpty,
       #vaultEmpty, #depositHistoryEmpty, #historyEmpty, #convertEmpty) {
  margin: var(--space-3) 0;
  padding: var(--space-5) var(--space-4);
  border: 1px dashed var(--stroke-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  text-align: center;
  line-height: 1.45;
}

.toast {
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  width: max-content;
  max-width: min(90vw, 420px);
  white-space: normal;
  overflow-wrap: anywhere;
}

.theme-tile[hidden] {
  display: none !important;
}

/* ========================================================================== */
/* MOTION SYSTEM                                                               */
/* Shared interaction motion; theme-specific game effects remain untouched.    */
/* ========================================================================== */

body.sidebar-open,
body.dialog-open {
  overflow: hidden;
}

.sidebar-overlay:not([hidden]) {
  animation: overlayEnter 180ms var(--ease-ui) both;
}

.sidebar-overlay.is-closing {
  opacity: 0;
  transition: opacity 180ms var(--ease-ui);
}

.modal-overlay:not([hidden]) {
  animation: overlayEnter 180ms var(--ease-ui) both;
}

.modal-overlay:not([hidden]) .modal {
  animation: dialogEnter 240ms var(--ease-ui) both;
  transform-origin: 50% 70%;
}

.modal-overlay.is-closing {
  opacity: 0;
  transition: opacity 180ms var(--ease-ui);
}

.modal-overlay.is-closing .modal {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 160ms var(--ease-ui), transform 180ms var(--ease-ui);
}

.toast:not([hidden]) {
  animation: toastEnter 220ms var(--ease-ui) both;
}

:where(button, [role="button"], .game-card, .panel) {
  -webkit-tap-highlight-color: transparent;
}

:where(button, [role="button"]):not(:disabled) {
  transition-property: transform, filter, background-color, border-color, box-shadow, opacity;
  transition-duration: var(--duration-ui);
  transition-timing-function: var(--ease-ui);
}

:where(button, [role="button"]):not(:disabled):active {
  transform: scale(0.97);
}

:where(button, [role="button"]):disabled {
  cursor: wait;
  opacity: 0.58;
}

.connection-banner:not([hidden]) {
  animation: bannerEnter 220ms var(--ease-ui) both;
}

.connection-banner.loading #connectionMessage::after {
  content: "";
  display: inline-block;
  width: 1.1em;
  text-align: left;
  animation: loadingDots 1.1s steps(4, end) infinite;
}

@keyframes overlayEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialogEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastEnter {
  from { opacity: 0; transform: translate(-50%, 10px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes bannerEnter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loadingDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}
