/* ===== Base Page Section ===== */
.page-section {
  min-height: 100vh;
  overflow: visible;
  padding: 100px 24px 80px;
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== TEMPLE PALETTE ===== */
:root {
  --crimson-deep: #5C0000;
  --crimson: #7B1818;
  --crimson-mid: #9B1B1B;
  --crimson-bright: #B22222;
  --crimson-light: #D43535;
  --gold-dark: #A67C00;
  --gold: #D4A017;
  --gold-bright: #FFD700;
  --gold-light: #FFE44D;
  --parchment: #FFF8DC;
  --parchment-mid: #FAEBD7;
  --parchment-dark: #F5DEB3;
  --parchment-text: #3C2415;
  --parchment-muted: #7A5C3D;
  --midnight: #0A0E27;
  --midnight-light: #1A2040;
  --incense-glow: rgba(255, 215, 0, 0.12);
  --incense-rim: rgba(255, 215, 0, 0.25);
  --jade: #2E8B57;
  --jade-glow: rgba(46, 139, 87, 0.25);
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Inter', system-ui, sans-serif;
  --font-cn: 'Noto Serif SC', serif;
  --font-title: 'Ma Shan Zheng', 'Noto Serif SC', cursive;
  --surface1: #2D0A0A;
  --surface2: #3D1515;
  --border: rgba(165, 124, 0, 0.2);
}

/* ===== BACKGROUND ===== */
html {
  scroll-behavior: smooth;
  height: 100%;
}
body {
  font-family: var(--font);
  background: linear-gradient(170deg, #3A0000 0%, #5C0000 20%, #7B1818 50%, #5C0000 80%, #3A0000 100%);
  color: var(--parchment-text);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.page-wrapper {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  padding-bottom: env(safe-area-inset-bottom, 24px);
}

/* ===== DECORATIVE BACKGROUND GRID (subtle gold lattice) ===== */
.bg-grid {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;

  pointer-events: none;
  background-image:
    linear-gradient(rgba(212, 160, 23, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 160, 23, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  pointer-events: none;
}

/* ===== ANIMATIONS ===== */
@keyframes incense-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 215, 0, 0.06), 0 0 12px rgba(255, 215, 0, 0.04); }
  50% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.18), 0 0 28px rgba(255, 215, 0, 0.08); }
}

@keyframes gold-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes temple-reveal {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes seal-stamp {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ember-drift {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  20% { opacity: 0.6; }
  80% { opacity: 0.3; }
  100% { transform: translateY(-40px) scale(0.3); opacity: 0; }
}

@keyframes scroll-unfurl {
  from { max-height: 0; opacity: 0; }
  to { max-height: 600px; opacity: 1; }
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; width: 100%;
  max-width: 100vw;
  min-height: 48px;

  background: #4A0000;
  border-bottom: 2px solid var(--gold-dark);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
  z-index: 100;
}
.nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 40px,
    rgba(212, 160, 23, 0.03) 40px,
    rgba(212, 160, 23, 0.03) 41px
  );
  pointer-events: none;
}


.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  gap: 8px;
}

.logo {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}
img.logo {
  display: block;
  height: 36px;
  width: auto;
}

/* ===== LOGO OVERLAY ===== */
/* Mobile: small fixed logo below nav bar */
@media (max-width: 640px) {
  /* Compact nav for mobile */
  .nav { min-height: auto; }
  .nav-inner {
    padding: 6px 4px;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }
  /* Mobile: push content below the features dropdown button */
  .page-section {
    padding-top: 16px;
  }
  .page-section#calculator-section {
    padding-top: 16px;
  }
  .main {
    padding-top: 125px;
  }
  .nav-left {
    font-size: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
  }
  .nav-right {
    flex-shrink: 0;
    gap: 1px;
  }
  .logo-overlay {
    flex-shrink: 0;
    width: 50px;
    height: 28px;
    border-width: 1px;
    box-shadow: 0 0 5px rgba(184, 134, 11, 0.2);
  }
  .logo-overlay img {
    width: 50px;
    margin-top: 1px;
  }
  .lang-opt { font-size: 10px; padding: 2px 6px; }
  .credit-badge { font-size: 10px; }
  .profile-add-btn { font-size: 10px; padding: 2px 6px; white-space: nowrap; }
}
.logo-overlay {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  pointer-events: none;
  line-height: 0;
  width: 100px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #5A0000 50%, #3A0000 100%);
  border: 1.5px solid #B8860B;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(184, 134, 11, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-overlay img {
  display: block;
  width: 100px;
  height: auto;
  margin-top: 3px;
}

.logo-sub {
  font-family: var(--font);
  font-weight: 400;
  color: var(--parchment-muted);
  font-size: 14px;
}


/* ===== MAIN ===== */

.scroll-wrapper {
  min-height: 100vh;
}
.main {
  max-width: 720px;
  margin: 0 auto;
  max-width: 100%;
  padding: 145px 24px 40px;
  position: relative;
  z-index: 1;
  touch-action: pan-y;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 48px 0 32px;
  position: relative;
}

/* Divider after subtitle on all section pages */
.hero-sub::after {
  content: '⸻⸻⸻ ✦ ⸻⸻⸻';
  display: block;
  margin-top: 20px;
  color: var(--gold-dark);
  font-size: 14px;
  letter-spacing: 4px;
  opacity: 0.5;
}

