/* ===================================================
   DISCOVER YOURSELF — Full Design System
   =================================================== */

/* ---------- FONTS & RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'Epic Pro Bold';
  src: url('assets/Epic Pro/GCEpicPro-Bold.woff2') format('woff2'),
       url('assets/Epic Pro/GCEpicPro-Bold.woff') format('woff'),
       url('assets/Epic Pro/GCEpicPro-Bold.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Epic Pro Medium';
  src: url('assets/Epic Pro/GCEpicPro-Medium.woff2') format('woff2'),
       url('assets/Epic Pro/GCEpicPro-Medium.woff') format('woff'),
       url('assets/Epic Pro/GCEpicPro-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg:           #000000;
  --bg-card:      #0a0a1e;
  --bg-glass:     rgba(10, 10, 30, 0.7);
  --blue:         #00b4d8;
  --blue-bright:  #48cae4;
  --blue-glow:    transparent;
  --blue-subtle:  rgba(0, 180, 216, 0.12);
  --gold:         #c9a84c;
  --gold-bright:  #e8c96a;
  --text:         #ffffff;
  --text-question:#f7eede;
  --text-break:   #f7eede;
  --text-dim:     #8888aa;
  --text-muted:   #55556a;
  --border-dim:   rgba(255,255,255,0.1);
  --border-card:  rgba(255,255,255,0.08);
  --gray-btn-bg:  rgba(255,255,255,0.05);
  --gray-btn-bd:  rgba(255,255,255,0.18);
  --selected-bg:  rgba(0,180,216,0.15);
  --selected-bd:  #00b4d8;
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    24px;
  --radius-pill:  999px;
  --shadow-glow:  none;
  --shadow-card:  0 8px 40px rgba(0,0,0,0.6);
  --transition:   0.35s cubic-bezier(0.4,0,0.2,1);

  /* EN font (Google Sans) */
  --font-english:  "Google Sans Flex", "Google Sans", sans-serif;

  /* TH font — Sukhumvit Set (Apple system) → Kanit (Google, modern fallback) → Sarabun (fallback) */
  --font-thai:    "Sukhumvit Set", "SukhumvitSet", "Kanit", "Sarabun", sans-serif;

  /* Heading & title font (Barlow Condensed) */
  --font-heading:  "Barlow Condensed", sans-serif;
}

/* ── Thai language override ──────────────────────────────────
   When body has .lang-th, replace --font-english with --font-thai
   globally. Every element using var(--font-english) automatically
   switches — no need to touch individual selectors.
─────────────────────────────────────────────────────────── */
body.lang-th {
  --font-english: "Sukhumvit Set", "SukhumvitSet", "Kanit", "Sarabun", sans-serif;
  --font-heading: "Sukhumvit Set", "SukhumvitSet", "Kanit", "Sarabun", sans-serif;
}

/* Heading elements override explicitly for TH */
body.lang-th .q-text,
body.lang-th .section-title,
body.lang-th .break-text {
  font-family: "Sukhumvit Set", "SukhumvitSet", "Kanit", "Sarabun", sans-serif;
}

/* ── Thai Vowel Clipping & Line-Height Fixes ───────────────
   Thai vowels/tone marks stack above/below and can be clipped
   by overflow:hidden or tight line-heights. We expand these here.
─────────────────────────────────────────────────────────── */
body.lang-th .q-text {
  line-height: 1.45 !important;
  letter-spacing: normal !important;
}
body.lang-th .radio-btn {
  line-height: 1.4;
  letter-spacing: normal !important;
  overflow: visible !important;
}
body.lang-th .answer-btn {
  overflow: visible !important;
}
body.lang-th .answer-btn .text-label {
  line-height: 1.4;
}
body.lang-th .custom-select,
body.lang-th .multi-option {
  line-height: 1.4;
}
body.lang-th .break-text {
  line-height: 1.6;
  letter-spacing: normal !important;
}
body.lang-th .hero-desc,
body.lang-th .result-desc,
body.lang-th .result-card-name {
  line-height: 1.45;
  letter-spacing: normal !important;
}
body.lang-th .hero-desc {
  font-family: var(--font-thai), sans-serif;
}


html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-heading);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* ---------- STARFIELD ---------- */
#stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- PAGE SYSTEM ---------- */
.page {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 110px 20px 90px;
}
.page.active {
  opacity: 1;
  pointer-events: auto;
}
#page-1 {
  background: radial-gradient(circle at 10% 20%, rgba(123, 44, 191, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 90% 80%, rgba(0, 180, 216, 0.12) 0%, transparent 60%),
              radial-gradient(circle at 50% 50%, rgba(10, 10, 30, 0.5) 0%, transparent 100%);
}
.page-content {
  width: 100%;
  max-width: 780px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
  padding: 40px 0;
  box-sizing: border-box;
}

/* ---------- UTILITY ---------- */
.hidden { opacity: 0; pointer-events: none; transform: translateY(10px); }
.fade-in { animation: fadeInUp 0.5s ease forwards; }
.fade-out { animation: fadeOutDown 0.35s ease forwards; pointer-events: none; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOutDown {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}
@keyframes fadeInUp80 {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 0.8; transform: translateY(0); }
}
@keyframes fadeInOnly {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50%       { transform: translateY(-18px) rotate(2deg); }
}

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
  40%           { transform: scale(1.3); opacity: 1; }
}
@keyframes aurora-sweep {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes flip-card {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(180deg); }
}

