@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cinzel+Decorative:wght@400;700&family=Cormorant+Garamond:wght@300;400;500;600&display=swap');

:root {
  --gold: #c9a44a;
  --gold-light: #e8d48b;
  --gold-dark: #b59545;
  --gold-glow: rgba(201, 164, 74, 0.4);
  --bg-dark: #0a0c12;
  --bg-panel: rgba(8, 10, 18, 0.88);
  --border-ornate: rgba(201, 164, 74, 0.3);
  --text-light: #e0d6c2;
  --text-dim: #7a7060;
  --error: #d96868;
  --success: #7ec98a;
  --red-glow: #c0392b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ============================================================
   SCENE — multi-layer parallax world (lifted from Launcher)
   ============================================================ */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 150% 50% at 50% 0%, #0c1628 0%, transparent 70%),
    radial-gradient(ellipse 80% 40% at 30% 10%, rgba(20, 50, 80, 0.4), transparent),
    radial-gradient(ellipse 60% 30% at 70% 5%, rgba(40, 20, 60, 0.3), transparent),
    linear-gradient(180deg, #060918 0%, #0e1830 25%, #12203c 45%, #101828 65%, #0a0e18 100%);
}

.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 25% 8%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 40% 22%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 55% 5%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 70% 18%, rgba(201, 164, 74, 0.5), transparent),
    radial-gradient(1px 1px at 85% 12%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 15% 30%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 60% 28%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 90% 25%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 35% 35%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 5% 6%, rgba(201, 164, 74, 0.4), transparent),
    radial-gradient(1px 1px at 48% 12%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 78% 32%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 92% 8%, rgba(220,200,150,0.4), transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
}

.aurora {
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 40%;
  background:
    linear-gradient(180deg, rgba(30,80,120,0.08) 0%, transparent 40%),
    linear-gradient(160deg, rgba(60,30,90,0.06) 0%, transparent 30%),
    linear-gradient(200deg, rgba(20,70,60,0.05) 0%, transparent 35%);
  filter: blur(30px);
  animation: auroraPulse 12s ease-in-out infinite alternate;
}

.moon {
  position: absolute;
  width: 80px; height: 80px;
  top: 9%; right: 16%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #f0e8d0, #d4c5a0, #a89878);
  box-shadow:
    0 0 30px rgba(240, 232, 208, 0.3),
    0 0 60px rgba(240, 232, 208, 0.15),
    0 0 120px rgba(201, 164, 74, 0.1);
  animation: moonGlow 8s ease-in-out infinite alternate;
}
.moon::after {
  content: '';
  position: absolute;
  width: 60px; height: 60px;
  top: 8px; left: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(150,130,100,0.15) 100%);
}
.moon::before {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  top: 22px; left: 18px;
  border-radius: 50%;
  background: rgba(160, 140, 100, 0.2);
  box-shadow:
    22px 15px 0 6px rgba(160,140,100,0.12),
    10px 30px 0 3px rgba(160,140,100,0.15),
    30px -5px 0 4px rgba(160,140,100,0.1);
}

.cloud {
  position: absolute;
  border-radius: 50%;
  background: rgba(20, 30, 50, 0.4);
  filter: blur(20px);
}
.cloud-1 { width: 300px; height: 40px; top: 8%;  left: -5%;  animation: cloudDrift1 40s linear infinite; }
.cloud-2 { width: 250px; height: 35px; top: 15%; left: 60%;  animation: cloudDrift2 55s linear infinite; opacity: 0.6; }
.cloud-3 { width: 350px; height: 50px; top: 5%;  left: 30%;  animation: cloudDrift3 70s linear infinite; opacity: 0.3; }