.hero h1 {
  font-family: var(--font-cn);
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
  color: var(--parchment);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.accent { color: var(--gold); text-shadow: 0 0 16px rgba(255, 215, 0, 0.2); }

.hero-sub {
  color: var(--gold-dark);
  font-size: 15px;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== CARDS (Parchment Scrolls) ===== */
.card {
  background: linear-gradient(135deg, var(--parchment) 0%, var(--parchment-mid) 50%, var(--parchment-dark) 100%);
  border: 1px solid rgba(165, 124, 0, 0.3);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

/* Incense glow rim light on hover */
.card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.5s ease;
  pointer-events: none;
}

.card:hover {
  border-color: var(--gold-dark);
  box-shadow:
    0 6px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 20px var(--incense-glow);
  animation: incense-glow 3s ease-in-out infinite;
}

.card h2 {
  font-family: var(--font-cn);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--parchment-text);
}

.card-sub {
  color: var(--parchment-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

/* ===== FORM ===== */
.form-row { margin-bottom: 20px; }
.form-row.thirds { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-row.halves { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--parchment-muted);
  margin-bottom: 6px;
}

.optional { font-weight: 400; font-size: 12px; }

.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(165, 124, 0, 0.2);
  border-radius: 8px;
  color: var(--parchment-text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: all 0.3s;
  -webkit-appearance: auto;
  appearance: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a57c00' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(165, 124, 0, 0.2);
  border-radius: 8px;
  color: var(--parchment-text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: all 0.3s;
}

.form-group select:focus, .form-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15), 0 0 12px var(--incense-glow);
  background: rgba(255, 255, 255, 0.8);
}

.gender-group { display: flex; gap: 20px; }

.gender-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(165, 124, 0, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.gender-opt:hover {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.6);
}

.gender-opt:has(input:checked) {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: rgba(212, 160, 23, 0.12);
  font-weight: 600;
  box-shadow: 0 0 10px var(--incense-glow);
}

.gender-opt input { display: none; }

/* ===== BUTTONS ===== */

/* Seal stamp primary button */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--crimson-mid) 0%, var(--crimson-bright) 50%, var(--crimson-mid) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 8px;
  color: var(--parchment);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-cn);
  cursor: pointer;
  transition: all 0.35s ease;
  position: relative;
  letter-spacing: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--crimson-bright) 0%, var(--crimson-light) 50%, var(--crimson-bright) 100%);
  border-color: var(--gold);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.35),
    0 0 20px var(--incense-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  
  border-radius: 8px;
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: rgba(212, 160, 23, 0.12);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 12px var(--incense-glow);
}

/* ===== CHART GRID (Pillar Shrines) ===== */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.pillar {
  background: linear-gradient(180deg, var(--crimson) 0%, var(--crimson-deep) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 8px;
  padding: 20px 12px 16px;
  text-align: center;
  position: relative;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
  color: var(--parchment);
}

/* Miniature temple roof (歇山顶) for pillars */
.pillar::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 10%;
  width: 80%;
  height: 10px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-dark));
  clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Ridge ornament */
.pillar::after {
  content: '◆';
  position: absolute;
  top: -55px;
  left: 50%;
  color: var(--gold);
  font-size: 8px;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

.pillar.highlight {
  border-color: var(--gold);
  box-shadow:
    0 0 24px var(--incense-glow),
    0 4px 20px rgba(0, 0, 0, 0.35),
    inset 0 0 20px rgba(255, 215, 0, 0.06);
}

.pillar:hover {
  border-color: var(--gold);
  box-shadow:
    0 0 20px var(--incense-glow),
    0 6px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.pillar-label {
  font-size: 11px;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.pillar-gan {
  font-family: var(--font-cn);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--parchment);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.pillar-zhi {
  font-family: var(--font-cn);
  font-size: 24px;
  color: var(--gold-light);
  margin-top: 4px;
  opacity: 0.85;
}

.pillar-element {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}

.pillar-animal {
  font-size: 12px;
  color: var(--gold-light);
  margin-top: 4px;
  opacity: 0.7;
}

/* Element badges */
.el-wood { background: rgba(46, 139, 87, 0.3); color: #7CCD7C; border: 1px solid rgba(46, 139, 87, 0.4); }
.el-fire { background: rgba(178, 34, 34, 0.3); color: #FF6B6B; border: 1px solid rgba(178, 34, 34, 0.4); }
.el-earth { background: rgba(165, 124, 0, 0.3); color: var(--gold-light); border: 1px solid rgba(165, 124, 0, 0.4); }
.el-metal { background: rgba(192, 192, 192, 0.2); color: #E8E8E8; border: 1px solid rgba(192, 192, 192, 0.3); }
.el-water { background: rgba(0, 100, 200, 0.3); color: #80C0FF; border: 1px solid rgba(0, 100, 200, 0.4); }

/* ===== INSIGHT ROW ===== */
.insight-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.insight-card {
  background: rgba(92, 0, 0, 0.15);
  border: 1px solid rgba(165, 124, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: all 0.3s;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.insight-card:hover {
  border-color: var(--gold-dark);
  box-shadow: 0 0 12px var(--incense-glow);
  background: rgba(92, 0, 0, 0.2);
}

/* Mobile: stack 4 pillar cards into 2x2 grid for readability */
@media (max-width: 640px) {
  #compat-pillars .insight-row {
    grid-template-columns: repeat(2, 1fr);
  }
}


.insight-label {
  display: block;
  font-size: 11px;
  color: var(--parchment-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 500;
}



/* Marriage year badges — highlight selected year */
.year-badge {
  display: inline-block;
  padding: 8px 16px;
  margin: 4px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-weight: 600;
  color: var(--parchment-text);
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.year-badge.active {
  background: var(--gold-dark);
  color: #fff;
  border-color: var(--gold-bright);
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.4);
}

/* Marriage month cards — highlight selected month */
.month-card {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border-left: 3px solid #4caf50;
  transition: all 0.2s ease;
}

.month-card.active {
  background: rgba(212, 160, 23, 0.25);
  border-left-color: var(--gold-bright);
  border-left-width: 4px;
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.3);
}

.insight-value {
  display: block;
  font-family: var(--font-cn);
  font-size: 22px;
  font-weight: 700;
  color: var(--parchment-text);
}

.insight-value.accent { color: var(--gold-dark); }

.insight-value.danger { color: var(--crimson-bright); }

.insight-meta {
  display: block;
  font-size: 11px;
  color: var(--parchment-muted);
  margin-top: 2px;
}

/* ===== LUCK CYCLE HIGHLIGHT CARDS ===== */
#luck-current-card .insight-value,
#luck-next-card .insight-value {
  color: var(--gold-bright);
}
#luck-current-card .insight-meta,
#luck-next-card .insight-meta {
  color: var(--gold);
}
#luck-current-card:hover,
#luck-next-card:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 0 16px var(--incense-glow);
}

/* ===== INTERPRETATION (Aged Divination Slip) ===== */
.interpretation {
  margin-top: 16px;
  padding: 20px 20px 16px;
  border: 1px solid rgba(165, 124, 0, 0.25);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 248, 220, 0.6) 0%, rgba(245, 222, 179, 0.4) 100%);
  position: relative;
}

.interpretation::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 28px,
    rgba(165, 124, 0, 0.06) 28px,
    rgba(165, 124, 0, 0.06) 29px
  );
  border-radius: 8px;
  pointer-events: none;
}

.interpretation h3 {
  font-family: var(--font-cn);
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--parchment-text);
  position: relative;
  z-index: 1;
}

