/* ============================================================================
   CDARS — CHURCH DOMAIN (v5.1 — LIVING GOLD · MOBILE PERFECTED)
   FILE: /assets/domains/church/church.css

   GOLD JURISDICTION · HONOR · WORTH · GLORY · FORMATION · ALIGNMENT
   
   MOBILE OPTIMIZATIONS:
   - Stack everything vertically on small screens
   - Reduce font sizes proportionally
   - Ensure touch targets are at least 44px
   - Prevent horizontal overflow
   - Fix accordion visibility on mobile
   - Adjust crown jewels for touch
   - Make flip cards usable on small screens
   ============================================================================ */

/* ============================================================================
   CORE VARIABLES — GOLDEN TOKENS
   ============================================================================ */

:root {
  /* Gold Jurisdiction */
  --gold: #FFD700;
  --gold-dark: #8B7500;
  --gold-light: #FFED4E;
  --gold-dawn: #FFB347;
  --gold-glow: rgba(255, 215, 0, 0.3);
  --gold-soft: rgba(255, 215, 0, 0.1);
  --gold-dim: rgba(255, 215, 0, 0.05);

  /* Text Layers */
  --ink: rgba(255, 255, 255, 0.92);
  --ink-muted: rgba(255, 255, 255, 0.68);
  --ink-soft: rgba(255, 255, 255, 0.45);

  /* Panel Layers */
  --panel: rgba(10, 14, 22, 0.62);
  --panel2: rgba(10, 14, 22, 0.42);
  --panel-deep: rgba(5, 8, 15, 0.72);
  --panel-edge: rgba(255, 255, 255, 0.10);
  --panel-edge-gold: rgba(255, 215, 0, 0.20);

  /* Shadows */
  --shadow-soft: 0 1px 1px rgba(0,0,0,0.04),
                 0 2px 2px rgba(0,0,0,0.04),
                 0 4px 4px rgba(0,0,0,0.04),
                 0 8px 8px rgba(0,0,0,0.04),
                 0 16px 16px rgba(0,0,0,0.04);
  --shadow-medium: 0 14px 40px rgba(0,0,0,0.35);
  --shadow-deep: 0 18px 60px rgba(0,0,0,0.55);
  --shadow-lift: 0 20px 60px rgba(0,0,0,0.65);
  --shadow-glow: 0 0 20px rgba(255,215,0,0.18),
                 0 0 60px rgba(255,215,0,0.08);

  /* Geometry */
  --phi: 1.618;
  --radius: 22px;
  --radius2: 18px;
  --radius3: 14px;

  /* Motion Curves */
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-slow: cubic-bezier(0.4,0,0.2,1);
  --ease-breathe: cubic-bezier(0.2,0.8,0.2,1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-pressure: cubic-bezier(0.2, 0.9, 0.3, 1.2);
  --ease-3d: cubic-bezier(0.23, 1, 0.32, 1);

  /* Mouse Position (set by JS) */
  --mouse-x: 50%;
  --mouse-y: 50%;

  /* Z-Index Law */
  --z-underlay: -3;
  --z-geometry: -1;
  --z-base: 0;
  --z-surface: 10;
  --z-nav: 50;
  --z-float: 9000;
  --z-modal: 9999;
  --z-debug: 999999;
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #05070c;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================================
   DOMAIN TOKENS
   ============================================================================ */

.domain-church {
  --gold: #FFD700;
  --primary-glow: rgba(255, 215, 0, 0.10);
  --secondary-glow: rgba(255, 215, 0, 0.05);
}

/* ============================================================================
   REALM — GOLDEN LIVING SPACE
   ============================================================================ */

.realm {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  padding: 20px 16px 40px;
  transition: background 1.2s var(--ease-slow);
  transform-style: preserve-3d;
  perspective: 1000px;
  z-index: var(--z-base);
  width: 100%;
  overflow-x: hidden;
}

/* Temporal States */
.realm.time-night {
  --gold: var(--gold-light);
  --panel: var(--panel-deep);
  background: radial-gradient(circle at top, rgba(255, 237, 78, 0.05), #03040a 85%);
}

.realm.time-dawn {
  --gold: var(--gold-dawn);
  background: radial-gradient(circle at top, rgba(255, 179, 71, 0.08), #05070c 70%);
}

.realm.time-day {
  background: radial-gradient(circle at top, rgba(255, 215, 0, 0.03), #05070c 90%);
}

/* Silence Mode */
.realm.mode-silence {
  --ease: var(--ease-slow);
}

.realm.mode-silence .tile {
  animation: none !important;
  filter: saturate(0.7) contrast(1.1);
}

.realm.mode-silence .halo {
  animation-duration: 6s !important;
}

/* Realm Background Layers */
.realm::before,
.realm::after {
  content: "";
  position: absolute;
  inset: -22%;
  z-index: var(--z-underlay);
  pointer-events: none;
}

.realm::before {
  background:
    radial-gradient(800px 500px at 20% 20%, rgba(255, 215, 0, .10), transparent 60%),
    radial-gradient(700px 420px at 80% 30%, rgba(120, 220, 255, .08), transparent 60%),
    radial-gradient(900px 600px at 55% 80%, rgba(160, 120, 255, .10), transparent 62%),
    radial-gradient(1200px 900px at 50% 50%, rgba(255, 255, 255, .03), transparent 65%),
    radial-gradient(2px 2px at 12% 18%, rgba(255, 255, 255, .45) 0, transparent 60%),
    radial-gradient(1px 1px at 28% 76%, rgba(255, 255, 255, .35) 0, transparent 60%),
    radial-gradient(1.5px 1.5px at 72% 38%, rgba(255, 255, 255, .40) 0, transparent 60%),
    radial-gradient(1px 1px at 88% 62%, rgba(255, 255, 255, .28) 0, transparent 60%),
    linear-gradient(180deg, #04060b 0%, #05070c 35%, #03040a 100%);
  filter: saturate(1.15) contrast(1.05);
  animation: realmBreath 16s var(--ease) infinite;
  opacity: .98;
}

.realm::after {
  z-index: calc(var(--z-underlay) + 1);
  inset: -30%;
  background:
    radial-gradient(900px 700px at 30% 55%, rgba(255, 215, 0, .10), transparent 62%),
    radial-gradient(900px 700px at 75% 65%, rgba(120, 220, 255, .07), transparent 62%),
    radial-gradient(1400px 900px at 50% 50%, rgba(0, 0, 0, .35), rgba(0, 0, 0, .88));
  mix-blend-mode: screen;
  animation: realmDrift 26s linear infinite;
  opacity: .20;
  filter: blur(.3px);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: var(--z-surface);
  width: 100%;
  padding: 0;
}

.realm .wrap::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-geometry);
  pointer-events: none;
  background:
    radial-gradient(1000px 700px at var(--mouse-x, 50%) var(--mouse-y, 45%), rgba(255, 215, 0, .06), transparent 62%),
    radial-gradient(1200px 900px at 30% 80%, rgba(120, 220, 255, .05), transparent 70%),
    repeating-conic-gradient(from 0deg, transparent 0deg 137.5deg, rgba(255, 215, 0, 0.015) 137.5deg 137.6deg),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .02) 1px, transparent 1px, transparent 3px);
  opacity: .45;
  mix-blend-mode: soft-light;
  filter: blur(.2px);
  animation: spiralRotate 120s linear infinite;
}

/* Realm Animations */
@keyframes realmBreath {
  0%, 100% { transform: scale(1) translate3d(0, 0, 0); opacity: .95; }
  50% { transform: scale(1.02) translate3d(0, -0.6%, 0); opacity: 1; }
}

@keyframes realmDrift {
  0% { transform: translate3d(-1%, 0, 0) rotate(0deg); }
  50% { transform: translate3d(1%, .6%, 0) rotate(2deg); }
  100% { transform: translate3d(-1%, 0, 0) rotate(0deg); }
}

@keyframes spiralRotate {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   QUANTUM REALITY LAYER — GOLDEN LIVING PHYSICS
   ============================================================================ */

.quantum-reality-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}

.reality-thread {
  position: fixed;
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: screen;
  will-change: transform, opacity;
  opacity: 0.5;
  filter: blur(0.8px) brightness(1.3);
  box-shadow: 0 0 15px currentColor;
}

.quantum-particle {
  position: fixed;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  filter: blur(2px);
  animation: particle-drift linear infinite;
  pointer-events: none;
  z-index: 4;
  opacity: 0.4;
  mix-blend-mode: screen;
}

@keyframes particle-drift {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(100vw, 100vh) rotate(360deg); }
}

.dimensional-echo {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 3;
  opacity: 0.15;
  mix-blend-mode: overlay;
  animation: echo-pulse 8s ease-in-out infinite;
}

@keyframes echo-pulse {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(1.05); }
}

