/* ==========================================================================
   Blackjack CSS - Premium Casino Styling
   ========================================================================== */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('assets/fonts/outfit-latin-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('assets/fonts/playfair-display-latin-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 600 700;
  font-display: swap;
  src: url('assets/fonts/playfair-display-latin-italic-variable.woff2') format('woff2');
}

:root {
  /* Premium Dark Casino Palette */
  --felt-bg: radial-gradient(circle, #073a24 0%, #031c11 100%);
  --felt-border: #145937;
  --gold-primary: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.4);
  --gold-dark: #aa841c;
  
  --ui-bg-glass: rgba(18, 30, 24, 0.7);
  --ui-border-glass: rgba(255, 255, 255, 0.08);
  
  /* Text colors */
  --text-light: #f5f6f5;
  --text-muted: #8c9c93;
  --text-dark: #121e18;
  
  /* Suits colors */
  --suit-red: #ff3366;
  --suit-black: #1a1a1a;
  
  /* Button Colors */
  --color-hit: #00e676;
  --color-stand: #ff1744;
  --color-double: #d500f9;
  --color-split: #2979ff;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Dimensions (Dynamic overlap and font sizing) */
  --card-width: 95px;
  --card-height: 138px;
  --card-overlap: -55px;
  --card-font-size: 1.15rem;
  --card-center-suit-size: 2.2rem;
}

@media (max-width: 600px) {
  :root {
    --card-width: 68px;
    --card-height: 98px;
    --card-overlap: -42px;
    --card-font-size: 0.85rem;
    --card-center-suit-size: 1.3rem;
  }
}

/* ==========================================================================
   Base Elements & Layouts
   ========================================================================== */

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: #0b0d0c;
  color: var(--text-light);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
}

/* ==========================================================================
   Mode Selection Screen
   ========================================================================== */

.mode-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #052b1b;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.mode-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(112deg, transparent 0 3px, rgba(255,255,255,.025) 4px, transparent 5px 9px),
    repeating-linear-gradient(22deg, transparent 0 4px, rgba(0,0,0,.04) 5px, transparent 6px 11px);
}

.mode-screen-is-leaving {
  opacity: 0;
  transform: scale(1.025);
  pointer-events: none;
}

.mode-content {
  position: relative;
  width: min(920px, 100%);
  text-align: center;
}

.welcome-header { margin-bottom: 18px; }

.welcome-emblem {
  position: relative;
  width: 112px;
  height: 72px;
  margin: 0 auto 10px;
}

.welcome-card {
  position: absolute;
  top: 5px;
  width: 42px;
  height: 58px;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 7px;
  color: #14251d;
  background: linear-gradient(145deg, #fffdf4, #dedacb);
  box-shadow: 0 9px 18px rgba(0,0,0,.35);
  font-family: Georgia, serif;
  font-size: .8rem;
  font-weight: 700;
  line-height: .8;
  text-align: left;
}

.welcome-card span { display: block; margin-top: 4px; font-size: .78rem; }
.welcome-card-left { left: 17px; color: #b82337; transform: rotate(-14deg); }
.welcome-card-right { right: 17px; transform: rotate(14deg); }

.welcome-chip {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 17px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px dashed rgba(255,244,189,.78);
  border-radius: 50%;
  color: #fff3bd;
  background: radial-gradient(circle, #b1283b 0 45%, #741725 47% 100%);
  box-shadow: 0 7px 18px rgba(0,0,0,.45), 0 0 20px rgba(212,175,55,.2);
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
  font-weight: 700;
  transform: translateX(-50%);
}

.welcome-title {
  margin: 2px 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3rem, 8vw, 5.4rem);
  font-style: italic;
  font-weight: 700;
  line-height: .9;
  letter-spacing: 0;
  color: #fffdf4;
  text-shadow: 0 4px 0 rgba(0,0,0,.28), 0 12px 30px rgba(0,0,0,.42);
}

.welcome-title-gold {
  color: #edcf67;
  background: linear-gradient(180deg, #fff2ad 5%, #d5aa31 55%, #fff0a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(85,57,4,.38));
}

.mode-welcome {
  margin: 0 auto 16px;
  color: #e8eee9;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  line-height: 1.5;
  letter-spacing: .01em;
}

.mode-brand-compact {
  gap: 15px;
  margin-bottom: 12px;
}

.mode-brand-compact .mode-monogram {
  position: relative;
  width: 68px;
  height: 68px;
  border: 2px solid #d4af37;
  font-size: 1.35rem;
  letter-spacing: .04em;
  color: #f4dc86;
  background: radial-gradient(circle at 38% 30%, rgba(39,112,73,.95), rgba(4,42,26,.98) 72%);
  box-shadow:
    0 8px 22px rgba(0,0,0,.35),
    0 0 28px rgba(212,175,55,.18),
    inset 0 0 0 4px rgba(3,32,20,.65),
    inset 0 0 0 5px rgba(238,204,93,.25);
  text-shadow: 0 2px 8px rgba(0,0,0,.55), 0 0 12px rgba(212,175,55,.25);
}

.mode-brand-compact .mode-suit {
  font-size: 1.2rem;
  color: #e3c866;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
}

.mode-brand-compact .mode-suit-red {
  color: #ee6573;
}

.mode-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--gold-primary);
}

.mode-monogram {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(212,175,55,.65);
  border-radius: 50%;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: inset 0 0 20px rgba(212,175,55,.1), 0 0 25px rgba(212,175,55,.1);
}

.mode-suit { font-size: 1rem; opacity: .7; }
.mode-suit-red { color: #e55161; }
.mode-eyebrow { color: var(--gold-primary); font-size: .72rem; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; }

.mode-content h1:not(.welcome-title) {
  margin-top: 8px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.1rem, 5vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.mode-intro { margin: 14px auto 32px; color: #a7b8ae; font-size: 1rem; line-height: 1.6; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  text-align: left;
}

.mode-grid-single {
  grid-template-columns: minmax(0, 620px);
  justify-content: center;
}

.mode-grid-single .mode-card {
  min-height: 178px;
}

.mode-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 260px;
  padding: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid rgba(212,175,55,.32);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, rgba(18,91,57,.97), rgba(5,46,29,.98));
  box-shadow: 0 22px 46px rgba(0,0,0,.34), inset 0 0 0 5px rgba(2,30,18,.34), inset 0 0 0 6px rgba(212,175,55,.12), inset 0 1px rgba(255,255,255,.1);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.mode-card:hover, .mode-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(235,201,94,.88);
  background: linear-gradient(145deg, rgba(22,106,67,.99), rgba(5,51,31,.99));
  box-shadow: 0 28px 58px rgba(0,0,0,.42), 0 0 30px rgba(212,175,55,.12), inset 0 0 0 5px rgba(2,30,18,.3), inset 0 0 0 6px rgba(235,201,94,.2);
  outline: none;
}

.mode-card:active { transform: translateY(-2px); }

.mode-card-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  top: -100px;
  right: -70px;
  border-radius: 50%;
  background: rgba(212,175,55,.22);
  filter: blur(30px);
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border-radius: 16px;
  color: var(--gold-primary);
  background: rgba(2,31,19,.38);
  border: 1px solid rgba(212,175,55,.42);
  box-shadow: inset 0 0 18px rgba(212,175,55,.08);
}

