/**
 * Tarot Reading Web Application - Global Stylesheet
 * -------------------------------------------------------------
 * Theme: Midnight Celestial & Occult Gold
 */

:root {
  --bg-dark: #090615;
  --bg-surface: #130d29;
  --bg-glass: rgba(23, 16, 50, 0.7);
  --bg-glass-border: rgba(212, 175, 55, 0.25);

  --gold-primary: #d4af37;
  --gold-light: #fef08a;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --gold-shadow: rgba(212, 175, 55, 0.15);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --element-fire: #ef4444;
  --element-earth: #10b981;
  --element-air: #38bdf8;
  --element-water: #6366f1;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --font-base: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Thai', sans-serif;
  --font-mystic: 'Cinzel', 'Playfair Display', 'Times New Roman', Georgia, serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-base);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

#mystical-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

.site-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Nav */
.app-header {
  background: rgba(9, 6, 21, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-glass-border);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-symbol {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff, var(--gold-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Common Buttons */
.btn-nav {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 1.02rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.btn-nav:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.btn-gold-primary {
  background: linear-gradient(135deg, #fef08a, var(--gold-primary), #b45309);
  color: #120924;
  border: none;
  font-weight: 700;
  padding: 0.95rem 2.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 20px var(--gold-glow);
  transition: all 0.25s ease;
}

.btn-gold-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.55);
}

.btn-gold-secondary {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-gold-secondary:hover {
  background: rgba(212, 175, 55, 0.25);
  transform: translateY(-1px);
}

/* Main Layout */
.app-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  padding: 2.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.panel-title-center {
  text-align: center;
  margin-bottom: 2rem;
}

.panel-title-center h2 {
  font-size: 1.85rem;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.panel-title-center p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.6;
}

/* Spreads Selector */
.spread-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.spread-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.spread-card:hover {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.05);
  transform: translateY(-2px);
}

.spread-card.active {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.12);
  box-shadow: 0 0 20px var(--gold-shadow);
}

.spread-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.spread-card-header h4 {
  font-size: 1.25rem;
  color: var(--text-primary);
}

.badge-count {
  background: var(--gold-primary);
  color: #120924;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
}

.spread-card-en {
  font-size: 0.95rem;
  color: var(--gold-light);
  opacity: 0.85;
  margin-bottom: 0.6rem;
}

.spread-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Form Settings */
.reading-options-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Deck Mode Selection */
.deck-mode-container {
  margin-bottom: 1.5rem;
}

.options-subheading {
  display: block;
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.deck-mode-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.deck-mode-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.deck-mode-btn:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.5);
  transform: translateY(-2px);
}

.deck-mode-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(120, 53, 15, 0.25) 100%);
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.25), inset 0 0 10px rgba(212, 175, 55, 0.1);
}

.deck-mode-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.deck-mode-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.deck-mode-name {
  font-family: var(--font-thai);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  flex: 1;
}

.deck-mode-btn.active .deck-mode-name {
  color: var(--gold-light);
}

.deck-mode-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.3);
  font-weight: 600;
  white-space: nowrap;
}

.deck-mode-btn.active .deck-mode-badge {
  background: var(--gold-primary);
  color: #120924;
  border-color: var(--gold-light);
}

.deck-mode-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.input-mystic {
  width: 100%;
  padding: 0.95rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-mystic:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-group input {
  accent-color: var(--gold-primary);
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.checkbox-label {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.center-action {
  text-align: center;
}

/* Shuffle Section */
.shuffle-container {
  text-align: center;
  padding: 3rem 1rem;
}

.meditation-message {
  font-size: 1.35rem;
  color: var(--gold-light);
  margin-top: 1.5rem;
  animation: pulse-glow 2s infinite ease-in-out;
}

/* Pick Section */
.pick-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.pick-header .text-muted {
  font-size: 1.12rem;
  color: var(--text-secondary);
}

.pick-counter-badge {
  display: inline-block;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 0.45rem 1.4rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0.6rem 0 0.5rem;
}

.pick-controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.6rem;
}

/* Fan Deck Area - จัดวางสำรับไพ่พอดีหน้าจออัตโนมัติ (Auto-Fit Screen) */
.fan-deck-wrapper {
  position: relative;
  min-height: 320px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  padding: 2.5rem 0.5rem 1.5rem;
}

.fan-deck-container {
  position: relative;
  margin: 0 auto;
  min-height: 280px;
  transition: width 0.3s ease, height 0.3s ease;
}

.fan-card {
  position: absolute;
  width: 95px;
  height: 155px;
  cursor: pointer;
  transform-origin: 50% 80%;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.25s ease, opacity 0.3s ease;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65));
  border-radius: 10px;
  will-change: transform;
}

