/* =========================================================
   ZAAD // HARKONNEN DOSSIER
   ========================================================= */

:root {
  --bg-0: #050202;
  --bg-1: #0d0303;
  --blood: #b6121b;
  --blood-deep: #5a0708;
  --ember: #ff5b1f;
  --ember-soft: #ff8a3d;
  --bone: #efe3c8;
  --ink: #0a0000;
  --line: rgba(255, 91, 31, 0.35);
  --line-strong: rgba(255, 91, 31, 0.65);
  --metal-1: #2a1010;
  --metal-2: #14060a;
  --green: #6cff8a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 35%, #1b0606 0%, #0a0202 45%, #000 100%);
  color: var(--bone);
  font-family: 'Rajdhani', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  cursor: crosshair;
}

.mono { font-family: 'Share Tech Mono', monospace; letter-spacing: 0.08em; }
.accent { color: var(--ember); }

/* ===== background layers ===== */
#storm {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; opacity: 0.55;
  pointer-events: none;
}

.vignette {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 75%, #000 100%),
    radial-gradient(circle at 50% 110%, rgba(182,18,27,0.15), transparent 50%);
  pointer-events: none; z-index: 1;
}

.scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,91,31,0.04) 0px,
    rgba(255,91,31,0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none; z-index: 2; mix-blend-mode: overlay;
  animation: scan-jitter 6s steps(60) infinite;
}
@keyframes scan-jitter {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.grid-floor {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 38vh;
  background:
    linear-gradient(to bottom, transparent 0%, rgba(255,91,31,0.05) 60%, rgba(255,91,31,0.12) 100%),
    repeating-linear-gradient(to right, transparent 0 80px, var(--line) 80px 81px),
    repeating-linear-gradient(to bottom, transparent 0 60px, var(--line) 60px 61px);
  transform: perspective(700px) rotateX(60deg);
  transform-origin: bottom;
  pointer-events: none;
  z-index: 1;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 35%, #000 100%);
}

/* ===== top + bottom bars ===== */
.topbar, .bottombar {
  position: fixed;
  left: 0; right: 0;
  z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px;
  font-size: 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), rgba(0,0,0,0));
  color: rgba(239,227,200,0.7);
}
.topbar { top: 0; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.bottombar {
  bottom: 0; top: auto;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  justify-content: center; gap: 14px;
  font-size: 11px;
  letter-spacing: 0.2em;
}
.sep { opacity: 0.4; }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 16px var(--green);
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1;} 50% { opacity: 0.3;} }

/* spice flow indicator */
.spice-flow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ember-soft);
  font-size: 11px;
}
.spice-flow b { color: var(--ember); }
.flow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 6px var(--ember), 0 0 14px var(--ember-soft);
  animation: blink 1.4s ease-in-out infinite;
}
.ticker {
  color: rgba(239,227,200,0.7);
  font-size: 11px;
  animation: ticker-flicker 4s ease-in-out infinite;
}
@keyframes ticker-flicker {
  0%,100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* marquee for "spice must flow" */
.spice-flow-marquee {
  display: inline-block;
  font-weight: 700;
  animation: spice-pulse 2.4s ease-in-out infinite;
  text-shadow: 0 0 6px rgba(255,91,31,0.6);
}
@keyframes spice-pulse {
  0%,100% { opacity: 1; letter-spacing: 0.2em; }
  50%     { opacity: 0.6; letter-spacing: 0.28em; }
}

/* ===== stage ===== */
.stage {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 90px 20px 90px;
}

.hint {
  margin-top: 28px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(239,227,200,0.45);
  animation: hint-pulse 3s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%,100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

/* ===== loading boot ===== */
.loading {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  color: var(--ember);
  transition: opacity 0.6s ease;
}
.loading.gone { opacity: 0; pointer-events: none; }
.boot-text {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.boot-text span {
  opacity: 0;
  transform: translateX(-8px);
  animation: boot-in 0.4s forwards;
}
.boot-text span:nth-child(1) { animation-delay: 0.1s; }
.boot-text span:nth-child(2) { animation-delay: 0.55s; }
.boot-text span:nth-child(3) { animation-delay: 1.0s; }
.boot-text span:nth-child(4) { animation-delay: 1.45s; }
.boot-text .green { color: var(--green); }
@keyframes boot-in {
  to { opacity: 1; transform: translateX(0); }
}

/* ===== CARD ===== */
.card-wrap {
  position: relative;
  perspective: 1600px;
  width: min(440px, 92vw);
  height: min(720px, 88vh);
  min-height: 700px;
}

.card {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  transform: rotateX(0deg) rotateY(0deg);
  will-change: transform;
}

.card-shadow {
  position: absolute;
  left: 8%; right: 8%;
  bottom: -40px;
  height: 70px;
  background: radial-gradient(ellipse at center, rgba(182,18,27,0.55), transparent 70%);
  filter: blur(20px);
  z-index: -1;
  animation: float-shadow 6s ease-in-out infinite;
}
@keyframes float-shadow {
  0%,100% { transform: scale(1) translateY(0); opacity: 0.7; }
  50% { transform: scale(0.92) translateY(8px); opacity: 0.45; }
}

.card-frame {
  position: absolute; inset: 0;
  border-radius: 6px;
  padding: 26px 24px 22px;
  background:
    linear-gradient(180deg, #1c0708 0%, #0a0204 100%),
    var(--metal-2);
  background-blend-mode: overlay;
  border: 2px solid #2a0c0e;
  box-shadow:
    0 0 0 1px rgba(255,91,31,0.15),
    inset 0 0 0 2px rgba(0,0,0,0.6),
    inset 0 0 60px rgba(0,0,0,0.7),
    0 30px 60px rgba(0,0,0,0.7),
    0 0 80px rgba(182,18,27,0.18);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateZ(0);
}

/* subtle worn texture */
.card-frame::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 6px),
    radial-gradient(circle at 20% 10%, rgba(255,91,31,0.1), transparent 35%),
    radial-gradient(circle at 80% 90%, rgba(182,18,27,0.15), transparent 40%);
  pointer-events: none;
  mix-blend-mode: screen;
}

/* holographic foil that follows mouse */
.card-foil {
  position: absolute; inset: 0;
  border-radius: 6px;
  background:
    radial-gradient(
      circle at var(--mx, 50%) var(--my, 50%),
      rgba(255,200,120,0.35),
      rgba(255,91,31,0.10) 18%,
      transparent 38%
    );
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 3;
  transition: background 0.08s linear;
}

.card-glow {
  position: absolute;
  inset: -2px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ember), var(--blood), transparent 60%);
  filter: blur(14px);
  opacity: 0.35;
  z-index: -1;
  animation: edge-breathe 4s ease-in-out infinite;
}
@keyframes edge-breathe {
  0%,100% { opacity: 0.25; }
  50% { opacity: 0.55; }
}