#reading-text {
  color: var(--parchment-text);
  font-size: 14px;
  line-height: 1.7;
  min-height: 40px;
  position: relative;
  z-index: 1;
}

/* ===== UPGRADE BANNER ===== */
.upgrade-banner {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(212, 160, 23, 0.1) 0%, rgba(212, 160, 23, 0.03) 100%);
  border: 1px solid rgba(212, 160, 23, 0.25);
  border-radius: 8px;
  text-align: center;
}

.upgrade-banner p { margin-bottom: 12px; font-size: 14px; color: var(--parchment-muted); }

/* ===== FOOTER (Stone Stele) ===== */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--parchment-muted);
  font-size: 12px;
  border-top: 1px solid rgba(165, 124, 0, 0.2);
  background: linear-gradient(180deg, transparent 0%, rgba(60, 36, 21, 0.15) 100%);
  position: relative;
}

.footer::before {
  content: '▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔';
  display: block;
  margin-bottom: 12px;
  color: rgba(165, 124, 0, 0.15);
  font-size: 9px;
  letter-spacing: 8px;
}

.footer-small { margin-top: 4px; font-size: 11px; opacity: 0.7; }

/* ===== LANGUAGE SWITCHER ===== */
.nav-inner { display: flex; align-items: center; justify-content: space-between; }

.nav-left {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  justify-content: flex-start;
  flex: 0 1 auto;
  max-width: calc(50vw - 145px);
  min-width: 0;
  overflow: hidden;
  position: fixed;
  left: 24px;
  top: 6px;
  transform: none;
  z-index: 100;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.credit-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(165, 124, 0, 0.15);
  border: 1px solid rgba(165, 124, 0, 0.3);
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  transition: background 0.2s;
  white-space: nowrap;
}
.credit-badge:hover {
  background: rgba(165, 124, 0, 0.25);
}
.credit-icon {
  font-size: 14px;
}

.lang-switcher {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid rgba(165, 124, 0, 0.15);
}

.lang-opt {
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: var(--parchment-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: var(--font);
}

.lang-opt.active, .lang-opt:hover {
  background: rgba(212, 160, 23, 0.15);
  color: var(--gold);
}

.profile-switcher-wrap {
  position: relative;
  max-width: calc(100% - 8px);
  width: 100%;
  display: flex;
  flex-direction: row;
  padding-left: 4px;
  overflow: visible;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
}
.profile-switcher-wrap .profile-list {
  display: flex;
  flex-direction: row;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  scrollbar-width: none;
}
.profile-switcher-wrap .profile-list::-webkit-scrollbar {
  display: none;
}
.profile-switcher-wrap .profile-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  flex: 0 0 auto;
  min-width: 80px;
  max-width: 130px;
  background: rgba(255,255,255,0.08);
}
.profile-switcher-wrap .profile-item-second-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 2px;
}
.profile-switcher-wrap .profile-item:hover {
  background: rgba(255,255,255,0.12);
}
.profile-switcher-wrap .profile-item.active {
  background: rgba(255,255,255,0.18);
}
.profile-switcher-wrap .profile-item-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.profile-switcher-wrap .profile-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-switcher-wrap .profile-item-meta {
  font-size: 9px;
  color: rgba(255,255,255,0.45);
}
.profile-switcher-wrap .profile-item-actions {
  display: flex;
  gap: 2px;
  margin-left: 6px;
}
.profile-switcher-wrap .profile-action-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
}
.profile-switcher-wrap .profile-action-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
}
.profile-switcher-wrap .profile-add-btn {
  background: none;
  border: 1px dashed rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  transition: all 0.15s;
  align-self: center;
}
.profile-switcher-wrap .profile-add-btn:hover {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.profile-switcher-wrap .profile-empty {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  padding: 6px 8px;
  flex: 0 0 auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

/* ===== RESULT SECTION ===== */
.result-header { margin-bottom: 20px; }

.result-sub {
  font-size: 13px;
  color: var(--parchment-muted);
}

/* ===== UPGRADE OFFER ===== */
.upgrade-offer { text-align: center; }

.upgrade-offer h3 {
  font-family: var(--font-cn);
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--parchment-text);
}

.upgrade-offer p {
  color: var(--parchment-muted);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.upgrade-categories {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ===== CATEGORY BUTTONS ===== */
.cat-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(165, 124, 0, 0.25);
  border-radius: 20px;
  color: var(--parchment-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.cat-btn:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: rgba(212, 160, 23, 0.08);
  box-shadow: 0 0 8px var(--incense-glow);
}

/* ===== UPGRADE QUESTION BOX ===== */
.upgrade-question-box {
  display: flex;
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
}

.upgrade-question-box textarea { min-height: 60px; }
.upgrade-question-box textarea,
.upgrade-question-box input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(165, 124, 0, 0.2);
  border-radius: 8px;
  color: var(--parchment-text);
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
  resize: none;
  min-height: 99px;
  line-height: 1.5;
  font-family: inherit;
}

.upgrade-question-box textarea:focus,
.upgrade-question-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15); }
.upgrade-question-box textarea:disabled,
.upgrade-question-box input:disabled { opacity: 0.4; }
.upgrade-question-box .btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== CHAT INTERFACE ===== */
.chat-card { padding: 20px; }

.chat-header { margin-bottom: 16px; }

.chat-header h3 {
  font-family: var(--font-cn);
  font-size: 16px;
  color: var(--parchment-text);
}

.chat-sub {
  font-size: 13px;
  color: var(--parchment-muted);
}

.chat-sub strong { color: var(--gold-dark); }

.chat-messages {
  max-height: 400px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  background: rgba(255, 248, 220, 0.4);
  border: 1px solid rgba(165, 124, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg { display: flex; margin-bottom: 4px; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }

.msg-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.chat-msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--crimson-mid), var(--crimson-bright));
  color: var(--parchment);
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(212, 160, 23, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-msg.assistant .msg-bubble {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--parchment-text);
  border-bottom-left-radius: 4px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chat-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.chat-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(165, 124, 0, 0.2);
  border-radius: 8px;
  color: var(--parchment-text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s;
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
  box-sizing: border-box;
}

.chat-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15), 0 0 10px var(--incense-glow);
  background: rgba(255, 255, 255, 0.8);
}