/* ===================================================
   PAGE 1 — HERO
   =================================================== */
.hero-content { gap: 24px; padding: 40px 20px; }

.hero-subtitle {
  font-family: "Barlow Condensed", sans-serif !important;
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.3s forwards;
}

.hero-title {
  font-family: "Barlow Condensed", sans-serif !important;
  font-size: clamp(3.4rem, 12vw, 6.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #8ea0c8 0%, #e2edf9 50%, #8ea0c8 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease 0.5s forwards, aurora-sweep 8s linear infinite;
  opacity: 0;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(4.5rem, 14vw, 6rem);
  }
}

.hero-desc {
  font-family: "Google Sans", "Google Sans Flex", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-dim);
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.8s forwards;
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}
.btn-lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
  animation: fadeInUp80 0.8s ease 1.1s forwards;
  padding: 0;
}
.btn-lang-toggle:hover {
  background: transparent;
  opacity: 1 !important;
  transform: scale(1.08);
}
.btn-lang-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 48px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #0077b6, var(--blue), #48cae4);
  background-size: 200% 200%;
  color: #fff;
  font-family: var(--font-english);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
}
#hero-start-btn {
  opacity: 0;
  animation: fadeInUp 0.8s ease 1.1s forwards;
}
.btn-primary:not(.hidden):hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-arrow { font-size: 1.1em; }

/* Continue button (appears after answer) */
.btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #0077b6, var(--blue), #48cae4);
  background-size: 200% 200%;
  color: #fff;
  font-family: var(--font-english);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}
.btn-continue.show {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 1;
  pointer-events: auto;
}

/* Back Button (Personality Questions) */
.q-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  border: 1.5px solid #888888;
  border-radius: var(--radius-pill);
  background: transparent;
  color: #888888;
  font-family: var(--font-english);
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition);
}
.q-back-btn:hover {
  border-color: #aaaaaa;
  color: #aaaaaa;
  background: rgba(136,136,136,0.08);
  transform: translateX(-2px);
}

/* Capsule Button (Deck Select) */
.btn-capsule {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 32px;
  border: none;
  border-radius: var(--radius-pill);
  background: #e8e8f0;
  color: #111;
  font-family: var(--font-english);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
}
.btn-capsule:hover { transform: translateY(-2px); }
.btn-capsule.selected {
  background: #0a1a30;
  color: var(--blue-bright);
  border: 1.5px solid var(--blue);
}
.btn-capsule .aurora-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #00b4d8, #48cae4, #90e0ef, #00b4d8);
  background-size: 300% 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: aurora-sweep 3s ease infinite;
  border-radius: var(--radius-pill);
}
.btn-capsule.selected .aurora-fill { opacity: 0.3; }
.btn-capsule span { position: relative; z-index: 1; }

/* ===================================================
   PAGE 2 — DECK SELECTION (3D Redesign)
   =================================================== */
.decks-container {
  position: relative;
  display: flex;
  gap: 40px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 40px 20px;
  transition: var(--transition);
}

/* Dim other decks when one is selected */
.decks-container:has(.selected) .deck-item:not(.selected) {
  opacity: 0.25;
  filter: blur(2px) grayscale(0.5);
  pointer-events: none;
  transform: scale(0.95);
}

.deck-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  transition: var(--transition);
  perspective: 1000px;
}

.deck-stack {
  position: relative;
  width: 156px;
  height: 260px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-in-stack {
  position: absolute;
  width: 144px;
  height: 240px;
  border-radius: 10px;
  background-image: url('assets/Tarot/C_Back.png');
  background-size: cover;
  background-position: center;
  border: 1.5px solid rgba(201, 168, 76, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* All Decks 3D Alignment (Facing straight forward and tilted back) */
.deck-stack {
  transform: rotateX(32deg) rotateY(0deg) rotateZ(0deg);
}
.deck-item:hover:not(.selected) .deck-stack {
  transform: translate3d(0, -15px, 20px) rotateX(30deg) rotateY(0deg) rotateZ(0deg);
}

/* Selection animation: Selected deck rises, aligns straight and glows */
.deck-item.selected .deck-stack {
  transform: translate3d(0, -25px, 50px) rotateX(15deg) rotateY(0deg) rotateZ(0deg) !important;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.55));
}
.deck-item.selected .card-in-stack {
  border-color: var(--blue-bright);
}

/* Card Stacking layers: default state translation */
.card-in-stack.s1  { transform: translate3d(0, 0, 0); z-index: 12; }
.card-in-stack.s2  { transform: translate3d(0, 1.5px, -1px); z-index: 11; }
.card-in-stack.s3  { transform: translate3d(0, 3.0px, -2px); z-index: 10; }
.card-in-stack.s4  { transform: translate3d(0, 4.5px, -3px); z-index: 9; }
.card-in-stack.s5  { transform: translate3d(0, 6.0px, -4px); z-index: 8; }
.card-in-stack.s6  { transform: translate3d(0, 7.5px, -5px); z-index: 7; }
.card-in-stack.s7  { transform: translate3d(0, 9.0px, -6px); z-index: 6; }
.card-in-stack.s8  { transform: translate3d(0, 10.5px, -7px); z-index: 5; }
.card-in-stack.s9  { transform: translate3d(0, 12.0px, -8px); z-index: 4; }
.card-in-stack.s10 { transform: translate3d(0, 13.5px, -9px); z-index: 3; }
.card-in-stack.s11 { transform: translate3d(0, 15.0px, -10px); z-index: 2; }
.card-in-stack.s12 { transform: translate3d(0, 16.5px, -11px); z-index: 1; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.75); }

