/* =========================================================
   Crossbones of Aeslion™
   CLEAN LAYOUT STYLESHEET — Desktop-first rebuild
   Base target: 1600 × 900
   Theme source: /images/ui/ generic root set
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Brilon";
  src:
    url("../fonts/Brilon.otf") format("opentype"),
    url("../fonts/Brilon.ttf") format("truetype");
  font-display: swap;
}

/* ---------- Theme variables ---------- */
:root {
  /* Colors */
  --bg: #0f0905;
  --ink: #f3ead3;
  --ink-soft: rgba(243, 234, 211, 0.88);
  --gold: #e6c789;
  --gold-bright: #f2d79b;
  --shadow: rgba(0, 0, 0, 0.62);

  --ui-text-shadow:
  0 1px 1px rgba(0,0,0,0.6),
  0 0 4px rgba(0,0,0,0.4);
  
  /* Layout — desktop baseline */
  --shell-max: 1600px;
  --shell-pad-x: 16px;
  --shell-pad-y: 16px;

  --header-h: 138px;
  --controls-h: 66px;

  --left-w: 360px;
  --right-w: 360px;
  --center-min-w: 720px;
  
  --grid-gap: 18px;        /* spacing for internal grids */
  --shell-row-gap: 8px;   /* spacing between major page rows */
  --bottom-h: auto;
  --copyright-h: 20px;

  --topbar-offset-y: -10px;
  --stage-offset-y: 0px;
  --table-offset-y: 20px;
  --right-panel-offset-y: -45px;

  /* Core UI Assets — default theme = Akros */
  --asset-title: url("../images/ui/title_plaque.png");
  --asset-bg: url("../images/ui/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/button_base_wide.png");
  --asset-button-small: url("../images/ui/button_base_small.png");
  --asset-button-settings: url("../images/ui/button_settings.png");
  --asset-tavern-reputation-plaque: url("../images/ui/tavern-reputation-plaque.png");
  --asset-token-frame: url("../images/ui/token_frame.png");
  --asset-token-slot: url("../images/ui/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/left_shutter.png");
  --asset-right-shutter: url("../images/ui/right_shutter.png");
  --asset-divider: url("../images/ui/divider_flourish.png");
  --asset-ante-plaque: url("../images/ui/ante.png");
 
  /* Left Player Panel */
  --asset-left-panel: url("../images/ui/left_panel_frame.png");
  --asset-pot-header: url("../images/ui/pot_header.png");
  --asset-player-row: url("../images/ui/player_row_plate.png");
  --asset-coin-pouch-full: url("../images/ui/coin_pouch_full.png");
  --asset-coin-pouch-empty: url("../images/ui/coin_pouch_empty.png");
  --asset-coin-badge: url("../images/ui/coin_badge.png");
  --asset-blossom-frame: url("../images/ui/blossom/blossom_frame.png");
 
  /* Center Tavern Table & Player Hand */
  --asset-table: url("../images/ui/tavern_table.png");
 
  /* Right Log & Hints */
  --asset-right-log: url("../images/ui/right_log_panel.png");
  --asset-right-hint: url("../images/ui/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/bottom_hand_bar.png");
 
  /* Pot coin visuals (scale with pot size) */
  --asset-coins-small: url("../images/ui/coins_small.png");
  --asset-coins-medium: url("../images/ui/coins_medium.png");
  --asset-coins-large: url("../images/ui/coins_large.png");

    /* End of the night tavern image */
    --asset-night-end: url("../images/ui/akros/tavern_end.png");
}

body[data-theme="akros"] {
  --asset-bg: url("../images/ui/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/button_base_wide.png");
  --asset-button-small: url("../images/ui/button_base_small.png");
  --asset-tavern-reputation-plaque: url("../images/ui/tavern-reputation-plaque.png");
  --asset-table: url("../images/ui/tavern_table.png");
  --asset-left-panel: url("../images/ui/left_panel_frame.png");
  --asset-right-log: url("../images/ui/right_log_panel.png");
  --asset-right-hint: url("../images/ui/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/bottom_hand_bar.png");
  --asset-token-frame: url("../images/ui/token_frame.png");
  --asset-token-slot: url("../images/ui/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/left_shutter.png");
  --asset-right-shutter: url("../images/ui/right_shutter.png");
  --asset-night-end: url("../images/ui/akros/tavern_end.png");
  --asset-ante-plaque: url("../images/ui/ante.png");
}

body[data-theme="faerie"] {
  --asset-bg: url("../images/ui/faerie/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/faerie/button_base_wide.png");
  --asset-button-small: url("../images/ui/faerie/button_base_small.png");
  --asset-tavern-reputation-plaque: url("../images/ui/faerie/tavern-reputation-plaque.png");
  --asset-table: url("../images/ui/faerie/tavern_table.png");
  --asset-left-panel: url("../images/ui/faerie/left_panel_frame.png");
  --asset-right-log: url("../images/ui/faerie/right_log_panel.png");
  --asset-right-hint: url("../images/ui/faerie/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/faerie/bottom_hand_bar.png");
  --asset-token-frame: url("../images/ui/faerie/token_frame.png");
  --asset-token-slot: url("../images/ui/faerie/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/faerie/left_shutter.png");
  --asset-right-shutter: url("../images/ui/faerie/right_shutter.png");
  --asset-night-end: url("../images/ui/faerie/tavern_end.png");
  --asset-ante-plaque: url("../images/ui/faerie/ante.png");
}

body[data-theme="karga"] {
  --asset-bg: url("../images/ui/karga/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/karga/button_base_wide.png");
  --asset-button-small: url("../images/ui/karga/button_base_small.png");
  --asset-tavern-reputation-plaque: url("../images/ui/karga/tavern-reputation-plaque.png");
  --asset-table: url("../images/ui/karga/tavern_table.png");
  --asset-left-panel: url("../images/ui/karga/left_panel_frame.png");
  --asset-right-log: url("../images/ui/karga/right_log_panel.png");
  --asset-right-hint: url("../images/ui/karga/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/karga/bottom_hand_bar.png");
  --asset-token-frame: url("../images/ui/karga/token_frame.png");
  --asset-token-slot: url("../images/ui/karga/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/karga/left_shutter.png");
  --asset-right-shutter: url("../images/ui/karga/right_shutter.png");
  --asset-night-end: url("../images/ui/karga/tavern_end.png");
  --asset-ante-plaque: url("../images/ui/karga/ante.png");
}

body[data-theme="dwarf"] {
  --asset-bg: url("../images/ui/dwarf/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/dwarf/button_base_wide.png");
  --asset-button-small: url("../images/ui/dwarf/button_base_small.png");
  --asset-tavern-reputation-plaque: url("../images/ui/dwarf/tavern-reputation-plaque.png");
  --asset-table: url("../images/ui/dwarf/tavern_table.png");
  --asset-left-panel: url("../images/ui/dwarf/left_panel_frame.png");
  --asset-right-log: url("../images/ui/dwarf/right_log_panel.png");
  --asset-right-hint: url("../images/ui/dwarf/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/dwarf/bottom_hand_bar.png");
  --asset-token-frame: url("../images/ui/dwarf/token_frame.png");
  --asset-token-slot: url("../images/ui/dwarf/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/dwarf/left_shutter.png");
  --asset-right-shutter: url("../images/ui/dwarf/right_shutter.png");
  --asset-night-end: url("../images/ui/dwarf/tavern_end.png");
  --asset-ante-plaque: url("../images/ui/dwarf/ante.png");
}

body[data-theme="demon"] {
  --asset-bg: url("../images/ui/demon/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/demon/button_base_wide.png");
  --asset-button-small: url("../images/ui/demon/button_base_small.png");
  --asset-tavern-reputation-plaque: url("../images/ui/demon/tavern-reputation-plaque.png");
  --asset-table: url("../images/ui/demon/tavern_table.png");
  --asset-left-panel: url("../images/ui/demon/left_panel_frame.png");
  --asset-right-log: url("../images/ui/demon/right_log_panel.png");
  --asset-right-hint: url("../images/ui/demon/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/demon/bottom_hand_bar.png");
  --asset-token-frame: url("../images/ui/demon/token_frame.png");
  --asset-token-slot: url("../images/ui/demon/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/demon/left_shutter.png");
  --asset-right-shutter: url("../images/ui/demon/right_shutter.png");
  --asset-night-end: url("../images/ui/demon/tavern_end.png");
  --asset-ante-plaque: url("../images/ui/demon/ante.png");
}

body[data-theme="dryad"] {
  --asset-bg: url("../images/ui/dryad/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/dryad/button_base_wide.png");
  --asset-button-small: url("../images/ui/dryad/button_base_small.png");
  --asset-tavern-reputation-plaque: url("../images/ui/dryad/tavern-reputation-plaque.png");
  --asset-table: url("../images/ui/dryad/tavern_table.png");
  --asset-left-panel: url("../images/ui/dryad/left_panel_frame.png");
  --asset-right-log: url("../images/ui/dryad/right_log_panel.png");
  --asset-right-hint: url("../images/ui/dryad/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/dryad/bottom_hand_bar.png");
  --asset-token-frame: url("../images/ui/dryad/token_frame.png");
  --asset-token-slot: url("../images/ui/dryad/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/dryad/left_shutter.png");
  --asset-right-shutter: url("../images/ui/dryad/right_shutter.png");
  --asset-night-end: url("../images/ui/dryad/tavern_end.png");
  --asset-ante-plaque: url("../images/ui/dryad/ante.png");
}

body[data-theme="dragon"] {
  --asset-bg: url("../images/ui/dragon/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/dragon/button_base_wide.png");
  --asset-button-small: url("../images/ui/dragon/button_base_small.png");
  --asset-tavern-reputation-plaque: url("../images/ui/dragon/tavern-reputation-plaque.png");
  --asset-table: url("../images/ui/dragon/tavern_table.png");
  --asset-left-panel: url("../images/ui/dragon/left_panel_frame.png");
  --asset-right-log: url("../images/ui/dragon/right_log_panel.png");
  --asset-right-hint: url("../images/ui/dragon/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/dragon/bottom_hand_bar.png");
  --asset-token-frame: url("../images/ui/dragon/token_frame.png");
  --asset-token-slot: url("../images/ui/dragon/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/dragon/left_shutter.png");
  --asset-right-shutter: url("../images/ui/dragon/right_shutter.png");
  --asset-night-end: url("../images/ui/dragon/tavern_end.png");
  --asset-ante-plaque: url("../images/ui/dragon/ante.png");
}

body[data-theme="merfolk"] {
  --asset-bg: url("../images/ui/merfolk/tavern-bg.jpg");
  --asset-button-wide: url("../images/ui/merfolk/button_base_wide.png");
  --asset-button-small: url("../images/ui/merfolk/button_base_small.png");
  --asset-tavern-reputation-plaque: url("../images/ui/merfolk/tavern-reputation-plaque.png");
  --asset-table: url("../images/ui/merfolk/tavern_table.png");
  --asset-left-panel: url("../images/ui/merfolk/left_panel_frame.png");
  --asset-right-log: url("../images/ui/merfolk/right_log_panel.png");
  --asset-right-hint: url("../images/ui/merfolk/right_hint_panel.png");
  --asset-bottom-bar: url("../images/ui/merfolk/bottom_hand_bar.png");
  --asset-token-frame: url("../images/ui/merfolk/token_frame.png");
  --asset-token-slot: url("../images/ui/merfolk/token_slot_ring.png");
  --asset-left-shutter: url("../images/ui/merfolk/left_shutter.png");
  --asset-right-shutter: url("../images/ui/merfolk/right_shutter.png");
  --asset-night-end: url("../images/ui/merfolk/tavern_end.png");
  --asset-ante-plaque: url("../images/ui/merfolk/ante.png");
}