.chat-input:disabled { opacity: 0.4; cursor: not-allowed; }

/* Seal stamp send button — small size */
.btn-send {
  width: 100%;
  padding: 12px 8px;
  min-width: 46px;
  background: linear-gradient(135deg, var(--crimson-mid), var(--crimson-bright));
  border: 2px solid var(--gold-dark);
  border-radius: 8px;
  color: var(--parchment);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-cn);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-send:hover:not(:disabled) {
  border-color: var(--gold);
  box-shadow: 0 0 16px var(--incense-glow), 0 3px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-small { padding: 8px 16px; font-size: 13px; }

.chat-upsell {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 248, 220, 0.3);
  border: 1px solid rgba(212, 160, 23, 0.2);
  border-radius: 8px;
  text-align: center;
}

.chat-upsell p { font-size: 14px; color: var(--parchment-muted); }
.chat-upsell .btn-secondary { margin-top: 8px; }

/* ===== SPINNER ===== */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(165, 124, 0, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== DAILY FORTUNE ===== */

/* Dark midnight section for daily fortune */
/* Yearly Fortune: center-align content */
.page-section#yearly-section .hero {
  text-align: center;
  padding-left: 0;
}
.page-section#yearly-section .hero h1 {
  text-align: center;
}
.page-section#yearly-section .hero-sub {
  text-align: center;
}

.page-section#daily-section .card {
  background: linear-gradient(135deg, var(--midnight) 0%, var(--midnight-light) 50%, var(--midnight) 100%);
  border-color: rgba(165, 124, 0, 0.2);
  color: #E8E0D0;
}

.page-section#daily-section .card h2 {
  color: var(--gold-light);
}

.page-section#daily-section .card-sub {
  color: rgba(232, 224, 208, 0.6);
}

.page-section#daily-section .hero h1 {
  color: #E8E0D0;
}

.page-section#daily-section .hero-sub {
  color: rgba(232, 224, 208, 0.6);
}

.page-section#daily-section .pillar {
  background: linear-gradient(180deg, rgba(10, 14, 39, 0.8) 0%, rgba(26, 32, 64, 0.9) 100%);
  border-color: rgba(165, 124, 0, 0.3);
}

.page-section#daily-section .pillar.highlight {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.1), 0 0 40px rgba(255, 215, 0, 0.05);
}

.page-section#daily-section .pillar-gan,
.page-section#daily-section .pillar-zhi {
  color: var(--parchment);
}

.page-section#daily-section .pillar-label {
  color: rgba(255, 228, 77, 0.7);
}

/* Daily badge styling */
.daily-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.daily-badge.favorable { background: rgba(46, 139, 87, 0.25); color: #7CCD7C; border: 1px solid rgba(46, 139, 87, 0.3); }
.daily-badge.neutral { background: rgba(212, 160, 23, 0.15); color: var(--gold-light); border: 1px solid rgba(212, 160, 23, 0.2); }
.daily-badge.challenging { background: rgba(178, 34, 34, 0.25); color: #FF6B6B; border: 1px solid rgba(178, 34, 34, 0.3); }
.daily-badge.caution { background: rgba(255, 152, 0, 0.2); color: #FFB74D; border: 1px solid rgba(255, 152, 0, 0.25); }

#daily-overall.favorable { color: #7CCD7C; }
#daily-overall.neutral { color: var(--gold-light); }
#daily-overall.challenging { color: #FF6B6B; }

/* Insight cards in daily section */
.page-section#daily-section .insight-card {
  background: rgba(10, 14, 39, 0.6);
  border-color: rgba(165, 124, 0, 0.15);
}

.page-section#daily-section .insight-value {
  color: #E8E0D0;
}

.page-section#daily-section .insight-value.accent {
  color: var(--gold-light);
}

.page-section#daily-section .insight-meta {
  color: rgba(232, 224, 208, 0.6);
}

.page-section#daily-section .insight-label {
  color: rgba(232, 224, 208, 0.5);
}

/* Day Interaction Card */
.page-section#daily-section #day-interaction-card div[style*="background"],
.page-section#daily-section div[style*="--surface2"] {
  background: rgba(10, 14, 39, 0.5) !important;
}


/* Horizontal scroll for daily interaction tables on mobile */
.daily-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.daily-table-scroll::-webkit-scrollbar {
  height: 4px;
}
.daily-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(212, 160, 23, 0.3);
  border-radius: 2px;
}
@media (max-width: 640px) {
  .daily-table-scroll {
    margin: 0 -16px;
    padding: 0 16px;
  }
}

/* Scroll hint arrow for interaction cards — on card level to avoid overflow-x clipping on Safari */
#day-interaction-card,
#month-interaction-card {
  position: relative;
}
#day-interaction-card::after,
#month-interaction-card::after {
    content: "→"; /* rightwards arrow */
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: rgba(212, 160, 23, 0.55);
  pointer-events: none;
  animation: ds-scroll-hint 2s ease-in-out infinite;
  z-index: 1;
  line-height: 1;
}
@keyframes ds-scroll-hint {
  0%, 100% { opacity: 0.25; right: 20px; }
  50% { opacity: 0.65; right: 16px; }
}
@media (max-width: 640px) {
  #day-interaction-card::after,
  #month-interaction-card::after {
    right: 28px;
  }
  @keyframes ds-scroll-hint {
    0%, 100% { opacity: 0.25; right: 28px; }
    50% { opacity: 0.65; right: 24px; }
  }
}


/* Redeem section balance */
.redeem-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.redeem-row input {
  flex: 1;
  min-width: 0;
}
.redeem-row .btn-redeem {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--crimson-mid) 0%, var(--crimson-bright) 50%, var(--crimson-mid) 100%);
  border: 1.5px solid var(--gold-dark);
  border-radius: 8px;
  color: var(--parchment);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  letter-spacing: 1.5px;
}
.redeem-row .btn-redeem:hover {
  background: linear-gradient(135deg, var(--crimson-bright) 0%, var(--crimson-light) 50%, var(--crimson-bright) 100%);
  border-color: var(--gold);
}

