/* ==========================================================================
   DUSKMIRE – REFINED COZY & GOTHIC DARK FANTASY DESIGN SYSTEM
   Clean surface layering, restrained antique gold accents, crisp readability
   ========================================================================== */

:root {
  --font-display: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-ui: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Layered Dark Fantasy Surfaces (depth via tone, not heavy frames) */
  --dm-night: #0b0e18;
  --dm-night-deep: #070911;
  --dm-surface-1: #131724;
  --dm-surface-2: #1a1f30;
  --dm-surface-3: #23293e;
  --dm-surface-recess: #0e111b;
  --dm-plum: #1e1630;
  --dm-forest: #122822;
  --dm-oak: #2a1c14;

  /* Restrained Accents */
  --dm-gold: #cfa349;
  --dm-gold-bright: #f0d07e;
  --dm-gold-dim: rgba(207, 163, 73, 0.34);
  --dm-teal: #348a84;
  --dm-teal-glow: #66c7bc;
  --dm-ember: #e07b2e;
  --dm-ember-glow: #f5aa56;
  --dm-crimson: #942b3c;
  --dm-crimson-bright: #c9465a;
  --dm-purple: #7d57c2;

  /* Borders & Text */
  --dm-line: rgba(235, 224, 200, 0.09);
  --dm-line-strong: rgba(207, 163, 73, 0.28);
  --dm-parchment: #f2e8d4;
  --dm-text: #e2d9c6;
  --dm-text-muted: #9c9589;
  --dm-radius-sm: 6px;
  --dm-radius-md: 10px;
  --dm-radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.48;
  color: var(--dm-text);
  background-color: var(--dm-night);
  background-image:
    radial-gradient(ellipse at 50% -8%, rgba(72, 48, 114, 0.28) 0%, transparent 52%),
    radial-gradient(ellipse at 14% 86%, rgba(32, 92, 82, 0.16) 0%, transparent 44%),
    radial-gradient(ellipse at 88% 80%, rgba(168, 86, 32, 0.1) 0%, transparent 46%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: var(--font-ui);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
}

img.pixel-art, canvas.pixel-art {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ==========================================================================
   MOONLIT SPLASH OVERLAY
   ========================================================================== */

.dm-splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background:
    radial-gradient(circle at 60% 30%, rgba(240, 208, 126, 0.18) 0%, transparent 34%),
    radial-gradient(circle at 50% 60%, rgba(38, 28, 66, 0.72) 0%, #070911 80%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.dm-splash--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dm-splash-card {
  background: var(--dm-surface-1);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72);
  padding: 28px 36px;
  text-align: center;
  max-width: 440px;
  width: 92%;
}

.dm-splash-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--dm-gold-bright);
  padding: 6px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dm-splash-bar-wrap {
  height: 8px;
  background: var(--dm-surface-recess);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 16px;
}

.dm-splash-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--dm-teal), var(--dm-gold), var(--dm-ember-glow));
  animation: dmLoadBar 0.72s ease-out forwards;
}

@keyframes dmLoadBar {
  0% { width: 12%; }
  70% { width: 84%; }
  100% { width: 100%; }
}

/* ==========================================================================
   CLEAN ORGANIZED TOP NAVIGATION BAR
   ========================================================================== */

.dm-topbar {
  background: rgba(13, 16, 26, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--dm-line-strong);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 60;
}

.dm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--dm-radius-sm);
  transition: opacity 0.15s ease;
}

.dm-brand:hover {
  opacity: 0.92;
}

.dm-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dm-gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.dm-logo-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
}

.dm-brand-sub {
  color: var(--dm-text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-left: 1px solid var(--dm-line);
  padding-left: 10px;
}

@media (max-width: 1120px) {
  .dm-brand-sub { display: none; }
}

.dm-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.dm-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 3px;
}

.dm-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: #c7bfb0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.dm-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dm-parchment);
}

.dm-nav-btn--active {
  background: rgba(207, 163, 73, 0.16);
  border-color: rgba(207, 163, 73, 0.55);
  color: var(--dm-gold-bright);
  font-weight: 700;
}

.dm-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dm-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 4px 10px 4px 5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dm-profile-pill:hover {
  border-color: var(--dm-line-strong);
  background: var(--dm-surface-3);
}

.dm-profile-pill img {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--dm-surface-recess);
}

.dm-wallet-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--dm-parchment);
}

.dm-wallet-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(207, 163, 73, 0.16);
  color: var(--dm-gold-bright);
  font-weight: 700;
  font-size: 12.5px;
  padding: 3px 9px;
  border: 1px solid rgba(207, 163, 73, 0.45);
  border-radius: 6px;
  white-space: nowrap;
}

.wallet-total-pill {
  color: #c9c1b2;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

.dm-audio-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 3px 8px;
}

.dm-audio-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dm-vol-slider {
  width: 50px;
  accent-color: var(--dm-gold);
  cursor: pointer;
  height: 14px;
}

/* ==========================================================================
   MAIN SHELL & CLEAN PANEL ARCHITECTURE
   ========================================================================== */

.dm-shell {
  max-width: 1260px;
  margin: 22px auto 52px;
  padding: 0 18px;
  animation: dmViewFade 0.22s ease-out;
}

