/* css/game.css — Bedrock Breakers: Idle Quarry (Play Store Vibrant Cartoon · Native 16:9 PC Widescreen) */
:root {
  --sky-teal: #8DB3BA;
  --ink: #1A1226;
  --ink-panel: #242229;
  --umber: #564340;
  --slate: #817669;
  --amber: #E4A759;
  --copper: #B87036;
  --cat-yellow: #FFBE0B;
  --cream: #F8EDDB;
  --emerald: #38D95A;
  --sky-blue: #26B6FF;
  --coral: #FF595E;
  --font-display: 'Lilita One', 'Luckiest Guy', 'Trebuchet MS', Impact, sans-serif;
  --font-body: 'Baloo 2', 'Segoe UI', Tahoma, sans-serif;
}

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

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

.hidden {
  display: none !important;
}

/* Global button anti-clipping rule for Red-Dot Notification Router */
button {
  font-family: var(--font-body);
  cursor: pointer;
  position: relative;
  overflow: visible !important;
}

.notify-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #FF3B3F;
  border: 2.2px solid var(--ink);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  box-shadow: 0 2px 0 var(--ink);
  pointer-events: none;
  animation: badgePulse 1.5s infinite ease-in-out;
}

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

/* 9-Slice Primary Sprite CTA (`assets/ui/btn_primary.png` — 1738x504, 136 139 136 137) */
.btn-9slice-primary {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 16px 22px 16px 22px;
  border-image: url('../assets/ui/btn_primary.png') 136 139 136 137 fill / 16px 22px 16px 22px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 0 rgba(20, 18, 31, 0.65));
  color: #14121F;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.35vw, 22px);
  letter-spacing: 0.4px;
  padding: 2px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-9slice-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05) drop-shadow(0 6px 0 rgba(20, 18, 31, 0.65));
}

.btn-9slice-primary:active {
  transform: translateY(2px);
  filter: drop-shadow(0 2px 0 rgba(20, 18, 31, 0.65));
}

/* 9-Slice Modal Frame (`assets/ui/frame_panel.png` — 1704x929, 221 271 168 280) */
.modal-9slice {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 54px 48px 38px 48px;
  border-image: url('../assets/ui/frame_panel.png') 221 271 168 280 fill / 54px 48px 38px 48px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.65));
  color: #14121F;
  position: relative;
}