/* Pillar label override in daily section */
.pillar-en {
  font-size: 11px;
  color: rgba(255, 228, 77, 0.5);
  margin-top: 4px;
}

/* Daily date */
#daily-date strong {
  color: var(--gold);
}

/* Daily section inline styles that need overriding - apply selectively */
.page-section#daily-section p[style*="color:#888"],
.page-section#daily-section p[style*="color: #888"] {
  color: rgba(232, 224, 208, 0.5) !important;
}

/* Daily section card with left accent border */
.page-section#daily-section .card[style*="border-left"] {
  border-left-color: var(--gold) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .chat-input { min-height: 120px; }
  .chat-input-area { align-items: stretch; }
  .btn-send { padding: 8px 6px; min-width: 38px; font-size: 11px; }
  .chat-messages { max-height: 50vh; }
  .hero h1 { font-size: 28px; }

  .chart-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .form-row.thirds,
  .form-row.halves {
    grid-template-columns: 1fr 1fr;
  }

  .card { padding: 20px; }

  .nav-right { gap: 8px; }

  /* Desktop: restore original layout */
  .feature-nav-buttons {
    padding: 116px 16px 80px;
    background: linear-gradient(180deg, rgba(92,0,0,0.90) 0%, rgba(92,0,0,0.85) 30%, rgba(92,0,0,0.50) 55%, rgba(92,0,0,0.15) 80%, rgba(92,0,0,0.0) 100%);
  }
  .feature-nav-btn {
    font-size: 11px;
    padding: 5px 6px;
    border-radius: 6px;
  }
  .feature-nav-btn .emoji {
    font-size: inherit;
  }
  .feature-nav-btn .feat-cost {
    font-size: inherit;
  }
  .page-section#calculator-section {
    padding-top: 100px;
  }
  .nav-inner {
    padding: 18px 24px;
    gap: 16px;
  }
  .nav-left { max-width: none; overflow: visible; }
  .nav-right { max-width: none; }
  .lang-opt {
    font-size: inherit;
    padding: 4px 10px;
  }
  .logo-overlay {
    width: 140px;
    height: 65px;
  }
  .logo-overlay img {
    width: 140px;
    margin-top: 4px;
  }
  /* Restore desktop nav layout */
  .nav-left { max-width: none; overflow: visible; }
  .nav-right { max-width: none; }
  .nav-inner { overflow: visible; }
  .lang-opt {
    font-size: inherit;
    padding: 4px 10px;
  }
}


/* ===== NAV DROPDOWNS ===== */
.nav-dropdown-wrap {
  position: relative;
}
.nav-dropdown-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(212,160,23,0.25);
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: var(--font);
}
.nav-dropdown-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--gold);
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #3A0000;
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 8px;
  padding: 6px;
  min-width: 160px;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.nav-dropdown.show {
  display: block;
}
.nav-lang-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--parchment-muted);
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.15s;
}
.nav-lang-opt:hover {
  background: rgba(212,160,23,0.15);
  color: var(--gold);
}
@media (max-width: 640px) {
  .nav-dropdown-btn {
    font-size: 11px;
    padding: 4px 10px;
  }
  .nav-dropdown {
    left: 0;
    transform: none;
    max-width: 170px;
    min-width: 0;
  }
  #profile-dropdown {
    left: 50%;
    transform: translateX(-50%);
    min-width: 0;
    width: auto;
    max-width: 110px;
    overflow: hidden;
  }
  #lang-dropdown {
    left: auto;
    right: 0;
  }
  .profile-switcher-wrap {
    flex-direction: column;
    align-items: stretch;
    width: auto;
    max-width: 100%;
  }
  .profile-switcher-wrap .profile-add-btn,
  .profile-switcher-wrap .profile-empty {
    white-space: normal;
    font-size: 11px;
  }
  .profile-switcher-wrap .profile-list {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 200px;
  }
  .profile-switcher-wrap .profile-item {
    width: 100%;
    padding: 6px 4px;
  }
  .profile-switcher-wrap .profile-item-name {
    font-size: 10px;
  }
  .profile-switcher-wrap .profile-item-meta {
    font-size: 8px;
  }
}


/* ===== FEATURE NAV BUTTONS ===== */
.feature-nav-buttons {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 112px 8px 30px;
  width: 100%;
  background: linear-gradient(180deg, transparent 60px, rgba(92,0,0,0.85) 72px, rgba(92,0,0,0.50) 100px, rgba(92,0,0,0.15) 140px, transparent 180px);
  box-sizing: border-box;
  pointer-events: none;
}
.feature-nav-buttons > * {
  pointer-events: auto;
}

.feature-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  background: var(--crimson);
  
  border-radius: 6px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.feature-nav-btn:hover {
  background: var(--crimson-mid);
  border-color: var(--gold);
}
.feature-nav-btn svg {
  display: block;
  flex-shrink: 0;
}

/* ===== KAU CHIM (求籤) ===== */
.kauchim-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 32px 24px;
  min-height: 320px;
}