.quantum-entanglement {
  position: fixed;
  pointer-events: none;
  z-index: 5;
}

/* ============================================================================
   PRESENCE SYSTEM — REAL-TIME BUBBLES
   ============================================================================ */

.presence-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.presence-bubble {
  background: var(--panel-deep);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 20px var(--gold-glow);
  animation: bubble-appear 0.3s var(--ease-spring);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.2s var(--ease-pressure);
  position: relative;
}

.presence-bubble:hover {
  transform: scale(1.02) translateX(-5px);
  border-color: var(--gold);
  box-shadow: 0 0 30px var(--gold);
}

.presence-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #000;
  box-shadow: 0 0 15px currentColor;
}

.presence-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.presence-location {
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.presence-role {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--panel-deep);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid currentColor;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.presence-bubble:hover .presence-role {
  opacity: 1;
}

@keyframes bubble-appear {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================================
   JOURNEY VISUALIZATION — PATH TRACKING
   ============================================================================ */

.journey-path {
  position: fixed;
  top: 100px;
  left: 20px;
  z-index: 9998;
  background: var(--panel-deep);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 8px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 20px var(--gold-glow);
  animation: journey-appear 0.5s var(--ease-spring);
  pointer-events: none;
  font-weight: 600;
}

.journey-icon {
  color: var(--gold);
  font-size: 1rem;
}

.journey-steps {
  display: flex;
  gap: 5px;
  color: var(--ink-muted);
}

.journey-step {
  display: flex;
  align-items: center;
  gap: 5px;
}

.journey-step.active {
  color: var(--gold);
  font-weight: 800;
}

.journey-step::after {
  content: '→';
  margin-left: 5px;
  color: var(--ink-soft);
}

.journey-step:last-child::after {
  display: none;
}

@keyframes journey-appear {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================================
   TOPBAR — GOLDEN NAVIGATION
   ============================================================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(10, 14, 22, .70), rgba(10, 14, 22, .35));
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  z-index: var(--z-nav);
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.sigil {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 0, .25);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 215, 0, .35), transparent 55%),
    radial-gradient(circle at 70% 75%, rgba(120, 220, 255, .18), transparent 58%),
    rgba(10, 14, 22, .6);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset, var(--shadow-glow);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.sigil::after {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(6px 6px at 18% 30%, rgba(255, 255, 255, .45), transparent 55%),
    radial-gradient(3px 3px at 65% 65%, rgba(255, 255, 255, .30), transparent 55%),
    radial-gradient(2px 2px at 40% 70%, rgba(255, 255, 255, .25), transparent 60%);
  opacity: .8;
  animation: sigilSpin 18s linear infinite;
}