/* ---------- Global ---------- */
*,
*::before,
*::after { 
  box-sizing: border-box; 
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Libre Baskerville", serif;
 
  /* Overflow hidden may need to be removed for mobile layout */
  overflow: auto;
 
  background:
    linear-gradient(rgba(11, 7, 4, 0.58), rgba(11, 7, 4, 0.58)),
    var(--asset-bg) center / cover no-repeat;
}
/* ---------- Screen Effects ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.18) 70%, rgba(0, 0, 0, 0.50) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0.12) 82%, rgba(0, 0, 0, 0.35));
}

#stingFlash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 220, 150, 0.20), rgba(0, 0, 0, 0) 48%);
  z-index: 50;
}

#stingFlash.crossbones-hit {
  animation: crossbonesFlash 220ms ease-out;
}

@keyframes crossbonesFlash {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(255, 180, 120, 0.34), rgba(0, 0, 0, 0) 58%);
  }
  100% {
    opacity: 0;
  }
}

.torch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 14% 28%, rgba(255, 180, 90, 0.18), rgba(255, 180, 90, 0) 18%),
    radial-gradient(circle at 86% 30%, rgba(255, 180, 90, 0.14), rgba(255, 180, 90, 0) 18%),
    radial-gradient(circle at 50% 54%, rgba(255, 130, 50, 0.06), rgba(255, 130, 50, 0) 28%);
  mix-blend-mode: screen;
  animation: flicker 4.2s ease-in-out infinite alternate;
}

@keyframes flicker {
  0% { 
    opacity:.72; 
    filter: blur(.2px); 
  }
  50% { 
    opacity:.95; 
    filter: blur(0); 
  }
  100% { 
    opacity:.82; 
    filter: blur(.15px); 
  }
}

@keyframes leaderRingPulse {
  0%,
  100% {
    transform: scale(1);
    filter:
      drop-shadow(0 0 6px rgba(255, 215, 120, 0.20))
      drop-shadow(0 0 10px rgba(255, 200, 90, 0.14))
      drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
  }

  50% {
    transform: scale(1.015);
    filter:
      drop-shadow(0 0 8px rgba(255, 225, 140, 0.28))
      drop-shadow(0 0 14px rgba(255, 205, 100, 0.20))
      drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
  }
}

.flyCoin {
  position: fixed;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2500;

  background:
    radial-gradient(circle at 30% 30%, #fff4b8 0%, #f5d56a 28%, #c28b1f 62%, #7a4d08 100%);
  box-shadow:
    0 0 0 1px rgba(88, 54, 8, 0.65),
    0 2px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

.rulesSparkle {
  position: fixed;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2600;

  background:
    radial-gradient(circle at 35% 35%,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(255, 246, 196, 0.92) 14%,
      rgba(255, 222, 170, 0.66) 32%,
      rgba(255, 182, 232, 0.34) 56%,
      rgba(255, 182, 232, 0) 82%);
  box-shadow:
    0 0 12px rgba(255, 228, 168, 0.48),
    0 0 22px rgba(255, 170, 230, 0.22);
}

#rulesBtn.rules-sparkle-hit,
#askBtn.sabine-sparkle-hit,
#startBtn.rules-sparkle-hit {
  animation: rulesSparkleHit 1.15s ease-out;
}

@keyframes rulesSparkleHit {
  0% {
    transform: scale(1);
    filter:
      brightness(1.08)
      drop-shadow(0 0 8px rgba(255, 220, 140, 0.22));
  }
  35% {
    transform: scale(1.05);
    filter:
      brightness(1.18)
      drop-shadow(0 0 14px rgba(255, 230, 160, 0.42))
      drop-shadow(0 0 24px rgba(255, 210, 120, 0.26));
  }
  100% {
    transform: scale(1);
    filter:
      brightness(1.08)
      drop-shadow(0 0 10px rgba(255, 220, 140, 0.28))
      drop-shadow(0 0 18px rgba(255, 220, 140, 0.20));
  }
}

.token-win {
  animation: tokenWinPulse 420ms ease-out;
}

@keyframes tokenWinPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  40% {
    transform: scale(1.08);
    filter: brightness(1.25) drop-shadow(0 0 8px rgba(255,215,120,0.6));
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

#sabineBox.sabine-payment-hit {
  animation: sabinePaymentHit 520ms ease-out;
}

@keyframes sabinePaymentHit {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  35% {
    transform: scale(1.015);
    filter:
      brightness(1.08)
      drop-shadow(0 0 10px rgba(255, 220, 140, 0.28));
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

#sabineBox.sabine-arrival {
  animation: sabineArrival 320ms ease-out;
}

@keyframes sabineArrival {
  0% {
    opacity: 0.72;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.centerPot.bump {
  animation: potBump 380ms ease;
}

@keyframes potBump {
  0% {
    transform: translate(-50%, -48%) scale(1);
  }
  35% {
    transform: translate(-50%, -48%) scale(1.06);
  }
  100% {
    transform: translate(-50%, -48%) scale(1);
  }
}

/* ---------- Layout Structure ---------- */
.wrap {
  position: relative;
  z-index: 2;
  width: min(100%, var(--shell-max));
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--shell-pad-y) var(--shell-pad-x);
  display: grid;
  grid-template-rows:
    var(--header-h)
    var(--controls-h)
    minmax(0, 1fr)
    auto
    var(--copyright-h);
  row-gap: var(--shell-row-gap);
}

/* ---------- Header ---------- */
.headerArea {
  grid-row: 1 / span 2;
  display: grid;
  grid-template-rows: var(--header-h) var(--controls-h);
  gap: 0;
  position: relative;
}

.titleBlock {
  position: relative;
  height: var(--header-h);
  background: var(--asset-title) center / contain no-repeat;
  text-align: center;
  display: grid;
  align-content: center;
  justify-items: center;
  padding-top: 8px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.55));
}

.titleMain {
  margin-top: 2px;
  font-family: "Brilon", "Cinzel", serif;
  font-size: clamp(36px, 3vw, 56px);
  line-height: 1;
  letter-spacing: 0.005em;
  color: #f2e6cb;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.titleSub {
  margin-top: 8px;
  font-family: "Libre Baskerville", serif;
  font-size: clamp(20px, 1.35vw, 26px);
  color: rgba(242, 233, 213, 0.88);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.tm {
  font-size: 0.34em;
  vertical-align: top;
  margin-left: 3px;
}

/* ---------- Controls row ---------- */
.topbar {
  position: relative;
  top: var(--topbar-offset-y);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--controls-h);
  column-gap: 12px;
}

.topbar-left-group {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: flex-end;
  position: relative;
  top: -58px;
  z-index: 60;
}

.topbar-center-group {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative;
  top: -5px;
}

.topbar-right-group {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  position: relative;
  top: -58px;
  z-index: 60;
}

.topbar,
.topbar-right-group,
#resetBtn,
#muteBtn,
#musicBtn {
  position: relative;
  z-index: 50;
}

button {
  appearance: none;
  border: 0;
  color: #f5ead4;
  font-family: "Cinzel", serif;
  letter-spacing: 0.02em;
  text-shadow: var(--ui-text-shadow);
  cursor: pointer;
  background: transparent center / 100% 100% no-repeat;
  transition: transform 0.14s ease, filter 0.14s ease, opacity 0.14s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#mulliganBtn:disabled {
  opacity: 0.62;
  filter: grayscale(0.12) brightness(0.88);
}

#mulliganBtn:not(:disabled) {
  filter: brightness(1);
}

#resetBtn,
#resetProgressBtn,
#muteBtn,
#musicBtn,
#askBtn,
#rulesBtn,
#mulliganBtn,
#skipMulliganBtn {
  min-width: 150px;
  height: 52px;
  padding: 0 18px;
  background-image: var(--asset-button-wide);
  font-size: 16px;
}

#rulesBtn.rules-onboarding {
  animation: rulesPulse 1.4s ease-in-out infinite;
  filter:
    brightness(1.08)
    drop-shadow(0 0 10px rgba(255, 220, 140, 0.28))
    drop-shadow(0 0 18px rgba(255, 220, 140, 0.20));
}

.bottomBarTop.mulligan-soft-attention #mulliganBtn,
.bottomBarTop.mulligan-soft-attention #skipMulliganBtn {
  animation: primaryPulse 3.2s ease-in-out infinite;
  filter:
    brightness(1.04)
    drop-shadow(0 0 10px rgba(255, 220, 140, 0.24))
    drop-shadow(0 0 18px rgba(255, 200, 120, 0.14));
}

@keyframes rulesPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-1px) scale(1.03);
  }
}

#startBtn {
  position: relative;
  z-index: 3;
  min-width: 194px;
  height: 52px;
  padding: 0 14px;
  background-image: var(--asset-button-wide);
  font-size: 16px;
  color: #fff2cf;
  animation: primaryPulse 3.2s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter:
    brightness(1.04)
    drop-shadow(0 0 10px rgba(255, 220, 140, 0.24))
    drop-shadow(0 0 18px rgba(255, 200, 120, 0.14));
}

#startBtn.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.startAnteWrap.is-hidden .anteControl,
.startAnteWrap.is-hidden #startBtn {
  visibility: hidden;
  pointer-events: none;
}

@keyframes primaryPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter:
      brightness(1.04)
      drop-shadow(0 0 10px rgba(255, 220, 140, 0.24))
      drop-shadow(0 0 18px rgba(255, 200, 120, 0.14));
  }
  50% {
    transform: translateY(-1px) scale(1.02);
    filter:
      brightness(1.12)
      drop-shadow(0 0 14px rgba(255, 230, 160, 0.34))
      drop-shadow(0 0 26px rgba(255, 210, 130, 0.22));
  }
}

.startAnteWrap {
  position: relative;
  width: 206px;
  height: 56px;
  flex: 0 0 206px;
}

.tavernReputationUnlock,
.tavernReputationProgress {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.tavernReputationUnlock {
  font-family: "Cinzel", serif;
  font-size: 16px;
  line-height: 1.1;
  color: #e8d9b8;
  margin-bottom: 4px;
}

.tavernReputationProgress {
  font-family: "Libre Baskerville", serif;
  font-size: 18px;
  line-height: 1.1;
  color: #d4b16a;
  font-weight: 700;
}

.map-btn {
  width: 76px;
  height: 76px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.map-btn img {
  display: block;
  width: 64px;
  height: 64px;
  pointer-events: none;
}

.map-btn.glow {
  animation: mapGlow 2.2s ease-in-out 3;
}

.map-btn.glow img {
  animation: mapButtonPulse 2.2s ease-in-out 3;
}

body.pre-game .seat .slot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes mapGlow {
  0% {
    filter:
      drop-shadow(0 0 0 rgba(255,215,120,0))
      drop-shadow(0 0 0 rgba(255,170,230,0));
  }
  50% {
    filter:
      drop-shadow(0 0 14px rgba(255,215,120,0.95))
      drop-shadow(0 0 28px rgba(255,170,230,0.36));
  }
  100% {
    filter:
      drop-shadow(0 0 0 rgba(255,215,120,0))
      drop-shadow(0 0 0 rgba(255,170,230,0));
  }
}

@keyframes mapButtonPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

/* ---------- Ante plaque ---------- */
.anteControl {
  position: absolute;
  left: 136px;
  top: 2px;
  width: 54px;
  height: 52px;
  background: var(--asset-ante-plaque) left center / 230px 52px no-repeat;
  overflow: hidden;
  transition: width 0.28s ease;
  z-index: 1;
}

.startAnteWrap:hover .anteControl,
.startAnteWrap:focus-within .anteControl,
.anteControl:hover,
.anteControl:focus-within {
  width: 230px;
}

.anteLabel {
  position: absolute;
  left: 92px;
  top: 56%;
  transform: translateY(-50%);
  font-family: "Cinzel", serif;
  font-size: 15px;
  color: #f2d79b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  white-space: nowrap;
}

#anteCycleBtn {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

#anteCycleBtn:hover {
  transform: translateY(-50%) scale(1.04);
  filter: brightness(1.08);
}

#anteCycleBtn:active {
  transform: translateY(-50%) scale(0.98);
}

#anteValueDisplay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-family: "Cinzel", serif;
  font-size: 18px;
  font-weight: 700;
  color: #f7e7bf;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  line-height: 1;
  pointer-events: none;

  transform: translateY(1px);
}

/* ---------- Settings menu ---------- */
.settingsMenu {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

#settingsBtn {
  min-width: 150px;
  width: 150px;
  height: 52px;
  padding: 0;
  background-image: var(--asset-button-settings);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#settingsBtn::before {
  content: "";
  width: 22px;
  height: 22px;
  background: center / contain no-repeat;
  pointer-events: none;
}

.settingsDropdown {
  position: absolute;
  top: 58px;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
}

.settingsDropdown button:nth-child(3) {
  margin-top: 8px;
}

.settingsMenu.open .settingsDropdown {
  display: flex;
}

.settingsDropdown #resetBtn,
.settingsDropdown #resetProgressBtn,
.settingsDropdown #muteBtn,
.settingsDropdown #musicBtn {
  min-width: 150px;
  width: 150px;
}

/* ---------- Main three-column stage ---------- */
.gameGrid {
  grid-row: 3;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--left-w) minmax(var(--center-min-w), 1fr) var(--right-w);
  gap: var(--grid-gap);
  align-items: start;
  position: relative;
  top: -52px;
}

.panelInner,
.centerPanel,
.leftPanel,
.rightPanel {
  min-width: 0;
  min-height: 0;
}

/* ---------- Left player panel ---------- */
.leftColumn {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  width: var(--left-w);
  flex: 0 0 var(--left-w);
  position: relative;
  top: -48px;
}

.leftPanel {
  position: relative;
  align-self: start;
  width: var(--left-w);
  height: 540px;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.45));
  overflow: visible;
  z-index: 5;
  background: none;
}

.leftPanel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--asset-left-panel) center / contain no-repeat;
  pointer-events: none;
  z-index: 3;
}

/* ---------- Player shutters ---------- */
.playerShutters {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.playerShutter {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  transition: transform 520ms ease, opacity 320ms ease;
  will-change: transform, opacity;
}

.playerShutter.left {
  background-image: var(--asset-left-shutter);
  background-position: center;
  transform: translateX(0);
}

.playerShutter.right {
  background-image: var(--asset-right-shutter);
  background-position: center;
  transform: translateX(0);
}

body.shutters-open .playerShutter.left {
  transform: translateX(-58%);
}

body.shutters-open .playerShutter.right {
  transform: translateX(58%);
}

body.pre-game .playerShutter,
body:not(.shutters-open) .playerShutter {
  opacity: 1;
}

body.shutters-open .playerShutter {
  opacity: 0.98;
}

.tavernReputationPanel {
  position: absolute;
  inset: 0;
  width: var(--left-w);
  height: 540px;
  background: var(--asset-tavern-reputation-plaque) center / contain no-repeat;
  background-size: 100% 100%;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.38));
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  z-index: 1;
}

.tavernReputationInner {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 430px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pregamePlaqueMessage {
  display: none;
}

body.pre-game .pregamePlaqueMessage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  text-align: center;
  font-family: "Libre Baskerville", serif;
  font-size: 13px;
  line-height: 1.25;
  color: #f1e3c0;
  text-shadow: var(--ui-text-shadow);
  padding: 0 8px;
}

.tavernReputationTitle,
.tavernReputationUnlock,
.tavernReputationProgress {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.tavernReputationTitle {
  font-family: "Cinzel", serif;
  font-size: 12px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f6e7c3;
  margin-bottom: 4px;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.9),
    0 0 6px rgba(0, 0, 0, 0.7);
}

