/* PalmMate — Modern Mystic Lab (Dark + Jade) Enhanced */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=DM+Sans:wght@400;500;600;700&family=Noto+Serif+KR:wght@400;600;700&family=Noto+Serif+JP:wght@400;600;700&display=swap');

:root {
  --bg: #0a0e12;
  --bg-card: #12181f;
  --bg-elevated: #1a222b;
  --bg-glass: rgba(18, 24, 31, 0.85);
  --text: #e8eef4;
  --text-muted: #7a8c9e;
  --text-dim: #4a5a6a;
  --accent: #2dd4bf;
  --accent-glow: rgba(45, 212, 191, 0.4);
  --accent-dim: rgba(45, 212, 191, 0.15);
  --accent-dark: #1a8a7d;
  --border: #1e2a36;
  --border-light: #2a3a4a;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Playfair Display", "Noto Serif KR", "Noto Serif JP", Georgia, serif;
  --font-mono: "DM Sans", -apple-system, sans-serif;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border);
  --shadow-glow: 0 0 40px var(--accent-glow);

  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  /* Eastern accent colors */
  --gold: #d4a857;
  --gold-glow: rgba(212, 168, 87, 0.4);
  --gold-dim: rgba(212, 168, 87, 0.15);
  --crimson: #c9544d;
  --ink: #2c2c2c;

  /* Element colors */
  --wood: #4ade80;
  --fire: #f87171;
  --earth: #fbbf24;
  --metal: #a1a1aa;
  --water: #60a5fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 80% at 50% -30%, var(--gold-dim), transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(212, 168, 87, 0.08), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(45, 212, 191, 0.05), transparent 40%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Subtle Eastern cloud pattern overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill='%23d4a857' fill-opacity='0.02' d='M40 80c-10 0-18-8-18-18s8-18 18-18c2 0 4 0 6 1-2-4-3-8-3-12 0-15 12-27 27-27 12 0 22 8 25 19 4-3 9-5 15-5 15 0 27 12 27 27 0 3-1 6-2 9 8 3 14 11 14 20 0 12-10 22-22 22H40z'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

#app {
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 20px 100px;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

/* ========== Screens ========== */
.screen {
  display: none;
  animation: screenIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.screen.active {
  display: block;
}

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

/* ========== Brand / Header ========== */
.brand {
  text-align: center;
  margin-bottom: 32px;
}
.brand.compact {
  text-align: left;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.brand h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.03em;
  font-family: var(--font-serif);
  background: linear-gradient(135deg, var(--gold) 0%, #f0d78c 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px var(--gold-glow);
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.brand h1:hover {
  opacity: 0.8;
}
.brand h1 a,
.brand h1 a:visited,
.brand h1 a:hover {
  text-decoration: none;
  background: linear-gradient(135deg, var(--gold) 0%, #f0d78c 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand.compact h1 {
  text-align: center;
  font-size: 1.25rem;
}
.brand-link-page:hover {
  opacity: 0.85;
}
.tagline {
  margin: 8px 0 0;
  color: var(--gold);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.06em;
  font-family: var(--font-serif);
}
.back {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.back:hover {
  color: var(--gold);
}

/* ========== Step Indicator ========== */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
  transition: all 0.3s ease;
}
.step-dot.active {
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
  width: 24px;
  border-radius: 4px;
}
.step-dot.completed {
  background: #a67c3d;
}

/* ========== Home Screen ========== */
.hero-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  background: var(--bg-elevated);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: float 4s ease-in-out infinite;
  position: relative;
  border: 2px solid var(--gold-dim);
  overflow: hidden;
}

.hero-icon img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* Eastern decorative ring */
.hero-icon::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  background: transparent;
}

.hero-icon::after {
  content: '☰';
  position: absolute;
  top: -16px;
  font-size: 10px;
  color: var(--gold);
  opacity: 0.6;
  letter-spacing: 2px;
}

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

.subheadline {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-base);
  margin: 0 0 32px;
}

/* Landing-only typography tuning */
#screen-home .brand {
  margin-bottom: 24px;
}

#screen-home .brand h1 {
  font-family: var(--font-serif);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: var(--text-3xl);
  background: linear-gradient(135deg, var(--gold) 0%, #f0d78c 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

#screen-home .brand h1 a,
#screen-home .brand h1 a:visited,
#screen-home .brand h1 a:hover {
  background: linear-gradient(135deg, var(--gold) 0%, #f0d78c 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#screen-home .tagline {
  margin-top: 10px;
  color: #dce6f1;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

#screen-home .subheadline {
  font-size: var(--text-base);
  line-height: 1.65;
  color: #b6c5d3;
  margin-bottom: 34px;
}

.cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.trust {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trust span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.trust-icon {
  font-size: 0.9em;
}

/* ========== Home Showcase ========== */
.home-showcase {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.home-showcase-head {
  text-align: center;
  margin-bottom: 14px;
}

.home-showcase-head h2 {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.home-showcase-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.home-showcase-viewport {
  position: relative;
}

.home-showcase-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 8px;
  scrollbar-width: none;
}

.home-showcase-scroll::-webkit-scrollbar {
  display: none;
}

.home-showcase-card {
  flex: 0 0 82%;
  min-width: 250px;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background:
    linear-gradient(145deg, rgba(212, 168, 87, 0.12), rgba(45, 212, 191, 0.08)),
    var(--bg-card);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: homeCardIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.home-showcase-card:nth-child(1) { animation-delay: 0.03s; }
.home-showcase-card:nth-child(2) { animation-delay: 0.08s; }
.home-showcase-card:nth-child(3) { animation-delay: 0.13s; }
.home-showcase-card:nth-child(4) { animation-delay: 0.18s; }
.home-showcase-card:nth-child(5) { animation-delay: 0.23s; }

.home-showcase-card:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--gold-dim);
  transform: translateY(-2px);
}

.showcase-chip {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 18, 0.44);
  color: var(--gold);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.showcase-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: #f2f6fb;
}

.showcase-desc {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.showcase-link {
  margin-top: auto;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
}

.home-showcase-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.home-showcase-dots .dot {
  width: 7px;
  height: 7px;
  border: none;
  border-radius: 50%;
  background: var(--border-light);
  padding: 0;
  cursor: pointer;
  transition: all 0.24s ease;
}

.home-showcase-dots .dot.active {
  width: 22px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

.home-showcase-hint {
  margin: 10px 0 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

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

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #a67c3d 100%);
  color: var(--bg);
  box-shadow: 0 4px 16px var(--gold-glow);
  font-family: var(--font-serif);
  letter-spacing: 0.03em;
}
.btn-primary:hover {
  box-shadow: 0 6px 24px var(--gold-glow);
  transform: translateY(-2px);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-primary:hover::before {
  opacity: 1;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}
.btn-secondary:hover {
  background: var(--border);
  border-color: var(--gold-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 12px 20px;
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}

/* ========== Upload Zone ========== */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  margin-bottom: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}
.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, var(--accent-dim), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--gold);
  background: var(--bg-elevated);
}
.upload-zone:hover::before,
.upload-zone.dragover::before {
  opacity: 1;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.8;
}
.upload-label {
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 6px;
  position: relative;
}
.upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  position: relative;
}

/* Skip Link */
.skip-link {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 12px;
  margin-bottom: 16px;
  transition: color 0.2s;
}
.skip-link:hover {
  color: var(--gold);
}

/* Image preview with highlight overlay */
.palm-preview-container {
  position: relative;
  margin-bottom: 16px;
  display: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--bg-card);
}
.palm-preview-container.visible {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: scaleIn 0.3s ease;
}