@keyframes sigilSpin {
  to { transform: rotate(360deg); }
}

.brand h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 700;
  letter-spacing: .4px;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.brand .sub {
  color: var(--ink-muted);
  font-size: clamp(10px, 2.5vw, 12px);
  line-height: 1.25;
  font-weight: 400;
  white-space: nowrap;
}

/* Presence Indicator in Topbar */
.presence-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid var(--gold);
  flex-shrink: 0;
}

.presence-pulse {
  width: 8px;
  height: 8px;
  background: #50ffb4;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.presence-count {
  font-size: 0.8rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Navigation */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

/* ============================================================================
   BUTTONS — GOLDEN INTERACTIONS
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(10, 14, 22, .40);
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
  will-change: transform;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 215, 0, .28);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .35), 0 0 24px var(--gold-glow);
  background: rgba(10, 14, 22, .55);
  outline: none;
}

.btn.gold {
  border-color: rgba(255, 215, 0, .30);
  background: linear-gradient(180deg, rgba(255, 215, 0, .20), rgba(10, 14, 22, .40));
  box-shadow: 0 0 0 1px rgba(255, 215, 0, .14) inset;
}

.user-badge {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.3rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
  white-space: nowrap;
}

/* ============================================================================
   HERO SECTION — GOLDEN MANIFESTO
   ============================================================================ */

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: calc(18px * var(--phi));
  margin-top: 28px;
  align-items: stretch;
  width: 100%;
}

.panel {
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10, 14, 22, .70), rgba(10, 14, 22, .35));
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transition: transform 0.8s var(--ease);
  z-index: var(--z-surface);
  width: 100%;
}

.panel::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(600px 360px at 18% 20%, rgba(255, 215, 0, .14), transparent 55%),
    radial-gradient(520px 300px at 82% 78%, rgba(120, 220, 255, .09), transparent 58%);
  opacity: .75;
  pointer-events: none;
  animation: heroDrift 16s var(--ease) infinite;
}

@keyframes heroDrift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(1.2%, -1.2%, 0); }
}

/* Mouse-Reactive Panel Effects */
.heroLeft,
.heroRight,
.color-meaning,
.category,
.tile {
  position: relative;
  overflow: hidden;
}

.heroLeft::after,
.heroRight::after,
.color-meaning::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                var(--gold-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.heroLeft:hover::after,
.heroRight:hover::after,
.color-meaning:hover::after {
  opacity: 0.4;
}

.heroLeft {
  padding: 28px 24px 20px;
}

.heroLeft.domain-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.55)),
    url("/assets/domains/church/hero.webp") center/cover no-repeat;
  opacity: 0.22;
  filter: blur(0.5px) saturate(0.9);
  z-index: 0;
  pointer-events: none;
}

.heroLeft.domain-hero > * {
  position: relative;
  z-index: 2;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 0, .22);
  background: rgba(10, 14, 22, .35);
  color: var(--gold);
  font-weight: 700;
  font-size: clamp(11px, 3vw, 12px);
  letter-spacing: .8px;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, .12);
  flex-wrap: wrap;
}

.title {
  margin: 20px 0 12px;
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .75), 0 0 38px var(--gold-glow);
  background: linear-gradient(135deg, #fff, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  word-break: break-word;
}

.desc {
  margin: 0 0 20px;
  color: var(--ink-muted);
  font-size: clamp(14px, 4vw, 15px);
  line-height: 1.6;
  max-width: 70ch;
  word-break: break-word;
}

/* ============================================================================
   DECLARATION & STATS
   ============================================================================ */

.declaration {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(0, 0, 0, .18);
  padding: 20px 18px 16px;
  display: grid;
  gap: 14px;
}

.declaration .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 14, 22, .45);
  color: var(--ink-muted);
  font-weight: 600;
  font-size: clamp(12px, 3.5vw, 13px);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.pill strong {
  color: var(--gold);
  font-weight: 800;
}

.declaration p {
  color: var(--ink-muted);
  font-size: clamp(13px, 4vw, 14px);
  line-height: 1.6;
  word-break: break-word;
}

.mantra {
  color: var(--gold);
  font-style: italic;
  font-weight: 500;
  border-left: 3px solid var(--gold);
  padding-left: 16px;
  margin: 8px 0;
  word-break: break-word;
}

.statsRow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.stat {
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(10, 14, 22, .42);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.stat span {
  color: var(--ink-muted);
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 500;
}

.stat b {
  font-weight: 900;
  letter-spacing: .2px;
  font-feature-settings: "tnum", "zero", "ss02";
  background: linear-gradient(120deg, var(--gold), rgba(255, 255, 255, 0.95));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(14px, 4vw, 16px);
}

.stat small {
  color: var(--ink-soft);
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 400;
}

/* ============================================================================
   HERO RIGHT — GOLDEN SEAL
   ============================================================================ */

.heroRight {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.sealBox {
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .06));
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.sealBox::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(500px 320px at 50% 50%, rgba(255, 215, 0, .18), transparent 60%),
    radial-gradient(520px 340px at 55% 60%, rgba(120, 220, 255, .09), transparent 62%);
  opacity: .8;
  animation: sealCloud 18s var(--ease) infinite;
  pointer-events: none;
}

@keyframes sealCloud {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(1.4%, -1.2%, 0) rotate(2deg); }
}