/* Pure CSS Sculpted 3D Cartoon Buttons (for dynamic-width bars & cards — zero raster warp!) */
.btn-cartoon {
  background: linear-gradient(180deg, #FFD83B 0%, #FFAE00 100%);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3.5px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.55);
  color: #14121F;
  font-family: var(--font-display);
  font-size: clamp(12px, 0.95vw, 15px);
  line-height: 1.15;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.btn-cartoon:hover:not(:disabled) {
  transform: translateY(-1.5px);
  filter: brightness(1.06);
}

.btn-cartoon:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1.5px 0 var(--ink);
}

.btn-cartoon.btn-emerald {
  background: linear-gradient(180deg, #52EE73 0%, #22B944 100%);
  color: #102415;
}

.btn-cartoon.btn-sky {
  background: linear-gradient(180deg, #58CCFF 0%, #1693DF 100%);
  color: #0E1D2C;
}

.btn-cartoon.btn-coral {
  background: linear-gradient(180deg, #FF7579 0%, #E0353B 100%);
  color: #FFFFFF;
  text-shadow: 0 1.5px 0 var(--ink);
}

.btn-cartoon.btn-slate {
  background: linear-gradient(180deg, #4C4958 0%, #322F3B 100%);
  color: #F8EDDB;
}

.btn-cartoon.btn-disabled,
.btn-cartoon:disabled {
  background: linear-gradient(180deg, #8B847E 0%, #6A635D 100%);
  color: #D9D2CA;
  cursor: default;
  opacity: 0.85;
}

/* ==================== TITLE SCREEN ==================== */
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: url('../assets/art/title_bg.jpg') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 38px;
}

#title-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(26, 18, 38, 0.18) 0%, rgba(20, 16, 28, 0.72) 100%);
  pointer-events: none;
}

.title-top-row {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.title-center-card {
  position: relative;
  z-index: 2;
  max-width: 760px;
  text-align: center;
  background: rgba(30, 26, 36, 0.82);
  border: 3.5px solid var(--ink);
  border-radius: 26px;
  padding: 28px 42px 32px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.58), inset 0 2px 0 rgba(255, 225, 77, 0.35);
}

.title-hazard-strip {
  height: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: repeating-linear-gradient(-45deg, #FFBE0B 0 16px, #242229 16px 32px);
  border: 2px solid var(--ink);
}

.game-logo-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 4.3vw, 64px);
  line-height: 1.02;
  color: #FFE14D;
  -webkit-text-stroke: 2.5px #1A1226;
  text-shadow: 0 5px 0 #1A1226, 0 10px 22px rgba(0, 0, 0, 0.55);
}

.game-logo-sub {
  margin: 10px 0 22px;
  font-family: var(--font-display);
  font-size: clamp(14px, 1.25vw, 19px);
  color: #F8EDDB;
  letter-spacing: 0.8px;
  text-shadow: 0 2px 0 #1A1226;
}

.boot-loader-wrap {
  width: min(420px, 80vw);
  margin: 0 auto 14px;
}

.boot-bar-outer {
  width: 100%;
  height: 22px;
  background: #181520;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 2px;
  overflow: hidden;
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF922B, #FFE14D, #38D95A);
  transition: width 0.15s ease;
}

.boot-pct-label {
  margin-top: 6px;
  font-weight: 800;
  font-size: 14px;
  color: #FFE14D;
}

/* ==================== MAIN 16:9 WIDESCREEN SHELL ==================== */
#game-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #2C2523;
}

/* Top Bar (100% width) */
#top-hud {
  height: 60px;
  min-height: 60px;
  width: 100%;
  padding: 0 14px;
  background: linear-gradient(180deg, #383342 0%, #24212B 100%);
  border-bottom: 3.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 30;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.hud-pill {
  height: 40px;
  padding: 0 10px;
  background: #1B1822;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}

.hud-pill img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-num {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.05vw, 17px);
  color: #FFFFFF;
  -webkit-text-stroke: 1.1px #1A1226;
  text-shadow: 0 2px 0 #1A1226;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hud-rate {
  font-size: 11px;
  font-weight: 800;
  color: #52EE73;
  white-space: nowrap;
}

/* Zone Progress Pill */
.zone-prog-pill {
  padding: 0 10px;
  gap: 8px;
}

.zone-bar-track {
  width: 78px;
  height: 12px;
  background: #0F0D14;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.zone-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38D95A, #FFE14D);
  transition: width 0.2s ease;
}

/* Overdrive Fever Pill Button */
.fever-btn {
  height: 40px;
  min-width: 128px;
  padding: 0 11px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: #231E2E;
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fever-btn.fever-ready {
  background: linear-gradient(90deg, #FF922B, #FFE14D);
  color: #14121F;
  animation: badgePulse 0.9s infinite;
}

.fever-gauge-mini {
  width: 44px;
  height: 10px;
  background: #120F18;
  border-radius: 99px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
}

.fever-gauge-fill {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, #FF595E, #FFBE0B);
}

.hud-icon-btn {
  height: 40px;
  padding: 0 10px;
}

.hud-icon-btn img {
  width: 21px;
  height: 21px;
  object-fit: contain;
}

/* Main Workspace Split (~66% Quarry Playfield + ~34% Right Command Panel = 100% Widescreen!) */
#workspace-split {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
}

#quarry-stage {
  flex: 0 0 65.5%;
  width: 65.5%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-right: 4px solid var(--ink);
}

#quarry-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Top-Right Live Quarry Minimap */
#minimap-card {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 178px;
  background: rgba(30, 26, 36, 0.92);
  border: 2.8px solid var(--ink);
  border-radius: 13px;
  padding: 5px 7px 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  z-index: 18;
}

.minimap-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 11px;
  color: #FFE14D;
  margin-bottom: 3px;
}

.minimap-toggle-btn {
  background: #3A3446;
  color: #FFFFFF;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
}

#minimap-canvas {
  width: 100%;
  height: 82px;
  display: block;
  border-radius: 7px;
  border: 2px solid var(--ink);
}

.minimap-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: #E8DCC8;
  margin-top: 3px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 3px;
}

/* Combo Pill Top-Left of Quarry */
#combo-pill {
  position: absolute;
  top: 64px;
  left: 12px;
  background: linear-gradient(180deg, #FF922B, #E05915);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  font-family: var(--font-display);
  font-size: 15px;
  color: #FFFFFF;
  -webkit-text-stroke: 1px var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  z-index: 18;
}

/* Non-Blocking FTUE Guide Strip */
#ftue-banner {
  position: absolute;
  top: 8px;
  left: 12px;
  max-width: calc(100% - 210px);
  background: rgba(28, 24, 36, 0.92);
  border: 2.5px solid #FFBE0B;
  border-radius: 13px;
  padding: 5px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 22;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

#ftue-banner img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

#ftue-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #F8EDDB;
  line-height: 1.25;
}

/* Bottom Quarry Action Deck */
#quarry-action-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 18;
}

.action-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.fleet-quick-chip {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: rgba(34, 30, 42, 0.92);
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 var(--ink);
}