/* corners */
.corner {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--ember);
  z-index: 4;
  filter: drop-shadow(0 0 4px var(--ember));
}
.corner.tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.corner.tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.corner.bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.corner.br { bottom: 8px; right: 8px; border-left: none; border-top: none; }

/* rivets on card outer frame */
.rivet {
  position: absolute;
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6b2222, #1a0303);
  box-shadow: inset 0 0 2px #000, 0 0 2px rgba(255,91,31,0.5);
  z-index: 5;
}
.rivet.r1 { top: 14px; left: 50%; transform: translateX(-50%); }
.rivet.r2 { bottom: 14px; left: 50%; transform: translateX(-50%); }
.rivet.r3 { top: 50%; left: 14px; transform: translateY(-50%); }
.rivet.r4 { top: 50%; right: 14px; transform: translateY(-50%); }

/* ===== card header ===== */
.card-header {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.sigil {
  width: 56px; height: 56px;
  filter: drop-shadow(0 0 8px rgba(255,91,31,0.65));
  animation: sigil-spin 22s linear infinite;
}
@keyframes sigil-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.house-label, .rank-label {
  font-size: 10px; color: rgba(239,227,200,0.5);
}
.house-name {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--ember);
  text-shadow: 0 0 10px rgba(255,91,31,0.55);
}
.rank { text-align: right; }
.rank-value {
  font-family: 'Cinzel', serif;
  font-size: 13px; letter-spacing: 0.2em;
  color: var(--bone);
}

/* ===== portrait ===== */
.portrait {
  margin: 14px 0 12px;
  position: relative;
  z-index: 2;
}
.portrait-inner {
  position: relative;
  aspect-ratio: 220 / 240;
  border: 1px solid var(--line-strong);
  background: #000;
  overflow: hidden;
  box-shadow:
    inset 0 0 30px rgba(255,91,31,0.18),
    inset 0 0 4px #000;
}
.silhouette { width: 100%; height: 100%; display: block; }

/* portrait flicker / target overlay */
.portrait-frame {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, transparent 0, transparent 49%, rgba(255,91,31,0.5) 49.5%, transparent 50%),
    linear-gradient(to right,  transparent 0, transparent 49%, rgba(255,91,31,0.5) 49.5%, transparent 50%);
  mix-blend-mode: screen;
  opacity: 0.4;
  animation: target-pulse 2.4s ease-in-out infinite;
}
@keyframes target-pulse {
  0%,100% { opacity: 0.25; }
  50% { opacity: 0.65; }
}

.portrait-rivets span {
  position: absolute;
  width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6b2222, #1a0303);
}
.portrait-rivets span:nth-child(1) { top: 6px; left: 6px; }
.portrait-rivets span:nth-child(2) { top: 6px; right: 6px; }
.portrait-rivets span:nth-child(3) { bottom: 6px; left: 6px; }
.portrait-rivets span:nth-child(4) { bottom: 6px; right: 6px; }

.portrait-tag {
  position: absolute;
  bottom: 6px; left: 12px;
  font-size: 9px;
  color: rgba(255,91,31,0.8);
  letter-spacing: 0.15em;
}

