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

:root {
  --gold: #c9a84c;
  --gold-dim: #8a6e2f;
  --gold-bright: #f0d080;
  --deep-purple: #1a0a2e;
  --purple-mid: #2d1458;
  --purple-light: #4a2080;
  --indigo: #3d2b7a;
  --crimson: #8b1a3a;
  --teal-glow: #1a6b6b;
  --text-bright: #f5f0e8;
  --text-dim: #a89878;
  --text-muted: #6e5c48;
  --panel-bg: rgba(15, 5, 30, 0.6);
  --panel-border: rgba(201, 168, 76, 0.3);
  --panel-border-hover: rgba(201, 168, 76, 0.6);
}

body {
  font-family: 'Crimson Pro', Georgia, serif;
  background-color: var(--deep-purple);
  color: var(--text-bright);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(75, 32, 128, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 26, 58, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(26, 107, 107, 0.15) 0%, transparent 70%);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 3, 20, 0.3) 0%, rgba(10, 3, 20, 0.1) 100%);
  z-index: 0;
  pointer-events: none;
}

/* ── Particles ─────────────────────────────────────────────────────────────── */
.particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* ── Camera Modal ──────────────────────────────────────────────────────────── */
.camera-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(5, 0, 15, 0.92);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.25s ease-out;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.camera-modal-inner {
  width: 100%; max-width: 580px;
  background: rgba(20, 8, 40, 0.95);
  border: 1px solid var(--panel-border);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 60px rgba(201,168,76,0.15), 0 20px 60px rgba(0,0,0,0.8);
  animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.camera-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(201,168,76,0.05);
}
.camera-title { font-family: 'Cinzel', serif; font-size: 16px; color: var(--gold); letter-spacing: 1px; }
.camera-close {
  background: none; border: 1px solid rgba(201,168,76,0.3); color: var(--text-dim);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.camera-close:hover { border-color: var(--gold); color: var(--text-bright); background: rgba(201,168,76,0.1); }

.camera-viewfinder { position: relative; width: 100%; background: #000; aspect-ratio: 4/3; overflow: hidden; }
#camera-video { width: 100%; height: 100%; object-fit: cover; display: block; }

.palm-guide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.palm-guide-box {
  width: 55%; aspect-ratio: 3/4;
  border: 2px solid rgba(201,168,76,0.7);
  border-radius: 50% 50% 40% 40% / 40% 40% 50% 50%;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35), inset 0 0 30px rgba(201,168,76,0.08);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px;
  animation: guideGlow 2.5s ease-in-out infinite;
}
@keyframes guideGlow {
  0%,100% { border-color: rgba(201,168,76,0.5); }
  50%      { border-color: rgba(201,168,76,1); box-shadow: 0 0 0 9999px rgba(0,0,0,0.35), inset 0 0 30px rgba(201,168,76,0.15), 0 0 20px rgba(201,168,76,0.3); }
}
.palm-guide-label { font-family: 'Cinzel', serif; font-size: 11px; color: rgba(201,168,76,0.85); letter-spacing: 1px; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }

.camera-footer { padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; background: rgba(10,3,20,0.6); }
.camera-hint { font-size: 14px; color: var(--text-dim); font-style: italic; text-align: center; }

.capture-btn {
  position: relative; width: 68px; height: 68px; border-radius: 50%;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease;
}
.capture-btn:hover { transform: scale(1.06); }
.capture-btn:active { transform: scale(0.94); }
.capture-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 12px rgba(201,168,76,0.4); }
.capture-dot {
  width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff 0%, var(--gold-bright) 40%, var(--gold) 100%);
  box-shadow: 0 2px 12px rgba(201,168,76,0.5); transition: background 0.15s ease;
}
.capture-btn:active .capture-dot { background: radial-gradient(circle at 40% 35%, #fff 0%, var(--gold) 40%, var(--gold-dim) 100%); }

.camera-error { padding: 40px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.camera-error-icon { font-size: 36px; }
.camera-error-text { font-size: 15px; color: var(--text-dim); font-style: italic; line-height: 1.6; }

/* ── App Container ──────────────────────────────────────────────────────────── */
.app-container {
  position: relative; z-index: 1;
  max-width: 860px; margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}

.header { text-align: center; padding: 20px 0; }

.sigil { font-size: 28px; color: var(--gold); display: block; margin-bottom: 12px; animation: sigilPulse 3s ease-in-out infinite; }
@keyframes sigilPulse {
  0%,100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.15); }
}

.main-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(42px, 8vw, 72px); font-weight: 700; letter-spacing: 6px;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(201,168,76,0.5), 0 0 60px rgba(201,168,76,0.2);
  margin-bottom: 12px; line-height: 1.1;
}

