/* ============================================================
 *  07-confidants.css — P5 bold aesthetic (no 3D, no floating art)
 *  Style mixed from yuzuki-persona-v4: diagonal red slab,
 *  Bebas Neue titles, Share Tech Mono labels, corner brackets,
 *  scanline overlay, PHANTOM THIEF FILE panel, bottom status bar
 * ============================================================ */

#scene-confidants .p5-bg--list {
  background: var(--p5-black);
}
#scene-confidants .p5-bg--list::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -55deg,
    transparent, transparent 20px,
    rgba(232, 0, 29, 0.035) 20px, rgba(232, 0, 29, 0.035) 21px
  );
  pointer-events: none;
}

/* Big red diagonal accent slab — angular clip-path (right side) */
.cf-slab {
  position: absolute;
  top: 0;
  right: 0;
  width: 38%;
  height: 100%;
  background: var(--p5-red);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
  opacity: 0.08;
  z-index: 1;
  pointer-events: none;
}

/* Scanline overlay — CRT feel */
.cf-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(0, 0, 0, 0.16) 2px, rgba(0, 0, 0, 0.16) 3px
  );
}

/* Gigantic faded watermark "19" */
.cf-wm {
  position: absolute;
  right: -3%;
  bottom: -12%;
  font-family: var(--font-p5-display);
  font-size: 40vw;
  line-height: 1;
  color: rgba(255, 255, 255, 0.025);
  letter-spacing: -14px;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

/* Corner brackets */
.c-tl, .c-br {
  position: absolute;
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 45;
}
.c-tl {
  top: 1.8rem;
  left: 1.8rem;
  border-top: 2px solid rgba(255, 255, 255, 0.14);
  border-left: 2px solid rgba(255, 255, 255, 0.14);
}
.c-br {
  bottom: 3.2rem;
  right: 1.8rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.14);
  border-right: 2px solid rgba(255, 255, 255, 0.14);
}

/* ============================================================
 *  HEADER
 * ============================================================ */
.confidants-header {
  position: absolute;
  top: 54px;
  left: 80px;
  z-index: 5;
}
.confidants-eyebrow {
  font-family: var(--font-p5-mono);
  font-size: 0.7rem;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.8rem;
}
.confidants-title {
  font-family: var(--font-p5-display);
  font-size: clamp(3.6rem, 6vw, 5.4rem);
  line-height: 0.88;
  color: var(--p5-white);
  text-shadow: 5px 5px 0 rgba(0, 0, 0, 0.6);
  letter-spacing: 2px;
}
.confidants-title b {
  color: var(--p5-yellow);
  font-weight: normal;
}
.confidants-date {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-p5-mono);
  font-size: 0.68rem;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.35);
}

/* ============================================================
 *  PHANTOM THIEF FILE — right panel (replaces old Joker art)
 * ============================================================ */
.cf-file {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 38px;
  width: min(320px, 26vw);
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.8rem 2rem 2.5rem;
  clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(
    to left,
    rgba(0, 0, 0, 0.88),
    rgba(0, 0, 0, 0.55)
  );
  font-family: var(--font-p5-body);
  color: var(--p5-white);
}
.cf-file-tag {
  font-family: var(--font-p5-mono);
  font-size: 0.6rem;
  letter-spacing: 6px;
  color: var(--p5-red);
  margin-bottom: 0.85rem;
}
.cf-file-name {
  font-family: var(--font-p5-display);
  font-size: clamp(2.6rem, 4vw, 3.8rem);
  line-height: 0.86;
  color: var(--p5-white);
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
  margin-bottom: 0.25rem;
}
.cf-file-codename {
  font-family: var(--font-p5-display);
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  color: var(--p5-red);
  letter-spacing: 4px;
  line-height: 1;
  margin-bottom: 1.1rem;
}
.cf-file-arcana {
  font-family: var(--font-p5-mono);
  font-size: 0.68rem;
  letter-spacing: 4px;
  color: var(--p5-yellow);
  margin-bottom: 1.3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

/* Stat rows */
.cf-stat {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}
.cf-stat-lbl {
  font-family: var(--font-p5-mono);
  font-size: 0.58rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
  width: 82px;
  flex-shrink: 0;
}
.cf-stat-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}
.cf-stat-fill {
  height: 100%;
  width: 0;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cf-stat-n {
  font-family: var(--font-p5-display);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.45);
  width: 24px;
  text-align: right;
}

/* Pentagon confidant rank pips */
.cf-rank-title {
  font-family: var(--font-p5-mono);
  font-size: 0.58rem;
  letter-spacing: 4px;
  color: var(--p5-yellow);
  margin: 1rem 0 0.5rem;
}
.cf-pips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.cf-pip {
  width: 16px;
  height: 16px;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.25s;
}
.cf-pip.lit { background: var(--p5-yellow); }

/* ============================================================
 *  CONFIDANT LIST — bold P5 menu item style
 * ============================================================ */
.confidants-list {
  position: absolute;
  top: 210px;
  left: 80px;
  width: 52%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  z-index: 5;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding-right: 14px;
}
.confidants-list::-webkit-scrollbar { width: 4px; }
.confidants-list::-webkit-scrollbar-thumb { background: var(--p5-red); }
.confidants-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); }

/* ============================================================
 *  PERSONA SKILL ROW — replaces friends list
 * ============================================================ */
