@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@500;700;900&family=Kanit:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg-dark: #070612;
  --bg-velvet: #130d2a;
  --bg-card: rgba(22, 16, 48, 0.75);
  --bg-glass: rgba(18, 12, 40, 0.85);
  --gold-primary: #facc15;
  --gold-light: #fef08a;
  --gold-glow: rgba(250, 204, 21, 0.45);
  --gold-gradient: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #b45309 100%);
  --purple-glow: rgba(168, 85, 247, 0.4);
  --purple-accent: #a855f7;
  --crimson-accent: #e11d48;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --border-gold: rgba(250, 204, 21, 0.3);
  --border-ornate: rgba(250, 204, 21, 0.6);
  --radius-lg: 24px;
  --radius-md: 14px;
  --font-heading: 'Cinzel Decorative', 'Cinzel', serif;
  --font-thai-title: 'Kanit', sans-serif;
  --font-body: 'Kanit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  max-width: 100dvw !important;
  width: 100% !important;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(88, 28, 135, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(180, 83, 9, 0.2) 0%, transparent 40%);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
}

.app-wrapper {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  box-sizing: border-box !important;
}



/* Background Particle Canvas */
/* ====================================================
   1. MYSTIC SANCTUARY ATMOSPHERE BACKGROUND
   ==================================================== */
.mystic-bg-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
}

/* Ambient Mist / Incense Fog */
.mystic-ambient-mist {
  position: absolute;
  inset: -20%;
  background: 
    radial-gradient(circle at 15% 25%, rgba(168, 85, 247, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(250, 204, 21, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(88, 28, 135, 0.18) 0%, transparent 60%);
  filter: blur(40px);
  animation: mistPulse 18s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

@keyframes mistPulse {
  0% { transform: scale(1) translate(0, 0); opacity: 0.7; }
  50% { transform: scale(1.08) translate(-20px, 15px); opacity: 0.95; }
  100% { transform: scale(1.03) translate(25px, -20px); opacity: 0.75; }
}

/* Central Astrological Zodiac Wheel */
.mystic-wheel-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 820px;
  height: 820px;
  transform: translate(-50%, -50%);
  opacity: 0.22;
  will-change: transform;
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 45%, rgba(0, 0, 0, 0) 75%);
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 45%, rgba(0, 0, 0, 0) 75%);
  animation: wheelSlowRotate 150s linear infinite;
}

.mystic-celestial-wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes wheelSlowRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Sacred Fortune Teller Hands (Left & Right Flanks) */
.mystic-hand-wrap {
  position: absolute;
  width: 320px;
  height: 540px;
  opacity: 0.18;
  transition: opacity 0.5s ease;
  will-change: transform;
}

.mystic-hand-wrap.left {
  bottom: 8%;
  left: -20px;
  animation: mysticFloatLeft 9s ease-in-out infinite alternate;
}

.mystic-hand-wrap.right {
  top: 12%;
  right: -20px;
  transform: scaleX(-1);
  animation: mysticFloatRight 10s ease-in-out infinite alternate;
}

.mystic-hand-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.35));
}

@keyframes mysticFloatLeft {
  0% { transform: translateY(0) rotate(2deg); opacity: 0.16; }
  50% { transform: translateY(-18px) rotate(-2deg); opacity: 0.24; }
  100% { transform: translateY(6px) rotate(3deg); opacity: 0.17; }
}

@keyframes mysticFloatRight {
  0% { transform: scaleX(-1) translateY(0) rotate(-2deg); opacity: 0.17; }
  50% { transform: scaleX(-1) translateY(-22px) rotate(3deg); opacity: 0.25; }
  100% { transform: scaleX(-1) translateY(8px) rotate(-1deg); opacity: 0.18; }
}

/* Mobile responsive adjustments for background hands & wheel */
@media (max-width: 900px) {
  .mystic-wheel-wrap {
    width: 600px;
    height: 600px;
    opacity: 0.16;
  }
  .mystic-hand-wrap {
    width: 220px;
    height: 380px;
    opacity: 0.12;
  }
  .mystic-hand-wrap.left {
    left: -70px;
    bottom: 4%;
  }
  .mystic-hand-wrap.right {
    right: -70px;
    top: 6%;
  }
}

@media (max-width: 480px) {
  .mystic-wheel-wrap {
    width: 440px;
    height: 440px;
    opacity: 0.12;
  }
  .mystic-hand-wrap {
    display: none;
  }
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px 60px 20px;
}

/* Header Navbar */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(250, 204, 21, 0.05);
  flex-wrap: wrap;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 14px var(--gold-primary));
  animation: floatOrb 4s ease-in-out infinite;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1.5px;
}

.logo-text p {
  font-family: var(--font-thai-title);
  font-size: 1.05rem;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.nav-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  padding: 7px 12px;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon:hover {
  background: var(--gold-primary);
  color: #0b061a;
  box-shadow: 0 0 20px var(--gold-glow);
  transform: translateY(-2px);
}

.btn-icon.active-bgm {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  color: #fff;
  border-color: #c084fc;
  box-shadow: 0 0 20px var(--purple-glow);
}

/* Voice Guide Banner */
.voice-guide-banner {
  background: linear-gradient(135deg, rgba(30, 16, 60, 0.85) 0%, rgba(18, 12, 40, 0.95) 100%);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(168, 85, 247, 0.15);
  backdrop-filter: blur(14px);
}

.voice-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.speaker-pulse {
  font-size: 2.2rem;
  animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0.8)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 15px var(--gold-primary)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0.8)); }
}

.voice-banner-text h4 {
  font-family: var(--font-thai-title);
  color: var(--gold-primary);
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.voice-banner-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Hero & Gypsy Oracle Widget */
.hero-section {
  text-align: center;
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  margin-bottom: 8px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(250, 204, 21, 0.3);
}

.hero-subtitle {
  font-family: var(--font-thai-title);
  font-size: 1.3rem;
  color: var(--gold-light);
  max-width: 800px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
}

/* Gypsy Crystal Ball Oracle Floating Widget */
.oracle-box {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.4) 0%, rgba(22, 16, 48, 0.8) 100%);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 40px;
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.25);
}

.oracle-box:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 30px var(--gold-glow);
  transform: scale(1.03);
}

/* ====================================================
   2. 3D MYSTIC CRYSTAL BALL (ORACLE WIDGET)
   ==================================================== */
.crystal-orb-container {
  position: relative;
  width: 44px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crystal-orb-sphere {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a855f7 0%, #3b0764 45%, #0f0728 100%);
  box-shadow: 
    0 0 16px rgba(168, 85, 247, 0.7),
    0 0 32px rgba(250, 204, 21, 0.3),
    inset -4px -4px 10px rgba(0, 0, 0, 0.9),
    inset 3px 3px 6px rgba(254, 240, 138, 0.6);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.oracle-box:hover .crystal-orb-sphere {
  transform: scale(1.12);
  box-shadow: 
    0 0 24px rgba(250, 204, 21, 0.85),
    0 0 40px rgba(168, 85, 247, 0.6),
    inset -4px -4px 10px rgba(0, 0, 0, 0.8),
    inset 4px 4px 8px #ffffff;
}

.orb-deep-nebula {
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, #ec4899, #8b5cf6, #3b82f6, #eab308, #ec4899);
  opacity: 0.55;
  filter: blur(4px);
  animation: nebulaSpin 5s linear infinite;
}

.orb-swirl-clouds {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 70% 60%, rgba(254, 240, 138, 0.8) 0%, transparent 60%);
  animation: nebulaCloudDrift 3s ease-in-out infinite alternate;
}

.orb-star-cluster {
  position: absolute;
  font-size: 0.75rem;
  color: #fff;
  text-shadow: 0 0 6px #facc15;
  animation: starTwinkle 2s ease-in-out infinite alternate;
  z-index: 2;
}

.orb-specular-glare {
  position: absolute;
  top: 4px;
  left: 6px;
  width: 14px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
  transform: rotate(-32deg);
  z-index: 3;
}

.orb-rim-light {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(254, 240, 138, 0.4);
  box-shadow: inset 0 0 6px rgba(250, 204, 21, 0.4);
  z-index: 4;
}

.orb-pedestal-base {
  width: 22px;
  height: 5px;
  background: var(--gold-gradient);
  border-radius: 3px;
  margin-top: -2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  border-top: 1px solid #fef08a;
  z-index: 1;
}

.orb-shockwave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #fef08a;
  opacity: 0;
  pointer-events: none;
}

.oracle-box.pulse-spark .orb-shockwave {
  animation: orbShockwaveBurst 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes nebulaSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes nebulaCloudDrift {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0.5; }
  100% { transform: scale(1.15) rotate(45deg); opacity: 0.9; }
}

@keyframes starTwinkle {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 1; text-shadow: 0 0 10px #ffffff, 0 0 18px #facc15; }
}

