/* ============================================================
 *  05-status.css — Persona 3 Reload status screen (real P3R vibe)
 *  Bold angular clip-path panels, cyan neon borders, stat BARS
 *  with numeric values, arcana badge, level indicator,
 *  corner brackets, and bold typography.
 * ============================================================ */

/* ============ Background layers ============ */
.p3-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, #12255c 0%, #0a1e3f 55%, #050c24 100%);
  z-index: 0;
}
.p3-bg::before {
  /* Diagonal stripe grid */
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(-55deg,
      transparent, transparent 22px,
      rgba(0, 212, 255, 0.03) 22px, rgba(0, 212, 255, 0.03) 23px);
  pointer-events: none;
}
.p3-scanlines {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,
      transparent, transparent 2px,
      rgba(0, 212, 255, 0.025) 2px, rgba(0, 212, 255, 0.025) 3px);
  pointer-events: none;
  z-index: 40;
}
.p3-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 100%, rgba(108, 180, 255, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 0%, rgba(0, 212, 255, 0.18) 0%, transparent 50%);
  pointer-events: none;
}

/* Giant faded "P" watermark */
.p3-wm {
  position: absolute;
  right: -6%;
  bottom: -20%;
  font-family: var(--font-impact);
  font-size: 60vw;
  line-height: 0.78;
  color: rgba(0, 212, 255, 0.035);
  letter-spacing: -20px;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* Top HUD header */
.status-hud-top {
  position: absolute;
  top: 28px;
  left: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--p3-cyan);
  font-size: 0.72rem;
  letter-spacing: 4px;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}
.hud-bracket {
  font-size: 1.05rem;
  color: var(--p3-blue-light);
}
.hud-divider {
  width: 44px;
  height: 1px;
  background: var(--p3-cyan);
  box-shadow: 0 0 6px var(--p3-cyan);
}
.hud-stamp {
  padding: 3px 9px;
  border: 1px solid var(--p3-cyan);
  background: rgba(0, 212, 255, 0.08);
  letter-spacing: 3px;
  font-size: 0.65rem;
}

/* Corner brackets on the four corners */
.status-c-tl, .status-c-tr, .status-c-bl, .status-c-br {
  position: absolute;
  width: 68px;
  height: 68px;
  pointer-events: none;
  z-index: 10;
}
.status-c-tl {
  top: 20px; left: 20px;
  border-top: 2px solid var(--p3-cyan);
  border-left: 2px solid var(--p3-cyan);
  box-shadow: -2px -2px 14px rgba(0, 212, 255, 0.3);
}
.status-c-tr {
  top: 20px; right: 20px;
  border-top: 2px solid var(--p3-cyan);
  border-right: 2px solid var(--p3-cyan);
}
.status-c-bl {
  bottom: 20px; left: 20px;
  border-bottom: 2px solid var(--p3-cyan);
  border-left: 2px solid var(--p3-cyan);
}
.status-c-br {
  bottom: 20px; right: 20px;
  border-bottom: 2px solid var(--p3-cyan);
  border-right: 2px solid var(--p3-cyan);
}

/* ============ Main layout ============ */
.status-layout {
  position: relative;
  z-index: 3;
  width: 92%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: 260px 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  padding-top: 42px;
}

/* ============================================================
 *  MAKOTO ZONE (left column)
 * ============================================================ */
.status-makoto {
  position: relative;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 40px 12px 14px;
  background: linear-gradient(
    165deg,
    rgba(0, 212, 255, 0.08),
    rgba(10, 30, 63, 0.72) 40%,
    rgba(10, 30, 63, 0.88)
  );
  border: 1px solid var(--p3-cyan-soft);
  clip-path: polygon(0 0, 100% 0, 100% 92%, 92% 100%, 0 100%);
  box-shadow:
    0 0 36px rgba(0, 212, 255, 0.18),
    inset 0 0 0 1px rgba(108, 180, 255, 0.22);
}
.status-makoto-glow {
  position: absolute;
  inset: 8% 0 0 0;
  background:
    radial-gradient(circle at 50% 35%,
      rgba(0, 212, 255, 0.32) 0%,
      rgba(108, 180, 255, 0.14) 35%,
      transparent 65%);
  pointer-events: none;
}

/* ============================================================
 *  P3R Character Splash — Yuzuki full-body
 *  Arcana disc + sun rays behind, full-body character floating
 *  in front (expects a transparent-bg PNG for the character),
 *  tarot glyphs orbiting the whole figure, cyan data-scan + plaque.
 * ============================================================ */
