:root {
  --bg-deep: #0a0014;
  --bg-mid: #1a0033;
  --bg-light: #2d0052;
  --gold: #d4af37;
  --gold-bright: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.6);
  --cream: #f5e6d3;
  --purple-mist: rgba(120, 60, 200, 0.3);
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Serif Thai', 'Sarabun', serif;
  background: radial-gradient(ellipse at center, var(--bg-mid) 0%, var(--bg-deep) 100%);
  color: var(--cream);
  position: relative;
  overflow-y: auto;
}

/* ===== ฉากหลัง ===== */
.starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  background: var(--cream);
  border-radius: 50%;
  animation: twinkle ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 4px var(--gold-glow); }
}

.mist {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 800px 400px at 20% 30%, var(--purple-mist) 0%, transparent 60%),
    radial-gradient(ellipse 600px 300px at 80% 70%, rgba(80, 40, 150, 0.25) 0%, transparent 60%);
  filter: blur(40px);
  animation: drift 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -20px); }
}

.moon {
  position: fixed;
  top: 40px;
  right: 60px;
  width: 80px;
  height: 80px;
  z-index: 1;
  filter: drop-shadow(0 0 20px var(--gold-glow));
  animation: moon-glow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes moon-glow {
  0%, 100% { filter: drop-shadow(0 0 12px var(--gold-glow)); }
  50% { filter: drop-shadow(0 0 20px var(--gold-glow)); }
}

/* ===== container ===== */
.container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  min-height: 100vh;
}

.section { display: none; animation: fadeIn 0.8s ease-out; position: relative; z-index: 3; }
.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fanCardEntrance {
  from {
    opacity: 0;
    transform: translateZ(0) rotate(var(--base-rot)) scale(0.3);
  }
  to {
    opacity: 1;
    transform: translateZ(0) rotate(var(--base-rot)) scale(var(--base-scale));
  }
}

/* ===== Landing ===== */
.landing { text-align: center; padding: 80px 20px; position: relative; z-index: 4; }

.title-main {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--gold-glow);
}

.title-thai {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 3.2rem;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--cream) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 30px;
  text-shadow: 0 0 30px var(--gold-glow);
}

.subtitle {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--cream);
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 50px;
  font-weight: 300;
}

.divider-ornate {
  width: 200px;
  margin: 30px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.divider-ornate::before,
.divider-ornate::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.divider-ornate-symbol { color: var(--gold); font-size: 1.5rem; }

.btn-primary {
  display: inline-block;
  padding: 18px 60px;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-mid) 100%);
  border: 2px solid var(--gold);
  color: var(--gold-bright);
  font-family: 'Noto Serif Thai', serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.4s ease;
  box-shadow: 0 0 15px var(--gold-glow), inset 0 0 15px rgba(255, 215, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--gold-glow), inset 0 0 20px rgba(255, 215, 0, 0.2);
  letter-spacing: 0.2em;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
  transition: left 0.6s;
}

.btn-primary:not(:disabled):hover::before { left: 100%; }

/* ===== หมวด ===== */
.section-title {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 2.2rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 15px;
  text-shadow: 0 0 15px var(--gold-glow);
}

.section-subtitle {
  text-align: center;
  color: var(--cream);
  opacity: 0.7;
  margin-bottom: 50px;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .section-title {
    font-size: 1.8rem;
  }
  .section-subtitle {
    font-size: 0.95rem;
    margin-bottom: 40px;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.6rem;
    margin-bottom: 12px;
  }
  .section-subtitle {
    font-size: 0.9rem;
    margin-bottom: 35px;
  }
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  max-width: 900px;
  margin: 0 auto 40px;
  position: relative;
  z-index: 5;
}

.category-card {
  flex: 1 1 120px;
  max-width: 180px;
  background: linear-gradient(135deg, rgba(45, 0, 82, 0.6) 0%, rgba(26, 0, 51, 0.6) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

@media (min-width: 640px) {
  .category-card {
    flex: 1 1 140px;
    padding: 24px 16px;
  }
}

@media (min-width: 768px) {
  .category-card {
    flex: 1 1 160px;
    padding: 28px 18px;
  }
}

.category-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px var(--gold-glow);
  background: linear-gradient(135deg, rgba(80, 30, 150, 0.6) 0%, rgba(45, 0, 82, 0.6) 100%);
}

.category-card.selected {
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(120, 60, 200, 0.5) 0%, rgba(80, 30, 150, 0.5) 100%);
  box-shadow: 0 0 20px var(--gold-glow);
}

.category-emoji {
  font-size: 2.6rem;
  display: block;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}

.category-name {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--cream);
}

.question-input-wrap { max-width: 600px; margin: 0 auto 40px; position: relative; z-index: 5; }

.question-label {
  display: block;
  text-align: center;
  color: var(--cream);
  opacity: 0.8;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.question-input {
  width: 100%;
  padding: 15px 20px;
  background: rgba(10, 0, 20, 0.6);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  color: var(--cream);
  font-family: 'Sarabun', sans-serif;
  font-size: 1rem;
  resize: vertical;
  min-height: 60px;
  transition: all 0.3s ease;
}

.question-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.center-btn { text-align: center; margin-top: 30px; position: relative; z-index: 6; }

/* ===== Shuffle Section (Enhanced) ===== */
.shuffle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
  position: relative;
}

.shuffle-text {
  margin-top: 40px;
  z-index: 5;
}

.shuffle-title {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--gold-bright);
  margin-bottom: 15px;
  text-shadow: 0 0 15px var(--gold-glow);
  animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 15px var(--gold-glow); }
  50% { text-shadow: 0 0 25px var(--gold-glow), 0 0 40px rgba(255, 215, 0, 0.4); }
}

.shuffle-subtitle {
  font-size: 1.1rem;
  color: var(--cream);
  opacity: 0.8;
  max-width: 400px;
  line-height: 1.7;
}