@keyframes orbShockwaveBurst {
  0% { transform: scale(1); opacity: 1; border-color: #ffffff; box-shadow: 0 0 25px #facc15; }
  100% { transform: scale(3.5); opacity: 0; border-color: #a855f7; box-shadow: 0 0 45px rgba(168, 85, 247, 0); }
}

.crystal-ball-icon {
  font-size: 1.8rem;
  animation: crystalGlow 3s ease-in-out infinite alternate;
}

@keyframes crystalGlow {
  0% { filter: drop-shadow(0 0 5px #a855f7); transform: scale(1); }
  100% { filter: drop-shadow(0 0 20px #facc15); transform: scale(1.1); }
}

.oracle-text {
  font-family: var(--font-thai-title);
  font-size: 1.1rem;
  color: var(--gold-light);
}

/* Help Nav Button Highlight */
.btn-help-highlight {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(168, 85, 247, 0.25) 100%) !important;
  border: 1px solid var(--gold-primary) !important;
  color: var(--gold-light) !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.2);
}

.btn-help-highlight:hover {
  background: var(--gold-gradient) !important;
  color: #0b061a !important;
  box-shadow: 0 0 20px var(--gold-glow);
  transform: translateY(-2px);
}

/* Progressive Divination Setup Card */
.setup-card {
  max-width: 760px;
  margin: 0 auto 28px auto;
  background: linear-gradient(135deg, rgba(26, 15, 52, 0.92) 0%, rgba(13, 8, 30, 0.96) 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.35);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.setup-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ec4899, #facc15, #38bdf8, #a855f7);
}

.setup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(250, 204, 21, 0.25);
  padding-bottom: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.setup-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.setup-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px #facc15);
}

.setup-header-title h3 {
  font-family: var(--font-thai-title);
  font-size: 1.45rem;
  color: var(--gold-primary);
  margin-bottom: 2px;
}

.setup-header-title p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pill-help-btn {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: var(--gold-light);
  padding: 8px 18px;
  border-radius: 30px;
  font-family: var(--font-thai-title);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

.pill-help-btn:hover {
  background: var(--gold-gradient);
  color: #0b061a;
  box-shadow: 0 0 15px var(--gold-glow);
  transform: translateY(-2px);
}

.setup-form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-step-box {
  background: rgba(14, 9, 32, 0.6);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 18px;
  padding: 18px 22px;
  transition: all 0.35s ease;
  text-align: left;
}

.form-step-box:focus-within {
  border-color: var(--gold-primary);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.2);
}

.form-step-box.locked {
  opacity: 0.42;
  pointer-events: none;
  filter: grayscale(0.5);
  border-style: dashed;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.step-badge {
  background: var(--gold-gradient);
  color: #0b061a;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.step-label-title {
  font-family: var(--font-thai-title);
  font-size: 1.05rem;
  color: var(--gold-light);
  font-weight: 600;
}

.select-container {
  position: relative;
  width: 100%;
}

.mystic-select {
  width: 100%;
  background: #0d081f;
  border: 1.5px solid rgba(250, 204, 21, 0.35);
  border-radius: 14px;
  color: #f8fafc;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 44px 13px 18px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.mystic-select:hover:not(:disabled) {
  border-color: var(--gold-primary);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.25);
}

.mystic-select:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 22px var(--gold-glow);
}

.mystic-select:disabled {
  background: rgba(15, 10, 30, 0.5);
  cursor: not-allowed;
  color: #64748b;
  border-color: rgba(255, 255, 255, 0.1);
}

.mystic-select option {
  background: #0f172a;
  color: #f8fafc;
  padding: 12px;
}

.select-chevron {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-primary);
  font-size: 0.85rem;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.step-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
  padding-left: 2px;
}

.setup-footer {
  margin-top: 22px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.btn-start-divination {
  font-size: 1.15rem;
  padding: 14px 40px;
  border-radius: 35px;
  box-shadow: 0 8px 30px rgba(250, 204, 21, 0.4);
  animation: pulse-ring 2.5s infinite;
}

.btn-start-divination:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(250, 204, 21, 0.6);
}

/* Active Session Bar */
.active-session-bar {
  max-width: 760px;
  margin: 0 auto 20px auto;
  background: linear-gradient(135deg, rgba(30, 16, 60, 0.85) 0%, rgba(16, 10, 38, 0.92) 100%);
  border: 1px solid var(--gold-primary);
  border-radius: 30px;
  padding: 10px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(250, 204, 21, 0.1);
  animation: fadeIn 0.4s ease;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.session-topic-tag {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(168, 85, 247, 0.3) 100%);
  border: 1px solid #ec4899;
  color: #fbcfe8;
  padding: 4px 14px;
  border-radius: 18px;
  font-family: var(--font-thai-title);
  font-size: 0.88rem;
  font-weight: 600;
}

.session-spread-tag {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 4px 14px;
  border-radius: 18px;
  font-family: var(--font-thai-title);
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-change-setup {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 18px;
  font-family: var(--font-thai-title);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-change-setup:hover {
  background: var(--gold-gradient);
  color: #0b061a;
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Result Bottom Actions */
.result-actions-bottom {
  margin-top: 36px;
  text-align: center;
  padding-top: 24px;
  border-top: 1px dashed rgba(250, 204, 21, 0.25);
}

.btn-new-reading {
  font-size: 1.1rem;
  padding: 13px 36px;
  border-radius: 30px;
}

/* Interactive Help Modal Guide */
.help-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 16, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.help-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.help-modal-container {
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, rgba(25, 14, 52, 0.98) 0%, rgba(12, 7, 28, 0.99) 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: 26px;
  padding: 32px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.9), 0 0 35px var(--gold-glow);
  position: relative;
  transform: translateY(30px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.help-modal-overlay.open .help-modal-container {
  transform: translateY(0) scale(1);
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(250, 204, 21, 0.3);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.help-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.help-header-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px #facc15);
}

.help-title-group h3 {
  font-family: var(--font-thai-title);
  font-size: 1.55rem;
  color: var(--gold-primary);
  margin-bottom: 3px;
}

.help-title-group p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--gold-light);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

.help-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.help-step-card {
  background: rgba(14, 8, 34, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 18px;
  padding: 20px;
  text-align: left;
  transition: all 0.3s ease;
}

.help-step-card:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(250, 204, 21, 0.15);
  transform: translateY(-2px);
}

.help-step-visual {
  background: rgba(25, 15, 54, 0.7);
  border: 1px dashed rgba(250, 204, 21, 0.25);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  position: relative;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-num-pill {
  position: absolute;
  top: -9px;
  left: 12px;
  background: var(--gold-gradient);
  color: #0b061a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.help-illu-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.illu-icon {
  font-size: 1.6rem;
}

.illu-arrow {
  color: var(--gold-primary);
  font-size: 0.9rem;
}

.illu-badge.topic {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 10px;
}

.help-spread-diagram {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dia-card-box {
  background: rgba(10, 6, 24, 0.8);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 6px 10px;
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.dia-card-box.highlight {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.dia-slot-icon {
  font-size: 0.85rem;
  color: var(--gold-light);
  font-weight: 600;
}

.dia-card-box small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.dia-arrow {
  color: var(--gold-primary);
  font-size: 0.8rem;
}

.help-fan-diagram {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-fan-deck {
  display: flex;
  margin-left: 10px;
}

.mini-card {
  font-size: 1.5rem;
  margin-left: -12px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.mini-card.c1 { transform: rotate(-15deg); }
.mini-card.c2 { transform: rotate(-7deg); }
.mini-card.c3 { transform: rotate(0deg); }
.mini-card.c4 { transform: rotate(7deg); }
.mini-card.c5 { transform: rotate(15deg); }

.mini-hand-tap {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
}

.help-result-diagram {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.dia-result-badge {
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
}

.dia-result-badge.tts {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38bdf8;
  color: #bae6fd;
}

.dia-result-badge.copy {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fde68a;
}

.help-step-card h4 {
  font-family: var(--font-thai-title);
  font-size: 1.15rem;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.help-step-card p {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.help-tips-box {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.3) 0%, rgba(20, 12, 45, 0.7) 100%);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  margin-bottom: 24px;
}

.tips-icon {
  font-size: 1.8rem;
}

.help-tips-box strong {
  display: block;
  font-family: var(--font-thai-title);
  font-size: 1.05rem;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

.help-tips-box p {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.6;
}

.help-modal-footer {
  text-align: center;
}

.btn-modal-start {
  font-size: 1.1rem;
  padding: 13px 40px;
  border-radius: 35px;
}

@media (max-width: 768px) {
  .help-steps-grid {
    grid-template-columns: 1fr;
  }
  .setup-card {
    padding: 20px 18px;
  }
}

/* Deck Back Style Switcher Bar */
.deck-switcher-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--gold-light);
}

.deck-choice-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: all 0.3s ease;
}

.deck-choice-btn.active, .deck-choice-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: rgba(250, 204, 21, 0.15);
}

/* Tarot Stage Area (Velvet Tablecloth) */
.tarot-stage {
  background: #0d081f;
  background: radial-gradient(ellipse at center, #1e133c 0%, #0c081e 100%);
  border: 2px solid var(--border-ornate);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 0 50px rgba(168, 85, 247, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-height: 580px;
  max-width: 100% !important;
  width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.tarot-stage.hidden,
.tarot-stage[style*="display: none"],
.tarot-stage[style*="display:none"] {
  display: none !important;
}

/* ====================================================
   3. REALISTIC SACRED CANDLES (TAROT STAGE)
   ==================================================== */
.side-candle {
  position: absolute;
  top: 18px;
  width: 38px;
  height: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 3;
}

.side-candle.left { left: 24px; }
.side-candle.right { right: 24px; }

/* Warm Ambient Glow Casting Light onto Velvet Tablecloth */
.candle-ambient-glow {
  position: absolute;
  top: -10px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.45) 0%, rgba(250, 204, 21, 0.25) 40%, transparent 75%);
  filter: blur(14px);
  animation: candleGlowBreathe 2s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Flame Wrap & Natural Draft Flickering */
.candle-flame-wrap {
  position: relative;
  width: 16px;
  height: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: bottom center;
  animation: candleFlickerNatural 2.2s ease-in-out infinite;
}

.side-candle.right .candle-flame-wrap {
  animation-duration: 2.5s;
  animation-delay: -0.8s;
}

.flame-outer {
  position: absolute;
  bottom: 0;
  width: 15px;
  height: 26px;
  border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, #ea580c 0%, #f59e0b 55%, #fef08a 100%);
  box-shadow: 0 0 12px #f59e0b, 0 0 24px rgba(234, 88, 12, 0.6);
  filter: blur(0.5px);
}

.flame-inner {
  position: absolute;
  bottom: 1px;
  width: 9px;
  height: 18px;
  border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, #fef08a 20%, #ffffff 100%);
  box-shadow: 0 0 6px #ffffff;
}

.flame-core {
  position: absolute;
  bottom: 0px;
  width: 4px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  opacity: 0.85;
}

.flame-spark {
  position: absolute;
  top: -6px;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: #fef08a;
  box-shadow: 0 0 4px #facc15;
  animation: candleEmberFloat 1.8s ease-out infinite;
}

/* Blackened Wick */
.candle-wick {
  width: 2px;
  height: 7px;
  background: #1c1917;
  border-radius: 1px;
  margin-top: -2px;
  z-index: 1;
}

/* Wax Pillar Body */
.candle-wax-body {
  position: relative;
  width: 18px;
  height: 44px;
  background: linear-gradient(90deg, #2e1065 0%, #581c87 35%, #7e22ce 65%, #3b0764 100%);
  border-radius: 3px 3px 2px 2px;
  box-shadow: inset 1px 0 2px rgba(254, 240, 138, 0.4), inset -1px 0 2px rgba(0, 0, 0, 0.7), 0 3px 8px rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(254, 240, 138, 0.6);
}

.wax-drip {
  position: absolute;
  top: 4px;
  left: 2px;
  width: 3.5px;
  height: 14px;
  background: rgba(168, 85, 247, 0.6);
  border-radius: 2px;
}

/* Ornate Antique Brass Holder */
.candle-holder-brass {
  width: 34px;
  height: 8px;
  background: var(--gold-gradient);
  border-radius: 4px;
  border-top: 1px solid #fef08a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
  margin-top: -1px;
}

@keyframes candleFlickerNatural {
  0% { transform: scale(1) rotate(-1deg); }
  20% { transform: scale(1.05, 0.96) rotate(1.5deg); }
  40% { transform: scale(0.96, 1.04) rotate(-2deg); }
  60% { transform: scale(1.03, 0.98) rotate(1deg); }
  80% { transform: scale(0.98, 1.02) rotate(-0.5deg); }
  100% { transform: scale(1) rotate(-1deg); }
}

@keyframes candleGlowBreathe {
  0% { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1.1); opacity: 0.95; }
}

@keyframes candleEmberFloat {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-16px) translateX(6px) scale(0); opacity: 0; }
}

/* Legacy side-candle override */
/* End of side candle styles */
.old-side-candle-disabled
.side-candle {
  position: absolute;
  top: 30px;
  font-size: 2.2rem;
  pointer-events: none;
  filter: drop-shadow(0 0 15px rgba(250, 204, 21, 0.8));
  animation: flicker 1.8s ease-in-out infinite alternate;
}

.side-candle.left { left: 24px; }
.side-candle.right { right: 24px; }

@keyframes flicker {
  0% { transform: scale(1) rotate(-1deg); opacity: 0.9; }
  50% { transform: scale(1.06) rotate(2deg); opacity: 1; filter: drop-shadow(0 0 22px #facc15); }
  100% { transform: scale(0.96) rotate(-2deg); opacity: 0.85; }
}

.stage-instructions {
  text-align: center;
  margin-bottom: 20px;
  z-index: 2;
}

.stage-instructions h3 {
  font-family: var(--font-thai-title);
  font-size: 1.6rem;
  color: var(--gold-primary);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.stage-instructions p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.action-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  z-index: 2;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #0b061a;
  border: none;
  padding: 14px 36px;
  border-radius: 40px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 25px var(--gold-glow);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary:hover {
  transform: scale(1.06);
  box-shadow: 0 0 35px rgba(250, 204, 21, 0.7);
}

/* Picked Slots Container (Standard & Celtic Cross Layouts) */
.picked-slots-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 30px;
  min-height: 260px;
  z-index: 2;
}

/* Slot Unit: Encapsulates slot box and label in a stable vertical flow */
.slot-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  user-select: none;
}

.slot-box {
  width: 135px;
  height: 215px;
  border: 2px dashed rgba(250, 204, 21, 0.45);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(10, 6, 25, 0.5);
  transition: all 0.3s ease;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}

.slot-box.filled {
  border: none;
  background: transparent;
  box-shadow: none;
}

.slot-label {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--gold-primary);
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  background: rgba(15, 10, 30, 0.88);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 12px;
  padding: 4px 12px;
  max-width: 155px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
  font-family: var(--font-body);
}

.slot-placeholder-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 0 10px;
  font-family: var(--font-body);
}

/* Celtic Cross Layout Grid */
.celtic-cross-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 36px;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 30px;
}

.celtic-cross-layout .slot-box {
  width: 118px;
  height: 188px;
}

.celtic-cross-layout .card-wrapper {
  width: 100%;
  height: 100%;
}

.celtic-cross-layout .slot-label {
  font-size: 0.78rem;
  padding: 3px 10px;
  max-width: 135px;
}

/* Celtic Cross Main Structure (Cross Formation) */
.celtic-cross-main {
  display: grid;
  grid-template-columns: 125px auto 125px;
  grid-template-rows: auto auto auto;
  gap: 16px 20px;
  align-items: center;
  justify-items: center;
}

.celtic-pos-5 {
  grid-column: 2;
  grid-row: 1;
}

.celtic-pos-4 {
  grid-column: 1;
  grid-row: 2;
}

.celtic-pos-center {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

.celtic-pos-6 {
  grid-column: 3;
  grid-row: 2;
}

.celtic-pos-3 {
  grid-column: 2;
  grid-row: 3;
}

/* Celtic Staff Column (Vertical Ladder on the Right) */
.celtic-staff-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
  border-left: 1px dashed rgba(250, 204, 21, 0.25);
  padding-left: 28px;
}

/* Deck Status Bar */
.deck-status-bar {
  margin-bottom: 16px;
  font-size: 1rem;
  color: var(--gold-primary);
  z-index: 2;
  font-family: var(--font-body);
}

/* Shuffling Deck Stage Animation Overlay */
.shuffle-stage-overlay {
  position: relative;
  width: 160px;
  height: 240px;
  margin: 20px 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 5;
}

.shuffle-card-stack {
  position: absolute;
  width: 130px;
  height: 210px;
  background: linear-gradient(135deg, #1e133c 0%, #0c081e 100%);
  border: 2px solid var(--gold-primary);
  border-radius: 12px;
  box-shadow: 0 0 20px var(--purple-glow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shuffle-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.shuffle-card-stack.left {
  animation: riffleLeft 0.8s ease-in-out infinite;
}

.shuffle-card-stack.right {
  animation: riffleRight 0.8s ease-in-out infinite;
}

@keyframes riffleLeft {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(-60px) rotate(-12deg); }
}

@keyframes riffleRight {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(60px) rotate(12deg); }
}

/* Fan Deck Table Layout (Traditional Arched Fan) */
.fan-table-wrapper {
  width: 100%;
  max-width: 1200px;
  height: 240px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden !important;
  padding-bottom: 20px;
  z-index: 3;
  box-sizing: border-box;
}

.fan-table-deck {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

/* Individual Fan Cards with CSS Variables to preserve base rotation & offset on hover */
.fan-card-item {
  position: absolute;
  width: 95px;
  height: 152px;
  background: linear-gradient(135deg, #1e133c 0%, #0c081e 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: 6px;
  cursor: pointer;
  transform-origin: bottom center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -5px 8px 18px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  
  /* Use CSS variables for position so hover stays in place! */
  transform: translateX(var(--base-tx, 0px)) rotate(var(--base-rot, 0deg));
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.3s ease;
}

.fan-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  border-radius: 4px;
}

/* Hover preserves the card's exact horizontal offset and rotation while lifting smoothly */
.fan-card-item:hover {
  transform: translateX(var(--base-tx, 0px)) rotate(var(--base-rot, 0deg)) translateY(-32px) scale(1.12) !important;
  z-index: 400 !important;
  box-shadow: 0 0 30px var(--gold-primary), 0 0 15px #ffffff;
  border-color: #ffffff;
}

.fan-card-pattern {
  width: 82%;
  height: 86%;
  border: 1px dashed var(--gold-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  pointer-events: none;
}

/* 3D Tarot Card Component in Slots */
.card-wrapper {
  perspective: 1000px;
  width: 100%;
  height: 100%;
  cursor: pointer;
  position: relative;
}

.card-wrapper.just-revealed .card-inner {
  animation: revealGlowPulse 1.2s ease-out;
}

@keyframes revealGlowPulse {
  0% { box-shadow: 0 0 45px #facc15, 0 0 25px #ffffff; }
  100% { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7); }
}

/* ====================================================
   4. GOLDEN STARDUST & AURA BURST (CARD ACTIONS)
   ==================================================== */
.stardust-burst-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 50;
}

.stardust-shock-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid #fef08a;
  box-shadow: 0 0 20px #facc15, inset 0 0 15px #facc15;
  animation: stardustRingExpand 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.stardust-sparkle-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 20%, #fef08a 60%, #f59e0b 100%);
  box-shadow: 0 0 8px #facc15, 0 0 16px #ffffff;
  animation: stardustDotShoot 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stardustRingExpand {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
  }
  100% {
    width: 340px;
    height: 340px;
    opacity: 0;
    border-color: #a855f7;
  }
}

@keyframes stardustDotShoot {
  0% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    transform: translate(calc(-50% + var(--tx, 50px)), calc(-50% + var(--ty, 50px))) scale(0.2);
    opacity: 0;
  }
}

/* Shuffling Vortex Portal Enhancement */
.shuffle-stage-overlay::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.45) 0%, rgba(168, 85, 247, 0.35) 45%, transparent 70%);
  border-radius: 50%;
  animation: shuffleVortexPulse 1.1s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
  filter: blur(14px);
}

@keyframes shuffleVortexPulse {
  0% { transform: scale(0.85) rotate(0deg); opacity: 0.6; }
  100% { transform: scale(1.2) rotate(180deg); opacity: 1; }
}

/* Fan Deck Card Hover Enhancement: Luminous Celestial Rune Glow */
.fan-card-item:hover {
  transform: translateX(var(--base-tx, 0px)) rotate(var(--base-rot, 0deg)) translateY(-32px) scale(1.12) !important;
  z-index: 400 !important;
  box-shadow: 0 0 35px var(--gold-primary), 0 0 20px #ffffff, 0 10px 30px rgba(0, 0, 0, 0.9) !important;
  border-color: #ffffff !important;
}

/* ====================================================
   Card Popup Zoom Reveal Modal
   ==================================================== */
.card-zoom-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 99999 !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(5, 2, 16, 0.86) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
  margin: 0 !important;
  padding: 16px !important;
  box-sizing: border-box !important;

  overflow: hidden !important;
}

.card-zoom-overlay.active {
  opacity: 1;
}

.card-zoom-container {
  display: flex;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  position: relative !important;
  margin: 0 auto !important;
  max-width: 92vw !important;
  box-sizing: border-box !important;

  transform: scale(0.35);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
  will-change: transform, opacity;
}

.card-zoom-overlay.active .card-zoom-container {
  transform: scale(1);
  opacity: 1;
}

.card-zoom-overlay.docking .card-zoom-container {
  transition: transform 0.42s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.38s ease;
}

.zoom-pos-badge {
  background: rgba(250, 204, 21, 0.2);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 20px;
  border-radius: 20px;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.35);
  text-align: center;
}

.zoom-card-3d {
  width: 260px;
  height: 420px;
  perspective: 1200px !important;
  -webkit-perspective: 1200px !important;
  perspective-origin: 50% 50% !important;
  -webkit-perspective-origin: 50% 50% !important;
  transform-origin: center center !important;
  -webkit-transform-origin: center center !important;
  position: relative;
  margin: 0 auto !important;
}

.zoom-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform-origin: center center !important;
  -webkit-transform-origin: center center !important;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 40px var(--gold-glow);
}