/* Hover spread effect */
.deck-item:hover .card-in-stack.s2  { transform: translate3d(0, 2.5px, -1.8px); }
.deck-item:hover .card-in-stack.s3  { transform: translate3d(0, 5.0px, -3.6px); }
.deck-item:hover .card-in-stack.s4  { transform: translate3d(0, 7.5px, -5.4px); }
.deck-item:hover .card-in-stack.s5  { transform: translate3d(0, 10.0px, -7.2px); }
.deck-item:hover .card-in-stack.s6  { transform: translate3d(0, 12.5px, -9.0px); }
.deck-item:hover .card-in-stack.s7  { transform: translate3d(0, 15.0px, -10.8px); }
.deck-item:hover .card-in-stack.s8  { transform: translate3d(0, 17.5px, -12.6px); }
.deck-item:hover .card-in-stack.s9  { transform: translate3d(0, 20.0px, -14.4px); }
.deck-item:hover .card-in-stack.s10 { transform: translate3d(0, 22.5px, -16.2px); }
.deck-item:hover .card-in-stack.s11 { transform: translate3d(0, 25.0px, -18.0px); }
.deck-item:hover .card-in-stack.s12 { transform: translate3d(0, 27.5px, -19.8px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85); }

/* ===================================================
   PAGE 3, 5, 7, 9, 11, 13 — BREAK PAGES
   =================================================== */
.break-content { gap: 20px; }

.break-text {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.15;
  color: var(--text-question);
  max-width: 620px;
  margin: 0 auto 32px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-family: var(--font-heading);
}

/* ===================================================
   PAGE 4 — DEMOGRAPHIC
   =================================================== */
.form-content { gap: 32px; }
.form-header { display: flex; flex-direction: column; gap: 8px; }
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.dropdowns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}
@media (max-width: 560px) { .dropdowns-grid { grid-template-columns: 1fr; } }

.dropdown-group { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.dropdown-label {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}

.custom-select-wrapper { position: relative; }
.custom-select {
  width: 100%;
  padding: 14px 44px 14px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-btn-bd);
  background: var(--gray-btn-bg);
  color: var(--text);
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: var(--transition);
}
.custom-select.filled,
.custom-select:focus, .custom-select:hover {
  border-color: var(--blue);
  background: var(--blue-subtle);
}
.custom-select option { 
  background: #0a0a2a; 
  color: var(--text); 
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
}
.select-arrow {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 1rem;
}

.custom-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-btn-bd);
  background: var(--gray-btn-bg);
  color: var(--text);
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}
.custom-input.filled,
.custom-input:focus, .custom-input:hover {
  border-color: var(--blue);
  background: var(--blue-subtle);
}
.custom-input.hidden {
  display: none !important;
}

/* ===================================================
   PAGE 6 — MUTELU BEHAVIOR
   =================================================== */
.mutelu-wrapper { width: 100%; }
.mutelu-question { animation: fadeInUp 0.5s ease forwards; }

/* ===================================================
   ANSWER BUTTONS (General & 5-point Scale)
   =================================================== */
.answers-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.answer-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 14px;
  min-width: 100px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-btn-bd);
  background: var(--gray-btn-bg);
  color: var(--text);
  font-family: var(--font-english);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  overflow: hidden;
}
.answer-btn:hover:not(.selected) {
  border-color: rgba(0,180,216,0.4);
  background: rgba(0,180,216,0.06);
}
.answer-btn.selected {
  border-color: var(--selected-bd);
  background: var(--selected-bg);
}
.answer-btn.selected .check-icon {
  opacity: 1;
  transform: scale(1);
}
.answer-btn .num-label {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--blue-bright);
  font-family: var(--font-english);
}
.answer-btn .text-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.3;
  max-width: 90px;
}
.answer-btn.selected .text-label { color: var(--blue-bright); }
.check-icon {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 5px;
  height: 10px;
  border: solid var(--blue-bright);
  border-width: 0 2px 2px 0;
  transform: translateY(-50%) rotate(45deg) scale(0.5);
  transform-origin: center;
  opacity: 0;
  transition: all 0.25s ease;
}

/* Radio-style answer buttons (for mutelu Q1, Q2) */
.answers-radio {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 500px;
  margin: 16px auto 0;
}
.answers-radio-center .radio-btn {
  justify-content: center;
  text-align: center;
}
.radio-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-btn-bd);
  background: var(--gray-btn-bg);
  color: var(--text);
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
}
.radio-btn:hover:not(.selected) {
  border-color: rgba(0, 180, 216, 0.45);
  background: rgba(0, 180, 216, 0.06);
}
.radio-btn.selected {
  border-color: var(--selected-bd);
  background: var(--selected-bg);
}
.radio-btn.selected .check-icon {
  opacity: 1;
  transform: translateY(-50%) rotate(45deg) scale(1);
}