/* Shuffle Deck Animation - Enhanced Riffle Shuffle */
.shuffle-deck {
  position: relative;
  width: 120px;
  height: 192px;
  filter: drop-shadow(0 0 20px var(--gold-glow));
}

.shuffle-card {
  position: absolute;
  width: 120px;
  height: 192px;
  top: 0;
  left: 0;
  animation: shuffleRiffle 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.shuffle-card:nth-child(1) {
  animation-delay: 0s;
  z-index: 3;
}
.shuffle-card:nth-child(2) {
  animation-delay: 0.3s;
  z-index: 2;
}
.shuffle-card:nth-child(3) {
  animation-delay: 0.6s;
  z-index: 1;
}

.shuffle-card svg {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

@keyframes shuffleRiffle {
  0%, 100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  20% {
    transform: translateX(-60px) translateY(-15px) rotate(-12deg);
  }
  40% {
    transform: translateX(-30px) translateY(-5px) rotate(-6deg);
  }
  50% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  60% {
    transform: translateX(30px) translateY(-5px) rotate(6deg);
  }
  80% {
    transform: translateX(60px) translateY(-15px) rotate(12deg);
  }
}

/* Shuffle Particles - Gold sparkles around deck */
.shuffle-particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

.shuffle-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, var(--gold-bright), transparent);
  border-radius: 50%;
  animation: particleFloat 3s ease-in-out infinite;
  opacity: 0;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0);
  }
  20% {
    opacity: 1;
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--tx, 0) * 2), calc(var(--ty, 0) * 2)) scale(0.3);
  }
}

/* ============================================
   CUT BUTTON SECTION - ปุ่มตัดไพ่ (อยู่ด้านล่างตรงกลางของ section)
   ============================================ */
.cut-button-section {
  position: absolute;
  top: 54%;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
  animation: fadeIn 1s ease-out 0.5s both;
  padding: 20px 0;
  transform: translateY(-50%);
}

.cut-button-section.hidden {
  display: none;
}

.btn-cut-deck {
  display: inline-block;
  padding: 14px 40px;
  background: linear-gradient(135deg, rgba(45, 0, 82, 0.7) 0%, rgba(26, 0, 51, 0.7) 100%);
  border: 1.5px solid var(--gold);
  color: var(--gold-bright);
  font-family: 'Noto Serif Thai', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-radius: 25px;
  transition: all 0.4s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 15px var(--gold-glow), inset 0 0 15px rgba(255, 215, 0, 0.1);
}

.btn-cut-deck:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 25px var(--gold-glow), inset 0 0 20px rgba(255, 215, 0, 0.2);
  letter-spacing: 0.2em;
}

.cut-button-subtitle {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--cream);
  opacity: 0.6;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .cut-button-section {
    top: 62%;
  }
}

@media (max-width: 640px) {
  .cut-button-section {
    padding: 15px 0 20px;
    top: 62%;
  }
  .btn-cut-deck {
    padding: 12px 32px;
    font-size: 1rem;
  }
  .cut-button-subtitle {
    font-size: 0.75rem;
    max-width: 220px;
  }
}

/* ============================================
   CUT OVERLAY - Animation พื้นที่ตอนตัดไพ่
   ============================================ */
.cut-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
  z-index: 50;
}

.cut-overlay.active {
  display: block;
}

/* Cut Stack - กองไพ่ตรงกลางตอนรวม (3D หนาๆ) */
.cut-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90px;
  height: 144px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  perspective: 300px;
}

.cut-stack::before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 3px;
  right: 3px;
  height: 18px;
  background: linear-gradient(to bottom,
    rgba(26, 0, 51, 0.95),
    rgba(10, 0, 20, 1)
  );
  border-radius: 0 0 8px 8px;
  transform: skewX(-3deg);
  box-shadow:
    0 6px 0 rgba(10, 0, 20, 0.9),
    0 12px 0 rgba(10, 0, 20, 0.85),
    0 18px 0 rgba(10, 0, 20, 0.8),
    0 24px 0 rgba(10, 0, 20, 0.75),
    0 30px 0 rgba(10, 0, 20, 0.7),
    0 36px 0 rgba(10, 0, 20, 0.65),
    0 42px 0 rgba(10, 0, 20, 0.6),
    0 48px 0 rgba(10, 0, 20, 0.55),
    0 54px 0 rgba(10, 0, 20, 0.5),
    0 60px 0 rgba(10, 0, 20, 0.45),
    0 66px 0 rgba(10, 0, 20, 0.4);
}

.cut-stack::after {
  content: '';
  position: absolute;
  top: 10px;
  right: -8px;
  width: 16px;
  height: calc(100% - 20px);
  background: linear-gradient(to right,
    rgba(10, 0, 20, 0.7),
    rgba(26, 0, 51, 0.9)
  );
  border-radius: 0 8px 8px 0;
  transform: skewY(-3deg);
  box-shadow:
    inset -3px 0 6px rgba(0, 0, 0, 0.6),
    inset 2px 0 4px rgba(212, 175, 55, 0.05);
}

.cut-stack-card {
  position: absolute;
  width: 90px;
  height: 144px;
  top: 0;
  left: 0;
  border-radius: 8px;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(212, 175, 55, 0.15);
}