/* Inner wrapper to maintain aspect ratio */
.palm-image-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  background: var(--bg-elevated);
}

.image-preview {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  display: block;
}
.image-preview.visible {
  display: block;
}

.highlight-canvas {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
  max-height: 350px;
}
.highlight-canvas.hidden {
  opacity: 0;
}

/* Highlight status indicator */
.highlight-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  color: var(--text-muted);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
}
.highlight-status.active {
  color: var(--gold);
  border-color: var(--gold-dim);
}
.highlight-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}
.highlight-status.active .status-dot {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.btn-toggle-highlight {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}
.btn-toggle-highlight:hover {
  background: var(--bg-elevated);
  border-color: var(--gold);
  transform: scale(1.1);
}
.btn-toggle-highlight.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}
.btn-toggle-highlight .highlight-icon {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}
.btn-toggle-highlight.active .highlight-icon {
  transform: scale(1.2);
}

/* Highlight loading state */
.btn-toggle-highlight.loading {
  pointer-events: none;
}
.btn-toggle-highlight.loading .highlight-icon {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }

}

/* Legend for highlights */
.highlight-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  z-index: 10;
}
.highlight-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
}
.legend-color {
  width: 12px;
  height: 3px;
  border-radius: 2px;
}
.legend-color.palm-line {
  background: var(--accent);
  box-shadow: 0 0 4px var(--accent);
}
.legend-color.skeleton {
  background: #ffc832;
}

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

/* ========== Analyzing Animation ========== */
.analyzing {
  text-align: center;
  padding: 40px 24px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.analyzing.hidden {
  display: none !important;
}

.spinner-container {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}
.spinner {
  width: 64px;
  height: 64px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.spinner-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analyzing-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}
.analyzing-progress {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
}
.analyzing-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #a67c3d);
  border-radius: 2px;
  transition: width 0.3s ease-out;
}

/* Analyzing Percent */
.analyzing-percent {
  color: var(--gold);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  margin: 8px 0 0;
  font-weight: 600;
}

/* Analyzing Steps Checklist */
.analyzing-steps {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  text-align: left;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.step-item.active {
  color: var(--text);
  opacity: 1;
}

.step-item.active .step-icon {
  animation: stepPulse 0.6s ease-in-out infinite;
}

.step-item.completed {
  color: var(--accent);
  opacity: 0.7;
}

.step-item .step-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
}

.step-item .step-text {
  flex: 1;
}

.step-item .step-check {
  color: var(--accent);
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}

.step-item.completed .step-check {
  opacity: 1;
  transform: scale(1);
}

@keyframes stepPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
  width: 0%;
  transition: width 0.3s ease;
}

/* ========== Analysis Failed ========== */
.analysis-failed {
  text-align: center;
  padding: 40px 24px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}
.analysis-failed.hidden {
  display: none !important;
}

.failed-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.failed-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}

.failed-message {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.failed-tips {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.failed-tips p {
  margin: 0;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.failed-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.failed-actions .btn {
  width: 100%;
}

/* ========== Forms ========== */
.form-reading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-reading.hidden {
  display: none;
}

.input-group {
  position: relative;
}
.input-group label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-dim);
  pointer-events: none;
  transition: all 0.2s;
}
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: 8px;
  transform: translateY(0);
  font-size: 0.7rem;
  color: var(--gold);
}

.form-reading input {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
}
.form-reading input::placeholder {
  color: var(--text-dim);
}
.form-reading input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

/* Date input with label */
.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.date-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-serif);
  padding-left: 4px;
}
.date-input-group input[type="date"] {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
}
.date-input-group input[type="date"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
/* Style the date picker icon */
.date-input-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

/* Gender Select */
.gender-select {
  display: flex;
  gap: 12px;
}
.gender-option {
  flex: 1;
  cursor: pointer;
}
.gender-option input {
  display: none;
}
.gender-label {
  display: block;
  padding: 14px 16px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: all 0.2s;
}
.gender-option input:checked + .gender-label {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
}
.gender-option:hover .gender-label {
  border-color: var(--border-light);
  background: var(--bg-elevated);
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.form-actions .btn-primary {
  flex: 1;
}

/* ========== Share Card (9:16) ========== */
.share-card {
  aspect-ratio: 9 / 16;
  max-height: 65vh;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-card), 0 0 40px rgba(212, 168, 87, 0.1);
  position: relative;
  overflow: hidden;
}

/* Eastern corner decorations */
.share-card::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--gold-dim);
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
  opacity: 0.5;
}

/* Card background glow based on element */
.share-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 30%, var(--element-color, var(--accent-dim)), transparent 50%);
  opacity: 0.3;
  pointer-events: none;
}

.share-card[data-element="wood"] { --element-color: rgba(74, 222, 128, 0.2); }
.share-card[data-element="fire"] { --element-color: rgba(248, 113, 113, 0.2); }
.share-card[data-element="earth"] { --element-color: rgba(251, 191, 36, 0.2); }
.share-card[data-element="metal"] { --element-color: rgba(161, 161, 170, 0.2); }
.share-card[data-element="water"] { --element-color: rgba(96, 165, 250, 0.2); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.element-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-dim);
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  font-family: var(--font-serif);
  letter-spacing: 0.05em;
}
.element-icon {
  font-size: 1.1em;
}
.element-kanji {
  font-family: var(--font-serif);
  font-size: 1.3em;
  font-weight: 700;
  opacity: 0.9;
}