.mountains-far {
  position: absolute;
  bottom: 28%; left: 0; right: 0;
  height: 25%;
  background: linear-gradient(180deg, #0e1420 0%, #0b1018 100%);
  clip-path: polygon(0% 100%, 0% 65%, 3% 55%, 8% 45%, 12% 50%, 18% 35%, 22% 42%, 28% 25%, 32% 30%, 35% 20%, 38% 28%, 42% 15%, 45% 22%, 48% 10%, 52% 18%, 55% 12%, 58% 20%, 62% 8%, 65% 15%, 68% 22%, 72% 12%, 75% 25%, 78% 18%, 82% 30%, 85% 22%, 88% 35%, 92% 28%, 95% 40%, 98% 45%, 100% 55%, 100% 100%);
}
.mountains-mid {
  position: absolute;
  bottom: 22%; left: 0; right: 0;
  height: 25%;
  background: linear-gradient(180deg, #101822 0%, #0c1018 100%);
  clip-path: polygon(0% 100%, 0% 55%, 5% 50%, 10% 60%, 15% 40%, 20% 50%, 25% 30%, 28% 38%, 32% 22%, 35% 35%, 38% 28%, 42% 40%, 45% 25%, 48% 35%, 52% 20%, 55% 32%, 58% 42%, 62% 30%, 65% 38%, 70% 25%, 73% 35%, 78% 20%, 82% 32%, 85% 45%, 88% 35%, 92% 50%, 95% 42%, 100% 55%, 100% 100%);
}
.mountains-mid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(200,210,230,0.08) 0%, transparent 15%);
  clip-path: inherit;
}
.mountains-near {
  position: absolute;
  bottom: 18%; left: 0; right: 0;
  height: 22%;
  background: linear-gradient(180deg, #121a26 0%, #0e1420 50%, #0b1018 100%);
  clip-path: polygon(0% 100%, 0% 40%, 4% 50%, 8% 35%, 12% 45%, 18% 28%, 22% 40%, 26% 32%, 30% 45%, 35% 30%, 38% 42%, 42% 50%, 48% 35%, 52% 45%, 55% 55%, 60% 40%, 65% 50%, 70% 38%, 75% 48%, 80% 35%, 85% 45%, 90% 38%, 95% 50%, 100% 42%, 100% 100%);
}

.castle {
  position: absolute;
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 80px;
}
.castle::before {
  content: '';
  position: absolute;
  bottom: 0; left: 30px;
  width: 60px; height: 50px;
  background: #0a0e18;
  clip-path: polygon(0% 100%, 0% 20%, 5% 20%, 5% 0%, 15% 0%, 15% 20%, 25% 20%, 25% 10%, 30% 10%, 30% 20%, 70% 20%, 70% 10%, 75% 10%, 75% 20%, 85% 20%, 85% 0%, 95% 0%, 95% 20%, 100% 20%, 100% 100%);
}
.castle::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 120px; height: 65px;
  background: #0a0e18;
  clip-path: polygon(0% 100%, 0% 30%, 3% 30%, 3% 10%, 8% 10%, 8% 0%, 12% 0%, 12% 10%, 17% 10%, 17% 30%, 20% 30%, 20% 100%, 80% 100%, 80% 30%, 83% 30%, 83% 10%, 88% 10%, 88% 0%, 92% 0%, 92% 10%, 97% 10%, 97% 30%, 100% 30%, 100% 100%);
}

