/* ============================================================
   Koda Design System — Shared CSS
   All design tokens, device frame, and reusable components
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500;600&family=Noto+Serif+SC:wght@300;400;500;600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ============================================================
   1. Design Tokens (CSS Variables)
   ============================================================ */
:root {
  /* Backgrounds */
  --bg: #091a12;
  --glow: #1a4a2e;
  --bg-blur: rgba(9,26,18,0.88);

  /* Text Colors */
  --tp: #eae6de;
  --ts: rgba(234,230,222,0.55);
  --tt: rgba(234,230,222,0.3);
  --th: rgba(234,230,222,0.16);

  /* Accent: Gold */
  --gold: #c4a55a;
  --gold-dim: rgba(196,165,90,0.5);
  --gold-bg: rgba(196,165,90,0.12);
  --gold-border: rgba(196,165,90,0.18);

  /* Glass Morphism */
  --glass-1: rgba(234,230,222,0.06);
  --glass-2: rgba(234,230,222,0.08);
  --glass-3: rgba(234,230,222,0.10);
  --glass-border-1: rgba(234,230,222,0.08);
  --glass-border-2: rgba(234,230,222,0.12);
  --glass-border-3: rgba(234,230,222,0.15);

  /* Semantic */
  --sep: rgba(234,230,222,0.08);
  --error: #ff3b30;
  --success: #34c759;

  /* Spacing (4pt grid) */
  --sp-xxs: 2px;
  --sp-xs: 4px;
  --sp-sm: 6px;
  --sp-md: 8px;
  --sp-lg: 10px;
  --sp-xl: 12px;
  --sp-2xl: 16px;
  --sp-3xl: 22px;
  --sp-4xl: 28px;

  /* Radii */
  --r-xl: 52px;
  --r-l: 16px;
  --r-m: 14px;
  --r-s: 8px;
  --r-xs: 3px;

  /* Fonts */
  --f-serif-cn: 'Noto Serif SC', 'Songti SC', serif;
  --f-serif-en: 'Cormorant Garamond', 'New York', serif;
  --f-sans: 'DM Sans', 'SF Pro Text', system-ui, sans-serif;
}

/* ============================================================
   2. Reset & Base
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100vh;
  background: #e8e4de;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, 'SF Pro Text', system-ui;
  -webkit-font-smoothing: antialiased;
  padding: 40px 20px;
}

/* ============================================================
   3. Device Frame (iPhone 15 Pro)
   ============================================================ */