.fleet-quick-chip img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.fleet-quick-chip.active-chip {
  background: linear-gradient(180deg, #FFE14D, #FF9F0A);
}

.fleet-quick-chip.locked-chip {
  opacity: 0.45;
  filter: grayscale(0.9);
}

.chip-hotkey {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--ink);
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 5px;
}

/* 4-Phase Foreman Ultimate Cut-in Banner (`portrait_foreman.png`) */
#foreman-cutin-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 28%;
  height: 126px;
  background: linear-gradient(95deg, #1A1226 0%, #FFBE0B 24%, #FF922B 78%, #1A1226 100%);
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 45;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

#foreman-cutin-banner img {
  height: 148px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 0 #1A1226);
}

.cutin-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 38px);
  color: #FFFFFF;
  -webkit-text-stroke: 2px #1A1226;
  text-shadow: 0 4px 0 #1A1226;
}

.cutin-sub {
  font-family: var(--font-display);
  font-size: 15px;
  color: #14121F;
}

.cutin-enter {
  animation: cutinSlideIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15) forwards;
}

.cutin-exit {
  animation: cutinSlideOut 0.18s ease-in forwards;
}

@keyframes cutinSlideIn {
  from { transform: translateX(-100%) skewX(-8deg); opacity: 0; }
  to { transform: translateX(0) skewX(0deg); opacity: 1; }
}

@keyframes cutinSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ==================== RIGHT DOCKED COMMAND PANEL (~34% width) ==================== */
#command-panel {
  flex: 1 1 34.5%;
  width: 34.5%;
  height: 100%;
  background: linear-gradient(180deg, #32363F 0%, #24272E 100%);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-hazard-top {
  height: 10px;
  background: repeating-linear-gradient(-45deg, #FFBE0B 0 14px, #1F2229 14px 28px);
  border-bottom: 2.5px solid var(--ink);
}

#panel-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 9px 10px 7px;
  background: #1F2228;
  border-bottom: 3px solid var(--ink);
}

#panel-tabs > * {
  min-width: 0;
  max-width: 100%;
}