.status-portrait-frame {
  position: relative;
  width: min(360px, 96%);
  aspect-ratio: 2 / 3;   /* tall for full-body pose */
  margin: 14px auto 0;
  z-index: 2;
}

/* Arcana disc sits centered on the character's torso/head area,
 * sized to roughly frame them like a P3 character splash. */
.status-portrait-ring {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 115%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 18px rgba(255, 216, 122, 0.35));
  pointer-events: none;
}
.spf-hex-outer {
  animation: spfRingPulse 3.6s ease-in-out infinite;
  transform-origin: 200px 200px;
}
@keyframes spfRingPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.015); }
}
.spf-sun-rays {
  transform-origin: 200px 200px;
  animation: spfRaysSpin 80s linear infinite;
}
@keyframes spfRaysSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Orbiting tarot glyphs — radius matches the arcana disc */
.status-portrait-orbit {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 0;
  height: 0;
  animation: spfOrbitSpin 40s linear infinite;
  pointer-events: none;
}
@keyframes spfOrbitSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spf-glyph {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #ffd87a;
  text-shadow: 0 0 10px rgba(255, 216, 122, 0.9);
  transform-origin: 0 0;
}
/* 4 glyphs at cardinal points around a ~180px radius */
.spf-glyph-1 { transform: rotate(  0deg) translate(0, -180px); }
.spf-glyph-2 { transform: rotate( 90deg) translate(0, -180px); }
.spf-glyph-3 { transform: rotate(180deg) translate(0, -180px); }
.spf-glyph-4 { transform: rotate(270deg) translate(0, -180px); }

/* Full-body character image — no clip, transparent-bg expected,
 * centered and filling the tall frame. */
.status-portrait-clip {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 24px;
  width: 100%;
  transform: translateX(-50%);
  overflow: hidden;
  z-index: 3;
}
.status-portrait-img {
  position: absolute;
  left: 50%;
  bottom: 0;
  max-height: 100%;
  width: auto;
  max-width: 110%;
  transform: translateX(-50%);
  display: block;
  /* Slight cyan rim-light via drop-shadow for P3R splash feel */
  filter:
    drop-shadow(0 0 16px rgba(0, 212, 255, 0.45))
    drop-shadow(0 0 28px rgba(108, 180, 255, 0.3))
    saturate(1.05);
}
.status-portrait-img:not([src]),
.status-portrait-img[src=""] { display: none; }
.status-portrait-img.is-fallback {
  display: block;
  width: 60%;
  height: 90%;
  left: 50%;
  bottom: 0;
  max-width: none;
  background:
    radial-gradient(ellipse at 50% 12%, #1a4080 0%, #0a1e3f 55%, transparent 60%),
    linear-gradient(180deg, transparent 0%, #0a1e3f 20%, #050e24 100%);
}

/* Cyan data-scan — sweeps down the character silhouette */
.status-portrait-scan {
  position: absolute;
  left: -5%;
  right: -5%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 212, 255, 0.9) 50%,
    transparent 100%);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  animation: spfScanSweep 4.2s ease-in-out infinite;
}
@keyframes spfScanSweep {
  0%,  8%    { top: 0;    opacity: 0; }
  14%        { opacity: 0.9; }
  70%        { top: 98%; opacity: 0.6; }
  78%, 100%  { top: 98%; opacity: 0; }
}

/* Bottom plaque — "☾ THE MOON · XVIII" */
.status-portrait-plaque {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 7px;
  background: linear-gradient(180deg, rgba(10, 30, 63, 0.95), rgba(6, 20, 51, 0.98));
  border: 1px solid var(--p3-cyan);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 100%, 0 100%);
  z-index: 5;
  white-space: nowrap;
  box-shadow:
    0 0 14px rgba(0, 212, 255, 0.45),
    inset 0 0 0 1px rgba(255, 216, 122, 0.22);
}
.spf-plaque-arcana {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 4px;
  color: var(--vr-gold-bright);
  text-shadow: 0 0 8px rgba(255, 216, 122, 0.75);
}
.spf-plaque-sep {
  color: var(--p3-cyan);
  font-weight: 700;
}
.spf-plaque-num {
  font-family: var(--font-impact);
  font-size: 1rem;
  letter-spacing: 3px;
  color: var(--p3-cyan);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.75);
}
.status-makoto-caption {
  position: relative;
  z-index: 3;
  margin-top: 14px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-style: italic;
  color: var(--p3-blue-light);
  text-shadow: 0 0 10px rgba(108, 180, 255, 0.7);
  font-size: 0.9rem;
  text-align: center;
  border-top: 1px solid rgba(0, 212, 255, 0.3);
}

