/* ============================================================
   economy.css — coin economy, boosters, daily rewards, chests,
   settings drawer, and accessibility modes.
   Reuses the .drawer-sheet / .pill-btn language from ui.css so
   these new screens feel native to the existing UI.
   ============================================================ */

/* ---------- coin pill + notify dot ---------- */

.coin-pill #coinVal { color: var(--accent-gold); font-weight: 800; }

.notify-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
}
#rewardsBtn, #chestsTabDot { position: relative; }

/* ---------- booster tray ---------- */

#boosterTray {
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 4px;
}
.booster-chip {
  flex: 0 0 auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.booster-chip:active { transform: scale(0.92); }
.booster-chip.empty { opacity: 0.35; }
.booster-chip.active-effect {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(34, 229, 238, 0.5);
}
.booster-chip .bc-icon { font-size: 15px; }
.booster-chip .bc-count {
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-ui);
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 1px 5px;
  min-width: 14px;
  text-align: center;
}

/* ---------- rewards drawer (daily / shop / chests) ---------- */

#rewardsDrawer, #settingsDrawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
#rewardsDrawer.show, #settingsDrawer.show { display: flex; }
#rewardsDrawer .drawer-sheet, #settingsDrawer .drawer-sheet {
  max-height: 82vh;
}

.tab-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.tab-btn {
  flex: 1;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  border-radius: 12px;
  padding: 8px 6px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  position: relative;
}
.tab-btn.active {
  color: var(--text-primary);
  background: rgba(139, 124, 246, 0.22);
  border-color: var(--accent-violet);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }
.tab-hint { font-size: 11.5px; color: var(--text-dim); margin: 0 0 10px; line-height: 1.4; }

/* daily calendar */
#dailyGrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.daily-cell {
  border-radius: 10px;
  padding: 6px 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  text-align: center;
  font-size: 9.5px;
  color: var(--text-faint);
}
.daily-cell .dc-day { font-weight: 700; font-size: 9px; opacity: 0.7; }
.daily-cell .dc-icon { font-size: 15px; margin: 2px 0; }
.daily-cell.claimed { background: rgba(74, 222, 128, 0.14); border-color: rgba(74, 222, 128, 0.4); color: var(--text-primary); }
.daily-cell.today { border-color: var(--accent-gold); box-shadow: 0 0 10px rgba(255, 209, 102, 0.35); }
.daily-cell.big { grid-column: span 2; }

/* shop */
#shopGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.shop-item {
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop-item .si-icon { font-size: 20px; }
.shop-item .si-name { font-size: 11.5px; font-weight: 700; }
.shop-item .si-desc { font-size: 9px; color: var(--text-faint); line-height: 1.3; min-height: 24px; }
.shop-item .si-owned { font-size: 9.5px; color: var(--text-dim); }
.shop-item button {
  margin-top: 4px;
  border: none;
  border-radius: 20px;
  padding: 6px 8px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 10.5px;
  background: linear-gradient(135deg, var(--accent-gold), #ffb347);
  color: #1b0f30;
  cursor: pointer;
}
.shop-item button:disabled { opacity: 0.35; cursor: not-allowed; }

/* chests list */
#chestGrid { display: flex; flex-direction: column; gap: 8px; }
.chest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
}
.chest-row .cr-icon { font-size: 24px; }
.chest-row .cr-info { flex: 1; }
.chest-row .cr-name { font-size: 12px; font-weight: 700; }
.chest-row .cr-source { font-size: 9.5px; color: var(--text-faint); text-transform: capitalize; }
.chest-row button {
  border: none;
  border-radius: 20px;
  padding: 7px 12px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-pink));
  color: #fff;
  cursor: pointer;
}

/* ---------- chest opening modal ---------- */

#chestOpenModal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}
#chestOpenModal.show { display: flex; }
.chest-open-card {
  width: 90%;
  max-width: 340px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 24px 20px;
  text-align: center;
  animation: chestPop 0.4s cubic-bezier(.2,.9,.25,1.3);
}
.chest-icon { font-size: 56px; animation: chestBounce 0.6s ease; }
.chest-open-card h3 { margin: 6px 0 14px; font-family: var(--font-display); }
#chestLootGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.loot-chip {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 8px 4px;
  font-size: 10px;
}
.loot-chip .lc-icon { font-size: 18px; display: block; }

@keyframes chestPop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes chestBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- settings / accessibility drawer ---------- */

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 12.5px;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-cyan); }

/* ---------- accessibility modes (applied via <body> classes) ---------- */

body.a11y-large-text { font-size: 112%; }
body.a11y-large-text .hc-value { font-size: 17px !important; }
body.a11y-large-text .pill-btn { font-size: 13.5px !important; }

body.a11y-reduced-motion *,
body.a11y-reduced-motion *::before,
body.a11y-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

body.a11y-high-contrast {
  --glass-bg: rgba(255, 255, 255, 0.16);
  --glass-bg-strong: rgba(5, 1, 15, 0.95);
  --glass-border: rgba(255, 255, 255, 0.55);
  --text-dim: rgba(244, 242, 255, 0.85);
  --text-faint: rgba(244, 242, 255, 0.6);
}

/* Colorblind mode overlays a shape/symbol per bubble color via a CSS
   class the renderer checks (Renderer reads body.a11y-colorblind); the
   canvas draws a small glyph on top of each bubble instead of relying on
   hue alone. See renderer.js COLOR_GLYPHS. */
body.a11y-colorblind #stageWrap { outline: 1px dashed transparent; }