.treeline {
  position: absolute;
  bottom: 16%; left: 0; right: 0;
  height: 12%;
  background: #0a1018;
  clip-path: polygon(0% 100%, 0% 50%, 1% 30%, 2% 50%, 3% 25%, 4% 45%, 5% 20%, 6% 40%, 7% 50%, 8% 35%, 9% 15%, 10% 35%, 11% 50%, 12% 30%, 13% 10%, 14% 30%, 15% 45%, 16% 25%, 17% 40%, 18% 20%, 19% 38%, 20% 50%, 21% 32%, 22% 12%, 23% 35%, 24% 48%, 25% 28%, 26% 8%, 27% 30%, 28% 45%, 29% 22%, 30% 40%, 31% 18%, 32% 35%, 33% 50%, 34% 30%, 35% 15%, 36% 38%, 37% 48%, 38% 25%, 39% 10%, 40% 32%, 41% 45%, 42% 20%, 43% 38%, 44% 15%, 45% 35%, 46% 50%, 47% 28%, 48% 8%, 49% 30%, 50% 45%, 51% 22%, 52% 5%, 53% 25%, 54% 42%, 55% 20%, 56% 38%, 57% 15%, 58% 32%, 59% 48%, 60% 25%, 61% 10%, 62% 30%, 63% 50%, 64% 28%, 65% 12%, 66% 35%, 67% 48%, 68% 22%, 69% 40%, 70% 18%, 71% 38%, 72% 50%, 73% 30%, 74% 15%, 75% 35%, 76% 45%, 77% 20%, 78% 8%, 79% 28%, 80% 42%, 81% 20%, 82% 35%, 83% 12%, 84% 30%, 85% 48%, 86% 25%, 87% 10%, 88% 32%, 89% 45%, 90% 22%, 91% 8%, 92% 28%, 93% 42%, 94% 20%, 95% 35%, 96% 15%, 97% 30%, 98% 45%, 99% 25%, 100% 40%, 100% 100%);
}

.water {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 18%;
  background: linear-gradient(180deg, rgba(12, 20, 36, 0.92) 0%, rgba(10, 16, 30, 0.95) 30%, #080e18 100%);
  overflow: hidden;
}
.water::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 10%, rgba(201, 164, 74, 0.08) 20%, rgba(201, 164, 74, 0.15) 30%, rgba(201, 164, 74, 0.08) 40%, transparent 50%, rgba(200, 210, 230, 0.06) 60%, rgba(200, 210, 230, 0.12) 70%, rgba(200, 210, 230, 0.06) 80%, transparent 90%);
}
.water::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(200, 210, 230, 0.02) 60px, rgba(200, 210, 230, 0.02) 61px);
  animation: ripple 4s ease-in-out infinite alternate;
}

.moon-reflection {
  position: absolute;
  bottom: 5%; right: 16%;
  width: 4px; height: 60px;
  background: linear-gradient(180deg, rgba(240, 232, 208, 0.15), rgba(240, 232, 208, 0.05), transparent);
  filter: blur(3px);
  animation: moonReflect 3s ease-in-out infinite alternate;
}

.mist {
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  filter: blur(15px);
  opacity: 0.4;
}
.mist-1 {
  bottom: 16%;
  background: linear-gradient(90deg, transparent 5%, rgba(30,40,60,0.3) 30%, rgba(20,30,50,0.4) 50%, rgba(30,40,60,0.3) 70%, transparent 95%);
  animation: mistDrift 25s ease-in-out infinite alternate;
}
.mist-2 {
  bottom: 19%;
  background: linear-gradient(90deg, transparent 15%, rgba(25,35,55,0.2) 40%, rgba(25,35,55,0.3) 60%, transparent 85%);
  animation: mistDrift 35s ease-in-out infinite alternate-reverse;
  opacity: 0.3;
}

.torch {
  position: absolute;
  bottom: 25%;
  width: 4px; height: 40px;
  background: linear-gradient(180deg, #2a1a0a, #1a1008);
  border-radius: 1px;
  z-index: 1;
}
.torch-left { left: 8%; }
.torch-right { right: 8%; }
.flame {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 22px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 200, 50, 0.9), rgba(255, 140, 20, 0.7), rgba(200, 60, 10, 0.4), transparent);
  filter: blur(2px);
  animation: flicker 0.15s ease-in-out infinite alternate;
  box-shadow: 0 0 15px rgba(255, 160, 30, 0.5), 0 0 40px rgba(255, 120, 10, 0.2), 0 -5px 20px rgba(255, 200, 50, 0.3);
}
.flame::before {
  content: '';
  position: absolute;
  top: 2px; left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 12px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: rgba(255, 240, 180, 0.8);
  filter: blur(1px);
  animation: innerFlicker 0.1s ease-in-out infinite alternate-reverse;
}
.torch-glow {
  position: absolute;
  bottom: 20%;
  width: 80px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 140, 30, 0.06), transparent);
  filter: blur(10px);
}
.torch-glow-left { left: calc(8% - 38px); }
.torch-glow-right { right: calc(8% - 38px); }