@keyframes dmViewFade {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dm-window {
  background: var(--dm-surface-1);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
  overflow: hidden;
  margin-bottom: 20px;
}

.dm-window-header {
  background: var(--dm-surface-2);
  color: var(--dm-parchment);
  padding: 13px 18px;
  border-bottom: 1px solid var(--dm-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dm-window-header--gold {
  border-bottom-color: rgba(207, 163, 73, 0.32);
}

.dm-window-header--emerald {
  border-bottom-color: rgba(52, 138, 132, 0.38);
}

.dm-window-header--crimson {
  border-bottom-color: rgba(201, 70, 90, 0.36);
}

.dm-window-header--royal {
  border-bottom-color: rgba(125, 87, 194, 0.38);
}

.dm-window-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--dm-gold-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-window-subtitle {
  font-size: 12.5px;
  color: var(--dm-text-muted);
}

.dm-window-body {
  padding: 18px;
}

.dm-section-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--dm-gold-bright);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   CONSISTENT FANTASY BUTTONS
   ========================================================================== */

.dm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  border: 1px solid rgba(235, 224, 200, 0.16);
  border-radius: var(--dm-radius-sm);
  cursor: pointer;
  background: var(--dm-surface-3);
  color: var(--dm-parchment);
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.dm-btn:hover:not(:disabled) {
  background: #2c334d;
  border-color: rgba(207, 163, 73, 0.55);
}

.dm-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.dm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dm-btn--blue {
  background: #1f2b45;
  border-color: rgba(114, 152, 222, 0.32);
  color: #dbe8ff;
}
.dm-btn--blue:hover:not(:disabled) { background: #273759; }

.dm-btn--purple {
  background: #302254;
  border-color: rgba(154, 118, 224, 0.4);
  color: #ede4ff;
}
.dm-btn--purple:hover:not(:disabled) { background: #3c2b69; }

.dm-btn--teal {
  background: #173a3b;
  border-color: rgba(102, 199, 188, 0.4);
  color: #d6faf6;
}
.dm-btn--teal:hover:not(:disabled) { background: #1e4b4c; }

.dm-btn--green {
  background: #1b4d3e;
  border-color: rgba(86, 188, 150, 0.45);
  color: #e4fff6;
}
.dm-btn--green:hover:not(:disabled) { background: #22604d; }

.dm-btn--gold, .dm-btn--nav-active {
  background: linear-gradient(180deg, #dfb85e 0%, #b5892d 100%);
  border-color: #f3d68b;
  color: #1a1204;
  font-weight: 700;
}
.dm-btn--gold:hover:not(:disabled), .dm-btn--nav-active:hover:not(:disabled) {
  background: linear-gradient(180deg, #ecc974 0%, #c49635 100%);
  box-shadow: 0 0 14px rgba(207, 163, 73, 0.32);
}

.dm-btn--red {
  background: #611e2b;
  border-color: rgba(209, 86, 104, 0.45);
  color: #ffe8ec;
}
.dm-btn--red:hover:not(:disabled) { background: #782535; }

.dm-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--dm-text-muted);
}
.dm-btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dm-parchment);
  border-color: transparent;
}

.dm-btn--lg {
  font-size: 14px;
  padding: 11px 22px;
}

.dm-btn--sm {
  font-size: 12px;
  padding: 5px 10px;
}

/* ==========================================================================
   DUSKMIRE TOWN WORLD MAP & COMPACT LAUNCH HUB
   ========================================================================== */

.world-canvas-wrap {
  background: #080b13;
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-md);
  overflow: hidden;
  position: relative;
}

.world-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
}

.world-hover-card {
  position: absolute;
  bottom: 14px;
  left: 14px;
  max-width: 340px;
  background: rgba(14, 17, 28, 0.94);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(207, 163, 73, 0.55);
  border-radius: var(--dm-radius-md);
  padding: 10px 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
  z-index: 5;
}

.world-hover-card--visible {
  opacity: 1;
  transform: translateY(0);
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 920px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.game-cards-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .game-cards-row {
    grid-template-columns: 1fr;
  }
}

.game-launch-card {
  background: var(--dm-surface-2);
  color: var(--dm-parchment);
  border: 1px solid var(--dm-line);
  border-top: 3px solid var(--dm-teal);
  border-radius: var(--dm-radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}

.game-launch-card:hover {
  transform: translateY(-2px);
  background: var(--dm-surface-3);
  border-color: var(--dm-line-strong);
}

.game-launch-card--21 { border-top-color: var(--dm-gold); }
.game-launch-card--trihigh { border-top-color: var(--dm-ember); }
.game-launch-card--trilow { border-top-color: var(--dm-purple); }

.game-launch-card h3 {
  font-size: 15px;
  color: var(--dm-gold-bright);
  letter-spacing: 0.4px;
}

.game-launch-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #c5bdb0;
}

.hub-side-panel {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   NPC TAVERN PATRON CARDS
   ========================================================================== */

.npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 12px;
}

.npc-card {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.npc-card:hover {
  border-color: var(--dm-line-strong);
  background: var(--dm-surface-3);
  transform: translateY(-2px);
}

.npc-card--selected {
  border-color: var(--dm-gold);
  background: #231f29;
  box-shadow: 0 0 0 1px rgba(207, 163, 73, 0.35);
}

.npc-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.npc-avatar-box {
  width: 48px;
  height: 48px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line-strong);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.npc-avatar-box img {
  width: 40px;
  height: 40px;
}

.npc-badge {
  display: inline-block;
  background: rgba(207, 163, 73, 0.14);
  color: var(--dm-gold-bright);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.npc-mini-inv {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--dm-line);
}

.npc-mini-inv span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  background: var(--dm-surface-recess);
  padding: 2px 5px;
  border-radius: 4px;
}

.npc-mini-inv img {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   ROYAL CASINO STAGE (CLEANER SEPARATION, LARGER RUNED CUPS)
   ========================================================================== */

.casino-stage {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(232, 134, 52, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 45%, #143d30 0%, #0d261e 72%, #081813 100%);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-md);
  padding: 18px;
  color: var(--dm-parchment);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.casino-stage--21 {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(232, 134, 52, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 45%, #15354a 0%, #0d2230 72%, #08141c 100%);
}

.casino-stage--trihigh {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(245, 170, 86, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 45%, #422019 0%, #29130e 72%, #170a07 100%);
}

.casino-stage--trilow {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(102, 199, 188, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 45%, #271b45 0%, #18102b 72%, #0f0a1c 100%);
}

.casino-stage--shake {
  animation: tableHeavyImpact 0.34s cubic-bezier(0.25, 0.8, 0.35, 1);
}

.casino-stage--bigwin {
  box-shadow: inset 0 0 60px rgba(240, 208, 126, 0.26), 0 0 28px rgba(207, 163, 73, 0.35);
}

@keyframes tableHeavyImpact {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-2px, 3px); }
  45%  { transform: translate(2px, -2px); }
  70%  { transform: translate(-1px, 1px); }
  100% { transform: translate(0, 0); }
}

.dealer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(12, 14, 22, 0.72);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.dealer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dealer-avatar-frame {
  width: 54px;
  height: 54px;
  background: var(--dm-surface-recess);
  border: 1.5px solid var(--dm-gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dealer-avatar-frame img {
  width: 44px;
  height: 44px;
}

.dm-speech-bubble {
  background: rgba(25, 22, 34, 0.92);
  color: var(--dm-parchment);
  border: 1px solid var(--dm-line-strong);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  max-width: 500px;
}

.dm-speech-bubble strong {
  color: var(--dm-gold-bright);
  font-style: normal;
}

.casino-turn-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--dm-radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(12, 15, 24, 0.72);
  border: 1px solid var(--dm-line);
  color: #d6cebe;
}

.casino-turn-banner--player {
  background: rgba(207, 163, 73, 0.16);
  border-color: rgba(207, 163, 73, 0.55);
  color: var(--dm-gold-bright);
}

.casino-turn-banner--dealer {
  background: rgba(52, 138, 132, 0.2);
  border-color: rgba(102, 199, 188, 0.45);
  color: #a9f0e7;
}

.pot-banner {
  background: rgba(12, 14, 22, 0.74);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-md);
  padding: 11px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pot-label {
  font-family: var(--font-display);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dm-gold-bright);
  font-weight: 700;
}

.rare-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.rare-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(12, 14, 24, 0.78);
  border: 1px solid var(--dm-line);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dm-parchment);
}

.rare-pill--light {
  background: var(--dm-surface-recess);
  border-color: var(--dm-line);
}

.rare-pill img {
  width: 18px;
  height: 18px;
}

.dice-zone {
  background: rgba(9, 11, 18, 0.44);
  border: 1px solid rgba(235, 224, 200, 0.1);
  border-radius: var(--dm-radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.dice-zone--dealer {
  background: rgba(12, 10, 22, 0.5);
}

.dice-zone--player {
  background: rgba(10, 22, 22, 0.44);
}

.dice-zone--active {
  border-color: rgba(207, 163, 73, 0.65);
  box-shadow: 0 0 22px rgba(207, 163, 73, 0.16);
}

.dice-zone--suspense {
  border-color: var(--dm-ember-glow);
  box-shadow: 0 0 28px rgba(224, 123, 46, 0.38);
  animation: suspensePulse 0.45s ease-in-out infinite alternate;
}

@keyframes suspensePulse {
  0%   { box-shadow: 0 0 12px rgba(224, 123, 46, 0.25); }
  100% { box-shadow: 0 0 30px rgba(240, 208, 126, 0.58); }
}

.dice-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.dice-zone-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dm-gold-bright);
}

.hand-badge {
  background: rgba(10, 12, 20, 0.85);
  color: var(--dm-gold-bright);
  border: 1px solid rgba(207, 163, 73, 0.45);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hand-badge--reveal {
  animation: comboRevealPop 0.45s cubic-bezier(0.18, 1.3, 0.32, 1);
  box-shadow: 0 0 14px rgba(207, 163, 73, 0.45);
}

.hand-badge--epic {
  background: linear-gradient(180deg, #6e4e15 0%, #3a2608 100%);
  border-color: #fff2be;
  color: #ffffff;
  box-shadow: 0 0 22px rgba(240, 208, 126, 0.72);
  animation: comboEpicReveal 0.58s cubic-bezier(0.18, 1.35, 0.32, 1);
}

.hand-badge--suspense {
  background: #361d0a;
  border-color: var(--dm-ember-glow);
  color: #ffe2bd;
  animation: badgeBlink 0.35s ease-in-out infinite alternate;
}

@keyframes badgeBlink {
  0% { opacity: 0.74; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.03); }
}

@keyframes comboRevealPop {
  0%   { transform: scale(0.7); opacity: 0; }
  65%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes comboEpicReveal {
  0%   { transform: scale(0.55) rotate(-3deg); opacity: 0; }
  55%  { transform: scale(1.16) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.hand-badge--bust {
  background: #59141f;
  border-color: #e06577;
  color: #ffe8eb;
}

.hand-badge--perfect {
  background: #144234;
  border-color: var(--dm-teal-glow);
  color: #d9fff8;
}

.dice-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 122px;
  padding: 16px 10px 14px;
  position: relative;
}

.casino-round-history {
  margin-top: 16px;
  background: rgba(11, 13, 21, 0.65);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 12px 14px;
}

/* ==========================================================================
   LARGER, CRISPER 3D RUNED DICE & GILDED FANTASY CUPS
   ========================================================================== */

.dm-cup-slot {
  position: relative;
  width: 98px;
  min-height: 116px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dm-cup-slot--sm {
  width: 84px;
  min-height: 100px;
}

.dm-cup-pad {
  position: absolute;
  bottom: 24px;
  left: 50%;
  width: 84px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.56) 0%, rgba(0, 0, 0, 0.14) 64%, transparent 78%);
  border: 1px dashed rgba(207, 163, 73, 0.32);
  pointer-events: none;
}

.dm-cup-slot--sm .dm-cup-pad {
  width: 72px;
  height: 20px;
}

.dm-cup-die-host {
  position: relative;
  z-index: 2;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-cup-slot--sm .dm-cup-die-host {
  min-height: 62px;
}

.dm-cup-dome {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.dm-cup-slot--sm .dm-cup-dome {
  width: 78px;
  height: 78px;
}

.dm-cup-img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.62));
}

.dm-cup-caption {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #d6cbb8;
  background: rgba(10, 12, 20, 0.88);
  border: 1px solid rgba(207, 163, 73, 0.32);
  border-radius: 12px;
  padding: 2px 9px;
  white-space: nowrap;
}

.dm-cup-slot--placeholder {
  opacity: 0.52;
  filter: saturate(0.7);
}

.dm-cup-slot--ready {
  cursor: pointer;
}

.dm-cup-slot--ready .dm-cup-dome {
  animation: cupInviteBob 1.7s ease-in-out infinite;
}

.dm-cup-slot--ready:hover .dm-cup-dome,
.dm-cup-slot--ready:focus-visible .dm-cup-dome {
  transform: translateX(-50%) translateY(-7px) scale(1.08);
  filter: drop-shadow(0 0 14px rgba(240, 208, 126, 0.85)) drop-shadow(0 0 6px rgba(102, 199, 188, 0.6));
}

.dm-cup-slot--ready:active .dm-cup-dome {
  transform: translateX(-50%) translateY(1px) scale(0.96);
}

.dm-cup-slot--ready .dm-cup-caption {
  background: linear-gradient(180deg, #e5bf65 0%, #b5892d 100%);
  color: #1a1102;
  border-color: #f8df9b;
}

@keyframes cupInviteBob {
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  50% { transform: translateX(-50%) translateY(-3.5px); }
}

.dm-cup-slot--shaking .dm-cup-dome {
  animation: cupRattle 0.4s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(245, 170, 86, 0.8));
}

@keyframes cupRattle {
  0%   { transform: translateX(-50%) translate(0px, 0px) rotate(0deg); }
  15%  { transform: translateX(-50%) translate(-5px, -5px) rotate(-8deg); }
  32%  { transform: translateX(-50%) translate(5px, -3px) rotate(8deg); }
  48%  { transform: translateX(-50%) translate(-4px, -6px) rotate(-6deg); }
  66%  { transform: translateX(-50%) translate(4px, -2px) rotate(7deg); }
  82%  { transform: translateX(-50%) translate(-3px, -4px) rotate(-5deg); }
  100% { transform: translateX(-50%) translate(0px, 0px) rotate(0deg); }
}

.dm-cup-slot--suspense .dm-cup-dome {
  transform: translateX(-50%) translateY(-2px) scale(1.05);
  filter: drop-shadow(0 0 16px rgba(102, 199, 188, 0.9));
}

.dm-cup-slot--lifting .dm-cup-dome {
  animation: cupLiftOff 0.45s cubic-bezier(0.22, 0.85, 0.32, 1) forwards;
}

@keyframes cupLiftOff {
  0%   { transform: translateX(-50%) translateY(0px) rotate(0deg) scale(1.04); opacity: 1; }
  35%  { transform: translateX(-50%) translateY(-50px) rotate(-14deg) scale(1.06); opacity: 0.96; }
  100% { transform: translateX(-50%) translate(14px, -104px) rotate(-24deg) scale(0.86); opacity: 0; }
}

.dm-die-wrap {
  --die-size: 66px;
  --half-size: 33px;
  position: relative;
  width: var(--die-size);
  height: var(--die-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.26s cubic-bezier(0.2, 1.3, 0.3, 1);
  will-change: transform;
}

.dm-die-wrap--sm {
  --die-size: 56px;
  --half-size: 28px;
}

.dm-die-shadow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 84%;
  height: 13px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 52%, rgba(0,0,0,0) 76%);
  pointer-events: none;
}

.dm-die-impact-ring {
  position: absolute;
  bottom: -12px;
  left: 50%;
  width: 66px;
  height: 20px;
  transform: translateX(-50%) scale(0.3);
  border: 2px solid rgba(240, 208, 126, 0.8);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.dm-die-wrap--impact .dm-die-impact-ring {
  animation: dmImpactRipple 0.38s ease-out forwards;
}

@keyframes dmImpactRipple {
  0%   { transform: translateX(-50%) scale(0.4); opacity: 0.85; }
  100% { transform: translateX(-50%) scale(1.65); opacity: 0; }
}

.dm-die-scene {
  width: var(--die-size);
  height: var(--die-size);
  perspective: 380px;
}

.dm-die-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.dm-die-face {
  position: absolute;
  width: var(--die-size);
  height: var(--die-size);
  background: linear-gradient(140deg, #2d2538 0%, #191522 55%, #0e0b14 100%);
  border: 2px solid #09070d;
  box-shadow:
    inset 0 0 0 2px #c89b3c,
    inset 0 2px 6px rgba(255, 255, 255, 0.2),
    inset 0 -3px 8px rgba(0, 0, 0, 0.65);
  border-radius: 9px;
  padding: 6px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dm-die-face::after {
  content: '';
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 236, 179, 0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

.dm-die-wrap--landed .dm-die-face::after,
.dm-die-wrap--highlight .dm-die-face::after {
  animation: dmDieGlint 0.6s ease-out 1;
}

@keyframes dmDieGlint {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(120%); }
}

.dm-die-face-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #f5ebd5 0%, #dfd0b0 75%, #c9b58b 100%);
  border: 1.5px solid #8a6824;
  border-radius: 5px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.28);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 4px;
}

.dm-die-pip-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-die-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #3a2d4a 0%, #120d1a 80%);
  box-shadow: inset 0 1.5px 2px rgba(0,0,0,0.75), 0 1px 0 rgba(255,255,255,0.65);
}

.dm-die-wrap--sm .dm-die-pip {
  width: 8.5px;
  height: 8.5px;
}

.dm-die-val-1 .dm-die-pip {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 35% 35%, #ff5c6c 0%, #8c1220 80%);
  box-shadow: 0 0 0 2px #c89b3c, inset 0 1.5px 2px rgba(0,0,0,0.55);
}

.dm-die-val-6 .dm-die-pip {
  background: radial-gradient(circle at 35% 35%, #ffe58f 0%, #9e6b0c 82%);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.45), 0 0 3px rgba(212,167,74,0.8);
}

.dm-die-face--front  { transform: rotateY(0deg) translateZ(var(--half-size)); }
.dm-die-face--right  { transform: rotateY(90deg) translateZ(var(--half-size)); }
.dm-die-face--back   { transform: rotateY(180deg) translateZ(var(--half-size)); }
.dm-die-face--left   { transform: rotateY(-90deg) translateZ(var(--half-size)); }
.dm-die-face--top    { transform: rotateX(90deg) translateZ(var(--half-size)); }
.dm-die-face--bottom { transform: rotateX(-90deg) translateZ(var(--half-size)); }

.dm-die-wrap--idle { opacity: 0.56; }

.dm-die-wrap--cup-bounce {
  animation: dmDieRevealBounce var(--roll-dur, 560ms) cubic-bezier(0.22, 0.72, 0.3, 1) forwards;
}

.dm-die-wrap--landed {
  animation: dmDieSettleWeight 0.24s ease-out;
}

.dm-die-wrap--highlight {
  transform: translateY(-6px) scale(1.08);
  z-index: 3;
}

.dm-die-wrap--highlight .dm-die-face {
  box-shadow:
    inset 0 0 0 2.5px #fff2be,
    0 0 18px rgba(240, 208, 126, 0.9),
    0 0 28px rgba(224, 123, 46, 0.4);
}

@keyframes dmDieRevealBounce {
  0%   { transform: translateY(-16px) scale(0.86); opacity: 0.45; }
  24%  { transform: translateY(-24px) scale(1.1); opacity: 1; }
  46%  { transform: translateY(4px) scale(0.93, 0.9); }
  66%  { transform: translateY(-11px) scale(1.04); }
  82%  { transform: translateY(2px) scale(0.97, 0.96); }
  100% { transform: translateY(0px) scale(1); }
}

@keyframes dmDieSettleWeight {
  0%   { transform: translateY(3px) scale(1.04, 0.94); }
  55%  { transform: translateY(-2px) scale(0.99, 1.02); }
  100% { transform: translateY(0) scale(1); }
}

/* ==========================================================================
   BIG WIN CALLOUT & SUBTLE CELEBRATIONS
   ========================================================================== */

.bigwin-flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background: radial-gradient(circle at 50% 45%, rgba(240, 208, 126, 0.3) 0%, rgba(224, 123, 46, 0.12) 45%, transparent 76%);
  animation: bigWinFlash 1.1s ease-out forwards;
}

@keyframes bigWinFlash {
  0%   { opacity: 0; transform: scale(0.9); }
  18%  { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.08); }
}

.bigwin-callout {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  pointer-events: none;
  background: var(--dm-surface-1);
  color: var(--dm-gold-bright);
  border: 2px solid var(--dm-gold);
  border-radius: var(--dm-radius-md);
  padding: 16px 30px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.72), 0 0 28px rgba(207, 163, 73, 0.45);
  animation: bigWinCalloutAnim 1.85s cubic-bezier(0.18, 1.3, 0.3, 1) forwards;
  text-align: center;
}

@keyframes bigWinCalloutAnim {
  0%   { opacity: 0; transform: translate(-50%, 20px) scale(0.7); }
  18%  { opacity: 1; transform: translate(-50%, 0) scale(1.04); }
  28%  { transform: translate(-50%, 0) scale(1); }
  80%  { opacity: 1; transform: translate(-50%, -4px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -22px) scale(0.96); }
}

/* ==========================================================================
   BET BUILDER & OUTCOME BANNERS
   ========================================================================== */

.bet-builder-box {
  background: var(--dm-surface-1);
  color: var(--dm-text);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 16px;
}

.bet-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .bet-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bet-summary-cell {
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: 6px;
  padding: 8px 10px;
}

.bet-summary-cell-label {
  font-size: 11px;
  color: var(--dm-text-muted);
}

.bet-summary-cell-val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--dm-parchment);
  margin-top: 2px;
}

.bet-rare-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 12px 0;
}