.dev {
  position: relative;
  width: 393px;
  height: 852px;
  border-radius: 55px;
  background: #1a1a1c;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 0 0 2px #2a2a2c,
    0 0 0 3.5px #1a1a1c,
    0 0 0 5px #3a3a3c,
    0 40px 80px rgba(0,0,0,0.45);
  overflow: hidden;
}
.dev::before {
  content: '';
  position: absolute;
  right: -2.5px;
  top: 186px;
  width: 3px;
  height: 72px;
  background: linear-gradient(180deg, #4a4a4c, #3a3a3c);
  border-radius: 0 1.5px 1.5px 0;
}
.dev::after {
  content: '';
  position: absolute;
  left: -2.5px;
  top: 162px;
  width: 3px;
  height: 32px;
  background: linear-gradient(180deg, #4a4a4c, #3a3a3c);
  border-radius: 1.5px 0 0 1.5px;
  box-shadow: 0 50px 0 #3a3a3c, 0 88px 0 #3a3a3c;
}

/* Dynamic Island */
.di {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 22px;
  z-index: 200;
}

/* Screen */
.scr {
  position: absolute;
  inset: 3.5px;
  border-radius: 52px;
  overflow: hidden;
  background: var(--bg);
}

/* ============================================================
   4. Status Bar
   ============================================================ */
.sb {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 54px;
  z-index: 150;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  pointer-events: none;
}
.sb-t { font-size: 15px; font-weight: 600; color: var(--tp); }
.sb-i { display: flex; align-items: center; gap: 6px; }
.sb-c { display: flex; align-items: flex-end; gap: 1.5px; height: 12px; }
.sb-c .b { width: 3px; border-radius: 0.5px; background: var(--tp); }
.sb-c .b:nth-child(1) { height: 4px; }
.sb-c .b:nth-child(2) { height: 6px; }
.sb-c .b:nth-child(3) { height: 8px; }
.sb-c .b:nth-child(4) { height: 11px; }
.sb-w { width: 16px; height: 12px; }
.sb-bt { display: flex; align-items: center; gap: 1px; }
.sb-bb {
  width: 25px; height: 12px;
  border-radius: 3px;
  border: 1.2px solid rgba(234,230,222,0.5);
  position: relative;
  overflow: hidden;
}
.sb-bf {
  position: absolute;
  top: 1.5px; left: 1.5px; bottom: 1.5px;
  width: 65%;
  background: var(--tp);
  border-radius: 1px;
}
.sb-bp {
  width: 2px; height: 5px;
  border-radius: 0 1px 1px 0;
  background: rgba(234,230,222,0.35);
}

/* ============================================================
   5. App Container & Atmosphere
   ============================================================ */
.app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.atm {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.atm::before {
  content: '';
  position: absolute;
  top: -15%; left: -10%;
  width: 120%; height: 75%;
  background: radial-gradient(ellipse at 40% 35%, rgba(26,74,46,0.32) 0%, transparent 65%);
  animation: drift 24s ease-in-out infinite;
}
.atm::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(to top, var(--bg), transparent);
}

.noise {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ============================================================
   6. Navigation Bar
   ============================================================ */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  margin-top: 54px;
  padding: 0 16px;
  flex-shrink: 0;
}
.nav-animated {
  opacity: 0;
  animation: fi 0.6s ease 0.3s forwards;
}

/* Nav: title left */
.tl { display: flex; align-items: baseline; gap: 6px; }
.tl-c {
  font-family: var(--f-serif-cn);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--tp);
}
.tl-e {
  font-family: var(--f-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ts);
}

/* Nav: right */
.nr { display: flex; align-items: center; gap: 4px; }

/* Streak badge */
.stk-b {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
}
.stk-d {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.stk-n {
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

/* Notification */
.noti {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}
.noti svg {
  width: 22px; height: 22px;
  stroke: var(--ts);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.noti-d {
  position: absolute;
  top: 9px; right: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--error);
  border: 1.5px solid var(--bg);
}

/* Nav: back button (push pages) */
.nav-back {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
}
.nav-back svg {
  width: 20px; height: 20px;
  stroke: var(--tp);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-back:active { opacity: 0.6; }

.nav-title {
  font-family: var(--f-sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--tp);
  letter-spacing: 0.3px;
}

/* ============================================================
   7. Tab Bar
   ============================================================ */
.tb {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  height: 83px;
  padding-top: 5px;
  border-top: 0.33px solid var(--sep);
  background: var(--bg-blur);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.tb-animated {
  opacity: 0;
  animation: fi 0.5s ease 1s forwards;
}

.t {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 64px;
  padding: 2px 0;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.t svg {
  width: 25px; height: 25px;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.t.on { color: var(--tp); }
.t:not(.on) { color: var(--tt); }
.t.on svg { stroke: var(--tp); }
.t:not(.on) svg { stroke: var(--tt); }
.t span { font-family: var(--f-sans); font-size: 10px; font-weight: 500; }
.t.on span { color: var(--tp); }
.t:not(.on) span { color: var(--tt); }

.hi {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 139px;
  height: 5px;
  border-radius: 2.5px;
  background: rgba(234,230,222,0.22);
}

/* ============================================================
   8. Glass Card System
   ============================================================ */
.glass-1 {
  background: var(--glass-1);
  border: 0.5px solid var(--glass-border-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--r-m);
}
.glass-2 {
  background: var(--glass-2);
  border: 0.5px solid var(--glass-border-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-m);
}
.glass-3 {
  background: var(--glass-3);
  border: 0.5px solid var(--glass-border-3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-l);
}
.glass-gold {
  background: rgba(196,165,90,0.10);
  border: 0.5px solid var(--gold-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-m);
}

.glass-1:active,
.glass-2:active,
.glass-3:active,
.glass-gold:active {
  background: rgba(234,230,222,0.14);
}

/* ============================================================
   9. Button System
   ============================================================ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: none;
  cursor: pointer;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  transition: transform 0.1s ease, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-primary {
  background: var(--glass-3);
  border: 0.5px solid var(--gold-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-m);
  color: var(--gold);
}
.btn-primary:active {
  background: rgba(234,230,222,0.14);
}

.btn-secondary {
  background: var(--glass-2);
  border: 0.5px solid var(--glass-border-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-m);
  color: var(--tp);
}
.btn-secondary:active {
  background: rgba(234,230,222,0.14);
}

.btn-ghost {
  background: none;
  border: none;
  border-radius: var(--r-m);
  color: var(--ts);
}
.btn-ghost:active {
  opacity: 0.6;
}

.btn-gold {
  background: linear-gradient(135deg, rgba(196,165,90,0.25), rgba(196,165,90,0.15));
  border: 0.5px solid var(--gold-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-m);
  color: var(--gold);
}
.btn-gold:active {
  background: linear-gradient(135deg, rgba(196,165,90,0.35), rgba(196,165,90,0.25));
}

.btn-full {
  width: 100%;
  border-radius: var(--r-m);
}

/* Social Auth Buttons */
.btn-apple, .btn-google {
  width: 100%;
  height: 50px;
  border-radius: var(--r-m);
  font-size: 16px;
  font-weight: 600;
  gap: 10px;
}
.btn-apple {
  background: var(--tp);
  color: #000;
  border: none;
}
.btn-apple:active { opacity: 0.85; }
.btn-google {
  background: var(--glass-2);
  border: 0.5px solid var(--glass-border-2);
  color: var(--tp);
}

/* ============================================================
   10. Input System
   ============================================================ */
.input-field {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--glass-1);
  border: 0.5px solid var(--glass-border-2);
  border-radius: var(--r-m);
  color: var(--tp);
  font-family: var(--f-sans);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.input-field::placeholder {
  color: var(--tt);
}
.input-field:focus {
  border-color: rgba(234,230,222,0.25);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-label {
  font-family: var(--f-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ts);
}

/* Select dropdown style */
.select-field {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--glass-1);
  border: 0.5px solid var(--glass-border-2);
  border-radius: var(--r-m);
  color: var(--tp);
  font-family: var(--f-sans);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(234,230,222,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.select-field option {
  background: #1a2a1e;
  color: var(--tp);
}

/* ============================================================
   11. List & Group System
   ============================================================ */
.list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-group-title {
  font-family: var(--f-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--tt);
  padding: 0 4px;
  margin-bottom: 0;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 12px 16px;
  background: var(--glass-2);
  border: 0.5px solid var(--glass-border-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-m);
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.list-item:active {
  background: rgba(234,230,222,0.14);
}

.list-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.list-item-icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
}
.list-item-icon svg {
  width: 22px; height: 22px;
  stroke: rgba(234,230,222,0.65);
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.list-item-text {
  font-family: var(--f-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--tp);
}
.list-item-subtitle {
  font-family: var(--f-sans);
  font-size: 12px;
  color: var(--ts);
  margin-top: 2px;
}

.list-chevron svg {
  width: 14px; height: 14px;
  stroke: rgba(234,230,222,0.4);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   12. Modal System
   ============================================================ */
.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-height: 80%;
  background: linear-gradient(180deg, rgba(20,40,28,0.98), rgba(9,26,18,0.98));
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 40px;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(234,230,222,0.2);
  margin: 0 auto 20px;
}

.modal-title {
  font-family: var(--f-serif-en);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--tp);
  text-align: center;
  margin-bottom: 16px;
}

.modal-body {
  color: var(--ts);
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================================
   13. Entry Grid (4-col)
   ============================================================ */
.eg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 68px;
  padding: 12px 4px 10px;
  border-radius: var(--r-m);
  background: var(--glass-2);
  border: 0.5px solid var(--glass-border-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.ent:active { background: rgba(234,230,222,0.14); }
.ent-i svg {
  width: 22px; height: 22px;
  stroke: rgba(234,230,222,0.65);
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ent-n {
  font-family: var(--f-sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(234,230,222,0.45);
}
.ent.g {
  background: rgba(196,165,90,0.1);
  border-color: rgba(196,165,90,0.2);
}
.ent.g .ent-i svg { stroke: rgba(196,165,90,0.7); }
.ent.g .ent-n { color: rgba(196,165,90,0.6); }

/* ============================================================
   14. Chips / Filter Pills
   ============================================================ */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--glass-1);
  border: 0.5px solid var(--glass-border-1);
  color: var(--ts);
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.chip.active {
  background: var(--glass-3);
  border-color: var(--glass-border-3);
  color: var(--tp);
}
.chip:active { background: rgba(234,230,222,0.14); }

/* ============================================================
   15. Card Variants
   ============================================================ */

/* Last reading card */
.prev {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--r-l);
  background: var(--glass-3);
  border: 0.5px solid var(--glass-border-3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s;
}
.prev:active { background: rgba(234,230,222,0.14); }
.prev-l {
  font-family: var(--f-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(234,230,222,0.45);
  margin-bottom: 2px;
}
.prev-t {
  font-family: var(--f-serif-en);
  font-size: 16px;
  font-weight: 400;
  color: rgba(234,230,222,0.82);
  letter-spacing: 0.3px;
}
.prev-t .cn {
  font-family: var(--f-serif-cn);
  font-size: 15px;
}
.prev-a svg {
  width: 14px; height: 14px;
  stroke: rgba(234,230,222,0.4);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Fortune card (for history / insight listings) */
.fortune-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--r-m);
  background: var(--glass-2);
  border: 0.5px solid var(--glass-border-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: background 0.2s;
}
.fortune-card:active { background: rgba(234,230,222,0.14); }
.fortune-card-num {
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--tp);
  letter-spacing: 0.3px;
}
.fortune-card-name {
  font-family: var(--f-serif-en);
  font-size: 15px;
  font-weight: 400;
  color: var(--tp);
  letter-spacing: 0.3px;
}
.fortune-card-meta {
  font-family: var(--f-sans);
  font-size: 11px;
  color: var(--ts);
  margin-top: 2px;
}
.fortune-card-luck {
  font-family: var(--f-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 8px;
}
.luck-supreme { background: rgba(255,215,0,0.15); color: #FFD700; }
.luck-great { background: rgba(232,195,74,0.12); color: #E8C34A; }
.luck-upper { background: rgba(196,168,77,0.1); color: #C4A84D; }
.luck-good { background: rgba(143,176,106,0.1); color: #8FB06A; }
.luck-rising { background: rgba(122,158,140,0.08); color: #7A9E8C; }
.luck-neutral { background: rgba(140,154,158,0.08); color: #8C9A9E; }
.luck-caution { background: rgba(160,128,96,0.1); color: #A08060; }
.luck-minor { background: rgba(196,122,90,0.1); color: #C47A5A; }
.luck-bad { background: rgba(160,64,64,0.1); color: #A04040; }


/* ============================================================
   16. Progress Bar
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--glass-1);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gold);
  transition: width 0.5s ease;
}

/* ============================================================
   17. Toggle Switch
   ============================================================ */
.toggle {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--glass-2);
  border: 0.5px solid var(--glass-border-2);
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}
.toggle.on {
  background: rgba(52,199,89,0.5);
  border-color: rgba(52,199,89,0.3);
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--tp);
  transition: transform 0.3s;
}
.toggle.on::after {
  transform: translateX(20px);
}

/* ============================================================
   18. Pricing Toggle
   ============================================================ */
.pricing-toggle {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--glass-1);
  border: 0.5px solid var(--glass-border-1);
}
.pricing-option {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ts);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.pricing-option.active {
  background: var(--glass-3);
  color: var(--tp);
}

/* ============================================================
   19. Scrollable Content Area
   ============================================================ */
.scroll-content {
  position: relative;
  z-index: 10;
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-content::-webkit-scrollbar { display: none; }

/* ============================================================
   20. Utility Classes
   ============================================================ */

/* Typography */
.text-display {
  font-family: var(--f-serif-cn);
  font-size: 44px;
  font-weight: 600;
  color: var(--tp);
}
.text-h1 {
  font-family: var(--f-serif-en);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--tp);
}
.text-h2 {
  font-family: var(--f-serif-cn);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--tp);
}
.text-h3 {
  font-family: var(--f-serif-en);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: var(--tp);
}
.text-body {
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--ts);
  line-height: 1.5;
}
.text-caption {
  font-family: var(--f-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ts);
}
.text-label {
  font-family: var(--f-sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(234,230,222,0.45);
}
.text-micro {
  font-family: var(--f-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--tt);
}
.text-overline {
  font-family: var(--f-sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--tt);
}

.text-gold { color: var(--gold); }
.text-error { color: var(--error); }
.text-center { text-align: center; }

/* Spacing helpers */
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 6px; }
.mt-md { margin-top: 8px; }
.mt-lg { margin-top: 10px; }
.mt-xl { margin-top: 12px; }
.mt-2xl { margin-top: 16px; }
.mt-3xl { margin-top: 22px; }
.mt-4xl { margin-top: 28px; }
.mb-md { margin-bottom: 8px; }
.mb-lg { margin-bottom: 10px; }
.mb-xl { margin-bottom: 12px; }
.mb-2xl { margin-bottom: 16px; }
.gap-md { gap: 8px; }
.gap-lg { gap: 10px; }
.gap-xl { gap: 12px; }
.p-2xl { padding: 16px; }

/* Flex */
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* Page indicator dots */
.page-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--glass-2);
  border: 0.5px solid var(--glass-border-2);
  transition: all 0.3s;
}
.dot.active {
  background: var(--tp);
  border-color: var(--tp);
  width: 24px;
  border-radius: 4px;
}

/* Checkbox */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.checkbox {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid var(--glass-border-3);
  background: var(--glass-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.2s;
}
.checkbox.checked {
  background: var(--gold);
  border-color: var(--gold);
}
.checkbox.checked::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid #091a12;
  border-bottom: 2px solid #091a12;
  transform: rotate(-45deg) translateY(-1px);
}

/* Divider */
.divider {
  width: 100%;
  height: 0.5px;
  background: var(--sep);
  margin: 16px 0;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  font-family: var(--f-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-gold {
  background: var(--gold-bg);
  color: var(--gold);
  border: 0.5px solid var(--gold-border);
}
.badge-save {
  background: rgba(52,199,89,0.15);
  color: var(--success);
  font-size: 9px;
  letter-spacing: 1px;
}

/* ============================================================
   21. Animations & Keyframes
   ============================================================ */
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2%, -1.5%); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fi {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes su {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes vi {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes idle {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(1.2deg); }
  70% { transform: rotate(-1.2deg); }
}
@keyframes gp {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes sw1 {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(-3deg); }
}
@keyframes sw2 {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(1.5deg); }
}
@keyframes sw3 {
  0%, 100% { transform: rotate(0.5deg); }
  50% { transform: rotate(3.5deg); }
}
@keyframes rip {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(-5deg); }
  20% { transform: rotate(5deg); }
  30% { transform: rotate(-4deg); }
  40% { transform: rotate(4deg); }
  50% { transform: rotate(-2deg); }
  60% { transform: rotate(2deg); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Stagger delay helpers */
.anim-d1 { opacity: 0; animation: su 0.6s ease 0.1s forwards; }
.anim-d2 { opacity: 0; animation: su 0.6s ease 0.2s forwards; }
.anim-d3 { opacity: 0; animation: su 0.6s ease 0.3s forwards; }
.anim-d4 { opacity: 0; animation: su 0.6s ease 0.4s forwards; }
.anim-d5 { opacity: 0; animation: su 0.6s ease 0.5s forwards; }
.anim-d6 { opacity: 0; animation: su 0.6s ease 0.6s forwards; }
.anim-d7 { opacity: 0; animation: su 0.6s ease 0.7s forwards; }
.anim-d8 { opacity: 0; animation: su 0.6s ease 0.8s forwards; }
.anim-d9 { opacity: 0; animation: su 0.6s ease 0.9s forwards; }
.anim-d10 { opacity: 0; animation: su 0.6s ease 1.0s forwards; }
.anim-fi-d1 { opacity: 0; animation: fi 0.6s ease 0.1s forwards; }
.anim-fi-d3 { opacity: 0; animation: fi 0.6s ease 0.3s forwards; }
.anim-fi-d5 { opacity: 0; animation: fi 0.8s ease 0.5s forwards; }
.anim-fi-d7 { opacity: 0; animation: fi 0.8s ease 0.7s forwards; }
.anim-fi-d10 { opacity: 0; animation: fi 0.5s ease 1.0s forwards; }

/* ============================================================
   22. Embed Mode (iframe)
   When a page is loaded inside an iframe (e.g. showcase site),
   strip the device frame and let the parent provide the chrome.
   ============================================================ */
html.in-iframe body {
  background: var(--bg);
  padding: 0;
  display: block;
  min-height: 100vh;
}
html.in-iframe .dev {
  width: 100%;
  height: 100vh;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
}
html.in-iframe .dev::before,
html.in-iframe .dev::after {
  display: none;
}
html.in-iframe .di {
  display: none;
}
html.in-iframe .scr {
  inset: 0;
  border-radius: 0;
}
html.in-iframe .app {
  animation: iframe-fadein 0.25s ease-out;
}
@keyframes iframe-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   23. Reduce Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .orbital { display: none; }
}