.tavernReputationUnlock {
  font-family: "Libre Baskerville", serif;
  font-size: 12px;
  line-height: 1.1;
  color: #f1e3c0;
  margin-bottom: 4px;
}

.tavernReputationProgress {
  font-family: "Cinzel", serif;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 700;
  color: #d4b16a;
}

body.show-reputation-plaque .tavernReputationPanel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body.pre-game .tavernReputationPanel {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transform: translateY(0);
}

body.pre-game .tavernReputationTitle,
body.pre-game .tavernReputationUnlock,
body.pre-game .tavernReputationProgress {
  display: none;
}

.leftPanel .panelInner {
  position: absolute;
  inset: 8px 22px 28px 22px;
  padding: 0;
  z-index: 4;
}

.potPlate {
  position: relative;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 3;
}

#potText,
.playerRow .name,
.playerRow .meta,
.pouchCount {
  text-shadow: var(--ui-text-shadow);
}

#potText {
  position: relative;
  z-index: 4;
  display: block;
  opacity: 1;
  visibility: visible;
  margin-top: 27px;
  font-family: "Cinzel", serif;
  font-size: 20px;
  font-weight: 700;
  color: #f6e8c8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

body.pre-game #potText {
  opacity: 0;
  visibility: hidden;
}

.playersList {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.playerRow {
  position: relative;
  height: 72px;
  overflow: visible;
}

.rowArt {
  position: absolute;
  top: 7px;
  bottom: 0;
  left: 13px;
  right: 28px;
  width: auto;
  height: 100%;
  object-fit: fill;
  display: block;
}

.playerRow .who {
  position: absolute;
  left: 72px;
  right: 96px;
  top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  z-index: 2;
  text-align: center;
}

.playerRow .name {
  font-family: "Cinzel", serif;
  font-size: 18px;
  font-weight: 700;
  color: #f6ead1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.playerRow .meta {
  font-size: 13px;
  color:rgba(243, 234, 211, 0.92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.playerRow .name,
.playerRow .meta {
  width: 100%;
  text-align: center;
}

/* Hide pre-game player row content until Start Night */
body.pre-game .playerRow .meta,
body.pre-game .playerRow .who,
body.pre-game .playerRow .pouchWrap,
body.pre-game .playerRow .rowArt {
  display: none;
}

body.pre-game .leftUtility .bottomBarTop,
body.pre-game .leftUtility #blossomCoinCounter {
  display: none;
}

/* Hide table nameplates before the game starts, except You */
body.pre-game .seat.top .namePlate,
body.pre-game .seat.left .namePlate,
body.pre-game .seat.right .namePlate {
  display: none;
}

.playerRow .pouchWrap {
  position: absolute;
  right: 28px;
  top: 10px;
  width: 68px;
  height: 60px;
  z-index: 2;
}

.playerRow .pouchImg {
  position: absolute;
  right: 0;
  top: 0;
  width: 60px;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.4));
}

.playerRow .pouchCount {
  position: absolute;
  left: 16px;
  bottom: 7px;
  width: 40px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", serif;
  font-size: 15px;
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  background: var(--asset-coin-badge) center / contain no-repeat;
}

.playerRow.isActive {
  filter: drop-shadow(0 0 14px rgba(255, 222, 143, 0.30));
}

/* ---------- Center table ---------- */
.centerPanel {
  position: relative;
  height: 100%;
  min-height: 500px;
  overflow: visible;
}

.centerPanel .panelInner {
  height: 100%;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.tableZone {
  position: relative;
  width: 100%;
  height: min(100%, 560px);
  min-height: 460px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(var(--table-offset-y) - 12px);
}

.table {
  position: relative;
  width: min(100%, 900px);
  aspect-ratio: 2400 / 1357;
  background: var(--asset-table) center / contain no-repeat;
  filter: drop-shadow(0 24px 38px rgba(0, 0, 0, 0.44));
}

.table::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 8%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0) 72%);
  filter: blur(10px);
  pointer-events: none;
  z-index: -1;
}

.centerPot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-48%);
  width: 130px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#potAnchor {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 24px;
  height: 16px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

#coinLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20; /* above table, below overlays */
}

.coinPile {
  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coinPile img {
  width: 130px;
  height: 78px;
  object-fit: contain;
  display: block;
}

/* seats at true 12/3/6/9 positions */
.seat {
  position: absolute;
  width: 170px;
  z-index: 3;
  text-align: center;
}

.seat.top {
  left: 50%;
  top: 35px;
  transform: translateX(-50%);
}

.seat.right {
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
}

.seat.bottom {
  left: 50%;
  bottom: 50px;
  transform: translateX(-50%);
}

.seat.left {
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
}

.slot {
  width: 136px;
  height: 136px;
  margin: 0 auto;
  background: var(--asset-token-slot) center / contain no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.seat.isActiveTurn .slot {
  filter:
    drop-shadow(0 0 6px rgba(255, 215, 120, 0.22))
    drop-shadow(0 0 10px rgba(255, 200, 90, 0.16))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
  animation: leaderRingPulse 2.2s ease-in-out infinite;
}

.namePlate {
  margin: 0 auto;
  width: max-content;
  min-width: 112px;
  max-width: 170px;
  padding: 7px 16px;
  background: linear-gradient(rgba(45, 27, 15, 0.88), rgba(28, 16, 10, 0.86));
  border: 1px solid rgba(255, 230, 180, 0.10);
  border-radius: 999px;
  font-family: "Cinzel", serif;
  font-size: 14px;
  line-height: 1;
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* ---------- Nameplate positioning ---------- */

/* TOP PLAYER */
.seat.top .namePlate {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
}

/* LEFT PLAYER */
.seat.left .namePlate {
  position: absolute;
  top: 127px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 110px;
}

/* RIGHT PLAYER */
.seat.right .namePlate {
  position: absolute;
  top: 127px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 110px;
}

/* BOTTOM PLAYER (YOU) — engraved into table rim */
.seat.bottom .namePlate {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);

  padding: 6px 18px;
  min-width: 96px;

  background: linear-gradient(
    rgba(32, 18, 10, 0.92),
    rgba(18, 10, 6, 0.92)
  );

  border: 1px solid rgba(255, 210, 130, 0.18);

  color: #f1d59b;

  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.65),
    0 2px 6px rgba(0,0,0,0.45);

  font-size: 13px;
}

.bubble {
  position: absolute;
  max-width: 220px;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(13, 9, 7, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5ead7;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  font-size: 15px;
  line-height: 1.32;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 40;
}

.bubble.show {
  opacity: 1;
  transform: translateY(0);
}

.seat.top .bubble {
  left: calc(100% - 20px);
  top: 15px;
  transform: translateY(6px);
}

.seat.top .bubble.show {
  transform: translateY(0);
}

.seat.right .bubble {
  right: 136px;
  top: 50%;
  transform: translateY(-50%) translateY(6px);
}

.seat.right .bubble.show {
  transform: translateY(-50%) translateY(0);
}

.seat.left .bubble {
  left: 136px;
  top: 50%;
  transform: translateY(-50%) translateY(6px);
}

.seat.left .bubble.show {
  transform: translateY(-50%) translateY(0);
}

.seat.bottom .bubble {
  left: 50%;
  bottom: 140px;
  transform: translateX(-50%) translateY(6px);
}

.seat.bottom .bubble.show {
  transform: translateX(-50%) translateY(0);
}

.trickBanner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%) scale(.96);
  min-width: 220px;
  text-align: center;
  white-space: pre-line;
  padding: 16px 24px;
  background: rgba(11, 7, 4, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  font-family: "Cinzel", serif;
  font-size: 28px;
  color: var(--gold-bright);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  z-index: 12;
}

.trickBanner.show {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
}

/* ---------- Right column ---------- */
.rightPanel {
  position: relative;
  top: -95px;
  height: auto;
  min-height: 500px;
  padding-top: 0;
}

.logPanel {
  position: relative;
  height: 100%;
  min-height: 540px;
  background: var(--asset-right-log) center / contain no-repeat;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.45));
  overflow: hidden;
}

.logBox {
  position: absolute;
  left: 38px;
  right: 42px;
  top: 102px;
  bottom: 104px;

  overflow-y: auto;
  overflow-x: hidden;

  padding: 12px 18px 16px;

  color: #2b1a0c;
  font-size: 15px;
  line-height: 1.4;

  scrollbar-width: thin;
}

.logBox::-webkit-scrollbar {
  width: 6px;
}

.logBox::-webkit-scrollbar-track {
  background: transparent;
}

.logBox::-webkit-scrollbar-thumb {
  background: rgba(120, 85, 45, 0.6);
  border-radius: 4px;
}

.logBox::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 85, 45, 0.9);
}

#logLines {
  color: #2b1a0c;
  text-shadow: none;
}

/* ---------- Lower utility region ---------- */
/* Temporary desktop alignment adjustment for lower gameplay row.
   Revisit during final layout normalization pass. */

.lowerGrid {
  grid-row: 4;
  position: relative;
  top: 48px;
  display: grid;
  grid-template-columns: var(--left-w) minmax(var(--center-min-w), 1fr) var(--right-w);
  gap: var(--grid-gap);
  align-items: start;
  min-height: 0;
}

/* ---------- Lower left: Blossom / mulligan ---------- */
.leftUtility {
  position: relative;
  min-height: 220px;
}

.bottomBarTop {
  position: relative;
  top: 98px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.bottomBarTop.mulligan-attention {
  animation: mulliganAttentionPulse 1.2s ease-in-out infinite;
}

.bottomBarTop.mulligan-attention #mulliganBtn,
.bottomBarTop.mulligan-attention #skipMulliganBtn {
  filter:
    brightness(1.14)
    drop-shadow(0 0 10px rgba(255, 215, 120, 0.45))
    drop-shadow(0 0 18px rgba(255, 190, 90, 0.24));
}

@keyframes mulliganAttentionPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
}

#mulliganBtn,
#skipMulliganBtn {
  min-width: 150px;
  height: 46px;
  font-size: 14px;
}

.leftUtility.utility-mode-mulligan .bottomBarTop {
  display: flex;
}

.leftUtility.utility-mode-mulligan #blossomPanel,
.leftUtility.utility-mode-mulligan #blossomCoinCounter {
  display: none;
}

.leftUtility.utility-mode-companion .bottomBarTop,
.leftUtility.utility-mode-placeholder .bottomBarTop,
.leftUtility.utility-mode-empty .bottomBarTop {
  display: none;
}

.leftUtility.utility-mode-companion #blossomPanel,
.leftUtility.utility-mode-companion #blossomCoinCounter,
.leftUtility.utility-mode-placeholder #blossomPanel,
.leftUtility.utility-mode-placeholder #blossomCoinCounter {
  display: block;
}

.leftUtility.utility-mode-empty #blossomPanel,
.leftUtility.utility-mode-empty #blossomCoinCounter {
  display: none;
}

.token.discarding {
  transform: translateY(-4px) scale(0.96);
  filter: grayscale(0.18) brightness(0.62);
  opacity: 0.58;
  box-shadow: inset 0 0 0 2px rgba(255, 120, 120, 0.28);
}

.token.ladybug-pending {
  opacity: 0.38;
  filter: grayscale(0.35) brightness(0.72);
}

.ladybugTrek {
  position: fixed;
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 2600;
  transform-origin: center center;
  filter: drop-shadow(0 0 8px rgba(255, 225, 130, 0.28));
}

.ladybugTrek.is-crawling {
  animation: ladybugCrawlSteps 2.2s linear forwards;
}

.ladybugTrek.is-flying-back {
  animation: ladybugFlyBack 0.55s ease-in forwards;
}

@keyframes ladybugCrawlSteps {
  0% {
    transform: translate(0, 0) scale(0.94) rotate(-8deg);
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  20% {
    transform: translate(var(--crawl-x1), var(--crawl-y1)) rotate(8deg);
  }

  28% {
    transform: translate(var(--crawl-x1), var(--crawl-y1)) rotate(-5deg);
  }

  43% {
    transform: translate(var(--crawl-x2), var(--crawl-y2)) rotate(7deg);
  }

  51% {
    transform: translate(var(--crawl-x2), var(--crawl-y2)) rotate(-4deg);
  }

  67% {
    transform: translate(var(--crawl-x3), var(--crawl-y3)) rotate(6deg);
  }

  75% {
    transform: translate(var(--crawl-x3), var(--crawl-y3)) rotate(-3deg);
  }

  100% {
    transform: translate(var(--crawl-x4), var(--crawl-y4)) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes ladybugFlyBack {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translate(var(--fly-x), var(--fly-y)) scale(0.86) rotate(22deg);
    opacity: 0;
  }
}

.token.ladybug-swap-flip {
  animation: ladybugSwapFlip 820ms ease;
  transform-style: preserve-3d;
}

@keyframes ladybugSwapFlip {
  0% {
    transform: scale(0.88) rotateY(0deg);
    filter:
      brightness(1.8)
      drop-shadow(0 0 20px rgba(255, 225, 130, 0.72));
  }
  35% {
    transform: scale(1.05) rotateY(90deg);
    filter:
      brightness(2)
      drop-shadow(0 0 28px rgba(255, 235, 160, 0.9));
  }
  55% {
    transform: scale(1.05) rotateY(180deg);
    filter:
      brightness(1.7)
      drop-shadow(0 0 22px rgba(255, 220, 120, 0.65));
  }
  100% {
    transform: scale(1) rotateY(360deg);
    filter: none;
  }
}

/* Blossom hooks for future JS */
#blossomPanel {
  position: relative;
  left: 0;
  width: 100%;
  height: 170px;
  margin-top: 60px;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
  pointer-events: auto;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.18s ease;
  cursor: default;
}

.leftUtility.utility-mode-companion #blossomPanel {
  cursor: pointer;
}