.seal {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  aspect-ratio: 1/1;
  border-radius: 24px;
  border: 1px solid var(--panel-edge-gold);
  background: rgba(10, 14, 22, .45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset, var(--shadow-glow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  will-change: transform, box-shadow;
}

.seal:hover {
  box-shadow: 0 0 0 2px var(--gold), 0 0 120px var(--gold-glow), inset 0 0 60px rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.seal:active {
  transform: scale(0.985);
}

.domain-church .domain-seal::after {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at center, var(--gold-glow), transparent 70%),
    url("/assets/domains/church/seat.webp") center/contain no-repeat;
  opacity: 0.35;
  filter: blur(1px);
  z-index: 0;
  pointer-events: none;
}

.halo {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  border: 1px solid var(--panel-edge-gold);
  box-shadow: inset 0 0 80px var(--gold-glow), 0 0 120px var(--gold-glow);
  animation: haloBreath 2.8s var(--ease) infinite;
  z-index: 1;
}

.halo:nth-child(2) {
  inset: -30%;
  border-color: rgba(120, 220, 255, .12);
  box-shadow: inset 0 0 90px rgba(120, 220, 255, .12), 0 0 140px rgba(120, 220, 255, .08);
  animation-duration: 3.6s;
}

@keyframes haloBreath {
  0%, 100% { transform: scale(1); opacity: .70; }
  50% { transform: scale(1.05); opacity: 1; }
}

.sealCore {
  width: 58%;
  height: 58%;
  border-radius: 50%;
  border: 1px solid var(--panel-edge-gold);
  background:
    radial-gradient(circle at 30% 25%, var(--gold-glow), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(120, 220, 255, .20), transparent 60%),
    rgba(0, 0, 0, .22);
  box-shadow: inset 0 0 60px var(--gold-glow), 0 0 90px var(--gold-glow);
  display: grid;
  place-items: center;
  animation: corePulse 2.4s var(--ease) infinite;
  position: relative;
  z-index: 3;
}

@keyframes corePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.sealCore .mark {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  color: var(--ink);
  text-shadow: 0 0 20px var(--gold-glow);
  font-size: clamp(12px, 3vw, 16px);
}

.sealCore .mark b {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  letter-spacing: .6px;
  font-weight: 800;
  font-size: clamp(10px, 2.5vw, 14px);
}

.seal-blessing {
  display: inline-block;
  margin-left: 4px;
  animation: blessing-pulse 2s ease-in-out infinite;
}

@keyframes blessing-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.sealMeta {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.sealMeta .line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(12px, 3.5vw, 13px);
  color: var(--ink-muted);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--panel-edge);
  background: rgba(10, 14, 22, .42);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.sealMeta .line span:last-child {
  color: var(--gold);
  font-weight: 800;
}

/* ============================================================================
   LEGENDARY CROWN — 12 JURISDICTIONS
   ============================================================================ */

.legendary-crown {
  margin: 2rem 0 3rem;
  padding: 2rem 0 1.5rem;
  background: var(--panel-deep);
  border-top: 2px solid var(--panel-edge-gold);
  border-bottom: 2px solid var(--panel-edge-gold);
  border-radius: var(--radius);
  position: relative;
  overflow: visible;
  z-index: 50;
  width: 100%;
}

.crown-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at 50% 50%, var(--gold-glow), transparent 70%);
  opacity: 0.3;
  pointer-events: none;
  animation: crown-pulse 8s ease-in-out infinite;
}

@keyframes crown-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

.crown-header {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 1.2rem;
  border-radius: 6px;
  letter-spacing: 0.2em;
  white-space: nowrap;
  box-shadow: 0 0 20px var(--gold);
  z-index: 55;
}

.crown-title {
  color: #000;
  font-weight: 900;
}

.crown-track-container {
  position: relative;
  overflow: visible;
  padding: 0 1rem;
}

.crown-gradient-left,
.crown-gradient-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50px;
  pointer-events: none;
  z-index: 52;
}

.crown-gradient-left {
  left: 0;
  background: linear-gradient(90deg, var(--panel-deep), transparent);
}

.crown-gradient-right {
  right: 0;
  background: linear-gradient(-90deg, var(--panel-deep), transparent);
}

.crown-track {
  display: flex;
  gap: 1rem;
  padding: 1rem 0.5rem 2rem;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--panel-edge);
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 51;
}

.crown-track::-webkit-scrollbar {
  height: 4px;
}

.crown-track::-webkit-scrollbar-track {
  background: var(--panel-edge);
  border-radius: 10px;
}

.crown-track::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

.crown-jewel {
  position: relative;
  width: clamp(60px, 15vw, 80px);
  height: clamp(60px, 15vw, 80px);
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.4s var(--ease-spring);
  filter: drop-shadow(0 0 10px var(--jewel-color));
  z-index: 53;
}

.crown-jewel::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: var(--jewel-color);
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(10px);
  z-index: -1;
}

.crown-jewel:hover::before {
  opacity: 0.5;
}

.crown-jewel:hover {
  transform: scale(1.1) translateY(-4px);
  z-index: 200;
}

.crown-jewel.active {
  transform: scale(1.05);
  filter: drop-shadow(0 0 20px var(--jewel-color));
}

.crown-jewel.active::after {
  content: '✦';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--jewel-color);
  font-size: 1rem;
  animation: active-star 2s ease-in-out infinite;
}

@keyframes active-star {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

.jewel-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--jewel-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  box-shadow: 0 0 30px var(--jewel-color), inset 0 0 15px rgba(255,255,255,0.6);
  border: 2px solid rgba(255,255,255,0.4);
  position: relative;
  overflow: hidden;
}

.jewel-face::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.crown-jewel:hover .jewel-face::after {
  opacity: 0.6;
}

.jewel-icon {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.3s ease;
}

.crown-jewel:hover .jewel-icon {
  transform: scale(1.1);
}

.jewel-name {
  font-size: clamp(0.6rem, 2vw, 0.7rem);
  font-weight: 800;
  text-transform: uppercase;
  color: #000;
  text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}