.zoom-card-inner.flipped {
  transform: rotateY(180deg);
}

.zoom-card-front, .zoom-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 3px solid var(--gold-primary);
}

.zoom-card-back {
  background: #0c081e;
}

.zoom-card-front {
  transform: rotateY(180deg);
  background: #090617;
  box-shadow: 0 0 35px var(--gold-glow);
}

.zoom-card-front img, .zoom-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zoom-card-info {
  margin-top: 16px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease 0.3s, transform 0.35s ease 0.3s;
}

.zoom-card-info.visible {
  opacity: 1;
  transform: translateY(0);
}

.zoom-card-name {
  font-family: var(--font-title);
  color: var(--gold-primary);
  font-size: 1.35rem;
  margin-bottom: 4px;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

.zoom-card-keywords {
  font-family: var(--font-body);
  color: var(--gold-light);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.zoom-tap-hint {
  font-size: 0.82rem;
  color: rgba(254, 240, 138, 0.75);
  font-style: italic;
  display: inline-block;
  animation: pulseHint 1.6s infinite ease-in-out;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

.card-wrapper.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 6px;
  overflow: hidden;
}

.card-back {
  background: linear-gradient(135deg, #1e133c 0%, #0c081e 100%);
  border: 1.5px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-front {
  transform: rotateY(180deg);
  background: #090617;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 0 25px var(--gold-glow);
}

.card-front img.card-real-img,
.card-back img.card-real-img,
.card-back img.card-back-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.mini-card-thumb {
  width: 54px;
  height: 86px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mini-card-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px var(--gold-primary);
}

.card-front svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reading Result Section */
.result-section {
  margin-top: 40px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(250, 204, 21, 0.05);
  display: none;
  animation: fadeIn 0.8s ease forwards;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.result-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.badge-topic {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(168, 85, 247, 0.3) 100%);
  border: 1px solid #ec4899;
  color: #fbcfe8;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--font-thai-title);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

.badge-spread {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--font-thai-title);
  font-weight: 600;
}

.result-title h2 {
  font-family: var(--font-thai-title);
  font-size: 2rem;
  color: var(--gold-primary);
}

.result-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.result-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tts-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 40px;
  border: 1px solid var(--border-gold);
  flex-wrap: wrap;
}

.tts-voice-wrap,
.tts-speed-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tts-speed-label {
  font-size: 0.85rem;
  color: var(--gold-primary);
  font-family: var(--font-body);
}

/* Copy Reading Button */
.btn-copy-reading {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #fbbf24;
  color: #0b061a;
  padding: 10px 22px;
  border-radius: 30px;
  font-family: var(--font-thai-title);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
  transition: all 0.3s ease;
}

.btn-copy-reading:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.6);
  filter: brightness(1.1);
}

.btn-copy-reading:active {
  transform: translateY(0);
}

.btn-copy-reading.copied {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5);
}

/* Executive Summary Box (Section 1 of Results) */
.summary-result-box {
  background: linear-gradient(135deg, rgba(30, 16, 65, 0.9) 0%, rgba(15, 10, 36, 0.95) 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 36px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(250, 204, 21, 0.08);
  position: relative;
  overflow: hidden;
}

.summary-result-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ec4899, #facc15, #38bdf8, #a855f7);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(250, 204, 21, 0.3);
  padding-bottom: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.summary-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.summary-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px #facc15);
}

.summary-title-group h3 {
  font-family: var(--font-thai-title);
  font-size: 1.5rem;
  color: var(--gold-primary);
  margin-bottom: 2px;
}

.summary-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.btn-listen-summary {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 8px 18px;
  border-radius: 20px;
  font-family: var(--font-thai-title);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

.btn-listen-summary:hover {
  background: var(--gold-gradient);
  color: #0b061a;
  box-shadow: 0 0 15px var(--gold-glow);
  transform: translateY(-1px);
}

.summary-body {
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.85;
  color: #f1f5f9;
  margin-bottom: 20px;
  white-space: pre-line;
}

.summary-body p {
  margin-bottom: 12px;
}

.summary-body strong {
  color: var(--gold-primary);
}

.summary-footer-meta {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--gold-light);
  font-family: var(--font-body);
}

.summary-footer-meta strong {
  color: var(--gold-primary);
  font-size: 1rem;
}

/* Detail Section Header */
.detail-section-header {
  margin-bottom: 22px;
}