/* Element-specific badge colors */
.element-badge[data-element="wood"] { color: var(--wood); border-color: rgba(74, 222, 128, 0.3); }
.element-badge[data-element="fire"] { color: var(--fire); border-color: rgba(248, 113, 113, 0.3); }
.element-badge[data-element="earth"] { color: var(--earth); border-color: rgba(251, 191, 36, 0.3); }
.element-badge[data-element="metal"] { color: var(--metal); border-color: rgba(161, 161, 170, 0.3); }
.element-badge[data-element="water"] { color: var(--water); border-color: rgba(96, 165, 250, 0.3); }

.score-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.score {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.score-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

.palm-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-dim);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 16px;
}

.card-summary {
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 0;
  padding: 0 8px;
  font-weight: 400;
  font-family: var(--font-serif);
}

.card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: auto;
  padding-top: 20px;
  position: relative;
  z-index: 1;
}
.pill {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.card-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.card-watermark {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
}

/* ========== Report Section ========== */
.report {
  margin-bottom: 24px;
}
.report h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  color: var(--gold);
}

.report-grid {
  display: grid;
  gap: 12px;
}

.report-section {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.report-section:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
}

.report-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.report-section-icon {
  font-size: 1.2em;
}
.report-section h3 {
  font-size: var(--text-sm);
  color: var(--gold);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-family: var(--font-serif);
}
.report-section p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========== Zodiac Section ========== */
#zodiac-section {
  display: flex;
  justify-content: center;
}
.zodiac-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.zodiac-icon {
  font-size: 1.5em;
}
.zodiac-info {
  text-align: left;
}
.zodiac-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.zodiac-planet {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========== Compatibility Section ========== */
.compatibility-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.compatibility-section h2 {
  font-size: var(--text-lg);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  color: var(--gold);
}
.compat-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.form-compat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-compat input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
.form-compat input::placeholder {
  color: var(--text-dim);
}
.form-compat input:focus {
  outline: none;
  border-color: var(--gold);
}
.form-compat .date-input-group input[type="date"] {
  padding: 14px 16px;
  background: var(--bg-elevated);
}
.form-compat .date-label {
  color: var(--text-muted);
}

.form-compat .gender-select {
  flex-direction: row;
}

.form-compat .btn {
  align-self: center;
  width: auto;
  min-width: 200px;
  margin-top: 4px;
}

.compat-result {
  margin-top: 16px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  text-align: center;
}
.compat-result.hidden {
  display: none !important;
}

.compat-score-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
}
.compat-score {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}
.compat-score-max {
  font-size: 1.25rem;
  color: var(--text-muted);
}

/* Score color based on value */
.compat-score.high { color: var(--wood); }
.compat-score.medium { color: var(--earth); }
.compat-score.low { color: var(--fire); }

.compat-elements {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.compat-element {
  display: flex;
  align-items: center;
  gap: 6px;
}
.compat-element .element-kanji {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--gold);
}
.compat-vs {
  color: var(--text-dim);
}

.compat-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ========== Share Section (Enhanced) ========== */
.share-section {
  margin-top: 32px;
  padding: 0;
}

.share-invite-card {
  background: linear-gradient(135deg, rgba(212, 168, 87, 0.1), rgba(201, 84, 77, 0.1));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 20px;
}

.share-invite-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1); }
  50% { transform: scale(1); }
  75% { transform: scale(1.05); }
}

.share-invite-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.share-invite-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.btn-invite {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), #c9544d);
  border: none;
  font-size: 1rem;
  padding: 14px 20px;
}

.btn-invite:hover {
  background: linear-gradient(135deg, #e5b968, #d4655e);
  transform: translateY(-1px);
}

.share-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.share-divider::before,
.share-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.share-buttons .btn {
  width: 100%;
}

/* Legacy Result Actions */
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.result-actions .btn {
  width: 100%;
}
.save-tip {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 16px 0 0;
  text-align: center;
}

/* ========== Toast Notification ========== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast-icon {
  color: var(--gold);
}

/* ========== Utilities ========== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========== Responsive ========== */

/* Small mobile (380px and below) */
@media (max-width: 380px) {
  #app {
    padding: 16px 16px 90px;
  }
  .share-card {
    padding: 20px 16px;
  }
  .score {
    font-size: 1.75rem;
  }
  .card-summary {
    font-size: 1rem;
  }
  .result-actions {
    grid-template-columns: 1fr;
  }
  .gender-select {
    flex-direction: column;
  }
  .form-actions {
    flex-direction: column;
  }
  .form-actions .btn-ghost {
    order: 2;
  }
  .form-actions .btn-primary {
    order: 1;
    width: 100%;
  }
}

/* Tablet (768px and above) */
@media (min-width: 768px) {
  body {
    font-size: 17px;
  }

  #app {
    max-width: 600px;
    padding: 40px 32px 100px;
  }

  .brand h1 {
    font-size: 2.25rem;
  }

  .tagline {
    font-size: 1.15rem;
  }

  .hero-icon {
    width: 100px;
    height: 100px;
    font-size: 42px;
    margin-bottom: 24px;
  }

  .subheadline {
    font-size: 1.1rem;
  }

  #screen-home .brand h1 {
    font-size: 2.5rem;
  }

  #screen-home .tagline {
    font-size: 1.5rem;
    line-height: 1.36;
  }

  #screen-home .subheadline {
    font-size: 1.16rem;
  }

  #screen-home {
    padding-top: clamp(28px, 4vh, 56px);
  }

  .cta-group {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
  .cta-group .btn {
    flex: 0 0 auto;
    min-width: 200px;
  }

  .trust {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
  }

  .home-showcase {
    margin-top: 34px;
  }

  .home-showcase-head h2 {
    font-size: 1.2rem;
  }

  .home-showcase-scroll {
    gap: 14px;
  }

  .home-showcase-card {
    flex-basis: 300px;
    min-width: 300px;
  }

  .upload-zone {
    padding: 60px 40px;
  }
  .upload-icon {
    font-size: 56px;
  }
  .upload-label {
    font-size: 1.25rem;
  }

  .image-preview {
    max-height: 450px;
  }
  .highlight-canvas {
    max-height: 450px;
  }

  .share-card {
    max-height: 70vh;
    padding: 32px 28px;
  }
  .card-summary {
    font-size: 1.3rem;
  }

  .report-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .compatibility-section {
    padding: 28px;
  }

  .form-compat {
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
  }
  .form-compat input[type="text"] {
    width: 100%;
  }
  .form-compat .date-input-group {
    width: 100%;
  }
  .form-compat .gender-select {
    flex-direction: row;
  }
  .form-compat .btn {
    align-self: center;
    min-width: 200px;
  }

  .compat-result {
    padding: 28px;
  }
  .compat-score {
    font-size: 3.5rem;
  }

  .lucky-info {
    justify-content: center;
  }

  .age-advice-section,
  .personality-section {
    padding: 28px;
  }

  .lang-selector {
    top: 24px;
    right: 24px;
  }
  .lang-selector select {
    padding: 10px 16px;
    padding-right: 32px;
    font-size: 0.9rem;
  }

  .toast {
    bottom: 32px;
    padding: 16px 28px;
    font-size: 1rem;
  }
}