@media (max-width: 780px) {
  .bet-rare-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bet-rare-slot {
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bet-rare-slot--selected {
  border-color: var(--dm-gold);
  background: #221d18;
}

.bet-rare-slot img {
  width: 40px;
  height: 40px;
}

.bet-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.bet-qty-controls button {
  width: 26px;
  height: 26px;
  padding: 0;
  font-weight: 700;
}

.bet-qty-num {
  min-width: 22px;
  font-weight: 700;
  font-size: 14px;
  color: var(--dm-gold-bright);
}

.decision-banner {
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-md);
  padding: 20px;
  text-align: center;
  margin-top: 14px;
  animation: bannerPop 0.3s cubic-bezier(0.2, 1.25, 0.4, 1);
}

.decision-banner--win {
  background: linear-gradient(180deg, rgba(24, 68, 52, 0.92) 0%, rgba(13, 38, 29, 0.95) 100%);
  border-color: rgba(102, 199, 188, 0.55);
  color: #f0fff8;
}

.decision-banner--loss {
  background: linear-gradient(180deg, rgba(84, 24, 34, 0.92) 0%, rgba(46, 13, 19, 0.95) 100%);
  border-color: rgba(209, 86, 104, 0.5);
  color: #fff0f2;
}

.decision-banner--tie {
  background: linear-gradient(180deg, rgba(33, 54, 84, 0.92) 0%, rgba(19, 32, 51, 0.95) 100%);
  border-color: rgba(128, 178, 240, 0.45);
  color: #eef6ff;
}

.decision-banner h2 {
  margin: 0 0 8px;
  font-size: 21px;
  color: var(--dm-gold-bright);
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

@keyframes bannerPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.sum21-meter {
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.sum21-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dm-teal), var(--dm-teal-glow));
  transition: width 0.35s ease;
}