#blossomPanel.show {
  opacity: 1;
}

#blossomCompanion {
  position: absolute;
  inset: 0;
  display: none;
}

#blossomPanel.show #blossomCompanion {
  display: block;
}

#blossomPanel .blossomCompanionOverlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

#blossomPanel .bcBubble {
  position: absolute;
  left: 124px;
  right: 40px;
  top: 0px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

#blossomPanel .bcName {
  display: block;
  margin-bottom: 4px;
  font-family: "Cinzel", serif;
  font-size: 0.80rem;
  line-height: 1.1;
  color: #f2dfb2;
}

#blossomCompanionText {
  font-size: 0.80rem;
  line-height: 1.18;
  color: #f6e7c8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

.blossomAbilityBtn{
  position: absolute;
  bottom: 2px;
  width: 58px;
  height: 58px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
  z-index: 8;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.45));
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.blossomAbilityBtn:hover{
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.52));
}

.blossomAbilityBtn:active{
  margin-top: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)) brightness(0.98);
}

.blossomAbilityBtn[hidden]{
  display: none;
}

.blossomAbilityBtn.ladybug{
  left: 50%;
  transform: translateX(-70%);
  background-image: url("../images/ui/blossom/ladybug_icon.png");
}

.blossomAbilityBtn.firebreath{
  left: 50%;
  transform: translateX(-50%);
  background-image: url("../images/ui/blossom/firebreath_icon.png");
}

.blossomAbilityBtn{
  position: absolute;
  bottom: -18px;
  width: 58px;
  height: 58px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
  z-index: 8;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.45));
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.blossomAbilityBtn:hover{
  filter:
    drop-shadow(0 6px 14px rgba(0,0,0,.52))
    drop-shadow(0 0 8px rgba(255,215,120,.45))
    brightness(1.08);
}

.blossomAbilityBtn:active{
  filter:
    drop-shadow(0 4px 10px rgba(0,0,0,.45))
    drop-shadow(0 0 4px rgba(255,215,120,.28))
    brightness(0.95);
}

.blossomAbilityBtn:disabled{
  cursor: default;
}

.blossomAbilityBtn.ladybug{
  left: 42px;
  background-image: url("../images/ui/blossom/ladybug_icon.png");
}

.blossomAbilityBtn.firebreath{
  left: 112px;
  background-image: url("../images/ui/blossom/firebreath_icon.png");
}

.blossomAbilityBtn.is-dormant{
  opacity: 0.38;
  filter: grayscale(0.25) brightness(0.78) drop-shadow(0 3px 7px rgba(0,0,0,.35));
}

.blossomAbilityBtn.is-ready{
  opacity: 1;
}

#blossomCoinCounter {
  position: absolute;
  left: 256px;
  bottom: 6px;
  width: 80px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", serif;
  font-size: 28px;
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* ---------- Lower center: hand bar ---------- */
.bottomBar {
  position: relative;
  top: -20px;
  margin: 0 auto;
  width: min(940px, 100%);
  min-width: 0;
  min-height: 220px;
  background: var(--asset-bottom-bar) center bottom / 100% auto no-repeat;
  display: grid;
  grid-template-rows: 72px 1fr;
  align-items: stretch;
  justify-items: center;
  padding-bottom: 26px;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.45));
}

.ruleLine {
  grid-row: 1;
  width: min(760px, 100%);
  height: 72px;
  margin: 0;
  padding: 0 18px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", serif;
  font-size: 14px;
  line-height: 1.2;
  color: #e9d09b;
  text-align: center;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.handRow {
  grid-row: 2;
  width: 100%;

  display: flex;
  justify-content: center;
  align-items: flex-end;

  gap: 8px;

  padding: 0 80px 18px; /* ← pulls tokens DOWN into the bar */

  min-height: 140px;
}

.footerNote {
  grid-row: 5;
  align-self: end;
  justify-self: center;
  margin: 0;
  font-size: 11px;
  line-height: 1.1;
  color: rgba(244, 235, 214, 0.84);
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

/* ---------- Lower right: Sabine / rules ---------- */
.rightUtility {
  position: relative;
  top: -36px;
  min-height: 190px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.utilityButtons {
  position: relative;
  top: -9px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hintPanel {
  position: relative;
  top: -10px;
  min-height: 185px;
  background: var(--asset-right-hint) center / contain no-repeat;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.40));
}

.sabineInner {
  position: absolute;
  left: 34px;
  right: 40px;
  top: 5px;
  bottom: 28px;
  padding: 14px 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hintPanel .title {
  font-family: "Cinzel", serif;
  font-size: 16px;
  color: #5f4523;
  margin-bottom: 14px;
}

.hintPanel .text {
  margin-top: -8px;
  color: #5c4322;
  font-size: 15px;
  line-height: 1.3;
}

/* =========================================================
   SABINE DEBT JAR
   ========================================================= */

   .sabine-debt-container {
    position: absolute;
    left: 50%;
    bottom: -30px;
    transform: translateX(-50%);
    width: 118px;
    height: 55px;
    pointer-events: none;
    overflow: hidden;
    border-radius: 999px;
  }
  
  /* main magic fill */
  .sabine-debt-fill {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 8px;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.35s ease, filter 0.35s ease;
    filter:
      drop-shadow(0 0 5px rgba(255, 212, 120, 0.16))
      drop-shadow(0 0 10px rgba(214, 164, 66, 0.10));
    isolation: isolate;
  }
  
  .sabine-debt-fill::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 999px;
    transition: width 0.45s ease, opacity 0.35s ease;
    background:
      linear-gradient(
        to bottom,
        rgba(255, 250, 222, 0.72) 0%,
        rgba(255, 236, 170, 0.95) 18%,
        rgba(245, 198, 84, 0.98) 46%,
        rgba(202, 136, 30, 0.98) 76%,
        rgba(124, 76, 12, 0.94) 100%
      ),
      linear-gradient(
        90deg,
        rgba(255, 244, 210, 0.00) 0%,
        rgba(255, 250, 228, 0.22) 14%,
        rgba(255, 220, 126, 0.10) 36%,
        rgba(255, 248, 220, 0.18) 58%,
        rgba(255, 214, 108, 0.08) 78%,
        rgba(255, 244, 210, 0.00) 100%
      );
    box-shadow:
      inset 0 1px 2px rgba(255, 250, 226, 0.52),
      inset 0 -2px 3px rgba(112, 66, 10, 0.34),
      0 0 6px rgba(255, 207, 110, 0.12);
  }

  .sabine-debt-fill::after {
    content: "";
    position: absolute;
    inset: 1px auto 1px 0;
    width: 0%;
    border-radius: 999px;
    transition: width 0.45s ease, opacity 0.35s ease;
    background:
      radial-gradient(circle at 16% 50%, rgba(255,255,245,0.75) 0 1px, transparent 2px),
      radial-gradient(circle at 34% 34%, rgba(255,246,214,0.60) 0 1px, transparent 2px),
      radial-gradient(circle at 58% 62%, rgba(255,255,240,0.70) 0 1px, transparent 2px),
      radial-gradient(circle at 76% 38%, rgba(255,242,205,0.58) 0 1px, transparent 2px),
      linear-gradient(
        to right,
        rgba(255,255,255,0.00) 0%,
        rgba(255,248,220,0.08) 26%,
        rgba(255,255,255,0.16) 52%,
        rgba(255,244,210,0.06) 74%,
        rgba(255,255,255,0.00) 100%
      );
    opacity: 0.55;
    filter: blur(0.25px);
  }
  
  /* soft glass highlight riding on the fill */
  .sabine-debt-sheen {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
  }
  
  .sabine-debt-sheen::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 999px;
    transition: width 0.45s ease, opacity 0.35s ease;
    background:
      linear-gradient(
        to right,
        rgba(255,255,255,0.00) 0%,
        rgba(255,248,222,0.08) 18%,
        rgba(255,255,255,0.18) 40%,
        rgba(255,250,228,0.28) 54%,
        rgba(255,255,255,0.14) 68%,
        rgba(255,255,255,0.00) 100%
      );
    filter: blur(0.35px);
  }
  
  /* stage 1 */
  .sabine-debt-1 .sabine-debt-fill {
    opacity: 0.78;
  }
  
  .sabine-debt-1 .sabine-debt-fill::before {
    width: 33%;
  }
  
  .sabine-debt-1 .sabine-debt-sheen {
    opacity: 0.34;
  }
  
  .sabine-debt-1 .sabine-debt-sheen::before {
    width: 25%;
  }
  
  /* stage 2 */
  .sabine-debt-2 .sabine-debt-fill {
    opacity: 0.86;
  }
  
  .sabine-debt-2 .sabine-debt-fill::before {
    width: 66%;
  }
  
  .sabine-debt-2 .sabine-debt-sheen {
    opacity: 0.42;
  }
  
  .sabine-debt-2 .sabine-debt-sheen::before {
    width: 56%;
  }
  
  /* stage 3 */
  .sabine-debt-3 .sabine-debt-fill {
    opacity: 0.96;
    animation: sabineDebtPulse 2.1s ease-in-out infinite;
  }
  
  .sabine-debt-3 .sabine-debt-fill::before {
    width: 100%;
  }
  
  .sabine-debt-3 .sabine-debt-sheen {
    opacity: 0.54;
  }
  
  .sabine-debt-3 .sabine-debt-sheen::before {
    width: 92%;
    animation: sabineDebtSweep 2.6s ease-in-out infinite;
  }
  
  .sabine-debt-3 .sabine-debt-fill::after {
    width: 100%;
    animation: sabineDebtSparkle 3.1s linear infinite;
  }
  
  @keyframes sabineDebtPulse {
    0%, 100% {
      filter:
        drop-shadow(0 0 6px rgba(255, 214, 120, 0.20))
        drop-shadow(0 0 12px rgba(255, 180, 70, 0.14));
    }
    50% {
      filter:
        drop-shadow(0 0 10px rgba(255, 226, 148, 0.34))
        drop-shadow(0 0 18px rgba(255, 190, 88, 0.22));
    }
  }
  
  @keyframes sabineDebtSweep {
    0%, 100% {
      transform: translateX(0);
      opacity: 0.46;
    }
    50% {
      transform: translateX(6px);
      opacity: 0.72;
    }
  }

  @keyframes sabineDebtSparkle {
    0% {
      transform: translateX(0);
      opacity: 0.48;
    }
    50% {
      transform: translateX(4px);
      opacity: 0.72;
    }
    100% {
      transform: translateX(0);
      opacity: 0.48;
    }
  }

/* ---------- Tokens ---------- */
.token {
  position: relative;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
  transition: transform .14s ease, filter .14s ease;
}

.slot .token {
  width: 112px;
  height: 112px;
  background: none;
}

.handRow .token {
  width: 96px;
  height: 96px;
  background: var(--asset-token-frame) center / contain no-repeat;
}

.handRow .token {
  transform: translateY(6px);
}

.handRow .tokenInner {
  border-radius: 0;
  overflow: visible;
}

.handRow .token:hover {
  transform: translateY(2px) scale(1.04);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.52));
}

.tokenInner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: visible;
}

.tokenArt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.token.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.token.played {
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 0 18px rgba(255, 219, 138, 0.28));
}

.tokenArt,
.boneArc,
.tokenFallback {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.handRow .token.sabine-recommended,
.handRow .token.sabine-recommended.player-turn-token {
  outline: 3px solid rgba(255, 228, 150, 1);
  box-shadow:
    0 0 0 3px rgba(120, 80, 30, 0.48),
    0 0 18px rgba(255, 225, 130, 0.72),
    0 0 32px rgba(255, 210, 110, 0.42);
  animation: sabineRecommendedPulse 1.2s ease-in-out infinite;
  transform: translateY(-2px) scale(1.04);
  z-index: 8;
}

@keyframes sabineRecommendedPulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(120, 80, 30, 0.48),
      0 0 18px rgba(255, 225, 130, 0.72),
      0 0 32px rgba(255, 210, 110, 0.42);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(120, 80, 30, 0.62),
      0 0 24px rgba(255, 235, 150, 0.95),
      0 0 40px rgba(255, 220, 120, 0.58);
    filter: brightness(1.08);
  }
}

.token.player-turn-token {
  box-shadow:
    0 0 0 1px rgba(130, 90, 34, 0.22),
    0 0 10px rgba(255, 225, 150, 0.20);
  animation: playerTurnGlimmer 1.8s ease-in-out infinite;
}

@keyframes playerTurnGlimmer {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(130, 90, 34, 0.22),
      0 0 10px rgba(255, 225, 150, 0.20);
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(130, 90, 34, 0.28),
      0 0 14px rgba(255, 225, 150, 0.30);
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45)) brightness(1.04);
  }
}

/* ---------- Utility polish (decorative divider) ---------- */
.dividerFlourish {
  height: 18px;
  width: 100%;
  background: var(--asset-divider) center / contain no-repeat;
  opacity: 0.9;
}

/* ---------- Modal / overlay system ---------- */
.modalOverlay,
.winOverlay,
.cbOverlay,
.sdOverlay,
.lbOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(5, 3, 2, 0.74);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

#mapModal.modalOverlay {
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
}

.map-modal {
  width: min(96vw, 1600px);
  height: calc(100vh - 20px);
  max-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
}

.modalOverlay.open,
.winOverlay.open,
.cbOverlay.open,
.sdOverlay.open,
.lbOverlay.open{
  display: flex;
}

