/* ==========================================================================
   Juice Bar Clicker - Static HTML/CSS/JS port
   ========================================================================== */

/* ---------- Pixel CJK webfont ----------
   Fusion Pixel 12px Proportional SC (SIL OFL 1.1, see fonts/fusion-pixel-LICENSE.txt)
   Scoped to CJK ranges so Latin text keeps using Press Start 2P / Fredoka. */
@font-face {
  font-family: 'Fusion Pixel SC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/fusion-pixel-12px-sc.woff2') format('woff2');
  unicode-range: U+2E80-2EFF, U+3000-303F, U+3040-30FF, U+3100-312F, U+31C0-31EF,
    U+3200-33FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; padding: 0; }

:root {
  --color-grass: #4FA339;
  --color-apple: #E63946;
  --color-cream: #FFF1C8;
  --color-gold: #FFD23F;
  --color-wood: #8B4A2A;
  --color-sky: #5BC0EB;
  --color-ink: #2C1810;
}

body {
  font-family: 'Fredoka', 'Fusion Pixel SC', system-ui, -apple-system, sans-serif;
  background: #FFF1C8;
  color: #2C1810;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #FFD23F; color: #2C1810; }

h1, h2, h3, h4, h5, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }

.font-pixel { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; }
.font-friendly { font-family: 'Fredoka', 'Fusion Pixel SC', system-ui, sans-serif; }

/* Inline icon artwork from the provided pixel assets (scales with the text next to it) */
.icon-img {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  display: inline-block;
  vertical-align: -0.2em;
}

/* Pixel UI icons (Pixelarticons, 24x24 grid, filled with currentColor).
   Pinned to 12px so each icon pixel lands on a device pixel at 2x DPR. */
.pix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.pix-icon {
  width: 12px;
  height: 12px;
  display: block;
  shape-rendering: crispEdges;
}
/* Square icon-only buttons get the full 1:1 size (crisp on 1x and 2x DPR). */
.modal-close .pix-icon,
.shop-drawer-close .pix-icon {
  width: 24px;
  height: 24px;
}

