/**
 * css/game.css — Play Store Glossy Casual (Sunlit Honey-Oak Boutique)
 * Locked Palette: #37170D, #A84225, #D98B4A, #524234, #F7E8CB, #9F6A42
 * Strictly zero dark-navy RPG boxes, zero stretched button PNGs, zero clipped Red-Dots!
 */
:root {
  --espresso-ink: #37170D;
  --awning-crimson: #A84225;
  --honey-oak: #D98B4A;
  --walnut-shadow: #524234;
  --sunlit-cream: #F7E8CB;
  --warm-caramel: #9F6A42;
  --cream-bright: #FFFDF6;
  --emerald-top: #34D955;
  --emerald-bot: #169E32;
  --emerald-lip: #0E6920;
  --amber-top: #FFD452;
  --amber-bot: #E8931E;
  --amber-lip: #9C5708;
  --font-display: 'Lilita One', 'Fredoka', 'Trebuchet MS', sans-serif;
  --font-heading: 'Fredoka', 'Nunito', 'Segoe UI', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--sunlit-cream);
  color: var(--espresso-ink);
  font-family: var(--font-body);
}

.hidden {
  display: none !important;
}

/* CRITICAL RED-DOT ANTI-CLIPPING LAW */
button, .btn {
  position: relative;
  overflow: visible !important;
  cursor: pointer;
  font-family: var(--font-heading);
  border: none;
  outline: none;
  transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1), filter 0.12s ease;
}
button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
button:active:not(:disabled) {
  transform: translateY(2px) scale(0.96);
}
button:disabled {
  cursor: default;
  opacity: 0.72;
}

.btn-label {
  display: inline-block;
  max-width: 100%;
  line-height: 1.18;
  word-break: break-word;
}

.notify-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF5A5F 0%, #D91E2A 100%);
  border: 2.5px solid #FFFDF6;
  box-shadow: 0 3px 6px rgba(55, 23, 13, 0.35);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  pointer-events: none;
  animation: badgePulse 1.5s infinite ease-in-out;
}

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

/* ==========================================================================
   9-SLICE ANTI-DISTORTION CHROME (`btn_primary.png` & `frame_panel.png`)
   ========================================================================== */
.btn-9slice-primary {
  box-sizing: border-box;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 16px 26px 16px 26px;
  border-image: url('../assets/ui/btn_primary.png') 205 209 205 212 fill / 16px 26px 16px 26px / 0 stretch;
  filter: drop-shadow(0 4px 0 rgba(20, 78, 22, 0.55));
  color: #14121F;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(14px, 1.15vw, 18px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 52px;
  padding: 2px 10px;
}

.btn-9slice-primary .btn-label {
  color: #FFFDF5;
  -webkit-text-stroke: 1.5px #124D16;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #124D16;
  letter-spacing: 0.3px;
}

/* Wide Royal 9-Slice Frame Panel (`frame_panel.png` 1465x946, crown top ribbon) */
.panel-9slice-royal {
  box-sizing: border-box;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 58px 110px 26px 110px;
  border-image: url('../assets/ui/frame_panel.png') 194 732 70 732 fill / 58px 110px 26px 110px / 0 stretch;
  filter: drop-shadow(0 14px 28px rgba(55, 23, 13, 0.42));
}