/* Multi-select for mutelu Q3 */
.multi-select-container { width: 100%; max-width: 500px; margin: 0 auto; }
.multi-select-toggle {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-btn-bd);
  background: var(--gray-btn-bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
}
.multi-select-toggle:hover { border-color: rgba(0,180,216,0.4); }
.multi-select-toggle.open { border-color: var(--blue); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.multi-select-dropdown {
  display: none;
  flex-direction: column;
  border: 1.5px solid var(--blue);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #0a0a22;
  max-height: 280px;
  overflow-y: auto;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}
.multi-select-dropdown::-webkit-scrollbar {
  display: none;             /* Hide scrollbar for Chrome/Safari */
}
.multi-select-dropdown.open { display: flex; }
.multi-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.88rem;
  color: var(--text-dim);
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
}
.multi-option:hover { background: rgba(0,180,216,0.08); }
.multi-option.selected { color: var(--blue-bright); background: rgba(0,180,216,0.1); }
.multi-option .multi-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--gray-btn-bd);
  position: relative;
  flex-shrink: 0;
  transition: var(--transition);
}
.multi-option.selected .multi-check {
  background: var(--blue);
  border-color: var(--blue);
}
.multi-option.selected .multi-check::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.multi-count-badge {
  background: var(--blue);
  color: #fff;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===================================================
   QUESTION PAGE (pages 8, 10, 12)
   =================================================== */
.question-page-wrapper { width: 100%; padding: 20px 0; }

.q-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-english);
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}
.q-progress-track {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: calc(100% - 40px);
  max-width: 300px;
  height: 4px;
  border-radius: 999px;
  background: var(--blue-subtle);
  overflow: hidden;
}
#page-8 .page-content,
#page-10 .page-content,
#page-12 .page-content {
  padding-top: 20px;
}
.prog {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0077b6, var(--blue-bright) 50%, #18255b);
  background-size: 200% 100%;
  animation: pgflow 2.2s linear infinite;   /* ไหลตลอดเวลา */
  transition: width .55s cubic-bezier(.4, 0, .2, 1);
}
@keyframes pgflow {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.question-block { animation: fadeInUp 0.5s ease forwards; }
.q-text {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.15;
  color: var(--text-question);
  max-width: 620px;
  margin: 0 auto 32px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-family: var(--font-heading);
}
.q-subtext {
  display: block;
  font-size: 0.5em;
  font-weight: 300;
  text-transform: none;
  opacity: 0.65;
  margin-top: 6px;
  line-height: 1.35;
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
}
body.lang-th .q-subtext {
  font-family: "Sukhumvit Set", "SukhumvitSet", "Kanit", "Sarabun", sans-serif !important;
}
.q-helper {
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
}
body.lang-th .q-helper {
  font-family: "Sukhumvit Set", "SukhumvitSet", "Kanit", "Sarabun", sans-serif !important;
}


/* ===================================================
   PAGE 14 — RESULT CARD
   =================================================== */
.result-content {
  padding: 40px 20px 80px;
  min-height: 100vh;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
}

/* Card flip scene */
.card-scene {
  width: 216px;
  height: 360px;
  perspective: 1000px;
  margin: 0 auto;
  transition: height 1s cubic-bezier(0.4,0,0.2,1);
}
.card-scene.is-small {
  height: 270px;
}
.card-flipper {
  width: 216px;
  height: 360px;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.card-flipper.is-flipped { 
  transform: rotateY(180deg) scale(1.3); 
}
.card-flipper.is-small {
  transform: rotateY(180deg) scale(0.75);
  transition: transform 1s cubic-bezier(0.4,0,0.2,1);
  animation: float-small 4s ease-in-out infinite;
  animation-delay: 1s; 
}

@keyframes float-small {
  0%, 100% {
    transform: rotateY(180deg) scale(0.75) translateY(0px) rotateZ(0deg);
  }
  50% {
    transform: rotateY(180deg) scale(0.75) translateY(-12px) rotateZ(1deg);
  }
}


.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-back-face {
  background-image: url('assets/Tarot/C_Back.png');
  background-size: cover;
  background-position: center;
  border: none;
  cursor: pointer;
  animation: float 3s ease-in-out infinite;
}
.card-flipper.is-flipped .card-back-face,
.card-flipper.is-small .card-back-face { animation: none; }

.card-front-face {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 6px;
  border: none;
}
.card-front-bg {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #0d1b2a, #1a0a2e, #0a1520);
}
.card-front-face * { position: relative; z-index: 1; }
.card-front-icon { font-size: 2.5rem; }
.card-front-name {
  font-family: 'Epic Pro Bold', var(--font-heading);
  font-size: 0.85rem;
  font-weight: normal;
  text-align: center;
  letter-spacing: 0.1em;
  line-height: 1.3;
  background: linear-gradient(180deg, #b4b3bc 30%, rgba(255, 255, 255, 0.15) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.card-front-glow {
  display: none;
}

/* Card front with actual image */
.card-front-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}
.card-front-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}


.click-hint {
  font-family: var(--font-english);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  animation: pulse-opacity 2s ease-in-out infinite;
}

/* Result Details */
.result-details {
  width: 100%;
  max-width: 640px;
  margin-top: 24px;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.result-details.visible { opacity: 1; }

.result-you-got {
  font-family: var(--font-english);
  font-size: 0.75rem;
  letter-spacing: 0;
  color: white;
  text-transform: uppercase;
  margin-top: 28px; 
  margin-bottom: 8px;
  text-align: center;
  font-weight: 500;
  opacity: 0.8;
}
.result-card-name {
  font-family: 'Epic Pro Bold', var(--font-heading);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: normal;
  color: #ffffff;
  text-align: center;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #b4b3bc 30%, rgba(255, 255, 255, 0.15) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.result-desc {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-dim);
  text-align: left;
  max-width: 520px;
  margin: 0 auto 32px;
  font-family: var(--font-english);
}
.desc-para {
  text-indent: 2em;
  margin: 0 0 12px 0;
}
.desc-para:last-child {
  margin-bottom: 0;
}

/* Swipeable Info Cards Stack */
.swipe-deck-container {
  position: relative;
  width: 100%;
  max-width: 540px; 
  margin: 12px auto 40px;
  perspective: 1000px;
  box-sizing: border-box;
}
.swipe-deck {
  position: relative;
  width: 100%;
  height: 450px; 
}
.swipe-card {
  position: absolute;
  inset: 0;
  background: #141414; 
  border: 1.5px solid #222222;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7); 
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  cursor: pointer; 
  user-select: none;
  transform-style: preserve-3d;
  will-change: transform;
  box-sizing: border-box;
  letter-spacing: 0 !important;
}
.swipe-card * {
  letter-spacing: 0 !important;
}
.swipe-card-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 10px; 
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.swipe-card-content-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.swipe-card-label {
  font-family: var(--font-english);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  background: linear-gradient(180deg, #b4b3bc 30%, rgba(255, 255, 255, 0.15) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.swipe-card-value {
  font-family: var(--font-english);
  font-size: 0.95rem;
  line-height: 1.45;
  color: #a1a1aa;
  font-weight: 400;
}
.swipe-card-arrow {
  position: absolute;
  bottom: 30px;
  right: 30px;
  color: #ffffff;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; 
  transition: transform 0.2s ease;
}
.swipe-card:hover .swipe-card-arrow {
  transform: translateX(4px);
  opacity: 1;
}

/* ── Spender Level Gauge Card ─────────────────────────── */
.swipe-card--spender {
  justify-content: flex-start;
  align-items: center;
  text-align: center;
}
.swipe-card--spender .swipe-card-label {
  margin-bottom: 0px;
}
.spender-gauge-wrap {
  position: relative;
  width: 100%;
  max-width: 286px;
  height: 163px;
  margin: 0 auto 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.spender-gauge-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.spender-gauge-pct {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Epic Pro Medium', var(--font-heading) !important;
  font-size: 3.2rem;
  font-weight: normal;
  color: #48cae4;
  line-height: 1;
  letter-spacing: -0.02em;
}
.spender-pct-sup {
  font-size: 0.45em;
  vertical-align: super;
}
.spender-desc {
  font-family: var(--font-english);
  font-size: 0.9rem;
  line-height: 1.55;
  color: #a1a1aa;
  font-weight: 400;
  text-align: center;
  max-width: 100%;
}

/* ── Capsule Styling ────────────────────────────────────── */
.swipe-card-capsules-wrap {
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-top: 5px;
}
.swipe-card-capsules-wrap::-webkit-scrollbar {
  display: none;
}
.capsules-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.capsule-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 14px 18px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}
.capsule-item-card:hover {
  border-color: rgba(0, 180, 216, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.08);
}
.capsule-pill {
  display: inline-block;
  padding: 6px 22px;
  border: 1px solid rgba(0, 180, 216, 0.3);
  border-radius: var(--radius-pill, 999px);
  color: var(--blue-bright, #48cae4); /* Vibrant modern cyan/blue */
  font-family: var(--font-english);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-align: center;
  max-width: 95%;
  background: rgba(0, 180, 216, 0.06);
  box-shadow: 0 2px 8px rgba(0, 180, 216, 0.05);
  transition: all 0.3s ease;
}
.capsule-desc {
  font-family: var(--font-english);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-dim, #8888aa);
  font-weight: 400;
  max-width: 95%;
  text-align: center;
}

/* ── Lucky Colors Grid ──────────────────────────────────── */
.lucky-colors-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}
.lucky-color-box {
  width: 100%;
  border-radius: 24px;
  padding: 16px 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 85px;
}
.lucky-color-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
.lucky-color-name {
  font-family: 'Epic Pro Bold', var(--font-english);
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 10px;
}
.lucky-color-desc {
  font-family: var(--font-english);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.45;
  opacity: 0.85;
}

/* ── Lucky Stone Card ───────────────────────────────────── */
.lucky-stone-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-top: 8px;
}
.lucky-stone-img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
  margin-bottom: 16px;
  animation: floatStone 4s ease-in-out infinite;
}
.lucky-stone-name {
  font-family: 'Epic Pro Bold', var(--font-english);
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--blue-bright, #48cae4);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.lucky-stone-desc {
  font-family: var(--font-english);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-dim, #8888aa);
  font-weight: 400;
  max-width: 90%;
}

@keyframes floatStone {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .swipe-deck-container {
    width: 90%;
    max-width: 350px;
    margin: 12px auto 40px;
    padding: 0;
  }
  .swipe-deck {
    height: 480px; 
  }
  .swipe-card {
    padding: 30px; 
    align-items: center;
    text-align: center;
  }
  .swipe-card-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 15px; 
    margin-left: auto;
    margin-right: auto;
  }
  .swipe-card-content-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px; 
  }
  .swipe-card-label {
    font-size: 24px;
  }
  .swipe-card-value {
    font-size: 0.95rem;
    line-height: 1.5;
  }
  .swipe-card-arrow {
    bottom: 30px;
    right: 30px;
  }
  .chart-container {
    width: 90%;
    max-width: 350px;
  }
  .spender-gauge-wrap {
    width: 100%;
    max-width: 247px;
    height: 143px;
    margin: 0 auto 6px;
  }
  .spender-gauge-pct {
    font-size: 2.6rem;
  }
  .spender-desc {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  .swipe-card-capsules-wrap {
    max-height: 310px;
    margin-top: 2px;
  }
  .result-card-name {
    font-size: clamp(1.4rem, 7.5vw, 2.2rem);
    white-space: nowrap;
  }
  .capsules-stack {
    gap: 10px;
  }
  .capsule-item-card {
    padding: 10px 14px;
    border-radius: 12px;
    gap: 8px;
  }
  .capsule-pill {
    padding: 5px 16px;
    font-size: 0.9rem;
  }
  .capsule-desc {
    font-size: 0.76rem;
    line-height: 1.45;
  }
  .lucky-colors-container {
    gap: 10px;
    margin-top: 4px;
  }
  .lucky-color-box {
    padding: 12px 18px;
    border-radius: 18px;
    min-height: 70px;
  }
  .lucky-color-name {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }
  .lucky-color-desc {
    font-size: 0.76rem;
    line-height: 1.35;
  }
  .lucky-stone-container {
    margin-top: 4px;
  }
  .lucky-stone-img {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
  }
  .lucky-stone-name {
    font-size: 1.25rem;
    margin-bottom: 6px;
  }
  .lucky-stone-desc {
    font-size: 0.76rem;
    line-height: 1.45;
  }
}