.cut-stack-card svg {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* Cut Stack กำลังเรืองแสง */
.cut-stack.glowing {
  animation: cutStackGlow 0.8s ease-in-out;
}

@keyframes cutStackGlow {
  0%, 100% {
    filter: drop-shadow(0 0 15px var(--gold-glow));
  }
  50% {
    filter: drop-shadow(0 0 40px var(--gold-bright)) drop-shadow(0 0 70px var(--gold-glow));
    transform: translate(-50%, -50%) scale(1.03);
  }
}

/* Cut Piles - กองบน/ล่าง ตอนแยกเสร็จแล้ว */
.cut-pile {
  position: absolute;
  left: 50%;
  width: 140px;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cut-pile-top {
  top: 25%;
  transform: translate(-50%, -50%);
}

.cut-pile-bottom {
  top: 75%;
  transform: translate(-50%, -50%);
}

.cut-overlay.piles-visible .cut-pile {
  opacity: 1;
}

.cut-overlay.piles-visible .cut-pile-top {
  animation: pileSlideUp 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.cut-overlay.piles-visible .cut-pile-bottom {
  animation: pileSlideDown 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pileSlideUp {
  0% {
    top: 50%;
    opacity: 0;
  }
  100% {
    top: 25%;
    opacity: 1;
  }
}

@keyframes pileSlideDown {
  0% {
    top: 50%;
    opacity: 0;
  }
  100% {
    top: 75%;
    opacity: 1;
  }
}

.cut-pile:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
}

.cut-pile-top:hover {
  animation: pileSlideUp 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, pileFloatUp 1.5s ease-in-out 0.9s infinite;
}

.cut-pile-bottom:hover {
  animation: pileSlideDown 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, pileFloatDown 1.5s ease-in-out 0.9s infinite;
}

@keyframes pileFloatUp {
  0%, 100% { transform: translate(-50%, -50%) scale(1.08); }
  50% { transform: translate(-50%, calc(-50% - 8px)) scale(1.1); }
}

@keyframes pileFloatDown {
  0%, 100% { transform: translate(-50%, -50%) scale(1.08); }
  50% { transform: translate(-50%, calc(-50% + 8px)) scale(1.1); }
}

.cut-pile-cards {
  position: relative;
  width: 80px;
  height: 128px;
  margin: 0 auto;
  perspective: 200px;
}

.cut-pile-cards::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 2px;
  right: 2px;
  height: 14px;
  background: linear-gradient(to bottom,
    rgba(26, 0, 51, 0.95),
    rgba(10, 0, 20, 1)
  );
  border-radius: 0 0 6px 6px;
  transform: skewX(-2deg);
  box-shadow:
    0 5px 0 rgba(10, 0, 20, 0.9),
    0 10px 0 rgba(10, 0, 20, 0.85),
    0 15px 0 rgba(10, 0, 20, 0.8),
    0 20px 0 rgba(10, 0, 20, 0.75),
    0 25px 0 rgba(10, 0, 20, 0.7),
    0 30px 0 rgba(10, 0, 20, 0.65),
    0 35px 0 rgba(10, 0, 20, 0.6),
    0 40px 0 rgba(10, 0, 20, 0.55);
}

.cut-pile-cards .stack-card {
  position: absolute;
  width: 80px;
  height: 128px;
  top: 0;
  left: 0;
  border-radius: 6px;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(212, 175, 55, 0.15);
}

.cut-pile-cards .stack-card svg {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

/* Stack offset effect - ทำให้ดูเหมือนกองไพ่จริง */
.cut-pile-cards .stack-card:nth-child(1) {
  transform: translate(-2px, -2px);
  z-index: 5;
}
.cut-pile-cards .stack-card:nth-child(2) {
  transform: translate(-1px, -1px);
  z-index: 4;
}
.cut-pile-cards .stack-card:nth-child(3) {
  transform: translate(0, 0);
  z-index: 3;
}
.cut-pile-cards .stack-card:nth-child(4) {
  transform: translate(1px, 1px);
  z-index: 2;
}
.cut-pile-cards .stack-card:nth-child(5) {
  transform: translate(2px, 2px);
  z-index: 1;
}

.cut-pile-label {
  text-align: center;
  margin-top: 18px;
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold-bright);
  letter-spacing: 0.15em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-shadow: none;
}

/* Pile selected state */
.cut-pile.selected {
  pointer-events: none;
}

.cut-pile.unselected {
  pointer-events: none;
  animation: pileFadeOut 0.6s ease-out forwards;
}

@keyframes pileFadeOut {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    filter: grayscale(1) blur(3px);
  }
}

.cut-pile.selected-merging {
  animation: pileMergeToCenter 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pileMergeToCenter {
  0% {
    /* keep current pos */
  }
  100% {
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 30px var(--gold-bright));
  }
}

/* Cut Header - หัวข้อด้านบนของ overlay */
.cut-header {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.cut-overlay.active .cut-header {
  opacity: 1;
}

.cut-title {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--gold-bright);
  margin-bottom: 8px;
  text-shadow: 0 0 15px var(--gold-glow);
}

.cut-subtitle {
  font-size: 0.95rem;
  color: var(--cream);
  opacity: 0.7;
}

@media (max-width: 640px) {
  .cut-header {
    top: 15px;
  }
  .cut-title {
    font-size: 1.4rem;
  }
  .cut-subtitle {
    font-size: 0.85rem;
  }
}

/* Cut instruction - ย้ายมาอยู่ด้านล่างกองไพ่ */
.cut-instruction {
  position: absolute;
  bottom: 25%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Noto Serif Thai', serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--gold-bright);
  text-shadow: 0 0 15px var(--gold-glow);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  white-space: nowrap;
}

.cut-overlay.show-instruction .cut-instruction {
  animation: instructionAppear 0.5s ease-out forwards;
}

@keyframes instructionAppear {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 640px) {
  .cut-instruction {
    font-size: 1rem;
    bottom: 28%;
  }
}

/* Mobile cut overlay adjustments */
@media (max-width: 640px) {
  .cut-pile {
    width: 110px;
  }
  .cut-pile-cards {
    width: 80px;
    height: 128px;
  }
  .cut-pile-cards .stack-card {
    width: 80px;
    height: 128px;
  }
  .cut-stack {
    width: 80px;
    height: 128px;
  }
  .cut-stack-card {
    width: 80px;
    height: 128px;
  }
  .cut-pile-label {
    font-size: 0.95rem;
  }
  .cut-instruction {
    font-size: 1.05rem;
  }
}

/* ===== หน้าเปิดไพ่ ===== */
#section-draw {
  position: relative;
  min-height: auto;
  padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.draw-status {
  text-align: center;
  margin-bottom: 20px;
  z-index: 5;
  position: relative;
}

.draw-position {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--gold-bright);
  margin-bottom: 8px;
  text-shadow: 0 0 15px var(--gold-glow);
}