/* FLOATING HOVER PORTAL */
.crown-hover-portal {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.crown-hover-portal.visible {
  opacity: 1;
}

.hover-card {
  background: var(--panel-deep);
  border: 2px solid var(--hover-color);
  border-radius: var(--radius2);
  padding: 1rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 40px var(--hover-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: min(280px, 80vw);
  transform-origin: center;
  animation: hover-appear 0.3s var(--ease-spring);
}

.hover-card.below {
  transform-origin: top center;
}

@keyframes hover-appear {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.hover-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--panel-deep);
  border-right: 2px solid var(--hover-color);
  border-bottom: 2px solid var(--hover-color);
}

.hover-arrow.above {
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
}

.hover-arrow.below {
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(225deg);
}

.hover-title {
  display: block;
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 800;
  color: var(--hover-color);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.hover-domain {
  display: block;
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--panel-edge);
}

.hover-meaning {
  display: block;
  font-size: clamp(0.75rem, 2.5vw, 0.85rem);
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.hover-preview {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* ============================================================================
   COLOR MEANING PANEL — GOLD JURISDICTION
   ============================================================================ */

.color-meaning {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-edge-gold);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  animation: justice-breathe 4.5s var(--ease-breathe) infinite;
  width: 100%;
}

.color-meaning:hover {
  animation-play-state: paused;
  border-color: var(--gold);
  transform: scale(1.01);
}

@keyframes justice-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
  50% { transform: scale(1.01); box-shadow: 0 8px 24px var(--gold-glow); }
}

.meaning-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.meaning-color {
  width: clamp(40px, 10vw, 60px);
  height: clamp(40px, 10vw, 60px);
  border-radius: 8px;
  background: var(--gold);
  box-shadow: 0 0 30px var(--gold);
}

.meaning-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  color: var(--gold);
}

.meaning-text {
  position: relative;
  z-index: 2;
  color: var(--ink-muted);
  font-size: clamp(0.9rem, 3vw, 1rem);
  line-height: 1.7;
  max-width: 800px;
  font-weight: 500;
  word-break: break-word;
}

.meaning-text strong {
  color: var(--gold);
}

/* ============================================================================
   LIBRARY SECTION
   ============================================================================ */

.section {
  margin-top: 28px;
  padding: 22px;
  position: relative;
  z-index: var(--z-surface);
  width: 100%;
}

.sectionHeader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sectionHeader h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-shadow: 0 0 18px var(--gold-glow), 0 0 44px var(--gold-soft);
}

.sectionHeader h2::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 14px;
  background: linear-gradient(90deg, transparent, var(--gold-glow), var(--gold-soft), transparent);
  opacity: 0.9;
}

.sectionHeader p {
  color: var(--ink-muted);
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  line-height: 1.5;
  max-width: 74ch;
}

.completion-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
}

.badge-percent {
  font-weight: 900;
  font-size: clamp(1rem, 4vw, 1.2rem);
}

.badge-label {
  font-weight: 700;
  font-size: clamp(0.6rem, 2.5vw, 0.7rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 14px;
}

.search {
  flex: 1 1 300px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--panel-edge);
  background: rgba(10, 14, 22, .42);
  padding: 0 16px;
  position: relative;
  z-index: 10;
  min-width: 200px;
}

.search input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: clamp(13px, 3.5vw, 14px);
  font-family: inherit;
}

.search input::placeholder {
  color: var(--ink-soft);
  font-weight: 400;
}

.selects {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.select select {
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--panel-edge);
  background: rgba(10, 14, 22, .42);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 700;
  font-size: clamp(12px, 3vw, 13px);
  outline: none;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  z-index: 10;
  min-width: 140px;
}

.select select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

/* Category Accordion */
.category {
  margin-bottom: 8px;
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(10, 14, 22, .62), rgba(10, 14, 22, .30));
  overflow: hidden;
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
  z-index: var(--z-surface);
  width: 100%;
}

.category:hover {
  border-color: var(--gold-soft);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .30);
}

.categoryHead {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: clamp(16px, 4vw, 20px) clamp(18px, 4vw, 22px);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .3s var(--ease);
  position: relative;
  z-index: 2;
  min-height: 60px;
}

.categoryHead:hover,
.categoryHead:focus-visible {
  background: var(--gold-dim);
  outline: none;
}

.categoryHead:focus-visible {
  box-shadow: 0 0 0 2px var(--gold) inset;
}

.catArrow {
  width: clamp(22px, 6vw, 26px);
  height: clamp(22px, 6vw, 26px);
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--gold-soft);
  background: rgba(0, 0, 0, .18);
  color: var(--gold);
  font-weight: 900;
  font-size: clamp(10px, 3vw, 12px);
  transition: transform .3s var(--ease), background .3s var(--ease);
  flex-shrink: 0;
}

.category[data-open="1"] .catArrow {
  transform: rotate(90deg);
  background: var(--gold-soft);
}

.catText {
  flex: 1;
  min-width: 0;
}

.catText b {
  display: block;
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.2;
}

.catSub {
  display: block;
  font-size: clamp(11px, 3vw, 13px);
  color: var(--ink-muted);
  line-height: 1.4;
  opacity: .9;
  word-break: break-word;
}

.catCount {
  min-width: clamp(36px, 10vw, 42px);
  height: clamp(24px, 6vw, 28px);
  padding: 0 clamp(8px, 2vw, 10px);
  border-radius: 999px;
  border: 1px solid var(--panel-edge);
  background: rgba(10, 14, 22, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(11px, 3vw, 13px);
  color: var(--gold);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.categoryBody {
  position: relative;
  z-index: 1;
  padding: 0 clamp(18px, 4vw, 22px);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), padding .5s var(--ease);
}

.category[data-open="1"] .categoryBody {
  opacity: 1;
  transform: translateY(0);
  padding: 0 clamp(18px, 4vw, 22px) clamp(20px, 5vw, 24px);
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(12px, 3vw, 20px);
  margin-top: 18px;
  animation: gridBreath 10.5s var(--ease-breathe) infinite;
  transform-origin: 50% 40%;
}

@keyframes gridBreath {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -0.35%, 0) scale(1.006); }
}