/* Chart */
.chart-container {
  position: relative;
  z-index: 10;
  background: #141414;
  border: 1.5px solid #222222; 
  border-radius: 16px;
  padding: 28px 24px;
  margin: 5px auto 12px; 
  max-width: 540px;   
  box-sizing: border-box;
}
.chart-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: #8e8e93;
  text-transform: uppercase;
  margin-bottom: 16px;
  text-align: center;
}
.chart-canvas-wrap { width: 100%; max-width: 380px; margin: 0 auto; }

/* Action buttons */
.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding-bottom: 40px;
}
.segmented-capsule-btn {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--blue);
  background: rgba(10, 10, 30, 0.65);
  backdrop-filter: blur(8px);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
  margin-bottom: 32px;
}
.capsule-divider {
  width: 1.5px;
  background-color: var(--blue);
  align-self: stretch;
}
.btn-share-segment, .btn-restart-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 36px;
  border: none;
  background: transparent;
  font-family: var(--font-english);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-share-segment {
  color: var(--blue-bright);
}
.btn-share-segment:hover {
  background: rgba(0, 180, 216, 0.18);
}
.btn-restart-segment {
  color: var(--text-dim);
}
.btn-restart-segment:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.btn-icon-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}


/* Mobile Carousel Controls (Hidden on Desktop) */
.mobile-carousel-controls {
  display: none;
}

