/* ═══════════════════════════════════════════════════════════════════════════
   STAR LEGENDS — Design System
   Font: Space Grotesk | Colors: Black + White + Gold accents
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; }
:root {
  --bg: #000; --text: #ccc; --text-dim: #666;
  --blue: #fff; --blue-bright: #fff; --blue-dark: #333;
  --glow: rgba(255,255,255,0.12); --glow-strong: rgba(255,255,255,0.25);
  --gold: #d4a853;
  --panel: rgba(10, 10, 10, 0.95);
  --line: rgba(255,255,255,0.12);
  --cyan: #d4a853;
  --red: #ff4444;
  --green: #50f39b;
  --muted: #666;
  font-family: 'Space Grotesk', sans-serif;
}
html { scroll-behavior: smooth; }
body { background: #000; color: var(--text); font-family: 'Space Grotesk', sans-serif; overflow-x: hidden; line-height: 1.6; }
button, input { font: inherit; }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; }

/* ═══ STARFIELD CANVAS ═══ */
#starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ═══ PLANET ═══ */
#the-planet {
  position: fixed; z-index: 0; pointer-events: none;
  width: 80vh; height: 80vh; min-width: 480px; min-height: 480px;
  border-radius: 50%; top: 50%; left: 65%;
  transform: translate(-50%, -50%);
}
.planet-sphere {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background: url('/assets/planet-coruscant.jpg') center/cover;
  box-shadow: inset -40px -30px 80px rgba(0,0,0,0.3);
}
.planet-atmo {
  position: absolute; inset: -24px; border-radius: 50%;
}
.planet-moon-orbit {
  position: absolute; inset: -90px; border-radius: 50%;
  border: 1px solid rgba(212,168,83,0.06);
  animation: moonOrbit 22s linear infinite;
}
.planet-moon {
  position: absolute; top: 0; left: 50%; width: 24px; height: 24px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6a8a9a 0%, #3a5060 40%, #1a2a35 100%);
  box-shadow: 0 0 12px rgba(212,168,83,0.2), inset -5px -3px 10px rgba(0,0,0,0.6);
}
@keyframes moonOrbit { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ═══ NAV ═══ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 60px; transition: all 0.4s;
}
nav.scrolled { background: rgba(0,0,0,0.7); backdrop-filter: blur(16px); padding: 16px 60px; }
.nav-logo { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.3em; color: #fff; text-decoration: none; }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a { color: #666; text-decoration: none; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; transition: color 0.3s; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-cta { padding: 9px 24px; background: transparent; border: 1px solid #fff; color: #fff; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; cursor: pointer; transition: all 0.3s; }
.nav-cta:hover { background: #fff; color: #000; }

/* ═══ SECTIONS ═══ */
section { position: relative; z-index: 1; display: flex; min-height: 100vh; align-items: center; overflow: hidden; }
section.dashboard-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; align-items: stretch; height: calc(100% - 24px); margin-top: 24px;}

/* ═══ HERO ═══ */
#hero { justify-content: flex-start; padding: 0 8vw; }
.hero-content { position: relative; z-index: 2; max-width: 600px; padding-left: 8vw; }
.hero-tag { display: inline-block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-bottom: 20px; opacity: 0; animation: fadeUp 0.8s ease 0.4s forwards; }
h1 { font-size: clamp(3.2rem, 6.5vw, 7rem); font-weight: 700; line-height: 0.93; letter-spacing: 0.04em; color: #fff; opacity: 0; animation: fadeUp 0.9s ease 0.6s forwards; }
h1 .glow-word { color: var(--gold); text-shadow: 0 0 50px rgba(212,168,83,0.4), 0 0 100px rgba(212,168,83,0.15); }
.hero-sub { margin-top: 28px; font-size: 1rem; font-weight: 300; color: #999; line-height: 1.75; max-width: 460px; opacity: 0; animation: fadeUp 0.9s ease 0.8s forwards; }
.hero-actions { margin-top: 40px; display: flex; gap: 16px; align-items: center; opacity: 0; animation: fadeUp 0.9s ease 1s forwards; }
.hero-stats { margin-top: 60px; margin-bottom: 80px; display: flex; gap: 48px; opacity: 0; animation: fadeUp 0.9s ease 1.2s forwards; }
.hero-stat-val { font-size: 1.8rem; font-weight: 700; color: #fff; }
.hero-stat-label { font-size: 0.68rem; color: #666; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }

/* ═══ BUTTONS ═══ */
.btn-primary { padding: 14px 36px; background: #fff; color: #000; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; border: none; border-radius: 12px; cursor: pointer; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.btn-primary:hover { box-shadow: 0 0 30px rgba(255,255,255,0.2), 0 8px 24px -8px rgba(255,255,255,0.15); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { padding: 13px 28px; background: transparent; border: 1px solid rgba(255,255,255,0.15); border-radius: 12px; color: rgba(255,255,255,0.5); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.4); color: #fff; background: rgba(255,255,255,0.04); }
.full-width { width: 100%; }

/* ═══ GENERIC ═══ */
.section-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; display: block; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700; color: #fff; line-height: 1.1; }

/* ═══ LORE ═══ */
.lore-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 100px 60px; width: 100%; }
.lore-text p { color: #999; font-size: 0.95rem; line-height: 1.8; margin-top: 18px; }
.lore-highlight { margin-top: 28px; padding: 18px 22px; border-left: 1px solid rgba(212,168,83,0.3); }
.lore-highlight p { font-style: italic; color: #ccc; font-size: 0.9rem; margin: 0 !important; }
.lore-visual { position: relative; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.holo-map { width: 300px; height: 300px; position: relative; border-radius: 50%; border: 1px solid rgba(255,255,255,0.1); animation: holoSpin 20s linear infinite; }
.holo-map::before, .holo-map::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,0.06); }
.holo-map::before { inset: 30px; animation: holoSpin 15s linear infinite reverse; }
.holo-map::after { inset: 70px; border-color: rgba(255,255,255,0.12); animation: holoSpin 10s linear infinite; }
.holo-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(212,168,83,0.5); animation: holoPulse 2s ease-in-out infinite; }
@keyframes holoSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes holoPulse { 0%,100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }

/* ═══ AVATAR SHOWCASE ═══ */
.avatar-inner { max-width: 1200px; margin: 0 auto; padding: 100px 60px; width: 100%; }
.avatar-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: start; margin-top: 60px; }
.avatar-card { border: 1px solid rgba(255,255,255,0.08); padding: 36px; position: relative; clip-path: polygon(0 0,calc(100% - 20px) 0,100% 20px,100% 100%,20px 100%,0 calc(100% - 20px)); }
.avatar-card::before { content: ''; position: absolute; top: 0; right: 20px; width: 60px; height: 2px; background: linear-gradient(to right, transparent, var(--gold)); }
.avatar-portrait { width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2a4a6a, #0d1f33); border: 2px solid rgba(255,255,255,0.2); box-shadow: 0 0 20px rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 18px; }
.avatar-name { font-size: 1rem; font-weight: 700; color: #fff; }
.avatar-class { font-size: 0.72rem; color: var(--gold); letter-spacing: 0.15em; text-transform: uppercase; margin-top: 4px; }
.avatar-level { margin-top: 22px; }
.level-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.level-label { font-size: 0.7rem; color: #666; letter-spacing: 0.1em; text-transform: uppercase; }
.level-val { font-size: 0.82rem; color: #fff; font-weight: 700; }
.xp-bar { height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.xp-fill { height: 100%; width: 0; background: linear-gradient(to right, #333, #fff); transition: width 1.8s ease; box-shadow: 0 0 8px rgba(255,255,255,0.1); }
.avatar-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.stat-cell { border: 1px solid rgba(255,255,255,0.06); padding: 12px 14px; }
.stat-name { font-size: 0.66rem; color: #666; letter-spacing: 0.12em; text-transform: uppercase; }
.stat-value { font-size: 0.95rem; color: #fff; font-weight: 600; margin-top: 4px; }
.stat-bar { margin-top: 5px; height: 2px; background: rgba(255,255,255,0.06); border-radius: 1px; }
.stat-bar-fill { height: 100%; background: #fff; border-radius: 1px; }
.skill-panel { border: 1px solid rgba(255,255,255,0.06); padding: 28px; }
.skill-panel-title { font-size: 0.75rem; color: var(--gold); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 20px; }
.skill-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.skill-row:last-child { border-bottom: none; }
.skill-icon { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; clip-path: polygon(8px 0,100% 0,calc(100% - 8px) 100%,0 100%); cursor: pointer; transition: all 0.3s; }
.skill-icon:hover, .skill-icon.active { border-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.1); }
.skill-info { flex: 1; }
.skill-name { font-size: 0.8rem; color: #ccc; font-weight: 500; }
.skill-desc { font-size: 0.7rem; color: #666; margin-top: 2px; }
.skill-lvl { font-size: 0.68rem; color: #fff; white-space: nowrap; }

/* ═══ EMPIRE ═══ */
.empire-inner { max-width: 1200px; margin: 0 auto; padding: 100px 60px; width: 100%; }
.empire-header { text-align: right; margin-bottom: 60px; }
.empire-panels { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; }
.empire-panel { padding: 36px 32px; position: relative; overflow: hidden; transition: background 0.4s; cursor: default; border: 1px solid rgba(255,255,255,0.04); }
.empire-panel::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: linear-gradient(to right,transparent,#fff,transparent); opacity: 0; transition: opacity 0.4s; }
.empire-panel:hover::after { opacity: 0.3; }
.panel-icon { font-size: 2.2rem; margin-bottom: 18px; display: block; }
.panel-title { font-size: 0.9rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.panel-desc { font-size: 0.82rem; color: #666; line-height: 1.7; }
.panel-resource { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.res-row { display: flex; justify-content: space-between; font-size: 0.72rem; }
.res-name { color: #666; }
.res-val { color: #fff; font-weight: 600; }
.res-bar { height: 2px; background: rgba(255,255,255,0.06); margin-top: 3px; }
.res-fill { height: 100%; background: #fff; opacity: 0.5; }

/* ═══ FEATURES ═══ */
.features-inner { max-width: 1200px; margin: 0 auto; padding: 100px 60px; width: 100%; }
.features-header { margin-bottom: 60px; }
.features-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.feature-card { padding: 36px; border: 1px solid rgba(255,255,255,0.06); transition: all 0.4s; position: relative; overflow: hidden; }
.feature-card:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-4px); }
.feature-num { font-size: 2rem; font-weight: 900; color: rgba(212,168,83,0.15); line-height: 1; margin-bottom: 12px; }
.feature-title { font-size: 0.88rem; font-weight: 700; color: #fff; letter-spacing: 0.05em; margin-bottom: 10px; }
.feature-desc { font-size: 0.85rem; color: #666; line-height: 1.7; }

/* ═══ FOOTER ═══ */
footer { padding: 36px 60px; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.footer-logo { font-weight: 700; font-size: 0.95rem; letter-spacing: 0.3em; color: #fff; }
.footer-copy { font-size: 0.75rem; color: #666; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 0.75rem; color: #666; text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: #fff; }

/* ═══ REVEALS ═══ */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.22s; }
.reveal-d3 { transition-delay: 0.34s; }
.reveal-d4 { transition-delay: 0.46s; }
@keyframes fadeUp { from{opacity:0;transform:translateY(28px);} to{opacity:1;transform:none;} }

/* ═══════════════════════════════════════════════════════════════════════════
   VELO DE TRANSICIÓN DE ACCESO
   ═══════════════════════════════════════════════════════════════════════════ */

/* z-index por encima del iframe de One Tap de Google (~2e9) para taparlo al volver. */
.auth-transition {
  position: fixed; inset: 0;
  z-index: 2147483000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(212,168,83,0.07) 0%, rgba(0,0,0,0.97) 70%);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
.auth-transition.visible {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.18s ease, visibility 0s;
}
html.auth-redirecting .auth-transition {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: none;
}
.auth-transition-inner {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.auth-transition-ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(212,168,83,0.18);
  border-top-color: rgba(212,168,83,0.9);
  animation: authSpin 0.9s linear infinite;
}
.auth-transition-text {
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
}
@keyframes authSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-transition-ring { animation: none; } }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

/* Overlay & container */
.auth-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hidden { display: none !important; }
.auth-modal.hidden { display: none; }
@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.auth-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(212,168,83,0.06) 0%, rgba(0,0,0,0.92) 70%);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
.auth-modal-content {
  position: relative; z-index: 1;
  width: min(460px, calc(100vw - 40px));
  max-height: 88vh; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,168,83,0.3) transparent;
}
.auth-modal-content::-webkit-scrollbar { width: 4px; }
.auth-modal-content::-webkit-scrollbar-thumb { background: rgba(212,168,83,0.3); border-radius: 4px; }

/* Card */
.auth-modal-card {
  background: linear-gradient(165deg, rgba(18,18,20,0.97) 0%, rgba(8,8,10,0.99) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 40px 36px 36px;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 80px -12px rgba(0,0,0,0.7),
    0 0 120px -40px rgba(212,168,83,0.08);
  animation: cardSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  overflow: hidden;
}
.auth-modal-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212,168,83,0.4) 50%, transparent 100%);
}
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Titles */
.auth-modal-title {
  font-size: 1.5rem; font-weight: 700; color: #fff;
  margin-bottom: 6px; letter-spacing: 0.04em;
}
.auth-modal-title span { color: var(--gold); }
.auth-modal-sub {
  color: rgba(255,255,255,0.45);
  font-size: 0.88rem; margin-bottom: 28px; line-height: 1.5;
}

/* Divider */
.auth-divider {
  text-align: center; color: rgba(255,255,255,0.3);
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  margin: 24px 0; position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 55px); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
}
.auth-divider::before { left: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1)); }
.auth-divider::after  { right: 0; background: linear-gradient(270deg, transparent, rgba(255,255,255,0.1)); }

/* Auth Brand */
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.auth-brand-icon {
  font-size: 1.4rem; color: var(--gold); line-height: 1;
  filter: drop-shadow(0 0 8px rgba(212,168,83,0.4));
}
.auth-brand h2 { margin-bottom: 0; }

/* Provider Button (Google, Apple, Microsoft...) */
.provider-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-provider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 20px;
  background: rgba(255,255,255,0.95); color: #1a1a1a;
  border: none; border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,1);
}
.btn-provider:hover {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,1);
  transform: translateY(-2px);
}
.btn-provider:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.provider-icon { flex-shrink: 0; }

/* Auth footer text */
.auth-footer-text {
  margin-top: 24px; text-align: center;
  font-size: 0.7rem; color: rgba(255,255,255,0.25);
  letter-spacing: 0.02em;
}

/* Close button */
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; color: rgba(255,255,255,0.4);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
  transition: all 0.2s; z-index: 2;
}
.modal-close:hover {
  color: #fff; background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}

/* ═══ AUTH FORMS ═══ */
.stack-form { display: grid; gap: 18px; }
.stack-form label span, .field-label {
  display: block; margin-bottom: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
input[type='text'], input[type='password'], input[type='file'] {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s;
}
input[type='text']:hover, input[type='password']:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
}
input[type='text']:focus, input[type='password']:focus {
  border-color: var(--gold);
  background: rgba(212,168,83,0.04);
  box-shadow: 0 0 0 3px rgba(212,168,83,0.1), 0 0 20px -4px rgba(212,168,83,0.15);
}
input::placeholder { color: rgba(255,255,255,0.2); }
.status-box {
  margin-top: 16px; padding: 12px 16px;
  color: rgba(255,255,255,0.5); font-size: 0.82rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.status-box:empty { display: none; }

/* ═══ WIZARD ═══ */
.wizard-panel { display: flex; flex-direction: column; gap: 20px; }
.wizard-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.wizard-progress { display: flex; flex-direction: column; gap: 8px; }
.progress-bar {
  height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), #f0d48a);
  box-shadow: 0 0 12px rgba(212,168,83,0.4);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-label { font-size: 0.72rem; color: rgba(255,255,255,0.35); letter-spacing: 0.05em; }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: stepFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes stepFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.step-title {
  font-size: 0.92rem; font-weight: 700; color: var(--gold);
  letter-spacing: 0.06em; margin: 0 0 16px;
  text-shadow: 0 0 20px rgba(212,168,83,0.2);
}
.step-flavor { color: rgba(255,255,255,0.4); font-size: 0.85rem; margin: 0 0 16px; line-height: 1.5; }

.wizard-nav { display: flex; gap: 10px; margin-top: 12px; }
.wizard-nav .btn-primary { flex: 1; }
.wizard-nav .btn-primary,
.wizard-nav .btn-ghost {
  border-radius: 12px;
}
.wizard-error {
  padding: 12px 16px; border-radius: 12px;
  background: rgba(255,68,68,0.06);
  border: 1px solid rgba(255,68,68,0.2);
  color: #ff8b8b; font-size: 0.85rem;
}

.link-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.4); font-size: 0.82rem;
  cursor: pointer; transition: color 0.25s;
}
.link-btn:hover { color: var(--gold); }

/* sex selector */
.sex-selector { display: flex; gap: 8px; }
.sex-btn {
  flex: 1; padding: 11px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.4); cursor: pointer;
  transition: all 0.25s; font-size: 0.82rem;
  font-weight: 500; text-align: center;
  border-radius: 10px;
}
.sex-btn:hover {
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.05);
}
.sex-btn.selected {
  border-color: var(--gold); color: var(--gold);
  background: rgba(212,168,83,0.08);
  box-shadow: 0 0 0 1px rgba(212,168,83,0.15), 0 0 16px -4px rgba(212,168,83,0.2);
}

/* avatar upload */
.avatar-upload-area {
  width: 140px; height: 140px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.15);
  margin: 0 auto; display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
  transition: all 0.3s;
  background: rgba(255,255,255,0.02);
}
.avatar-upload-area:hover {
  border-color: var(--gold);
  background: rgba(212,168,83,0.04);
  box-shadow: 0 0 30px -8px rgba(212,168,83,0.2);
}
.avatar-drop-text { text-align: center; color: rgba(255,255,255,0.35); font-size: 0.78rem; padding: 10px; }
.avatar-preview { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

/* attribute rows */
.attr-rows { display: grid; gap: 10px; margin-bottom: 16px; }
.attribute-row {
  display: grid; grid-template-columns: 90px 1fr 28px auto;
  align-items: center; gap: 10px;
  padding: 6px 0;
}
.attr-label { color: rgba(255,255,255,0.5); font-size: 0.85rem; }
.attr-bar-track {
  height: 6px; background: rgba(255,255,255,0.06);
  overflow: hidden; border-radius: 3px;
}
.attribute-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.attr-value { color: #fff; font-weight: 700; font-size: 0.95rem; text-align: right; }
.redistrib-indicator {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  background: rgba(212,168,83,0.05);
  border: 1px solid rgba(212,168,83,0.12);
}
.redistrib-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(212,168,83,0.15); color: var(--gold);
  font-weight: 700; font-size: 0.9rem;
}
.redistrib-label { color: rgba(255,255,255,0.4); font-size: 0.78rem; line-height: 1.4; }
.reroll-area { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reroll-area .btn-ghost { padding: 8px 14px; font-size: 0.82rem; border-radius: 10px; }
.muted-text { color: rgba(255,255,255,0.35); font-size: 0.85rem; }

@keyframes dice-shake {
  0%,100% { transform: translateX(0); }
  15% { transform: translateX(-5px) rotate(-2deg); }
  35% { transform: translateX(5px) rotate(2deg); }
  55% { transform: translateX(-4px) rotate(-1deg); }
  75% { transform: translateX(4px) rotate(1deg); }
}
.dice-shake { animation: dice-shake 0.5s ease; }

/* planet cards */
.planets-container { display: grid; gap: 10px; }
.planet-card {
  padding: 16px; border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02); cursor: pointer;
  border-radius: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.planet-card:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}
.planet-card.selected {
  border-color: var(--gold);
  background: rgba(212,168,83,0.04);
  box-shadow: 0 0 0 1px var(--gold), 0 0 24px -4px rgba(212,168,83,0.2);
}
.planet-card.assigned { cursor: default; }
.planet-card.assigned:hover { transform: none; }
.assigned-badge {
  margin-left: auto; padding: 3px 10px; font-size: 0.66rem;
  background: rgba(212,168,83,0.12); border: 1px solid var(--gold);
  color: var(--gold); border-radius: 6px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.planet-card-header { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.planet-emoji { font-size: 2rem; line-height: 1; }
.planet-name { font-size: 0.88rem; font-weight: 700; color: #fff; margin: 0 0 4px; }
.planet-type-badge {
  display: inline-block; padding: 3px 10px; font-size: 0.68rem;
  background: rgba(212,168,83,0.08); border: 1px solid rgba(212,168,83,0.2);
  color: var(--gold); border-radius: 6px; font-weight: 600;
}
.planet-tagline { color: rgba(255,255,255,0.4); font-size: 0.82rem; line-height: 1.5; margin: 0 0 8px; }
.planet-lore-btn {
  background: none; border: none; color: var(--gold); font-size: 0.78rem;
  cursor: pointer; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px;
  opacity: 0.7; transition: opacity 0.2s;
}
.planet-lore-btn:hover { opacity: 1; }
.planet-lore {
  margin-top: 10px; font-size: 0.8rem; color: rgba(255,255,255,0.4); line-height: 1.6;
  border-left: 2px solid rgba(212,168,83,0.25); padding-left: 12px;
}
.planet-lore.hidden { display: none; }

/* profession cards */
.professions-container { display: grid; gap: 10px; }
.profession-card {
  padding: 14px 16px; border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02); cursor: pointer;
  border-radius: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.profession-card:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}
.profession-card.selected {
  border-color: var(--gold);
  background: rgba(212,168,83,0.04);
  box-shadow: 0 0 0 1px var(--gold), 0 0 20px -4px rgba(212,168,83,0.2);
}
.profession-card h4 { margin: 0 0 4px; font-size: 0.9rem; color: #fff; }
.profession-desc { color: rgba(255,255,255,0.4); font-size: 0.78rem; margin: 0 0 6px; line-height: 1.5; }
.profession-item { font-size: 0.78rem; color: rgba(255,255,255,0.35); }
.profession-item strong { color: var(--gold); }

/* confirmation */
.confirm-summary { display: grid; gap: 14px; }
.confirm-avatar-row {
  display: flex; gap: 16px; align-items: center;
  padding: 16px; border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.confirm-avatar-img {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--gold); object-fit: cover;
  box-shadow: 0 0 20px -4px rgba(212,168,83,0.3);
}
.confirm-id strong { display: block; font-size: 1.05rem; color: #fff; }
.confirm-id .muted-text { font-size: 0.82rem; }
.confirm-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.88rem; color: #ccc;
}
.confirm-row span:first-child { color: rgba(255,255,255,0.4); }
.confirm-attrs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.confirm-attr-row {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.8rem;
  transition: border-color 0.2s;
}
.confirm-attr-row:hover { border-color: rgba(212,168,83,0.2); }
.confirm-attr-row span { color: rgba(255,255,255,0.4); margin-bottom: 3px; }
.confirm-attr-row strong { color: var(--gold); font-size: 1.1rem; }

/* loading / error */
.loading-text { color: rgba(255,255,255,0.4); text-align: center; padding: 24px; font-size: 0.88rem; }
.error-text { color: #ff8b8b; text-align: center; padding: 16px; font-size: 0.85rem; }

@keyframes blink-dot-anim {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}
.blink-dot { animation: blink-dot-anim 1.4s infinite; animation-delay: var(--d, 0s); }


/* ═══ RESPONSIVE ═══ */
@media (max-width: 1100px) {
  .lore-inner { grid-template-columns: 1fr; gap: 40px; }
  .avatar-grid { grid-template-columns: 1fr; }
  .empire-panels { grid-template-columns: 1fr; }
  .features-panels { grid-template-columns: 1fr; }
  nav { padding: 16px 24px; }
  .nav-links { display: none; }
}