.sum21-meter-fill--warn { background: linear-gradient(90deg, var(--dm-gold), var(--dm-ember)); }
.sum21-meter-fill--perfect { background: linear-gradient(90deg, var(--dm-gold-bright), var(--dm-teal-glow)); }
.sum21-meter-fill--bust { background: linear-gradient(90deg, var(--dm-crimson-bright), #7a1c28); }

/* ==========================================================================
   RELIQUARY INVENTORY, STATS, PROFILE & CHARTS
   ========================================================================== */

.rare-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
}

.rare-inv-card {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease;
}

.rare-inv-card:hover {
  border-color: var(--dm-line-strong);
  background: var(--dm-surface-3);
  transform: translateY(-2px);
}

.rare-inv-card img {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}

.rare-count-badge {
  background: rgba(207, 163, 73, 0.15);
  color: var(--dm-gold-bright);
  font-weight: 700;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 99px;
}

.rare-placed-tag {
  background: rgba(125, 87, 194, 0.22);
  color: #d9c7ff;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
}

.stat-card {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-sm);
  padding: 12px 10px;
  text-align: center;
}

.stat-card-label {
  font-size: 11.5px;
  color: var(--dm-text-muted);
  margin-bottom: 4px;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--dm-parchment);
}

.stat-card-value--pos { color: #7ae0c2; }
.stat-card-value--neg { color: #f08696; }

/* Profile Hero & Discrete Charts */
.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

@media (max-width: 720px) {
  .profile-hero {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
}

.profile-avatar-lg {
  width: 74px;
  height: 74px;
  background: var(--dm-surface-recess);
  border: 2px solid var(--dm-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-lg img {
  width: 60px;
  height: 60px;
}

.title-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(207, 163, 73, 0.16);
  color: var(--dm-gold-bright);
  border: 1px solid rgba(207, 163, 73, 0.45);
  border-radius: 99px;
  padding: 3px 11px;
  font-size: 11.5px;
  font-weight: 700;
}

.chart-panel {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 14px 16px;
}

.chart-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 78px;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12.5px;
}

.chart-bar-track {
  height: 10px;
  background: var(--dm-surface-recess);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--dm-teal), var(--dm-gold));
  transition: width 0.35s ease;
}

.chart-bar-fill--win { background: #3da88a; border-radius: 0; }
.chart-bar-fill--loss { background: #c24b5d; border-radius: 0; }
.chart-bar-fill--tie { background: #5a82bd; border-radius: 0; }

/* ==========================================================================
   ACHIEVEMENTS & DAILY QUESTS
   ========================================================================== */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.ach-card {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.ach-card--unlocked {
  border-color: rgba(207, 163, 73, 0.55);
  background: linear-gradient(180deg, rgba(46, 38, 28, 0.6) 0%, var(--dm-surface-2) 100%);
}

.ach-progress-track {
  height: 7px;
  background: var(--dm-surface-recess);
  border-radius: 99px;
  overflow: hidden;
}

.ach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dm-teal), var(--dm-gold));
  border-radius: 99px;
  transition: width 0.3s ease;
}

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

.quest-card {
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quest-card--done {
  border-color: rgba(102, 199, 188, 0.45);
  background: rgba(22, 54, 48, 0.34);
}

/* ==========================================================================
   RARE COLLECTION BOOK (GOTHIC FANTASY GRIMOIRE)
   ========================================================================== */

.book-banner {
  background: linear-gradient(135deg, #211a2c 0%, #161826 100%);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-md);
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.book-entry {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}

.book-entry:hover {
  transform: translateY(-2px);
  border-color: var(--dm-line-strong);
  background: var(--dm-surface-3);
}

.book-entry--owned {
  border-color: rgba(207, 163, 73, 0.42);
}

.book-entry--missing {
  opacity: 0.72;
  background: var(--dm-surface-recess);
}

.book-entry--missing .book-art-wrap img {
  filter: brightness(0.18) saturate(0.2) contrast(1.2);
}

.book-art-wrap {
  width: 82px;
  height: 82px;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(207, 163, 73, 0.12) 0%, var(--dm-surface-recess) 75%);
  border: 1px solid var(--dm-line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-art-wrap img {
  width: 62px;
  height: 62px;
}

/* Modal for Item Details & History */
.dm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(5, 7, 14, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: dmViewFade 0.16s ease-out;
}

.dm-modal {
  background: var(--dm-surface-1);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.dm-modal-header {
  padding: 14px 18px;
  background: var(--dm-surface-2);
  border-bottom: 1px solid var(--dm-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dm-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   TABLES, TAGS & NOTICES
   ========================================================================== */

.dm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--dm-surface-recess);
  border-radius: var(--dm-radius-sm);
  overflow: hidden;
  color: var(--dm-text);
}

.dm-table th {
  background: var(--dm-surface-2);
  color: var(--dm-gold-bright);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--dm-line);
  font-family: var(--font-display);
  font-size: 12.5px;
}

.dm-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--dm-line);
}

.dm-table tr:last-child td {
  border-bottom: none;
}

.dm-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.tag-win {
  background: rgba(34, 102, 82, 0.32);
  color: #84e6cb;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

.tag-loss {
  background: rgba(143, 38, 54, 0.34);
  color: #ffa3af;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

.tag-tie {
  background: rgba(54, 92, 148, 0.32);
  color: #a8ceff;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 1.45s linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(540deg); opacity: 0; }
}

.combo-cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.combo-cheat-item {
  background: rgba(10, 12, 20, 0.72);
  border: 1px solid var(--dm-line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}

.combo-cheat-item strong { color: var(--dm-gold-bright); }

.notice-error {
  background: rgba(122, 33, 48, 0.28);
  color: #ffc0c9;
  border: 1px solid rgba(201, 70, 90, 0.45);
  border-radius: var(--dm-radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
}

.notice-info {
  background: rgba(34, 62, 88, 0.28);
  color: #d2e8ff;
  border: 1px solid rgba(90, 142, 194, 0.38);
  border-radius: var(--dm-radius-sm);
  padding: 10px 13px;
  font-size: 13px;
}

.notice-ok {
  background: rgba(24, 78, 60, 0.32);
  color: #b4f5e0;
  border: 1px solid rgba(86, 188, 150, 0.42);
  border-radius: var(--dm-radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
}

/* ==========================================================================
   THE RARE MERCHANT (CLEAN EXCLUSIVE SHOWCASE)
   ========================================================================== */

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
}

.catalog-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
}

.catalog-item-card {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}

.catalog-item-card:hover {
  transform: translateY(-3px);
  border-color: var(--dm-line-strong);
  background: var(--dm-surface-3);
}

.catalog-item-card--ultra {
  border-color: rgba(207, 163, 73, 0.45);
}

.catalog-item-card--ltd {
  border-color: rgba(155, 114, 232, 0.55);
  background: linear-gradient(180deg, #221938 0%, var(--dm-surface-2) 100%);
}

.catalog-item-card--soldout {
  opacity: 0.62;
}

.catalog-item-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.catalog-item-icon {
  width: 92px;
  height: 92px;
  background: radial-gradient(circle, rgba(207, 163, 73, 0.12) 0%, var(--dm-surface-recess) 74%);
  border: 1px solid var(--dm-line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
}

.catalog-item-card--ltd .catalog-item-icon {
  background: radial-gradient(circle, rgba(155, 114, 232, 0.22) 0%, var(--dm-surface-recess) 74%);
  border-color: rgba(155, 114, 232, 0.45);
}

.catalog-item-icon img {
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.rarity-pill {
  display: inline-block;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ==========================================================================
   PLAYER HOMES (TOP-DOWN COZY FANTASY INTERIORS & DIRECTORY)
   ========================================================================== */

.room-layout-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  .room-layout-grid {
    grid-template-columns: 1fr;
  }
}

.room-stage-wrap {
  background: #0a0c14;
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-md);
  overflow: hidden;
  position: relative;
}

.room-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
}

.room-mode-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(11, 13, 22, 0.9);
  color: var(--dm-gold-bright);
  border: 1px solid rgba(207, 163, 73, 0.5);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
  z-index: 4;
}

.room-sidebar-panel {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-inv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 2px;
}

.room-inv-item {
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--dm-parchment);
  transition: transform 0.1s ease, border-color 0.14s ease;
}

.room-inv-item:hover {
  border-color: var(--dm-line-strong);
  transform: translateY(-1px);
}

.room-inv-item--active {
  border-color: var(--dm-gold-bright);
  background: #241e16;
}

.room-inv-item img {
  width: 38px;
  height: 38px;
}

.room-trophy-inspector {
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.room-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.room-dir-card {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.room-dir-card:hover {
  transform: translateY(-2px);
  border-color: var(--dm-line-strong);
  background: var(--dm-surface-3);
}

.room-dir-card--own {
  border-color: rgba(207, 163, 73, 0.55);
  background: linear-gradient(180deg, rgba(44, 35, 22, 0.65) 0%, var(--dm-surface-2) 100%);
}

.room-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

.room-theme-card {
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  background: var(--dm-surface-recess);
  color: var(--dm-parchment);
  text-align: center;
  transition: transform 0.08s ease, border-color 0.14s ease;
}

.room-theme-card:hover {
  border-color: var(--dm-line-strong);
}

.room-theme-card--selected {
  border-color: var(--dm-gold-bright);
  background: #241e16;
}

.room-theme-swatch {
  height: 22px;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* Clean Dark Inputs & Selects */
.dm-input, .dm-select {
  background: var(--dm-surface-recess);
  color: var(--dm-parchment);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-sm);
  padding: 8px 11px;
  font-size: 13px;
}

.dm-input {
  flex: 1;
}

.dm-input:focus, .dm-select:focus {
  outline: none;
  border-color: var(--dm-gold-bright);
  box-shadow: 0 0 0 2px rgba(207, 163, 73, 0.2);
}

/* ==========================================================================
   RESPONSIVE REFINEMENTS
   ========================================================================== */

@media (max-width: 720px) {
  .dm-topbar {
    padding: 8px 12px;
  }
  .dm-shell {
    padding: 0 10px;
    margin-top: 14px;
  }
  .dm-window-body {
    padding: 14px;
  }
  .dm-cup-slot {
    width: 78px;
    min-height: 98px;
  }
  .dm-cup-dome {
    width: 72px;
    height: 72px;
  }
  .dice-tray {
    gap: 12px;
  }
}


/* ==========================================================================
   CASINO QUALITY POLISH — CLEANER HIERARCHY, FELT BOARD, CUPS, TOURNAMENTS & LEADERBOARD
   ========================================================================== */

.dealer-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dealer-name-row strong {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--dm-gold-bright);
}

.dealer-sub-meta {
  font-size: 12px;
  color: var(--dm-text-muted);
  margin-top: 2px;
}

.dealer-sub-meta b {
  color: #7ae0c2;
}

/* Unified Casino Status & Inline Pot Strip */
.casino-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--dm-radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(10, 12, 20, 0.62);
  border-left: 3px solid var(--dm-line-strong);
  color: #e4dccb;
}

.casino-status-bar--player {
  border-left-color: var(--dm-gold-bright);
  background: rgba(207, 163, 73, 0.13);
  color: var(--dm-gold-bright);
}

.casino-status-bar--dealer {
  border-left-color: var(--dm-teal-glow);
  background: rgba(52, 138, 132, 0.16);
  color: #aef2ea;
}

.casino-status-bar--win {
  border-left-color: #66d9b0;
  background: rgba(24, 78, 58, 0.28);
  color: #c8fce8;
}

.casino-status-bar--loss {
  border-left-color: #e06577;
  background: rgba(112, 28, 42, 0.28);
  color: #ffd3da;
}

.casino-status-bar--tie {
  border-left-color: #7eaef0;
  background: rgba(38, 66, 108, 0.28);
  color: #d4e7ff;
}

.casino-pot-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.casino-pot-chip {
  font-size: 12px;
  background: rgba(9, 11, 18, 0.72);
  border: 1px solid var(--dm-line);
  border-radius: 99px;
  padding: 3px 10px;
  color: var(--dm-parchment);
}

.casino-pot-chip--gold {
  border-color: rgba(207, 163, 73, 0.55);
  color: var(--dm-gold-bright);
}

/* Integrated Felt Table Board (Fewer Nested Borders, Clear Dealer/Player Split) */
.casino-felt-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: rgba(7, 10, 14, 0.34);
  border: 1px solid rgba(207, 163, 73, 0.24);
  border-radius: var(--dm-radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 232, 180, 0.08), inset 0 12px 32px rgba(0, 0, 0, 0.34);
  margin-bottom: 14px;
}

.casino-felt-board .dice-zone {
  margin-bottom: 0;
  border-color: rgba(235, 224, 200, 0.07);
}

.dice-zone--winner {
  border-color: rgba(102, 217, 176, 0.72) !important;
  background: rgba(20, 68, 52, 0.38) !important;
  box-shadow: 0 0 24px rgba(102, 217, 176, 0.22), inset 0 0 24px rgba(240, 208, 126, 0.08);
  animation: dmWinZonePulse 1.1s ease-out 1;
}

.dice-zone--loser {
  opacity: 0.8;
}

.dice-zone--tie {
  border-color: rgba(126, 174, 240, 0.55) !important;
  box-shadow: 0 0 16px rgba(126, 174, 240, 0.16);
}

@keyframes dmWinZonePulse {
  0%   { box-shadow: 0 0 0 rgba(240, 208, 126, 0.0); }
  45%  { box-shadow: 0 0 34px rgba(240, 208, 126, 0.45); }
  100% { box-shadow: 0 0 24px rgba(102, 217, 176, 0.22); }
}

.hand-badge--muted {
  opacity: 0.65;
  border-color: var(--dm-line);
  color: var(--dm-text-muted);
}

/* Enhanced Runed Cup Golden Sparkle Burst */
.dm-cup-sparkle {
  position: absolute;
  bottom: 54px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8d6 0%, #f0d07e 60%, transparent 100%);
  box-shadow: 0 0 8px rgba(240, 208, 126, 0.9);
  pointer-events: none;
  z-index: 6;
  animation: dmSparkleBurst 0.5s ease-out forwards;
}

@keyframes dmSparkleBurst {
  0%   { transform: translate(-50%, 0) scale(1.1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--sx, 14px)), var(--sy, -22px)) scale(0.15); opacity: 0; }
}

/* Dice Poker Hand Comparison & Side-by-Side Cash Out / Double Cards */
.poker-compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: rgba(8, 10, 18, 0.56);
  border: 1px solid rgba(235, 224, 200, 0.12);
  border-radius: var(--dm-radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .poker-compare-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.poker-compare-side {
  padding: 6px 8px;
  border-radius: 6px;
}

.poker-compare-side--winner {
  background: rgba(207, 163, 73, 0.14);
  border: 1px solid rgba(207, 163, 73, 0.4);
}

.poker-compare-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--dm-text-muted);
}

.poker-compare-hand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--dm-gold-bright);
  margin-top: 2px;
}