.detail-section-header h3 {
  font-family: var(--font-thai-title);
  font-size: 1.6rem;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

.detail-section-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Card Detail Focus Badge & Content */
.topic-focus-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.topic-main-content {
  background: rgba(250, 204, 21, 0.05);
  border-left: 3px solid var(--gold-primary);
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 14px;
  line-height: 1.7;
}

.topic-main-content strong {
  color: var(--gold-primary);
  display: block;
  margin-bottom: 4px;
}

.sub-aspects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.sub-aspect-item {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.55;
  padding-left: 10px;
  border-left: 2px solid rgba(250, 204, 21, 0.3);
}

.sub-aspect-item strong {
  color: var(--gold-light);
}

.other-aspects-toggle {
  background: transparent;
  border: 1px dashed rgba(250, 204, 21, 0.3);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.25s ease;
  width: 100%;
  text-align: center;
}

.other-aspects-toggle:hover {
  background: rgba(250, 204, 21, 0.1);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.other-aspects-panel {
  display: none;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.other-aspects-panel.open {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Toast Notification Popup */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, rgba(30, 16, 60, 0.96) 0%, rgba(15, 10, 36, 0.98) 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: 40px;
  padding: 14px 28px;
  color: #fff;
  font-family: var(--font-thai-title);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7), 0 0 20px var(--gold-glow);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  font-size: 1.4rem;
  animation: crystalGlow 1.5s infinite alternate;
}

.tts-btn {
  background: var(--gold-gradient);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  color: #0b061a;
  box-shadow: 0 0 14px var(--gold-glow);
  transition: transform 0.2s ease;
}

.tts-btn.speaking {
  animation: pulse-speaking 1.2s infinite;
  background: linear-gradient(135deg, #a855f7 0%, #38bdf8 100%);
  color: #fff;
}

@keyframes pulse-speaking {
  0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
  70% { box-shadow: 0 0 0 16px rgba(168, 85, 247, 0); }
  100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

.speed-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  max-width: 240px;
  text-overflow: ellipsis;
}

.speed-select option {
  background: #0f172a;
  color: #fff;
}

.cards-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card-detail-box {
  background: rgba(14, 9, 32, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card-detail-box:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px);
}

.detail-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-card-head .mini-icon {
  font-size: 2.4rem;
}

.detail-card-head h4 {
  font-family: var(--font-thai-title);
  font-size: 1.4rem;
  color: var(--gold-primary);
}

.detail-card-head span {
  font-size: 0.85rem;
  color: var(--gold-light);
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  background: rgba(250, 204, 21, 0.12);
  color: var(--gold-primary);
  border: 1px solid rgba(250, 204, 21, 0.25);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-family: var(--font-body);
}

.reading-content p {
  line-height: 1.65;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-family: var(--font-body);
}

.reading-content strong {
  color: var(--gold-primary);
}

.lucky-info {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px stroke rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
  .celtic-cross-layout {
    flex-direction: column;
    gap: 32px;
  }
  .celtic-staff-column {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-top: 1px dashed rgba(250, 204, 21, 0.25);
    padding-left: 0;
    padding-top: 24px;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .hero-title { font-size: 1.9rem; }
  .hero-subtitle { font-size: 1.1rem; }
  .voice-guide-banner { flex-direction: column; text-align: center; }
  .voice-banner-content { flex-direction: column; }
  .tarot-stage {
    padding: 24px 12px !important;
    min-height: 520px;
  }
  .side-candle {
    display: none !important;
  }
  .stage-instructions h3 {
    font-size: 1.35rem;
    padding: 0 6px;
    line-height: 1.35;
  }
  .action-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .btn-primary {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  .fan-table-wrapper { height: 180px; }
  .fan-card-item { width: 68px; height: 108px; }
  .slot-box { width: 105px; height: 168px; }
  .celtic-cross-layout .slot-box { width: 88px; height: 140px; }
  .zoom-card-3d { width: 210px !important; height: 335px !important; }
  .zoom-card-name { font-size: 1.15rem; }
}

@media (max-width: 500px) {
  .celtic-cross-layout {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 4px !important;
    gap: 20px !important;
  }
  .celtic-cross-main {
    grid-template-columns: minmax(68px, 76px) minmax(136px, 150px) minmax(68px, 76px) !important;
    gap: 8px 4px !important;
    max-width: 100% !important;
    justify-content: center !important;
  }
  .celtic-pos-center {
    gap: 4px !important;
  }
  .celtic-cross-layout .slot-box {
    width: 66px !important;
    height: 105px !important;
    border-radius: 10px !important;
  }
  .celtic-cross-layout .slot-label {
    font-size: 0.62rem !important;
    padding: 2px 4px !important;
    max-width: 72px !important;
    line-height: 1.2 !important;
    word-break: break-word !important;
  }
  .celtic-staff-column {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px 8px !important;
    padding-top: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .celtic-staff-column .slot-box {
    width: 66px !important;
    height: 105px !important;
  }
  .celtic-staff-column .slot-label {
    font-size: 0.62rem !important;
    padding: 2px 4px !important;
    max-width: 72px !important;
  }
  .zoom-card-3d { width: 190px !important; height: 305px !important; }
  .zoom-pos-badge { font-size: 0.85rem; padding: 4px 14px; margin-bottom: 10px; }
  .zoom-card-name { font-size: 1.2rem; }
  .zoom-card-keywords { font-size: 0.82rem; }
}

/* ==========================================================================
   SECURITY & ANTI-THEFT PROTECTION STYLES
   ========================================================================== */
/* Anti-theft: Disable dragging on all images and prevent direct selection */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Card glass overlay to shield direct right-clicks and extraction */
.card-shield-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  pointer-events: none;
  background: transparent;
}

/* Screen Blur Security Shield (Loss of Window Focus / Snipping Tool Deterrent) */
.security-screen-shield {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(7, 6, 18, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease-out;
}

.shield-dialog {
  background: linear-gradient(135deg, rgba(22, 16, 48, 0.95), rgba(12, 8, 28, 0.95));
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(250, 204, 21, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shield-icon {
  font-size: 3.5rem;
  display: inline-block;
  margin-bottom: 12px;
  animation: pulseGlow 2s infinite ease-in-out;
}

.shield-dialog h3 {
  font-size: 1.35rem;
  color: var(--gold-primary);
  margin-bottom: 10px;
  font-family: var(--font-heading);
}

.shield-dialog p {
  font-size: 1rem;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.shield-dialog small {
  display: block;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.shield-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 20px;
}

#btn-dismiss-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  margin: 0 auto;
}

/* ==========================================================================
   LOGIN GATE SCREEN (6-CHAR ACCESS CODE & USER NAME)
   ========================================================================== */
.login-gate-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 30% 20%, rgba(88, 28, 135, 0.45) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(180, 83, 9, 0.35) 0%, transparent 50%),
    linear-gradient(180deg, rgba(7, 6, 18, 0.95) 0%, rgba(19, 13, 42, 0.98) 100%);
  display: flex;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 36px 16px 80px 16px;
  overflow-y: auto;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-gate-screen.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 48px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}

/* Left Pane: Language Switcher (aligned at top with login card) + Tarot Presentation */
.gate-left-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
  max-width: 360px;
}

.gate-lang-capsule {
  margin: 0;
  align-self: center;
}

/* 3D Showcase of Tarot Back Card */
.gate-tarot-presentation {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  perspective: 1200px;
}

.gate-card-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 420px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(250, 204, 21, 0.35) 0%, rgba(168, 85, 247, 0.3) 50%, transparent 75%);
  filter: blur(24px);
  z-index: 1;
  pointer-events: none;
  animation: pulseGlow 4s infinite alternate ease-in-out;
}

.gate-tarot-frame {
  position: relative;
  z-index: 2;
  width: 240px;
  height: 415px;
  aspect-ratio: 825 / 1425;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.85),
    0 0 30px rgba(250, 204, 21, 0.4),
    0 0 0 2px rgba(250, 204, 21, 0.6);
  transform-style: preserve-3d;
  animation: gateCardFloat 6s ease-in-out infinite alternate;
  background: #0d091e;
  padding: 2px;
  box-sizing: border-box;
}

@keyframes gateCardFloat {
  0% { transform: translateY(0px) rotateY(-5deg) rotateX(4deg); }
  50% { transform: translateY(-12px) rotateY(3deg) rotateX(-2deg); }
  100% { transform: translateY(-4px) rotateY(-3deg) rotateX(3deg); }
}

.gate-back-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  border-radius: 4px;
}

.gate-sacred-caption {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  letter-spacing: 0.15em;
  color: var(--gold-light);
  text-shadow: 0 0 10px var(--gold-glow);
}

.gate-sacred-star {
  color: var(--gold-primary);
  animation: spinSlow 12s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Gate Form Card */
.gate-form-card {
  flex: 1;
  max-width: 480px;
  background: var(--bg-glass);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-lg);
  padding: 34px 32px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(168, 85, 247, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 2;
}

.gate-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.gate-mystic-icon {
  font-size: 2.4rem;
  display: inline-block;
  margin-bottom: 8px;
}

.gate-brand-header h2 {
  font-family: var(--font-heading);
  color: var(--gold-primary);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.gate-welcome-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Form inputs */
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gate-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gate-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gate-input-text {
  width: 100%;
  box-sizing: border-box;
  background: rgba(10, 7, 24, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  color: #f8fafc;
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  transition: all 0.25s ease;
}

.gate-input-text:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.35);
  background: rgba(17, 12, 38, 0.95);
}

.code-input-row {
  display: flex;
  gap: 8px;
}

.gate-input-text.code-box {
  flex: 1;
  font-family: 'Cinzel', monospace, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold-light);
  border-width: 2px;
}

.btn-paste-code {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: var(--gold-light);
  border-radius: 10px;
  padding: 0 16px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-paste-code:hover {
  background: rgba(250, 204, 21, 0.25);
  color: #fff;
}

.gate-field-hint {
  font-size: 0.8rem;
  color: #94a3b8;
}

.gate-error-banner {
  background: rgba(225, 29, 72, 0.18);
  border: 1px solid rgba(225, 29, 72, 0.5);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: shakeX 0.4s ease;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.btn-gate-enter {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 6px;
}

/* Quick test codes */
.gate-test-codes {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed rgba(250, 204, 21, 0.2);
}

.test-codes-header {
  font-size: 0.84rem;
  color: var(--gold-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.test-code-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-quick-code {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-quick-code:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: #c084fc;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-quick-code code {
  color: var(--gold-primary);
  font-weight: 700;
  font-family: monospace;
}

.gate-footer-links {
  margin-top: 20px;
  text-align: center;
}

.link-admin-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.86rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s;
  font-family: inherit;
}

.link-admin-btn:hover {
  color: var(--gold-primary);
}

/* ==========================================================================
   USER & ADMIN SESSION BARS
   ========================================================================== */
.user-session-bar,
.admin-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 12, 40, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s ease;
}

.admin-session-bar {
  background: rgba(45, 15, 75, 0.88);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.25);
}

.user-session-left,
.admin-session-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.user-bar-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  color: #e2e8f0;
}

.user-bar-badge.name strong { color: var(--gold-light); }
.user-bar-badge.code strong { color: #67e8f9; font-family: monospace; letter-spacing: 0.08em; }
.user-bar-badge.quota strong { color: #4ade80; }

.admin-bar-crown {
  font-size: 1.25rem;
}

.btn-bar-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-bar-action:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-bar-action.logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}

.btn-bar-action.dash {
  background: var(--gold-gradient);
  color: #0d091e;
  font-weight: 600;
  border: none;
  margin-right: 6px;
}

.btn-bar-action.dash:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-admin-shortcut {
  background: rgba(168, 85, 247, 0.18) !important;
  border-color: rgba(168, 85, 247, 0.45) !important;
  color: #f3e8ff !important;
}

.btn-admin-shortcut:hover {
  background: rgba(168, 85, 247, 0.35) !important;
}

/* ==========================================================================
   MODAL DIALOGS (ADMIN LOGIN, DASHBOARD, LOG DETAIL)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(5, 3, 15, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}

/* Admin Login Dialog */
.admin-login-dialog {
  background: linear-gradient(135deg, rgba(24, 17, 52, 0.98), rgba(13, 9, 32, 0.98));
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(250, 204, 21, 0.2);
}

.admin-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.dialog-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-crown-icon {
  font-size: 2rem;
}

.dialog-title-group h3 {
  font-size: 1.25rem;
  color: var(--gold-primary);
  margin-bottom: 2px;
}

.dialog-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
  border-color: #ef4444;
}

.admin-form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-field label {
  font-size: 0.88rem;
  color: var(--text-main);
}

.admin-text-input {
  background: rgba(10, 7, 24, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 8px;
  padding: 10px 14px;
  color: #f8fafc;
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}

.admin-text-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.admin-text-input.uppercase {
  text-transform: uppercase;
  font-family: 'Cinzel', monospace, sans-serif;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.admin-error-box {
  background: rgba(225, 29, 72, 0.2);
  border: 1px solid rgba(225, 29, 72, 0.5);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fca5a5;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-seed-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 6px;
}

.admin-seed-hint code {
  color: var(--gold-light);
  font-weight: 600;
}

.btn-submit-admin {
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 6px;
}

/* ==========================================================================
   ADMIN DASHBOARD DIALOG (FULL PORTAL)
   ========================================================================== */
.dashboard-dialog-window {
  background: linear-gradient(135deg, rgba(20, 14, 46, 0.98), rgba(10, 7, 26, 0.99));
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-lg);
  max-width: 1180px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(250, 204, 21, 0.2);
  overflow: hidden;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: rgba(12, 8, 30, 0.85);
  border-bottom: 1px solid rgba(250, 204, 21, 0.2);
}

.dashboard-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crown-badge {
  font-size: 2.2rem;
}

.dashboard-identity h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold-primary);
  margin-bottom: 2px;
}

.dashboard-identity p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.role-pill {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-dash-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-dash-icon:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.btn-dash-icon:disabled,
.btn-dash-icon.refreshing {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

/* Dashboard Tabs Bar (Always Visible, Non-Shrinking & Multi-Row Responsive) */
.dashboard-tabs-bar {
  display: flex;
  flex-wrap: wrap; /* Automatically wraps to new line when screen is full or on mobile */
  flex-shrink: 0 !important; /* CRITICAL: Never squish down or vanish under flex container */
  background: rgba(14, 9, 32, 0.98);
  border-bottom: 1px solid rgba(250, 204, 21, 0.25);
  padding: 8px 14px;
  gap: 8px;
  min-height: 48px;
  box-sizing: border-box;
  align-items: center;
  z-index: 10;
}

.dash-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #cbd5e1;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.dash-tab:hover {
  color: #fef08a;
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.4);
  transform: translateY(-1px);
}

.dash-tab.active {
  color: #0b061a !important;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%) !important;
  border-color: #facc15 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.35);
}

.dash-tab.active span {
  color: #0b061a !important;
}

/* Dashboard Body Content */
.dashboard-body-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-pane.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

/* Code Creation Card */
.code-creation-card {
  background: rgba(14, 9, 32, 0.7);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

.code-creation-card h4 {
  color: var(--gold-light);
  font-size: 1.05rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-code-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: 16px;
  align-items: flex-end;
}

.create-creator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: flex-end;
}

.create-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.create-field label {
  font-size: 0.85rem;
  color: var(--text-main);
}

.code-input-with-btn {
  display: flex;
  gap: 6px;
}

.quota-stepper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quota-quick-pills {
  display: flex;
  gap: 4px;
}

.btn-quota-preset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-quota-preset:hover {
  background: rgba(250, 204, 21, 0.2);
  color: var(--gold-light);
  border-color: var(--gold-primary);
}

.btn-add-code {
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Toolbar & Filters */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.search-box-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 7, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 280px;
}

.search-box-wrap input {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  width: 100%;
}

.filter-pills {
  display: flex;
  gap: 6px;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.filter-pill.active {
  background: rgba(250, 204, 21, 0.18);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  font-weight: 600;
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.dash-table thead {
  background: rgba(255, 255, 255, 0.04);
}

.dash-table th {
  padding: 12px 14px;
  color: var(--gold-light);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.dash-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  vertical-align: middle;
}

.dash-table tr:hover td {
  background: rgba(250, 204, 21, 0.03);
}

.dash-code-tag {
  font-family: 'Cinzel', monospace, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-primary);
}

.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.status-badge.used {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-table-action {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn-table-action.delete:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}

.btn-table-action.view {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
}

.btn-table-action.view:hover {
  background: rgba(168, 85, 247, 0.4);
  color: #fff;
}

/* Database Tab styling */
.db-guide-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.db-hero-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  padding: 20px;
}

.db-icon {
  font-size: 2.8rem;
}

.db-hero-card h4 {
  font-size: 1.15rem;
  color: var(--gold-light);
  margin-bottom: 4px;
}

.db-hero-card p {
  font-size: 0.9rem;
  color: #e2e8f0;
}

.db-actions-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-db-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-db-action.sql {
  background: var(--gold-gradient);
  color: #0d091e;
  border: none;
}

.btn-db-action.sql:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-db-action.json {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-db-action.json:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.db-steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.db-step-item {
  background: rgba(14, 9, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
}

.db-step-badge {
  display: inline-block;
  background: rgba(250, 204, 21, 0.15);
  color: var(--gold-primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.db-step-item h5 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.db-step-item p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.db-step-item code {
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 5px;
  border-radius: 4px;
}

/* ==========================================================================
   READING LOG DETAIL DIALOG
   ========================================================================== */
.log-detail-dialog {
  background: linear-gradient(135deg, rgba(22, 16, 48, 0.98), rgba(12, 8, 28, 0.98));
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.log-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 7, 24, 0.8);
}

.log-detail-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.log-detail-summary-card h4,
.log-detail-cards-card h4 {
  color: var(--gold-light);
  font-size: 1rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-text-box {
  background: rgba(10, 7, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #f1f5f9;
  white-space: pre-wrap;
}

.log-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.log-card-item {
  background: rgba(14, 9, 32, 0.8);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.log-card-item img {
  width: 60px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
}

.log-card-item strong {
  font-size: 0.84rem;
  color: var(--gold-primary);
}

.log-card-item small {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.log-detail-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 7, 24, 0.8);
}

/* ==========================================================================
   ADMIN READING LOG STAGE VIEW (FORTUNE TELLING STAGE REPLICA)
   ========================================================================== */
#logs-stage-view {
  animation: fadeIn 0.3s ease;
}

/* Topbar with Back button and Meta strip */
.stage-view-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(14, 9, 32, 0.95);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.btn-back-logs {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  border-radius: 30px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-back-logs:hover {
  background: var(--gold-primary);
  color: #0b061a;
  box-shadow: 0 0 20px var(--gold-glow);
  transform: translateY(-2px);
}

.stage-view-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.stage-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(8, 5, 20, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.stage-meta-icon {
  font-size: 1rem;
}

.stage-meta-label {
  color: #94a3b8;
  font-weight: 500;
}

.stage-meta-val {
  color: var(--gold-light);
  font-weight: 600;
}

/* History Stage Table (Velvet table layout) */
.history-stage-table {
  background: radial-gradient(circle at center, rgba(38, 22, 75, 0.75) 0%, rgba(10, 6, 24, 0.98) 100%);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin-bottom: 28px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.85), 0 16px 45px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: auto;
}

.stage-table-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--gold-light);
  margin-bottom: 6px;
  text-shadow: 0 0 12px var(--gold-glow);
}

.stage-sacred-star {
  color: var(--gold-primary);
  animation: spinSlow 12s linear infinite;
}

.stage-table-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  text-align: center;
}

.history-slots-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Flex spread row for non-celtic spreads */
.history-spread-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}

.history-slots-container .slot-unit {
  cursor: pointer;
  transition: transform 0.25s ease;
}

.history-slots-container .slot-unit:hover {
  transform: translateY(-6px);
}

.history-slots-container .slot-box.filled {
  border: none;
  background: transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  overflow: hidden;
}

.history-card-face {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.45);
  background: #090617;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.history-card-face:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 6px 24px rgba(250, 204, 21, 0.7);
}

.history-card-face img.card-real-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-slots-container .card-wrapper {
  cursor: pointer;
}

.history-slots-container .slot-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 6px 12px;
  max-width: 150px;
  text-align: center;
  border-radius: 8px;
  background: rgba(14, 9, 30, 0.9);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.slot-pos-badge {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.slot-card-name {
  font-size: 0.88rem;
  color: var(--gold-light);
  font-weight: 600;
}

/* History Executive Summary Card */
.history-summary-card {
  background: rgba(18, 12, 40, 0.92);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55);
}

.history-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(250, 204, 21, 0.2);
  padding-bottom: 14px;
}