/* Sculpted Glossy Casual Buttons & Sunlit Cream Cards */
.btn-glossy {
  background: linear-gradient(180deg, var(--emerald-top) 0%, var(--emerald-bot) 100%);
  border: 3px solid #FFFDF6;
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--emerald-lip), 0 8px 14px rgba(55, 23, 13, 0.22);
  color: #FFFDF6;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 16px;
  text-shadow: 0 2px 0 var(--emerald-lip);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-glossy-amber {
  background: linear-gradient(180deg, var(--amber-top) 0%, var(--amber-bot) 100%);
  box-shadow: 0 5px 0 var(--amber-lip), 0 8px 14px rgba(55, 23, 13, 0.22);
  color: #37170D;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.btn-glossy-owned {
  background: linear-gradient(180deg, #D6C7B2 0%, #B8A389 100%);
  box-shadow: 0 4px 0 #7D6B57;
  color: #37170D;
  text-shadow: none;
}

.btn-glossy-muted {
  background: linear-gradient(180deg, #E8DAC3 0%, #CFAF88 100%);
  box-shadow: 0 4px 0 #8F6840;
  color: #524234;
  text-shadow: none;
}

.btn-glossy-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 13px;
}

.casual-card {
  background: linear-gradient(180deg, #FFFDF7 0%, #F7E8CB 100%);
  border: 3.5px solid var(--honey-oak);
  border-radius: 22px;
  box-shadow: 0 6px 0 var(--warm-caramel), 0 10px 22px rgba(55, 23, 13, 0.18);
  padding: 12px 14px;
}

/* ==========================================================================
   TITLE SCREEN (`#screen-title`)
   ========================================================================== */
.screen-layer {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#screen-title {
  background-image: url('../assets/art/title_bg.jpg');
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px 28px;
}

.title-top-bar {
  width: 100%;
  max-width: 1680px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.utility-pill-btn {
  background: linear-gradient(180deg, #FFFDF7 0%, #F5E0B7 100%);
  border: 3px solid var(--honey-oak);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--warm-caramel);
  color: var(--espresso-ink);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
}

.utility-pill-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.title-center-hero {
  width: min(780px, 92vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(255, 251, 240, 0.88);
  backdrop-filter: blur(6px);
  border: 4px solid var(--honey-oak);
  border-radius: 30px;
  box-shadow: 0 10px 0 var(--warm-caramel), 0 20px 44px rgba(55, 23, 13, 0.28);
  padding: 22px 28px 26px;
}

.no-blur-fx .title-center-hero,
.no-blur-fx .modal-backdrop {
  backdrop-filter: none !important;
}

.title-awning-emblem {
  width: 108px;
  height: auto;
  margin-top: -54px;
  filter: drop-shadow(0 6px 10px rgba(55, 23, 13, 0.3));
}

.game-logo-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.06;
  color: #FFFDF5;
  -webkit-text-stroke: 2.5px #4A2511;
  paint-order: stroke fill;
  text-shadow: 0 5px 0 #4A2511, 0 9px 18px rgba(55, 23, 13, 0.32);
}

.game-logo-sub {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 700;
  color: #6E3918;
}

.title-showcase-goods {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 2px 0;
}

.title-showcase-goods img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px rgba(55, 23, 13, 0.25));
}

/* Real 0-100% Boot Progress Bar */
.boot-loader-wrap {
  width: min(440px, 84vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.boot-bar-track {
  width: 100%;
  height: 24px;
  background: #524234;
  border: 3px solid #37170D;
  border-radius: 999px;
  padding: 3px;
  overflow: hidden;
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34D955 0%, #A3E635 100%);
  transition: width 0.12s ease-out;
}

.boot-bar-meta {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--espresso-ink);
}

.title-ready-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.mode-selector-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 560px;
}

.mode-pick-card {
  background: linear-gradient(180deg, #FFFDF9 0%, #F4E3C3 100%);
  border: 3px solid #CFA572;
  border-radius: 18px;
  box-shadow: 0 4px 0 #9F6A42;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--espresso-ink);
}

.mode-pick-card img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.mode-pick-card.mode-card-selected {
  background: linear-gradient(180deg, #FFFBEB 0%, #FDE68A 100%);
  border-color: #D97706;
  box-shadow: 0 5px 0 #B45309;
}

.mode-pick-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--espresso-ink);
}

.mode-pick-sub {
  font-size: 12px;
  font-weight: 700;
  color: #6E4726;
}

.title-play-cta {
  min-width: 250px;
  min-height: 64px;
  font-size: 22px;
}

.title-play-cta .btn-label {
  font-size: 23px;
}

.title-footer-note {
  font-weight: 700;
  font-size: 13px;
  color: #37170D;
  background: rgba(255, 248, 231, 0.85);
  padding: 5px 16px;
  border-radius: 999px;
  border: 2px solid var(--honey-oak);
}

/* ==========================================================================
   16:9 3-COLUMN WIDESCREEN GAMEPLAY (`#screen-game` — >= 90% viewport width!)
   ========================================================================== */
#screen-game {
  background-image: url('../assets/art/arena_bg.jpg');
  display: flex;
  flex-direction: column;
  padding: 10px 2vw 12px;
  gap: 8px;
}