.mode-icon svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.mode-card-copy { display: flex; flex-direction: column; width: 100%; min-width: 0; }
.mode-card-kicker { color: var(--gold-primary); font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.mode-card-title { margin-top: 5px; font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; }
.mode-card-description { margin-top: 10px; color: #c1d1c8; font-size: .92rem; line-height: 1.55; }
.mode-card-action { margin-top: auto; padding-top: 20px; color: #f2df9c; font-size: .82rem; font-weight: 700; letter-spacing: .04em; }
.mode-card-action span { display: inline-block; margin-left: 5px; transition: transform .2s ease; }
.mode-card:hover .mode-card-action span { transform: translateX(4px); }

.welcome-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 820px;
  margin: 24px auto 0;
  border-top: 1px solid rgba(232,240,235,.16);
  border-bottom: 1px solid rgba(232,240,235,.1);
  text-align: left;
}

.welcome-detail {
  min-width: 0;
  padding: 17px 20px;
  display: flex;
  gap: 12px;
}

.welcome-detail + .welcome-detail { border-left: 1px solid rgba(232,240,235,.12); }
.welcome-detail-index { flex: 0 0 auto; color: #d9b94d; font-size: .64rem; font-weight: 800; }
.welcome-detail div { display: flex; flex-direction: column; gap: 5px; }
.welcome-detail strong { color: #f3e7ba; font-size: .8rem; text-transform: uppercase; }
.welcome-detail div span { color: #aebfb5; font-size: .75rem; line-height: 1.45; }

.mode-feedback { min-height: 20px; margin-top: 22px; color: #8fa39a; font-size: .8rem; }
.mode-footer { display: flex; flex-direction: column; align-items: center; }

.game-is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

@media (max-width: 650px) {
  .mode-screen { display: grid; padding: 12px 14px; }
  .mode-content { margin: auto; }
  .welcome-header { margin-bottom: 13px; }
  .welcome-emblem { width: 90px; height: 57px; margin-bottom: 6px; transform: scale(.82); transform-origin: center bottom; }
  .welcome-title { margin-top: 0; font-size: clamp(2.65rem, 13vw, 3.5rem); }
  .mode-eyebrow { font-size: .6rem; }
  .mode-welcome { max-width: 300px; margin-bottom: 13px; font-size: .98rem; line-height: 1.35; }
  .mode-brand { margin-bottom: 8px; }
  .mode-brand-compact .mode-monogram { width: 58px; height: 58px; font-size: 1.15rem; }
  .mode-brand-compact .mode-suit { font-size: 1rem; }
  .mode-intro { margin-bottom: 22px; }
  .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .mode-card, .mode-grid-single .mode-card { min-height: 142px; padding: 15px 18px; }
  .mode-icon { width: 40px; height: 40px; margin-bottom: 8px; border-radius: 12px; }
  .mode-icon svg { width: 24px; height: 24px; }
  .mode-card-kicker { font-size: .57rem; }
  .mode-card-title { margin-top: 2px; font-size: 1.38rem; }
  .mode-card-description { margin-top: 4px; font-size: .78rem; line-height: 1.35; }
  .mode-card-action { padding-top: 8px; font-size: .7rem; }
  .welcome-details { grid-template-columns: 1fr; margin-top: 12px; }
  .welcome-detail { padding: 8px 4px; gap: 9px; }
  .welcome-detail + .welcome-detail { border-left: 0; border-top: 1px solid rgba(232,240,235,.1); }
  .welcome-detail strong { font-size: .7rem; }
  .welcome-detail div span { font-size: .68rem; line-height: 1.3; }
  .mode-feedback { min-height: 12px; margin-top: 5px; font-size: .68rem; }
}

@media (max-width: 650px) and (max-height: 600px) {
  .welcome-emblem, .mode-eyebrow { display: none; }
  .welcome-title { font-size: 2.35rem; }
  .welcome-header { margin-bottom: 7px; }
  .mode-welcome { margin-bottom: 8px; }
  .mode-card, .mode-grid-single .mode-card { min-height: 118px; }
  .welcome-detail { padding-block: 5px; }
  .welcome-detail div span { display: none; }
}

@media (max-height: 700px) and (min-width: 651px) {
  .mode-screen { padding-block: 18px; }
  .mode-brand { margin-bottom: 10px; }
  .mode-monogram { width: 46px; height: 46px; }
  .mode-intro { margin: 8px auto 18px; }
  .mode-card, .mode-grid-single .mode-card { min-height: 168px; padding: 20px 22px; }
  .mode-icon { margin-bottom: 15px; }
  .mode-feedback { margin-top: 12px; }
}

/* Opening experience */
.mode-screen {
  display: block;
  padding: 0;
  background: #061b12;
  isolation: isolate;
}

.mode-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #061b12 url('assets/images/blackjack-welcome.webp') center 60% / cover no-repeat;
}

.mode-screen::before {
  z-index: -1;
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(2,15,10,.92) 0%, rgba(2,19,12,.74) 46%, rgba(2,15,10,.38) 100%),
    linear-gradient(180deg, rgba(1,10,7,.66) 0%, transparent 38%, rgba(1,10,7,.76) 100%);
}

.mode-content {
  width: min(1180px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 34px max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  text-align: left;
}

.welcome-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fffdf4;
}

.welcome-wordmark-chip {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px dashed #f5dd84;
  border-radius: 50%;
  color: #fff5c8;
  background: #8f2032;
  font-family: Georgia, serif;
  font-size: .86rem;
  font-weight: 700;
  box-shadow: 0 7px 18px rgba(0,0,0,.36);
}

.welcome-wordmark > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.welcome-wordmark strong { font-size: .82rem; letter-spacing: .13em; }
.welcome-wordmark small { margin-top: 4px; color: #d9bd5e; font-size: .55rem; letter-spacing: .28em; }

.menu-audio-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  color: #f4e5ae;
  background: rgba(2,20,12,.58);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.menu-audio-btn:hover, .menu-audio-btn:focus-visible { border-color: #e2c45e; background: rgba(8,47,29,.88); outline: none; transform: translateY(-1px); }
.menu-audio-btn.is-muted { color: #95a69d; }
.menu-audio-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.welcome-header {
  align-self: center;
  width: min(670px, 68vw);
  margin: 30px 0 20px;
}

.mode-eyebrow {
  color: #e4c65d;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.welcome-title {
  max-width: 650px;
  margin: 15px 0 18px;
  font-size: clamp(3.7rem, 7.4vw, 6.7rem);
  font-style: normal;
  line-height: .9;
  text-shadow: 0 6px 26px rgba(0,0,0,.62);
}

.welcome-title span { display: block; }

.mode-welcome {
  max-width: 560px;
  margin: 0 0 27px;
  color: #d8e1dc;
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem;
  line-height: 1.55;
}

.welcome-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 186px;
  min-height: 54px;
  padding: 14px 24px;
  border: 1px solid #ffe59a;
  border-radius: 6px;
  color: #182016;
  background: linear-gradient(180deg, #f5dc83, #cba336);
  box-shadow: 0 12px 28px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.55);
  font: 800 .92rem 'Outfit', sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

.welcome-play-btn:hover, .welcome-play-btn:focus-visible { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 16px 34px rgba(0,0,0,.42); outline: none; }
.welcome-play-btn:active { transform: translateY(0); }
.welcome-play-btn svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; }

.welcome-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.welcome-quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 25px;
  color: #bdcbc3;
  font-size: .72rem;
  text-transform: uppercase;
}

.welcome-quick-facts span { padding: 0 16px; border-left: 1px solid rgba(255,255,255,.2); }
.welcome-quick-facts span:first-child { padding-left: 0; border-left: 0; }
.welcome-quick-facts strong { margin-right: 4px; color: #f3d774; font-size: .86rem; }

.welcome-details {
  max-width: 620px;
  width: min(100%, 620px);
  margin: 0;
  border-color: rgba(232,240,235,.18);
  background: rgba(2,17,11,.38);
}

.welcome-detail {
  min-height: 50px;
  padding: 12px 16px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}

.welcome-detail svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #d9bb53;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-detail strong { color: #fff4c8; font-size: .7rem; letter-spacing: .05em; white-space: nowrap; }

.mode-footer {
  min-height: 44px;
  padding-top: 10px;
  flex-direction: row;
  justify-content: center;
}

.mode-feedback { min-height: 0; margin: 0; }

@media (max-width: 650px) {
  .mode-content {
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 18px max(12px, env(safe-area-inset-bottom));
  }

  .welcome-wordmark-chip { width: 37px; height: 37px; }
  .menu-audio-btn { width: 39px; height: 39px; }
  .welcome-header { width: 100%; margin: 22px 0 18px; text-align: center; }
  .mode-eyebrow { font-size: .58rem; }
  .welcome-title { margin: 12px auto 15px; font-size: clamp(3.15rem, 17vw, 4.8rem); }
  .mode-welcome { max-width: 420px; margin: 0 auto 21px; font-size: .88rem; line-height: 1.45; }
  .welcome-play-btn { min-width: min(240px, 78vw); min-height: 52px; }
  .welcome-actions { flex-direction: column; align-items: center; }
  .welcome-quick-facts { justify-content: center; margin-top: 20px; font-size: .61rem; }
  .welcome-quick-facts span { padding: 0 9px; }
  .welcome-quick-facts strong { font-size: .72rem; }
  .welcome-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .welcome-detail { min-height: 46px; padding: 9px 4px; gap: 6px; }
  .welcome-detail + .welcome-detail { border-top: 0; border-left: 1px solid rgba(232,240,235,.1); }
  .welcome-detail svg { width: 17px; height: 17px; }
  .welcome-detail strong { font-size: .58rem; }
  .mode-footer { min-height: 38px; padding-top: 6px; }
}

@media (max-width: 650px) and (max-height: 650px) {
  .welcome-header { margin-block: 12px; }
  .mode-eyebrow { display: block; }
  .welcome-title { font-size: 2.75rem; }
  .mode-welcome { margin-bottom: 14px; font-size: .78rem; }
  .welcome-play-btn { min-height: 45px; padding-block: 10px; }
  .welcome-quick-facts { margin-top: 12px; }
  .welcome-detail { padding-block: 6px; }
}

@media (min-width: 651px) and (max-height: 700px) {
  .welcome-header { margin-block: 16px; }
  .welcome-title { font-size: 4.2rem; }
  .welcome-details { margin: 0; }
}

.game-container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--felt-bg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8),
              inset 0 0 100px rgba(0,0,0,0.5);
  border: 12px solid #2d261e; /* Classic wooden bumper border */
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

/* Keep the compact framed table in the packaged app, while the browser build
   uses every available desktop pixel. */
.native-app .game-container {
  max-width: 1024px;
  max-height: 800px;
}

.web-app .game-container {
  max-width: none;
  max-height: none;
  border: none;
  border-radius: 0;
}

@media (min-width: 1200px) and (min-height: 850px) {
  .web-app {
    --card-width: clamp(105px, 6.25vw, 120px);
    --card-height: clamp(152px, 9vw, 174px);
    --card-overlap: clamp(-68px, -3.55vw, -58px);
    --card-font-size: 1.3rem;
    --card-center-suit-size: 2.55rem;
  }

  .web-app .game-header {
    height: 82px;
    padding-inline: clamp(28px, 3vw, 58px);
  }

  .web-app .blackjack-table {
    padding: 30px clamp(28px, 3vw, 58px);
  }

  .web-app .game-footer {
    padding: 20px;
  }
}

@media (max-width: 1024px) {
  .game-container {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border: none;
    border-radius: 0;
  }
}

/* Tablet (iPad) aspect-ratio and spacing optimization to prevent overlaps */
@media (min-width: 601px) and (max-width: 1024px) {
  :root {
    --card-width: 80px;
    --card-height: 116px;
    --card-overlap: -48px;
    --card-font-size: 1rem;
    --card-center-suit-size: 1.8rem;
  }

  .betting-circle-container {
    top: 43%;
  }
}

/* ==========================================================================
   Header Elements (HUD)
   ========================================================================== */

.game-header {
  height: 70px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ui-border-glass);
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.brand-subtitle {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--text-muted);
}

.bankroll-container {
  display: flex;
  gap: 16px;
}

.hud-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
  transition: transform var(--transition-fast);
}

.hud-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.hud-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.hud-value {
  font-size: 1.28rem;
  font-weight: 700;
  color: #fff;
}

#balance-display {
  color: #00ff88;
}

#bet-display {
  color: var(--gold-primary);
}

.header-buttons {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--gold-primary);
  color: var(--text-dark);
  box-shadow: 0 0 10px var(--gold-glow);
  transform: translateY(-2px);
}

