/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: var(--bg-deepest);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }

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

/* ===========================
   LAYOUT
   =========================== */
.app-main {
  position: fixed;
  top: var(--header-h); bottom: var(--nav-h); left: 0; right: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ===========================
   PAGES
   =========================== */
.page {
  display: none; min-height: 100%;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  animation: fadeIn 0.3s ease;
}
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===========================
   STEPS (Draw Page)
   =========================== */
.step { display: none; }
.step.active-step { display: block; }
.step.hidden { display: none !important; }

/* ===========================
   UTILITIES
   =========================== */
.hidden { display: none !important; }
.mt-sm { margin-top: 10px; }

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(0,200,224,0.2); }
  50% { box-shadow: 0 0 24px rgba(0,200,224,0.5); }
}
.card-flip-scene { animation: pulseGlow 3s ease-in-out infinite; }
.card-flip.flipped { animation: none; }