.top-hud-bar {
  width: 100%;
  max-width: 1820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-badge-level {
  background: linear-gradient(180deg, #C93B2B 0%, #992418 100%);
  border: 3px solid #FFF8E7;
  border-radius: 16px;
  box-shadow: 0 4px 0 #5E140C;
  padding: 7px 16px;
  color: #FFFDF5;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  text-shadow: 0 2px 0 #5E140C;
}

.hud-timer-badge {
  background: linear-gradient(180deg, #FFFDF7 0%, #F7E8CB 100%);
  border: 3px solid var(--honey-oak);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--warm-caramel);
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--espresso-ink);
  font-variant-numeric: tabular-nums;
}

.hud-timer-badge img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.hud-timer-badge.timer-frozen {
  background: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 100%);
  border-color: #0284C7;
  color: #0C4A6E;
}

.hud-timer-badge.timer-urgent {
  background: linear-gradient(180deg, #FEE2E2 0%, #FCA5A5 100%);
  border-color: #DC2626;
  color: #7F1D1D;
}

.currency-pill {
  background: linear-gradient(180deg, #4A2511 0%, #37170D 100%);
  border: 3px solid var(--honey-oak);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(55, 23, 13, 0.4);
  padding: 5px 14px 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #1E0B05;
}

.currency-pill img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.shop-hud-btn {
  background: linear-gradient(180deg, #FFD452 0%, #E8931E 100%);
  border: 3px solid #FFFDF6;
  border-radius: 16px;
  box-shadow: 0 4px 0 #9C5708;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #37170D;
  font-weight: 700;
  font-size: 14px;
}

.shop-hud-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* 3-COLUMN WIDESCREEN PLAYFIELD */
.widescreen-command-grid {
  flex: 1;
  min-height: 0;
  width: 94%;
  max-width: 1800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 22%) minmax(0, 56%) minmax(220px, 22%);
  gap: 16px;
  align-items: stretch;
}

.side-wing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.wing-section-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #7C4414;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.scene-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.scene-status-row img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.scene-active-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--espresso-ink);
}

.mode-live-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(217, 139, 74, 0.16);
  border-radius: 14px;
  padding: 8px 10px;
}

.mode-live-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--espresso-ink);
}

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

.meta-nav-btn {
  min-width: 0;
  background: linear-gradient(180deg, #FFFDF9 0%, #F3DEC0 100%);
  border: 3px solid var(--honey-oak);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--warm-caramel);
  padding: 9px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--espresso-ink);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.meta-nav-btn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.meta-sub-pill {
  font-size: 11px;
  color: #7C4414;
  font-weight: 800;
}

/* CENTER PLAYFIELD STAGE */
.center-cabinet-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#shelf-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* FTUE Non-Blocking Coach Card (Docked in Left Wing so 0% of Shelves or Staging Tray is covered!) */
.ftue-coach-bar {
  width: 100%;
  background: linear-gradient(180deg, #FFFBEB 0%, #FDE68A 100%);
  border: 3px solid #D97706;
  border-radius: 18px;
  box-shadow: 0 5px 0 #B45309, 0 8px 16px rgba(55, 23, 13, 0.2);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  z-index: 25;
}

.ftue-coach-bar span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  color: var(--espresso-ink);
}