/* Desktop (1024px and above) */
@media (min-width: 1024px) {
  body {
    font-size: 18px;
  }

  #app {
    max-width: 720px;
    padding: 48px 40px 120px;
  }

  .brand h1 {
    font-size: 2.5rem;
  }

  .hero-icon {
    width: 110px;
    height: 110px;
    font-size: 48px;
  }

  .btn {
    padding: 18px 32px;
    font-size: 1.05rem;
  }
  .btn:hover {
    transform: translateY(-3px);
  }

  .home-showcase-scroll {
    gap: 16px;
  }

  .home-showcase-card {
    flex-basis: 320px;
    min-width: 320px;
  }

  #screen-home {
    padding-top: clamp(44px, 6vh, 84px);
  }

  .upload-zone {
    padding: 70px 50px;
  }
  .upload-zone:hover {
    transform: scale(1.01);
  }

  .share-card {
    padding: 36px 32px;
  }
  .score {
    font-size: 2.5rem;
  }
  .card-summary {
    font-size: 1.4rem;
    padding: 0 16px;
  }

  .report-section {
    padding: 20px;
  }
  .report-section p {
    font-size: 0.95rem;
  }

  .form-reading input {
    padding: 18px;
    font-size: 1.05rem;
  }

  .gender-label {
    padding: 16px 20px;
    font-size: 1rem;
  }
}

/* Large Desktop (1200px and above) */
@media (min-width: 1200px) {
  #app {
    max-width: 800px;
    padding: 56px 48px 140px;
  }

  .brand h1 {
    font-size: 2.75rem;
  }

  .tagline {
    font-size: 1.25rem;
  }

  .cta-group .btn {
    min-width: 240px;
    padding: 20px 36px;
  }

  .share-card {
    max-height: 75vh;
    padding: 40px 36px;
  }

  .report-grid {
    gap: 16px;
  }
  .report-section {
    padding: 24px;
  }

  .compat-score {
    font-size: 4rem;
  }
}

/* Extra large screens - center content with max width */
@media (min-width: 1400px) {
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #app {
    max-width: 850px;
    width: 100%;
  }

  .site-footer {
    max-width: 850px;
    width: 100%;
  }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  #app {
    padding-bottom: 60px;
  }

  .hero-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
    margin-bottom: 12px;
  }

  .brand {
    margin-bottom: 16px;
  }

  .step-indicator {
    margin-bottom: 16px;
  }

  .share-card {
    aspect-ratio: auto;
    max-height: none;
    min-height: 400px;
  }

  .upload-zone {
    padding: 24px 20px;
  }

  .analyzing {
    padding: 24px 20px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }
  .btn:active {
    transform: scale(0.97);
  }

  .upload-zone:hover {
    transform: none;
  }

  .report-section:hover {
    background: var(--bg-card);
    border-color: var(--border);
    border-left-color: var(--gold-dim);
  }

  .home-showcase-card:hover {
    transform: none;
    box-shadow: var(--shadow-card);
    border-color: var(--border-light);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-icon {
    animation: none;
  }

  .screen {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #3a4a5a;
    --border-light: #4a5a6a;
    --text-muted: #9aacbe;
    --text-dim: #6a7c8e;
  }

  .btn-primary {
    border: 2px solid var(--gold);
  }

  .share-card {
    border-width: 2px;
  }
}

/* ========== Focus Visible ========== */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ========== Language Selector ========== */
.lang-selector {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
}
.lang-selector select {
  background: var(--bg-glass);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a8c9e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.lang-selector select:hover {
  border-color: var(--gold);
}
.lang-selector select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.lang-selector select option {
  background: var(--bg-card);
  color: var(--text);
}

/* ========== Enhanced Fortune Sections ========== */

/* Report detail (strength/caution) */
.report-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.report-detail p {
  margin: 6px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.fortune-strength {
  color: var(--gold);
}
.fortune-caution {
  color: var(--text-muted);
}

/* Age advice section */
.age-advice-section {
  margin: 24px 0;
  padding: 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.age-advice-section h2 {
  font-size: 1.1rem;
  margin: 0 0 16px 0;
  color: var(--gold);
  font-family: var(--font-serif);
  text-align: center;
}
.age-advice-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.age-stage {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
  padding: 4px 12px;
  background: var(--gold-dim);
  border-radius: var(--radius-pill);
  display: inline-block;
  font-family: var(--font-serif);
}
.age-advice-text {
  margin: 12px 0 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Lucky info */
.lucky-info {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.lucky-item {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

/* Personality section */
.personality-section {
  margin: 24px 0;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border-radius: var(--radius);
  border: 1px solid var(--gold-dim);
}
.personality-section h2 {
  font-size: 1.1rem;
  margin: 0 0 12px 0;
  color: var(--gold);
  font-family: var(--font-serif);
  text-align: center;
}
.personality-core {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  text-align: center;
  padding: 8px 0;
}
.personality-section:empty,
.personality-core:empty {
  display: none;
}

/* Section icon */
.section-icon {
  margin-right: 8px;
}

/* ========== Enhanced Compatibility ========== */

.compat-level {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 8px 0 16px 0;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  display: inline-block;
}
.compat-level.best {
  background: linear-gradient(135deg, #4ade80, #2dd4bf);
  color: var(--bg);
}
.compat-level.good {
  background: var(--gold);
  color: var(--bg);
}
.compat-level.normal {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.compat-level.conflict {
  background: #fbbf24;
  color: var(--bg);
}
.compat-level.clash {
  background: #f87171;
  color: white;
}

.compat-animals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 1.1rem;
}
.compat-animal {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.elem-compat {
  margin: 12px 0;
}
.elem-compat-badge {
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.elem-compat-badge.generating {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold);
}
.elem-compat-badge.overcoming {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid #f87171;
}
.elem-compat-badge.neutral {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.compat-story {
  font-style: italic;
  color: var(--text-muted);
  margin: 16px 0;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
  font-family: var(--font-serif);
}

.compat-advice {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-align: left;
}
.compat-advice strong {
  color: var(--gold);
}
.compat-advice ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}
.compat-advice li {
  margin: 6px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Hide empty sections */
.age-advice-section.hidden,
.personality-section:empty {
  display: none;
}

/* ========== Report section enhancements ========== */
.report-section {
  transition: all 0.3s ease;
}
.report-section:hover {
  background: var(--bg-elevated);
}

/* ========== Eastern Decorative Elements ========== */

/* Seal-style watermark for share card */
.card-watermark {
  font-family: var(--font-serif);
  letter-spacing: 0.1em;
  color: var(--gold);
  opacity: 0.7;
  position: relative;
}
.card-watermark::before {
  content: '印';
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--crimson);
  opacity: 0.6;
}

/* Eastern divider style */
.eastern-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--gold-dim);
}
.eastern-divider::before,
.eastern-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.eastern-divider span {
  font-size: 0.8rem;
  color: var(--gold);
  opacity: 0.6;
}

/* Bagua symbol styling */
.bagua-symbol {
  font-family: sans-serif;
  color: var(--gold);
}

/* Five elements enhanced styling */
.element-badge[data-element="wood"] {
  color: var(--wood);
  border-color: rgba(74, 222, 128, 0.3);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), transparent);
}
.element-badge[data-element="fire"] {
  color: var(--fire);
  border-color: rgba(248, 113, 113, 0.3);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.1), transparent);
}
.element-badge[data-element="earth"] {
  color: var(--earth);
  border-color: rgba(251, 191, 36, 0.3);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), transparent);
}
.element-badge[data-element="metal"] {
  color: var(--metal);
  border-color: rgba(161, 161, 170, 0.3);
  background: linear-gradient(135deg, rgba(161, 161, 170, 0.1), transparent);
}
.element-badge[data-element="water"] {
  color: var(--water);
  border-color: rgba(96, 165, 250, 0.3);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), transparent);
}