.skull-stake {
  position: absolute;
  bottom: 16%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.skull-stake-left { left: 18%; }
.skull-stake-right { right: 18%; }
.skull-stake::after {
  content: '';
  display: block;
  width: 3px; height: 38px;
  background: linear-gradient(180deg, #2a1a0a, #141008);
  border-radius: 1px;
}
.skull-icon {
  font-size: 20px;
  color: rgba(210, 190, 145, 0.78);
  text-shadow: 0 0 8px rgba(201, 164, 74, 0.55), 0 0 20px rgba(201, 164, 74, 0.25), 0 0 40px rgba(201, 164, 74, 0.1);
  animation: skullPulse 6s ease-in-out infinite alternate;
  line-height: 1;
  margin-bottom: -3px;
}

.runes {
  position: absolute;
  bottom: 17%; left: 0; right: 0;
  height: 4%;
  display: flex;
  justify-content: center;
  gap: 60px;
  align-items: center;
  z-index: 1;
}
.rune {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 164, 74, 0.6), transparent);
  box-shadow: 0 0 8px rgba(201, 164, 74, 0.4), 0 0 20px rgba(201, 164, 74, 0.15);
  animation: runeGlow var(--dur, 3s) var(--delay, 0s) ease-in-out infinite alternate;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 55% at 50% 42%, transparent 30%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.particle {
  position: fixed;
  width: 2px; height: 2px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 4px rgba(201, 164, 74, 0.8);
  animation: float var(--dur, 18s) var(--delay, 0s) ease-in-out infinite;
}

/* ============================================================
   FOREGROUND CONTENT
   ============================================================ */
.app-shell {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-border {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-light) 50%, var(--gold) 80%, transparent);
  box-shadow: 0 0 15px var(--gold-glow), 0 2px 8px rgba(0,0,0,0.5);
}

.container {
  position: relative;
  z-index: 5;
  max-width: 580px;
  margin: 0 auto;
  padding: 60px 24px 40px;
  flex: 1;
}

/* --- Hero --- */
.hero { text-align: center; margin-bottom: 26px; }

.hero .ornament-top {
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
  margin-bottom: 18px;
}
.hero .ornament-top .ornament-line {
  width: 100px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero .ornament-top .ornament-diamond {
  width: 10px; height: 10px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--gold-glow);
}

.hero h1 {
  margin: 0;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 700;
  font-size: 52px;
  letter-spacing: 10px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #f0e0b0 0%, #c9a44a 40%, #8a6d2b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(201,164,74,0.3)) drop-shadow(0 2px 4px rgba(0,0,0,0.8));
  line-height: 1.1;
}

.hero-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-top: 6px;
}

.hero .ornament-bottom {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.ornament-line-short {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,164,74,0.5), transparent);
}
.ornament-scroll {
  font-size: 16px;
  color: var(--gold);
  opacity: 0.7;
  font-family: 'Cinzel Decorative', serif;
}

.tagline {
  margin-top: 22px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--text-light);
  letter-spacing: 2px;
  opacity: 0.85;
}

/* --- Status bar --- */
.realm-status {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin: 18px auto 0;
  padding: 6px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red-glow);
  box-shadow: 0 0 8px rgba(192, 57, 43, 0.7), 0 0 18px rgba(192, 57, 43, 0.3);
  animation: statusPulse 2.4s ease-in-out infinite;
}
.realm-status .status-text { color: var(--text-dim); }

/* --- Panel / card with full ornaments (top + bottom corners) --- */
.card, .panel {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-ornate);
  border-radius: 2px;
  padding: 36px 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(201, 164, 74, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  margin: 8px auto;
}
.card.center, .panel.center { text-align: center; }