/* Non-Blocking Celebratory Fever Cut-In Banner */
.fever-cutin-banner {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: linear-gradient(90deg, #C93B2B 0%, #F59E0B 50%, #C93B2B 100%);
  border: 3.5px solid #FFFDF5;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(55, 23, 13, 0.38);
  padding: 6px 22px 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 30;
}

.fever-cutin-banner.fever-active {
  animation: feverPop 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes feverPop {
  0% { transform: translateX(-50%) scale(0.7); opacity: 0; }
  65% { transform: translateX(-50%) scale(1.06); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.fever-cutin-banner img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.fever-cutin-banner span {
  font-family: var(--font-display);
  font-size: 22px;
  color: #FFFDF5;
  -webkit-text-stroke: 1.5px #4A2511;
  paint-order: stroke fill;
}

/* RIGHT WING: OBJECTIVES, 4-BOOSTER RAIL & STAR CHEST */
.goals-stat-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.goal-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(217, 139, 74, 0.14);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.goal-stat-val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--awning-crimson);
  font-variant-numeric: tabular-nums;
}

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

.booster-btn {
  min-width: 0;
  background: linear-gradient(180deg, #FFFDF9 0%, #F4E0BE 100%);
  border: 3px solid var(--honey-oak);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--warm-caramel);
  padding: 8px 6px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  color: var(--espresso-ink);
}

.booster-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.booster-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.15;
}

.booster-qty-pill {
  background: #4A2511;
  color: #FFFDF5;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}

.hotkey-chip {
  position: absolute;
  top: -7px;
  left: -6px;
  background: #FFF8E7;
  border: 2px solid #7C4414;
  border-radius: 7px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 800;
  color: #37170D;
  z-index: 10;
}

.star-chest-btn {
  width: 100%;
  background: linear-gradient(180deg, #FFFBEB 0%, #FDE68A 100%);
  border: 3px solid #D97706;
  border-radius: 18px;
  box-shadow: 0 5px 0 #B45309;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.star-chest-btn img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.star-chest-info {
  flex: 1;
  min-width: 0;
}

.star-chest-bar {
  width: 100%;
  height: 12px;
  background: rgba(74, 37, 17, 0.22);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.star-chest-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, #F59E0B 0%, #22C55E 100%);
  border-radius: 999px;
}

/* ==========================================================================
   MODALS (Spring Entry, `minmax(0, 1fr)` Containment Law, Zero Overflow!)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 20, 9, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 120;
}

.modal-card {
  position: relative;
  width: min(840px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: transparent;
  border: none;
  border-radius: 28px;
  padding: 86px 42px 32px;
  animation: modalSpringIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

.modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  box-sizing: border-box;
  border-style: solid;
  border-color: transparent;
  border-width: 92px 76px 34px 76px;
  border-image: url('../assets/ui/frame_panel.png') 205 165 75 165 fill / 92px 76px 34px 76px / 0 stretch;
  filter: drop-shadow(0 16px 32px rgba(35, 14, 6, 0.45));
}

.modal-card-compact {
  width: min(580px, 92vw);
  padding: 78px 36px 28px;
}

.modal-card-compact::before {
  border-width: 82px 68px 30px 68px;
  border-image: url('../assets/ui/frame_panel.png') 205 165 75 165 fill / 82px 68px 30px 68px / 0 stretch;
}

@keyframes modalSpringIn {
  0% { transform: scale(0.86); opacity: 0; }
  70% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 30px);
  color: #FFFDF5;
  -webkit-text-stroke: 2px #4A2511;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #4A2511;
}

.modal-subtitle {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: #6E4726;
}

.modal-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, #EF4444 0%, #B91C1C 100%);
  border: 3px solid #FFFDF6;
  box-shadow: 0 4px 0 #7F1D1D;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* SHOP 6-SKU GRID (`minmax(0, 1fr)`) */
.shop-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.shop-card {
  position: relative;
  min-width: 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #FBF0D9 100%);
  border: 3px solid #D99B52;
  border-radius: 20px;
  box-shadow: 0 5px 0 #A86E34;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.shop-card-featured {
  background: linear-gradient(180deg, #FFFDF0 0%, #FDE68A 100%);
  border-color: #D97706;
  box-shadow: 0 5px 0 #92400E;
}

.shop-ribbon-badge {
  position: absolute;
  top: -10px;
  right: 10px;
  background: linear-gradient(180deg, #E11D48 0%, #9F1239 100%);
  border: 2px solid #FFFDF6;
  border-radius: 999px;
  padding: 2px 10px;
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
}

.shop-art-wrap {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-pack-img {
  max-width: 84px;
  max-height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(55, 23, 13, 0.25));
}

.shop-card-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--espresso-ink);
}

.shop-card-desc {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #6E4726;
  flex: 1;
}

.shop-buy-btn {
  width: 100%;
  min-height: 46px;
  font-size: 14px;
}

/* CODEX 24-GOODS GRID */
.codex-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.codex-card {
  min-width: 0;
  background: #FFFDF9;
  border: 2.5px solid #D99B52;
  border-radius: 16px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
}

.codex-card.codex-locked .codex-good-img {
  filter: brightness(0.15) opacity(0.55);
}

.codex-good-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.codex-good-name {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--espresso-ink);
}

.codex-status-tag {
  font-size: 11px;
  font-weight: 800;
  color: #7C4414;
  background: rgba(217, 139, 74, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
}

/* SCENES, ORDERS, DAILY & LEADERBOARD */
.scenes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scene-card {
  min-width: 0;
  background: #FFFDF9;
  border: 3px solid #D99B52;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.scene-preview-strip {
  width: 100%;
  height: 86px;
  border-radius: 12px;
  border: 3px solid var(--honey-oak);
  background-size: cover;
  background-position: center;
}

.scene-card-name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 15px;
}

.orders-list, .leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-row, .leader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFFDF9;
  border: 2.5px solid #D99B52;
  border-radius: 16px;
  padding: 10px 14px;
}

.leader-row-me {
  background: #FEF3C7;
  border-color: #D97706;
}

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

.order-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 5px;
}