.modal,
.winModal,
.cbModal,
.sdModal,
.lbModal{
  width: min(760px, 100%);
  max-height: min(86vh, 860px);
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(rgba(20, 12, 7, 0.96), rgba(12, 7, 5, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
  color: var(--ink);
}

.winOverlay {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(255, 190, 95, 0.08), rgba(0, 0, 0, 0) 48%),
    linear-gradient(rgba(10, 6, 4, 0.22), rgba(10, 6, 4, 0.48)),
    var(--asset-night-end) center / cover no-repeat;
  backdrop-filter: none;
}

.winOverlay[data-result="win"] {
  background:
    radial-gradient(circle at center, rgba(255, 220, 140, 0.20), rgba(0, 0, 0, 0) 44%),
    linear-gradient(rgba(10, 6, 4, 0.12), rgba(10, 6, 4, 0.34)),
    var(--asset-night-end) center / cover no-repeat;
}

.winOverlay[data-result="loss"] {
  background:
    radial-gradient(circle at center, rgba(150, 72, 44, 0.14), rgba(0, 0, 0, 0) 44%),
    linear-gradient(rgba(10, 6, 4, 0.32), rgba(10, 6, 4, 0.62)),
    var(--asset-night-end) center / cover no-repeat;
}

.lbModal {
  width: min(720px, 92vw);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lbHeader,
.lbBody {
  padding-left: 24px;
  padding-right: 24px;
}

.lbHeader {
  padding-top: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.lbTitle {
  font-family: "Cinzel", serif;
  font-size: 22px;
  color: var(--gold-bright);
}

.lbSub {
  margin-top: 6px;
  font-size: 15px;
  color: rgba(243,234,211,0.82);
}

.lbBody {
  padding-top: 10px;
  padding-bottom: 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.lbPortraitWrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -4px;
  margin-bottom: 10px;
  min-height: 132px;
}

.lbPortrait {
  display: block;
  width: min(520px, 100%);
  height: auto;
  margin: 0 auto;
}

#fbPortrait {
  width: min(330px, 82%);
}

.lbPrompt,
.lbTargetPrompt {
  text-align: center;
  font-size: 18px;
  line-height: 1.4;
  color: #f4ead3;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.lbActions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.lbTargetStage {
  margin-top: 10px;
}

.lbTargetChoices {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.lbTargetChoice {
  min-width: 220px;
  height: auto;
  padding: 18px 16px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  text-align: center;
}

.lbTargetChoice:hover {
  transform: translateY(-2px);
}

.lbTargetPortrait {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(230,199,137,0.42);
  background: rgba(0,0,0,0.25);
}

.lbTargetName {
  font-family: "Cinzel", serif;
  font-size: 20px;
  line-height: 1.1;
  color: var(--gold-bright);
}

.lbTargetMeta {
  font-size: 14px;
  line-height: 1.2;
  color: rgba(243,234,211,0.84);
  text-align: center;
}

.token.ladybug-selectable {
  cursor: pointer;
  filter: drop-shadow(0 0 14px rgba(242,215,155,0.22));
}

.token.ladybug-selectable:hover {
  transform: translateY(2px) scale(1.04);
  filter: drop-shadow(0 0 18px rgba(242,215,155,0.34));
}

.token.ladybug-pending {
  opacity: 0.34;
  filter: grayscale(0.38) brightness(0.72);
}

.token.ladybug-swapped {
  animation: ladybugSwapReveal 900ms ease;
}

@keyframes ladybugSwapReveal {
  0% {
    transform: scale(0.7) rotate(-8deg);
    opacity: 0;
    filter:
      brightness(2.2)
      drop-shadow(0 0 28px rgba(255, 240, 140, 0.95));
  }

  40% {
    transform: scale(1.15) rotate(3deg);
    opacity: 1;
  }

  65% {
    transform: scale(0.95);
    filter:
      brightness(1.6)
      drop-shadow(0 0 22px rgba(255, 220, 120, 0.7));
  }

  100% {
    transform: scale(1);
    filter: none;
  }
}

.winBodyGrid {
  display: grid;
  gap: 18px;
}

.winWinnerCard {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(230, 199, 137, 0.18);
  border-radius: 18px;
  background: linear-gradient(rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.winWinnerPortrait {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(230, 199, 137, 0.26);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.winPortraitImg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.winPortraitFallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: 20px;
  color: var(--gold-bright);
}

.winWinnerMeta {
  min-width: 0;
}

.winWinnerLabel {
  font-family: "Cinzel", serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(242, 215, 155, 0.82);
  margin-bottom: 6px;
}

.winWinnerName {
  font-family: "Cinzel", serif;
  font-size: 32px;
  line-height: 1.08;
  color: var(--gold-bright);
  margin-bottom: 8px;
}

.winWinnerFlavor {
  font-size: 16px;
  line-height: 1.4;
  color: rgba(243, 234, 211, 0.88);
}

.winQuotes {
  display: grid;
  gap: 10px;
}

.winQuotes .quote {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.winModal {
  width: min(680px, 92vw);
  max-height: min(82vh, 820px);
  border: 1px solid rgba(230, 199, 137, 0.35);
  border-radius: 22px;
  background: linear-gradient(rgba(24, 15, 10, 0.88), rgba(16, 10, 6, 0.92));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(230, 199, 137, 0.08);
}

.modalHeader,
.winHeader,
.cbHeader,
.sdHeader {
  padding:18px 22px;
  border-bottom:1px solid rgba(255, 255, 255, 0.08);
  background:linear-gradient(rgba(44, 25, 15, 0.64), rgba(16, 10, 6, 0.64));
}

.modalTitle,
.winTitle,
.cbTitle,
.sdTitle {
  font-family: "Cinzel", serif;
  font-size: 26px;
  color: var(--gold-bright);
}

.winSub,
.cbSub,
.sdSub {
  margin-top: 6px;
  font-size: 15px;
  color:rgba(243, 234, 211, 0.82);
}

.modalBody,
.winBody,
.cbBody,
.sdBody {
  padding: 20px 22px;
  line-height: 1.48;
  font-size: 15px;
  scrollbar-width: thin;
  max-height: 70vh;
  overflow-y: auto;
}

.sdBody {
  max-height: none;
  overflow-y: visible;
}

.modalBody::-webkit-scrollbar,
.winBody::-webkit-scrollbar,
.cbBody::-webkit-scrollbar,
.sdBody::-webkit-scrollbar {
  width: 8px;
}

.modalBody::-webkit-scrollbar-track,
.winBody::-webkit-scrollbar-track,
.cbBody::-webkit-scrollbar-track,
.sdBody::-webkit-scrollbar-track {
  background: transparent;
}

.modalBody::-webkit-scrollbar-thumb,
.winBody::-webkit-scrollbar-thumb,
.cbBody::-webkit-scrollbar-thumb,
.sdBody::-webkit-scrollbar-thumb {
  background: rgba(120, 85, 45, 0.65);
  border-radius: 6px;
}

.rulesTokenExplainer {
  display: block;
  margin: 12px auto 18px auto;
  max-width: 260px;
  height: auto;
  opacity: 0.95;
}

.rulesTokenCaption {
  text-align: center;
  font-family: "Libre Baskerville", serif;
  font-size: 13px;
  color: rgba(243, 234, 211, 0.75);
  margin-top: -6px;
  margin-bottom: 12px;
  line-height: 1.2;
}

.rulesTokenFloatWrap {
  display: block;
  margin: 0 0 6px;
}

.rulesTokenExplainer {
  float: right;
  width: 330px;
  margin-left: 12px;
  margin-right: 70px;
  margin-bottom: 10px;
}

.rulesTokenFloatWrap::after {
  content: "";
  display: block;
  clear: both;
}

.rulesTokenFloatWrap p {
  margin-top: 0;
  margin-bottom: 6px;
}

.rulesTokenFloatWrap ol {
  margin-top: 2px;
  margin-bottom: 0;
  padding-right: 18px;
}

.rulesTokenFloatWrap ol + p {
  margin-top: 14px; /* pushes "Elements:" down from the numbered list */
}

.rulesTokenFloatWrap p + ul {
  margin-top: 6px; /* gives breathing room under "Elements:" */
}

.rulesTokenCaption {
  display: none;
}

.rulesTokenRow {
  align-items: flex-start;
}

.rulesSubNote {
  font-size: 13px;
  opacity: 0.7;
  margin-top: -4px;
  margin-bottom: 6px;
}

/* ---------- End-night redesign ---------- */

.winModal {
  width: min(980px, 94vw);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  background: url("../images/ui/dialogue_result_frame.png") center / 100% 100% no-repeat;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

.winHero {
  padding: 82px 42px 14px;
  border-bottom: 0;
  background: transparent;
}

.winOverlay[data-result="win"] .winHero,
.winOverlay[data-result="loss"] .winHero {
  background: transparent;
}

.winHeroEyebrow {
  font-family: "Cinzel", serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(230, 199, 137, 0.98);
  margin-bottom: 16px;
  text-align: center;
  line-height: 1;
  transform: translateY(6px);
}

.winTitle {
  font-family: "Cinzel", serif;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.08;
  color: #f4e2b6;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  transform: translateY(6px);
}

.winOverlay[data-result="win"] .winTitle,
.winOverlay[data-result="loss"] .winTitle {
  color: #f4e2b6;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.winSub {
  margin: 20px auto 0;
  font-size: 16px;
  line-height: 1.4;
  color: rgba(243, 234, 211, 0.92);
  max-width: 38rem;
  text-align: center;
}

.winBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 42px 18px;
}

.winBodyInner {
  display: grid;
  gap: 14px;
}

.winReactionCard,
.winSection,
.winStatCard {
  border: 1px solid rgba(230, 199, 137, 0.10);
  border-radius: 20px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    rgba(20, 12, 7, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.winReactionCard {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.winReactionPortrait {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(230, 199, 137, 0.18);
  background: rgba(12, 8, 6, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.winPortraitImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.winPortraitFallback {
  padding: 12px;
  text-align: center;
  font-family: "Cinzel", serif;
  color: #f2d79b;
}

.winReactionCaption {
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(230, 199, 137, 0.82);
  margin-bottom: 6px;
}

.winReactionFlavor {
  font-size: 15px;
  line-height: 1.4;
  color: rgba(243, 234, 211, 0.92);
}

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

.winStatCard {
  padding: 14px 16px;
}

.winStatCardPrimary {
  background:
    linear-gradient(rgba(255, 220, 140, 0.05), rgba(255, 255, 255, 0)),
    rgba(20, 12, 7, 0.46);
}

.winStatLabel {
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(230, 199, 137, 0.9);
  margin-bottom: 10px;
}

.winStatValue {
  font-family: "Cinzel", serif;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1;
  color: #f6e8c8;
}

.winStatValueSmall {
  font-family: "Cinzel", serif;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1;
  color: #f6e8c8;
}

.winSection {
  padding: 14px 16px;
}

.winSectionTitle {
  font-family: "Cinzel", serif;
  font-size: 18px;
  color: #f2d79b;
  margin-bottom: 10px;
}

.winNextUnlockFlavor {
  font-size: 16px;
  line-height: 1.4;
  color: rgba(243, 234, 211, 0.82);
  margin-bottom: 8px;
}

.winNextUnlockProgress {
  font-family: "Cinzel", serif;
  font-size: 24px;
  color: #f5ead4;
}

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

.winUnlockColumn {
  min-width: 0;
}

.winUnlockList {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

.winUnlockList li {
  margin: 0;
  color: rgba(243, 234, 211, 0.92);
}

.winUnlockEmpty {
  color: rgba(243, 234, 211, 0.72);
  font-style: italic;
}

@media (max-width: 760px) {
  .winUnlockColumns {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.winReactionList {
  display: grid;
  gap: 12px;
}

.winReactionLine {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(243, 234, 211, 0.94);
  line-height: 1.45;
}

.secondaryResultBtn {
  min-width: 220px;
  height: 54px;
  padding: 0 24px;
  background-image: var(--asset-button-wide);
  font-size: 16px;
  opacity: 0.92;
}

#winPrimaryBtn {
  min-width: 240px;
  height: 54px;
  padding: 0 24px;
  background-image: var(--asset-button-wide);
  font-size: 16px;
}

.winOverlay[data-result="win"] #winPrimaryBtn {
  filter:
    brightness(1.04)
    drop-shadow(0 0 10px rgba(255, 215, 120, 0.18));
}

.winOverlay[data-result="loss"] #winPrimaryBtn {
  filter:
    brightness(0.98)
    drop-shadow(0 0 8px rgba(165, 84, 52, 0.14));
}

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

  .winReactionPortrait {
    width: 110px;
    height: 110px;
  }

  .winStatsGrid {
    grid-template-columns: 1fr;
  }
}

.modalFooter,
.winFooter,
.cbFooter{
  padding:16px 22px 18px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  border-top:1px solid rgba(255, 255, 255, 0.08);
}

.winFooter {
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 28px 24px;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 4, 2, 0.72);
  backdrop-filter: blur(3px);
  z-index: 2000;
}

.modalOverlay.open {
  display: flex;
}

.modal {
  width: min(92vw, 960px);
  max-height: min(88vh, 900px);
  overflow: hidden;
  border: 1px solid rgba(201, 169, 106, 0.35);
  border-radius: 18px;
  background:
    linear-gradient(rgba(36, 24, 14, 0.96), rgba(24, 16, 9, 0.96)),
    rgba(24, 16, 9, 0.96);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modalTitle {
  font-family: "Cinzel", serif;
  font-size: 24px;
  color: var(--gold-bright);
  letter-spacing: 0.03em;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 4, 2, 0.72);
  backdrop-filter: blur(3px);
  z-index: 2000;
}

.modalOverlay.open {
  display: flex;
}

.modal {
  width: min(92vw, 960px);
  max-height: min(88vh, 900px);
  overflow: hidden;
  border: 1px solid rgba(201, 169, 106, 0.35);
  border-radius: 18px;
  background:
    linear-gradient(rgba(36, 24, 14, 0.96), rgba(24, 16, 9, 0.96)),
    rgba(24, 16, 9, 0.96);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modalTitle {
  font-family: "Cinzel", serif;
  font-size: 18px;
  color: var(--gold-bright);
  letter-spacing: 0.03em;
}

.modalClose {
  width: 36px;
  height: 36px;
  background:rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: var(--ink);
  font-size: 16px;
}

.cbChoice {
  width: 100%;
  padding: 14px 16px;
  margin-top: 10px;
  background:rgba(255, 255, 255, 0.04);
  border:1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  text-align: left;
  color: var(--ink);
}

.map-modal {
  width: min(96vw, 1600px);
  height: min(90vh, 980px);
  max-width: none;
  max-height: none;
}

.mapModalBody {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  padding: 10px 14px 14px;
  overflow: hidden;
  display: flex;
}

.mapLayout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.map-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1120px;
  max-height: 100%;
  margin: 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 14px 28px rgba(0, 0, 0, 0.28);
}

.map-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

#mapMarkers {
  position: absolute;
  inset: 0;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 108px;
  padding: 6px 10px;
  border: 1px solid rgba(201, 169, 106, 0.95);
  border-radius: 999px;
  background: rgba(24, 16, 9, 0.88);
  color: #f5e6c8;
  font-family: "Cinzel", serif;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    transform 0.14s ease,
    filter 0.14s ease,
    opacity 0.14s ease,
    box-shadow 0.14s ease;
}

.map-marker:hover {
  transform: translate(-50%, -50%) translateY(-1px);
  filter: brightness(1.06);
}

.map-marker.locked {
  opacity: 0.42;
  cursor: default;
  filter: grayscale(0.15);
}

.map-marker.locked:hover {
  transform: translate(-50%, -50%);
  filter: grayscale(0.15);
}

.map-marker.active {
  box-shadow:
    0 0 0 1px rgba(255, 222, 143, 0.95),
    0 0 12px rgba(255, 214, 120, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.35);
}

.mapPreviewPanel {
  width: 100%;
  max-width: 360px;
  align-self: stretch;
  min-height: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(24, 16, 9, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 14px 28px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mapPreviewImageWrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(11, 7, 4, 0.55);
  aspect-ratio: 16 / 9;
}

.mapPreviewImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mapPreviewLockBadge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 12, 7, 0.86);
  border: 1px solid rgba(201, 169, 106, 0.72);
  color: #f2dfb4;
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mapPreviewName {
  font-family: "Cinzel", serif;
  font-size: 24px;
  line-height: 1.05;
  color: #f5e6c8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.mapPreviewTagline {
  margin-top: -4px;
  font-family: "Cinzel", serif;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d9bc82;
}

.mapPreviewFlavor {
  min-height: 0;
  color: rgba(243, 234, 211, 0.92);
  font-size: 15px;
  line-height: 1.5;
}

.mapPreviewCharacter {
  color: rgba(230, 215, 184, 0.9);
  font-size: 14px;
  line-height: 1.45;
  padding-top: 2px;
}

.mapPreviewQuoteWrap {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(11, 7, 4, 0.35);
  border: 1px solid rgba(201, 169, 106, 0.18);
}

.mapPreviewQuote {
  color: #f1e3c0;
  font-size: 14px;
  line-height: 1.45;
  font-style: italic;
}

.mapPreviewQuoteBy {
  margin-top: 8px;
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #d9bc82;
}

.mapPreviewStatus {
  margin-top: auto;
  font-family: "Cinzel", serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #d9bc82;
}

.mapPreviewBookLink {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(11, 7, 4, 0.35);
  border: 1px solid rgba(201, 169, 106, 0.18);
  color: inherit;
  text-decoration: none;
  transition: transform 0.14s ease, filter 0.14s ease, border-color 0.14s ease;
}

.mapPreviewBookLink:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  border-color: rgba(201, 169, 106, 0.34);
}

.mapPreviewBookImage {
  width: 64px;
  height: auto;
  flex: 0 0 64px;
  object-fit: contain;
  display: block;
}

.mapPreviewBookMeta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mapPreviewBookEyebrow {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d9bc82;
}

.mapPreviewBookTitle {
  color: #f5e6c8;
  font-size: 16px;
  line-height: 1.25;
}

.mapPreviewPanel.is-locked .mapPreviewImage {
  filter: grayscale(0.6) brightness(0.55);
}

.mapPreviewPanel.is-locked .mapPreviewStatus {
  color: #e0c48e;
}

.mapPreviewPanel.is-unlocked .mapPreviewImage {
  filter: none;
}

.map-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c9a96a;
  box-shadow:
    0 0 0 2px rgba(24, 16, 9, 0.88),
    0 0 8px rgba(255, 214, 120, 0.28);
}

.map-marker.locked::before {
  opacity: 0.65;
}

.map-marker.active::before {
  background: #f1d28c;
  box-shadow:
    0 0 0 2px rgba(24, 16, 9, 0.88),
    0 0 12px rgba(255, 214, 120, 0.55);
}

/* Reset Night confirmation modal intent */
#resetBtn.confirming {
  filter: brightness(1.1);
}


.unlockBanner {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 2200;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.unlockBanner.show {
  opacity: 1;
  visibility: visible;
}

.unlockBannerInner {
  pointer-events: auto;
  width: min(880px, 92vw);
  min-height: 420px;
  padding: 34px 56px 42px;
  border: 0;
  border-radius: 0;
  background: url("../images/ui/special_event_overlay.png") center / 100% 100% no-repeat;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
  text-align: center;
}

.unlockBannerEyebrow {
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e6c789;
  margin-bottom: 8px;
}

.unlockBannerTitle {
  font-family: "Cinzel", serif;
  font-size: 26px;
  color: #f5ead4;
  margin-bottom: 8px;
}

.unlockBannerText {
  font-size: 16px;
  line-height: 1.35;
  color: rgba(243, 234, 211, 0.92);
  white-space: pre-line;
}

.unlockBannerPreview {
  margin: 14px auto 14px;
  width: min(100%, 260px);
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: transparent;
}

.unlockBannerPreview img {
  display: block;
  width: 100%;
  height: auto;
}

.unlockBannerHint {
  margin-top: 10px;
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(230, 199, 137, 0.92);
}

.unlockContinueBtn {
  margin-top: 20px;
  width: 194px;
  min-width: 194px;
  height: 52px;
  padding: 0 12px;
  border: none;
  border-radius: 0;
  background-image: var(--asset-button-wide);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  font-family: "Cinzel", serif;
  font-size: 16px;
  color: #f5e6c8;
  cursor: pointer;
  text-align: center;
}

.gameToast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(12px);
  width: min(520px, calc(100vw - 32px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2400;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease;
}

.gameToast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.gameToastInner {
  padding: 18px 22px;
  background: url("../images/ui/special_event_overlay.png") center / 100% 100% no-repeat;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.46);
  text-align: center;
}

.gameToastTitle {
  font-family: "Cinzel", serif;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: #f5ead4;
  margin-bottom: 6px;
}

.gameToastText {
  font-family: "Libre Baskerville", serif;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(243, 234, 211, 0.94);
  white-space: pre-line;
}

/* ---------- Sudden Death Overlay ---------- */
.sdModal {
  width: min(860px, 92vw);
  max-height: min(86vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sdBody {
  padding: 14px 18px 18px;
  overflow-y: visible;
  overflow-x: hidden;
  max-height: none;
}

.sdCards{
  min-width: 0;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
  align-items:start;
  margin-bottom:14px;
}

.sdCard{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 110px;
  align-items:center;
  gap:16px;
  padding:14px 16px;
  border-radius:20px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  min-height:0;
  text-align:left;
}

.sdCard.sdWinner{
  border-color:rgba(231, 201, 138, 0.72);
  box-shadow:0 0 0 1px rgba(231, 201, 138, 0.18), 0 0 28px rgba(231, 201, 138, 0.14);
}

.sdMetaWrap{
  display:grid;
  grid-template-columns:96px minmax(0, 1fr);
  align-items:center;
  gap:14px;
  width:100%;
  min-width:0;
}

.sdPortrait{
  width:96px;
  height:96px;
  aspect-ratio:1 / 1;
  object-fit:cover;
  display:block;
  border-radius:999px;
  border:4px solid rgba(196, 144, 82, 0.85);
  box-shadow:0 10px 28px rgba(0,0,0,0.38);
  background:#120a06;
}

.sdCard .n{
  font-family:"Cinzel", serif;
  font-size:16px;
  color:var(--gold-bright);
}

.sdCard .m{
  font-size:13px;
  color:rgba(243, 234, 211, 0.76);
}

.sdTokenSlot{
  width:110px;
  height:110px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-top:0;
}

.sdTokenSlot .token{
  width:100%;
  height:100%;
}

.sdCenter{
  display:flex;
  justify-content:center;
  align-items:center;
}

.sdStackBtn,
.sdContinueBtn{
  min-width:170px;
  min-height:54px;
  padding:12px 22px;
  border-radius:16px;
  border:1px solid rgba(231, 201, 138, 0.35);
  background:linear-gradient(rgba(69, 40, 21, 0.92), rgba(38, 21, 11, 0.96));
  color:var(--gold-bright);
  font-family:"Cinzel", serif;
  font-size:18px;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(0,0,0,0.28);
}

.sdStackBtn:hover,
.sdContinueBtn:hover{
  filter:brightness(1.08);
}

.sdStackBtn:disabled,
.sdContinueBtn:disabled{
  opacity:0.65;
  cursor:default;
}

.sdResults{
  margin-top:12px;
  padding:12px 14px;
  border-radius:16px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  text-align:center;
  line-height:1.4;
  font-size:14px;
}

.sdWinnerLine{
  display:block;
  margin-top:6px;
  font-family:"Cinzel", serif;
  color:var(--gold-bright);
  font-size:16px;
}

.sdWhyLine{
  margin-top:10px;
  font-size:13px;
  line-height:1.45;
  color:rgba(243, 234, 211, 0.88);
}

/* ---------- Responsive foundation ---------- */

/* Tablet landscape */
@media (max-width: 1180px) and (min-width: 981px) {
  :root {
    --left-w: 300px;
    --right-w: 300px;
    --center-min-w: 0px;
    --grid-gap: 14px;
    --shell-pad-x: 10px;
    --shell-pad-y: 10px;
    --header-h: 118px;
    --controls-h: 64px;
    --topbar-offset-y: 0px;
  }

  body {
    overflow-x: hidden;
  }

  .wrap {
    width: min(100vw, 1180px);
    min-height: 100dvh;
    height: auto;
    padding: 10px;
    row-gap: 10px;
    grid-template-rows:
      var(--header-h)
      var(--controls-h)
      auto
      auto
      var(--copyright-h);
  }

  .titleMain {
    font-size: clamp(38px, 4vw, 50px);
  }

  .titleSub {
    font-size: clamp(16px, 1.8vw, 22px);
  }

  .topbar-left-group,
  .topbar-right-group,
  .topbar-center-group {
    top: 0;
  }

  .topbar-left-group,
  .topbar-right-group {
    align-items: center;
  }

  .gameGrid {
    top: 0;
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
  }

  .leftColumn {
    top: 0;
    width: 300px;
    flex-basis: 300px;
  }

  .leftPanel,
  .tavernReputationPanel {
    width: 300px;
    height: 470px;
  }

  .tavernReputationInner {
    left: 22px;
    right: 22px;
    top: 376px;
    height: 72px;
  }

  .leftPanel .panelInner {
    inset: 8px 18px 24px 18px;
  }

  .playerRow .who {
    left: 64px;
    right: 82px;
    top: 20px;
  }

  .playerRow .name {
    font-size: 16px;
  }

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

  .playerRow .pouchWrap {
    right: 20px;
    top: 10px;
    width: 60px;
    height: 54px;
  }

  .playerRow .pouchImg {
    width: 52px;
  }

  .playerRow .pouchCount {
    left: 12px;
    bottom: 6px;
    width: 36px;
    height: 22px;
    font-size: 13px;
  }

  .centerPanel {
    min-height: 420px;
  }

  .tableZone {
    height: min(100%, 500px);
    min-height: 400px;
    padding-top: 6px;
  }

  .table {
    width: min(100%, 760px);
  }

  .seat {
    width: 148px;
  }

  .slot {
    width: 118px;
    height: 118px;
  }

  .seat.top {
    top: 28px;
  }

  .seat.bottom {
    bottom: 40px;
  }

  .seat.left {
    left: 42px;
  }

  .seat.right {
    right: 42px;
  }

  .seat.left .bubble {
    left: 116px;
  }

  .seat.right .bubble {
    right: 116px;
  }

  .seat.bottom .bubble {
    bottom: 126px;
  }

  .trickBanner {
    font-size: 24px;
    padding: 14px 20px;
  }

  .rightPanel {
    top: 0;
    min-height: 470px;
  }

  .logPanel {
    min-height: 470px;
  }

  .logBox {
    left: 30px;
    right: 34px;
    top: 88px;
    bottom: 90px;
    padding: 10px 14px 14px;
    font-size: 14px;
  }

  .lowerGrid {
    top: 0;
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
  }

  .leftUtility {
    min-height: 190px;
  }

  .bottomBarTop {
    top: 54px;
  }

  #blossomPanel {
    margin-top: 34px;
    height: 150px;
  }

  #blossomPanel .bcBubble {
    left: 112px;
    right: 28px;
    top: 4px;
    bottom: 16px;
  }

  #blossomCoinCounter {
    left: 220px;
    bottom: 6px;
    width: 64px;
    font-size: 24px;
  }

  .bottomBar {
    top: 0;
    width: min(100%, 760px);
    min-height: 190px;
    grid-template-rows: 62px 1fr;
    padding-bottom: 22px;
  }

  .ruleLine {
    width: min(100%, 620px);
    height: 62px;
    font-size: 13px;
    padding: 0 16px 4px;
  }

  .handRow {
    gap: 6px;
    padding: 0 44px 14px;
    min-height: 118px;
  }

  .handRow .token {
    width: 84px;
    height: 84px;
  }

  .rightUtility {
    top: 0;
    min-height: 190px;
  }

  .utilityButtons {
    top: 0;
    gap: 8px;
  }

  .hintPanel {
    top: 0;
    min-height: 170px;
  }

  .sabineInner {
    left: 28px;
    right: 34px;
    top: 6px;
    bottom: 24px;
    padding: 12px 14px 10px;
  }

  .hintPanel .title {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .hintPanel .text {
    font-size: 14px;
    line-height: 1.28;
  }

  .footerNote {
    white-space: normal;
    padding: 0 14px;
  }
}

/* Tablet portrait */
@media (max-width: 980px) and (min-width: 701px) {
  :root {
    --shell-pad-x: 10px;
    --shell-pad-y: 10px;
    --header-h: 112px;
    --controls-h: auto;
    --topbar-offset-y: 0px;
  }

  body {
    overflow-x: hidden;
    background-attachment: scroll;
  }

  .wrap {
    width: min(100vw, 980px);
    min-height: 100dvh;
    height: auto;
    padding: 10px;
    row-gap: 12px;
    grid-template-rows: auto auto auto auto var(--copyright-h);
  }

  .headerArea {
    grid-row: auto;
    grid-template-rows: auto auto;
  }

  .titleBlock {
    height: 112px;
  }

  .titleMain {
    font-size: clamp(34px, 5vw, 46px);
  }

  .titleSub {
    font-size: clamp(15px, 2vw, 20px);
  }

  .topbar {
    top: 0;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 10px;
  }

  .topbar-left-group,
  .topbar-center-group,
  .topbar-right-group {
    top: 0;
    align-items: center;
  }

  .topbar-left-group {
    justify-self: start;
  }

  .topbar-center-group {
    justify-self: center;
  }

  .topbar-right-group {
    justify-self: end;
  }

  .map-btn {
    width: 66px;
    height: 66px;
  }

  .map-btn img {
    width: 56px;
    height: 56px;
  }

  .gameGrid {
    top: 0;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "center center"
      "left right";
    gap: 14px;
    align-items: start;
  }

  .leftColumn {
    grid-area: left;
    top: 0;
    width: 100%;
    flex-basis: auto;
    align-items: stretch;
  }

  .centerPanel {
    grid-area: center;
    min-height: 420px;
  }

  .rightPanel {
    grid-area: right;
    top: 0;
    min-height: 430px;
  }

  .leftPanel,
  .tavernReputationPanel {
    width: 100%;
    max-width: 360px;
    height: 470px;
    margin: 0 auto;
  }

  .tavernReputationInner {
    left: 26px;
    right: 26px;
    top: 378px;
    height: 72px;
  }

  .leftPanel .panelInner {
    inset: 8px 20px 24px 20px;
  }

  .centerPanel .panelInner {
    align-items: center;
  }

  .tableZone {
    height: min(100%, 500px);
    min-height: 410px;
    padding-top: 6px;
  }

  .table {
    width: min(100%, 760px);
  }

  .seat {
    width: 148px;
  }

  .slot {
    width: 116px;
    height: 116px;
  }

  .seat.top {
    top: 26px;
  }

  .seat.bottom {
    bottom: 38px;
  }

  .seat.left {
    left: 40px;
  }

  .seat.right {
    right: 40px;
  }

  .seat.left .bubble {
    left: 112px;
  }

  .seat.right .bubble {
    right: 112px;
  }

  .seat.bottom .bubble {
    bottom: 124px;
  }

  .trickBanner {
    font-size: 24px;
    padding: 14px 20px;
  }

  .logPanel {
    min-height: 470px;
  }

  .logBox {
    left: 32px;
    right: 36px;
    top: 90px;
    bottom: 92px;
    padding: 10px 14px 14px;
    font-size: 14px;
  }

  .lowerGrid {
    top: 0;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "bottom bottom"
      "leftutil rightutil";
    gap: 14px;
    align-items: start;
  }

  .leftUtility {
    grid-area: leftutil;
    min-height: 200px;
  }

  .bottomBar {
    grid-area: bottom;
    top: 0;
    width: min(100%, 760px);
    min-height: 196px;
    margin: 0 auto;
    grid-template-rows: 62px 1fr;
    padding-bottom: 22px;
  }

  .rightUtility {
    grid-area: rightutil;
    top: 0;
    min-height: 196px;
  }

  .bottomBarTop {
    top: 48px;
  }

  #blossomPanel {
    margin-top: 34px;
    height: 150px;
  }

  #blossomPanel .bcBubble {
    left: 116px;
    right: 30px;
    top: 4px;
    bottom: 16px;
  }

  #blossomCoinCounter {
    left: auto;
    right: 12px;
    bottom: 6px;
    width: 60px;
    font-size: 23px;
  }

  .ruleLine {
    width: min(100%, 640px);
    height: 62px;
    padding: 0 16px 4px;
    font-size: 13px;
  }

  .handRow {
    gap: 6px;
    padding: 0 36px 14px;
    min-height: 120px;
  }

  .handRow .token {
    width: 82px;
    height: 82px;
  }

  .utilityButtons {
    top: 0;
    gap: 8px;
  }

  .hintPanel {
    top: 0;
    min-height: 174px;
  }

  .sabineInner {
    left: 30px;
    right: 34px;
    top: 6px;
    bottom: 24px;
    padding: 12px 14px 10px;
  }

  .hintPanel .title {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .hintPanel .text {
    font-size: 14px;
    line-height: 1.28;
  }

  .footerNote {
    white-space: normal;
    padding: 0 16px;
  }
}

/* Phones unsupported */
@media (max-width: 700px) {
  .wrap,
  .headerArea,
  .gameGrid,
  .lowerGrid,
  .footerNote {
    display: none !important;
  }

  body::after {
    content: "Crossbones of Aeslion is not supported on phones yet. Please open it on a tablet, laptop, or desktop.";
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    text-align: center;
    font-family: "Cinzel", serif;
    font-size: 20px;
    line-height: 1.5;
    color: #f3ead3;
    background:
      linear-gradient(rgba(11, 7, 4, 0.92), rgba(11, 7, 4, 0.92)),
      var(--asset-bg) center / cover no-repeat;
    z-index: 10000;
  }
}

/* =========================================================
   Token Bone Pip Rendering
   ========================================================= */

   .boneArc {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
  }
  
  .bonePip {
    position: absolute;
    width: 20px;
    height: auto;
    display: block;
    pointer-events: none;
  }

/* =========================================================
   Active Player Highlight
   ========================================================= */

   .activeSeat {
    filter: drop-shadow(0 0 12px rgba(255,210,120,0.9));
  }
  
  .activePlayer {
    box-shadow: 0 0 14px rgba(255,210,120,0.8);
  }  

/* =========================================================
   ONBOARDING OVERLAYS
   ========================================================= */

   .tutorialOverlay {
    backdrop-filter: blur(6px);
  }
  
  .welcomeOverlay {
    backdrop-filter: blur(6px);
  }
  
  .welcomeCard {
    position: relative;
    width: min(620px, 72vw);
    aspect-ratio: 1280 / 1344;
    background-image: url("../images/ui/welcome_card_overlay.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.62));
    animation: parchmentFadeIn 0.4s ease-out;
  }
  
  .welcomeCardInner {
    width: 62%;
    max-width: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 86px;
  }
  
  .welcomeTitle {
    margin: 0 0 12px;
    font-family: "Cinzel", serif;
    font-size: 26px;
    line-height: 1.1;
    color: #f3e7cb;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  .welcomeSubtitle {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.3;
    color: rgba(243, 231, 203, 0.92);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
    white-space: nowrap;
  }
  
  .welcomeNoBreak {
    white-space: nowrap;
  }
  
  .welcomeBody {
    margin: 0 0 22px;
    font-size: 16px;
    line-height: 1.35;
    color: rgba(243, 231, 203, 0.96);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  .welcomeActions {
    display: flex;
    justify-content: center;
  }
  
  #welcomeEnterBtn {
    width: 214px;
    min-width: 214px;
    height: 52px;
    padding: 0 14px;
    background-image: var(--asset-button-wide);
    background-size: 100% 100%;
    font-size: 16px;
    outline: none;
    box-shadow: none;
  }
  
  #welcomeEnterBtn:focus,
  #welcomeEnterBtn:focus-visible {
    outline: none;
    box-shadow: none;
  }

  .parchmentModal {
    position: relative;
    width: min(940px, 94vw);
    aspect-ratio: 16 / 11;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.62));
    animation: parchmentFadeIn 0.4s ease-out;
  }
  
  .sabineParchment {
    background-image: url("../images/ui/sabine_intro_parchment.png");
  }
  
  .malekParchment {
    background-image: url("../images/ui/malek_intro_parchment.png");
  }
  
  .parchmentContent {
    width: 76%;
    height: 76%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .parchmentContent--intro {
    width: 78%;
    height: 78%;
  }
  
  .parchmentContent--sabine {
    width: 76%;
    height: 76%;
  }
  
  .parchmentText {
    font-family: "Libre Baskerville", serif;
    font-size: 18px;
    line-height: 1.5;
    color: #2a1a0f;
    text-align: center;
    text-shadow: none;
  }
  
  .parchmentText p {
    margin: 0 0 12px;
  }
  
  .parchmentText--intro {
    padding-top: 26px;
  }
  
  .parchmentText--intro p {
    margin-bottom: 12px;
  }
  
  .parchmentText--sabine {
    padding-top: 78px;
  }
  
  .parchmentText--sabine p {
    margin-bottom: 12px;
  }
  
  .parchmentLogTitle {
    font-family: "Cinzel", serif;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    margin-bottom: 20px;
  }
  
  .parchmentWarning {
    margin-top: 8px;
    font-weight: 700;
    color: #3a1f12;
  }
  
  .parchmentSignature {
    margin-top: 16px;
    font-family: "Cinzel", serif;
    font-size: 20px;
    letter-spacing: 0.04em;
  }
  
  .parchmentSignature--malek {
    margin-top: 18px;
  }
  
  .parchmentActions {
    display: flex;
    justify-content: center;
    gap: 16px;
  }
  
  .parchmentActions--on-note {
    margin-top: 10px;
    padding-bottom: 4px;
  }
  
  .parchmentActions button {
    min-width: 220px;
    height: 48px;
    padding: 0 18px;
    background: transparent;
    border: 1px solid rgba(63, 39, 22, 0.55);
    border-radius: 10px;
    color: #2a1a0f;
    font-family: "Cinzel", serif;
    font-size: 15px;
    letter-spacing: 0.03em;
    text-shadow: none;
    box-shadow: 0 1px 0 rgba(255, 245, 220, 0.18) inset;
  }
  
  .parchmentActions button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    background: rgba(90, 58, 35, 0.06);
  }
  
  .parchmentActions button:active {
    transform: translateY(1px);
  }
  
  @keyframes parchmentFadeIn {
    0% {
      opacity: 0;
      transform: scale(0.96);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }

.cbChoice {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 14px;
}

.cbChoicePortraitWrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cbChoicePortrait {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(230, 199, 137, 0.34);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 220, 140, 0.06) inset;
}

.cbChoiceText {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* =========================================================
   PARCHMENT OVERLAYS (Sabine / Malek)
   ========================================================= */

/* =========================================================
   PARCHMENT OVERLAYS (Sabine / Malek)
   ========================================================= */

   .parchmentModal {
    position: relative;
    width: min(940px, 94vw);
    aspect-ratio: 16 / 11;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.62));
    animation: parchmentFadeIn 0.4s ease-out;
  }
  
  .sabineParchment {
    background-image: url("../images/ui/sabine_intro_parchment.png");
  }
  
  .malekParchment {
    background-image: url("../images/ui/malek_intro_parchment.png");
  }
  
  .parchmentContent {
    width: 76%;
    height: 76%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .parchmentContent--intro {
    width: 78%;
    height: 78%;
  }
  
  .parchmentContent--sabine {
    width: 76%;
    height: 76%;
  }
  
  .parchmentText {
    font-family: "Libre Baskerville", serif;
    font-size: 18px;
    line-height: 1.5;
    color: #2a1a0f;
    text-align: center;
    text-shadow: none;
  }
  
  .parchmentText p {
    margin: 0 0 12px;
  }
  
  .parchmentText--intro p {
    margin-bottom: 12px;
  }
  
  .parchmentText--sabine p {
    margin-bottom: 12px;
  }
  
  .parchmentLogTitle {
    font-family: "Cinzel", serif;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    margin-bottom: 20px;
  }
  
  .parchmentWarning {
    margin-top: 8px;
    font-weight: 700;
    color: #3a1f12;
  }
  
  .parchmentSignature {
    margin-top: 16px;
    font-family: "Cinzel", serif;
    font-size: 20px;
    letter-spacing: 0.04em;
  }
  
  .parchmentSignature--malek {
    margin-top: 18px;
  }
  
  .parchmentActions {
    display: flex;
    justify-content: center;
    gap: 16px;
  }
  
  .parchmentActions--on-note {
    margin-top: 10px;
    padding-bottom: 4px;
  }
  
  .parchmentActions button {
    min-width: 220px;
    height: 48px;
    padding: 0 18px;
    background: transparent;
    border: 1px solid rgba(63, 39, 22, 0.55);
    border-radius: 10px;
    color: #2a1a0f;
    font-family: "Cinzel", serif;
    font-size: 15px;
    letter-spacing: 0.03em;
    text-shadow: none;
    box-shadow: 0 1px 0 rgba(255, 245, 220, 0.18) inset;
  }
  
  .parchmentActions button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    background: rgba(90, 58, 35, 0.06);
  }
  
  .parchmentActions button:active {
    transform: translateY(1px);
  }
  
  @keyframes parchmentFadeIn {
    0% {
      opacity: 0;
      transform: scale(0.96);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }

/* =========================================================
   EVERDUSK OVERLAY SWAP
   Crossbones / Sudden Death / Rules
   ========================================================= */

/* ---------- Shared EverDusk frame treatment ---------- */
#rulesOverlay,
#cbOverlay,
#sdOverlay {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#rulesOverlay .modal,
#cbOverlay .cbModal,
#sdOverlay .sdModal {
  border: 0;
  border-radius: 0;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: #f3ead3;
  overflow: hidden;
}

/* =========================================================
   RULES OVERLAY
   ========================================================= */

   #rulesOverlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  
  #rulesOverlay .modal {
    width: min(1100px, 95vw);
    max-height: min(90vh, 900px);
    background-image: url("../images/ui/rules_overlay.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
    color: #f3ead3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
  }
  
  #rulesOverlay .modalHeader {
    position: relative;
    min-height: 100px;
    padding: 0;
    border: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  
  #rulesOverlay .modalTitle {
    margin-top: 24px;
    font-family: "Cinzel", serif;
    font-size: 28px;
    line-height: 1.05;
    color: #f5ead4;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  #rulesOverlay .modalClose {
    position: absolute;
    top: 34px;
    right: 18px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f5ead4;
    font-size: 34px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  #rulesOverlay .modalClose:hover {
    transform: scale(1.04);
    filter: brightness(1.10);
  }
  
  #rulesOverlay .modalBody {
    flex: 1 1 auto;
    max-height: min(70vh, 650px);
    overflow-y: auto;
    padding: 10px 84px 34px;
    background: transparent;
    color: rgba(243, 234, 211, 0.96);
    line-height: 1.55;
    scrollbar-gutter: stable both-edges;
  }
  
  #rulesOverlay .modalBody p,
  #rulesOverlay .modalBody li {
    font-size: 17px;
  }
  
  #rulesOverlay .modalBody ul,
  #rulesOverlay .modalBody ol {
    padding-left: 24px;
  }
  
  #rulesOverlay .modalFooter {
    display: none;
  }