.poker-compare-detail {
  font-size: 12px;
  color: #d6ccb8;
}

.poker-compare-vs {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
  white-space: nowrap;
}

.cmp-result--win  { background: rgba(34, 102, 82, 0.45); color: #9cf5da; }
.cmp-result--loss { background: rgba(143, 38, 54, 0.45); color: #ffb3be; }
.cmp-result--tie  { background: rgba(54, 92, 148, 0.45); color: #bcd9ff; }

.poker-tiebreaker-note {
  font-size: 12.5px;
  color: #e6dcc8;
  margin-bottom: 6px;
}

.poker-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
  text-align: left;
}

@media (max-width: 640px) {
  .poker-choice-grid {
    grid-template-columns: 1fr;
  }
}

.poker-choice-card {
  background: rgba(9, 12, 20, 0.7);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-sm);
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.poker-choice-card--safe { border-color: rgba(102, 199, 188, 0.35); }
.poker-choice-card--risk { border-color: rgba(207, 163, 73, 0.42); }

.poker-choice-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--dm-gold-bright);
}

.poker-choice-desc {
  font-size: 12px;
  color: #cfc6b6;
  line-height: 1.45;
}

.combo-rules-drawer {
  margin-top: 14px;
  background: rgba(10, 12, 20, 0.65);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 12px 14px;
}