/* ============================================================================
   TILE — SACRED VOLUME CARDS
   ============================================================================ */

.tile {
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(10, 14, 22, .62), rgba(10, 14, 22, .30));
  box-shadow: var(--shadow-medium);
  padding: clamp(16px, 4vw, 20px) clamp(14px, 3.5vw, 18px) clamp(16px, 4vw, 18px);
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), filter .35s var(--ease);
  will-change: transform;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  animation: tileBreathe 7.2s var(--ease-breathe) infinite;
  counter-increment: canon-volume;
  z-index: var(--z-surface);
  width: 100%;
}

.tile::before {
  content: "Vol. " counter(canon-volume);
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  font-weight: 800;
  background: rgba(10, 14, 22, .7);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--gold-soft);
  z-index: 2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@keyframes tileBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.006); }
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(600px 220px at var(--mouse-x, 40%) var(--mouse-y, 30%), var(--gold-glow), transparent 55%);
  opacity: .55;
  transition: opacity 260ms var(--ease);
}

.tile:hover,
.tile:focus-within {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lift), 0 0 0 1px var(--gold-soft) inset;
  border-color: var(--gold-soft);
  filter: saturate(1.05) contrast(1.02);
  outline: none;
}

.tile:hover::after {
  opacity: .9;
}

/* 3D Flip Card Styles */
.tile.has-flip {
  transition: transform 0.6s var(--ease-3d);
  transform-style: preserve-3d;
  position: relative;
  cursor: pointer;
  min-height: 280px;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: inherit;
  padding: clamp(1.2rem, 4vw, 2rem);
  background: linear-gradient(180deg, rgba(10, 14, 22, .70), rgba(10, 14, 22, .35));
  border: 1px solid var(--panel-edge-gold);
  box-shadow: inherit;
  top: 0;
  left: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.card-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, rgba(5, 8, 15, .95), rgba(10, 14, 22, .85));
  border-color: var(--gold);
  text-align: center;
  align-items: center;
}

.card-back h4 {
  color: var(--gold);
  font-size: clamp(1rem, 4vw, 1.2rem);
  margin-bottom: 0.8rem;
  font-weight: 900;
}

.card-back p {
  color: var(--ink-muted);
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  margin-bottom: 0.8rem;
}

.card-back .btn {
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
  display: inline-block;
  margin-top: 0.5rem;
  font-size: clamp(0.8rem, 3vw, 0.9rem);
}

.card-back .btn:hover {
  background: var(--gold);
  color: #000;
  transform: scale(1.05);
}

.tile.flipped {
  transform: rotateY(180deg);
}

/* Tile Inner Elements */
.tileTop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.icon {
  width: clamp(36px, 10vw, 44px);
  height: clamp(36px, 10vw, 44px);
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-soft);
  background: rgba(0, 0, 0, .22);
  color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05) inset, 0 0 30px var(--gold-soft);
  font-weight: 900;
  font-size: clamp(16px, 5vw, 20px);
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: clamp(24px, 6vw, 28px);
  padding: 0 clamp(8px, 2.5vw, 12px);
  border-radius: 999px;
  border: 1px solid var(--panel-edge);
  background: rgba(10, 14, 22, .45);
  color: var(--ink-muted);
  font-size: clamp(10px, 3vw, 12px);
  letter-spacing: .8px;
  text-transform: uppercase;
  font-weight: 900;
  transition: transform 220ms var(--ease), filter 220ms var(--ease);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.tile:hover .badge {
  transform: translate3d(0, -1px, 0) scale(1.02);
  filter: brightness(1.1);
}

.badge.core {
  border-color: var(--gold-soft);
  color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-soft), 0 0 18px var(--gold-glow);
}

.badge.admin {
  border-color: rgba(120, 220, 255, .18);
  color: rgba(200, 240, 255, .78);
  box-shadow: 0 0 0 1px rgba(120, 200, 255, .18), 0 0 18px rgba(120, 200, 255, .06);
}

.tile h3 {
  margin: 0 0 12px;
  position: relative;
  z-index: 1;
  font-size: clamp(15px, 4vw, 17px);
  letter-spacing: .2px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.tile p {
  margin: 0 0 16px;
  position: relative;
  z-index: 1;
  color: var(--ink-muted);
  font-size: clamp(13px, 3.5vw, 14px);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(3 * 1.5 * 14px);
  flex-grow: 1;
  word-break: break-word;
}

.locked-indicator {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  color: var(--gold);
  opacity: 0.8;
}

.metaRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  z-index: 1;
  margin-top: auto;
  flex-wrap: wrap;
}

.tagPill {
  display: inline-flex;
  align-items: center;
  height: clamp(24px, 6vw, 28px);
  padding: 0 clamp(8px, 2.5vw, 12px);
  border-radius: 999px;
  border: 1px solid var(--panel-edge);
  background: rgba(10, 14, 22, .45);
  color: var(--ink-muted);
  font-weight: 800;
  font-size: clamp(10px, 3vw, 12px);
  letter-spacing: .3px;
  text-transform: lowercase;
  font-variant-numeric: tabular-nums;
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 900;
  font-size: clamp(11px, 3vw, 13px);
  color: var(--ink);
  border: 1px solid var(--gold-soft);
  background: var(--gold-dim);
  height: clamp(32px, 8vw, 36px);
  padding: 0 clamp(10px, 3vw, 14px);
  border-radius: 999px;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), filter .25s var(--ease);
  font-family: inherit;
}