/* Score with Eastern style */
.score {
  font-family: var(--font-serif);
  background: linear-gradient(135deg, var(--gold) 0%, #f0d78c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Report section Eastern border accent */
.report-section {
  border-left: 2px solid var(--gold-dim);
}
.report-section:hover {
  border-left-color: var(--gold);
}

/* Palm type badge Eastern style */
.palm-type-badge {
  background: var(--gold-dim);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-serif);
  letter-spacing: 0.05em;
}

/* Zodiac badge Eastern enhancement */
.zodiac-badge {
  border-color: var(--gold-dim);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
}
.zodiac-name {
  font-family: var(--font-serif);
  color: var(--gold);
}

/* Compatibility section Eastern style */
.compatibility-section {
  border-color: var(--gold-dim);
  position: relative;
}
.compatibility-section::before {
  content: '緣';
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.08;
  font-family: var(--font-serif);
}

/* Age advice Eastern style */
.age-advice-section {
  border-color: var(--gold-dim);
  position: relative;
}
.age-advice-section::before {
  content: '運';
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.08;
  font-family: var(--font-serif);
}

/* Personality section Eastern style */
.personality-section {
  border-color: var(--gold-dim);
  position: relative;
}
.personality-section::before {
  content: '命';
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.08;
  font-family: var(--font-serif);
}

/* Pill/keyword Eastern refinement */
.pill {
  font-family: var(--font-serif);
  letter-spacing: 0.03em;
  border-color: var(--gold-dim);
}

/* SEO Articles Nav */
.seo-articles {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 32px 20px 0;
  border-top: 1px solid var(--border);
}

.seo-articles h2 {
  font-family: var(--font-serif);
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.seo-articles ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 24px;
}

.seo-articles a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.8;
  transition: color 0.2s;
}

.seo-articles a:hover {
  color: var(--gold);
}

/* Site Footer */
.site-footer {
  margin-top: 48px;
  padding: 24px 20px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-copy {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin: 0;
}

/* ========== Partner Palm Upload Section (v2) ========== */

.partner-palm-section {
  margin-bottom: 16px;
}

.partner-palm-upload {
  position: relative;
}

.partner-upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-elevated);
}

.partner-upload-zone:hover {
  border-color: var(--gold);
  background: var(--bg-card);
}

.partner-upload-zone .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.partner-upload-zone .upload-label {
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.partner-upload-zone .upload-hint {
  font-size: 0.8rem;
  margin: 0;
}

/* Partner palm preview */
.partner-palm-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.partner-palm-preview .image-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
}

.partner-palm-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-glass);
  border-top: 1px solid var(--border);
}

.palm-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.palm-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: pulse 1s ease-in-out infinite;
}

.palm-status.detected .status-dot {
  background: var(--gold);
  animation: none;
  box-shadow: 0 0 6px var(--gold);
}

.palm-status.detected {
  color: var(--gold);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--fire);
}

/* Partner palm result badge */
.partner-palm-result {
  margin-top: 12px;
  text-align: center;
}

.palm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--gold-dim);
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold-dim);
  font-size: 0.9rem;
  color: var(--gold);
  font-family: var(--font-serif);
}

.palm-badge .palm-icon {
  font-size: 1.1em;
}

/* Partner gender select */
.partner-gender {
  margin-bottom: 4px;
}

/* ========== Palm Synergy Section ========== */

