/* ============================================================
   HEATED RIVALRY LEAGUE DATABASE
   Design system v2 — confidential sports league aesthetic
   Reference: NHL / EA Sports / ESPN / Apple Wallet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Rajdhani:wght@500;600;700&family=Barlow+Condensed:wght@400;500;600&display=swap');

@font-face { font-family: 'JetBrains Mono'; src: url('assets/fonts/JetBrainsMono-Regular.ttf') format('truetype'); font-weight: 500; }
@font-face { font-family: 'JetBrains Mono'; src: url('assets/fonts/JetBrainsMono-Bold.ttf') format('truetype'); font-weight: 700; }

:root {
  --bg: #06070a;
  --surface: #0d0f14;
  --surface-2: #12151c;
  --surface-3: #171b24;
  --border: #1d212b;
  --border-bright: #2a3040;
  --text: #f2f4f8;
  --text-dim: #9aa2b3;
  --text-faint: #5d6474;

  --wolves: #d81e3a;
  --wolves-glow: rgba(216,30,58,0.18);
  --saints: #3373f2;
  --saints-glow: rgba(51,115,242,0.18);

  --gold: #e8b34a;
  --green: #34c77b;
  --amber: #f0a63c;
  --violet: #a888f0;
  --red: #ef4a5c;

  --font-display: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  --font-ui: 'Rajdhani', sans-serif;
  --font-body: 'Barlow Condensed', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --ease: cubic-bezier(.22,.9,.32,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  position: relative;
}

/* ---------- Subtle background texture: carbon fibre weave + ice sheen ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 4px);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% -5%, rgba(150,190,255,0.05), transparent 60%),
    radial-gradient(ellipse 50% 35% at 100% 0%, rgba(255,255,255,0.035), transparent 60%);
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 64px;
  position: relative;
  z-index: 1;
}

svg { display: block; }

/* ============================================================
   ICON CHIP — used everywhere an icon needs a housing
   ============================================================ */
.icon-chip {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-bright);
  color: var(--text-dim);
}
.icon-chip svg { width: 17px; height: 17px; }

/* ============================================================
   HOME / LOCKED LANDING SCREEN
   ============================================================ */
.lock-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.lock-screen .brand-crest {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
  color: var(--text-dim);
}
.lock-screen .brand-crest svg { width: 26px; height: 26px; }
.lock-screen .eyebrow {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.lock-screen h1 {
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0 0 14px;
  color: var(--text);
}
.lock-screen p {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 320px;
  margin: 0;
}
.lock-screen .divider {
  width: 40px; height: 2px;
  background: var(--border-bright);
  margin: 22px 0;
  border-radius: 2px;
}
.lock-screen .fine-print {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-top: 28px;
}

/* ============================================================
   LOADING SEQUENCE (player.html) — full-viewport, replaces content
   until the profile is authenticated or denied
   ============================================================ */
.loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
  z-index: 2;
  background: var(--bg);
}
.loading-screen .ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border-bright);
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
  margin-bottom: 28px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-lines {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  min-height: 24px;
  letter-spacing: 0.02em;
}
.loading-lines .cur { color: var(--text); }
.loading-lines .dot { display: inline-block; width: 6px; }

.loading-screen.fade-out { animation: fadeOutScreen .45s var(--ease) forwards; }
@keyframes fadeOutScreen { to { opacity: 0; transform: scale(0.98); } }

/* ============================================================
   ACCESS DENIED
   ============================================================ */
.denied-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: fadeIn .5s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.denied-screen .denied-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(239,74,92,0.08);
  border: 1px solid rgba(239,74,92,0.35);
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
  margin-bottom: 24px;
}
.denied-screen .denied-icon svg { width: 30px; height: 30px; }
.denied-screen h1 {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 0.06em;
  color: var(--red);
  margin: 0 0 14px;
}
.denied-screen p {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 300px;
  margin: 0 0 4px;
}