.tile:hover .go {
  transform: translate3d(1px, -1px, 0);
  background: var(--gold-soft);
  border-color: var(--gold);
  box-shadow: var(--shadow-lift), 0 0 40px var(--gold-glow);
  filter: brightness(1.08);
}

.go:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 999px;
}

.go.locked {
  opacity: 0.8;
}

/* Search Highlight */
mark.canon-match {
  background: linear-gradient(120deg, transparent 0%, var(--gold-soft) 50%, transparent 100%);
  padding: 0 2px;
  border-radius: 2px;
  animation: highlightPulse 1.5s var(--ease);
  color: var(--gold);
  font-weight: 700;
}

@keyframes highlightPulse {
  0%, 100% { background-color: transparent; }
  50% { background-color: var(--gold-soft); }
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.emptyState {
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius2);
  background: rgba(10, 14, 22, .42);
  padding: clamp(24px, 6vw, 32px) clamp(20px, 5vw, 24px);
  text-align: center;
  width: 100%;
}

.emptyCard {
  max-width: 400px;
  margin: 0 auto;
}

.emptyCard b {
  display: block;
  font-size: clamp(16px, 5vw, 18px);
  margin-bottom: 8px;
  color: var(--gold);
}

.emptyCard p {
  color: var(--ink-muted);
  font-size: clamp(13px, 4vw, 14px);
  line-height: 1.5;
}

.empty-icon {
  font-size: clamp(2.5rem, 8vw, 3rem);
  opacity: 0.7;
  margin-bottom: 1rem;
  display: block;
  color: var(--gold);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
  margin-top: 28px;
  padding: clamp(14px, 4vw, 16px) clamp(16px, 4vw, 20px);
  border-radius: 18px;
  border: 1px solid var(--panel-edge);
  background: rgba(10, 14, 22, .42);
  color: var(--ink-muted);
  font-size: clamp(11px, 3vw, 13px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
  width: 100%;
}

.footer b {
  color: var(--gold);
  font-weight: 800;
}

.footer-law {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.law-glyph {
  color: var(--gold);
  font-size: 1.1rem;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.separator {
  color: var(--ink-soft);
}

/* ============================================================================
   MODE TOGGLE — SILENCE MODE
   ============================================================================ */

.mode-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: clamp(40px, 10vw, 44px);
  height: clamp(40px, 10vw, 44px);
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  cursor: pointer;
  z-index: var(--z-float);
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}

.mode-toggle:hover {
  background: var(--gold-soft);
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--gold-glow);
}

.mode-toggle::before {
  content: "♫";
  font-size: clamp(16px, 4vw, 18px);
  color: var(--gold);
}

.realm.mode-silence .mode-toggle::before {
  content: "♪";
  opacity: 0.6;
}

/* ============================================================================
   CANON BLESSING — CEREMONIAL OVERLAY
   ============================================================================ */

.canon-blessing {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel-deep);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: clamp(20px, 5vw, 24px) clamp(24px, 6vw, 32px);
  z-index: var(--z-modal);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lift), 0 0 0 1px var(--gold-soft) inset;
  max-width: min(400px, 90vw);
  width: 90%;
  text-align: center;
  animation: blessingAppear 0.6s var(--ease) forwards;
}

@keyframes blessingAppear {
  0% { opacity: 0; transform: translate(-50%, -40%); }
  100% { opacity: 1; transform: translate(-50%, -50%); }
}

.canon-blessing p {
  color: var(--gold);
  font-family: "Playfair Display", serif;
  font-size: clamp(16px, 5vw, 18px);
  line-height: 1.4;
  margin: 0;
  font-style: italic;
  word-break: break-word;
}

/* ============================================================================
   MOBILE-FIRST MEDIA QUERIES
   ============================================================================ */