.subtitle { font-size: 18px; font-style: italic; color: var(--text-dim); letter-spacing: 2px; }

/* Sections */
.section {
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 32px 36px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(201,168,76,0.15);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.section:hover {
  border-color: var(--panel-border-hover);
  box-shadow: 0 6px 40px rgba(0,0,0,0.6), 0 0 20px rgba(201,168,76,0.08), inset 0 1px 0 rgba(201,168,76,0.2);
}

.section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.section-icon { font-size: 28px; }
.section-title { font-family: 'Cinzel', serif; font-size: 22px; font-weight: 600; color: var(--gold); letter-spacing: 2px; }
.stars-decor { margin-left: auto; color: var(--gold-dim); font-size: 18px; letter-spacing: 6px; }

/* Upload */
.upload-section { border-color: rgba(138,110,47,0.4); border-left: 3px solid var(--gold); }

.upload-area {
  border: 2px dashed rgba(201,168,76,0.35); border-radius: 12px; padding: 20px;
  transition: all 0.3s ease; min-height: 220px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201,168,76,0.03);
}
.upload-area.drag-over { border-color: var(--gold); background: rgba(201,168,76,0.08); box-shadow: 0 0 20px rgba(201,168,76,0.2); }

.upload-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upload-icon { font-size: 52px; animation: floatIcon 4s ease-in-out infinite; }
@keyframes floatIcon { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.upload-main { font-family: 'Cinzel', serif; font-size: 20px; color: var(--text-bright); letter-spacing: 1px; }
.upload-sub { font-size: 15px; color: var(--text-dim); font-style: italic; max-width: 300px; line-height: 1.6; }

.upload-btn-row { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.upload-btn { display: flex; align-items: center; gap: 8px; padding: 13px 26px; border-radius: 30px; font-family: 'Cinzel', serif; font-size: 14px; font-weight: 600; letter-spacing: 1px; cursor: pointer; transition: all 0.3s ease; }
.btn-icon { font-size: 18px; line-height: 1; }

.upload-btn--file { background: linear-gradient(135deg, var(--gold-dim), var(--gold)); color: var(--deep-purple); border: none; box-shadow: 0 4px 16px rgba(201,168,76,0.3); }
.upload-btn--file:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(201,168,76,0.5); background: linear-gradient(135deg, var(--gold), var(--gold-bright)); }
.upload-btn--camera { background: linear-gradient(135deg, var(--purple-mid), var(--indigo)); color: var(--gold-bright); border: 1px solid var(--gold-dim); box-shadow: 0 4px 16px rgba(61,43,122,0.4); }
.upload-btn--camera:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(61,43,122,0.6), 0 0 16px rgba(201,168,76,0.15); border-color: var(--gold); }

.drag-hint { text-align: center; font-size: 13px; color: var(--text-muted); font-style: italic; margin-top: 10px; }

/* Preview */
.preview-content { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; }
.preview-content img { max-width: 100%; max-height: 320px; border-radius: 10px; border: 1px solid var(--panel-border); object-fit: contain; box-shadow: 0 0 30px rgba(201,168,76,0.15); }
.preview-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.read-btn {
  background: linear-gradient(135deg, var(--purple-mid), var(--indigo));
  color: var(--gold-bright); border: 1px solid var(--gold-dim);
  padding: 14px 40px; border-radius: 30px;
  font-family: 'Cinzel', serif; font-size: 16px; font-weight: 600; letter-spacing: 2px;
  cursor: pointer; transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(61,43,122,0.5);
}
.read-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(61,43,122,0.7), 0 0 20px rgba(201,168,76,0.2); border-color: var(--gold); }
.read-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.change-btn { background: transparent; color: var(--text-dim); border: 1px solid rgba(201,168,76,0.2); padding: 14px 24px; border-radius: 30px; font-size: 14px; cursor: pointer; transition: all 0.3s ease; }
.change-btn:hover { border-color: var(--gold-dim); color: var(--text-bright); }