/* ============================================================
 *  CENTER CARD — Yuzuki profile
 * ============================================================ */
.status-card {
  position: relative;
  padding: 36px 28px 26px 32px;
  background: linear-gradient(
    180deg,
    rgba(10, 30, 63, 0.92),
    rgba(6, 20, 44, 0.95)
  );
  border: 1px solid var(--p3-cyan);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  box-shadow:
    0 0 40px rgba(0, 212, 255, 0.30),
    inset 0 0 0 1px rgba(108, 180, 255, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.status-card::before {
  /* Top cyan bar accent */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg,
    transparent, var(--p3-cyan), transparent);
  box-shadow: 0 0 10px var(--p3-cyan);
}
.status-card-tag {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 5px;
  color: var(--p3-blue-light);
  margin-bottom: 8px;
  text-shadow: 0 0 8px rgba(108, 180, 255, 0.6);
}
.status-card-name {
  font-family: var(--font-impact);
  color: var(--vr-cream);
  font-size: 4.2rem;
  line-height: 0.86;
  letter-spacing: 2px;
  text-shadow:
    0 0 18px rgba(0, 212, 255, 0.45),
    4px 4px 0 rgba(0, 0, 0, 0.5);
  transform: skewX(-6deg);
}
.status-card-subtitle {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--p3-cyan);
  font-size: 0.78rem;
  letter-spacing: 4px;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
  margin-top: 6px;
}
.status-card-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(0, 212, 255, 0.45) 20%, rgba(0, 212, 255, 0.45) 80%, transparent);
  margin: 18px 0 14px;
}
.status-card-arcana-row,
.status-card-level-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 0;
  font-family: var(--font-ui);
}
.arcana-row-label {
  font-size: 0.62rem;
  letter-spacing: 4px;
  color: rgba(108, 180, 255, 0.6);
  font-weight: 700;
}
.arcana-row-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--vr-gold);
  text-shadow: 0 0 10px rgba(201, 164, 97, 0.6);
  letter-spacing: 2px;
}
.status-level-num {
  font-family: var(--font-impact);
  font-style: normal;
  font-size: 1.5rem;
  color: var(--p3-cyan);
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
  letter-spacing: 1px;
}
.status-card-quote {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--vr-cream);
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.9;
  padding: 4px 6px;
  border-left: 2px solid var(--p3-cyan);
  padding-left: 12px;
}

/* ============================================================
 *  AFFINITY / RESISTANCES — inside-joke pills below the quote
 * ============================================================ */