.history-summary-header h4 {
  font-size: 1.15rem;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

.summary-header-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

#history-summary-text {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #f1f5f9;
  white-space: pre-line;
}

.stage-view-bottom-actions {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed rgba(250, 204, 21, 0.25);
}

@media (max-width: 860px) {
  .stage-view-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .stage-view-meta-strip {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .stage-meta-item {
    width: 100%;
    justify-content: flex-start;
  }
  .history-summary-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .summary-header-btns {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 860px) {
  .login-gate-screen {
    padding: 16px 12px 60px 12px !important;
    overflow-x: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;

  }
  .gate-container {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
  .gate-left-pane {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 14px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
  .gate-lang-capsule {
    align-self: center !important;
    margin-bottom: 2px !important;
  }
  .gate-tarot-presentation {
    width: 100% !important;
    max-width: 220px !important;
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;

  }
  .gate-card-aura {
    width: 200px !important;
    height: 300px !important;
  }
  .gate-tarot-frame {
    width: 150px !important;
    height: 259px !important;
    aspect-ratio: 825 / 1425 !important;
  }
  .gate-sacred-caption {
    font-size: 0.78rem !important;
    letter-spacing: 0.08em !important;
    margin-top: 10px !important;
    justify-content: center !important;
    width: 100% !important;
    box-sizing: border-box !important;

  }
  .gate-form-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 14px !important;
    box-sizing: border-box !important;

    margin: 0 auto !important;
  }
  .gate-brand-header h2 {
    font-size: 1.35rem !important;
  }
  .gate-welcome-text {
    font-size: 0.84rem !important;
  }
  .gate-input-text {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;

    min-width: 0 !important;
  }
  .code-input-row {
    width: 100% !important;
    display: flex;
    gap: 8px !important;
    box-sizing: border-box !important;

  }
  .gate-input-text.code-box {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    font-size: 1.15rem !important;
    letter-spacing: 0.16em !important;
    padding: 10px 8px !important;
    box-sizing: border-box !important;

  }
  .btn-paste-code {
    flex: 0 0 65px !important;
    width: 65px !important;
    padding: 0 !important;
    font-size: 0.84rem !important;
    box-sizing: border-box !important;

  }
  .gate-footer-links {
    display: flex;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;

    margin-top: 14px !important;
  }
  .link-video-btn,
  .link-querent-btn {
    width: 100% !important;
    justify-content: center !important;
    margin-right: 0 !important;
    font-size: 0.8rem !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;

    border-radius: 20px !important;
  }
  .link-admin-btn {
    font-size: 0.8rem !important;
    margin-top: 4px !important;
  }
  .featured-reviews-showcase {
    margin: 24px auto 16px auto !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;

  }
  .reviews-showcase-title {
    font-size: 1.05rem !important;
    margin-bottom: 14px !important;
  }
  .reviews-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;

  }
  .review-card {
    width: 100% !important;
    box-sizing: border-box !important;

    padding: 14px 14px !important;
  }
  .review-card-stars {
    font-size: 0.92rem !important;
    flex-shrink: 0 !important;
  }
  .review-author-name {
    font-size: 0.85rem !important;
  }
  .review-comment {
    font-size: 0.82rem !important;
  }
  .create-code-grid,
  .create-creator-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .dashboard-tabs-bar {
    padding: 8px 10px;
    gap: 6px;
  }
  .dash-tab {
    flex: 1 1 calc(50% - 6px); /* Wraps to 2 items per line on mobile */
    min-width: 130px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }
  .dashboard-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   VIDEO TUTORIAL MODAL & BUTTONS
   ========================================================================== */

/* Header & Nav Action Button */
.btn-video-highlight {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22) 0%, rgba(168, 85, 247, 0.28) 100%) !important;
  border: 1px solid rgba(244, 114, 182, 0.55) !important;
  color: #fce7f3 !important;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.25);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-video-highlight:hover {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 0 24px rgba(236, 72, 153, 0.65);
  transform: translateY(-2px);
}

/* Login Gate Link Button */
.link-video-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(234, 179, 8, 0.18));
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: var(--gold-light, #fef08a);
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  margin-right: 12px;
}

.link-video-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.38), rgba(234, 179, 8, 0.38));
  border-color: var(--gold-primary, #facc15);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.35);
}

/* Callout inside Help Modal */
.help-video-callout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.16) 0%, rgba(234, 179, 8, 0.12) 100%);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 22px;
  gap: 16px;
}

.help-video-callout .callout-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-video-callout .callout-icon {
  font-size: 1.8rem;
}

.help-video-callout strong {
  display: block;
  color: var(--gold-light, #fef08a);
  font-size: 0.96rem;
  margin-bottom: 2px;
}

.help-video-callout p {
  color: var(--text-muted, #94a3b8);
  font-size: 0.84rem;
  margin: 0;
}

.btn-callout-watch {
  flex-shrink: 0;
  padding: 8px 16px !important;
  font-size: 0.88rem !important;
  border-radius: 20px !important;
}

/* Video Modal Overlay */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.video-modal-container {
  max-width: 880px;
  width: 100%;
  background: linear-gradient(135deg, rgba(25, 14, 52, 0.98) 0%, rgba(12, 7, 28, 0.99) 100%);
  border: 1.5px solid var(--gold-primary, #facc15);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.9), 0 0 35px rgba(250, 204, 21, 0.35);
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-modal-overlay.open .video-modal-container {
  transform: translateY(0) scale(1);
}

.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(250, 204, 21, 0.25);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.video-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.video-header-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.4));
}

.video-title-group h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--gold-light, #fef08a);
  margin: 0 0 4px 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.video-title-group p {
  font-size: 0.86rem;
  color: var(--text-muted, #94a3b8);
  margin: 0;
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(250, 204, 21, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
}

.video-player-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.video-modal-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.video-footer-tip {
  font-size: 0.86rem;
  color: var(--gold-light, #fef08a);
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-footer-tip .tip-star {
  color: var(--gold-primary, #facc15);
}

@media (max-width: 640px) {
  .help-video-callout {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-callout-watch {
    width: 100%;
  }
  .video-modal-container {
    padding: 16px;
  }
  .video-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   VIDEO BUFFERING & PROGRESS OVERLAY
   ========================================================================== */

.video-loader-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 18, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  border-radius: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.video-loader-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.loader-mystic-orb {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.loader-mystic-orb .orb-icon {
  font-size: 2.8rem;
  z-index: 2;
  animation: orbFloat 2s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.65));
}

.loader-mystic-orb .orb-glow-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(250, 204, 21, 0.55);
  animation: orbRotate 6s linear infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.06); }
}

@keyframes orbRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-status-text {
  font-family: 'Kanit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-light, #fef08a);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.loader-progress-track {
  width: 82%;
  max-width: 440px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 30px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.loader-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ec4899 0%, #a855f7 50%, #facc15 100%);
  border-radius: 30px;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.85);
  transition: width 0.15s ease-out;
}

.loader-stats-row {
  display: flex;
  justify-content: space-between;
  width: 82%;
  max-width: 440px;
  margin-bottom: 14px;
}

.loader-percent-badge {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-primary, #facc15);
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
  font-family: 'Cinzel', sans-serif;
}

.loader-size-badge {
  font-size: 0.88rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.loader-tip-hint {
  font-size: 0.82rem;
  color: rgba(254, 240, 138, 0.9);
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 20px;
  padding: 6px 14px;
  max-width: 90%;
}

/* Floating Buffering Pill */
.video-buffering-pill {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 7, 30, 0.94);
  border: 1px solid var(--gold-primary, #facc15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85), 0 0 14px rgba(250, 204, 21, 0.45);
  color: var(--gold-light, #fef08a);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 500;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.buffering-spin {
  display: inline-block;
  animation: spinSlow 2s linear infinite;
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   3-TIER RBAC, FIFO 99 BANNER & QUERENT PORTAL STYLES
   ========================================================================== */

/* Querent Nav & Gate Buttons */
.btn-querent-highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(168, 85, 247, 0.25) 100%) !important;
  border: 1px solid rgba(96, 165, 250, 0.55) !important;
  color: #bfdbfe !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.25);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-querent-highlight:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
}

.link-querent-btn {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(168, 85, 247, 0.16));
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #bfdbfe;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  margin-right: 12px;
}

.link-querent-btn:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(168, 85, 247, 0.35));
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

/* FIFO 99 Info Banner in Admin Logs */
.logs-fifo-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.14) 0%, rgba(168, 85, 247, 0.12) 100%);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 16px;
}

.fifo-icon {
  font-size: 1.8rem;
}

.fifo-text strong {
  display: block;
  color: var(--gold-light, #fef08a);
  font-size: 0.94rem;
  margin-bottom: 2px;
}

.fifo-text p {
  color: var(--text-muted, #94a3b8);
  font-size: 0.82rem;
  margin: 0;
}

/* Querent Code Search Box in Dashboard */
.querent-code-search-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.search-instructions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.search-instructions .search-icon {
  font-size: 1.8rem;
}

.search-instructions h4 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light, #fef08a);
  margin: 0 0 4px 0;
  font-size: 1.05rem;
}

.search-instructions p {
  color: var(--text-muted, #94a3b8);
  font-size: 0.84rem;
  margin: 0;
}

.code-search-input-row {
  display: flex;
  gap: 12px;
  max-width: 480px;
}

/* Querent Direct Modal Dialog */
.querent-lookup-dialog {
  max-width: 600px;
  width: 100%;
}

.querent-lookup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.querent-results-container {
  margin-top: 12px;
  max-height: 380px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.querent-results-container h4 {
  color: var(--gold-light, #fef08a);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.querent-result-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.querent-result-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold-primary, #facc15);
  transform: translateY(-1px);
}

.querent-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.querent-card-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
}

.querent-card-sub {
  color: var(--text-muted, #94a3b8);
  font-size: 0.8rem;
}

.btn-open-result {
  flex-shrink: 0;
  padding: 8px 14px !important;
  font-size: 0.85rem !important;
  border-radius: 18px !important;
}

.role-tag-admin {
  background: rgba(234, 179, 8, 0.2) !important;
  border: 1px solid rgba(250, 204, 21, 0.4) !important;
  color: #facc15 !important;
}

.role-tag-supervisor {
  background: rgba(168, 85, 247, 0.2) !important;
  border: 1px solid rgba(168, 85, 247, 0.4) !important;
  color: #d8b4fe !important;
}

.role-tag-querent {
  background: rgba(59, 130, 246, 0.2) !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  color: #93c5fd !important;
}


/* ==========================================================================
   ROADMAP EXPANSIONS: REVERSED CARDS, SOCIAL SHARE IMAGE & HAPTIC ACTIONS
   ========================================================================== */

/* Reversed Cards Toggle in Step 2 */
.reversed-cards-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(30, 27, 75, 0.4) 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 16px;
  padding: 14px 20px;
  margin-top: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.switch-control {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.switch-control input:checked + .switch-slider {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-color: #f472b6;
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(24px);
}

.switch-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-title {
  color: var(--gold-light, #fef08a);
  font-weight: 600;
  font-size: 0.96rem;
}

.switch-desc {
  color: var(--text-muted, #94a3b8);
  font-size: 0.82rem;
}

/* 3D Reversed Card Visuals */
.card-reversed .card-front img,
.card-reversed img.card-real-img {
  transform: rotate(180deg) !important;
}

.card-reversed-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(220, 38, 38, 0.25) 100%);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fde047;
  font-size: 0.76rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

/* Action Pills for Share & Save */
.btn-save-image {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: 1px solid #34d399 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

.btn-save-image:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45) !important;
}

.btn-share-line {
  background: #06c755 !important;
  color: #ffffff !important;
  border: 1px solid #00b900 !important;
  box-shadow: 0 4px 14px rgba(6, 199, 85, 0.35) !important;
}

.btn-share-line:hover {
  background: #05ad4a !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(6, 199, 85, 0.45) !important;
}

/* Social Share Image Modal */
.share-image-dialog {
  max-width: 520px;
  width: 95%;
  background: linear-gradient(135deg, rgba(20, 12, 42, 0.98) 0%, rgba(10, 5, 24, 0.99) 100%);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(168, 85, 247, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.share-dialog-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-image-body {
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
}

.share-image-preview-wrap {
  max-height: 520px;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.share-image-preview-wrap img {
  display: block;
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.share-image-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}


/* ==========================================================================
   BULK CODE DELETION & CODE CREATED SUCCESS POPUP STYLES
   ========================================================================== */

/* Bulk Action Buttons & Toolbar */
.bulk-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.bulk-select-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #ffffff !important;
  border: 1px solid #ef4444 !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35) !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.45) !important;
}

.btn-danger:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

.btn-sm {
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
}

.btn-text {
  background: none !important;
  border: none !important;
  color: #94a3b8 !important;
  cursor: pointer;
  text-decoration: underline;
}

.btn-text:hover {
  color: #ffffff !important;
}

/* Custom Table Checkbox */
.code-checkbox, #check-all-codes {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #facc15;
  vertical-align: middle;
}

tr.row-selected {
  background: rgba(250, 204, 21, 0.1) !important;
}

/* Code Created Success Dialog */
.code-created-dialog {
  max-width: 480px;
  width: 92%;
  background: linear-gradient(135deg, rgba(22, 12, 46, 0.98) 0%, rgba(12, 6, 28, 0.99) 100%);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 30px rgba(250, 204, 21, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* ==========================================================================
   SYSTEM CHANGELOG & USER INTERACTION AUDIT STYLES
   ========================================================================== */

/* Sub-segment switch in Tab 4 */
.updates-subnav {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 14px;
}

.subnav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted, #94a3b8);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subnav-btn:hover {
  background: rgba(250, 204, 21, 0.1);
  color: #ffffff;
  border-color: rgba(250, 204, 21, 0.4);
}

.subnav-btn.active {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  color: #fde047;
  border-color: #facc15;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.2);
}

/* Version Hero Card */
.version-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.version-hero-badge {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0b051a;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 6px 16px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* Changelog Timeline */
.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.changelog-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 20px 24px;
  transition: all 0.2s ease;
}

.changelog-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(250, 204, 21, 0.3);
  transform: translateY(-2px);
}

.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.changelog-title-group h4 {
  margin: 0;
  color: #fef08a;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.changelog-date {
  color: #94a3b8;
  font-size: 0.85rem;
}

.changelog-list {
  margin: 0;
  padding-left: 20px;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.7;
}

.changelog-list li {
  margin-bottom: 4px;
}

/* Interaction Feed */
.interaction-feed-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.interaction-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 580px;
  overflow-y: auto;
  padding-right: 6px;
}

.interaction-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.interaction-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(250, 204, 21, 0.25);
}

.interaction-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}

.interaction-content {
  flex: 1;
}

.interaction-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.interaction-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
}

.interaction-time {
  color: #94a3b8;
  font-size: 0.8rem;
}

.interaction-details {
  color: #cbd5e1;
  font-size: 0.86rem;
  margin: 0;
}

/* ==========================================================================
   BGM PLAYER CAPSULE & CONTROLS (v2.7.3)
   ========================================================================== */
.bgm-player-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 12, 44, 0.7);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 30px;
  padding: 3px 8px 3px 3px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(168, 85, 247, 0.15);
  transition: all 0.3s ease;
}