.kauchim-instruction {
  text-align: center;
  font-size: 16px;
  color: var(--gold);
  padding: 12px 24px;
  background: rgba(212, 160, 23, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(212, 160, 23, 0.2);
  line-height: 1.5;
}

.bamboo-cup-wrapper {
  position: relative;
  width: 160px;
  height: 220px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease;
}

.bamboo-cup-wrapper:active {
  transform: translateY(8px) rotate(5deg);
}

.bamboo-cup-wrapper.shaking {
  animation: cup-shake 0.5s ease-in-out infinite;
}

@keyframes cup-shake {
  0% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-3px) rotate(-1.5deg); }
  40% { transform: translateX(3px) rotate(1.5deg); }
  60% { transform: translateX(-2px) rotate(-1deg); }
  80% { transform: translateX(2px) rotate(1deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

.bamboo-cup-wrapper.shaking .bamboo-stick {
  animation: stick-shake 0.12s ease-in-out infinite alternate;
}

.bamboo-sticks {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 4px;
  z-index: 2;
}

.bamboo-stick {
  width: 6px;
  height: 100px;
  background: linear-gradient(180deg, #D4A017 0%, #8B6914 50%, #D4A017 100%);
  border-radius: 3px;
  opacity: 0.5;
  transform-origin: bottom center;
}

.bamboo-stick:nth-child(1) { transform: rotate(-20deg) translateY(-8px); }
.bamboo-stick:nth-child(2) { transform: rotate(-12deg) translateY(-5px); }
.bamboo-stick:nth-child(3) { transform: rotate(-4deg) translateY(-2px); }
.bamboo-stick:nth-child(4) { transform: rotate(4deg) translateY(-2px); }
.bamboo-stick:nth-child(5) { transform: rotate(12deg) translateY(-5px); }
.bamboo-stick:nth-child(6) { transform: rotate(20deg) translateY(-8px); }
.bamboo-stick:nth-child(7) { transform: rotate(-16deg) translateY(-6px); }
.bamboo-stick:nth-child(8) { transform: rotate(0deg) translateY(0px); }
.bamboo-stick:nth-child(9) { transform: rotate(16deg) translateY(-6px); }
.bamboo-stick:nth-child(10) { transform: rotate(-8deg) translateY(-3px); }

.bamboo-cup {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, #2a1810 0%, #4a2a1a 30%, #6a3a2a 60%, #4a2a1a 100%);
  border-radius: 10px 10px 30px 30px;
  border: 2px solid rgba(212, 160, 23, 0.3);
  z-index: 1;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 -4px 10px rgba(0,0,0,0.2);
}

.bamboo-cup::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  bottom: 8px;
  border: 1px solid rgba(212, 160, 23, 0.15);
  border-radius: 6px 6px 24px 24px;
}

/* Revealing animation — sticks fly out (selected stays) */
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected) {
  animation: stick-fly 0.6s ease-out forwards;
}

.bamboo-cup-wrapper.revealing .bamboo-stick.selected {
  animation: none;
  opacity: 1;
  transform: rotate(0deg) translateY(-10px) !important;
  height: 120px;
  z-index: 10;
  filter: brightness(1.3);
  box-shadow: 0 0 15px rgba(212, 160, 23, 0.6);
}

.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(1) { animation-delay: 0.05s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(2) { animation-delay: 0.10s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(3) { animation-delay: 0.15s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(4) { animation-delay: 0.08s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(5) { animation-delay: 0.18s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(6) { animation-delay: 0.12s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(7) { animation-delay: 0.06s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(8) { animation-delay: 0.14s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(9) { animation-delay: 0.09s; }
.bamboo-cup-wrapper.revealing .bamboo-stick:not(.selected):nth-child(10) { animation-delay: 0.16s; }

@keyframes stick-shake {
  0% { transform: rotate(-2deg) translateY(-1px); }
  100% { transform: rotate(2deg) translateY(1px); }
}

@keyframes stick-fly {
  0% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--fly-angle, 30deg)) translateY(-120px); }
}

.bamboo-stick:nth-child(1) { --fly-angle: -40deg; }
.bamboo-stick:nth-child(2) { --fly-angle: 35deg; }
.bamboo-stick:nth-child(3) { --fly-angle: -25deg; }
.bamboo-stick:nth-child(4) { --fly-angle: 20deg; }
.bamboo-stick:nth-child(5) { --fly-angle: -15deg; }
.bamboo-stick:nth-child(6) { --fly-angle: 45deg; }
.bamboo-stick:nth-child(7) { --fly-angle: -30deg; }
.bamboo-stick:nth-child(8) { --fly-angle: 10deg; }
.bamboo-stick:nth-child(9) { --fly-angle: -45deg; }
.bamboo-stick:nth-child(10) { --fly-angle: 25deg; }


/* Selected / flying stick states */
.bamboo-stick.selected {
  opacity: 1;
  animation: none;
  transform: rotate(0deg) translateY(-10px) !important;
  height: 120px;
  z-index: 10;
  filter: brightness(1.3);
  box-shadow: 0 0 15px rgba(212, 160, 23, 0.6);
}

.bamboo-stick.flying {
  animation: stick-fly 0.6s ease-out forwards;
}

/* Stick number badge (Chinese characters) */
.stick-number-badge {
  position: absolute;
  top: -35px;
  left: 50%;
  background: #D4A017;
  color: #1a0a0a;
  font-size: 22px;
  font-weight: bold;
  font-family: 'Noto Serif SC', serif;
  padding: 4px 14px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  opacity: 0;
  animation: badge-fade-in 0.5s 0.6s ease-out forwards;
}

@keyframes badge-fade-in {
  from { opacity: 0; transform: translateX(-50%) scale(0.5); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ===== Oracle Paper ===== */
.oracle-paper {
  display: none;
  background: linear-gradient(135deg, #f5f0e1 0%, #f0e8d0 50%, #ede4c8 100%);
  border-radius: 12px;
  padding: 32px 28px;
  margin: 24px auto;
  max-width: 560px;
  border: 1px solid rgba(212, 160, 23, 0.3);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.5);
  text-align: center;
  color: #2a1a0a;
}

.oracle-paper.show {
  display: block;
  animation: paper-rise 0.5s ease-out;
}

@keyframes paper-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.oracle-stick-number {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  color: #8B6914;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.oracle-grade {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: #B8860B;
  margin-bottom: 16px;
  padding: 4px 16px;
  display: inline-block;
  border: 1px solid #D4A017;
  border-radius: 20px;
}

.oracle-poem {
  font-style: italic;
  font-size: 15px;
  line-height: 1.8;
  color: #3a2a1a;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(139, 105, 20, 0.06);
  border-radius: 8px;
  white-space: pre-line;
}

.oracle-interpretation {
  font-size: 14px;
  line-height: 1.6;
  color: #4a3a2a;
  margin-bottom: 12px;
  text-align: left;
}

.oracle-advice {
  font-size: 13px;
  line-height: 1.5;
  color: #6a5a3a;
  padding: 8px 12px;
  background: rgba(212, 160, 23, 0.1);
  border-radius: 6px;
  text-align: left;
}

.jiaobei-area {
  display: none;
  text-align: center;
  padding: 20px;
  margin-top: 12px;
}

.jiaobei-area.show {
  display: block;
  animation: fade-in 0.4s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.jiaobei-hint {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 12px;
  opacity: 0.8;
}

.jiaobei-button {
  background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
  color: #f5f0e1;
  border: 1px solid #D4A017;
  padding: 12px 32px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

.jiaobei-button:hover {
  background: linear-gradient(135deg, #A0522D 0%, #CD853F 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 160, 23, 0.3);
}

.jiaobei-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@keyframes jiaobei-toss {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-15deg) scale(0.9); }
  50% { transform: rotate(25deg) scale(1.1); }
  75% { transform: rotate(-10deg) scale(0.95); }
  100% { transform: rotate(0deg) scale(1); }
}

.jiaobei-result {
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  animation: fade-in 0.3s ease-out;
}

.jiaobei-result.confirmed {
  background: rgba(76, 175, 80, 0.12);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.jiaobei-result.retry {
  background: rgba(255, 152, 0, 0.12);
  color: #ff9800;
  border: 1px solid #ff9800;
}

.jiaobei-result.laughing {
  background: rgba(212, 160, 23, 0.12);
  color: #D4A017;
  border: 1px solid #D4A017;
}

/* Feature nav cost badges */
.feat-cost {
  display: inline-block;
  font-size: 9px;
  padding: 0px 4px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 600;
  background: rgba(165, 124, 0, 0.15);
  color: var(--gold);
  border: 1px solid rgba(165, 124, 0, 0.25);
}
.feat-paid {
  background: rgba(165, 124, 0, 0.25);
  color: #ffd700;
}

/* Typing indicator (three bouncing dots) */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b8860b;
  animation: typing-bounce 1.4s ease-in-out infinite both;
}
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== MOBILE FEATURES DROPDOWN ===== */
.mobile-features-dropdown {
  display: none;
  position: fixed;
  top: 108px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 102;
}
.mobile-features-btn {
  font-size: 13px;
  padding: 6px 16px;
  background: var(--crimson);
  border: 1px solid var(--gold-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.mobile-features-btn:hover {
  background: var(--crimson-mid);
}
#features-dropdown {
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-height: 60vh;
  overflow-y: auto;
}
#features-dropdown .nav-lang-opt {
  font-size: 14px;
  padding: 10px 14px;
}

@media (max-width: 640px) {
  .mobile-features-dropdown {
    display: block;
  }
  .feature-nav-buttons {
    display: none;
  }
}


/* ===== HELP BUTTON & MODAL ===== */
.help-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(212,160,23,0.15);
  border: 1px solid rgba(212,160,23,0.3);
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.15s;
  line-height: 1;
}
.help-btn:hover {
  background: rgba(212,160,23,0.3);
  border-color: var(--gold);
  color: #fff;
}
.help-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.help-modal-overlay.show {
  display: flex;
}
.help-modal-content {
  background: #2A0000;
  border: 1px solid var(--gold-dark);
  border-radius: 12px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  position: relative;
  animation: helpFadeIn 0.2s ease;
}
@keyframes helpFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.help-modal-content h3 {
  color: var(--gold);
  font-size: 18px;
  margin: 0 0 12px 0;
  padding-right: 24px;
}
.help-modal-content p {
  color: #ccc;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 20px 0;
}
.help-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.help-modal-close:hover { color: #fff; }
.help-modal-ok {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--crimson);
  border: 1px solid var(--gold-dark);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
}
.help-modal-ok:hover {
  background: var(--crimson-mid);
}
@media (max-width: 640px) {
  .help-btn {
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .help-modal-content {
    padding: 20px;
  }
}

/* Feng Shui input row — stack vertically on mobile */
.fengshui-input-row {
  display: flex;
  gap: 10px;
}
@media (max-width: 480px) {
  .fengshui-input-row {
    flex-direction: column;
  }
  .fengshui-input-row input,
  .fengshui-input-row button {
    width: 100%;
  }
  .fengshui-input-row button {
    text-align: center;
    justify-content: center;
  }
}

/* ===== SHARE CARD (exported as PNG via html2canvas) ===== */
.share-card-hidden {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 420px;
  z-index: -1;
}

.share-card-inner {
  width: 420px;
  padding: 24px 20px 16px;
  background: #0a0a0b;
  color: #e8dcc8;
  font-family: 'Noto Serif SC', 'Georgia', serif;
  box-sizing: border-box;
  line-height: 1.5;
}

.share-border-top,
.share-border-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.share-border-bottom {
  margin-top: 12px;
  margin-bottom: 0;
}

.share-ornament {
  color: #D4A017;
  font-size: 10px;
}

.share-ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #D4A017, transparent);
}

.share-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.share-logo-icon {
  font-size: 18px;
  color: #D4A017;
  opacity: 0.7;
}

.share-title-group {
  flex: 1;
}

.share-site-name {
  font-size: 15px;
  font-weight: 700;
  color: #D4A017;
  letter-spacing: 1px;
}

.share-tagline {
  font-size: 10px;
  color: #999;
  margin-top: 1px;
}

.share-user-name {
  font-size: 14px;
  color: #f0e8d8;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2a2a;
}

.share-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.share-pillar {
  text-align: center;
  padding: 8px 4px;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  background: #111;
}

.share-pillar-highlight {
  border-color: #D4A017;
  background: #1a1400;
}

.share-pillar-label {
  font-size: 9px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.share-pillar-gan {
  font-size: 20px;
  font-weight: 700;
  color: #f0e8d8;
  line-height: 1.2;
}

.share-pillar-zhi {
  font-size: 16px;
  color: #D4A017;
  line-height: 1.3;
}

.share-insights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px;
  background: #111;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
}

.share-insight {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
}

.share-insight-label {
  font-size: 10px;
  color: #999;
  min-width: 48px;
}

.share-insight-value {
  font-size: 12px;
  font-weight: 600;
  color: #f0e8d8;
}

.share-insight-meta {
  font-size: 10px;
  color: #D4A017;
  margin-left: 2px;
}

.share-accent {
  color: #4fc3f7 !important;
}

.share-danger {
  color: #ef5350 !important;
}

.share-reading {
  margin-bottom: 8px;
  padding: 10px;
  background: #111;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
}

.share-reading-label {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.share-reading-text {
  font-size: 12px;
  color: #d8d0c0;
  line-height: 1.7;
  word-break: break-word;
}

.share-watermark {
  text-align: center;
  font-size: 9px;
  color: #555;
  letter-spacing: 0.5px;
}

/* ── Modal Overlay (shared) ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

/* ── Credit Gate Modal ── */
.credit-gate-content {
  max-width: 380px;
  width: 100%;
  padding: 32px 28px 24px;
  position: relative;
  background: #1f0a0a;
  border: 1px solid rgba(180, 130, 40, 0.25);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  animation: modal-enter 0.25s ease-out;
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.credit-gate-content .credit-gate-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.credit-gate-content .credit-gate-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.credit-gate-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(180, 130, 40, 0.15);
}

.credit-gate-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--gold-bright);
  font-family: var(--font-display);
  text-align: center;
}

.credit-gate-icon {
  font-size: 22px;
  line-height: 1;
}

.credit-gate-subtitle {
  color: #bbb;
  font-size: 14px;
  margin: 0 0 18px 0;
  text-align: center;
}

.credit-gate-subtitle strong {
  color: #fff;
}

.credit-gate-choose {
  color: #999;
  font-size: 13px;
  text-align: center;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.credit-gate-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(165, 124, 0, 0.06);
  border: 1px solid rgba(180, 130, 40, 0.2);
  border-radius: 20px;
  padding: 10px 20px;
  margin-bottom: 20px;
}

.balance-icon {
  font-size: 16px;
  line-height: 1;
}

.balance-label {
  color: #999;
  font-size: 13px;
}

.balance-value {
  color: var(--gold-bright);
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-display);
  margin-left: 4px;
}

/* Purchase pack cards - side by side */
.credit-gate-packs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.pack-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  background: rgba(40, 15, 15, 0.6);
  border: 1px solid rgba(80, 60, 30, 0.3);
  border-radius: 14px;
  padding: 20px 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.pack-card:hover {
  border-color: var(--gold);
  background: rgba(60, 30, 15, 0.6);
  transform: translateY(-2px);
}

.pack-card:active {
  transform: translateY(0);
}

.pack-featured {
  border-color: rgba(180, 130, 40, 0.35);
  background: linear-gradient(180deg, rgba(180, 130, 40, 0.08), rgba(40, 15, 15, 0.6));
}

.pack-featured:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(180, 130, 40, 0.15), rgba(60, 30, 15, 0.6));
}

.redeem-link {
  text-align: center;
  margin-top: 20px;
  padding: 8px 0;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
}
.redeem-link a {
  color: var(--accent);
  text-decoration: underline;
}
.redeem-link:hover {
  color: #ccc;
}

.pack-badge {
  position: absolute;
  top: -9px;
  right: 50%;
  transform: translateX(50%);
  background: var(--gold);
  color: #1a1a1e;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.pack-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
}

.pack-price {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.pack-credits {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}

.pack-desc {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

/* Discount code step */
.discount-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.discount-input {
  flex: 1;
  padding: 12px 14px;
  background: rgba(30, 10, 10, 0.8);
  border: 1px solid rgba(80, 60, 30, 0.4);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s;
}

.discount-input:focus {
  border-color: var(--gold);
}

.discount-status {
  font-size: 13px;
  margin: 8px 0 14px;
  min-height: 18px;
  text-align: center;
}

.discount-or {
  text-align: center;
  color: #555;
  font-size: 13px;
  margin: 10px 0;
}

#credit-gate-step-2 .btn-primary,
#credit-gate-step-2 .btn-secondary {
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}

/* Processing */
.processing-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(180, 130, 40, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Nav credit badge - always visible */
.credit-badge {
  display: flex !important;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(165, 124, 0, 0.12);
  border: 1px solid rgba(165, 124, 0, 0.25);
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.credit-badge:hover {
  background: rgba(165, 124, 0, 0.25);
  border-color: var(--gold);
}

.credit-badge.credit-zero {
  opacity: 0.45;
}

.credit-icon {
  font-size: 13px;
  line-height: 1;
}

/* Mobile responsive */
@media (max-width: 500px) {
  .credit-gate-content {
    padding: 28px 18px 20px;
    max-width: 95vw;
  }
  
  .credit-gate-packs {
    gap: 10px;
  }
  
  .pack-card {
    padding: 16px 10px 14px;
  }
  
  .pack-price {
    font-size: 19px;
  }
  
  .credit-badge {
    font-size: 11px;
    padding: 3px 8px;
  }
}


/* ===== Account Page ===== */
.account-card {
  max-width: 500px;
  margin: 0 auto 16px;
}

.account-balance-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  background: #2d0a0a;
  border: 1px solid #a67c00;
  border-radius: 10px;
  margin-bottom: 12px;
}

.account-balance-icon {
  font-size: 28px;
  line-height: 1;
}

.account-balance-value {
  font-size: 36px;
  font-weight: 700;
  color: #fff8dc;
  line-height: 1;
}

.account-balance-label {
  font-size: 15px;
  color: #998a6b;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.account-conversion-note {
  text-align: center;
  font-size: 13px;
  color: #665544;
  margin: -8px 0 16px;
}

.account-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.account-actions .btn-primary,
.account-actions .btn-secondary {
  width: auto;
  min-width: 140px;
}

.account-email-row {
  display: flex;
  gap: 8px;
}

.account-email-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #a67c00;
  border-radius: 8px;
  background: #1a0a0a;
  color: #fff8dc;
  font-size: 14px;
  outline: none;
}

.account-email-input:focus {
  border-color: #d4a017;
  box-shadow: 0 0 8px rgba(212,160,23,0.2);
}

.account-email-btn {
  width: auto;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .account-email-row {
    flex-direction: column;
  }
  .account-email-btn {
    width: 100%;
  }
  .account-actions {
    flex-direction: column;
    align-items: center;
  }
  .account-actions .btn-primary,
  .account-actions .btn-secondary {
    width: 100%;
    max-width: 280px;
  }
}

/* ===== RESPONSIVE CENTERING for standalone sections ===== */
/* Sections outside <main> get flex centering with max-width content */
.page-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page-section > * {
  width: 100%;
  max-width: 720px;
}

/* Inside <main>, sections keep their natural layout 
   since .main already provides the centered wrapper */
main .page-section,
main .page-section > * {
  display: block;
  max-width: none;
  width: auto;
}

/* Mobile: tighter padding */
@media (max-width: 640px) {
  .page-section {
    padding-left: 16px;
    padding-right: 16px;
  }
}