/* Small phones */
@media (max-width: 480px) {
  .realm {
    padding: 12px 10px 30px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brand {
    min-width: unset;
    justify-content: center;
  }

  .brand h1 {
    font-size: 16px;
    white-space: normal;
  }

  .brand .sub {
    font-size: 10px;
    white-space: normal;
  }

  .presence-indicator {
    justify-content: center;
  }

  .nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .btn {
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .user-badge {
    padding: 0.2rem 0.8rem;
    font-size: 0.7rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
  }

  .heroLeft, .heroRight {
    padding: 16px;
  }

  .kicker {
    font-size: 10px;
    padding: 6px 10px;
  }

  .title {
    font-size: 2rem;
    margin: 12px 0 8px;
  }

  .statsRow {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat {
    padding: 8px 12px;
  }

  .declaration {
    padding: 16px 14px 12px;
  }

  .pill {
    padding: 6px 10px;
    font-size: 11px;
  }

  .legendary-crown {
    margin: 1.5rem 0 2rem;
    padding: 1.5rem 0 1rem;
  }

  .crown-header {
    font-size: 0.6rem;
    padding: 0.15rem 1rem;
    white-space: normal;
    width: 90%;
    text-align: center;
  }

  .crown-track {
    gap: 0.8rem;
    padding: 0.8rem 0.3rem 1.5rem;
  }

  .crown-jewel {
    width: 55px;
    height: 55px;
  }

  .jewel-icon {
    font-size: 1.3rem;
  }

  .jewel-name {
    font-size: 0.55rem;
  }

  .color-meaning {
    margin: 1.5rem 0;
    padding: 1.2rem;
  }

  .meaning-header {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }

  .meaning-color {
    width: 40px;
    height: 40px;
  }

  .meaning-title {
    font-size: 1.3rem;
  }

  .section {
    padding: 16px;
    margin-top: 20px;
  }

  .sectionHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

  .selects {
    width: 100%;
    flex-direction: column;
  }

  .select select {
    width: 100%;
  }

  .categoryHead {
    padding: 14px 16px;
    gap: 10px;
  }

  .catText b {
    font-size: 14px;
  }

  .catSub {
    font-size: 11px;
  }

  .catArrow {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .catCount {
    min-width: 30px;
    height: 22px;
    font-size: 10px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tile {
    min-height: 240px;
    padding: 14px;
  }

  .tile::before {
    top: 10px;
    right: 10px;
    font-size: 9px;
    padding: 2px 5px;
  }

  .tile h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .tile p {
    font-size: 12px;
    max-height: calc(3 * 1.5 * 12px);
  }

  .tile.has-flip {
    min-height: 260px;
  }

  .card-front, .card-back {
    padding: 1rem;
  }

  .card-back h4 {
    font-size: 0.9rem;
  }

  .card-back p {
    font-size: 0.75rem;
  }

  .icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .badge, .tagPill {
    height: 22px;
    padding: 0 8px;
    font-size: 9px;
  }

  .go {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .footer-meta {
    justify-content: center;
  }

  .journey-path {
    top: auto;
    bottom: 20px;
    left: 10px;
    font-size: 0.7rem;
    padding: 6px 12px;
  }

  .presence-container {
    bottom: 10px;
    right: 10px;
  }

  .presence-bubble {
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  .presence-avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .mode-toggle {
    bottom: 15px;
    right: 15px;
    width: 38px;
    height: 38px;
  }

  .mode-toggle::before {
    font-size: 15px;
  }

  .canon-blessing {
    padding: 16px 20px;
  }

  .canon-blessing p {
    font-size: 15px;
  }
}

/* Medium phones and small tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .realm {
    padding: 16px 14px 35px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .brand {
    min-width: unset;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .statsRow {
    grid-template-columns: repeat(2, 1fr);
  }

  .crown-jewel {
    width: 65px;
    height: 65px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr 0.9fr;
    gap: 16px;
  }

  .statsRow {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================================
   ACCESSIBILITY & UTILITIES
   ============================================================================ */

/* Screen Reader Only */
.sr {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Fallback for browsers without -webkit-line-clamp */
@supports not (-webkit-line-clamp: 3) {
  .tile p {
    position: relative;
    max-height: calc(3 * 1.5 * 14px);
    overflow: hidden;
  }
  .tile p::after {
    content: "…";
    position: absolute;
    bottom: 0;
    right: 0;
    padding-left: 40px;
    background: linear-gradient(to right, transparent, rgba(10, 14, 22, 0.85) 50%);
  }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
  .category, .catArrow, .catCount, .tile {
    border: 2px solid currentColor;
  }
  .badge.core, .badge.admin {
    border-width: 2px;
  }
}

/* Print Mode */
@media print {
  .realm {
    background: white !important;
    color: black !important;
    --gold: var(--gold-dark);
    padding: 0;
  }
  .wrap { max-width: none; margin: 0; }
  .category {
    break-inside: avoid;
    border: 1px solid #000;
    margin-bottom: 12px;
  }
  .categoryHead {
    background: #f5f5f5 !important;
    color: #000 !important;
    padding: 12px;
  }
  .catArrow { display: none; }
  .categoryBody {
    max-height: none !important;
    opacity: 1 !important;
    padding: 12px !important;
    display: block !important;
    overflow: visible !important;
    transform: none !important;
  }
  .tile {
    break-inside: avoid;
    border: 2px solid #000;
    box-shadow: none;
    animation: none !important;
    background: white !important;
    color: black !important;
  }
  .tile p {
    -webkit-line-clamp: unset;
    max-height: none;
    overflow: visible;
  }
  .tile::before {
    content: "Ref: " attr(data-id);
    display: block;
    font-size: 9px;
    opacity: .6;
    color: #666;
  }
  .btn, .nav, .sealBox, .mode-toggle, .quantum-reality-layer,
  .presence-container, .journey-path, .crown-hover-portal {
    display: none !important;
  }
  .sigil, .halo, .seal {
    border-color: #ccc !important;
    background: #f5f5f5 !important;
    box-shadow: none !important;
  }
  .legendary-crown {
    display: none !important;
  }
}

/* Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .realm::before, .realm::after, .realm .wrap::before,
  .grid, .tile, .halo, .sigil, .sealCore, .panel::before, .sealBox::before,
  .crown-glow, .crown-jewel, .presence-bubble, .journey-path {
    animation: none !important;
    transition: none !important;
  }
  
  .tile:hover {
    transform: none !important;
  }
  
  .quantum-reality-layer {
    display: none;
  }
}

/* Touch Device Optimizations */
.is-touch .categoryHead {
  min-height: 60px;
}

.is-touch .tile {
  animation: none;
}

.is-touch .tile:hover {
  transform: none;
}

.is-touch .crown-jewel:hover {
  transform: scale(1.05);
}

/* ============================================================================
   Z-INDEX LAW — SEALED
   ============================================================================ */

.realm { z-index: var(--z-base); }
.realm::before, .realm::after { z-index: var(--z-underlay); }
.realm .wrap::before { z-index: var(--z-geometry); }
.wrap { z-index: var(--z-surface); }
.topbar { z-index: var(--z-nav); }
.section, .panel, .category { position: relative; z-index: var(--z-surface); }
.mode-toggle { z-index: var(--z-float); }
.canon-blessing { z-index: var(--z-modal); }

/* ============================================================================
   FINAL SEAL — GOLD JURISDICTION
   ============================================================================ */

/* Ensure no horizontal scroll on any device */
body, html {
  overflow-x: hidden;
  max-width: 100%;
}

img, picture, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Ensure touch targets are at least 44px */
button, .btn, .go, .categoryHead, .crown-jewel, .seal {
  min-height: 44px;
  min-width: 44px;
}

/* Fix for 100vh on mobile */
@supports (-webkit-touch-callout: none) {
  .realm {
    min-height: -webkit-fill-available;
  }
}