.draw-position-desc {
  color: var(--cream);
  opacity: 0.75;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .draw-position {
    font-size: 1.4rem;
  }
  .draw-position-desc {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .draw-position {
    font-size: 1.25rem;
    margin-bottom: 6px;
  }
  .draw-position-desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  .draw-position {
    font-size: 1.15rem;
  }
  .draw-position-desc {
    font-size: 0.8rem;
  }
}

.draw-progress {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px 0;
}

.progress-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: transparent;
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-glow);
}

.progress-dot.done { background: var(--gold); }

/* ===== พัดครึ่งวงกลม ===== */
.fan-container {
  position: relative;
  width: 100%;
  height: 564px;
  margin: 20px 0 60px;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Subtle ambient glow beneath the fan */
.fan-container::before {
  content: '';
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, 85vw);
  height: 100px;
  background: radial-gradient(ellipse at center bottom,
    rgba(147, 51, 234, 0.15) 0%,
    rgba(147, 51, 234, 0.05) 40%,
    transparent 70%);
  filter: blur(25px);
  pointer-events: none;
  z-index: 0;
}

/* Fan-wrap hidden state - ตอนกำลังตัดไพ่ */
.fan-wrap.collapsing .tarot-card {
  animation: cardCollectToCenter 0.7s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}

@keyframes cardCollectToCenter {
  0% {
    /* keep current transform via inline style */
  }
  100% {
    transform: translate(0, 0) rotate(0deg) scale(0.85) !important;
    opacity: 0;
  }
}