.tab-btn {
  height: 44px;
  padding: 4px 4px;
  border-radius: 10px;
  border: 2.5px solid var(--ink);
  background: #353944;
  color: #DCD1A1;
  font-family: var(--font-display);
  font-size: clamp(11px, 0.88vw, 13.5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 2.5px 0 var(--ink);
}

.tab-btn.active {
  background: linear-gradient(180deg, #FFE14D 0%, #FFAE00 100%);
  color: #14121F;
}

.panel-sec-header {
  padding: 8px 14px;
  background: #2B2E37;
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 15px;
  color: #FFE14D;
  text-shadow: 0 2px 0 var(--ink);
}

#panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* Industrial Upgrade / Fleet / Crew Card (matches gameplay_concept.jpg!) */
.cmd-card {
  background: linear-gradient(180deg, #3D424D 0%, #31353F 100%);
  border: 2.8px solid var(--ink);
  border-radius: 14px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 0 var(--ink), inset 0 1.5px 0 rgba(255, 255, 255, 0.14);
}

.cmd-card.card-equipped {
  border-color: #FFE14D;
  background: linear-gradient(180deg, #474438 0%, #34322A 100%);
}

.cmd-thumb-box {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(180deg, #F8EDDB 0%, #DFC69E 100%);
  border: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.cmd-thumb-box img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.cmd-info {
  min-width: 0;
}

.cmd-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: #FFFFFF;
  text-shadow: 0 2px 0 var(--ink);
  line-height: 1.15;
}

.cmd-sub {
  font-size: 12px;
  font-weight: 700;
  color: #DCD1A1;
  line-height: 1.2;
  margin-top: 2px;
}

.cmd-pips {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}

.lvl-pip {
  width: 16px;
  height: 8px;
  border-radius: 3px;
  background: #1B1E24;
  border: 1.5px solid var(--ink);
}

.lvl-pip.filled {
  background: #38D95A;
}

.cmd-delta {
  font-size: 11px;
  font-weight: 800;
  color: #52EE73;
  margin-left: 4px;
}

.cmd-cta-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.locked-gate-card {
  background: rgba(24, 22, 32, 0.85);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  color: #DCD1A1;
  font-weight: 700;
}

/* ==================== MODALS (Spring Overshoot & 9-Slice Frame) ==================== */
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(14, 12, 22, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: scrimFade 0.18s ease-out;
}

@keyframes scrimFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  width: min(880px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSpring 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.08);
}

.modal-dialog.modal-sm {
  width: min(540px, 92vw);
}

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

.modal-hdr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -36px;
  margin-bottom: 12px;
}

.modal-title-txt {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 1.8vw, 28px);
  color: #14121F;
}

.modal-scroll-content {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(90vh - 130px);
  padding: 4px;
}

/* Shop 8-SKU Grid (`minmax(0, 1fr)` containment law!) */
#shop-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#shop-cards-grid > * {
  min-width: 0;
  max-width: 100%;
}

.shop-card {
  position: relative;
  background: #FFF9EE;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 0 rgba(26, 18, 38, 0.2);
}

.shop-card-featured {
  background: linear-gradient(180deg, #FFF5CC 0%, #FFE799 100%);
  border-color: #B87036;
}

.shop-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: #FF595E;
  color: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

.shop-badge-starter { background: #38D95A; color: #102415; }
.shop-badge-best-value { background: #9B5DE5; color: #FFFFFF; }

.shop-art-wrap {
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.shop-art-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.shop-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: #14121F;
  margin-top: 4px;
  line-height: 1.15;
}

.shop-card-desc {
  font-size: 11.5px;
  font-weight: 700;
  color: #4A3E38;
  margin: 4px 0 8px;
  flex: 1;
  line-height: 1.22;
}

.btn-shop-buy {
  width: 100%;
}

/* Daily 7-Day Grid */
.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.daily-grid > * { min-width: 0; max-width: 100%; }

.daily-day-card {
  background: #FFF9EE;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  color: #14121F;
}

.daily-day-card.day-today {
  background: #FFF0B3;
  border-color: #E07438;
}

/* 3-Card Research Draft Grid */
.draft-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.draft-cards-grid > * { min-width: 0; max-width: 100%; }

.draft-card {
  background: linear-gradient(180deg, #FFFDF7 0%, #F5E6CC 100%);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: #14121F;
}

.draft-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Settings Rows */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.setting-row {
  background: rgba(255, 255, 255, 0.62);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #14121F;
  font-weight: 800;
}

/* Exit Retention Cards */
#exit-reward-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

#exit-reward-cards > * { min-width: 0; max-width: 100%; }

.exit-jump-card {
  background: #FFF4CC;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  color: #14121F;
}

.exit-jump-card img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.exit-jump-txt strong { display: block; font-size: 12px; }
.exit-jump-txt span { font-size: 11px; color: #B85218; font-weight: 800; }

/* Supply Crate 3-Beat Modal */
.crate-stage-box {
  text-align: center;
  padding: 10px;
}

.crate-hero-img {
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.crate-beat-jiggle {
  animation: crateJiggle 0.16s infinite alternate;
}

.crate-beat-pop {
  animation: modalSpring 0.28s ease-out;
}

@keyframes crateJiggle {
  from { transform: rotate(-6deg) scale(1.04, 0.96); }
  to { transform: rotate(6deg) scale(0.96, 1.05); }
}

#crate-rewards-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.crate-reward-item {
  background: #FFF9EE;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  color: #14121F;
  animation: modalSpring 0.24s ease-out backwards;
}

.crate-reward-item img { width: 28px; height: 28px; object-fit: contain; }

/* DOM Click & Bezier Loot Overlay */
#fx-dom-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 160;
}

.click-burst-ring {
  position: absolute;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  border-radius: 50%;
  border: 3px solid #FFE14D;
  animation: ringExpand 0.35s ease-out forwards;
}

@keyframes ringExpand {
  from { transform: scale(0.35); opacity: 1; }
  to { transform: scale(1.65); opacity: 0; }
}

.fly-loot-icon {
  position: fixed;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

#toast-msg {
  position: fixed;
  bottom: 72px;
  left: 33%;
  transform: translateX(-50%);
  background: rgba(24, 20, 32, 0.94);
  border: 2.5px solid #FFE14D;
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 15px;
  padding: 7px 18px;
  border-radius: 999px;
  z-index: 150;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Preview-only `[DEV F2]` Pill & Panel */
#dev-f2-pill {
  position: fixed;
  bottom: 8px;
  right: 10px;
  z-index: 180;
  background: rgba(20, 18, 30, 0.86);
  color: #52EE73;
  border: 1.5px solid #52EE73;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
}

#debug-panel {
  position: fixed;
  bottom: 36px;
  right: 10px;
  width: 300px;
  z-index: 180;
  background: rgba(20, 18, 30, 0.95);
  border: 2px solid #52EE73;
  border-radius: 12px;
  padding: 10px;
  color: #FFFFFF;
  font-size: 12px;
}

.dbg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

/* Responsive Fallback (<900px) */
@media (max-width: 900px) {
  #top-hud {
    height: auto;
    flex-wrap: wrap;
    padding: 6px 8px;
  }
  #workspace-split {
    flex-direction: column;
  }
  #quarry-stage {
    flex: 0 0 54%;
    width: 100%;
    border-right: none;
    border-bottom: 4px solid var(--ink);
  }
  #command-panel {
    flex: 1 1 46%;
    width: 100%;
  }
  #shop-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