.bgm-player-capsule:hover {
  border-color: rgba(250, 204, 21, 0.75);
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.25);
}

.btn-bgm-pill {
  padding: 6px 10px !important;
  font-size: 0.82rem !important;
  border-radius: 20px !important;
  background: rgba(250, 204, 21, 0.12) !important;
  border: 1px solid rgba(250, 204, 21, 0.35) !important;
  white-space: nowrap;
}

.btn-bgm-pill.active-bgm {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%) !important;
  border-color: #c084fc !important;
  color: #ffffff !important;
  animation: pulseBgmGlow 2s infinite ease-in-out;
}

@keyframes pulseBgmGlow {
  0%, 100% {
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
  }
  50% {
    box-shadow: 0 0 22px rgba(250, 204, 21, 0.75), 0 0 15px rgba(168, 85, 247, 0.8);
  }
}

.bgm-select-wrap {
  display: flex;
  align-items: center;
}

.bgm-track-select {
  background: rgba(14, 7, 28, 0.95);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 16px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  max-width: 140px;
}

.bgm-track-select:hover, .bgm-track-select:focus {
  border-color: #facc15;
  background: rgba(25, 12, 50, 0.98);
}

.bgm-volume-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
}

.bgm-vol-icon {
  font-size: 0.82rem;
  opacity: 0.85;
}

.bgm-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 50px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.bgm-volume-slider:hover {
  background: rgba(250, 204, 21, 0.4);
}

.bgm-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #facc15;
  border: 1.5px solid #1e1038;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.8);
}

.bgm-volume-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #facc15;
  border: 1.5px solid #1e1038;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.8);
}

@media (max-width: 768px) {
  .nav-actions {
    gap: 6px;
    width: 100%;
    justify-content: center;
  }
  .btn-icon {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  .bgm-player-capsule {
    width: 100%;
    justify-content: space-between;
    padding: 5px 8px;
  }
  .bgm-track-select {
    max-width: 150px;
    font-size: 0.75rem;
  }
  .bgm-volume-slider {
    width: 45px;
  }
}

/* ==========================================================================
   USER FEEDBACK & STAR RATING POPUP STYLES (v2.8.0)
   ========================================================================== */
.feedback-dialog {
  max-width: 520px;
  width: 95%;
  background: linear-gradient(135deg, rgba(20, 12, 42, 0.98) 0%, rgba(10, 5, 24, 0.99) 100%);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 30px rgba(168, 85, 247, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: feedbackModalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes feedbackModalPop {
  0% { transform: scale(0.85) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.feedback-dialog-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(250, 204, 21, 0.04);
}

.feedback-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feedback-crown-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #facc15;
}

.feedback-header-title h3 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: #fef08a;
}

.feedback-header-title p {
  margin: 3px 0 0 0;
  font-size: 0.84rem;
  color: #94a3b8;
}

.feedback-dialog-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Star Rating Section */
.star-rating-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 6px 0;
}

.star-rating-label {
  font-size: 0.9rem;
  color: #cbd5e1;
  font-weight: 500;
}

.star-rating-stars {
  display: flex;
  gap: 8px;
  user-select: none;
}

.fb-star {
  font-size: 2.5rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
}

.fb-star:hover,
.fb-star.hovered {
  color: #fef08a;
  transform: scale(1.22);
  text-shadow: 0 0 15px rgba(250, 204, 21, 0.8);
}

.fb-star.active {
  color: #facc15;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

.star-rating-desc {
  font-size: 0.92rem;
  color: #fde047;
  font-weight: 500;
  min-height: 22px;
  text-align: center;
  transition: all 0.2s ease;
}

/* Quick Tag Chips */
.feedback-quick-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-tag-label {
  font-size: 0.82rem;
  color: #94a3b8;
}

.fb-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fb-quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 18px;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-family: inherit;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-quick-chip:hover {
  background: rgba(250, 204, 21, 0.18);
  border-color: #facc15;
  color: #fef08a;
  transform: translateY(-1px);
}

/* Feedback Textarea */
.feedback-textarea-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-textarea-wrap label {
  font-size: 0.84rem;
  color: #cbd5e1;
}

.feedback-textarea {
  background: rgba(14, 7, 28, 0.95);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #f8fafc;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: all 0.2s;
}

.feedback-textarea:focus {
  border-color: #facc15;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
}

.feedback-char-count {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #64748b;
}

.feedback-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.btn-secondary,
#btn-cancel-feedback {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(250, 204, 21, 0.3) !important;
  padding: 10px 22px !important;
  border-radius: 40px !important;
  font-family: var(--font-body) !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.btn-secondary:hover,
#btn-cancel-feedback:hover {
  background: rgba(250, 204, 21, 0.16) !important;
  color: #fef08a !important;
  border-color: rgba(250, 204, 21, 0.7) !important;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.35) !important;
  transform: translateY(-2px) !important;
}

.btn-secondary:active,
#btn-cancel-feedback:active {
  transform: scale(0.97) !important;
}

/* Admin Dashboard Feedback Tab Styling */
.feedbacks-panel-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 0;
}

.feedback-stats-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.fb-stat-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.fb-stat-item.highlight {
  border-color: rgba(250, 204, 21, 0.4);
  background: rgba(250, 204, 21, 0.06);
}

.fb-stat-icon {
  font-size: 2rem;
}

.fb-stat-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: #facc15;
  font-family: 'Cinzel', serif;
}

.fb-stat-lbl {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 2px;
}

.feedback-info-notice {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #bae6fd;
  line-height: 1.5;
}

.fb-filter-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-filter-pill:hover,
.fb-filter-pill.active {
  background: #facc15;
  color: #0b061a;
  border-color: #facc15;
  font-weight: 600;
}

/* Feature Toggle Switch in Table */
.toggle-featured-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.toggle-featured-btn.featured {
  background: rgba(250, 204, 21, 0.2);
  border-color: #facc15;
  color: #fef08a;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.25);
}

.toggle-featured-btn:hover {
  transform: scale(1.05);
}

/* Featured Reviews Showcase (Landing Page & Result Page) */
.featured-reviews-showcase {
  max-width: 960px;
  width: 100%;
  margin: 44px auto 24px auto;
  padding: 0 16px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.reviews-showcase-title {
  text-align: center;
  font-family: 'Cinzel', 'Kanit', serif;
  font-size: 1.25rem;
  color: #fef08a;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.reviews-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
}

.review-card {
  background: linear-gradient(135deg, rgba(26, 14, 52, 0.85) 0%, rgba(14, 8, 30, 0.95) 100%);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.3s ease;
}

.review-card:hover {
  transform: translateY(-3px);
  border-color: rgba(250, 204, 21, 0.7);
  box-shadow: 0 8px 25px rgba(250, 204, 21, 0.2);
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.review-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(20, 14, 46, 0.95);
  border: 2px solid rgba(250, 204, 21, 0.65);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.review-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  transition: transform 0.3s ease;
}

.review-card:hover .review-avatar {
  border-color: #facc15;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.6);
}

.review-card:hover .review-avatar-img {
  transform: scale(1.1);
}

.review-author-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #f8fafc;
}

.review-card-stars {
  color: #facc15;
  font-size: 1rem;
  letter-spacing: 2px;
}

.review-topic-tag {
  font-size: 0.76rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  display: inline-block;
  align-self: flex-start;
}

.review-comment-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  font-style: italic;
  margin: 0;
}

.review-card-footer {
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

/* Result Section Featured Reviews */
.result-featured-reviews-wrap {
  margin: 32px 0 20px 0;
  padding: 24px;
  background: rgba(18, 9, 36, 0.6);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 18px;
}

.result-reviews-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.reviews-sparkle {
  font-size: 1.8rem;
}

.result-reviews-header h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #fef08a;
  font-family: 'Cinzel', serif;
}

.result-reviews-header p {
  margin: 2px 0 0 0;
  font-size: 0.84rem;
  color: #94a3b8;
}

.result-reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

/* Rate reading button in result actions */
.btn-rate-reading {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
  color: #ffffff !important;
  border: 1px solid #fbbf24 !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
}

.btn-rate-reading:hover {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45) !important;
}


/* ============================================================================
   GYPSY MYSTIC TAROT - MULTILINGUAL SWITCHER & CARD LIBRARY STYLES (v2.9.2)
   ============================================================================ */

/* --- 1. Language Selector Capsule (🌐 ภาษา, language: 🇹🇭 🇬🇧 🇨🇳) --- */
.lang-selector-capsule {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(18, 12, 38, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 9999px;
  padding: 3px 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45), inset 0 0 10px rgba(250, 204, 21, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  user-select: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.lang-selector-capsule:hover {
  border-color: rgba(250, 204, 21, 0.8);
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.25);
}

.lang-selector-capsule.mini {
  padding: 2px 6px;
  gap: 4px;
}

.lang-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #facc15;
  letter-spacing: 0.3px;
  margin-right: 2px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}

.lang-btn:hover {
  background: rgba(250, 204, 21, 0.15);
  color: #fef08a;
  border-color: rgba(250, 204, 21, 0.3);
}

.lang-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0c0a1a;
  font-weight: 800;
  border-color: #fef08a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.55);
}

/* Gate Screen Top Bar */
.gate-top-bar {
  width: 100%;
  max-width: 960px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 4px 6px;
  z-index: 10;
}

.btn-gate-library-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 20, 60, 0.8);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: #fef08a;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-gate-library-top:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  border-color: #facc15;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.25);
}

.btn-library-highlight {
  border: 1px solid rgba(250, 204, 21, 0.45) !important;
  background: rgba(30, 18, 65, 0.85) !important;
  color: #fef08a !important;
}

.btn-library-highlight:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(147, 51, 234, 0.3) 100%) !important;
  border-color: #facc15 !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4) !important;
}

.link-library-btn {
  background: rgba(45, 25, 90, 0.65);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fef08a;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.link-library-btn:hover {
  background: rgba(250, 204, 21, 0.15);
  border-color: #facc15;
  transform: translateY(-1px);
}

/* --- 2. Main Card Library Dialog Modal --- */
.card-library-dialog {
  background: linear-gradient(180deg, #120c2b 0%, #090616 100%);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 20px;
  width: 95vw;
  max-width: 1240px;
  height: 92vh;
  max-height: 960px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(168, 85, 247, 0.15);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.card-library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(18, 12, 38, 0.95);
  border-bottom: 1px solid rgba(250, 204, 21, 0.2);
}

.library-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 8px rgba(250, 204, 21, 0.4));
}

.library-header-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1.3;
}

.library-header-title p {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin: 3px 0 0 0;
}

.library-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-library-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Custom Scrollbar for Library */
.card-library-body::-webkit-scrollbar {
  width: 8px;
}
.card-library-body::-webkit-scrollbar-track {
  background: rgba(10, 6, 25, 0.5);
}
.card-library-body::-webkit-scrollbar-thumb {
  background: rgba(250, 204, 21, 0.35);
  border-radius: 4px;
}
.card-library-body::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 204, 21, 0.6);
}

/* --- 3. Tarot Origins Banner Section --- */
.tarot-origins-section {
  background: linear-gradient(135deg, rgba(30, 20, 60, 0.85) 0%, rgba(20, 12, 45, 0.9) 100%);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.origins-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(250, 204, 21, 0.08);
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.origins-banner-header:hover {
  background: rgba(250, 204, 21, 0.15);
}

.origins-lead {
  display: flex;
  align-items: center;
  gap: 8px;
}

.origins-star {
  font-size: 1.2rem;
}

.origins-heading {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fef08a;
}

.btn-toggle-origins {
  background: rgba(10, 6, 25, 0.6);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #fde047;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.origins-content-collapse {
  padding: 16px 20px;
  border-top: 1px solid rgba(250, 204, 21, 0.15);
  background: rgba(15, 10, 32, 0.95);
  animation: fadeIn 0.2s ease-out;
}

.origins-nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.origins-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.origins-tab:hover {
  background: rgba(250, 204, 21, 0.12);
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.35);
}