.status-resist {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(108, 180, 255, 0.28);
}
.status-resist-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.64rem;
  letter-spacing: 4px;
  color: var(--p3-cyan);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
  margin-bottom: 10px;
}
.status-resist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.status-resist-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(10, 30, 63, 0.65);
  border: 1px solid rgba(108, 180, 255, 0.3);
  border-left-width: 3px;
  font-family: var(--font-p5-mono);
  font-size: 0.56rem;
  letter-spacing: 1.5px;
  color: var(--vr-cream);
  transition: transform 0.18s ease, background 0.18s ease;
}
.status-resist-pill:hover {
  transform: translateX(2px);
  background: rgba(0, 212, 255, 0.08);
}
.status-resist-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.status-resist-label {
  flex: 1;
  letter-spacing: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-resist-badge {
  padding: 1px 5px;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  border: 1px solid currentColor;
  line-height: 1.3;
}

/* Affinity color variants */
.status-resist-pill.is-weak {
  border-left-color: #ff4455;
  color: #ffc8cc;
}
.status-resist-pill.is-weak .status-resist-badge {
  color: #ff4455;
  background: rgba(255, 68, 85, 0.1);
}
.status-resist-pill.is-resist {
  border-left-color: #a0a0a0;
  color: #cccccc;
}
.status-resist-pill.is-resist .status-resist-badge {
  color: #a0a0a0;
  background: rgba(160, 160, 160, 0.1);
}
.status-resist-pill.is-null {
  border-left-color: #ffffff;
  color: #ffffff;
}
.status-resist-pill.is-null .status-resist-badge {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}
.status-resist-pill.is-absorb {
  border-left-color: #44dd77;
  color: #b6f5c6;
}
.status-resist-pill.is-absorb .status-resist-badge {
  color: #44dd77;
  background: rgba(68, 221, 119, 0.1);
}
.status-resist-pill.is-block {
  border-left-color: #c488ff;
  color: #e0c4ff;
}
.status-resist-pill.is-block .status-resist-badge {
  color: #c488ff;
  background: rgba(196, 136, 255, 0.1);
}

/* ============================================================
 *  STATS PANEL — right column
 * ============================================================ */
.status-stats {
  position: relative;
  padding: 32px 28px 24px;
  background: linear-gradient(
    180deg,
    rgba(10, 30, 63, 0.82),
    rgba(6, 20, 44, 0.92)
  );
  border: 1px solid var(--p3-cyan-soft);
  border-left: 3px solid var(--p3-cyan);
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
  box-shadow:
    0 0 36px rgba(0, 212, 255, 0.18),
    inset 0 0 30px rgba(0, 212, 255, 0.05);
}
.status-stats-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--vr-cream);
  font-size: 0.92rem;
  letter-spacing: 4px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(108, 180, 255, 0.35);
  text-shadow: 0 0 10px rgba(108, 180, 255, 0.5);
}
.stats-title-bracket {
  color: var(--p3-blue-light);
  font-size: 1.05rem;
}
.status-stats-mark {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--p3-cyan);
  letter-spacing: 3px;
  background: rgba(0, 212, 255, 0.12);
  padding: 3px 9px;
  border: 1px solid var(--p3-cyan);
}

.status-stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;   /* anchor for the scan-line */
}

/* Scan-line — a cyan beam that sweeps top-to-bottom of the stats list
 * during the reveal, unlocking each row as it passes. */
.status-scan-line {
  position: absolute;
  left: -8px;
  right: -8px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 212, 255, 0.6) 18%,
    rgba(120, 240, 255, 1) 50%,
    rgba(0, 212, 255, 0.6) 82%,
    transparent 100%);
  box-shadow:
    0 0 10px rgba(0, 212, 255, 0.9),
    0 0 22px rgba(0, 212, 255, 0.5);
  pointer-events: none;
  z-index: 3;
  transform: translateY(-1px);
  will-change: top, opacity;
}

/* ============ Individual stat row (BAR style) ============ */
.status-stat-row {
  display: grid;
  grid-template-columns: 130px 1fr 48px;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 6px 0;
  /* Dimmed by default; JS promotes to .is-revealed when scan-line hits it */
  transition: color 0.3s ease;
  transform-origin: 50% 50%;
}
/* Brighter left border when revealed — P3R-style gold accent */
.status-stat-row::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -14px;
  width: 3px;
  background: var(--p3-cyan, #00d4ff);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.75);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.status-stat-row.is-revealed::before {
  opacity: 0.85;
}
.status-stat-label {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--vr-cream);
  font-size: 0.78rem;
  letter-spacing: 3px;
}
.status-stat-bar {
  position: relative;
  height: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(108, 180, 255, 0.08)),
    repeating-linear-gradient(90deg,
      transparent, transparent 7px,
      rgba(0, 212, 255, 0.15) 7px, rgba(0, 212, 255, 0.15) 8px);
  border: 1px solid rgba(108, 180, 255, 0.45);
  overflow: hidden;
}
.status-stat-bar::before {
  /* Bar notches (tick marks) */
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    transparent 0, transparent 19.5%,
    rgba(0, 0, 0, 0.4) 19.5%, rgba(0, 0, 0, 0.4) 20%);
  pointer-events: none;
}
.status-stat-fill {
  position: relative;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg,
    #0088cc 0%,
    #00d4ff 40%,
    #6cd8ff 100%);
  box-shadow:
    0 0 8px rgba(0, 212, 255, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.status-stat-fill::after {
  /* Animated shimmer on the bar tip */
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  width: 4px;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 18px var(--p3-cyan);
}
.status-stat-value {
  font-family: var(--font-impact);
  font-size: 1.25rem;
  color: var(--p3-cyan);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
  text-align: right;
  line-height: 1;
}
/* Grade letter badge beside value */
.status-stat-grade {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 0.68rem;
  color: var(--p3-blue-bg);
  background: var(--p3-cyan);
  text-shadow: none;
  letter-spacing: 1px;
}