.combo-cheat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.combo-cheat-item span {
  color: #cfc6b6;
  font-size: 11.5px;
}

/* Dice 21 Distance-to-21 Pill, Delta Pop, Scale & Action Bar */
.d21-dist-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--dm-line);
}

.d21-dist--neutral { background: rgba(12, 15, 24, 0.7); color: var(--dm-text-muted); }
.d21-dist--safe    { background: rgba(24, 78, 60, 0.38); border-color: rgba(102, 199, 188, 0.4); color: #9ef0dc; }
.d21-dist--warn    { background: rgba(138, 84, 24, 0.4); border-color: rgba(245, 170, 86, 0.55); color: #ffe0ad; }
.d21-dist--perfect { background: rgba(196, 150, 48, 0.32); border-color: var(--dm-gold-bright); color: #fff4c2; }
.d21-dist--bust    { background: rgba(128, 26, 42, 0.48); border-color: #e06577; color: #ffd4db; }

.d21-delta-pop {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(207, 163, 73, 0.25);
  color: var(--dm-gold-bright);
  font-size: 12px;
  animation: comboRevealPop 0.4s ease-out;
}

.sum21-meter-wrap {
  margin-top: 8px;
}

.sum21-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--dm-text-muted);
  margin-top: 3px;
  padding: 0 2px;
}

.d21-action-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 240px));
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 560px) {
  .d21-action-bar {
    grid-template-columns: 1fr;
  }
}