.fan-card:hover {
  transform: translateY(-50px) scale(1.18) !important;
  z-index: 1200 !important;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 16px var(--gold-primary));
}

.fan-card.picked {
  opacity: 0.15;
  pointer-events: none;
  transform: translateY(50px) scale(0.7) !important;
}

.fan-card svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Table Section */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-header h2 {
  color: var(--gold-light);
  font-size: 1.75rem;
}

.table-header .text-muted {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.table-actions {
  display: flex;
  gap: 0.75rem;
}

/* Results & Interpretation Section */
.result-section {
  margin-top: 3.5rem;
  animation: fadeIn 0.6s ease-out;
}

.element-summary-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.element-bars-title {
  font-size: 1.15rem;
  color: var(--gold-light);
  margin-bottom: 0.9rem;
  font-weight: 600;
}

.element-bars-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
}

.element-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.element-label {
  font-size: 1.02rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.element-progress-track {
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.element-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fire { background: var(--element-fire); }
.bar-earth { background: var(--element-earth); }
.bar-air { background: var(--element-air); }
.bar-water { background: var(--element-water); }

/* Interpretation Cards */
.interpretation-card-box {
  background: var(--bg-surface);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.inter-box-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1.2rem;
  margin-bottom: 1.3rem;
  flex-wrap: wrap;
}

.inter-card-preview-wrap {
  width: 64px;
  height: 102px;
  border-radius: 8px;
  border: 1.5px solid var(--gold-primary);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 0 10px rgba(212, 175, 55, 0.3);
  flex-shrink: 0;
  background: #0b071c;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease;
}

.inter-card-preview-wrap.reversed-thumb {
  transform: rotate(180deg);
}

.inter-card-preview-wrap .inter-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.inter-card-thumb-art {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inter-card-thumb-art svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.inter-card-meta-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  min-width: 240px;
}

.inter-badges-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.inter-pos-tag {
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-sm);
}

.inter-card-identity {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.inter-card-num {
  font-family: var(--font-mystic);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.inter-card-name {
  font-family: var(--font-mystic);
  font-size: 1.7rem;
  color: #ffffff;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.inter-card-name-th {
  font-size: 1.15rem;
  color: var(--gold-light);
  font-weight: 500;
}

.inter-orient-badge {
  font-size: 0.92rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
}

.badge-upright {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #10b981;
}

.badge-reversed {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid #f59e0b;
}

.inter-keywords {
  margin-bottom: 1.4rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.keyword-pill {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.75rem;
  border-radius: 14px;
  font-size: 0.92rem;
  color: var(--gold-light);
}

.inter-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.3rem;
}

.inter-section {
  display: flex;
  gap: 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

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

.inter-section h5 {
  font-size: 1.15rem;
  color: var(--gold-light);
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.inter-section p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.result-footer-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 2, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Card Zoom Lightbox Modal */
.card-zoom-overlay {
  background: rgba(4, 2, 12, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.card-zoom-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 95vw;
  max-height: 94vh;
  animation: modalPop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-close-zoom {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(26, 18, 56, 0.88);
  border: 1.5px solid var(--gold-primary);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 130;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 10px rgba(212, 175, 55, 0.3);
  transition: all 0.2s ease;
}

.btn-close-zoom:hover {
  background: var(--gold-primary);
  color: #0d0922;
  transform: scale(1.1);
}

.card-zoom-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.zoom-card-container {
  perspective: 1000px;
  transition: transform 0.3s ease;
}

.zoom-card-container.is-reversed {
  transform: rotate(180deg);
}

.zoom-card-frame {
  position: relative;
  width: min(320px, 80vw);
  height: min(512px, 66vh);
  border-radius: 16px;
  border: 2px solid var(--gold-primary);
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.35);
  background: linear-gradient(145deg, #181138, #0e0a24);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.zoom-card-frame:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(212, 175, 55, 0.5);
}

.zoom-card-artwork {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.zoom-card-artwork .card-art-img,
.zoom-card-artwork .card-art-svg,
.zoom-card-artwork .card-archetype-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zoom-card-title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 36px 16px 14px;
  background: linear-gradient(0deg, rgba(7, 4, 18, 0.95) 0%, rgba(7, 4, 18, 0.75) 60%, transparent 100%);
  text-align: center;
  z-index: 4;
}

.zoom-card-title-en {
  font-family: var(--font-mystic);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 12px rgba(212, 175, 55, 0.5);
}

.zoom-card-title-th {
  font-size: 1.05rem;
  color: var(--gold-light);
  font-weight: 500;
  margin-top: 3px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

.zoom-card-info-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.zoom-badges-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.zoom-num {
  font-family: var(--font-mystic);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-light);
}

.zoom-card-keywords {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-zoom-read-action {
  font-size: 1.08rem;
  font-weight: 700;
  padding: 0.72rem 2rem;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.4rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4), 0 0 15px rgba(212, 175, 55, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
}

.btn-zoom-read-action:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 28px rgba(212, 175, 55, 0.65), 0 0 22px rgba(212, 175, 55, 0.4);
}

.card-zoom-hint {
  margin-top: 0.3rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-align: center;
  opacity: 0.9;
  user-select: none;
}

/* Highlight effect when jumping to card interpretation */
@keyframes interCardGlowPulse {
  0% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--bg-glass-border);
    transform: scale(1);
  }
  25% {
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.85), 0 0 70px rgba(212, 175, 55, 0.45);
    border-color: #ffd700;
    transform: scale(1.02);
  }
  60% {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6), 0 0 50px rgba(212, 175, 55, 0.3);
    border-color: #fff5a6;
    transform: scale(1.01);
  }
  100% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--bg-glass-border);
    transform: scale(1);
  }
}

.inter-card-highlight {
  animation: interCardGlowPulse 2.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  font-size: 1.45rem;
  color: var(--gold-light);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.btn-close-modal:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* History Items */
.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 1.12rem;
  margin-bottom: 0.5rem;
}

.history-date {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.history-question {
  font-size: 1.05rem;
  color: var(--gold-light);
  margin-bottom: 0.6rem;
  font-style: italic;
  line-height: 1.5;
}

.history-cards-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.history-card-tag {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

/* Encyclopedia Filter Tabs */
.encyclopedia-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.enc-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--text-secondary);
  font-family: var(--font-thai);
  font-size: 0.95rem;
  padding: 0.45rem 0.95rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.enc-tab:hover {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.45);
}

.enc-tab.active {
  background: linear-gradient(135deg, #d4af37 0%, #b45309 100%);
  color: #0f0926;
  font-weight: 700;
  border-color: #ffd700;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.35);
}

/* Encyclopedia Grid */
.encyclopedia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.encyclopedia-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1.3rem;
}

.enc-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.8rem;
}