.confidant-row {
  display: grid;
  grid-template-columns: 48px 38px 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  transform: none;
  box-shadow: none;
  transition: padding-left 0.22s ease;
}
.confidant-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.confidant-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--p5-red);
  transform: scaleY(0);
  transition: transform 0.18s ease;
  z-index: 0;
}
.confidant-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(232, 0, 29, 0.12),
    rgba(232, 0, 29, 0.02) 60%,
    transparent
  );
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  z-index: 0;
}
.confidant-row:hover {
  padding-left: 1.6rem;
}
.confidant-row:hover::before { transform: scaleY(1); }
.confidant-row:hover::after  { opacity: 1; }
.confidant-row > * { position: relative; z-index: 1; }

/* Icon cell (big symbol) */
.cf-skill-icon {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--p5-yellow);
  text-align: center;
  text-shadow: 0 0 12px rgba(245, 195, 0, 0.4);
  transition: transform 0.2s ease, color 0.2s ease;
}
.confidant-row:hover .cf-skill-icon {
  transform: scale(1.15) rotate(-8deg);
  color: #fff;
}

/* Skill number (mono) */
.cf-skill-num {
  font-family: var(--font-p5-mono);
  font-size: 0.62rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.25);
}

/* Skill name + description */
.cf-skill-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cf-skill-name {
  font-family: var(--font-p5-display);
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
  letter-spacing: 3px;
  color: var(--p5-white);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.18s;
}
.confidant-row:hover .cf-skill-name { color: var(--p5-yellow); }
.cf-skill-desc {
  font-family: var(--font-p5-mono);
  font-size: 0.58rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 36ch;
}

/* SP cost */
.cf-skill-cost {
  font-family: var(--font-p5-mono);
  font-size: 0.58rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 0.8rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Element type badge */
.cf-skill-type {
  font-family: var(--font-p5-mono);
  font-size: 0.55rem;
  letter-spacing: 2px;
  padding: 0.2rem 0.55rem;
  border: 1px solid;
  text-align: center;
  min-width: 72px;
}

/* ============================================================
 *  BLESSING POPUP
 * ============================================================ */
.cf-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
}
.cf-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.cf-modal-backdrop {
  position: absolute;
  inset: 0;
  /* No backdrop-filter — it forced the whole underlying scene (skill cards
   * + P5 backdrop) to be rasterized and blurred every frame, which is what
   * made the popup feel janky. A darker solid overlay gives the same
   * "dim the background" effect at near-zero compositor cost. */
  background:
    radial-gradient(circle at 50% 30%, rgba(232, 0, 29, 0.22), transparent 42%),
    rgba(0, 0, 0, 0.86);
}
.cf-modal-card {
  --cf-modal-accent: var(--p5-yellow);
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 56px));
  max-height: min(78vh, 700px);
  /* centering is owned by GSAP (xPercent/yPercent) — no CSS transform here */
  overflow: auto;
  padding: 28px 30px 26px;
  background:
    linear-gradient(135deg, rgba(232, 0, 29, 0.16), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(8, 8, 10, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
.cf-modal-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--cf-modal-accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--cf-modal-accent) 65%, transparent);
}
.cf-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-p5-mono);
  font-size: 0.58rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.cf-modal-close:hover,
.cf-modal-close:focus-visible {
  background: rgba(232, 0, 29, 0.18);
  border-color: var(--p5-red);
  color: #fff;
  outline: none;
}
.cf-modal-head {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 1rem;
  align-items: start;
  padding-right: 82px;
}
.cf-modal-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  color: var(--cf-modal-accent);
  font-size: 2rem;
  text-shadow: 0 0 18px color-mix(in srgb, var(--cf-modal-accent) 70%, transparent);
}
.cf-modal-kicker {
  font-family: var(--font-p5-mono);
  font-size: 0.6rem;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.46);
  margin-bottom: 0.55rem;
}
.cf-modal-name {
  font-family: var(--font-p5-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.92;
  letter-spacing: 2px;
  color: var(--p5-white);
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}
.cf-modal-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}
.cf-modal-type,
.cf-modal-cost {
  font-family: var(--font-p5-mono);
  font-size: 0.6rem;
  letter-spacing: 2px;
}
.cf-modal-type {
  padding: 0.24rem 0.6rem;
  border: 1px solid currentColor;
}
.cf-modal-cost {
  color: rgba(255, 255, 255, 0.46);
}
.cf-modal-body {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cf-modal-block {
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.cf-modal-label {
  font-family: var(--font-p5-mono);
  font-size: 0.58rem;
  letter-spacing: 4px;
  color: var(--cf-modal-accent);
  margin-bottom: 0.7rem;
}
.cf-modal-copy {
  font-family: var(--font-p5-body);
  font-size: 1.02rem;
  line-height: 1.72;
  color: rgba(255, 255, 255, 0.88);
}
.cf-modal-copy--accent {
  color: color-mix(in srgb, var(--cf-modal-accent) 82%, white);
}

/* ============================================================
 *  BOTTOM STATUS BAR
 * ============================================================ */
.cf-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: rgba(0, 0, 0, 0.82);
  border-top: 2px solid var(--p5-red);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 3rem;
  z-index: 45;
}
.cf-bar-item {
  font-family: var(--font-p5-mono);
  font-size: 0.62rem;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.35);
}
.cf-bar-item span {
  color: var(--p5-yellow);
  margin-left: 0.4rem;
}

/* While Motoha's intro dialogue is on screen, tuck the RETURN button
 * under the dock and gated from interaction. It fades back in when the
 * dock is dismissed. */
#scene-confidants.intro-visible .p5-return {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}
#scene-confidants .p5-return {
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.18s ease, letter-spacing 0.2s ease;
}

/* Motoha's dialogue dock sits above everything — list, file panel,
 * bottom status bar, modal backdrop — so nothing can overlap her. */
#scene-confidants .motoha-dock {
  z-index: 200 !important;
}