@media (max-width: 600px) {
  #page-2 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #page-2 .section-title {
    padding-left: 20px;
    padding-right: 20px;
  }

  .mobile-carousel-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    z-index: 10;
  }
  
  .carousel-indicator-triangle {
    color: var(--blue-bright);
    font-size: 1.1rem;
    transform: scaleY(0.7);
    margin-bottom: -2px;
    animation: bounceUpDown 2s ease-in-out infinite;
  }
  @keyframes bounceUpDown {
    0%, 100% { transform: scaleY(0.7) translateY(0); }
    50% { transform: scaleY(0.7) translateY(-3px); }
  }

  .shared-select-btn {
    background: #ffffff !important;
    color: #000000 !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
    padding: 12px 38px !important;
  }

  /* Carousel layout for decks container on mobile */
  .decks-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    width: 100% !important;
    max-width: 100vw !important;
    /* Calculated padding to center the 160px wide deck and give space for scale/tilt */
    padding: 55px calc(50% - 80px) 15px !important;
    gap: 24px !important;
    box-sizing: border-box !important;
    -ms-overflow-style: none;  
    scrollbar-width: none; 
  }
  .decks-container::-webkit-scrollbar {
    display: none;
  }

  .deck-item {
    scroll-snap-align: center !important;
    flex-shrink: 0 !important;
    width: 160px !important;
    opacity: 0.35;
    transform: scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .deck-stack {
    width: 160px !important;
    height: 267px !important;
  }
  .card-in-stack {
    width: 150px !important;
    height: 250px !important;
  }
  
  /* Disable desk hover effect on mobile to prevent conflicts with active swipe scaling */
  .deck-item:hover:not(.selected) .deck-stack {
    transform: rotateX(32deg) rotateY(0deg) rotateZ(0deg) !important;
  }
  
  .deck-item.active-mobile {
    opacity: 1;
    transform: scale(1.08);
  }
  .deck-item.active-mobile .deck-stack {
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  }

  /* Hide individual deck buttons on mobile */
  .deck-item button.btn-capsule {
    display: none !important;
  }
}