/* ============================================================
   PLAYER HERO — portrait dominates, name is huge
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  animation: heroIn .6s var(--ease);
}
@keyframes heroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hero-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.hero-frame.team-wolves { background: radial-gradient(120% 100% at 50% 0%, var(--wolves-glow), transparent 60%), linear-gradient(180deg, #1a0a0e 0%, #06070a 78%); }
.hero-frame.team-saints { background: radial-gradient(120% 100% at 50% 0%, var(--saints-glow), transparent 60%), linear-gradient(180deg, #0a1220 0%, #06070a 78%); }

.hero-frame .jersey-watermark {
  position: absolute;
  right: -4%; top: 46%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 62vw;
  line-height: 1;
  color: rgba(255,255,255,0.045);
  z-index: 1;
  max-width: none;
}

.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%;
  z-index: 2;
}
.portrait-img.is-placeholder {
  object-fit: contain;
  object-position: center 62%;
  width: 78%;
  height: 78%;
  left: 11%;
  top: 6%;
  opacity: 0.9;
}

.hero-frame .scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(6,7,10,0) 0%, rgba(6,7,10,0.15) 45%, rgba(6,7,10,0.92) 82%, #06070a 100%);
}

.hero-top-row {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 0;
}
.file-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 5px 9px;
  backdrop-filter: blur(6px);
}
.role-badge {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  backdrop-filter: blur(6px);
}
.role-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.team-wolves .role-badge .dot { background: var(--wolves); }
.team-saints .role-badge .dot { background: var(--saints); }

.hero-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  padding: 0 20px 22px;
}
.team-crest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.team-crest-row img { width: 18px; height: 18px; object-fit: contain; border-radius: 4px; }
.team-crest-row span {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.player-name {
  font-family: var(--font-display);
  font-size: clamp(46px, 15vw, 64px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.player-name .nick {
  display: block;
  color: var(--team-accent, var(--gold));
}
.player-first {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}

/* ============================================================
   SECTION CARDS
   ============================================================ */
.cards {
  padding: 26px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 18px;
  text-align: left;
}
.card-head .label {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text);
  flex: 1;
}
.card-head .chev {
  width: 18px; height: 18px;
  color: var(--text-faint);
  transition: transform .3s var(--ease);
  flex-shrink: 0;
}
.card.open .card-head .chev { transform: rotate(180deg); }

.card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .38s var(--ease);
}
.card.open .card-body { max-height: 1600px; }
.card-body-inner {
  padding: 2px 18px 22px 65px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-dim);
}

/* scouting stat rows */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.stat-dots { display: flex; gap: 5px; }
.stat-dots .pip {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-bright);
}
.stat-dots .pip.on { background: var(--gold); }

.persona-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.015em;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.1;
}

.phrase-list, .freq-list { margin: 12px 0 0; padding-left: 0; list-style: none; }
.phrase-list li, .freq-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 9px;
  font-size: 16px;
}
.phrase-list li::before { content: '\201C'; position: absolute; left: 0; top: -3px; color: var(--gold); font-size: 20px; font-family: Georgia, serif; }
.freq-list li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }
.subhead {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 18px 0 2px;
}
.subhead:first-child { margin-top: 0; }

/* ============================================================
   OBJECTIVES — elevated treatment, stands apart from other cards
   ============================================================ */
.card.objectives-card {
  background: linear-gradient(165deg, rgba(232,179,74,0.07), var(--surface) 55%);
  border-color: rgba(232,179,74,0.28);
}
.card.objectives-card .icon-chip {
  background: rgba(232,179,74,0.12);
  border-color: rgba(232,179,74,0.35);
  color: var(--gold);
}
.objectives-progress {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.03em;
}

.obj-list { list-style: none; margin: 4px 0 0; padding: 0; }
.obj-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(232,179,74,0.15);
  cursor: pointer;
}
.obj-item:last-child { border-bottom: none; }
.obj-box {
  width: 25px; height: 25px;
  border: 2px solid var(--border-bright);
  border-radius: 7px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.obj-item.checked .obj-box { background: var(--gold); border-color: var(--gold); transform: scale(1.04); }
.obj-box svg { width: 14px; height: 14px; opacity: 0; stroke: #241800; }
.obj-item.checked .obj-box svg { opacity: 1; }
.obj-text { color: var(--text); font-size: 16.5px; line-height: 1.4; padding-top: 2px; }
.obj-item.checked .obj-text { color: var(--text-faint); text-decoration: line-through; }
.obj-value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--gold);
  margin-top: 14px;
  letter-spacing: 0.04em;
  text-align: right;
}