.card::before, .card::after, .panel::before, .panel::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--gold);
  opacity: 0.55;
}
.card::before, .panel::before { top: -1px; left: -1px;  border-right: none; border-bottom: none; }
.card::after,  .panel::after  { top: -1px; right: -1px; border-left: none;  border-bottom: none; }

.panel-corner-bl, .panel-corner-br {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--gold);
  opacity: 0.55;
}
.panel-corner-bl { bottom: -1px; left: -1px;  border-right: none; border-top: none; }
.panel-corner-br { bottom: -1px; right: -1px; border-left: none;  border-top: none; }

.panel-label, .field-label, label > span {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold-dark);
  text-align: center;
  margin-bottom: 16px;
}
label > span { margin-bottom: 8px; }

.panel-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin: 4px 0 22px;
}
.panel-divider .ornament-line-short { width: 70px; }
.panel-divider .ornament-scroll { font-size: 14px; }

/* --- Forms --- */
label {
  display: block;
  margin-bottom: 18px;
  font-family: 'Cormorant Garamond', serif;
  text-align: left;
}
label > span { text-align: left; }

input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(10, 16, 28, 0.7);
  border: 1px solid var(--border-ornate);
  border-radius: 2px;
  color: var(--text-light);
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
  letter-spacing: 1px;
}
input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 18px var(--gold-glow), inset 0 0 12px rgba(201, 164, 74, 0.06);
}
input::placeholder { color: rgba(201, 164, 74, 0.25); font-style: italic; }

.access-key-input {
  font-family: 'Cinzel', monospace;
  font-size: 22px;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
  padding: 18px 16px;
}

.hint {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
  text-align: center;
}
code {
  font-family: 'Consolas', ui-monospace, monospace;
  background: rgba(10, 16, 28, 0.8);
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 13px;
  color: var(--gold-light);
}

/* --- Buttons (epic gold) --- */
button, .btn, .btn-epic {
  position: relative;
  display: inline-block;
  padding: 14px 32px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(180deg, #f0e0b0 0%, #c9a44a 30%, #a07830 70%, #7a5a20 100%);
  border: 1px solid rgba(240, 224, 176, 0.5);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  transition: all .3s;
  box-shadow:
    0 2px 10px rgba(201, 164, 74, 0.3),
    0 4px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}
button::before, .btn::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1px;
  pointer-events: none;
}
button:hover:not(:disabled), .btn:hover {
  background: linear-gradient(180deg, #f8ecc0, #d4b05a 30%, #b08840 70%, #8a6a2a);
  box-shadow:
    0 2px 15px rgba(201, 164, 74, 0.5),
    0 4px 30px rgba(201, 164, 74, 0.2),
    0 8px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}
button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 5px rgba(201, 164, 74, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
button:disabled {
  background: linear-gradient(180deg, #3a3a3a, #2a2a2a 50%, #1a1a1a);
  color: #555;
  border-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  text-shadow: none;
}
button[type="submit"] { width: 100%; padding: 16px 32px; font-size: 14px; letter-spacing: 6px; margin-top: 6px; }

button.btn-ghost, .btn-ghost {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(201, 164, 74, 0.2);
  color: var(--gold-light);
  box-shadow: none;
  text-shadow: none;
  font-size: 11px;
  letter-spacing: 3px;
  padding: 10px 18px;
}
button.btn-ghost::before, .btn-ghost::before { display: none; }
button.btn-ghost:hover, .btn-ghost:hover {
  background: rgba(201, 164, 74, 0.1);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 12px var(--gold-glow);
  transform: none;
}

.cf-turnstile { margin: 16px 0; display: flex; justify-content: center; }

/* --- Status messages --- */
.error, .success {
  margin-top: 14px;
  font-size: 14px;
  text-align: center;
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
}
.error   { color: var(--error);   text-shadow: 0 0 10px rgba(217, 104, 104, 0.3); }
.success { color: var(--success); }

.foot {
  margin-top: 32px;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(201, 164, 74, 0.45);
}
.foot a { color: var(--gold-dark); text-decoration: none; }
.foot a:hover { color: var(--gold-light); }

.footer-line {
  width: 240px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 164, 74, 0.3), transparent);
  margin: 0 auto 10px;
}

/* --- Admin styles --- */
.admin-container {
  position: relative;
  z-index: 5;
  max-width: 980px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}
.admin-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.admin-header h1 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 24px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--gold-light);
}
.admin-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.admin-actions input[type="text"] { padding: 10px 14px; font-size: 14px; }

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(201, 164, 74, 0.2);
  margin-bottom: 18px;
}
.admin-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--text-dim);
  padding: 10px 22px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;
  margin-bottom: -1px;
}
.admin-tab::before { display: none; }
.admin-tab:hover { color: var(--gold-light); background: rgba(201, 164, 74, 0.05); transform: none; box-shadow: none; }
.admin-tab.active {
  color: var(--gold-light);
  border-color: rgba(201, 164, 74, 0.3);
  background: rgba(201, 164, 74, 0.08);
  border-bottom: 1px solid var(--bg-dark);
  box-shadow: none;
  transform: none;
}