.fan-wrap.expanding .tarot-card {
  animation: cardExpandFromCenter 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes cardExpandFromCenter {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  100% {
    /* final transform set via inline style */
    opacity: 1;
  }
}

/* fan-wrap = Center pivot point for radial fan arrangement */
.fan-wrap {
  position: absolute;
  left: 50%;
  bottom: 100px;
  width: 0;
  height: 0;
}

/* ไพ่แต่ละใบ */
.tarot-card {
  position: absolute;
  left: -45px;
  bottom: 60px;
  width: 90px;
  height: 144px;
  cursor: pointer;
  transform-origin: 50% calc(100% + 60px);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.tarot-card:hover {
  transform: rotate(var(--rot)) translateY(-15px) scale(1.05);
  z-index: 100;
  filter: brightness(1.1) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
}

.tarot-card:hover .card-face {
  box-shadow:
    0 0 20px rgba(212, 175, 55, 0.4),
    0 0 40px rgba(147, 51, 234, 0.2),
    0 8px 25px rgba(0, 0, 0, 0.6);
}

.tarot-card.selected {
  pointer-events: none;
  opacity: 0.3;
  filter: grayscale(0.7);
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

.card-face {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 7px;
  overflow: hidden;
  border: 1.8px solid var(--gold);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(212, 175, 55, 0.1),
    inset 0 0 20px rgba(147, 51, 234, 0.1);
  transition: box-shadow 0.3s ease;
  backface-visibility: hidden;
}

.card-back {
  background:
    radial-gradient(circle at center, rgba(120, 60, 200, 0.4) 0%, var(--bg-mid) 70%),
    var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.card-back svg {
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

/* ===== ผลทำนาย ===== */
.result-section { padding: 20px 0; z-index: 5; position: relative; }

.selected-cards {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 30px 0 50px;
  flex-wrap: wrap;
  position: relative;
  z-index: 8;
}

.selected-card-wrap {
  text-align: center;
  animation: cardReveal 0.8s ease-out forwards;
  opacity: 0;
}

.selected-card-wrap:nth-child(1) { animation-delay: 0.2s; }
.selected-card-wrap:nth-child(2) { animation-delay: 0.5s; }
.selected-card-wrap:nth-child(3) { animation-delay: 0.8s; }

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.selected-card-display {
  width: 140px;
  height: 240px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  margin: 0 auto 12px;
  box-shadow: 0 0 18px var(--gold-glow);
  overflow: hidden;
  background: var(--cream);
}

.selected-card-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.selected-card-name {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--cream);
  margin-bottom: 4px;
}

.selected-card-name-en {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--gold);
  opacity: 0.85;
  letter-spacing: 0.05em;
  font-variant: small-caps;
}

.position-label {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold-bright);
  margin-top: 10px;
  letter-spacing: 0.1em;
}

.reading-block {
  background: linear-gradient(135deg, rgba(45, 0, 82, 0.5) 0%, rgba(26, 0, 51, 0.5) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
  opacity: 0;
  animation: blockReveal 0.8s ease-out forwards;
  position: relative;
  z-index: 10;
}

.reading-block:nth-of-type(1) { animation-delay: 1.2s; }
.reading-block:nth-of-type(2) { animation-delay: 1.7s; }
.reading-block:nth-of-type(3) { animation-delay: 2.2s; }
.reading-block:nth-of-type(4) { animation-delay: 2.8s; }

@keyframes blockReveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.reading-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 12px;
}

.reading-icon { font-size: 1.6rem; }

.reading-title {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--gold-bright);
  flex: 1;
}

.reading-card-name {
  color: var(--cream);
  font-size: 0.95rem;
  opacity: 0.85;
  text-align: right;
}

.reading-card-name .en {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  display: block;
  opacity: 0.7;
  margin-top: 2px;
}

.reading-text {
  font-family: 'Noto Serif Thai', serif;
  line-height: 1.85;
  font-size: 1.05rem;
  color: var(--cream);
}

.reading-summary-block {
  background: linear-gradient(135deg, rgba(120, 60, 200, 0.4) 0%, rgba(45, 0, 82, 0.4) 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 50px;
  flex-wrap: wrap;
  position: relative;
  z-index: 6;
}

.btn-secondary {
  padding: 14px 40px;
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: 'Noto Serif Thai', serif;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 20px var(--gold-glow);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

/* ===== footer ===== */
.footer {
  text-align: center;
  margin-top: 80px;
  padding: 40px 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  position: relative;
  z-index: 3;
}

.footer-text {
  color: var(--cream);
  opacity: 0.8;
  font-size: 1rem;
  margin-bottom: 15px;
}

.footer-ig {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-bright);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 10px 25px;
  border: 1.5px solid var(--gold);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.footer-ig:hover {
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 15px var(--gold-glow);
  transform: translateY(-2px);
}

.footer-credit {
  margin-top: 20px;
  font-size: 0.78rem;
  opacity: 0.5;
  color: var(--cream);
  font-family: 'Sarabun', sans-serif;
}

.footer-ornate { color: var(--gold); margin: 0 10px; }

@media (max-width: 768px) {
  .footer {
    margin-top: 50px;
    padding: 30px 20px;
  }
  .footer-ig {
    font-size: 1rem;
    padding: 8px 20px;
  }
}

@media (max-width: 480px) {
  .footer {
    margin-top: 40px;
    padding: 25px 15px;
  }
  .footer-text {
    font-size: 0.9rem;
  }
  .footer-ig {
    font-size: 0.95rem;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .fan-wrap { bottom: 60px; }
  .fan-container { height: 444px; margin: 80px 0 20px; }
}

@media (max-width: 768px) {
  .title-thai { font-size: 2.3rem; }
  .title-main { font-size: 1.3rem; letter-spacing: 0.25em; }
  .moon { width: 50px; height: 50px; top: 20px; right: 20px; }
  .fan-wrap { bottom: 40px; }
  .fan-container { height: 379px; margin: 60px 0 20px; }
  .selected-card-display { width: 110px; height: 188px; }
  .reading-block { padding: 20px; }
  .reading-text { font-size: 1rem; }
  .section-title { font-size: 1.7rem; }
  .container { padding: 20px 15px 60px; }
  .reading-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .reading-card-name { text-align: left; }
}

@media (max-width: 640px) {
  .shuffle-title { font-size: 1.6rem; }
  .shuffle-subtitle { font-size: 1rem; }
  .shuffle-deck {
    width: 100px;
    height: 160px;
  }
  .shuffle-card {
    width: 100px;
    height: 160px;
  }
}

@media (max-width: 480px) {
  .title-thai { font-size: 1.9rem; }
  .fan-wrap { bottom: 30px; }
  .fan-container {
    height: 349px;
    margin: 50px 0 20px;
    overflow-x: hidden;
  }
  .draw-position { font-size: 1.25rem; }
  .draw-position-desc { font-size: 0.85rem; }
}

@media (max-width: 400px) {
  .title-thai { font-size: 1.7rem; }
  .title-main { font-size: 1.1rem; letter-spacing: 0.2em; }
  .subtitle { font-size: 0.95rem; margin-bottom: 40px; }
  .container { padding: 30px 12px 60px; }
  .section-title { font-size: 1.4rem; margin-bottom: 10px; }
  .section-subtitle { font-size: 0.85rem; margin-bottom: 30px; }
  .category-emoji { font-size: 2rem; }
  .category-name { font-size: 1rem; }
  .btn-primary { padding: 14px 40px; font-size: 1rem; }
  .fan-container {
    height: 320px;
    margin: 40px 0 20px;
    overflow-x: hidden;
  }
  .fan-wrap { bottom: 25px; }

  .tarot-card {
    width: 100px;
    height: 160px;
    left: -50px;
    bottom: 67px;
  }
}

/* ========================================================================
   LANDING WIDGETS
   ======================================================================== */

/* Widget 1: Card of the Day */
.widget-card-day {
  max-width: 400px;
  margin: 30px auto 20px;
  padding: 25px 20px;
  background: rgba(26, 0, 51, 0.6);
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
  animation: fadeIn 1s ease-out 1s both;
}

.widget-card-day-label {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 15px;
  opacity: 0.9;
}

.widget-card-day-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
}

.widget-card-day-img {
  width: 70px;
  height: 112px;
  object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 6px;
  box-shadow: 0 0 15px var(--gold-glow);
}

.widget-card-day-names {
  text-align: left;
}

.widget-card-day-name-th {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--cream);
  margin-bottom: 4px;
}

.widget-card-day-name-en {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.widget-card-day-toggle {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 8px 20px;
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.1em;
}

.widget-card-day-toggle:hover {
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 10px var(--gold-glow);
}

.widget-card-day-meaning {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  text-align: left;
}

.widget-card-day-meaning.expanded {
  max-height: 200px;
  padding-top: 15px;
}

.widget-card-day-meaning-text {
  font-family: 'Sarabun', sans-serif;
  font-size: 0.95rem;
  color: var(--cream);
  opacity: 0.85;
  line-height: 1.7;
}

/* Widget 2: Zodiac Button */
.widget-zodiac-btn {
  text-align: center;
  margin-bottom: 20px;
  animation: fadeIn 1s ease-out 1.2s both;
}

.btn-zodiac {
  background: rgba(45, 0, 82, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--cream);
  padding: 10px 24px;
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.95rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.1em;
}

.btn-zodiac:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  box-shadow: 0 0 15px var(--gold-glow);
}

/* Zodiac Modal */
.zodiac-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.zodiac-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.zodiac-modal-content {
  position: relative;
  background: linear-gradient(135deg, rgba(26, 0, 51, 0.95) 0%, rgba(10, 0, 20, 0.98) 100%);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  backdrop-filter: blur(15px);
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zodiac-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  line-height: 1;
}

.zodiac-modal-close:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: rotate(90deg);
}

.zodiac-modal-inner {
  min-height: 300px;
}

.zodiac-modal-title {
  font-family: 'Noto Serif Thai', serif;
  font-size: 1.4rem;
  color: var(--gold-bright);
  text-align: center;
  margin-bottom: 25px;
  text-shadow: 0 0 15px var(--gold-glow);
}

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .zodiac-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
  }
}