.enc-card-thumb,
.enc-card-thumb-preview {
  width: 48px;
  height: 72px;
  border-radius: 4px;
  border: 1px solid var(--gold-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  overflow: hidden;
  background: #0d0822;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enc-card-thumb-preview img,
.enc-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.enc-card-thumb-preview .card-art-svg,
.enc-card-thumb .card-art-svg {
  width: 100%;
  height: 100%;
}

.enc-card-title-wrap {
  flex: 1;
}

.enc-card-main-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.enc-card-main-title h4 {
  font-size: 1.15rem;
  color: #fff;
  margin: 0;
}

.enc-num {
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 1.2rem;
}

.enc-th {
  font-size: 0.98rem;
  color: var(--text-muted);
}

.enc-keywords {
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.enc-tag {
  font-size: 0.85rem;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}

.enc-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Footer */
.app-footer {
  background: rgba(9, 6, 21, 0.9);
  border-top: 1px solid var(--bg-glass-border);
  padding: 1.2rem 1.5rem;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.footer-brand-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.footer-link {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.footer-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.footer-separator {
  color: var(--text-muted);
  opacity: 0.45;
}

.footer-version-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-version-check {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-version-check:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

/* Anti-Cache Update Banner & Toasts */
.update-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  background: linear-gradient(135deg, #1e1548, #2a1b63);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.4rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 450px;
}

.update-banner-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

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

.update-text strong {
  color: var(--gold-light);
  font-size: 0.95rem;
}

.update-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.update-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary-small {
  background: var(--gold-primary);
  color: #120924;
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-ghost-small {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

.version-toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(19, 13, 41, 0.95);
  border: 1px solid var(--gold-primary);
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  font-size: 0.88rem;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.version-toast.toast-error {
  border-color: #ef4444;
}

.version-toast.toast-shield {
  border-color: #ffd700;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4), 0 0 12px rgba(212, 175, 55, 0.25);
  letter-spacing: 0.3px;
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

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

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .app-main {
    padding: 1.2rem 1rem 3rem;
  }
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .glass-panel {
    padding: 1.4rem;
  }
  .spread-grid {
    grid-template-columns: 1fr;
  }
  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  .inter-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .app-header {
    padding: 0.6rem 0.85rem;
  }
  .logo-text h1 {
    font-size: 1.05rem;
  }
  .logo-text p {
    display: none;
  }
  .logo-symbol {
    font-size: 1.5rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .btn-nav {
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    gap: 0.3rem;
  }
  .app-main {
    padding: 1rem 0.6rem 3rem;
  }
  .glass-panel {
    padding: 1.2rem 0.8rem;
    border-radius: 16px;
  }
  .panel-title-center h2 {
    font-size: 1.45rem;
  }
  .panel-title-center p {
    font-size: 1.05rem;
  }
  .pick-header h2 {
    font-size: 1.45rem;
  }
  .pick-header .text-muted {
    font-size: 1rem;
  }
  .pick-controls-bar {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  .fan-deck-wrapper {
    min-height: 270px;
    padding: 1.8rem 0.4rem 1.2rem;
  }
  .fan-card:hover {
    transform: translateY(-26px) scale(1.12) !important;
  }
  .table-actions {
    width: 100%;
    justify-content: space-between;
  }
  .table-actions button {
    flex: 1;
    font-size: 0.98rem;
    padding: 0.65rem 0.8rem;
    justify-content: center;
  }
  .interpretation-card-box {
    padding: 1.4rem 1rem;
  }
  .inter-card-name {
    font-size: 1.35rem;
  }
  .inter-card-name span {
    display: block;
    font-size: 1rem;
    margin-top: 3px;
  }
  .inter-section h5 {
    font-size: 1.08rem;
  }
  .inter-section p {
    font-size: 0.98rem;
    line-height: 1.6;
  }
  .btn-gold-primary {
    font-size: 1.15rem;
    padding: 0.85rem 1.6rem;
  }
  .btn-gold-secondary {
    font-size: 1.02rem;
    padding: 0.65rem 1.2rem;
  }
  .result-footer-actions button {
    width: 100%;
    justify-content: center;
  }
  .modal-card {
    max-width: 95vw;
    max-height: 88vh;
  }
  .modal-body {
    padding: 1rem;
  }
  .update-banner {
    left: 15px;
    right: 15px;
    bottom: 15px;
    max-width: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  .update-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.9rem;
  }
  .footer-brand-links {
    justify-content: center;
  }
  .footer-version-group {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Card Image Protection & Copyright Safeguards */
.tarot-card,
.zoom-card-container,
.zoom-card-frame,
.inter-card-preview-wrap,
.enc-card-thumb-preview {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Print-only Elements: ซ่อนในหน้าจอปกติ */
.print-reading-footer,
.print-header-brand {
  display: none;
}

/* =============================================================
   Google AdSense Layout & Container Stylings
   ============================================================= */
.tarot-ad-wrapper {
  margin: 1.8rem auto;
  width: 100%;
  max-width: 820px;
  background: rgba(14, 10, 32, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md, 12px);
  padding: 10px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tarot-ad-wrapper .ad-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  margin-bottom: 6px;
  text-align: center;
  user-select: none;
}

.tarot-ad-wrapper ins.adsbygoogle {
  margin: 0 auto;
  background: transparent;
  min-height: 90px;
}

.ad-setup-banner {
  max-width: 728px;
  margin: 1.5rem auto 2rem;
}

.ad-result-top {
  margin: 1rem auto 1.8rem;
}

.ad-result-bottom {
  margin: 2rem auto 1rem;
}

.ad-in-article {
  margin: 1.8rem auto;
  border-color: rgba(212, 175, 55, 0.15);
  background: rgba(10, 7, 24, 0.5);
}

.ad-encyclopedia-banner {
  margin: 0.8rem auto 1.2rem;
  max-width: 728px;
}

/* Print Stylesheet สำหรับการพิมพ์คำทำนาย (Print / Save as PDF) */
@media print {
  /* ซ่อนปุ่มควบคุมและองค์ประกอบส่วนติดต่อผู้ใช้ที่ไม่เกี่ยวข้อง */
  #starfield-canvas,
  .app-header,
  .setup-section,
  .shuffle-section,
  .pick-section,
  .modal-overlay,
  .update-banner,
  .version-toast,
  .app-footer,
  .result-footer-actions,
  .table-actions,
  .card-zoom-hint,
  .card-art-shield,
  .btn-version-check,
  .tarot-ad-wrapper,
  .adsbygoogle,
  ins.adsbygoogle,
  [id^="google_ads"],
  .google-auto-placed {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #1a1a1a !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }

  .app-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #section-table,
  #section-result {
    display: block !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .glass-panel {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .table-header h2 {
    color: #111111 !important;
    font-size: 1.8rem !important;
    border-bottom: 2px solid #d4af37 !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 1rem !important;
  }

  .table-header p {
    display: none !important;
  }

  /* ตารางโต๊ะวางไพ่ในหน้าพิมพ์ */
  .cards-table-grid {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 1.2rem !important;
    margin-bottom: 1.5rem !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .cards-table-grid.spread-three,
  .cards-table-grid.spread-love {
    display: flex !important;
    justify-content: center !important;
    max-width: 100% !important;
    gap: 1.2rem !important;
  }

  .cards-table-celtic-container {
    display: flex !important;
    justify-content: center !important;
    overflow: visible !important;
    padding: 0.5rem 0 !important;
    margin: 0 auto 1.5rem !important;
    width: 100% !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .celtic-layout {
    display: flex !important;
    justify-content: center !important;
    margin: 0 auto !important;
    gap: 2.2rem !important;
    min-width: 0 !important;
  }

  /* ไพ่ในโต๊ะวางไพ่ (Tarot Card on Table) */
  .tarot-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .tarot-card .card-inner {
    transform: none !important;
    transform-style: flat !important;
  }

  .tarot-card .card-back {
    display: none !important;
  }

  .tarot-card .card-front {
    transform: none !important;
    -webkit-transform: none !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    visibility: visible !important;
    background: #ffffff !important;
    border: 1.5px solid #333333 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    z-index: 10 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .tarot-card.is-reversed .card-front {
    transform: rotate(180deg) !important;
    -webkit-transform: rotate(180deg) !important;
  }

  .celtic-card-2 {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    z-index: 15 !important;
  }

  /* ภาพเต็มใบไพ่ (Card Artwork & Image) */
  .card-artwork {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    visibility: visible !important;
    overflow: hidden !important;
    border-radius: 11px !important;
    z-index: 1 !important;
  }

  /* หน้าไพ่ที่ generate มา: บังคับแสดงผลคมชัดในโทนขาวดำ (Grayscale) */
  .card-art-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    filter: grayscale(100%) contrast(108%) !important;
    -webkit-filter: grayscale(100%) contrast(108%) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* สำคัญมาก: ซ่อน Fallback SVG ไม่ให้แสดงทับภาพหน้าไพ่ที่ generate มา */
  .card-art-fallback {
    display: none !important;
  }

  /* กล่องพรีวิวหน้าไพ่ในหัวข้อคำทำนาย */
  .inter-card-preview-wrap {
    background: #ffffff !important;
    border: 1px solid #666666 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .inter-card-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    filter: grayscale(100%) contrast(108%) !important;
    -webkit-filter: grayscale(100%) contrast(108%) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* ป้ายชื่อไพ่บนตัวไพ่ในหน้าพิมพ์ */
  .card-title-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 60%, rgba(255, 255, 255, 0) 100%) !important;
    border-top: 1px solid rgba(120, 120, 120, 0.3) !important;
    padding: 16px 4px 5px !important;
    z-index: 4 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .card-title-overlay .card-title-en {
    color: #000000 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
  }

  .card-title-overlay .card-title-th {
    color: #222222 !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
  }

  .card-position-label {
    margin-top: 8px !important;
    background: #f0f0f0 !important;
    color: #111111 !important;
    border: 1px solid #999999 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .card-border-ornament .corner {
    border-color: rgba(60, 60, 60, 0.6) !important;
  }

  /* กล่องคำทำนายแต่ละใบในหน้าพิมพ์ */
  .interpretation-card-box {
    background: #ffffff !important;
    border: 1px solid #dcdcdc !important;
    border-left: 4px solid #555555 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    color: #1a1a1a !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 1.2rem !important;
    padding: 1.2rem !important;
  }

  .inter-card-name {
    color: #111111 !important;
  }

  .inter-card-name-th {
    color: #555555 !important;
  }

  .inter-section {
    background: #fbfbfb !important;
    border: 1px solid #e5e5e5 !important;
  }

  .inter-section h5 {
    color: #333333 !important;
    font-size: 1.05rem !important;
  }

  .inter-section p {
    color: #222222 !important;
    font-size: 0.98rem !important;
  }

  .inter-pos-tag,
  .inter-orient-badge,
  .card-element-tag,
  .keyword-pill {
    border: 1px solid #cccccc !important;
    background: #f3f3f3 !important;
    color: #333333 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .element-summary-box {
    background: #f9f9fb !important;
    border: 1px solid #e0e0e0 !important;
    color: #111111 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 1.5rem !important;
  }

  .element-card {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    color: #111111 !important;
  }

  .element-name, .element-percent {
    color: #111111 !important;
  }

  /* ป้ายชื่อเว็บไซต์และ URL ด้านบนหัวกระดาษหน้าพิมพ์ */
  .print-header-brand {
    display: block !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #444444 !important;
    margin-bottom: 0.4rem !important;
  }

  /* กล่องเครดิต ลิขสิทธิ์ และลิงก์เว็บไซต์ท้ายหน้าพิมพ์คำทำนาย */
  .print-reading-footer {
    display: block !important;
    margin-top: 2rem !important;
    padding: 1.2rem 1.4rem !important;
    background: #f8f8fb !important;
    border: 1px solid #d5d5d5 !important;
    border-left: 4px solid #333333 !important;
    border-radius: 6px !important;
    page-break-inside: avoid;
    break-inside: avoid;
    color: #222222 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-brand-name {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #111111 !important;
    margin-bottom: 0.5rem !important;
  }

  .print-links-list {
    font-size: 0.95rem !important;
    line-height: 1.8 !important;
    color: #333333 !important;
  }

  .print-links-list div {
    margin-bottom: 0.2rem !important;
  }

  .print-copy-notice {
    margin-top: 0.6rem !important;
    padding-top: 0.5rem !important;
    border-top: 1px dashed #cccccc !important;
    font-size: 0.82rem !important;
    color: #666666 !important;
  }
}