.section-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 8px;
}
.section-toolbar input[type="text"] {
  padding: 10px 14px;
  font-size: 14px;
  max-width: 320px;
  flex: 1 1 220px;
}
.muted { color: var(--text-dim); font-size: 12px; letter-spacing: 1px; }

.loading-row, .empty-row {
  color: var(--text-dim);
  text-align: center;
  padding: 28px;
  font-style: italic;
}

table.keys td.ip { font-family: 'Consolas', monospace; color: var(--text-dim); font-size: 12px; }
table.keys td:last-child, table.keys th:last-child { width: 36px; text-align: center; }

.row-delete {
  background: transparent;
  border: 1px solid rgba(217, 104, 104, 0.25);
  color: rgba(217, 104, 104, 0.65);
  padding: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  text-shadow: none;
  box-shadow: none;
  font-family: serif;
  font-weight: bold;
}
.row-delete::before { display: none; }
.row-delete:hover {
  background: rgba(217, 104, 104, 0.15);
  border-color: var(--error);
  color: var(--error);
  box-shadow: 0 0 12px rgba(217, 104, 104, 0.3);
  transform: none;
}

.key-display {
  margin-top: 16px;
  padding: 18px;
  background: rgba(10, 16, 28, 0.7);
  border: 1px solid var(--gold);
  border-radius: 2px;
  font-family: 'Consolas', monospace;
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--gold-light);
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 0 20px var(--gold-glow);
}

table.keys {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-family: 'Cormorant Garamond', serif;
}
table.keys th, table.keys td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(201, 164, 74, 0.12);
  font-size: 14px;
}
table.keys th {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 500;
  border-bottom: 1px solid var(--border-ornate);
}
table.keys td.k { font-family: 'Consolas', monospace; color: var(--gold-light); }
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.status-pill.unused { background: rgba(126, 201, 138, 0.12); color: var(--success); border: 1px solid rgba(126, 201, 138, 0.3); }
.status-pill.used   { background: rgba(122, 112, 96, 0.15); color: var(--text-dim); border: 1px solid rgba(122, 112, 96, 0.3); }

.note-cell {
  cursor: pointer;
  position: relative;
  transition: background-color .15s, color .15s;
  border-radius: 2px;
}
.note-cell:hover { background-color: rgba(201, 164, 74, 0.06); }
.note-cell.editing { cursor: text; background-color: rgba(10, 16, 28, 0.7); }
.note-cell.saving { opacity: 0.55; }
.note-placeholder {
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: 1px;
  font-size: 12px;
}
input.note-edit {
  width: 100%;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 2px;
  color: var(--text-light);
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  outline: none;
  box-shadow: 0 0 12px var(--gold-glow);
}