/* =========================================================
   CROSSBONES OVERLAY
   ========================================================= */

   #cbOverlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  
  #cbOverlay .cbModal {
    width: min(980px, 94vw);
    max-height: min(88vh, 760px);
    background-image: url("../images/ui/special_event_overlay.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
    color: #f3ead3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  #cbOverlay .cbHeader,
  #cbOverlay .cbBody,
  #cbOverlay .cbFooter {
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  
  #cbOverlay .cbHeader {
    min-height: 0;
    padding: 24px 56px 0;
    text-align: center;
  }
  
  #cbOverlay .cbTitle {
    font-family: "Cinzel", serif;
    font-size: 34px;
    line-height: 1.05;
    color: #f5ead4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  #cbOverlay .cbSub {
    margin-top: 10px;
    font-size: 18px;
    line-height: 1.35;
    color: rgba(243, 234, 211, 0.90);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  #cbOverlay .cbBody {
    padding: 18px 56px 18px;
    text-align: center;
  }
  
  #cbOverlay #cbPromptText {
    margin-bottom: 18px;
    font-size: 22px;
    color: rgba(243, 234, 211, 0.96);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  #cbOverlay .cbChoices {
    width: min(520px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 14px;
  }
  
  #cbOverlay .cbChoice {
    width: 100%;
    min-height: 88px;
    padding: 12px 18px;
    border: 1px solid rgba(230, 199, 137, 0.26);
    border-radius: 18px;
    background: linear-gradient(rgba(32, 18, 11, 0.58), rgba(18, 10, 6, 0.48));
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.28),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    align-items: center;
    text-align: left;
  }
  
  #cbOverlay .cbChoice:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow:
      0 14px 30px rgba(0, 0, 0, 0.34),
      0 0 0 1px rgba(230, 199, 137, 0.10),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
  
  #cbOverlay .cbChoicePortraitWrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(230, 199, 137, 0.50);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.30);
  }
  
  #cbOverlay .cbChoicePortrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  #cbOverlay .cbChoiceText .name {
    font-family: "Cinzel", serif;
    font-size: 24px;
    line-height: 1.05;
    color: #f5ead4;
  }
  
  #cbOverlay .cbChoiceText .meta {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.25;
    color: rgba(243, 234, 211, 0.78);
    text-transform: none;
  }
  
  #cbOverlay .cbFooter {
    display: flex;
    justify-content: center;
    padding: 6px 0 28px;
  }
  
  #cbOverlay .cbFooter button {
    width: 194px;
    min-width: 194px;
    height: 52px;
    padding: 0 12px;
    background-image: var(--asset-button-wide);
    background-size: 100% 100%;
    font-size: 16px;
    outline: none;
    box-shadow: none;
  }
  
  #cbOverlay .cbFooter button:focus,
  #cbOverlay .cbFooter button:focus-visible {
    outline: none;
    box-shadow: none;
  }