.icon-btn:active {
  transform: translateY(0);
}

.exit-btn:hover {
  background: #d83a4d;
  color: #fff;
  box-shadow: 0 0 10px rgba(216, 58, 77, 0.45);
}

.exit-modal-card {
  max-width: 430px;
}

.exit-modal-body p {
  color: #d5e2da;
  line-height: 1.5;
}

.btn-danger {
  background: #c92f43;
  border-color: #e04a5e;
  color: #fff;
}

.btn-danger:hover {
  background: #df3b50;
}

/* ==========================================================================
   Casino Table Felts & Markings
   ========================================================================== */

.blackjack-table {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 20px;
  overflow: hidden;
}

.felt-markings {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  opacity: 0.12;
}

.table-info-panel {
  position: absolute;
  top: 18px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  border: 1px solid rgba(243, 224, 152, 0.14);
  border-radius: 6px;
  background: rgba(5, 20, 12, 0.22);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  opacity: 0.78;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.table-bankroll-panel {
  left: 22px;
  align-items: flex-start;
}

.table-guide-toggle {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 4;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(219,236,223,.24);
  border-radius: 6px;
  color: rgba(219,236,223,.72);
  background: rgba(5,20,12,.38);
  font: 800 .68rem 'Outfit', sans-serif;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.table-guide-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.table-guide-toggle:hover,
.table-guide-toggle:focus-visible {
  color: #fff;
  border-color: rgba(243,224,152,.58);
  outline: none;
}

.table-guide-toggle.is-active {
  color: #f3df96;
  border-color: rgba(243,224,152,.42);
  background: rgba(79,61,13,.34);
}

.guide-toggle-state {
  min-width: 22px;
  color: #91a49a;
  font-size: .58rem;
  text-align: left;
}

.table-guide-toggle.is-active .guide-toggle-state { color: #7ce2a8; }

.table-info-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.table-info-label {
  min-width: 43px;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(219, 236, 223, 0.62);
}

.table-info-value {
  font-size: 0.94rem;
  font-weight: 800;
  color: rgba(245, 222, 145, 0.84);
  text-shadow: none;
}

.table-info-line-muted {
  opacity: 0.76;
}

.marking-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.marking-rules, .marking-insurance, .marking-limit {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(255,255,255,0.2);
  padding-bottom: 4px;
}

.marking-insurance {
  font-size: 1rem;
  color: var(--gold-primary);
  border-bottom: none;
}

.marking-limit {
  border-bottom: none;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Hands & Card Slots Layout
   ========================================================================== */

.table-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  width: 100%;
}

.dealer-row {
  margin-top: 5px;
}

.player-row {
  margin-bottom: 5px;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 5px;
}

.hand-meta {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 20px;
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.hand-label {
  color: var(--text-muted);
}

.hand-score {
  background: var(--gold-primary);
  color: var(--text-dark);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.05rem;
}

.hand-bet {
  color: #00ff88;
  font-weight: 700;
}

/* Wrapper supporting splitting side-by-side */
.hands-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 40px;
  width: 100%;
  transition: all var(--transition-normal);
}

.player-hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  padding: 8px;
  border-radius: 16px;
  min-width: 150px;
}

/* Dim inactive split hand */
.player-hand:not(.active) {
  opacity: 0.4;
  transform: scale(0.95);
}

.player-hand.active {
  opacity: 1;
  transform: scale(1.03);
}

.player-hand.active::after {
  content: '';
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: -4px;
  right: -4px;
  border: 2px solid var(--gold-primary);
  border-radius: 20px;
  box-shadow: 0 0 15px var(--gold-glow);
  pointer-events: none;
  animation: pulse-border 2s infinite;
}

/* The desktop browser has extra vertical room, but an empty hand should not
   look like a large card box before Deal is pressed. */
.web-app .player-hand:not(:has(.cards-container .card)) {
  padding-block: 0;
}

.web-app .player-hand:not(:has(.cards-container .card)) .cards-container {
  min-height: 0;
}

.web-app .player-hand.active:not(:has(.cards-container .card))::after,
.web-app .player-hand:not(:has(.cards-container .card)) .hand-indicator {
  display: none;
}

.player-hand.result-win,
.player-hand.result-blackjack,
.player-hand.result-lose,
.player-hand.result-push {
  opacity: 1;
  transform: scale(1);
}

.player-hand.result-win::before,
.player-hand.result-blackjack::before,
.player-hand.result-lose::before,
.player-hand.result-push::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 20px;
  pointer-events: none;
  animation: result-glow 0.8s ease-out forwards;
}

.player-hand.result-win::before {
  border: 2px solid #00e676;
  box-shadow: 0 0 22px rgba(0, 230, 118, 0.55);
}

.player-hand.result-blackjack::before {
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 26px rgba(212, 175, 55, 0.7);
}

.player-hand.result-lose::before {
  border: 2px solid #ff1744;
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.5);
}