.d21-act-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 18px;
}

.d21-act-btn small {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
}

.d21-act-btn--ready {
  box-shadow: 0 0 16px rgba(240, 208, 126, 0.25);
}

/* Tri-High / Tri-Low Live Duel Scoreboard */
.tri-duel-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(9, 11, 18, 0.62);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-sm);
}

.tri-duel-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.tri-duel-box--winner {
  background: rgba(207, 163, 73, 0.18);
  border: 1px solid rgba(207, 163, 73, 0.55);
}

.tri-duel-who {
  font-size: 12.5px;
  color: #dcd3c2;
  font-weight: 600;
}

.tri-duel-score {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--dm-gold-bright);
}

.tri-duel-mode {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--dm-text-muted);
  text-align: center;
}

.duel-score-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 6px;
}

.duel-score-sep {
  color: var(--dm-text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

/* Streamlined Bet Builder Refinements */
.bet-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.bet-npc-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bet-toolbar-label {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--dm-gold-bright);
}

.npc-style-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(125, 87, 194, 0.24);
  border: 1px solid rgba(154, 118, 224, 0.42);
  color: #e4d8ff;
}

.bet-quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bet-summary-sub {
  font-size: 11.5px;
  color: var(--dm-text-muted);
  font-family: var(--font-ui);
  font-weight: 400;
}