.palm-synergy-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.palm-synergy-section h3 {
  font-size: 1rem;
  margin: 0 0 16px;
  color: var(--gold);
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Palm comparison */
.palm-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.palm-comparison .palm-badge.me {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.palm-comparison .palm-badge.partner {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.synergy-vs {
  font-size: 1.2rem;
  color: var(--text-dim);
}

/* Synergy score display */
.synergy-score-display {
  text-align: center;
  margin-bottom: 16px;
}

.synergy-score {
  font-family: var(--font-serif); font-variant-numeric: tabular-nums;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, #f0d78c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.synergy-level-text {
  display: block;
  font-size: 0.9rem;
  color: var(--gold);
  margin-top: 4px;
  font-family: var(--font-serif);
}

/* Relationship type tabs */
.relationship-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.rel-tab {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rel-tab:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.rel-tab.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

/* Synergy detail */
.synergy-detail {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.synergy-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.synergy-description p {
  margin: 0 0 8px;
}

.synergy-description p:last-child {
  margin-bottom: 0;
}

/* Synergy summary (best/worst match) */
.synergy-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.summary-item.best {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.summary-item.worst {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.summary-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.summary-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.summary-item.best .summary-value {
  color: var(--wood);
}

.summary-item.worst .summary-value {
  color: var(--earth);
}

.summary-score {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Responsive adjustments for synergy */
@media (max-width: 380px) {
  .relationship-tabs {
    gap: 6px;
  }

  .rel-tab {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .synergy-summary {
    grid-template-columns: 1fr;
  }

  .palm-comparison {
    flex-direction: column;
    gap: 8px;
  }

  .synergy-vs {
    transform: rotate(90deg);
  }
}

/* Palm insight box in compatibility */
.palm-insight-box {
  background: linear-gradient(135deg, var(--gold-dim), rgba(45, 212, 191, 0.1));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  text-align: left;
}

.palm-insight-box strong {
  color: var(--gold);
  font-size: 0.9rem;
}

.palm-insight-box p {
  margin: 8px 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.palm-synergy-score {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.palm-hint-box {
  background: var(--bg-elevated);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  text-align: center;
}

.palm-hint-box span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Synergy overview */
.synergy-overview {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--gold);
}

.synergy-overview .overview-text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Palm characteristics display */
.palm-char-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.char-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 40px;
}

.char-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mini-pill {
  padding: 2px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.char-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Palm badge variations */
.palm-badge.highlight {
  background: linear-gradient(135deg, var(--gold-dim), var(--accent-dim));
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Synergy description enhancements */
.synergy-description p:first-child {
  font-weight: 500;
  color: var(--text);
}

.synergy-description p:last-child {
  color: var(--gold);
  font-style: italic;
}

@media (min-width: 768px) {
  .partner-upload-zone {
    padding: 28px 20px;
  }

  .partner-palm-preview .image-preview {
    max-height: 250px;
  }

  .relationship-tabs {
    gap: 10px;
  }

  .rel-tab {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .synergy-score {
    font-size: 3rem;
  }
}

/* ========================================
   Compatibility Result Styles (Unified UI)
   ======================================== */

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

/* Result Card */
.compat-result-card {
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.compat-score-circle {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.compat-score-circle .score-number {
  font-size: 4rem;
  font-weight: 700;
  font-family: var(--font-serif); font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.compat-score-circle .score-unit {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.compat-level-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

.compat-level-badge.high {
  background: rgba(74, 222, 128, 0.15);
  border-color: var(--wood);
  color: var(--wood);
}

.compat-level-badge.medium {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.compat-level-badge.low {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--fire);
  color: var(--fire);
}

/* Person Comparison */
.person-comparison {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.person-card {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.person-card.me {
  border-color: var(--accent-dark);
}

.person-card.partner {
  border-color: var(--gold);
}

.person-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.person-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.person-elements {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0.5rem;
}

.person-card .element-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--bg-card);
  border-radius: var(--radius-pill);
}

.person-card .animal-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.palm-badge-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 3px 8px;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  color: var(--gold);
  margin-top: 0.5rem;
}

.vs-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

/* Section Blocks in Result */
.compat-section-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.compat-section-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.compat-section-block .section-icon {
  font-size: 1.1rem;
}

.compat-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Synergy in Result */
.synergy-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.synergy-score-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-serif); font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.synergy-level-badge {
  font-size: 0.8rem;
  padding: 4px 12px;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  color: var(--gold);
}

.compat-summary-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Result Actions */
/* Responsive for Compatibility Result */
@media (max-width: 480px) {
  .compat-score-circle .score-number {
    font-size: 3rem;
  }

  .person-comparison {
    gap: 8px;
  }

  .person-card {
    padding: 0.75rem;
  }

  .vs-icon {
    font-size: 1.2rem;
  }
}

@media (min-width: 768px) {
  .compat-result-card {
    padding: 2.5rem;
  }

  .compat-score-circle .score-number {
    font-size: 5rem;
  }
}

/* ========================================
   Palm Analysis Section (Landmark-based)
   ======================================== */

.palm-analysis-section {
  margin: 24px 0;
}

.palm-analysis-section .section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  color: var(--gold);
}

.palm-analysis-section .section-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 16px;
}

.palm-analysis-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.palm-analysis-card {
  background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.palm-analysis-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, var(--gold));
}

.palm-analysis-card[data-category="love"] {
  --card-accent: #f472b6;
}

.palm-analysis-card[data-category="investment"] {
  --card-accent: #fbbf24;
}

.palm-analysis-card[data-category="career"] {
  --card-accent: #60a5fa;
}

.palm-analysis-card[data-category="health"] {
  --card-accent: #4ade80;
}

.palm-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.palm-card-icon {
  font-size: 1.2rem;
}

.palm-card-title-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.palm-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.palm-card-line {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.palm-card-score {
  font-family: var(--font-sans); font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  min-width: 55px;
  text-align: center;
}

.palm-card-body {
  padding-left: 32px;
}

.palm-card-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ========================================
   Fortune Category Cards (Swipeable)
   ======================================== */

.fortune-cards-section {
  margin: 24px 0;
}

.fortune-cards-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  color: var(--gold);
}

.fortune-cards-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 16px;
  text-align: center;
  text-align: center;
}

.fortune-cards-container {
  position: relative;
  margin: 0 -20px;
  padding: 0 20px;
}

.fortune-cards-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.fortune-cards-scroll::-webkit-scrollbar {
  display: none;
}

/* Fortune Card */
.fortune-card {
  flex: 0 0 280px;
  scroll-snap-align: center;
  background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 360px;
}

.fortune-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--gold));
}

/* Card category colors */
.fortune-card[data-category="love"] {
  --card-accent: #f472b6;
}
.fortune-card[data-category="money"] {
  --card-accent: var(--earth);
}
.fortune-card[data-category="career"] {
  --card-accent: var(--accent);
}
.fortune-card[data-category="health"] {
  --card-accent: var(--wood);
}
.fortune-card[data-category="social"] {
  --card-accent: var(--water);
}

.fortune-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.fortune-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fortune-card-icon {
  font-size: 1.5rem;
}

.fortune-card-title-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.fortune-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-serif);
}

.fortune-card-line {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.fortune-card-score {
  font-family: var(--font-sans); font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 700;
  color: var(--card-accent, var(--gold));
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  min-width: 55px;
  text-align: center;
}

.fortune-card-body {
  flex: 1;
  min-height: 0;
}

.fortune-card-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.72;
  margin: 0;
  max-height: 13.8em;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  text-wrap: pretty;
}

.fortune-card-tldr {
  margin: 0 0 10px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--card-accent, var(--gold)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--gold)) 28%, transparent);
}

.fortune-cards-section.lang-es .fortune-card-text {
  line-height: 1.78;
  max-height: 15.2em;
}

.fortune-cards-section.lang-ja .fortune-card-text {
  line-height: 1.82;
  max-height: 16.2em;
}

.fortune-card-text::-webkit-scrollbar {
  width: 6px;
}

.fortune-card-text::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 999px;
}

.fortune-card-text::-webkit-scrollbar-track {
  background: transparent;
}

.fortune-card-detail {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.fortune-card-detail .fortune-strength {
  font-size: 0.8rem;
  color: var(--gold);
  margin: 0 0 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.fortune-card-detail .fortune-strength::before {
  content: '💪';
  flex-shrink: 0;
}

.fortune-card-detail .fortune-caution {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.fortune-card-detail .fortune-caution::before {
  content: '⚠️';
  flex-shrink: 0;
}

.fortune-card-detail .fortune-strength:empty,
.fortune-card-detail .fortune-caution:empty {
  display: none;
}

.fortune-card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.fortune-card-date {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-sans); font-variant-numeric: tabular-nums;
}

/* Card Indicator Dots */
.fortune-cards-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.fortune-cards-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
  transition: all 0.3s ease;
  cursor: pointer;
}

.fortune-cards-dots .dot.active {
  background: var(--gold);
  transform: scale(1.2);
}

.fortune-cards-dots .dot:hover {
  background: var(--gold-dim);
}

/* Responsive for cards */
@media (max-width: 380px) {
  .fortune-card {
    flex: 0 0 260px;
    padding: 16px;
  }

  .fortune-card-text {
    font-size: 0.85rem;
  }
}

@media (min-width: 768px) {
  .fortune-cards-container {
    margin: 0;
    padding: 0;
  }

  .fortune-card {
    flex: 0 0 320px;
    padding: 24px;
    min-height: 390px;
  }

  .fortune-card-text {
    font-size: 0.95rem;
    max-height: 15.5em;
  }

  .fortune-card-tldr {
    font-size: 0.84rem;
  }

  .fortune-cards-section.lang-es .fortune-card-text {
    max-height: 17.2em;
  }

  .fortune-cards-section.lang-ja .fortune-card-text {
    max-height: 18.2em;
  }

  .fortune-cards-scroll {
    padding: 12px 8px 20px;
  }
}

@media (min-width: 1024px) {
  .fortune-cards-scroll {
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .fortune-card {
    flex: 0 0 calc(50% - 12px);
    max-width: 340px;
  }

  .fortune-cards-dots {
    display: none;
  }

  .fortune-cards-hint {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   COMPATIBILITY RESULT UI v3 - Enhanced Professional Report
   ═══════════════════════════════════════════════════════════════ */

/* Hero Section */
.compat-hero-section {
  margin-bottom: 24px;
}

.compat-result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px;
  margin-bottom: 24px;
}

.compat-score-circle {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.5s ease-out;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.compat-score-circle .score-number {
  font-size: 3rem;
  font-weight: 700;
  font-family: var(--font-serif);
  background: linear-gradient(135deg, var(--gold) 0%, #f0d78c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.compat-score-circle .score-unit {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.compat-level-badge {
  margin-top: 16px;
  padding: 8px 20px;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--gold);
}

/* Detail Cards (common style) */
.compat-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  animation: cardSlideIn 0.5s ease-out;
}

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

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.detail-card-icon {
  font-size: 1.5rem;
}

.detail-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--gold);
}

/* Radar Chart Styles */
.radar-chart-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.radar-chart {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
}

.radar-grid-line {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.radar-axes line {
  stroke: var(--border-light);
  stroke-width: 1;
}

.radar-data {
  fill: var(--gold-dim);
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linejoin: round;
  transition: all 0.8s ease-out;
  filter: drop-shadow(0 0 12px var(--gold-glow));
}

.radar-labels text {
  fill: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.radar-dots circle {
  fill: var(--gold);
  stroke: var(--bg-card);
  stroke-width: 2;
  r: 5;
}

/* Radar Scores List */
.radar-scores-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.radar-score-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.dim-label {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 70px;
}

.dim-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--gold) 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 1s ease-out;
}

.dim-value {
  flex: 0 0 30px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  text-align: right;
}

/* Element Harmony Card */
.element-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
}

.element-comparison {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0;
}

.element-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.element-big-icon {
  font-size: 3rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.element-kanji-big {
  font-size: 2rem;
  font-family: var(--font-serif);
  color: var(--gold);
  font-weight: 700;
}

.element-name-display {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.element-relation-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
}

.element-relation-icon {
  font-size: 2rem;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.element-relation-label {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--gold);
}

.element-relation-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.element-desc {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  font-family: var(--font-serif);
}

/* Zodiac Story Card */
.zodiac-story-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(212, 168, 87, 0.05) 100%);
}