/* Reading */
.reading-section { border-color: rgba(138,110,47,0.4); border-left: 3px solid var(--crimson); }

.loading-state { display: flex; flex-direction: column; align-items: center; gap: 32px; padding: 20px 0; }

.crystal-ball { position: relative; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }
.orb-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(201,168,76,0.3); }
.ring1 { width: 120px; height: 120px; animation: orbSpin 4s linear infinite; }
.ring2 { width: 88px; height: 88px; animation: orbSpin 3s linear infinite reverse; border-color: rgba(138,110,47,0.4); }
.ring3 { width: 56px; height: 56px; animation: orbSpin 2s linear infinite; border-color: rgba(201,168,76,0.5); }
@keyframes orbSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.orb-core { font-size: 36px; animation: corePulse 2s ease-in-out infinite; z-index: 1; }
@keyframes corePulse { 0%,100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } }

.loading-text { font-family: 'Cinzel', serif; font-size: 17px; color: var(--gold-dim); letter-spacing: 2px; text-align: center; animation: textFade 2s ease-in-out infinite; }
@keyframes textFade { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

.reading-content { display: flex; flex-direction: column; gap: 28px; }

.reading-emblem { text-align: center; font-size: 26px; color: var(--gold-dim); letter-spacing: 12px; animation: emblemGlow 4s ease-in-out infinite; }
@keyframes emblemGlow {
  0%,100% { color: var(--gold-dim); text-shadow: none; }
  50%      { color: var(--gold); text-shadow: 0 0 20px rgba(201,168,76,0.4); }
}

.reading-text { font-size: 18px; line-height: 1.9; color: var(--text-bright); font-weight: 300; border-left: 2px solid rgba(201,168,76,0.3); padding-left: 24px; animation: revealText 0.8s ease-out; }
@keyframes revealText { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.reading-text h3 { font-family: 'Cinzel', serif; font-size: 15px; color: var(--gold); letter-spacing: 2px; font-weight: 600; margin: 20px 0 8px; text-transform: uppercase; }
.reading-text p { margin-bottom: 14px; font-style: italic; }

.reading-footer { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 16px; border-top: 1px solid rgba(201,168,76,0.15); }
.disclaimer { font-size: 13px; color: var(--text-muted); letter-spacing: 2px; text-align: center; }
.reading-model-used { font-size: 12px; color: var(--text-muted); letter-spacing: 1.5px; font-style: italic; }

.new-reading-btn { background: transparent; color: var(--gold-dim); border: 1px solid var(--gold-dim); padding: 12px 32px; border-radius: 30px; font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 2px; cursor: pointer; transition: all 0.3s ease; }
.new-reading-btn:hover { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 16px rgba(201,168,76,0.2); }

.error-state { text-align: center; padding: 20px 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.error-icon { font-size: 40px; color: var(--crimson); }
.error-text { color: var(--text-dim); font-size: 17px; font-style: italic; }
.retry-btn { background: rgba(139,26,58,0.2); color: #e06080; border: 1px solid rgba(139,26,58,0.4); padding: 12px 28px; border-radius: 30px; font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 1px; cursor: pointer; transition: all 0.3s ease; }
.retry-btn:hover { background: rgba(139,26,58,0.4); border-color: #e06080; }

/* Info */
.info-section { border-left: 3px solid var(--teal-glow); }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num { font-family: 'Cinzel', serif; font-size: 28px; color: var(--gold-dim); font-weight: 400; min-width: 36px; line-height: 1.1; }
.step-body h3 { font-family: 'Cinzel', serif; font-size: 14px; color: var(--gold); letter-spacing: 1px; margin-bottom: 6px; font-weight: 600; }
.step-body p { font-size: 15px; color: var(--text-dim); line-height: 1.7; font-style: italic; }

.footer { text-align: center; padding: 12px 0; }
.footer p { font-size: 13px; color: var(--text-muted); letter-spacing: 2px; }

/* ── Model Selector ─────────────────────────────────────────────────────────── */
.model-section { border-left: 3px solid var(--teal-glow); }

.model-selector { display: flex; gap: 16px; flex-wrap: wrap; }

.model-btn {
  flex: 1; min-width: 140px;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.2);
  cursor: pointer; transition: all 0.25s ease;
  color: var(--text-dim); font-family: 'Cinzel', serif;
}
.model-btn:hover { border-color: rgba(201,168,76,0.5); background: rgba(201,168,76,0.05); color: var(--text-bright); }
.model-btn.active {
  border-color: var(--gold);
  background: rgba(201,168,76,0.1);
  color: var(--gold-bright);
  box-shadow: 0 0 16px rgba(201,168,76,0.15), inset 0 1px 0 rgba(201,168,76,0.2);
}

.model-icon { font-size: 22px; line-height: 1; }
.model-name { font-size: 15px; font-weight: 600; letter-spacing: 1px; flex: 1; }
.model-tag { font-size: 10px; letter-spacing: 1.5px; padding: 3px 8px; border-radius: 20px; border: 1px solid currentColor; opacity: 0.7; text-transform: uppercase; }
.model-btn.active .model-tag { opacity: 1; background: rgba(201,168,76,0.15); }

.model-desc { margin-top: 14px; font-size: 14px; font-style: italic; color: var(--text-muted); line-height: 1.6; min-height: 20px; transition: opacity 0.2s ease; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .app-container { padding: 24px 16px 48px; gap: 24px; }
  .section { padding: 24px 20px; }
  .steps-grid { grid-template-columns: 1fr; gap: 20px; }
  .reading-text { padding-left: 16px; font-size: 16px; }
  .stars-decor { display: none; }
  .upload-btn-row { flex-direction: column; align-items: center; width: 100%; }
  .upload-btn { width: 100%; max-width: 280px; justify-content: center; }
  .camera-modal-inner { border-radius: 12px; }
  .palm-guide-box { width: 65%; }
  .model-selector { flex-direction: column; }
  .model-btn { min-width: unset; }
}

@media (max-width: 767px) {
  body { background-attachment: scroll; }
}

/* ── Crop Modal ───────────────────────────────────────────────────────────────── */
.crop-modal {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(5, 0, 15, 0.95);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.25s ease-out;
}

.crop-modal-inner {
  width: 100%; max-width: 680px;
  background: rgba(20, 8, 40, 0.98);
  border: 1px solid var(--panel-border);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 60px rgba(201,168,76,0.15), 0 20px 60px rgba(0,0,0,0.9);
  display: flex; flex-direction: column;
  max-height: 92vh;
  animation: modalSlideIn 0.3s ease-out;
}

.crop-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(201,168,76,0.05);
  flex-shrink: 0;
}

.crop-title {
  font-family: 'Cinzel', serif; font-size: 15px;
  color: var(--gold); letter-spacing: 1px;
}

.crop-hint-bar {
  padding: 8px 20px;
  background: rgba(0,0,0,0.3);
  font-size: 12px; color: var(--text-muted);
  font-style: italic; text-align: center;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.crop-canvas-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #000;
  min-height: 260px;
  cursor: crosshair;
  touch-action: none; /* prevent browser scroll during pinch/pan */
}

#crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
}

.crop-footer {
  display: flex; gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--panel-border);
  background: rgba(10,3,20,0.7);
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.crop-skip-btn {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(201,168,76,0.2);
  padding: 12px 22px; border-radius: 30px;
  font-size: 13px; cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Crimson Pro', serif;
}
.crop-skip-btn:hover { border-color: var(--gold-dim); color: var(--text-bright); }

.crop-confirm-btn {
  background: linear-gradient(135deg, var(--purple-mid), var(--indigo));
  color: var(--gold-bright);
  border: 1px solid var(--gold-dim);
  padding: 12px 28px; border-radius: 30px;
  font-family: 'Cinzel', serif; font-size: 14px;
  font-weight: 600; letter-spacing: 1px;
  cursor: pointer; transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(61,43,122,0.4);
}
.crop-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(61,43,122,0.6), 0 0 12px rgba(201,168,76,0.15);
  border-color: var(--gold);
}

/* Crop button in preview */
.crop-btn {
  background: transparent;
  color: var(--gold-dim);
  border: 1px solid var(--gold-dim);
  padding: 14px 22px; border-radius: 30px;
  font-family: 'Cinzel', serif; font-size: 14px;
  letter-spacing: 1px; cursor: pointer;
  transition: all 0.3s ease;
}
.crop-btn:hover {
  border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 12px rgba(201,168,76,0.2);
}

@media (max-width: 600px) {
  .crop-modal-inner { border-radius: 12px; max-height: 96vh; }
  .crop-footer { padding: 12px 16px; }
  .crop-confirm-btn, .crop-skip-btn { flex: 1; text-align: center; justify-content: center; }
  .feature-nav { gap: 8px; }
  .feature-tab { padding: 10px 12px; font-size: 12px; letter-spacing: 0.5px; }
  .compat-grid { grid-template-columns: 1fr; }
  .chat-messages { min-height: 200px; max-height: 320px; }
}

/* ── Feature Navigation ───────────────────────────────────────────────── */
.feature-nav {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.feature-tab {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--text-dim);
  padding: 12px 20px;
  border-radius: 30px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.feature-tab:hover {
  border-color: rgba(201,168,76,0.5);
  color: var(--text-bright);
  background: rgba(201,168,76,0.05);
}

.feature-tab.active {
  background: linear-gradient(135deg, var(--purple-mid), var(--indigo));
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 4px 16px rgba(61,43,122,0.4), 0 0 12px rgba(201,168,76,0.1);
}

.feature-panel { width: 100%; display: flex; flex-direction: column; gap: 24px; }

/* ── Shared feature styles ─────────────────────────────────────────────── */
.feature-desc {
  font-size: 15px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ── Daily Destiny ───────────────────────────────────────────────────── */
.destiny-palm-status {
  font-size: 13px;
  color: var(--teal-glow);
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-style: italic;
}

/* ── Compatibility ─────────────────────────────────────────────────── */
#partner-section {
  border-left: 3px solid var(--crimson);
}

#compat-action-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 36px;
}

.compat-hint {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  letter-spacing: 0.5px;
  transition: opacity 0.3s ease;
}

/* ── Fortune Chat ──────────────────────────────────────────────────── */
.chat-section { border-left: 3px solid var(--crimson); }

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

.chat-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: revealText 0.4s ease-out;
}

.chat-msg--user { flex-direction: row-reverse; }

.chat-avatar {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 50%;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.7;
  font-style: italic;
}

.chat-msg--mystic .chat-bubble {
  background: rgba(45, 20, 88, 0.5);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--text-bright);
  border-radius: 4px 16px 16px 16px;
}

.chat-msg--user .chat-bubble {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--text-bright);
  border-radius: 16px 4px 16px 16px;
  font-style: normal;
}

.chat-msg--typing .chat-bubble {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 14px 18px;
}

.typing-dot {
  width: 7px; height: 7px;
  background: var(--gold-dim);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30%          { transform: translateY(-6px); opacity: 1; }
}

.chat-input-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 30px;
  padding: 12px 20px;
  color: var(--text-bright);
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus { border-color: var(--gold-dim); }
.chat-input::placeholder { color: var(--text-muted); font-style: italic; }

.chat-send-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-mid), var(--indigo));
  border: 1px solid var(--gold-dim);
  color: var(--gold-bright);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(61,43,122,0.4);
}

.chat-send-btn:hover {
  transform: scale(1.08);
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(61,43,122,0.6);
}

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