.bet-rare-slot {
  position: relative;
  cursor: pointer;
}

.bet-rare-slot:hover:not(.bet-rare-slot--empty) {
  border-color: var(--dm-line-strong);
  background: var(--dm-surface-2);
}

.bet-rare-slot--empty {
  opacity: 0.48;
  cursor: default;
}

.bet-rare-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--dm-gold);
  color: #161004;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

.bet-rare-name {
  font-size: 11.5px;
  color: var(--dm-parchment);
}

.bet-rare-meta {
  font-size: 10.5px;
  color: var(--dm-text-muted);
}

.bet-rare-meta b {
  color: var(--dm-gold-bright);
}

.bet-match-preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  background: rgba(24, 78, 60, 0.26);
  border: 1px solid rgba(86, 188, 150, 0.36);
  border-radius: var(--dm-radius-sm);
  padding: 10px 14px;
}

@media (max-width: 640px) {
  .bet-match-preview {
    grid-template-columns: 1fr;
  }
  .bet-match-vs { display: none; }
}

.bet-match-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.bet-match-heading--player { color: #9cf2c8; }
.bet-match-heading--npc    { color: var(--dm-gold-bright); }
.bet-match-vs { font-size: 18px; color: var(--dm-gold-bright); font-weight: 700; }

.bet-confirm-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

/* Casino Tournaments UI */
.trn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.trn-card {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line-strong);
  border-radius: var(--dm-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.trn-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trn-card-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trn-card h3 {
  font-size: 16px;
  color: var(--dm-gold-bright);
}

.trn-card-sub {
  font-size: 11.5px;
  color: var(--dm-text-muted);
  margin-top: 2px;
}

.trn-card-desc {
  margin: 0;
  font-size: 12.5px;
  color: #ccc3b2;
  line-height: 1.45;
}

.trn-rounds-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trn-round-chip {
  font-size: 11px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: 99px;
  padding: 3px 9px;
  color: #d9d0be;
}

.trn-prize-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--dm-surface-recess);
  border-radius: var(--dm-radius-sm);
  padding: 9px 10px;
  text-align: center;
}

.trn-prize-strip span {
  display: block;
  font-size: 10.5px;
  color: var(--dm-text-muted);
}

.trn-prize-strip strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--dm-parchment);
}

.trn-progress-meta {
  font-size: 12px;
  color: var(--dm-text-muted);
  margin-top: 2px;
}

.trn-bracket-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trn-bracket-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(11, 13, 21, 0.72);
  border: 1px solid var(--dm-line);
  border-radius: 6px;
  font-size: 12.5px;
}

.trn-bracket-item--player {
  border-color: rgba(207, 163, 73, 0.45);
  background: rgba(42, 34, 22, 0.48);
}

.trn-bracket-round {
  font-size: 11px;
  font-weight: 700;
  color: var(--dm-gold-bright);
  text-transform: uppercase;
}

.trn-bracket-winner {
  font-weight: 700;
  color: #84e6cb;
}

/* Leaderboard & History Filter Bar */
.lb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
}

.lb-row--player td {
  background: rgba(207, 163, 73, 0.1) !important;
}


/* ==========================================================================
   ADMIN CONTROL PANEL
   ========================================================================== */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 820px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-panel {
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-md);
  padding: 16px;
}

.admin-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.admin-stack-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-rare-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 150px;
}

.admin-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dm-text-muted);
}

.admin-rare-action-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-pack-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  padding: 10px 12px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius-sm);
}

.admin-quick-rare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.admin-rare-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dm-surface-recess);
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 7px 9px;
}

.admin-rare-chip img {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.admin-rare-chip-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.admin-rare-chip-info strong {
  font-size: 12px;
  color: var(--dm-parchment);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-rare-chip-info span {
  font-size: 11px;
  color: var(--dm-text-muted);
}

.admin-rare-chip-btns {
  display: inline-flex;
  gap: 4px;
}


/* Clean Numeric Total Above Dice in Dice 21 */
.dice-zone-header--compact {
  margin-bottom: 4px;
}

.d21-total-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2px 0 4px;
}

.d21-total-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 18px;
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--dm-gold-bright);
  background: rgba(10, 12, 20, 0.78);
  border: 1px solid rgba(207, 163, 73, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.36);
}

.d21-total-num--empty {
  color: var(--dm-text-muted);
  border-color: var(--dm-line);
  opacity: 0.65;
}

.d21-total-num--perfect {
  color: #e6fff5;
  background: rgba(20, 74, 56, 0.85);
  border-color: var(--dm-teal-glow);
  box-shadow: 0 0 18px rgba(102, 199, 188, 0.35);
}

.d21-total-num--bust {
  color: #ffe4e8;
  background: rgba(110, 22, 36, 0.88);
  border-color: #e06577;
  box-shadow: 0 0 16px rgba(224, 101, 119, 0.32);
}