.player-hand.result-push::before {
  border: 2px solid #b0bec5;
  box-shadow: 0 0 18px rgba(176, 190, 197, 0.35);
}

@keyframes result-glow {
  0% { opacity: 0; transform: scale(0.96); }
  35% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0.85; transform: scale(1); }
}

@keyframes pulse-border {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.hand-indicator {
  position: absolute;
  bottom: -22px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-primary);
  background: var(--text-dark);
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--gold-primary);
  opacity: 0;
  transform: translateY(-5px);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.player-hand.active .hand-indicator {
  opacity: 1;
  transform: translateY(0);
}

/* Cards Container */
.cards-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: var(--card-height);
  width: 100%;
}

/* Overlapping fanned card slots */
.cards-container .card {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
  margin-left: var(--card-overlap);
  transition: transform var(--transition-slow) cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-transition: -webkit-transform var(--transition-slow) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cards-container .card:first-child {
  margin-left: 0;
}

/* ==========================================================================
   Flat Cards Styling
   ========================================================================== */

.card {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
  background: #ffffff;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.05), 0 6px 12px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-slow) cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-transition: -webkit-transform var(--transition-slow) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card.dealt {
  -webkit-animation: card-deal 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
  animation: card-deal 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@-webkit-keyframes card-deal {
  0% {
    opacity: 0;
    -webkit-transform: translate(120px, -80px) rotate(15deg);
  }
  100% {
    opacity: 1;
    -webkit-transform: translate(0) rotate(0);
  }
}

@keyframes card-deal {
  0% {
    opacity: 0;
    transform: translate(120px, -80px) rotate(15deg);
    -webkit-transform: translate(120px, -80px) rotate(15deg);
  }
  100% {
    opacity: 1;
    transform: translate(0) rotate(0);
    -webkit-transform: translate(0) rotate(0);
  }
}

/* Suits customization */
.card.suit-heart, .card.suit-diamond {
  color: var(--suit-red);
}

.card.suit-spade, .card.suit-club {
  color: var(--suit-black);
}

.card-value-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: var(--card-font-size);
  line-height: 1.1;
}

.card-suit-center {
  font-size: var(--card-center-suit-size);
  align-self: center;
  line-height: 1;
}

.card-value-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: var(--card-font-size);
  line-height: 1.1;
  transform: rotate(180deg);
  -webkit-transform: rotate(180deg);
}