/* ---------- Tailwind-equivalent animations ---------- */
@keyframes tw-bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}
@keyframes tw-spin { to { transform: rotate(360deg); } }
@keyframes tw-ping { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes tw-pulse { 50% { opacity: 0.5; } }

.animate-bounce { animation: tw-bounce 1s infinite; }
.animate-spin { animation: tw-spin 1s linear infinite; }
.animate-ping { animation: tw-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
.animate-pulse { animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ---------- Pixel art cards & buttons ---------- */
.pixel-box { border: 3px solid #2C1810; box-shadow: 0 4px 0 #2C1810; }
.pixel-box-sm { border: 2px solid #2C1810; box-shadow: 0 2px 0 #2C1810; }
.pixel-box-lg { border: 4px solid #2C1810; box-shadow: 0 6px 0 #2C1810; }

.pixel-btn {
  border: 2px solid #2C1810;
  box-shadow: 0 3px 0 #2C1810;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.pixel-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 #2C1810; }
.pixel-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #2C1810; }
.pixel-btn:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(40%); }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #F3E5AB; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #8B4A2A; border: 1px solid #2C1810; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #6C391F; }

/* ---------- Custom keyframes ---------- */
@keyframes tree-squash-bounce {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.1, 0.88); }
  50% { transform: scale(0.94, 1.08); }
  75% { transform: scale(1.03, 0.98); }
  100% { transform: scale(1, 1); }
}
.animate-tree-bounce { animation: tree-squash-bounce 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2); }

@keyframes gentle-sway {
  0%, 100% { transform: rotate(-0.75deg); }
  50% { transform: rotate(0.75deg); }
}
.animate-sway { animation: gentle-sway 4s ease-in-out infinite; }

@keyframes drone-hover {
  0%, 100% { transform: translateY(0px) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}
.animate-drone { animation: drone-hover 2.2s ease-in-out infinite; }

@keyframes pulse-sunlight {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 210, 63, 0.7)); }
  50% { filter: drop-shadow(0 0 24px rgba(255, 170, 0, 0.95)); }
}
.animate-sunlight { animation: pulse-sunlight 1.5s ease-in-out infinite; }

@keyframes customer-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.animate-walk { animation: customer-bob 0.4s infinite; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #FFF1C8;
  color: #2C1810;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}
.col-left { display: flex; flex-direction: column; gap: 1rem; position: relative; }
.col-right { display: flex; flex-direction: column; gap: 1rem; }

@media (min-width: 640px) {
  .main { padding: 1.25rem; }
}
@media (min-width: 1024px) {
  .main { grid-template-columns: repeat(12, 1fr); }
  .col-left { grid-column: span 7; }
  .col-right { grid-column: span 5; }
}

/* ==========================================================================
   Top header
   ========================================================================== */
.top-header {
  width: 100%;
  background: #FFF1C8;
  border-bottom: 4px solid #2C1810;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  padding: 0.625rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.top-header-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  row-gap: 0.5rem;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  gap: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.625rem; }
.brand-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
}
.brand-title {
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2C1810;
}
.brand-sub { font-size: 11px; color: #6C391F; font-weight: 700; margin-top: 0.15rem; }

.mobile-actions { display: flex; align-items: center; gap: 0.375rem; margin-left: auto; }
.icon-btn {
  background: #fff;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  border-radius: 0.5rem;
  padding: 0.375rem;
  font-size: 0.875rem;
  line-height: 1;
}
.icon-btn:hover { background: #FFF8E1; }
.icon-btn.lang-btn { padding: 0.25rem 0.5rem; font-size: 0.75rem; font-weight: 700; font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; }

.desktop-controls { display: none; }

.counters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  justify-content: center;
}
.counter {
  flex: 1;
  background: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 140px;
  border: 3px solid #2C1810;
  box-shadow: 0 4px 0 #2C1810;
}
.counter-juice { background: #FFF7ED; border-color: #EA580C; box-shadow: 0 4px 0 #2C1810; }
.counter-coins { background: #FFFBEB; border-color: #D97706; box-shadow: 0 4px 0 #2C1810; }
.counter-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
}
.icon-apples { background: #FEE2E2; }
.icon-juice { background: #FFEDD5; border-color: #EA580C; }
.icon-coins { background: #FEF3C7; border-color: #D97706; }
.counter-icon .icon-img { width: 82%; height: 82%; vertical-align: 0; }
/* The juice artwork is an opaque photo, so let it fill the badge entirely. */
.icon-juice .icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.375rem; }
.counter-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.025em; color: #991B1B; }
.label-juice { color: #C2410C; }
.label-coins { color: #B45309; }
.counter-value { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 1rem; font-weight: 900; color: #2C1810; line-height: 1.1; }
.value-juice { color: #C2410C; }
.value-coins { color: #B45309; }
.counter-rate { font-size: 10px; font-weight: 600; margin-top: 0.125rem; color: #388E3C; }
.rate-juice { color: #EA580C; }
.rate-coins { color: #D97706; }

.buff-pills { display: flex; align-items: center; gap: 0.375rem; margin-right: 0.5rem; }
.buff-pill {
  background: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.buff-pill .secs { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 10px; }

.btn {
  padding: 0.375rem 0.625rem;
  background: #fff;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border: 2px solid #2C1810;
  box-shadow: 0 3px 0 #2C1810;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 #2C1810; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #2C1810; }
.btn-lang { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; }
.btn-reset { background: #FEE2E2; color: #991B1B; }
.btn-reset:hover { background: #FCA5A5; }
.btn-save { background: #DCFCE7; color: #166534; }
.btn-save:hover { background: #BBF7D0; }

.save-notice { font-size: 10px; text-align: center; color: rgba(139, 74, 42, 0.7); margin-top: 0.25rem; pointer-events: none; }

@media (min-width: 640px) {
  .top-header { padding: 0.75rem 1.5rem; }
  .brand-logo { width: 2.5rem; height: 2.5rem; }
  .brand-title { font-size: 0.875rem; }
  .counter { padding: 0.5rem 1rem; gap: 0.75rem; min-width: 170px; }
  .counter-icon { width: 2.25rem; height: 2.25rem; font-size: 1.25rem; }
  .counter-label { font-size: 11px; }
  .counter-value { font-size: 1.125rem; }
}
@media (min-width: 768px) {
  .top-header-inner { flex-direction: row; }
  .brand-row { width: auto; }
  .mobile-actions { display: none; }
  .desktop-controls { display: flex; align-items: center; gap: 0.5rem; }
  .counters { width: auto; }
  .counter { flex: initial; }
}

/* ==========================================================================
   Apple tree canvas
   ========================================================================== */
.tree-wrap { position: relative; }

.tree-canvas {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(to bottom, #7AD1F5, #A6E1F9, #8AD16A);
  border: 3px solid #2C1810;
  box-shadow: 0 4px 0 #2C1810;
  transition: all 0.3s;
  outline: none;
}
.tree-canvas.fertilizer-active { animation: pulse-sunlight 1.5s ease-in-out infinite; }
.tree-canvas:focus-visible { outline: 3px dashed #2C1810; outline-offset: 3px; }

/* Farm scene artwork (provided asset) */
.scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% 50%;
  pointer-events: none;
  user-select: none;
}

/* Drones */
.drones-layer {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 20rem;
  height: 4rem;
  pointer-events: none;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  padding: 0 0.75rem;
}
.drone { display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25)); animation: drone-hover 2.2s ease-in-out infinite; }
.drone-img { width: 2.75rem; height: auto; }
.drone-count {
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 9px;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(44, 24, 16, 0.4);
  margin-top: -0.125rem;
}

/* Center tree (transparent sprite asset) */
.tree-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  padding: 0.5rem 0.75rem 1.25rem;
}
.tree-img-box {
  position: relative;
  height: 80%;
  aspect-ratio: 1 / 1;
  max-width: 84%;
  transition: transform 0.15s ease;
}
.tree-canvas:hover .tree-img-box { transform: scale(1.03); }
.tree-img-box.is-bouncing { transform: scale(0.92) translateY(0.5rem); }
.tree-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  pointer-events: none;
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.22));
}
.tree-img-box.boosted .tree-img {
  filter: drop-shadow(0 0 16px #FFD23F) drop-shadow(0 0 6px #FFD23F) drop-shadow(0 8px 6px rgba(0, 0, 0, 0.22))
    brightness(1.08) saturate(1.15);
}
/* Owned picking machinery standing in the orchard */
.machine {
  position: absolute;
  bottom: 1.5%;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.machine-picker { left: 1.5%; width: 19%; }
.machine-harvester { right: 1.5%; width: 25%; }
.machine-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.3));
}
.machine-count {
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 9px;
  color: #fff;
  background: rgba(44, 24, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  margin-top: 0.125rem;
}

/* Particles */
.particles-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.particle { position: absolute; pointer-events: none; z-index: 30; }
.particle-img {
  width: 1.4rem;
  height: 1.4rem;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.particle-sun { width: 1rem; height: 1rem; background: #FBBF24; border: 1px solid #2C1810; border-radius: 9999px; animation: tw-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* Hint & buff tag */
.tree-hint {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(255, 241, 200, 0.9);
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  pointer-events: none;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
}
.tree-hint .bounce { font-size: 1rem; animation: tw-bounce 1s infinite; }
.hint-title { font-weight: 700; color: #2C1810; line-height: 1; font-size: 0.75rem; }
.hint-sub { font-size: 11px; color: #4A5568; margin-top: 0.15rem; }

.buff-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #FFD23F;
  color: #2C1810;
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 10px;
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  animation: tw-bounce 1s infinite;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Floating popups */
.float-layer { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.float-text {
  position: absolute;
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 0.75rem;
  font-weight: 900;
  pointer-events: none;
  z-index: 40;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
  animation: tw-bounce 1s infinite;
}
@media (min-width: 640px) {
  .tree-center { padding: 0.75rem 1rem 1.75rem; }
  .float-text { font-size: 0.875rem; }
}
@media (min-width: 768px) {
  .tree-canvas { height: 440px; }
}
@media (min-width: 1024px) {
  .tree-canvas { height: 480px; }
}

/* ==========================================================================
   Courtyard customers
   ========================================================================== */
/* Full-width row under both columns of the main grid. */
.courtyard-wrap { grid-column: 1 / -1; }
.courtyard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.375rem; padding: 0 0.25rem; }
.courtyard-title { font-weight: 700; font-size: 0.75rem; color: #8B4A2A; display: flex; align-items: center; gap: 0.25rem; }
.courtyard-sub { font-size: 11px; color: #6C391F; }

.courtyard {
  position: relative;
  width: 100%;
  height: 14rem;
  background: #E2F0D9;
  border-radius: 0.75rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  overflow: hidden;
  --px: 0; /* pointer-driven parallax offset, set by JS (-1 .. 1) */
}

/* ---- parallax layers, painted back to front ---- */
.cy-layer {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  height: 100%;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: cover;
  transform: translateX(calc(var(--px) * var(--par, 0) * 1px));
  will-change: transform;
}
.cy-sky {
  left: 0;
  right: 0;
  background: linear-gradient(#BFE7F5 0%, #DDF1DE 64%, #E2F0D9 100%);
  transform: none;
  z-index: 0;
}
.cy-sky::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#C4DCB5 15%, transparent 16%);
  background-size: 12px 12px;
  opacity: 0.35;
}
.cy-hills { --par: 4; height: 62%; opacity: 0.95; z-index: 1; background-size: 100% auto; background-position: bottom center; }
.cy-fence { --par: 8; height: 44%; z-index: 2; }
.cy-ground {
  --par: 0;
  height: 34%;
  background-position: center 42%;
  background-color: #D6EAC7;
  background-image: linear-gradient(#DCEFCB, #C3DFAF);
  border-top: 2px solid #A8CE96;
  z-index: 3;
}
.cy-stall {
  position: absolute;
  right: 6%;
  bottom: 26%;
  height: 58%;
  width: auto;
  aspect-ratio: 656 / 640; /* hug the artwork so it never floats inside a wide box */
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: contain;
  transform: translateX(calc(var(--px) * 11 * 1px));
  pointer-events: none;
  z-index: 4;
}
.cy-fg { --par: 15; height: 20%; z-index: 8; }

.stall-indicator {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: #FFF1C8;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  z-index: 10;
}
/* Once real stall artwork is present the emoji label steps aside. */
.courtyard.has-art .stall-indicator { display: none; }
.stall-indicator .pulse { font-size: 1rem; animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.stall-indicator div { font-size: 10px; font-weight: 700; color: #8B4A2A; line-height: 1.15; }
.courtyard-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  color: #527941;
  font-style: italic;
  text-align: center;
  white-space: nowrap;
  z-index: 5;
}

/* Above the stall so visitors walk in front of the stand, never through it. */
.customers-layer { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.customer {
  position: absolute;
  bottom: 20%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translateX(-50%);
  will-change: left;
}
.customer-quote {
  background: #fff;
  color: #2C1810;
  font-size: 9px;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #2C1810;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: -0.125rem;
  white-space: nowrap;
  animation: tw-bounce 1s infinite;
  z-index: 20;
}
.customer-sprite { font-size: 1.5rem; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.25)); }

/* Sprite-sheet mode: 4 columns x 3 rows (row = walking / ordering / drinking). */
.customer-sprite.sheet {
  --fw: 64px;
  --fh: 64px;
  width: var(--fw);
  height: var(--fh);
  background-repeat: no-repeat;
  background-size: calc(var(--fw) * 4) calc(var(--fh) * 3);
  image-rendering: pixelated;
}
.customer-sprite.sheet.face-left { transform: scaleX(-1); }
.customer-sprite.sheet[data-state='walking'] { animation: cy-walk 0.95s steps(4) infinite; }
.customer-sprite.sheet[data-state='waiting'] { animation: cy-order 1s steps(2) infinite; }
.customer-sprite.sheet[data-state='drinking'] { animation: cy-drink 0.8s steps(2) infinite; }

@keyframes cy-walk {
  from { background-position: 0 0; }
  to { background-position: calc(-4 * var(--fw)) 0; }
}
@keyframes cy-order {
  from { background-position: 0 calc(-1 * var(--fh)); }
  to { background-position: calc(-2 * var(--fw)) calc(-1 * var(--fh)); }
}
@keyframes cy-drink {
  from { background-position: 0 calc(-2 * var(--fh)); }
  to { background-position: calc(-2 * var(--fw)) calc(-2 * var(--fh)); }
}
.customer-state {
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 9px;
  color: #3F6228;
  background: rgba(255, 255, 255, 0.7);
  padding: 0 0.25rem;
  border-radius: 0.125rem;
  transform: scale(0.75);
  margin-top: -0.25rem;
}
.rush-badge {
  position: absolute;
  top: 0.25rem;
  left: 0.75rem;
  background: #E63946;
  color: #fff;
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 9px;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 640px) {
  .courtyard { height: 19rem; }
  .customer-sprite { font-size: 1.875rem; }
  .customer-sprite.sheet { --fw: 88px; --fh: 88px; }
}

/* ==========================================================================
   Juice bar workshop
   ========================================================================== */
.workshop {
  position: relative;
  width: 100%;
  border-radius: 1rem;
  background: #FEF9E7;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 3px solid #2C1810;
  box-shadow: 0 4px 0 #2C1810;
  transition: all 0.3s;
}
.awning { position: absolute; top: 0; left: 0; right: 0; height: 1rem; display: flex; overflow: hidden; border-bottom: 2px solid #2C1810; }
.awning i { flex: 1; height: 100%; background: #FFF1C8; }
.awning i:nth-child(odd) { background: #E63946; }

.workshop-body { padding-top: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; }
.workshop-banner {
  position: relative;
  width: 100%;
  height: 8rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(93, 166, 71, 0.2);
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
}
.workshop-img { width: 100%; height: 100%; object-fit: cover; }
/* While a booster is running its illustration takes over the banner */
@keyframes banner-glow {
  0%, 100% { box-shadow: 0 2px 0 #2C1810, 0 0 0 2px #FFD23F, 0 0 12px rgba(255, 210, 63, 0.7); }
  50% { box-shadow: 0 2px 0 #2C1810, 0 0 0 3px #FFD23F, 0 0 22px rgba(255, 170, 0, 0.95); }
}
.workshop-banner.buffed {
  background: linear-gradient(to bottom, #FFF8E1, #FEF3C7);
  animation: banner-glow 1.6s ease-in-out infinite;
}
.workshop-banner.buffed .workshop-img { object-fit: contain; }
.workshop-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 50%, transparent); pointer-events: none; }
.workshop-meta { position: absolute; bottom: 0.5rem; left: 0.5rem; right: 0.5rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem; }
.lvl-wrap { color: #fff; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25); display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.lvl-tag {
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 10px;
  background: #8B4A2A;
  color: #fff;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.lvl-name { font-size: 11px; font-weight: 700; color: #FFD23F; }
.stock-badge {
  background: #FFF1C8;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.stock-img { width: 1.5rem; height: 1.5rem; border-radius: 0.125rem; object-fit: cover; border: 1px solid #2C1810; }
.stock-info { line-height: 1; text-align: right; }
.stock-label { font-size: 9px; text-transform: uppercase; font-weight: 700; color: #7A4B1A; }
.stock-value { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 0.875rem; font-weight: 900; color: #D97706; }
.workshop-desc { font-size: 0.75rem; color: #5D2E16; line-height: 1.375; }

/* Pressing box */
.press-box { margin: 0.75rem 0; padding: 0.75rem; background: #FFF8E1; border-radius: 0.75rem; border: 2px solid #2C1810; box-shadow: 0 2px 0 #2C1810; }
.press-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; font-weight: 700; color: #2C1810; margin-bottom: 0.5rem; gap: 0.5rem; }
.press-head-left { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.press-icon { font-size: 1rem; }
.press-icon.pressing { animation: tw-spin 1s linear infinite; }
.speed-tag {
  padding: 0.125rem 0.375rem;
  background: #FB8500;
  color: #fff;
  font-size: 9px;
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  border-radius: 0.25rem;
  animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.press-formula { color: #8B4A2A; font-size: 11px; text-align: right; }
/* Segmented pixel meter: filled cells are solid, the rest stay dithered. */
.progress-track {
  width: 100%;
  height: 1.25rem;
  display: flex;
  gap: 3px;
  padding: 0.1875rem;
  background: #FFF8E1;
  border-radius: 0.375rem;
  border: 2px solid #2C1810;
  overflow: hidden;
}
.progress-track .seg {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid rgba(44, 24, 16, 0.45);
  background-color: #F3EAD3;
  background-image:
    linear-gradient(45deg, rgba(44, 24, 16, 0.4) 25%, transparent 25%, transparent 75%, rgba(44, 24, 16, 0.4) 75%),
    linear-gradient(45deg, rgba(44, 24, 16, 0.4) 25%, transparent 25%, transparent 75%, rgba(44, 24, 16, 0.4) 75%);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
}
.progress-track .seg.on {
  background-image: none;
  background-color: #E63946;
  border-color: #2C1810;
}
.progress-track.rapid .seg.on { background-color: #FB8500; }
.press-foot { margin-top: 0.5rem; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #4A5568; gap: 0.5rem; }
.press-price { display: flex; align-items: center; gap: 0.25rem; }
.price-val { font-weight: 700; color: #B45309; }
.price-boost { color: #E63946; margin-left: 0.25rem; }
.press-status { font-size: 11px; font-weight: 500; color: #2C1810; }
.press-status.warn { color: #E63946; }
.press-status.ok { color: #388E3C; }

/* Upgrade area */
.upgrade-area { padding-top: 0.25rem; }
.upgrade-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  background: rgba(243, 229, 171, 0.6);
  padding: 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(139, 74, 42, 0.3);
}
.upgrade-title { font-weight: 700; color: #8B4A2A; display: flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; }
.upgrade-stats { font-size: 11px; color: #5D2E16; margin-top: 0.125rem; }
.upgrade-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.upgrade-btn .cost { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 10px; margin-left: 0.25rem; }
.upgrade-btn.can { background: #E63946; color: #fff; }
.upgrade-btn.can:hover { background: #D32F2F; }
.upgrade-btn:disabled { background: #d1d5db; color: #4b5563; }
.max-level { background: #FEF3C7; padding: 0.625rem; border-radius: 0.75rem; border: 1px solid #F59E0B; text-align: center; font-size: 0.75rem; font-weight: 700; color: #B45309; }

@media (min-width: 640px) {
  .workshop { padding: 1.25rem; }
  .workshop-banner { height: 15rem; }
  .upgrade-row { flex-direction: row; align-items: center; justify-content: space-between; }
  .upgrade-btn { width: auto; }
}

/* ==========================================================================
   Shop panel
   ========================================================================== */
/* Slide-in shop drawer, opened from the 🛒 button in the header */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.45);
  z-index: 60;
}
.shop-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(26rem, 92vw);
  z-index: 61;
  display: flex;
  flex-direction: column;
  padding: 0.875rem;
  background: #FFF9EB;
  border-left: 3px solid #2C1810;
  box-shadow: -6px 0 0 rgba(44, 24, 16, 0.15);
  overflow-y: auto;
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.26s;
}
.shop-drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s;
}
.shop-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.shop-drawer-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: #8B4A2A;
}
.shop-drawer-close {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-weight: 700;
  color: #2C1810;
  background: #FFF1C8;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
}
.shop-drawer-close:hover { background: #FFD23F; }
.shop-drawer .tabs { flex-shrink: 0; }
.btn-shop { background: #FFD23F; }
.tabs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem;
  background: #F3E5AB;
  border-radius: 0.75rem;
  border: 1px solid rgba(44, 24, 16, 0.2);
  margin-bottom: 0.75rem;
  overflow-x: auto;
}
.tab {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #6C391F;
  transition: all 0.15s ease;
}
.tab:hover { background: #FFF1C8; }
.tab.active { background: #8B4A2A; color: #fff; border: 2px solid #2C1810; box-shadow: 0 2px 0 #2C1810; }
.tab-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #FFD23F; margin-left: 0.125rem; animation: tw-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

.shop-content { display: flex; flex-direction: column; }
.multibuy-row { display: flex; align-items: center; justify-content: space-between; padding-bottom: 0.5rem; margin-bottom: 0.5rem; border-bottom: 1px solid rgba(44, 24, 16, 0.15); }
.multibuy-label { font-size: 11px; font-weight: 700; color: #8B4A2A; }
.multibuy-btns { display: flex; align-items: center; gap: 0.25rem; }
.qty-btn {
  padding: 0.125rem 0.5rem;
  font-size: 11px;
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  border-radius: 0.375rem;
  background: #FFF1C8;
  color: #6C391F;
  border: 1px solid rgba(44, 24, 16, 0.2);
  transition: all 0.15s ease;
}
.qty-btn:hover { background: #fff; }
.qty-btn.active { background: #FFD23F; color: #2C1810; border: 1px solid #2C1810; font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }

.shop-list { display: flex; flex-direction: column; gap: 0.625rem; padding-right: 0.25rem; }
.shop-list.tight { gap: 0.75rem; }

.banner { position: relative; width: 100%; height: 6rem; border-radius: 0.75rem; overflow: hidden; margin-bottom: 0.5rem; border: 2px solid #2C1810; box-shadow: 0 2px 0 #2C1810; }
.banner-img { width: 100%; height: 100%; object-fit: cover; }
.banner-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3), transparent); display: flex; align-items: center; padding: 0 0.75rem; }
.banner-tag { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 10px; color: #FFD23F; }
.banner-text { font-size: 0.75rem; font-weight: 700; line-height: 1.2; color: #fff; }

.item { padding: 0.75rem; border-radius: 0.75rem; border: 2px solid; display: flex; flex-direction: column; gap: 0.75rem; transition: all 0.15s ease; }
.item.affordable { background: #fff; border-color: #2C1810; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.item.affordable:hover { border-color: #8B4A2A; }
.item.locked { background: #F7F5EB; border-color: #d1d5db; opacity: 0.8; }
.item-left { display: flex; align-items: center; gap: 0.75rem; }
.item-icon {
  width: 2.75rem;
  height: 2.75rem;
  background: #FFF1C8;
  border-radius: 0.5rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.item-icon.wide { width: 4rem; height: 3.25rem; }
.item-img { width: 88%; height: 88%; object-fit: contain; }
.item-title-row { display: flex; align-items: center; gap: 0.5rem; }
.item-title { font-weight: 700; font-size: 0.875rem; color: #2C1810; line-height: 1.15; }
.item-badge {
  font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace;
  font-size: 10px;
  color: #8B4A2A;
  background: #FFF1C8;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(44, 24, 16, 0.3);
}
.item-desc { font-size: 0.75rem; color: #5D2E16; margin-top: 0.125rem; }
.item-rate { font-size: 11px; color: #388E3C; font-weight: 600; margin-top: 0.25rem; }
.item-rate.red { color: #E63946; }
.item-rate-total { color: #6b7280; font-weight: 400; margin-left: 0.25rem; }

.buy-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: #d1d5db;
  color: #6b7280;
  border: 2px solid #2C1810;
  box-shadow: 0 3px 0 #2C1810;
  transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.15s ease;
}
.buy-btn.can { background: #FFD23F; color: #2C1810; }
.buy-btn.can:hover { background: #FBBF24; transform: translateY(-1px); box-shadow: 0 4px 0 #2C1810; }
.buy-btn.can:active { transform: translateY(2px); box-shadow: 0 1px 0 #2C1810; }
.buy-cost { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 11px; }
.buy-extra { font-size: 10px; font-weight: 400; color: #5D2E16; }
.buy-active { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 10px; }
.buy-btn.active { background: #388E3C; color: #fff; }
.buy-btn.active:hover { background: #2E7D32; transform: translateY(-1px); box-shadow: 0 4px 0 #2C1810; }

/* Enhancers */
.enhancer-tip { font-size: 0.75rem; color: #6C391F; background: #FFF1C8; padding: 0.625rem; border-radius: 0.75rem; border: 1px solid rgba(44, 24, 16, 0.2); line-height: 1.625; }
/* The countdown bar is a full-width flex child, so let it wrap onto its own row
   instead of squeezing the icon, text and buy button on one line. */
.item.enhancer { position: relative; overflow: hidden; flex-wrap: wrap; }
.item.enhancer .item-left { flex: 1 1 auto; min-width: 0; }
.item.enhancer.active { background: linear-gradient(to right, #FFF8E1, #FEF3C7); border-color: #F59E0B; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.enhancer-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  background: #FFF1C8;
}
.enhancer-icon.wide { width: 4.5rem; height: 3.25rem; }
/* Active booster: keep the box still and only breathe the artwork itself. */
.enhancer-icon.active { background: #FFD23F; }
@keyframes enhancer-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.enhancer-icon.active .item-img { animation: enhancer-breathe 1.6s ease-in-out infinite; }
.enhancer-timer { font-size: 10px; font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; color: #8B4A2A; background: #FFF1C8; padding: 0.125rem 0.375rem; border-radius: 0.25rem; border: 1px solid rgba(44, 24, 16, 0.2); }
.enhancer-bar { width: 100%; height: 0.375rem; background: #E2E8F0; border-radius: 9999px; overflow: hidden; margin-top: 0.625rem; }
.enhancer-bar > i { display: block; height: 100%; background: #E63946; transition: width 1s linear; }

/* Stats tab */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.stat-card { background: #FFF1C8; padding: 0.625rem; border-radius: 0.75rem; border: 1px solid rgba(44, 24, 16, 0.2); text-align: center; }
.stat-label { font-size: 10px; color: #6C391F; font-weight: 700; }
.stat-value { font-size: 0.875rem; font-weight: 700; margin-top: 0.125rem; }
.stat-value.apples { color: #E63946; }
.stat-value.coins { color: #D97706; }
.stat-value.juice { color: #388E3C; }
.stat-value.clicks { color: #2C1810; }

.prestige-box {
  background: linear-gradient(to right, #FFFBEB, #FEF3C7, #FDE68A);
  padding: 0.875rem;
  border-radius: 0.75rem;
  border: 2px solid #2C1810;
  box-shadow: 0 2px 0 #2C1810;
}
.prestige-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.prestige-title-row { display: flex; align-items: center; gap: 0.5rem; }
.prestige-title { font-weight: 700; font-size: 0.875rem; color: #92400E; }
.prestige-badge { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 9px; background: #D97706; color: #fff; padding: 0.125rem 0.375rem; border-radius: 0.25rem; }
.prestige-desc { font-size: 0.75rem; color: #78350F; margin-top: 0.25rem; line-height: 1.625; }
.prestige-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  background: #d1d5db;
  color: #6b7280;
  border: 2px solid #2C1810;
  box-shadow: 0 3px 0 #2C1810;
  transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.15s ease;
}
.prestige-btn .seeds { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 10px; }
.prestige-btn.can { background: #F59E0B; color: #2C1810; }
.prestige-btn.can:hover { background: #D97706; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 0 #2C1810; }
.prestige-btn.can:active { transform: translateY(2px); box-shadow: 0 1px 0 #2C1810; }
.prestige-lock { font-size: 10px; color: #B45309; margin-top: 0.5rem; font-weight: 500; }

.ach-head { font-weight: 700; font-size: 0.75rem; color: #8B4A2A; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.25rem; }
.ach-count { font-size: 11px; color: #6b7280; }
.ach-grid { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.ach-card { padding: 0.625rem; border-radius: 0.75rem; border: 1px solid; display: flex; align-items: center; gap: 0.625rem; transition: all 0.15s ease; }
.ach-card.unlocked { background: #fff; border-color: #2C1810; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.ach-card.locked { background: #f3f4f6; border-color: #d1d5db; opacity: 0.55; }
.ach-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; background: #e5e7eb; filter: grayscale(1); }
.ach-card.unlocked .ach-icon { background: #FFF1C8; filter: none; border: 2px solid #2C1810; box-shadow: 0 2px 0 #2C1810; }
.ach-img { width: 1.4rem; height: 1.4rem; object-fit: contain; }
.ach-title { font-weight: 700; font-size: 0.75rem; color: #2C1810; }
.ach-desc { font-size: 11px; color: #5D2E16; line-height: 1.2; }

.shop-section { display: flex; flex-direction: column; gap: 1rem; }

@media (min-width: 640px) {
  .shop-drawer { padding: 1rem; }
  .item { flex-direction: row; align-items: center; justify-content: space-between; }
  .item.enhancer { flex-direction: row; align-items: center; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .ach-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.modal {
  background: #FEF9E7;
  border-radius: 1rem;
  padding: 1.25rem;
  max-width: 32rem;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  border: 3px solid #2C1810;
  box-shadow: 0 4px 0 #2C1810;
}
.modal.modal-small { background: #FFF1C8; max-width: 24rem; text-align: center; }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: #fff;
  color: #2C1810;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.modal-head .emoji { font-size: 1.875rem; }
.modal-title { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 0.875rem; color: #2C1810; }
.modal-sub { font-size: 0.75rem; color: #8B4A2A; font-weight: 700; margin-top: 0.25rem; }

.modal-body { display: flex; flex-direction: column; gap: 1rem; font-size: 0.75rem; color: #2C1810; line-height: 1.625; }
.guide-section { background: #FFF1C8; padding: 0.75rem; border-radius: 0.75rem; border: 1px solid rgba(44, 24, 16, 0.2); }
.guide-title { font-weight: 700; color: #8B4A2A; font-size: 0.875rem; display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.375rem; }
.guide-row { display: flex; align-items: flex-start; gap: 0.5rem; margin-top: 0.375rem; }
.guide-row .emoji { font-size: 1rem; flex-shrink: 0; }
.guide-list { list-style: decimal; list-style-position: inside; color: #5D2E16; display: flex; flex-direction: column; gap: 0.25rem; }
.guide-bullets { list-style: none; color: #5D2E16; display: flex; flex-direction: column; gap: 0.25rem; }
.strong-red { color: #991B1B; }
.strong-gold { color: #B45309; }

.modal-footer { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid rgba(44, 24, 16, 0.2); display: flex; justify-content: flex-end; }
.btn-primary { padding: 0.5rem 1.25rem; background: #8B4A2A; color: #fff; font-weight: 700; border-radius: 0.75rem; font-size: 0.75rem; }

.reset-emoji { font-size: 2.25rem; margin-bottom: 0.5rem; }
.reset-title { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 0.875rem; color: #991B1B; margin-bottom: 0.5rem; }
.reset-text { font-size: 0.75rem; color: #5D2E16; margin-bottom: 1rem; line-height: 1.625; }
.reset-actions { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.btn-cancel { padding: 0.5rem 1rem; background: #fff; color: #2C1810; font-weight: 700; border-radius: 0.75rem; font-size: 0.75rem; }
.btn-danger { padding: 0.5rem 1rem; background: #E63946; color: #fff; font-weight: 700; border-radius: 0.75rem; font-size: 0.75rem; }

.offline-emoji { font-size: 2.25rem; margin-bottom: 0.5rem; }
.offline-title { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 0.875rem; color: #8B4A2A; margin-bottom: 0.25rem; }
.offline-text { font-size: 0.75rem; color: #5D2E16; margin-bottom: 0.75rem; }
.offline-reward { background: #fff; padding: 0.75rem; border-radius: 0.75rem; border: 2px solid #2C1810; box-shadow: 0 2px 0 #2C1810; margin-bottom: 1rem; }
.offline-value { font-family: 'Press Start 2P', 'Fusion Pixel SC', monospace; font-size: 1.125rem; color: #E63946; }