@media (max-width: 720px) {
  .hero h1 { font-size: 34px; letter-spacing: 6px; }
  .hero-subtitle { letter-spacing: 5px; }
  .hero .ornament-top .ornament-line { width: 60px; }
  .container { padding-top: 40px; }
  .card, .panel { padding: 28px 22px; }
  .torch-left  { left: 4%; }
  .torch-right { right: 4%; }
  .skull-stake-left  { left: 12%; }
  .skull-stake-right { right: 12%; }
  .castle { display: none; }
  .access-key-input { font-size: 18px; letter-spacing: 4px; }
  .admin-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes twinkle {
  0% { opacity: .6; }
  50% { opacity: 1; }
  100% { opacity: .7; }
}
@keyframes moonGlow {
  0%   { box-shadow: 0 0 30px rgba(240,232,208,0.3), 0 0 60px rgba(240,232,208,0.15); }
  100% { box-shadow: 0 0 40px rgba(240,232,208,0.4), 0 0 80px rgba(240,232,208,0.2), 0 0 140px rgba(201,164,74,0.12); }
}
@keyframes cloudDrift1 { 0% { transform: translateX(-100px); } 100% { transform: translateX(calc(100vw + 200px)); } }
@keyframes cloudDrift2 { 0% { transform: translateX(100px); }  100% { transform: translateX(calc(-100vw - 200px)); } }
@keyframes cloudDrift3 { 0% { transform: translateX(-200px); } 100% { transform: translateX(calc(100vw + 300px)); } }
@keyframes auroraPulse { 0% { opacity: .4; transform: scaleY(1); } 50% { opacity: .8; transform: scaleY(1.1); } 100% { opacity: .5; transform: scaleY(.95); } }
@keyframes ripple { 0% { transform: translateX(-5px); opacity: .5; } 100% { transform: translateX(5px); opacity: .8; } }
@keyframes moonReflect { 0% { transform: scaleX(1); opacity: .6; } 100% { transform: scaleX(2.5); opacity: .3; } }
@keyframes flicker {
  0%   { transform: translateX(-50%) scaleY(1) scaleX(1); opacity: 0.9; }
  100% { transform: translateX(-50%) scaleY(1.15) scaleX(0.9); opacity: 1; }
}
@keyframes innerFlicker {
  0%   { transform: translateX(-50%) scaleY(1); opacity: 0.7; }
  100% { transform: translateX(-50%) scaleY(1.2); opacity: 1; }
}
@keyframes runeGlow {
  0%   { opacity: 0.2; transform: scale(0.8); box-shadow: 0 0 5px rgba(201,164,74,0.2); }
  100% { opacity: 1;   transform: scale(1.2); box-shadow: 0 0 12px rgba(201,164,74,0.6), 0 0 30px rgba(201,164,74,0.2); }
}
@keyframes mistDrift { 0% { transform: translateX(-30px); } 100% { transform: translateX(30px); } }
@keyframes skullPulse {
  0%   { opacity: 0.55; text-shadow: 0 0 6px rgba(201,164,74,0.4),  0 0 14px rgba(201,164,74,0.15); }
  50%  { opacity: 0.88; text-shadow: 0 0 12px rgba(201,164,74,0.65), 0 0 26px rgba(201,164,74,0.3); }
  100% { opacity: 0.60; text-shadow: 0 0 7px rgba(201,164,74,0.45), 0 0 18px rgba(201,164,74,0.18); }
}
@keyframes float {
  0%   { opacity: 0;  transform: translateY(100vh) scale(0); }
  10%  { opacity: var(--peak, 0.6); }
  90%  { opacity: var(--peak, 0.6); }
  100% { opacity: 0;  transform: translateY(-20vh) scale(1); }
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(192,57,43,0.6), 0 0 18px rgba(192,57,43,0.3); }
  50%      { box-shadow: 0 0 12px rgba(192,57,43,0.85), 0 0 28px rgba(192,57,43,0.45); }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.25); }
::-webkit-scrollbar-thumb { background: rgba(201,164,74,0.25); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,164,74,0.4); }