/* ===== identity ===== */
.identity { position: relative; z-index: 2; margin-top: 4px; }
.name-line { position: relative; }
.name {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 48px;
  margin: 0;
  letter-spacing: 0.22em;
  color: var(--bone);
  text-shadow:
    0 0 1px #fff,
    0 0 14px rgba(255,91,31,0.55),
    0 2px 0 #2a0303;
  line-height: 1;
}
.name-underline {
  height: 2px;
  background: linear-gradient(to right, var(--ember), transparent 80%);
  margin-top: 4px;
  box-shadow: 0 0 8px var(--ember);
}

/* glitch */
.glitch { position: relative; display: inline-block; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.glitch::before {
  color: #ff2a4d;
  mix-blend-mode: screen;
  transform: translate(2px, 0);
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  animation: glitch-a 4s steps(40) infinite;
}
.glitch::after {
  color: #1ee3ff;
  mix-blend-mode: screen;
  transform: translate(-2px, 0);
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  animation: glitch-b 5.5s steps(40) infinite;
}
@keyframes glitch-a {
  0%, 88%, 100% { transform: translate(0,0); opacity: 0; }
  89% { transform: translate(2px,-1px); opacity: 0.7; }
  92% { transform: translate(-3px,1px); opacity: 0.8; }
  95% { transform: translate(1px,0); opacity: 0.6; }
}
@keyframes glitch-b {
  0%, 92%, 100% { transform: translate(0,0); opacity: 0; }
  93% { transform: translate(-2px,1px); opacity: 0.7; }
  96% { transform: translate(2px,-1px); opacity: 0.8; }
}

.subtitle {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.18em;
}
.class-tag {
  display: inline-block;
  padding: 3px 10px;
  background: linear-gradient(180deg, #6e0a10, #2a0405);
  border: 1px solid var(--ember);
  color: var(--bone);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(255,91,31,0.35);
}
.guild-tag { color: rgba(239,227,200,0.7); font-size: 12px; }
.guild-tag b { color: var(--ember); letter-spacing: 0.22em; }
.dot-sep {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 6px var(--ember);
}

/* ===== stats ===== */
.stats {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; z-index: 2;
}
.stat-head {
  display: flex; justify-content: space-between;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(239,227,200,0.85);
  margin-bottom: 4px;
}
.stat-num { color: var(--ember); }
.bar {
  position: relative;
  height: 8px;
  background:
    linear-gradient(to right, rgba(255,91,31,0.08) 0 1px, transparent 1px) 0 0/8px 100%,
    rgba(0,0,0,0.6);
  border: 1px solid rgba(255,91,31,0.25);
  overflow: hidden;
}
.bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  background:
    linear-gradient(90deg, #ffb37a, var(--ember) 50%, var(--blood) 100%);
  box-shadow: 0 0 8px rgba(255,91,31,0.7);
  animation: fill-bar 1.6s 0.4s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes fill-bar {
  to { width: var(--v); }
}
.bar-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to right,
    rgba(0,0,0,0.0) 0 6px,
    rgba(0,0,0,0.35) 6px 7px
  );
}

/* ===== KPI grid ===== */
.kpis {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: relative; z-index: 2;
}
.kpi {
  text-align: center;
  padding: 10px 6px;
  background: linear-gradient(180deg, rgba(255,91,31,0.06), rgba(0,0,0,0.4));
  border: 1px solid rgba(255,91,31,0.28);
  border-top: 1px solid var(--ember);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,91,31,0.18), transparent 40%);
  pointer-events: none;
}
.kpi-val {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--ember);
  text-shadow: 0 0 8px rgba(255,91,31,0.5);
  letter-spacing: 0.05em;
}
.kpi-lbl {
  margin-top: 4px;
  font-size: 9px;
  color: rgba(239,227,200,0.6);
  letter-spacing: 0.12em;
}

/* ===== card footer ===== */
.card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  position: relative; z-index: 2;
}
.loadout {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
  font-size: 11px;
  padding: 3px 0;
}
.lo-lbl { color: rgba(239,227,200,0.45); font-size: 9px; }
.lo-val {
  color: var(--bone);
  letter-spacing: 0.1em;
  font-weight: 500;
  text-align: right;
}
.motto {
  margin-top: 12px;
  padding: 10px 12px;
  font-family: 'Cinzel', serif;
  font-style: italic;
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.12em;
  color: rgba(239,227,200,0.85);
  border-top: 1px dashed rgba(255,91,31,0.4);
  border-bottom: 1px dashed rgba(255,91,31,0.4);
  background: linear-gradient(180deg, rgba(182,18,27,0.08), transparent);
}
.quote-mark {
  color: var(--ember);
  font-size: 18px;
  vertical-align: -2px;
  font-style: normal;
}

/* ===== responsive ===== */
@media (max-width: 480px) {
  .card-wrap { min-height: 660px; }
  .name { font-size: 38px; }
  .kpi-val { font-size: 18px; }
  .topbar, .bottombar { padding: 10px 14px; font-size: 10px; }
}