/* =========================================================
   SUDDEN DEATH OVERLAY
   ========================================================= */

   #sdOverlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  
  #sdOverlay .sdModal {
    width: min(1080px, 95vw);
    max-height: min(90vh, 860px);
    background-image: url("../images/ui/special_event_overlay.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
    color: #f3ead3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  #sdOverlay .sdHeader,
  #sdOverlay .sdBody,
  #sdOverlay .sdCenter,
  #sdOverlay .sdResults {
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  
  #sdOverlay .sdHeader {
    min-height: 0;
    padding: 24px 56px 0;
    text-align: center;
  }
  
  #sdOverlay .sdTitle {
    font-family: "Cinzel", serif;
    font-size: 36px;
    line-height: 1.05;
    color: #f5ead4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  #sdOverlay .sdSub {
    margin-top: 10px;
    font-size: 18px;
    line-height: 1.35;
    color: rgba(243, 234, 211, 0.90);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
  }
  
  #sdOverlay .sdBody {
    padding: 18px 56px 30px;
  }
  
  #sdOverlay .sdCards {
    margin-bottom: 16px;
  }
  
  #sdOverlay .sdCenter {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 14px 0 10px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  
  #sdOverlay .sdResults {
    margin-top: 16px;
    padding: 0;
    text-align: center;
    color: rgba(243, 234, 211, 0.96);
  }
  
  #sdOverlay .sdStackBtn,
  #sdOverlay .sdContinueBtn {
    width: 178px;
    min-width: 178px;
    height: 52px;
    padding: 0 10px;
  
    appearance: none;
    -webkit-appearance: none;
  
    border: 0;
    outline: none;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
    background-image: var(--asset-button-wide);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
  
    font-size: 16px;
  }

