/* ═══════════════════════════════════════════════
   css/base.css
   Reset, body, scrollbars, utility classes
═══════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--ink); }

body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--parch);
  line-height: 1.65;
}

/* Scrollbars */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--stone); border-radius: 2px; }

/* Grain overlay */
#grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: var(--z-grain);
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* App container */
#app { position: fixed; inset: 0; overflow: hidden; }

/* Screens */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* Utility */
.hidden { display: none !important; }
.fade-in { animation: fadeIn .35s ease both; }
.fade-up { animation: fadeUp .4s ease both; }
.shake   { animation: screenShake .3s ease; }

/* Color utilities */
.txt-gold   { color: var(--gold); }
.txt-dharma { color: var(--dharma-light); }
.txt-blood  { color: var(--blood-light); }
.txt-mara   { color: var(--mara-light); }
.txt-ash    { color: var(--ash); }
.txt-sky    { color: #80B4E0; }

/* Divider */
.divider {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
  margin: 12px 0;
}

/* Pane section title */
.pane-section-title {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--ash);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .game-body {
    grid-template-columns: 1fr !important;
  }
  .sidebar {
    display: none !important;
  }
  .hud-vitals .vital-track {
    width: 48px !important;
  }
  .scene-art {
    height: 120px !important;
  }
  .story-body {
    font-size: 14px !important;
  }
  .bottom-bar {
    gap: 4px !important;
    padding: 4px 6px !important;
  }
  .bb-btn {
    font-size: 8px !important;
    padding: 3px 6px !important;
  }
  .vital-track {
    width: 48px !important;
  }
  .hud-gold, .hud-score {
    font-size: 10px !important;
  }
  .choice-meta {
    float: none !important;
    display: inline !important;
    font-size: 9px !important;
  }
  .class-grid {
    grid-template-columns: 1fr !important;
  }
  .shop-grid,
  .achievement-grid {
    grid-template-columns: 1fr !important;
  }
  .inv-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .spy-stats-row {
    grid-template-columns: 1fr !important;
  }
  .panel-box {
    max-width: 100% !important;
  }
  #screen-title {
    padding: 20px !important;
  }
  .title-dharma-wheel {
    width: 120px !important;
    height: 120px !important;
  }
  .title-main {
    font-size: clamp(24px, 6vw, 36px) !important;
  }
}

/* Mobile sidebar: show as bottom sheet on small screens */
@media (max-width: 768px) {
  .sidebar-pane.active {
    display: block;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 40vh;
    z-index: 60;
    background: var(--panel-bg);
    border-top: 1px solid var(--border-gold);
    padding: 12px;
    overflow-y: auto;
    animation: fadeUp .3s ease;
  }
  .sidebar-tabs {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 70;
    display: flex;
    background: var(--ink);
    border-top: 1px solid var(--border);
  }
  .stab {
    padding: 10px 4px !important;
    font-size: 10px !important;
  }
}