.zodiac-comparison {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
}

.zodiac-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.zodiac-big-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.zodiac-name-display {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.zodiac-relation-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.zodiac-compat-type {
  padding: 8px 16px;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--gold);
}

.zodiac-narrative {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.zodiac-story-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--gold);
}

.zodiac-story-content {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  font-family: var(--font-serif);
}

.zodiac-traits-row {
  padding: 12px 0;
}

.trait-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trait-pill {
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--text);
}

.zodiac-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 12px;
}

.pros, .cons {
  padding: 12px;
  border-radius: var(--radius-sm);
}

.pros {
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.cons {
  background: rgba(212, 168, 87, 0.1);
  border: 1px solid rgba(212, 168, 87, 0.3);
}

.pros-label, .cons-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.pros-list, .cons-list {
  margin: 0;
  padding-left: 16px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.pros-list li, .cons-list li {
  margin-bottom: 4px;
}

/* Advice Section */
.advice-section {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(45, 212, 191, 0.03) 100%);
}

.advice-cards-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.advice-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.advice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.advice-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-dim);
  border-radius: 50%;
  font-size: 1.4rem;
}

.advice-content {
  flex: 1;
}

.advice-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  font-family: var(--font-serif);
}

.advice-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Summary Card */
.summary-card .compat-summary-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  font-family: var(--font-serif);
  text-align: center;
  padding: 8px 0;
}

/* Synergy Card (existing, enhanced) */
.synergy-card {
  background: var(--bg-card);
}

.synergy-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.synergy-score-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--gold);
}

.synergy-level-badge {
  padding: 6px 14px;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}

/* Count-up Animation */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.score-animate {
  animation: countUp 0.5s ease-out;
}