.origins-tab.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(147, 51, 234, 0.25) 100%);
  color: #fef08a;
  border-color: #facc15;
  font-weight: 700;
}

.origins-art-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #facc15;
  margin: 0 0 8px 0;
}

.origins-art-p {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.65;
  margin: 0 0 12px 0;
}

.origins-highlight-box {
  background: rgba(250, 204, 21, 0.08);
  border-left: 3px solid #facc15;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: #fef08a;
  line-height: 1.5;
}

.major-journey-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.journey-pill {
  background: rgba(30, 20, 55, 0.8);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #fef08a;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
}

.journey-arrow {
  color: #f59e0b;
  font-weight: 800;
}

.four-suits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.suit-desc-card {
  background: rgba(25, 16, 50, 0.65);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 10px;
  padding: 12px;
}

.suit-desc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.suit-icon {
  font-size: 1.4rem;
}

.elem-tag {
  display: inline-block;
  font-size: 0.72rem;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.suit-meaning-text {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.court-ranks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.court-rank-card {
  background: rgba(25, 16, 50, 0.65);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
}

.court-rank-title {
  color: #fef08a;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 4px;
}

.court-rank-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

/* --- 4. Card Library Filter Controls & Search --- */
.card-library-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
}

.lib-filter-btn {
  background: rgba(25, 15, 55, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.25);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.lib-filter-btn:hover {
  background: rgba(250, 204, 21, 0.15);
  color: #fef08a;
  border-color: rgba(250, 204, 21, 0.5);
}

.lib-filter-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0c0a1a;
  font-weight: 800;
  border-color: #fef08a;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45);
}

.library-search-wrap {
  display: flex;
  align-items: center;
  background: rgba(14, 8, 30, 0.9);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 12px;
  padding: 4px 14px;
  gap: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s;
}

.library-search-wrap:focus-within {
  border-color: #facc15;
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.25);
}

.search-glass {
  font-size: 1rem;
  opacity: 0.7;
}

.library-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 0.88rem;
  padding: 8px 0;
}

.library-search-input::placeholder {
  color: #64748b;
}

.library-counter-badge {
  font-size: 0.76rem;
  font-weight: 700;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* --- 5. Cards Grid & Thumbnails --- */
.card-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding-bottom: 20px;
}

.lib-card-item {
  background: linear-gradient(180deg, rgba(28, 18, 58, 0.8) 0%, rgba(16, 10, 36, 0.9) 100%);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s, border-color 0.25s;
  position: relative;
}

.lib-card-item:hover {
  transform: translateY(-5px);
  border-color: #facc15;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(250, 204, 21, 0.3);
}

.lib-card-art-wrap {
  width: 100%;
  aspect-ratio: 9 / 15;
  overflow: hidden;
  position: relative;
  background: #080512;
}

.lib-card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lib-card-item:hover .lib-card-thumbnail {
  transform: scale(1.05);
}

.lib-card-id-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(10, 6, 25, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fef08a;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.lib-card-info {
  padding: 10px 10px 12px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 6px;
}

.lib-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
}

.lib-meta-elem {
  color: #facc15;
  font-weight: 700;
}

.lib-meta-suit {
  color: #94a3b8;
  font-size: 0.66rem;
}

.lib-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  line-height: 1.35;
  min-height: 2.3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-inspect-card {
  width: 100%;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #fde047;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.lib-card-item:hover .btn-inspect-card {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0c0a1a;
  border-color: #fef08a;
}

.library-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: #94a3b8;
}

.empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.6;
}

/* --- 6. Card Deep Detail Inspector Modal --- */
.card-detail-dialog {
  background: linear-gradient(180deg, #130d2e 0%, #0a0618 100%);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 20px;
  width: 95vw;
  max-width: 1080px;
  height: 92vh;
  max-height: 940px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(250, 204, 21, 0.2);
  animation: modalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: rgba(20, 14, 44, 0.95);
  border-bottom: 1px solid rgba(250, 204, 21, 0.2);
}

.detail-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-badge-number {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fef08a;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

.detail-header-info h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fef08a;
  margin: 0;
  letter-spacing: 0.3px;
}

.detail-element-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #facc15;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.25);
  padding: 2px 8px;
  border-radius: 9999px;
}

.card-detail-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden !important;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.card-detail-body::-webkit-scrollbar {
  width: 8px;
}
.card-detail-body::-webkit-scrollbar-thumb {
  background: rgba(250, 204, 21, 0.35);
  border-radius: 4px;
}

/* Left Column: Visual, 3D, Orientation, Lucky */
.detail-visual-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.detail-card-3d-wrap {
  perspective: 1000px;
  width: 210px;
  height: 350px;
}

.detail-card-3d {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(250, 204, 21, 0.25);
  border: 2px solid rgba(250, 204, 21, 0.5);
  background: #090616;
  transition: transform 0.3s ease;
}

.detail-card-3d:hover {
  transform: rotateY(8deg) rotateX(4deg);
}

.detail-card-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.orientation-switcher {
  display: flex;
  gap: 6px;
  background: rgba(14, 8, 30, 0.9);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 4px;
  border-radius: 9999px;
  width: 100%;
  max-width: 250px;
}

.orient-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.orient-btn:hover {
  color: #fef08a;
}

.orient-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0c0a1a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.btn-detail-voice {
  width: 100%;
  max-width: 250px;
  background: rgba(147, 51, 234, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-detail-voice:hover {
  background: rgba(147, 51, 234, 0.35);
  border-color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.detail-lucky-box {
  width: 100%;
  max-width: 250px;
  background: rgba(20, 12, 45, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-around;
}

.lucky-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lucky-icon {
  font-size: 1.2rem;
}

.lucky-text {
  display: flex;
  flex-direction: column;
}

.lucky-label {
  font-size: 0.66rem;
  color: #94a3b8;
}

.lucky-text strong {
  font-size: 0.82rem;
  color: #fef08a;
}

/* Right Column: Content Cards */
.detail-content-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.detail-section-card {
  background: rgba(22, 14, 50, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.section-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(250, 204, 21, 0.15);
}

.sec-icon {
  font-size: 1.15rem;
}

.section-card-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fef08a;
  margin: 0;
  letter-spacing: 0.3px;
}

/* Symbolism ('ในรูปสื่ออะไร') Pills */
.symbolism-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.symbolism-item-pill {
  background: rgba(14, 8, 32, 0.8);
  border: 1px solid rgba(250, 204, 21, 0.18);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}

.symbolism-item-pill:hover {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(22, 12, 48, 0.85);
}

.sym-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fde047;
  font-size: 0.82rem;
  font-weight: 700;
}

.sym-dot {
  color: #f59e0b;
  font-size: 0.75rem;
}

.sym-meaning {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0;
  padding-left: 14px;
}

.detail-narrative {
  font-size: 0.86rem;
  color: #e2e8f0;
  line-height: 1.65;
  margin: 0;
}

/* Aspects Card & Tabs */
.aspect-tabs-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap !important;
  overflow-x: hidden !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 12px;
  width: 100% !important;
  box-sizing: border-box !important;
}

.aspect-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex: 1 1 auto;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
}

.detail-section-card,
.symbolism-item-pill,
.sym-meaning,
.detail-narrative,
.aspect-block-text,
.gypsy-quote-bubble {
  min-width: 0 !important;
  max-width: 100% !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  box-sizing: border-box !important;
}

.aspect-tab:hover {
  background: rgba(250, 204, 21, 0.1);
  color: #fef08a;
}

.aspect-tab.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(147, 51, 234, 0.3) 100%);
  color: #fef08a;
  border-color: #facc15;
  font-weight: 700;
}

.aspect-block-lead {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #facc15;
  font-size: 0.84rem;
  margin-bottom: 6px;
}

.aspect-block-text {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

/* Friendly Gypsy Quote Bubble */
.gypsy-quote-bubble {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.86rem;
  font-style: italic;
  color: #fef08a;
  line-height: 1.6;
}

.gypsy-quote-bubble p {
  margin: 0;
}

/* Detail Footer Navigation */
.detail-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 22px;
  background: rgba(16, 10, 36, 0.95);
  border-top: 1px solid rgba(250, 204, 21, 0.2);
}