.zodiac-option {
  background: rgba(45, 0, 82, 0.5);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  padding: 15px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.zodiac-option:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.zodiac-option.selected {
  background: rgba(212, 175, 55, 0.3);
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px var(--gold-glow);
}

.zodiac-symbol {
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
}

.zodiac-name {
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.9rem;
  color: var(--cream);
}

/* Zodiac Result View */
.zodiac-result-view {
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.zodiac-result-img {
  width: 120px;
  height: 192px;
  object-fit: cover;
  border: 2.5px solid var(--gold);
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 0 25px var(--gold-glow);
}

.zodiac-result-name-th {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--cream);
  margin-bottom: 5px;
}

.zodiac-result-name-en {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}

.zodiac-result-meaning {
  font-family: 'Sarabun', sans-serif;
  font-size: 0.95rem;
  color: var(--cream);
  opacity: 0.85;
  line-height: 1.7;
  margin-bottom: 25px;
  max-height: 300px;
  overflow-y: auto;
}

.zodiac-result-back {
  background: rgba(45, 0, 82, 0.6);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  padding: 10px 25px;
  font-family: 'Nino Serif Thai', serif;
  font-size: 0.95rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.1em;
}

.zodiac-result-back:hover {
  background: rgba(212, 175, 55, 0.2);
  box-shadow: 0 0 15px var(--gold-glow);
}

/* ========================================================================
   TAROT GUIDE PAGE STYLES
   ======================================================================== */

.guide-page {
  padding-top: 60px;
}

.guide-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 0, 20, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-bright);
  text-decoration: none;
  font-family: 'Noto Serif Thai', serif;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.nav-back:hover {
  color: var(--cream);
  transform: translateX(-3px);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--cream);
  text-decoration: none;
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  opacity: 1;
  color: var(--gold-bright);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-glow);
}

.guide-container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.guide-hero {
  text-align: center;
  padding: 60px 20px 80px;
  animation: fadeIn 0.8s ease-out;
  position: relative;
}

.guide-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  color: var(--gold-bright);
  margin-bottom: 10px;
  text-shadow: 0 0 30px var(--gold-glow);
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--cream);
  margin-bottom: 30px;
  opacity: 0.9;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--cream);
  opacity: 0.75;
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-cta {
  padding: 16px 48px;
  font-size: 1.1rem;
}

.guide-section {
  padding: 60px 0;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.guide-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.history-content {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 60px;
  align-items: start;
}

.history-text h3 {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--gold-bright);
  margin: 30px 0 15px;
}

.history-text h3:first-child {
  margin-top: 0;
}

.history-paragraph {
  line-height: 1.9;
  color: var(--cream);
  opacity: 0.85;
  margin-bottom: 20px;
}

.history-paragraph strong {
  color: var(--gold-bright);
  font-weight: 600;
}

.history-timeline {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline-item {
  background: linear-gradient(135deg, rgba(45, 0, 82, 0.4) 0%, rgba(26, 0, 51, 0.4) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(10px);
  text-align: center;
  transition: all 0.3s ease;
}

.timeline-item:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.15);
}

.timeline-year {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--gold-bright);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.timeline-event {
  color: var(--cream);
  font-size: 0.95rem;
  opacity: 0.9;
}

.arcan-tabs,
.suit-tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.arcan-tab,
.suit-tab {
  padding: 12px 32px;
  background: rgba(26, 0, 51, 0.6);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 25px;
  color: var(--cream);
  font-family: 'Noto Serif Thai', serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.arcan-tab:hover,
.suit-tab:hover {
  border-color: var(--gold);
  background: rgba(45, 0, 82, 0.6);
}

.arcan-tab.active,
.suit-tab.active {
  background: linear-gradient(135deg, rgba(120, 60, 200, 0.5) 0%, rgba(80, 30, 150, 0.5) 100%);
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px var(--gold-glow);
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
  display: block;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding: 20px 0 40px;
}

@media (min-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.guide-card {
  background: linear-gradient(135deg, rgba(45, 0, 82, 0.4) 0%, rgba(26, 0, 51, 0.4) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.guide-card:hover {
  border-color: var(--gold-bright);
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(212, 175, 55, 0.25),
    inset 0 0 20px rgba(212, 175, 55, 0.05);
}

.guide-card:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

.guide-card-image {
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--bg-deep);
  position: relative;
}

.guide-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.guide-card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(45, 0, 82, 0.4) 0%,
    rgba(120, 60, 200, 0.2) 50%,
    rgba(45, 0, 82, 0.4) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.guide-card-image.loaded::before {
  opacity: 0;
  pointer-events: none;
}

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

.guide-card-image img.loaded {
  opacity: 1;
}

.guide-card:hover .guide-card-image img {
  transform: scale(1.05);
}

.guide-card-info {
  padding: 16px;
  text-align: center;
}

.guide-card-symbol {
  font-size: 1.5rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.guide-card-name-en {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  font-variant: small-caps;
}

.guide-card-name-th {
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.95rem;
  color: var(--cream);
  font-weight: 600;
}

.reading-intro {
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--cream);
  opacity: 0.85;
  max-width: 800px;
  margin: 0 auto 40px;
}

.spread-selector {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
}

.spread-btn {
  padding: 12px 32px;
  background: rgba(26, 0, 51, 0.6);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 25px;
  color: var(--cream);
  font-family: 'Noto Serif Thai', serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.spread-btn:hover {
  border-color: var(--gold);
  background: rgba(45, 0, 82, 0.6);
}

.spread-btn.active {
  background: linear-gradient(135deg, rgba(120, 60, 200, 0.5) 0%, rgba(80, 30, 150, 0.5) 100%);
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px var(--gold-glow);
}

.spread-diagrams {
  position: relative;
}

.spread-diagram {
  display: none;
  animation: fadeIn 0.5s ease-out;
}

.spread-diagram.active {
  display: block;
}

.spread-svg {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 30px;
  display: block;
}

.spread-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.spread-card:hover rect {
  stroke: var(--gold-bright);
  stroke-width: 3;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}

.spread-description {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background: rgba(26, 0, 51, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
}

.spread-description h4 {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gold-bright);
  margin-bottom: 10px;
}

.spread-description p {
  color: var(--cream);
  opacity: 0.85;
  line-height: 1.7;
}

.position-tooltip {
  position: fixed;
  background: rgba(10, 0, 20, 0.98);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 20px 25px;
  max-width: min(350px, 90vw);
  z-index: 10000;
  transform: translateX(-50%);
  left: 50% !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--gold-glow);
}

.position-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
}

.tooltip-title {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold-bright);
  margin-bottom: 10px;
}

.tooltip-text {
  color: var(--cream);
  line-height: 1.7;
  font-size: 0.95rem;
}

.card-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.card-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
  border: 2px solid var(--gold);
  border-radius: 15px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px var(--gold-glow);
  transform: none;
  transition: none;
}