/* ==========================================================================
   Overlay Banner & Insurance
   ========================================================================== */

.status-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--gold-primary);
  padding: 14px 40px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--gold-glow);
  text-align: center;
  animation: banner-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes banner-pop {
  0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#game-status-message {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.status-banner.win {
  background: rgba(7, 50, 25, 0.92);
  border-color: #4caf50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(76, 172, 80, 0.5);
}

.status-banner.lose {
  background: rgba(60, 14, 14, 0.92);
  border-color: #f44336;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(244, 67, 54, 0.5);
}

.status-banner.blackjack {
  background: rgba(55, 40, 10, 0.92);
  border-color: var(--gold-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px var(--gold-glow);
}

.status-banner.push {
  background: rgba(35, 35, 35, 0.92);
  border-color: #9e9e9e;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(158, 158, 158, 0.4);
}

.insurance-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fade-in var(--transition-fast) forwards;
}

.insurance-card {
  background: var(--ui-bg-glass);
  border: 1px solid var(--ui-border-glass);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 350px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.insurance-card h3 {
  color: var(--gold-primary);
  margin-bottom: 12px;
}

.insurance-card p {
  font-size: 0.95rem;
  margin-bottom: 24px;
  color: var(--text-light);
}

.insurance-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ==========================================================================
   Buttons Controls Panel (Footer)
   ========================================================================== */

.game-footer {
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--ui-border-glass);
  padding: 16px;
  z-index: 10;
}

.strategy-advice {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  z-index: 12;
  width: min(650px, 100%);
  margin: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(235,201,94,.72);
  border-radius: 14px;
  background:
    radial-gradient(circle at 15% 0%, rgba(43,128,83,.42), transparent 48%),
    linear-gradient(135deg, rgba(8,61,37,.99), rgba(2,31,19,.99));
  box-shadow:
    0 10px 28px rgba(0,0,0,.5),
    0 0 18px rgba(212,175,55,.12),
    inset 0 0 0 3px rgba(3,40,24,.6),
    inset 0 0 0 4px rgba(212,175,55,.12);
  pointer-events: none;
}

.strategy-advice-icon {
  flex: 0 0 auto;
  color: var(--gold-primary);
  font-size: 1rem;
  filter: drop-shadow(0 0 6px rgba(212,175,55,.25));
}

.strategy-advice-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 3px 9px;
}

.strategy-advice-copy strong {
  color: #f3da82;
  font-size: .98rem;
  letter-spacing: .02em;
}