/* ============================================================
   CONFIDENTIAL LEAGUE INTELLIGENCE FILE
   ============================================================ */
.directive-wrap { padding: 0 18px; margin-top: 14px; }

.directive-card {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px),
    linear-gradient(165deg, #150708 0%, #0a0607 55%, #060505 100%);
  border: 1px solid rgba(239,74,92,0.4);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(239,74,92,0.06), 0 0 38px rgba(239,74,92,0.14), inset 0 0 60px rgba(239,74,92,0.05);
}

.classified-watermark {
  position: absolute;
  top: 52%; left: 50%;
  transform: translate(-50%, -50%) rotate(-22deg);
  font-family: var(--font-display);
  font-size: 15vw;
  letter-spacing: 0.08em;
  color: rgba(239,74,92,0.05);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.directive-card > * { position: relative; z-index: 1; }

.directive-icon {
  width: 50px; height: 50px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(239,74,92,0.1);
  border: 1px solid rgba(239,74,92,0.45);
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
  animation: pulseWarn 2.4s ease-in-out infinite;
}
.directive-icon svg { width: 22px; height: 22px; }
@keyframes pulseWarn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,74,92,0.28); }
  50% { box-shadow: 0 0 0 9px rgba(239,74,92,0); }
}

.directive-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
  line-height: 1.4;
}

.classification-level {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 auto 18px;
  padding: 10px 18px;
  border: 1px dashed rgba(239,74,92,0.4);
  border-radius: var(--radius-sm);
  background: rgba(239,74,92,0.04);
}
.cl-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.cl-value {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.directive-intro {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 320px;
  margin: 0 auto 22px;
}

.directive-open-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: var(--red);
  color: #1a0304;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform .15s var(--ease), opacity .2s ease;
}
.directive-open-btn .btn-icon { width: 18px; height: 18px; display: flex; }
.directive-open-btn .btn-icon svg { width: 100%; height: 100%; }
.directive-open-btn:active { transform: scale(0.97); }
.directive-open-btn.is-open { opacity: 0; height: 0; padding: 0; overflow: hidden; margin: 0; pointer-events: none; }
.directive-open-btn:disabled { cursor: default; }

.decrypt-sequence {
  display: none;
  padding: 18px 0 4px;
}
.decrypt-sequence.show { display: block; }
.decrypt-sequence.fade { opacity: 0; transition: opacity .25s ease; }
.decrypt-line {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--red);
}
.decrypt-line.flash { animation: decryptFlash .3s ease; }
@keyframes decryptFlash { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.directive-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: max-height .55s var(--ease), opacity .45s ease, transform .45s var(--ease), margin .45s var(--ease);
  text-align: left;
}
.directive-content.open {
  max-height: 1100px;
  opacity: 1;
  transform: translateY(0) scale(1);
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px dashed rgba(239,74,92,0.3);
}
.directive-body {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
}

.directive-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(239,74,92,0.2);
  text-align: center;
}
.df-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.df-body {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-faint);
}

/* ============================================================
   LEAGUE STATUS FOOTER
   ============================================================ */
.status-panel {
  margin: 22px 18px 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.status-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.05em;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-bright);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-sub {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.7;
}

.admin-panel {
  margin-top: 0;
  border: 1px dashed var(--saints);
  background: rgba(51,115,242,0.05);
}
.admin-panel .icon-chip { background: rgba(51,115,242,0.12); border-color: rgba(51,115,242,0.4); color: var(--saints); }
.admin-panel .card-head .label { color: var(--saints); }
.admin-row { margin-bottom: 14px; }
.admin-row:last-child { margin-bottom: 0; }
.admin-key {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.admin-val { font-size: 15px; color: var(--text); line-height: 1.5; }

.footer-note {
  text-align: center;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* ============================================================
   ORGANISER DASHBOARD
   ============================================================ */
.dash-eyebrow {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
}