/* Mobile responsive scaling under 520px */
@media (max-width: 520px) {
  .btn-primary {
    padding: 12px 36px;
    font-size: 0.9rem;
  }
  .btn-lang-toggle {
    width: 44px;
    height: 44px;
  }
  .btn-lang-toggle img {
    width: 100%;
    height: 100%;
  }


}


/* ─── INTRO POPUP ────────────────────────────────────────────
   Shows automatically on page load.
   Clicking anywhere closes it with a fade-out.
   Replace assets/intro-popup.png with your actual image.
──────────────────────────────────────────────────────────── */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 3, 15, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  animation: introFadeIn 0.5s ease forwards;
}
.intro-overlay.closing {
  animation: introFadeOut 0.35s ease forwards;
}
@keyframes introFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes introFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.intro-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(92vw, calc(80vh * 2917 / 4167), 600px);
  max-width: 100%;
  animation: introSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes introSlideUp {
  from { transform: translateY(28px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Main popup image */
.intro-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  object-fit: contain;
}

/* Placeholder when image is not yet provided */
.intro-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(88vw, 480px);
  height: 320px;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(255,255,255,0.15);
  background: rgba(10, 10, 30, 0.6);
  color: var(--text-dim);
  font-family: var(--font-english);
  font-size: 0.95rem;
  text-align: center;
  padding: 24px;
}
.intro-placeholder span { font-size: 2.5rem; }
.intro-placeholder code {
  background: rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--blue-bright);
}


@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.intro-skeleton {
  width: 100%;
  aspect-ratio: 2917 / 4167;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.1) 37%,
    rgba(255, 255, 255, 0.04) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.intro-overlay.hidden-overlay {
  display: none !important;
  animation: none !important;
}
.intro-overlay.hidden-overlay .intro-box {
  animation: none !important;
}

/* About us icon button */
.about-us-btn {
  position: fixed;
  top: 36px;
  right: 80px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #141414;
  border: 1.5px solid #222222;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  padding: 0;
  box-sizing: border-box;
}

.about-us-btn:hover {
  background: #1e1e1e;
  border-color: #333333;
  transform: scale(1.05);
}

.about-us-btn:active {
  transform: scale(0.95);
}

.about-us-icon {
  display: block;
  width: 20px;
  height: 20px;
}


/* ---------- HEADER & FOOTER OVERLAYS ---------- */
.header-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 80px;
  background-image: url('assets/Header-Footer.svg'), linear-gradient(to bottom, #000000 30%, rgba(0, 0, 0, 0) 100%);
  background-size: 100vw auto, 100% 100%;
  background-position: top center, top center;
  background-repeat: no-repeat, no-repeat;
  pointer-events: none;
  z-index: 10;
  transition: background-image 0.6s ease;
}
.header-overlay.on-hero {
  background-image: url('assets/Header-Footer.svg');
  background-size: 100vw auto;
  background-position: top center;
}

.footer-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 80px;
  background-image: url('assets/Header-Footer.svg'), linear-gradient(to top, #000000 30%, rgba(0, 0, 0, 0) 100%);
  background-size: 100vw auto, 100% 100%;
  background-position: bottom center, bottom center;
  background-repeat: no-repeat, no-repeat;
  pointer-events: none;
  z-index: 10;
  transition: background-image 0.6s ease;
}
.footer-overlay.on-hero {
  background-image: url('assets/Header-Footer.svg');
  background-size: 100vw auto;
  background-position: bottom center;
}

@media (max-width: 1200px) {
  .header-overlay,
  .footer-overlay {
    background-size: 1400px auto, 100% 100%;
    height: 75px;
  }
  .header-overlay.on-hero,
  .footer-overlay.on-hero {
    background-size: 1400px auto;
  }
  .page {
    padding: 75px 20px;
  }
}