.btn-detail-nav {
  background: rgba(25, 15, 55, 0.7);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-detail-nav:hover {
  background: rgba(250, 204, 21, 0.18);
  color: #fef08a;
  border-color: #facc15;
}

.btn-detail-nav.close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-detail-nav.close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

/* --- 7. Responsive Breakpoints for Mobile --- */
@media (max-width: 860px) {
  .card-detail-body {
    grid-template-columns: 1fr !important;
    gap: 18px;
    padding: 16px 18px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .detail-visual-col {
    width: 100%;
  }
  .detail-card-3d-wrap {
    width: 170px;
    height: 280px;
  }
}

@media (max-width: 640px) {
  .card-library-dialog,
  .card-detail-dialog {
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    overflow-x: hidden !important;
  }

  .card-library-header,
  .detail-dialog-header {
    padding: 10px 14px;
    overflow-x: hidden;
  }

  .library-header-title h2,
  .detail-header-info h3 {
    font-size: 1.05rem;
  }

  .card-library-body,
  .card-detail-body {
    padding: 10px 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .detail-dialog-footer {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    overflow-x: hidden;
  }

  .btn-detail-nav {
    flex: 1 1 auto;
    min-width: 90px;
    font-size: 0.75rem;
    padding: 6px 10px;
    justify-content: center;
  }

  .card-library-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .gate-top-bar {
    justify-content: center;
  }
}

/* ==========================================================================
   TAROT CARD ANTI-DOWNLOAD & IMAGE PRESERVATION SHIELD
   Completely prevents right-click saving, drag-and-drop, and mobile touch callouts
   ========================================================================== */
.lib-card-thumbnail,
.detail-card-art,
.gate-back-img,
.tarot-card-face,
.tarot-card-back,
.tarot-card img,
.deck-card-sample img,
.lib-card-art-wrap img {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -khtml-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
  pointer-events: none !important;
}

.lib-card-art-wrap,
.detail-card-3d,
.gate-tarot-frame {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* ====================================================
   MOBILE CARD REVEAL CTA & LOADING OVERLAY STYLES
   ==================================================== */
.card-tap-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.95) 0%, rgba(202, 138, 4, 0.95) 100%);
  border: 1.5px solid #fef08a;
  color: #ffffff;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.85), 0 4px 15px rgba(0, 0, 0, 0.7);
  animation: badgePulseBreath 1.5s infinite ease-in-out;
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@keyframes badgePulseBreath {
  0% { transform: translate(-50%, -50%) scale(0.96); box-shadow: 0 0 12px rgba(250, 204, 21, 0.5); }
  50% { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 28px rgba(250, 204, 21, 0.95), 0 0 12px #ffffff; }
  100% { transform: translate(-50%, -50%) scale(0.96); box-shadow: 0 0 12px rgba(250, 204, 21, 0.5); }
}

.card-wrapper.flipped .card-tap-badge {
  display: none !important;
}

.btn-reveal-all {
  background: linear-gradient(135deg, #7e22ce 0%, #db2777 50%, #ea580c 100%) !important;
  border: 1.5px solid #fef08a !important;
  color: #ffffff !important;
  box-shadow: 0 0 25px rgba(219, 39, 119, 0.6), 0 0 15px rgba(250, 204, 21, 0.5) !important;
  animation: revealBtnPulse 1.8s infinite alternate ease-in-out;
  font-weight: 700;
}

@keyframes revealBtnPulse {
  0% { transform: scale(1); box-shadow: 0 0 18px rgba(219, 39, 119, 0.5); }
  100% { transform: scale(1.05); box-shadow: 0 0 32px rgba(250, 204, 21, 0.8), 0 0 20px #db2777; }
}

.prompt-glow-active {
  color: var(--gold-light);
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
  font-weight: 600;
  animation: promptGlowBlink 2s infinite alternate ease-in-out;
}

@keyframes promptGlowBlink {
  0% { opacity: 0.85; }
  100% { opacity: 1; text-shadow: 0 0 18px #fde047; }
}

.stage-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(12, 8, 28, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.stage-loading-orb {
  font-size: 3.2rem;
  animation: crystalGlow 1.5s infinite alternate;
  margin-bottom: 12px;
}

.stage-loading-title {
  font-family: var(--font-thai-title);
  color: var(--gold-primary);
  font-size: 1.25rem;
  margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
}

.stage-loading-bar-wrap {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.stage-loading-bar {
  position: absolute;
  left: -50%;
  width: 50%;
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 4px;
  animation: stageLoadingProgress 1.4s infinite ease-in-out;
}

@keyframes stageLoadingProgress {
  0% { left: -50%; width: 40%; }
  50% { left: 30%; width: 60%; }
  100% { left: 100%; width: 40%; }
}


/* ==========================================================================
   SACRED MYSTIC INTRO PORTAL (REALISTIC HANDS & CRYSTAL GLASS ORB REVEAL)
   ========================================================================== */
.mystic-intro-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background-color: var(--bg-dark, #070612) !important;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(88, 28, 135, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(180, 83, 9, 0.2) 0%, transparent 40%) !important;
  z-index: 999999 !important;
  display: none !important; /* STRICTLY HIDDEN BY DEFAULT */
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transition: opacity 0.4s ease-out;
  pointer-events: none !important;
}

.mystic-intro-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.intro-canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.btn-skip-intro {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2000005 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  background: rgba(18, 10, 42, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fef08a;
  font-family: var(--font-thai-title);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 12px rgba(250, 204, 21, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.btn-skip-intro:hover {
  background: rgba(30, 16, 70, 0.9);
  border-color: #facc15;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(250, 204, 21, 0.35);
}

.intro-hud {
  position: absolute;
  bottom: 7vh;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #fef08a;
  z-index: 1000000;
  pointer-events: none;
  width: 90%;
  max-width: 540px;
  animation: introHudFloat 2s infinite alternate ease-in-out;
}

@keyframes introHudFloat {
  0% { transform: translate(-50%, 0); }
  100% { transform: translate(-50%, -4px); }
}

.intro-rune-symbol {
  font-size: 2.2rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 15px #facc15);
  animation: introRunePulse 1.8s infinite alternate ease-in-out;
}

@keyframes introRunePulse {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 25px #ec4899); }
}

.intro-welcome-title {
  font-family: var(--font-thai-title);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.5px;
  margin: 0 0 6px 0;
  text-shadow: 0 0 20px rgba(250, 204, 21, 0.7), 0 2px 4px rgba(0, 0, 0, 0.8);
}

.intro-welcome-sub {
  font-size: 0.92rem;
  color: #cbd5e1;
  margin: 0 0 14px 0;
  font-weight: 400;
  letter-spacing: 0.4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.intro-progress-bar-wrap {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.intro-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #ec4899, #8b5cf6, #38bdf8);
  border-radius: 9999px;
  transition: width 0.05s linear;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.8);
}

@media (max-width: 640px) {
  .btn-skip-intro {
    top: 16px;
    right: 16px;
    padding: 5px 12px;
    font-size: 0.75rem;
  }
  .intro-welcome-title {
    font-size: 1.25rem;
  }
  .intro-welcome-sub {
    font-size: 0.82rem;
  }
  .intro-progress-bar-wrap {
    width: 170px;
  }
}

.intro-progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.intro-progress-percent {
  font-family: var(--font-thai-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.8), 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* Sanctuary Smooth Fade-In Transition after Intro */
.sanctuary-fade-in {
  animation: sanctuaryFadeIn 0.6s ease-out forwards !important;
}

@keyframes sanctuaryFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.slots-action-bar {
  display: none;
  justify-content: center;
  align-items: center;
  margin: 18px 0 24px 0;
  z-index: 10;
  width: 100%;
}


/* ==========================================================================
   POFSTUDIO TAROT — SEO Knowledge & Rich FAQ Section
   ========================================================================== */
.gate-brand-header h1.gate-main-heading {
  font-family: var(--font-heading);
  color: var(--gold-primary);
  font-size: 1.55rem;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .gate-brand-header h1.gate-main-heading {
    font-size: 1.3rem !important;
  }
}

.gate-seo-section {
  max-width: 960px;
  width: 100%;
  margin: 36px auto 24px auto;
  padding: 0 16px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.seo-card-container {
  background: rgba(18, 13, 38, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 16px;
  padding: 28px 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.seo-section-header {
  text-align: center;
  margin-bottom: 22px;
}

.seo-badge-star {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde047;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.seo-main-heading {
  font-family: 'Kanit', sans-serif;
  font-size: 1.45rem;
  color: #facc15;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.35;
}

.seo-intro-desc {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.65;
  max-width: 820px;
  margin: 0 auto;
}

.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.seo-feat-item {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.seo-feat-item:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.seo-feat-icon {
  font-size: 1.9rem;
  margin-bottom: 8px;
  line-height: 1;
}

.seo-feat-item h3 {
  font-family: 'Kanit', sans-serif;
  font-size: 1rem;
  color: #fde047;
  margin-bottom: 6px;
  font-weight: 600;
}

.seo-feat-item p {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.seo-faq-wrap {
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  padding-top: 22px;
}

.seo-faq-heading {
  font-family: 'Kanit', sans-serif;
  font-size: 1.15rem;
  color: #fef08a;
  margin-bottom: 14px;
  font-weight: 600;
}

.seo-faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.seo-faq-item[open] {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(255, 255, 255, 0.045);
}

.seo-faq-question {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  user-select: none;
  list-style: none;
}

.seo-faq-question::-webkit-details-marker {
  display: none;
}

.seo-faq-question:hover {
  color: #fde047;
}

.faq-toggle-icon {
  font-size: 0.9rem;
  color: #f59e0b;
  transition: transform 0.2s ease;
}

.seo-faq-item[open] .faq-toggle-icon {
  transform: rotate(180deg);
}

.seo-faq-answer {
  padding: 10px 16px 14px 16px;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.seo-faq-answer p {
  margin: 0;
}

@media (max-width: 768px) {
  .seo-card-container {
    padding: 20px 14px;
  }
  .seo-main-heading {
    font-size: 1.25rem;
  }
  .seo-features-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .seo-faq-question {
    font-size: 0.9rem;
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .seo-features-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   FREE REGISTRATION & ANALYTICS CHARTS (v2.9.17)
   ========================================================================== */

/* --- 1. Gate Screen: Free Quota CTA --- */
.gate-free-quota-box {
  width: 100%;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.free-quota-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.free-quota-divider .divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234, 179, 8, 0.35), transparent);
}

.free-quota-divider .divider-text {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: #94a3b8;
  white-space: nowrap;
  font-family: 'Cinzel', 'Noto Serif Thai', serif;
  text-transform: uppercase;
}

.btn-free-registration {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.85) 0%, rgba(88, 28, 135, 0.8) 50%, rgba(120, 53, 15, 0.75) 100%);
  border: 1px solid rgba(234, 179, 8, 0.45);
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(147, 51, 234, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-free-registration::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-22deg);
  transition: 0.6s;
}

.btn-free-registration:hover::before {
  left: 150%;
}

.btn-free-registration:hover {
  transform: translateY(-2px);
  border-color: #facc15;
  box-shadow: 0 8px 24px rgba(234, 179, 8, 0.35), 0 0 14px rgba(168, 85, 247, 0.3);
  background: linear-gradient(135deg, rgba(46, 16, 101, 0.9) 0%, rgba(107, 33, 168, 0.85) 50%, rgba(146, 64, 14, 0.8) 100%);
}

.free-reg-badge-icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(234, 179, 8, 0.4));
  animation: pulse-free-gift 2.2s infinite ease-in-out;
}

@keyframes pulse-free-gift {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12) rotate(4deg); }
}

.free-reg-text-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.free-reg-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: 0.01em;
  font-family: 'Cinzel', 'Noto Serif Thai', serif;
}

.free-reg-sub {
  font-size: 0.76rem;
  color: #cbd5e1;
  line-height: 1.3;
}

.free-reg-action-arrow {
  color: #facc15;
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}

.btn-free-registration:hover .free-reg-action-arrow {
  transform: translateX(4px) scale(1.2);
}

/* --- 2. Free Registration Modal & OTP Form --- */
.free-register-modal-card {
  max-width: 480px;
  width: 92%;
  border-radius: 18px;
  background: radial-gradient(circle at top, #1e1b4b 0%, #0f172a 60%, #030712 100%);
  border: 1px solid rgba(234, 179, 8, 0.35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(147, 51, 234, 0.25);
}

.free-reg-intro-text {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: center;
}

.form-group-modern {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group-modern label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group-modern .field-hint {
  font-size: 0.74rem;
  color: #94a3b8;
}

.otp-sent-banner {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 16px;
}

.otp-sent-banner .otp-icon {
  font-size: 1.8rem;
}

.otp-sent-banner p {
  color: #94a3b8;
  font-size: 0.84rem;
}

.otp-sent-banner .masked-email {
  color: #38bdf8;
  font-size: 0.98rem;
  font-family: monospace;
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px dashed rgba(56, 189, 248, 0.4);
}

.otp-sent-banner .otp-tip {
  color: #64748b;
  font-size: 0.74rem;
}

.otp-group {
  text-align: center;
}

.otp-group label {
  justify-content: center;
}

.otp-input-container {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.otp-input-box {
  width: 220px;
  font-size: 1.8rem;
  letter-spacing: 0.45rem;
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  color: #facc15;
  background: #090d16;
  border: 2px solid rgba(234, 179, 8, 0.5);
  border-radius: 12px;
  padding: 8px 12px;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 12px rgba(234, 179, 8, 0.2);
  transition: all 0.25s ease;
}

.otp-input-box:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
}

.otp-cooldown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 16px;
  padding: 0 4px;
}

.btn-resend-link {
  background: none;
  border: none;
  color: #38bdf8;
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: underline;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.btn-resend-link:disabled {
  color: #475569;
  cursor: not-allowed;
  text-decoration: none;
}

.btn-resend-link:not(:disabled):hover {
  color: #7dd3fc;
}

.free-reg-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 0;
}

.success-burst-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce-in {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.revealed-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 8px 18px;
  margin: 14px 0;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.magic-code-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.25rem;
  color: #fef08a;
  text-shadow: 0 0 10px rgba(254, 240, 138, 0.5);
}

.btn-copy-pill {
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #facc15;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-copy-pill:hover {
  background: #facc15;
  color: #0f172a;
}

.success-note {
  font-size: 0.82rem;
  color: #a7f3d0;
  line-height: 1.5;
  margin-bottom: 16px;
  background: rgba(6, 78, 59, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
}

.btn-enter-magic {
  width: 100%;
  font-size: 1.05rem;
  padding: 14px;
}

/* --- 3. Admin Dashboard: Free Registrations Analytics (Tab 6) --- */
.free-reg-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.free-kpi-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, border-color 0.2s;
}

.free-kpi-card:hover {
  transform: translateY(-2px);
}

.free-kpi-card.card-total { border-color: rgba(99, 102, 241, 0.35); }
.free-kpi-card.card-verified { border-color: rgba(16, 185, 129, 0.35); }
.free-kpi-card.card-conversion { border-color: rgba(245, 158, 11, 0.35); }
.free-kpi-card.card-countries { border-color: rgba(56, 189, 248, 0.35); }
.free-kpi-card.card-ips { border-color: rgba(236, 72, 153, 0.35); }

.free-kpi-icon {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.free-kpi-info {
  display: flex;
  flex-direction: column;
}

.free-kpi-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.free-kpi-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  font-family: 'Cinzel', monospace, sans-serif;
}

.free-kpi-sub {
  font-size: 0.68rem;
  color: #64748b;
}

/* Charts Grid */
.free-reg-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.free-chart-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.chart-card-timeline {
  grid-column: 1 / -1;
}

.free-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.free-chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.free-chart-title h5 {
  margin: 0;
  font-size: 0.94rem;
  color: #f1f5f9;
  font-weight: 600;
}

.free-chart-tag {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 2px 8px;
  border-radius: 6px;
}

.free-chart-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 200px;
  max-height: 280px;
}

.doughnut-wrap {
  max-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Free Registrations Table & Toolbar */
.free-reg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
}

.status-badge.verified {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.code-pill-tag {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #facc15;
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.otp-pill-tag {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

.ip-text {
  font-family: monospace;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.country-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.country-code-badge {
  font-size: 0.72rem;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-radius: 4px;
  padding: 1px 4px;
  font-family: monospace;
}

@media (max-width: 900px) {
  .free-reg-charts-grid {
    grid-template-columns: 1fr;
  }
}


.free-register-modal-card {
  padding: 0 !important;
  overflow: hidden;
}

.free-register-modal-card .modal-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  width: 100%;
  padding: 18px 20px 12px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.free-register-modal-card .modal-title-with-icon {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px;
  flex: 1;
  text-align: left;
}

.free-register-modal-card .modal-title-with-icon h3 {
  margin: 0 0 4px 0;
  font-size: 1.15rem;
  color: #fef08a;
}

.free-register-modal-card .modal-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.free-register-modal-card .modal-body {
  padding: 18px 20px 22px 20px !important;
  box-sizing: border-box;
}


/* --- Google / Gmail One-Tap Quick Register (v2.9.18) --- */
.google-reg-container {
  width: 100%;
  margin-bottom: 12px;
}

.btn-google-signup {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  color: #3c4043;
  cursor: pointer;
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.22s ease-in-out;
  position: relative;
  box-sizing: border-box;
}

.btn-google-signup:hover {
  background: #f8fafd;
  box-shadow: 0 4px 18px rgba(66, 133, 244, 0.4);
  border-color: #4285f4;
  transform: translateY(-1px);
}

.google-svg-icon {
  flex-shrink: 0;
}

.google-btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.google-main-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1f2937;
}

.google-sub-text {
  font-size: 0.72rem;
  color: #6b7280;
}

.reg-divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px 0;
}

.reg-divider-or .divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.reg-divider-or .divider-label {
  font-size: 0.76rem;
  color: #94a3b8;
  white-space: nowrap;
}

/* Admin Google OAuth Settings Card */
.google-settings-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(66, 133, 244, 0.35);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.google-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.google-settings-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.google-settings-title h5 {
  margin: 0;
  font-size: 0.96rem;
  color: #ffffff;
  font-weight: 700;
}

.google-settings-desc {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.input-action-flex {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.input-action-flex input {
  flex: 1;
}

.google-guide-collapsible {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.82rem;
}

.google-guide-collapsible summary {
  cursor: pointer;
  color: #60a5fa;
  font-weight: 600;
  user-select: none;
}

.guide-steps-list {
  margin-top: 8px;
  color: #94a3b8;
  line-height: 1.6;
}

.guide-steps-list ol {
  margin: 4px 0;
  padding-left: 20px;
}

.guide-steps-list code {
  background: rgba(255, 255, 255, 0.1);
  color: #facc15;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}


/* --- Free Registration Modal Centered Action Buttons (v2.9.20) --- */
.free-register-modal-dialog {
  box-sizing: border-box;
}

.modal-actions-stacked {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin-top: 18px !important;
  gap: 10px !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

#btn-free-reg-submit,
#btn-free-reg-verify,
#btn-free-reg-enter-now {
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  padding: 13px 24px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  box-shadow: 0 4px 18px rgba(250, 204, 21, 0.35) !important;
}

.btn-resend-link,
.btn-text-muted {
  align-self: center !important;
  margin: 4px auto 0 auto !important;
  text-align: center !important;
}