.card-modal.active .modal-content {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(212, 175, 55, 0.2);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-bright);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--gold);
  color: var(--bg-deep);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 60px 40px 40px;
}

.modal-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image img {
  width: 100%;
  max-width: 280px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.25);
  border: 2px solid var(--gold);
  transition: box-shadow 0.3s ease;
}

.modal-image img:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 50px rgba(212, 175, 55, 0.4);
}

.modal-info {
  display: flex;
  flex-direction: column;
}

.modal-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.modal-title-th {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 8px;
}

.modal-title-en {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: 15px;
}

.modal-symbol {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}

.meanings-title {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold-bright);
  margin-bottom: 20px;
  text-align: center;
}

.meanings-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meaning-item {
  background: rgba(45, 0, 82, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.25s ease;
}

.meaning-item:hover {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(60, 10, 110, 0.4);
}

.meaning-category {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold-bright);
  display: block;
  margin-bottom: 8px;
}

.meaning-text {
  color: var(--cream);
  line-height: 1.7;
  font-size: 0.9rem;
  opacity: 0.9;
}

.guide-footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  margin-top: 80px;
  position: relative;
  z-index: 3;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-bright);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 12px 30px;
  border: 1.5px solid var(--gold);
  border-radius: 50px;
  transition: all 0.3s ease;
  font-family: 'Noto Serif Thai', serif;
}

.footer-link:hover {
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 20px var(--gold-glow);
  transform: translateY(-2px);
}

.error-message {
  text-align: center;
  padding: 60px 20px;
  background: rgba(139, 0, 0, 0.2);
  border: 2px solid rgba(255, 0, 0, 0.3);
  border-radius: 10px;
}

.error-message h3 {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: #ff6b6b;
  margin-bottom: 15px;
}

.error-message p {
  color: var(--cream);
  opacity: 0.85;
}

.guide-section .section-title {
  font-size: 2.4rem;
  letter-spacing: 0.02em;
}

@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }

  .history-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .history-timeline {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .modal-body {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 40px 30px 30px;
  }

  .modal-image {
    order: -1;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 10px;
  }

  .nav-links {
    gap: 15px;
  }

  .guide-page {
    padding-top: 90px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.5rem;
  }

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

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-body {
    padding: 50px 20px 20px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .guide-container {
    padding: 20px 15px 60px;
  }

  .hero-title {
    font-size: 2rem;
    letter-spacing: 0.3em;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

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

  .arcan-tabs,
  .suit-tabs {
    gap: 10px;
  }

  .arcan-tab,
  .suit-tab {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .spread-selector {
    flex-direction: column;
  }

  .spread-btn {
    width: 100%;
  }

  .history-timeline {
    grid-template-columns: 1fr;
  }

  .guide-card-name-th {
    font-size: 0.85rem;
  }

  .modal-title-th {
    font-size: 1.4rem;
  }

  .modal-title-en {
    font-size: 0.9rem;
  }
}

/* ============================================================
   ✦ MODERN POLISH LAYER — 2026 Refresh
   Additive layer: overrides visual styling only.
   ไม่แตะ fan layout, cut animation, หรือ JS hooks ใดๆ
   ============================================================ */

/* ---------- 1. Refined design tokens ---------- */
:root {
  --gold-soft: #e8c96a;
  --gold-dim: rgba(212, 175, 55, 0.35);
  --glass-bg: rgba(30, 8, 58, 0.45);
  --glass-border: rgba(212, 175, 55, 0.28);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Ambient atmosphere ---------- */
/* Aurora glow behind the hero — GPU-friendly, single element */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  width: 130vw;
  height: 70vh;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 55% 45% at 50% 30%,
      rgba(140, 80, 220, 0.16) 0%,
      rgba(212, 175, 55, 0.05) 45%,
      transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: aurora-breathe 9s ease-in-out infinite;
}

@keyframes aurora-breathe {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.06); }
}

/* CSS-only shooting stars */
.starfield::before,
.starfield::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 248, 213, 0.9), transparent);
  border-radius: 999px;
  opacity: 0;
  animation: shooting-star 8s linear infinite;
}

.starfield::before { top: 18%; left: 65%; animation-delay: 3s; }
.starfield::after  { top: 34%; left: 15%; animation-delay: 9.5s; transform: rotate(-18deg); }

@keyframes shooting-star {
  0%, 92%  { opacity: 0; translate: 0 0; }
  93%      { opacity: 1; }
  100%     { opacity: 0; translate: -180px 60px; }
}