/* Responsive adjustments for new cards */
@media (max-width: 480px) {
  .compat-score-circle {
    width: 120px;
    height: 120px;
  }

  .compat-score-circle .score-number {
    font-size: 2.5rem;
  }

  .radar-scores-list {
    grid-template-columns: 1fr;
  }

  .element-big-icon, .zodiac-big-icon {
    font-size: 2.5rem;
  }

  .element-kanji-big {
    font-size: 1.5rem;
  }

  .zodiac-pros-cons {
    grid-template-columns: 1fr;
  }

  .element-comparison, .zodiac-comparison {
    flex-direction: column;
    gap: 16px;
  }

  .element-relation-center, .zodiac-relation-center {
    order: -1;
  }

  .element-side, .zodiac-side {
    flex-direction: row;
    gap: 12px;
  }

  .invite-banner {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }

  .invite-envelope-icon {
    font-size: 2rem;
  }

  .invite-sender-badges {
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .radar-chart-container {
    flex-direction: row;
    align-items: flex-start;
  }

  .radar-chart {
    flex: 0 0 280px;
  }

  .radar-scores-list {
    flex: 1;
    grid-template-columns: 1fr;
  }

  .advice-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .advice-card {
    flex-direction: column;
    text-align: center;
  }

  .advice-icon {
    margin: 0 auto;
  }
}

/* ========== Invite Banner (screen-result integrated) ========== */
.invite-banner {
  background: linear-gradient(135deg, rgba(212, 168, 87, 0.15), rgba(201, 84, 77, 0.1));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.invite-envelope-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  animation: floatEnvelope 2s ease-in-out infinite;
}

.invite-banner-content {
  flex: 1;
}

.invite-banner-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.4;
}

.invite-banner-title span:first-child {
  color: var(--gold);
  font-weight: 700;
}

.invite-banner-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.invite-sender-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Inline Palm Upload for Invite */
.invite-palm-upload-inline {
  margin-bottom: 16px;
}

.palm-upload-content-inline {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.palm-upload-content-inline:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.palm-upload-content-inline .upload-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.palm-upload-content-inline .upload-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 4px;
}

.palm-upload-content-inline .upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.palm-preview-inline {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.palm-preview-inline .palm-preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.palm-preview-inline .palm-status-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-remove-inline {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-remove-inline:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.palm-result-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 500;
}

.palm-result-inline .palm-icon {
  font-size: 1.2rem;
}

/* ========== Invite Screen (legacy styles) ========== */
.invite-card {
  background: linear-gradient(135deg, rgba(212, 168, 87, 0.15), rgba(201, 84, 77, 0.1));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 24px;
}

.invite-envelope {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: floatEnvelope 2s ease-in-out infinite;
}

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

.invite-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.4;
}

.invite-title span:first-child {
  color: var(--gold);
  display: block;
  font-size: 1.4rem;
}

.invite-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.invite-sender-info {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sender-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--text);
}

.sender-badge .element-icon,
.sender-badge .zodiac-icon,
.sender-badge .palm-icon {
  font-size: 1rem;
}

.invite-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
}

.invite-divider::before,
.invite-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.divider-text {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}

.invite-form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.invite-form-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px;
  text-align: center;
}

.invite-palm-upload {
  margin-bottom: 20px;
}

.invite-palm-upload .palm-upload-content {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.invite-palm-upload .palm-upload-content:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.invite-palm-preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.invite-palm-preview .palm-preview-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
}

.invite-palm-preview .palm-preview-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.palm-result-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 500;
}

.invite-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.invite-form .btn-lg {
  margin-top: 8px;
  padding: 16px 24px;
  font-size: 1.05rem;
}

.invite-result {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* Invite Result Card */
.invite-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.invite-result-score {
  font-size: 4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}

.invite-result-max {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.invite-result-level {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 20px;
}

.invite-result-names {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.invite-name-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.invite-name-badge .name {
  font-weight: 600;
  color: var(--text);
}

.invite-name-badge .element {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.invite-result-summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.invite-result-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.invite-result-actions .btn {
  flex: 1;
}

/* ========================================
   Popular Readings Section (SEO Links)
======================================== */
.popular-readings-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  border-top: 1px solid var(--border);
}

.popular-readings-section h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 8px;
}

.popular-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 24px;
}

.popular-readings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.popular-reading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.popular-reading-card:hover {
  border-color: var(--gold);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

.popular-reading-card .card-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.popular-reading-card .card-title {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

.popular-reading-card .card-desc {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

/* Mobile: 2 columns */
@media (max-width: 480px) {
  .popular-readings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .popular-reading-card {
    padding: 14px 10px;
  }
}

/* ========================================
   Related Readings (Landing Pages)
======================================== */
.related-readings {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related-readings h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 16px;
}

.related-readings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.related-reading-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.related-reading-link:hover {
  border-color: var(--gold);
  background: var(--bg-elevated);
}

.related-reading-link .link-icon {
  font-size: 1.25rem;
}

.related-reading-link .link-text {
  color: var(--text);
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .related-readings-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Image Placeholders ========== */

/* 1. Hero Background Image */
#screen-home {
  position: relative;
}

.hero-bg {
  position: absolute;
  top: -24px;
  left: -20px;
  right: -20px;
  height: 400px;
  background-image: url('images/hero-palm-bg-480.webp');
  /* Placeholder: https://placehold.co/800x600/0a0e12/d4a857?text=Palm+Background */
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0.3;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}

/* Fallback gradient when no image */
.hero-bg.no-image {
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 20%, var(--gold-dim), transparent),
    radial-gradient(circle at 30% 70%, rgba(45, 212, 191, 0.1), transparent);
  opacity: 1;
}

/* 2. Upload Zone */
.upload-zone {
  position: relative;
}

/* 3. Result Card Background Pattern */
.fortune-card,
.palm-analysis-card {
  position: relative;
  overflow: hidden;
}

.fortune-card::before,
.palm-analysis-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background-image: url('images/pattern-eastern.svg');
  /* Placeholder: decorative eastern pattern */
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.05;
  pointer-events: none;
}

/* 4. SEO Landing Page Hero Image */
.landing-hero-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.landing-hero-img.placeholder {
  height: 200px;
  background: var(--bg-elevated);
  background-image: url('images/palm-diagram-placeholder.webp');
  /* Will be replaced with specific line diagrams */
  background-size: cover;
  background-position: center;
}

/* 5. About Page Feature Images */
.about .feature-img {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-sm);
}

.about .hero-visual {
  width: 100%;
  max-width: 300px;
  height: 200px;
  margin: 0 auto 24px;
  background-image: url('images/about-hero-300.webp');
  /* Placeholder: https://placehold.co/600x400/0a0e12/d4a857?text=PalmMate */
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  border: 1px solid var(--gold-dim);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

@media (min-width: 768px) {
  .hero-bg {
    background-image: url('images/hero-palm-bg.webp');
  }

  .about .hero-visual {
    background-image: url('images/about-hero.webp');
  }
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .hero-bg {
    height: 500px;
  }

  .landing-hero-img {
    max-width: 500px;
  }

  .about .hero-visual {
    max-width: 400px;
    height: 260px;
  }
}