.strategy-advice-copy strong.advice-hit { color: #65e69a; }
.strategy-advice-copy strong.advice-stand { color: #ff7b7b; }
.strategy-advice-copy strong.advice-double { color: #78c7ff; }
.strategy-advice-copy strong.advice-split { color: #e7b5ff; }

.strategy-advice-copy .strategy-win-chance {
  color: #f3da82;
  font-weight: 700;
  white-space: nowrap;
}

.strategy-advice-copy span {
  color: #c2d0c8;
  font-size: .86rem;
}

/* Button general style */
.btn {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: var(--text-dark);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4);
}

.btn-glow {
  animation: btn-glow-pulse 2s infinite alternate;
}

@keyframes btn-glow-pulse {
  0% { box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2); }
  100% { box-shadow: 0 4px 20px rgba(212, 175, 55, 0.5); }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-light);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

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

.btn:focus-visible {
  outline: 3px solid #fff3b0;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.32);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Betting Phase UI */
.betting-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.chips-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Realistic 3D Chips */
.chip {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px dashed #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 10px rgba(0,0,0,0.4),
              inset 0 0 10px rgba(0,0,0,0.3);
  transition: all var(--transition-fast) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chip::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: inherit;
  border: 2px solid rgba(255,255,255,0.4);
}

.chip span {
  z-index: 2;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.7);
}

.chip:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 12px 18px rgba(0,0,0,0.5);
  border-color: #ffffff;
}

.chip:active {
  transform: translateY(-1px) scale(1.02);
}

/* Chip value backgrounds */
.chip-50 { background: #388e3c; }
.chip-100 { background: #1f1f1f; border-color: var(--gold-primary) !important; }
.chip-100 span { color: var(--gold-primary); }
.chip-200 { background: #1976d2; }
.chip-500 { background: #7b1fa2; }

.betting-actions {
  display: flex;
  gap: 12px;
}

/* Playing Action Buttons */
.action-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-action {
  flex: 1;
  max-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-action svg {
  transition: transform var(--transition-fast);
}

.btn-action:hover:not(:disabled) svg {
  transform: scale(1.15);
}

.btn-hit {
  background: linear-gradient(135deg, #00a84a 0%, #007030 100%);
  border: 1px solid #00e676;
  box-shadow: 0 4px 10px rgba(0, 168, 74, 0.2), 0 4px 6px rgba(0,0,0,0.15);
  color: #ffffff;
}

.btn-hit:hover:not(:disabled) {
  background: linear-gradient(135deg, #00c853 0%, #008a34 100%);
  border-color: #00ff88;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.45);
}

.btn-stand {
  background: linear-gradient(135deg, #b71c1c 0%, #7f0000 100%);
  border: 1px solid #ff1744;
  box-shadow: 0 4px 10px rgba(183, 28, 28, 0.2), 0 4px 6px rgba(0,0,0,0.15);
  color: #ffffff;
}

.btn-stand:hover:not(:disabled) {
  background: linear-gradient(135deg, #d50000 0%, #9e0000 100%);
  border-color: #ff5252;
  box-shadow: 0 0 15px rgba(255, 23, 68, 0.45);
}

.btn-double {
  background: linear-gradient(135deg, #7b1fa2 0%, #4a0072 100%);
  border: 1px solid #d500f9;
  box-shadow: 0 4px 10px rgba(123, 31, 162, 0.2), 0 4px 6px rgba(0,0,0,0.15);
  color: #ffffff;
}

.btn-double:hover:not(:disabled) {
  background: linear-gradient(135deg, #aa00ff 0%, #6a00b0 100%);
  border-color: #f50057;
  box-shadow: 0 0 15px rgba(213, 0, 249, 0.45);
}

.btn-split {
  background: linear-gradient(135deg, #0d47a1 0%, #002171 100%);
  border: 1px solid #2979ff;
  box-shadow: 0 4px 10px rgba(13, 71, 161, 0.2), 0 4px 6px rgba(0,0,0,0.15);
  color: #ffffff;
}

.btn-split:hover:not(:disabled) {
  background: linear-gradient(135deg, #2962ff 0%, #0d3cbf 100%);
  border-color: #82b1ff;
  box-shadow: 0 0 15px rgba(41, 121, 255, 0.45);
}

/* Result Controls Panel */
.result-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ==========================================================================
   Modals & Forms Layout
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 35%, rgba(13, 82, 51, 0.24), transparent 48%),
    rgba(0, 8, 5, 0.8);
  -webkit-backdrop-filter: blur(9px) saturate(0.75);
  backdrop-filter: blur(9px) saturate(0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-overlay-top {
  z-index: 10100;
}

.modal-card {
  position: relative;
  background:
    linear-gradient(145deg, rgba(18, 74, 47, 0.98), rgba(5, 35, 22, 0.99) 58%, rgba(3, 25, 16, 0.99));
  border: 1px solid rgba(232, 202, 102, 0.72);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 240, 172, 0.08) inset,
    0 0 36px rgba(212, 175, 55, 0.16);
  width: min(100%, 500px);
  max-width: 500px;
  max-height: 85vh;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform var(--transition-normal);
}

.modal-card::before {
  content: '';
  position: absolute;
  inset: 5px;
  z-index: 2;
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-radius: 17px;
  pointer-events: none;
}

.modal-overlay.hidden .modal-card {
  transform: translateY(20px);
}

.modal-header {
  position: relative;
  padding: 21px 24px 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.23), rgba(0, 0, 0, 0.08));
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: #f5d96f;
  letter-spacing: 0.35px;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.modal-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #b8c9bf;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.close-modal-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 1.55rem;
  line-height: 1;
  color: #e9f1ec;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.close-modal-btn:hover {
  color: #142117;
  background: #e2c45e;
  border-color: #ffe99b;
  transform: rotate(4deg) scale(1.04);
}

.close-modal-btn:focus-visible {
  outline: 3px solid #fff3b0;
  outline-offset: 3px;
}

.modal-body {
  position: relative;
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #edf5f0;
  scrollbar-color: rgba(212, 175, 55, 0.65) rgba(0, 0, 0, 0.18);
}

.confirm-modal-card,
.exit-modal-card {
  max-width: 450px;
}

.confirm-modal-body {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.confirm-modal-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(245, 217, 111, 0.72);
  border-radius: 50%;
  color: #f8df83;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2), rgba(0, 0, 0, 0.16));
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.15);
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.confirm-modal-body p {
  padding-top: 2px;
  color: #d9e6de;
  line-height: 1.65;
}

.confirm-modal-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

.modal-card .btn-secondary {
  background: rgba(229, 240, 233, 0.09);
  border-color: rgba(229, 240, 233, 0.25);
}

.modal-card .btn-secondary:hover:not(:disabled) {
  background: rgba(229, 240, 233, 0.17);
  border-color: rgba(245, 217, 111, 0.5);
}

.modal-card .btn-danger {
  background: linear-gradient(135deg, #a92235, #721321);
  border: 1px solid #e15c70;
  box-shadow: 0 5px 16px rgba(95, 10, 25, 0.34);
}

.modal-card .btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #ce3047, #8e1729);
  border-color: #ff8c9d;
}

/* Help Rules Modal Styles */
.rules-section {
  margin-bottom: 24px;
}

.rules-section h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ui-border-glass);
  padding-bottom: 4px;
}

.rules-section ul {
  list-style: none;
}

.rules-section li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  color: #c8d7ce;
}

.rules-section li strong {
  color: var(--text-light);
}

.rules-section li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--gold-primary);
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
}

.rules-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.rules-table td:first-child {
  font-weight: 600;
  color: var(--text-light);
}

.rules-table td:last-child {
  text-align: right;
  color: var(--gold-primary);
  font-weight: 700;
}

/* Settings Form Styles */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.form-group input[type="number"], .form-group select {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--ui-border-glass);
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input[type="number"]:focus, .form-group select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-glow);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--gold-primary);
}

.range-row span {
  min-width: 44px;
  text-align: right;
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.form-divider {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin: 28px 0 16px 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 6px;
}

/* Custom toggles styling */
.toggle-group {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  padding-bottom: 14px;
}

.toggle-label-desc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 78%;
}

.toggle-title {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.toggle-desc {
  font-size: 0.75rem;
  color: #b8c9bf;
}

/* Switch Switch Slider */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border: 1px solid rgba(255,255,255,0.08);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

input:checked + .slider {
  background-color: #00ff88;
}

input:focus + .slider {
  box-shadow: 0 0 0 3px #fff3b0, 0 0 0 6px rgba(212, 175, 55, 0.28);
}

input:checked + .slider:before {
  transform: translateX(22px);
  -webkit-transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.form-actions.confirm-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  min-width: 0;
  padding: 14px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.stat-card-wide {
  grid-column: 1 / -1;
}

.stat-num {
  margin-bottom: 4px;
  color: var(--gold-primary);
  font-size: 1.65rem;
  font-weight: 800;
}

.stat-label {
  color: #bacbc1;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.stats-footer {
  display: flex;
  justify-content: center;
}

/* Utility Helpers */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Mobile-Specific Media Queries (Extra Polish)
   ========================================================================== */

@media (max-width: 600px) {
  .game-header {
    height: 52px;
    padding: 0 12px;
  }
  
  .brand-title {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }
  
  .brand-subtitle {
    font-size: 0.55rem;
    letter-spacing: 2px;
  }
  
  .bankroll-container {
    gap: 6px;
  }
  
  .hud-item {
    min-width: 66px;
    padding: 4px 6px;
    border-radius: 8px;
  }
  
  .hud-label {
    font-size: 0.56rem;
    letter-spacing: 1px;
  }
  
  .hud-value {
    font-size: 0.9rem;
  }

  
  .icon-btn {
    width: 32px;
    height: 32px;
  }
  
  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .header-buttons {
    gap: 4px;
  }

  @media (max-width: 360px) {
    .brand {
      display: none;
    }
  }
  
  .blackjack-table {
    padding: 10px 8px;
  }

  .table-info-panel {
    top: 8px;
    gap: 2px;
    padding: 5px 7px;
  }

  .table-bankroll-panel {
    left: 8px;
  }

  .table-guide-toggle {
    top: 8px;
    right: 8px;
    height: 30px;
    padding-inline: 8px;
    gap: 5px;
    font-size: .6rem;
  }

  .table-guide-toggle svg { width: 14px; height: 14px; }
  .guide-toggle-state { min-width: 18px; font-size: .52rem; }

  .table-info-line {
    gap: 6px;
  }

  .table-info-label {
    min-width: 37px;
    font-size: 0.46rem;
    letter-spacing: 0.8px;
  }

  .table-info-value {
    font-size: 0.8rem;
  }
  
  .felt-markings {
    width: 90%;
  }
  
  .marking-title {
    font-size: 1.4rem;
    letter-spacing: 2px;
  }
  
  .marking-rules, .marking-insurance, .marking-limit {
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
  }
  
  .hand-meta {
    padding: 3px 12px;
    margin-bottom: 6px;
    font-size: 0.75rem;
  }
  
  .hand-score {
    padding: 2px 8px;
    font-size: 0.95rem;
  }
  
  .hands-wrapper {
    gap: 12px;
  }
  
  .player-hand {
    min-width: 125px;
    padding: 4px;
  }
  
  .player-hand.active::after {
    border-radius: 12px;
  }
  
  .status-banner {
    padding: 10px 24px;
    width: 85%;
    border-radius: 20px;
  }
  
  #game-status-message {
    font-size: 0.95rem;
  }
  
  .game-footer {
    padding: 12px;
  }

  .strategy-advice {
    bottom: calc(100% + 8px);
    width: calc(100% - 24px);
    padding: 9px 12px;
    gap: 7px;
  }

  .strategy-advice-copy {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }

  .strategy-advice-copy strong { font-size: .86rem; }
  .strategy-advice-copy span { font-size: .76rem; line-height: 1.3; }
  
  /* Betting layout on mobile */
  .chips-row {
    gap: 8px;
  }
  
  .chip {
    width: 44px;
    height: 44px;
    border-width: 2.5px;
  }
  
  .chip::before {
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
  }
  
  .chip span {
    font-size: 0.75rem;
  }
  
  .betting-actions {
    gap: 8px;
  }
  
  .betting-actions .btn {
    padding: 10px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
  }
  
  /* Action control layout on mobile */
  .action-controls {
    gap: 8px;
  }
  
  .btn-action {
    max-width: 90px;
    padding: 8px 4px;
    font-size: 0.65rem;
    gap: 4px;
    border-radius: 8px;
  }
  
  .btn-action svg {
    width: 16px;
    height: 16px;
  }
  
  /* Result control layout on mobile */
  .result-controls {
    gap: 8px;
  }
  
  .result-controls .btn {
    padding: 10px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
  }
  
  /* Modal responsive sizes */
  .modal-overlay {
    padding: 12px;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 16px;
  }
  
  .modal-header {
    padding: 14px 18px;
  }
  
  .modal-header h2 {
    font-size: 1.1rem;
  }
  
  .modal-body {
    padding: 16px;
    font-size: 0.85rem;
  }

  .confirm-modal-body {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 13px;
  }

  .confirm-modal-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .confirm-modal-actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  
  .form-group {
    margin-bottom: 14px;
  }
  
  .form-divider {
    margin: 20px 0 12px 0;
  }
  
}

/* Extra small height screens (Landscape or older devices) */
@media (max-height: 560px) and (max-width: 900px) {
  .brand {
    display: none;
  }
  
  .blackjack-table {
    padding: 6px;
  }
  
  .felt-markings {
    display: none; /* Hide backing marks to save space */
  }

  .table-info-panel {
    display: none;
  }
  
  :root {
    --card-width: 54px;
    --card-height: 78px;
    --card-overlap: -34px;
    --card-font-size: 0.65rem;
    --card-center-suit-size: 1.1rem;
  }
}

/* ==========================================================================
   Betting Circle, Stacked Chips, and Particle Canvas Overlays
   ========================================================================== */

.betting-circle-container {
  position: absolute;
  top: 47%; /* Shifted slightly up, outside the player hand box */
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
  z-index: 1;
}

/* Keep the wager chip clearly separated from the active hand on the taller
   full-screen browser table. */
.web-app .betting-circle-container {
  top: 42%;
}

.betting-circle {
  width: 76px;
  height: 76px;
  border: 2.5px dashed rgba(212, 175, 55, 0.35);
  border-radius: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all var(--transition-normal);
  background: rgba(0, 0, 0, 0.15);
}

.betting-circle-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) scale(0.8);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-primary);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  transition: all var(--transition-normal);
  opacity: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  white-space: nowrap;
}

.betting-circle-label.active {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.stacked-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: absolute;
  border: 2px dashed #ffffff;
  box-shadow: 0 4px 6px rgba(0,0,0,0.5), inset 0 0 5px rgba(0,0,0,0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 0.7rem;
  color: #fff;
  text-shadow: 0 1.5px 2px rgba(0,0,0,0.7);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.stacked-chip::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border-radius: 50%;
  background: inherit;
  border: 1.5px solid rgba(255,255,255,0.4);
}

.stacked-chip span {
  z-index: 2;
}

@media (min-width: 601px) {
  .web-app .betting-circle {
    width: 92px;
    height: 92px;
  }

  .web-app .stacked-chip {
    width: 58px;
    height: 58px;
    border-width: 3px;
    font-size: 0.86rem;
  }

  .web-app .stacked-chip::before {
    inset: 4px;
    border-width: 2px;
  }

  .web-app .betting-circle-label {
    left: calc(100% + 12px);
    padding: 5px 12px;
    font-size: 0.9rem;
  }
}

#effect-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

@media (max-width: 600px) {
  .betting-circle-container {
    top: 37%; /* Shifted higher up on mobile to completely clear the player hand box */
  }
  .betting-circle {
    width: 62px;
    height: 62px;
  }
  .stacked-chip {
    width: 36px;
    height: 36px;
    font-size: 0.6rem;
    border-width: 1.5px;
  }
  .stacked-chip::before {
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
  }
}

/* ==========================================================================
   Dealer's Card Shoe (Deck Holder) Styling
   ========================================================================== */

.card-shoe {
  position: absolute;
  top: 15px;
  right: 20px;
  width: 78px;
  height: 112px;
  background: linear-gradient(135deg, #151515 0%, #080808 100%);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.65), 
              inset 0 1px 3px rgba(255,255,255,0.2),
              0 0 0 1.5px rgba(212, 175, 55, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 5px;
  z-index: 10;
  perspective: 500px;
  transform: rotate(-12deg);
  overflow: hidden;
}

/* Glass shine highlight across the shoe */
.card-shoe::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, 
                transparent 45%, 
                rgba(255, 255, 255, 0.08) 48%, 
                rgba(255, 255, 255, 0.22) 50%, 
                rgba(255, 255, 255, 0.08) 52%, 
                transparent 55%);
  transform: rotate(-15deg);
  pointer-events: none;
  z-index: 6;
}

.shoe-base {
  position: absolute;
  bottom: -4px;
  left: -2px;
  right: -2px;
  height: 8px;
  background: linear-gradient(to right, #000, #333, #000);
  border-radius: 3px;
  box-shadow: 0 3px 5px rgba(0,0,0,0.8);
}

.shoe-deck {
  width: 100%;
  height: 86%;
  background: #1e0306;
  border-radius: 4px;
  position: relative;
  overflow: visible;
}

.deck-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 4px;
  background: repeating-linear-gradient(
                45deg,
                #9d0208,
                #9d0208 4px,
                #dc2f02 4px,
                #dc2f02 8px
              );
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.deck-layer.layer-1 {
  transform: translate3d(0, 0, 0);
  z-index: 1;
}
.deck-layer.layer-2 {
  transform: translate3d(-3.5px, -3.5px, 0);
  z-index: 2;
}
.deck-layer.layer-3 {
  transform: translate3d(-7px, -7px, 0);
  z-index: 3;
}

.shoe-front {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(to bottom, #252525 0%, #0d0d0d 100%);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom: 2.5px solid var(--gold-primary);
  z-index: 5;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Gold hot-stamped crown logo on the shoe front */
.shoe-front::after {
  content: '👑';
  font-size: 0.65rem;
  opacity: 0.85;
  text-shadow: 0 0 3px rgba(212, 175, 55, 0.6);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

/* Dynamic Depletion States */
.shoe-deck.depleted-2 .layer-3 { display: none; }
.shoe-deck.depleted-1 .layer-2 { display: none; }
.shoe-deck.depleted-0 .layer-1 { opacity: 0.15; background: #222; }

@media (max-width: 600px) {
  .card-shoe {
    width: 52px;
    height: 74px;
    top: 10px;
    right: 12px;
    padding: 3px;
    box-shadow: 0 5px 12px rgba(0,0,0,0.65), 0 0 0 1px rgba(212, 175, 55, 0.4);
  }
  .shoe-front {
    height: 20px;
  }
  .shoe-front::after {
    font-size: 0.5rem;
  }
  .deck-layer.layer-2 {
    transform: translate3d(-2px, -2px, 0);
  }
  .deck-layer.layer-3 {
    transform: translate3d(-4px, -4px, 0);
  }
}