/* ---------- 3. Fluid typography (clamp) ---------- */
.title-main {
  font-size: clamp(1.05rem, 0.7rem + 2vw, 1.8rem);
  letter-spacing: clamp(0.2em, 0.15em + 0.3vw, 0.4em);
}

.title-thai {
  font-size: clamp(1.9rem, 1.1rem + 4.5vw, 3.6rem);
  line-height: 1.25;
  background: linear-gradient(120deg,
    var(--gold) 0%, var(--gold-bright) 25%,
    var(--cream) 50%,
    var(--gold-bright) 75%, var(--gold) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gold-shimmer 6s linear infinite;
}

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

.subtitle {
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.15rem);
  text-wrap: balance;
}

.section-title { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.2rem); }
.section-subtitle { font-size: clamp(0.88rem, 0.82rem + 0.3vw, 1rem); text-wrap: balance; }

/* ---------- 4. Hero entrance orchestration ---------- */
.landing.active .title-main,
.landing.active .title-thai,
.landing.active .divider-ornate,
.landing.active .subtitle {
  animation-name: rise-in;
  animation-duration: 0.9s;
  animation-timing-function: var(--ease-smooth);
  animation-fill-mode: both;
}

.landing.active .title-main  { animation-delay: 0.05s; }
.landing.active .title-thai  { animation-delay: 0.18s, 0s; animation-name: rise-in, gold-shimmer; animation-duration: 0.9s, 6s; animation-iteration-count: 1, infinite; animation-timing-function: var(--ease-smooth), linear; }
.landing.active .divider-ornate { animation-delay: 0.32s; }
.landing.active .subtitle    { animation-delay: 0.42s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ---------- 5. Buttons — refined feel ---------- */
.btn-primary {
  border-radius: 10px;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease, letter-spacing 0.35s ease;
  will-change: transform;
}

.btn-primary:not(:disabled):active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  border-radius: 10px;
  backdrop-filter: blur(6px);
  transition: transform 0.3s var(--ease-spring), background 0.3s ease, box-shadow 0.3s ease;
}

.btn-secondary:not(:disabled):hover { transform: translateY(-2px); }
.btn-secondary:not(:disabled):active { transform: scale(0.98); }

/* Keyboard focus — a11y quality floor */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-zodiac:focus-visible,
.btn-cut-deck:focus-visible,
.category-card:focus-visible,
.footer-ig:focus-visible,
.widget-card-day-toggle:focus-visible,
.question-input:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ---------- 6. Category cards — glass + gold corners ---------- */
.category-card {
  position: relative;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.35s ease, border-color 0.3s ease, background 0.3s ease;
  will-change: transform;
}

/* Gold corner accents — appears on hover/selected */
.category-card::before,
.category-card::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gold-bright);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-smooth);
  pointer-events: none;
}

.category-card::before {
  top: 7px; left: 7px;
  border-right: none; border-bottom: none;
  border-top-left-radius: 8px;
  transform: translate(4px, 4px);
}

.category-card::after {
  bottom: 7px; right: 7px;
  border-left: none; border-top: none;
  border-bottom-right-radius: 8px;
  transform: translate(-4px, -4px);
}

.category-card:hover::before,
.category-card:hover::after,
.category-card.selected::before,
.category-card.selected::after {
  opacity: 1;
  transform: translate(0, 0);
}

.category-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 24px rgba(212, 175, 55, 0.25);
}

.category-card.selected {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold-dim), 0 0 28px rgba(212, 175, 55, 0.35);
}

.category-emoji {
  transition: transform 0.4s var(--ease-spring);
}

.category-card:hover .category-emoji,
.category-card.selected .category-emoji {
  transform: translateY(-3px) scale(1.12);
}

/* ---------- 7. Question input — refined glass ---------- */
.question-input {
  border-radius: 12px;
  background: rgba(14, 2, 28, 0.55);
  backdrop-filter: blur(8px);
  line-height: 1.7;
}

.question-input::placeholder { color: rgba(245, 230, 211, 0.35); }

.question-input:focus {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15), 0 0 18px rgba(212, 175, 55, 0.25);
}

/* ---------- 8. Result section — elegant reading blocks ---------- */
.reading-block {
  border-radius: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.reading-summary-block {
  border: 1px solid var(--gold);
  background: linear-gradient(150deg, rgba(120, 60, 200, 0.32) 0%, rgba(45, 0, 82, 0.4) 100%);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.18), inset 0 1px 0 rgba(255, 215, 0, 0.12);
}

.selected-card-display {
  border-radius: 12px;
  transition: transform 0.45s var(--ease-spring), box-shadow 0.35s ease;
}

.selected-card-wrap:hover .selected-card-display {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 26px var(--gold-glow);
}

/* ---------- 9. Widgets & footer ---------- */
.widget-card-day {
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.footer-ig {
  transition: transform 0.3s var(--ease-spring), background 0.3s ease, box-shadow 0.3s ease;
}

.footer-ig:hover { transform: translateY(-3px); }

/* ---------- 10. Scrollbar & selection ---------- */
::selection {
  background: rgba(212, 175, 55, 0.35);
  color: #fff8d5;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-dim), rgba(120, 60, 200, 0.4));
  border-radius: 999px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

html { scrollbar-color: rgba(212, 175, 55, 0.4) #0a0014; scrollbar-width: thin; }

/* ---------- 11. Reduced motion — a11y quality floor ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .title-thai {
    -webkit-text-fill-color: var(--gold-bright);
    background: none;
  }
}

/* ---------- 12. Small-screen refinements ---------- */
@media (max-width: 480px) {
  .moon { top: 24px; right: 20px; width: 56px; height: 56px; }
  .category-card { border-radius: 12px; }
  .reading-block { padding: 22px 18px; border-radius: 14px; }
}

/* Touch devices: no hover-lift jitter, use active state instead */
@media (hover: none) {
  .category-card:hover { transform: none; }
  .category-card:active {
    transform: scale(0.97);
    border-color: var(--gold-bright);
  }
}