@media (max-width: 600px) {
  /* Prevent scroll and keep content tightly centered on question pages */
  #page-6,
  #page-8,
  #page-10,
  #page-12 {
    overflow-y: hidden;
  }
  .page {
    padding: 85px 20px 70px;
  }

  #page-6 .page-content {
    padding: 10px 0;
    gap: 14px;
    margin: auto 0;
  }
  #page-8 .page-content,
  #page-10 .page-content,
  #page-12 .page-content {
    padding: 10px 0;
    padding-top: 12px;
    gap: 14px;
    margin: auto 0;
  }

  /* Compact progress bar */
  .q-progress-header {
    margin-bottom: 6px;
    font-size: 0.78rem;
  }
  .q-progress-track {
    top: 85px;
    width: calc(100% - 32px);
  }

  /* Compact question text */
  .q-text {
    margin-bottom: 16px;
    font-size: clamp(1.1rem, 5vw, 1.5rem);
  }

  /* Compact answers container */
  .answers-radio {
    margin: 8px auto 0;
    gap: 8px;
  }

  /* Compact option buttons */
  .radio-btn {
    padding: 12px 18px;
    font-size: 0.82rem;
    gap: 10px;
  }
}

/* ---------- MUSIC TOGGLE BUTTON ---------- */
.music-toggle-btn {
  position: fixed;
  top: 36px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #141414;
  border: 1.5px solid #222222;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  padding: 0;
  box-sizing: border-box;
}

.music-toggle-btn:hover {
  background: #1e1e1e;
  border-color: #333333;
  transform: scale(1.05);
}

.music-toggle-btn:active {
  transform: scale(0.95);
}

.music-icon {
  display: block;
  width: 20px;
  height: 20px;
}

.music-toggle-btn .music-icon-hidden {
  display: none !important;
}

/* ---------- GLOBAL LANGUAGE TOGGLE BUTTON ---------- */
.lang-toggle-btn-global {
  position: fixed;
  top: 36px;
  right: 136px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #141414;
  border: 1.5px solid #222222;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  padding: 0;
  box-sizing: border-box;
}

.lang-toggle-btn-global:hover {
  background: #1e1e1e;
  border-color: #333333;
  transform: scale(1.05);
}

.lang-toggle-btn-global:active {
  transform: scale(0.95);
}

.lang-toggle-btn-global img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Adjust button layout for mobile */
@media (max-width: 600px) {
  .music-toggle-btn {
    top: 24px;
    right: 16px;
    width: 38px;
    height: 38px;
  }
  .music-icon {
    width: 16px;
    height: 16px;
  }
  .lang-toggle-btn-global {
    top: 24px;
    right: 112px;
    width: 38px;
    height: 38px;
  }
  .lang-toggle-btn-global img {
    width: 18px;
    height: 18px;
  }
  .about-us-btn {
    top: 24px;
    right: 64px;
    width: 38px;
    height: 38px;
  }
  .about-us-icon {
    width: 16px;
    height: 16px;
  }
}

/* ---------- LUCKY ITEMS CAPSULE STYLING (MATCHING MOCKUP) ---------- */
.lucky-items-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  padding: 4px;
  box-sizing: border-box;
}

.lucky-item-capsule {
  background: #3b3b3c; 
  border-radius: 9999px;
  padding: 8px 16px 8px 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.lucky-item-capsule:hover {
  transform: translateY(-2px);
}

.lucky-item-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #f5f5f7; /* Off-white circle */
  color: #282829; /* Dark text inside circle */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.lucky-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.lucky-item-name {
  font-family: var(--font-thai), var(--font-english), sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  color: #f5f5f7; 
  line-height: 1.25;
  white-space: normal;
  word-wrap: break-word;
}

.lucky-item-desc {
  font-family: var(--font-thai), var(--font-english), sans-serif;
  font-size: 0.75rem;
  color: #b0b3b8;
  font-weight: normal;
  line-height: 1.4;
  white-space: normal;
  word-wrap: break-word;
}

@media (max-width: 600px) {
  .lucky-items-stack {
    gap: 8px;
    margin-top: 8px;
    padding: 2px;
  }
  .lucky-item-capsule {
    padding: 7px 16px 7px 7px;
    gap: 10px;
  }
  .lucky-item-circle {
    width: 32px;
    height: 32px;
    font-size: 1.0rem;
  }
  .lucky-item-name {
    font-size: 0.8rem;
  }
  .lucky-item-desc {
    font-size: 0.65rem;
  }
}

/* ─── AUSPICIOUS TIME CUSTOM LAYOUT ─── */
.auspicious-time-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin-top: 15px;
  gap: 6px;
}

.auspicious-day {
  font-family: 'Epic Pro Bold', var(--font-english);
  font-size: 3.3rem; 
  font-weight: bold;
  letter-spacing: 0.04em;
  margin-bottom: 0px;
  text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.auspicious-clock {
  font-family: var(--font-english);
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.auspicious-desc {
  font-family: var(--font-thai), var(--font-english), sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-dim, #8888aa);
  font-weight: 400;
  max-width: 90%;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .auspicious-time-container {
    margin-top: 10px;
    gap: 2px;
  }
  .auspicious-day {
    font-size: clamp(1.8rem, 9vw, 2.55rem); 
  }
  .auspicious-clock {
    font-size: 0.875rem; 
  }
  .auspicious-desc {
    font-size: 0.82rem;
    line-height: 1.45;
  }
  .btn-share-segment, .btn-restart-segment {
    padding: 10px 20px;
    font-size: 0.82rem;
    gap: 6px;
  }
}

/* Custom mockup button styling */
#hero-mock-btn {
  transition: all 0.3s ease;
}
#hero-mock-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}