.order-prog-track {
  width: 100%;
  height: 10px;
  background: #E5D3B3;
  border-radius: 999px;
  overflow: hidden;
}

.order-prog-fill {
  height: 100%;
  background: #22C55E;
  border-radius: 999px;
}

.order-reward-tag {
  font-family: var(--font-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.inline-mini-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.daily-card {
  background: #FFFDF9;
  border: 2.5px solid #D99B52;
  border-radius: 16px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.daily-ready {
  background: #FEF3C7;
  border-color: #D97706;
}

.daily-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.daily-day-label, .daily-amt {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
}

/* SETTINGS */
.settings-rows {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFFDF9;
  border: 2px solid #E5C899;
  border-radius: 14px;
  padding: 9px 14px;
  font-weight: 700;
}

.setting-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-select {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 2px solid var(--honey-oak);
  background: #FFFDF6;
  color: var(--espresso-ink);
}

.toggle-pill-btn {
  min-width: 68px;
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 700;
  background: #D6C7B2;
  color: #37170D;
}

.toggle-pill-btn.toggle-on {
  background: #22C55E;
  color: #FFFFFF;
}

/* WIN / FAIL / CHEST / EXIT CELEBRATIONS */
.celebration-stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.celebration-stat-box {
  background: #FFFBEB;
  border: 3px solid #F59E0B;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.celebration-stat-box img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.celebration-stat-val {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--espresso-ink);
}

.discovery-spotlight {
  background: #ECFDF5;
  border: 2.5px solid #10B981;
  border-radius: 16px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  font-weight: 800;
}

.discovery-spotlight img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.modal-actions-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

/* 3-Beat Chest */
.chest-stage-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
}

.chest-hero-img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  cursor: pointer;
  z-index: 2;
}

.chest-beat-anticipate {
  animation: chestJiggle 0.22s infinite alternate ease-in-out;
}

@keyframes chestJiggle {
  0% { transform: scale(1.05, 0.94) rotate(-4deg); }
  100% { transform: scale(0.95, 1.06) rotate(4deg); }
}

.chest-sunburst {
  position: absolute;
  top: -10px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(253, 224, 71, 0.48) 0deg 15deg, rgba(253, 224, 71, 0) 15deg 30deg);
  animation: spinRays 8s linear infinite;
  pointer-events: none;
}

@keyframes spinRays {
  to { transform: rotate(360deg); }
}

.chest-reward-cards {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.chest-loot-card {
  background: #FFFBEB;
  border: 3px solid #F59E0B;
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: modalSpringIn 0.28s backwards;
}

.chest-loot-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.chest-loot-label {
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Exit Retention Jump Cards */
.exit-rewards-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.exit-reward-jump-card {
  background: #FFFBEB;
  border: 3px solid #F59E0B;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--espresso-ink);
  text-align: left;
}

.exit-reward-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* Flying Loot & Click Sparks */
#fx-dom-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

.flying-hud-loot {
  position: fixed;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
}

.click-spark-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  border-radius: 50%;
  border: 3px solid #FDE047;
  animation: clickRingOut 0.35s ease-out forwards;
}

@keyframes clickRingOut {
  0% { transform: scale(0.35); opacity: 0.95; }
  100% { transform: scale(1.65); opacity: 0; }
}

.market-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #37170D;
  color: #FFFDF5;
  border: 2.5px solid #F59E0B;
  border-radius: 999px;
  padding: 9px 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  z-index: 220;
}

/* Preview-Only [DEV F2] */
#dev-f2-pill {
  position: fixed;
  bottom: 8px;
  right: 8px;
  background: rgba(55, 23, 13, 0.72);
  color: #FDE047;
  border: 1.5px solid #D98B4A;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  z-index: 250;
}

#debug-panel {
  position: fixed;
  bottom: 38px;
  right: 10px;
  width: 220px;
  background: #FFFDF6;
  border: 3px solid #37170D;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 250;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

#debug-panel button {
  background: #F7E8CB;
  border: 1.5px solid #9F6A42;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #37170D;
}

.debug-hdr {
  font-weight: 800;
  font-size: 12px;
  text-align: center;
  margin-bottom: 2px;
}

/* Responsive Fallback (< 900px) */
@media (max-width: 900px) {
  .widescreen-command-grid {
    width: 98%;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
  }
  .side-wing {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .shop-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .codex-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