#sdOverlay .sdStackBtn:hover,
#sdOverlay .sdContinueBtn:hover,
#sdOverlay .sdStackBtn:focus,
#sdOverlay .sdStackBtn:focus-visible,
#sdOverlay .sdContinueBtn:focus,
#sdOverlay .sdContinueBtn:focus-visible,
#sdOverlay .sdStackBtn:active,
#sdOverlay .sdContinueBtn:active {
  border: 0;
  outline: none;
  box-shadow: none;
  background-color: transparent;
}
  
  #sdOverlay .sdWinner {
    filter:
      brightness(1.08)
      drop-shadow(0 0 10px rgba(255, 220, 140, 0.28))
      drop-shadow(0 0 18px rgba(255, 220, 140, 0.20));
  }

  /* =========================================================
   EVERDUSK COMPANION OVERLAYS
   Ladybug / Firebreath
   ========================================================= */

#lbOverlay,
#fbOverlay {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#lbOverlay .lbModal,
#fbOverlay .lbModal {
  width: min(980px, 94vw);
  max-height: min(88vh, 820px);
  background-image: url("../images/ui/special_event_overlay.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-color: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
  color: #f3ead3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#lbOverlay .lbHeader,
#lbOverlay .lbBody,
#fbOverlay .lbHeader,
#fbOverlay .lbBody {
  background: transparent;
  border: 0;
  box-shadow: none;
}

#lbOverlay .lbHeader,
#fbOverlay .lbHeader {
  min-height: 0;
  padding: 26px 56px 0;
  text-align: center;
}

#lbOverlay .lbTitle,
#fbOverlay .lbTitle {
  font-family: "Cinzel", serif;
  font-size: 34px;
  line-height: 1.05;
  color: #f5ead4;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
}

#lbOverlay .lbSub,
#fbOverlay .lbSub {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.35;
  color: rgba(243, 234, 211, 0.90);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
}

#lbOverlay .lbBody,
#fbOverlay .lbBody {
  padding: 18px 56px 34px;
  text-align: center;
}

#lbOverlay .lbPortraitWrap,
#fbOverlay .lbPortraitWrap {
  margin: 6px auto 20px;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lbOverlay .lbPortrait,
#fbOverlay .lbPortrait {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.34));
}

#lbOverlay .lbPrompt,
#fbOverlay .lbPrompt {
  margin: 0 auto 22px;
  max-width: 640px;
  text-align: center;
  font-size: 24px;
  line-height: 1.3;
  color: rgba(243, 234, 211, 0.96);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
}

#lbOverlay .lbActions,
#fbOverlay .lbActions {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

#lbOverlay .lbActions button,
#fbOverlay .lbActions button {
  width: 194px;
  min-width: 194px;
  height: 52px;
  padding: 0 12px;
  background-image: var(--asset-button-wide);
  background-size: 100% 100%;
  font-size: 16px;
  outline: none;
  box-shadow: none;
}

#lbOverlay .lbActions button:focus,
#lbOverlay .lbActions button:focus-visible,
#fbOverlay .lbActions button:focus,
#fbOverlay .lbActions button:focus-visible {
  outline: none;
  box-shadow: none;
}

/* ---------- Ladybug target stage ---------- */

#lbOverlay .lbTargetStage {
  margin-top: 10px;
}

#lbOverlay .lbTargetPrompt {
  max-width: 620px;
  margin: 0 auto 18px;
  text-align: center;
  font-size: 22px;
  line-height: 1.3;
  color: rgba(243, 234, 211, 0.96);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
}

#lbOverlay .lbTargetChoices {
  width: min(560px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

#lbOverlay .lbTargetChoice {
  width: 100%;
  min-height: 88px;
  padding: 12px 18px;
  border: 1px solid rgba(230, 199, 137, 0.26);
  border-radius: 18px;
  background: linear-gradient(rgba(32, 18, 11, 0.58), rgba(18, 10, 6, 0.48));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  text-align: left;
}

#lbOverlay .lbTargetChoice:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(230, 199, 137, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

#lbOverlay .lbTargetPortrait {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(230, 199, 137, 0.50);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.30);
}

#lbOverlay .lbTargetName {
  font-family: "Cinzel", serif;
  font-size: 24px;
  line-height: 1.05;
  color: #f5ead4;
}

#lbOverlay .lbTargetMeta {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.25;
  color: rgba(243, 234, 211, 0.78);
  text-transform: none;
}

/* ---------- Firebreath copy spacing ---------- */

#fbOverlay .lbPrompt {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   PRETTY NIGHT-END OVERLAY
   ========================================================= */

   #winOverlay .winModal {
    width: min(1100px, 95vw);
    max-height: min(90vh, 900px);
    border: 0;
    border-radius: 0;
    background: url("../images/ui/rules_overlay.png") center / 100% 100% no-repeat;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
    overflow: hidden;
    color: #f3ead3;
  }
  
  #winOverlay .winHero,
  #winOverlay .winBody,
  #winOverlay .winFooter {
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  
  #winOverlay .winHero {
    padding: 26px 56px 8px;
  }
  
  #winOverlay .winBody {
    padding: 8px 56px 20px;
  }
  
  #winOverlay .winFooter {
    padding: 0 0 30px;
    justify-content: center;
  }

  /* =========================================================
   RESET PROGRESSION CONFIRM OVERLAY
   ========================================================= */

   #resetProgressOverlay .modal {
    width: min(860px, 94vw);
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: url("../images/ui/reset_progression.png") center / 100% 100% no-repeat;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.62);
    color: #f3ead3;
    position: relative;
  }
  
  #resetProgressOverlay .modalHeader,
  #resetProgressOverlay .modalBody,
  #resetProgressOverlay .modalFooter {
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  
  #resetProgressOverlay .modalHeader {
    padding: 34px 54px 6px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  #resetProgressOverlay .modalTitle {
    width: 100%;
    text-align: center;
    font-family: "Cinzel", serif;
    font-size: 34px;
    line-height: 1.08;
    color: #f5ead4;
  }
  
  #resetProgressOverlay .modalClose {
    position: absolute;
    top: 26px;
    right: 24px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f5ead4;
    font-size: 34px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  #resetProgressOverlay .modalBody {
    padding: 10px 72px 16px;
    text-align: center;
    font-size: 20px;
    line-height: 1.5;
  }
  
  #resetProgressOverlay .modalFooter {
    padding: 8px 0 38px;
    display: flex;
    justify-content: center;
    gap: 16px;
  }
  
  #resetProgressOverlay .modalFooter button {
    width: 194px;
    min-width: 194px;
    height: 52px;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background-image: var(--asset-button-wide);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    font-family: "Cinzel", serif;
    font-size: 16px;
    color: #f5ead4;
  }