/* ===== ORDNANCE — operator accounts ===== */
/* Loaded only on /profile and /leaderboard. Inherits tokens from styles.css. */

/* ---------- shared panel primitive ---------- */

.panel {
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(160deg, #14161a, #0c0d10);
  padding: clamp(20px, 2.6vw, 30px);
}

.panel__head {
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.panel__head h3 {
  margin: 0; font-family: var(--display); font-weight: 900;
  font-size: clamp(20px, 2.4vw, 27px); letter-spacing: .04em;
  text-transform: uppercase; line-height: 1; color: #fff;
}
.panel__note {
  margin: 0 0 18px; font-size: 14px; line-height: 1.6;
  color: var(--text-mute); max-width: 60ch; text-wrap: pretty;
}

/* ---------- operator identity strip ---------- */

.op-head {
  display: flex; align-items: center; gap: clamp(16px, 2.4vw, 26px);
  flex-wrap: wrap;
  border: 1px solid rgba(255,255,255,.1);
  background:
    radial-gradient(90% 180% at 0% 0%, rgba(255,106,31,.14), transparent 60%),
    linear-gradient(160deg, #15171c, #0c0d10);
  padding: clamp(20px, 2.6vw, 30px);
}
.op-head__avatar {
  width: 78px; height: 78px; flex: 0 0 auto;
  object-fit: cover; display: block;
  border: 1px solid rgba(255,255,255,.22);
  background: #1a1d22;
}
.op-head__id { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.op-head__callsign {
  margin: 0; font-family: var(--display); font-weight: 900;
  font-size: clamp(28px, 4.4vw, 46px); line-height: .95;
  text-transform: uppercase; letter-spacing: .02em; color: #fff;
  overflow-wrap: anywhere;
}
.op-head__handle {
  font-family: var(--mono); font-size: 13px; letter-spacing: .1em;
  color: var(--orange);
}
.op-head__since {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-faint);
}
.op-head__rank { margin-left: auto; text-align: right; }
.op-head__rank .label { display: block; margin-bottom: 4px; }
.op-head__rank strong {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(30px, 4vw, 44px); line-height: 1;
  color: var(--cyan); font-variant-numeric: tabular-nums;
}

/* ---------- stat tiles ---------- */

.stat-row {
  display: grid; gap: 12px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
}
.stat {
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(160deg, #14161a, #0c0d10);
  padding: 20px clamp(18px, 2vw, 24px);
  display: flex; flex-direction: column; gap: 8px;
}
.stat__n {
  font-family: var(--display); font-weight: 900; line-height: 1;
  font-size: clamp(34px, 4.6vw, 50px); color: #fff;
  font-variant-numeric: tabular-nums;
}
.stat--accent .stat__n { color: var(--orange); }
.stat__sub { font-size: 13px; color: var(--text-faint); line-height: 1.4; }

/* ---------- layout ---------- */

.acct-grid { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 900px) {
  .acct-grid--split { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ---------- fields ---------- */

.field { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.field__input {
  flex: 1 1 220px; min-width: 0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff; padding: 14px 16px;
  font-family: var(--mono); font-size: 13px; outline: none;
}
.field__input::placeholder { color: var(--text-faint); }
.field__input:focus { border-color: var(--cyan); }
.field__input:disabled { opacity: .55; cursor: default; }

.field__btn {
  flex: 0 0 auto;
  font-family: var(--display); font-weight: 900; font-size: 15px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--bg); background: var(--orange); border: 0;
  padding: 14px 26px; cursor: pointer; transition: background .2s;
}
.field__btn:hover:not(:disabled) { background: var(--orange-pale); }
.field__btn:disabled { opacity: .55; cursor: default; }
.field__btn--ghost {
  background: none; color: var(--text);
  border: 1px solid rgba(255,255,255,.3);
}
.field__btn--ghost:hover:not(:disabled) {
  background: none; border-color: var(--cyan); color: var(--cyan);
}

.field__msg {
  width: 100%; min-height: 18px; margin: 10px 0 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--cyan);
}
.field__msg[data-state="error"] { color: var(--red); }

.field__hint {
  margin: 12px 0 0; font-size: 12px; line-height: 1.55;
  color: var(--text-faint); max-width: 56ch;
}

.locked {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
  overflow-wrap: anywhere;
}
.locked svg { flex: 0 0 auto; color: var(--cyan); }

/* ---------- campaign ---------- */

.campaign { display: grid; gap: clamp(18px, 2.4vw, 26px); }
@media (min-width: 760px) { .campaign { grid-template-columns: 300px 1fr; align-items: start; } }

.campaign__art {
  display: block; width: 100%; height: auto;
  border: 1px solid rgba(255,255,255,.14);
}
.campaign__body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }


.campaign__copy {
  margin: 0; padding: 16px 18px;
  border-left: 2px solid var(--orange);
  background: rgba(255,255,255,.04);
  font-size: 14px; line-height: 1.65; color: var(--text-dim);
  white-space: pre-line;
}

.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: step; }
.steps li {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px;
  align-items: baseline; font-size: 14px; color: var(--text-dim); line-height: 1.5;
}
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: 11px; color: var(--orange);
  letter-spacing: .08em;
}

/* ---------- submissions ---------- */

.subs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.subs li {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.025);
  padding: 13px 16px;
}
.subs__link {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  overflow-wrap: anywhere; min-width: 0;
}
.subs__link:hover { color: var(--orange-lt); }
.subs__date {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-faint); margin-left: auto;
}

.chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; padding: 4px 9px;
  border: 1px solid currentColor; white-space: nowrap; flex: 0 0 auto;
}
.chip--pending  { color: var(--orange-lt); }
.chip--verified { color: var(--cyan); }
.chip--rejected { color: var(--red); }

.empty {
  margin: 0; padding: 22px 0; text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint);
}

/* ---------- referral link ---------- */

.ref-link {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px dashed rgba(255,106,31,.5);
  background: rgba(255,106,31,.06);
  padding: 15px 18px;
}
.ref-link code {
  font-family: var(--mono); font-size: 13px; color: var(--orange-pale);
  overflow-wrap: anywhere; min-width: 0;
}

/* ---------- signed-out gate ---------- */

.gate { max-width: 560px; margin: 0 auto; text-align: center; }
.gate h1 {
  margin: 0 0 16px; font-family: var(--display); font-weight: 900;
  font-size: clamp(34px, 6vw, 58px); line-height: .95;
  text-transform: uppercase; color: #fff;
}
.gate p { margin: 0 auto 28px; color: var(--text-dim); font-size: 16px; line-height: 1.6; max-width: 46ch; }

.gate__bonus {
  display: inline-block; margin: 0 auto 28px; padding: 11px 20px;
  border: 1px solid rgba(46,230,214,.45); background: rgba(46,230,214,.07);
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--cyan);
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.gate__bonus strong { color: #fff; font-weight: 700; }

.btn--x {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-weight: 900;
  font-size: 18px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--bg); background: #fff; border: 0;
  padding: 16px 32px; cursor: pointer; transition: background .2s;
}
.btn--x:hover { background: var(--orange-pale); color: var(--bg); }
.btn--x svg { flex: 0 0 auto; }

/* ---------- leaderboard: personnel roster sheet ---------- */
/* Paper palette matches the Form ORD-04 / ORD-10 dossiers in styles.css:
   aged stock #d9cdb0, ink #241d12, red #8c2f1d, Courier Prime throughout. */

.roster-sheet { margin-top: 4px; }

/* The shared .dossier__head pushes its meta block right with margin-left:auto.
   Once it wraps that leaves a stranded gap, so below 640px it just stacks. */
@media (max-width: 640px) {
  .roster-sheet .dossier__head { gap: 6px; padding-bottom: 12px; }
  .roster-sheet .dossier__meta { margin-left: 0; text-align: left; line-height: 1.5; }
  .roster-sheet .dossier__schedule { margin-bottom: 14px; }
}

.roster-wrap { overflow-x: auto; margin-top: 4px; }

.roster {
  width: 100%; min-width: 34rem;
  border-collapse: collapse;
  font-family: 'Courier Prime', var(--mono);
}

.roster th {
  text-align: left;
  padding: 0 clamp(8px, 1.4vw, 16px) 9px;
  font-family: 'Courier Prime', var(--mono);
  font-weight: 700; font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: #6b5737;
  border-bottom: 2px solid rgba(40,32,20,.7);
  white-space: nowrap;
}
.roster th.roster__num { text-align: right; width: 1%; }

.roster td {
  padding: 13px clamp(8px, 1.4vw, 16px);
  border-bottom: 1px dotted rgba(66,53,32,.5);
  vertical-align: middle;
  color: #3d3120;
}
.roster tbody tr:last-child td { border-bottom: 1px dotted rgba(66,53,32,.5); }

/* the operator reading their own row */
.roster tr[data-me="true"] td { background: rgba(140,47,29,.09); }

.lb__rank {
  width: 1%;
  font-family: var(--display); font-weight: 900; font-size: 20px;
  color: #6b5737; font-variant-numeric: tabular-nums; text-align: center;
}
.roster tbody tr:nth-child(1) .lb__rank,
.roster tbody tr:nth-child(2) .lb__rank,
.roster tbody tr:nth-child(3) .lb__rank { color: #8c2f1d; }

.lb__op { display: flex; align-items: center; gap: 13px; min-width: 0; }
.lb__op img {
  width: 38px; height: 38px; flex: 0 0 auto; display: block;
  object-fit: cover;
  border: 1px solid rgba(66,53,32,.55);
  padding: 2px; background: rgba(255,250,235,.5);
  filter: saturate(.72) contrast(1.04);
}
.lb__names { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lb__callsign {
  font-family: var(--display); font-weight: 900; font-size: 17px;
  letter-spacing: .03em; text-transform: uppercase; color: #241d12;
  line-height: 1.1; overflow-wrap: anywhere;
}
.lb__handle {
  font-family: 'Courier Prime', var(--mono); font-size: 11.5px;
  color: #6b5737; letter-spacing: .04em;
}

.lb__n {
  font-family: 'Courier Prime', var(--mono); font-weight: 700;
  font-size: 15px; color: #3d3120;
  font-variant-numeric: tabular-nums; text-align: right;
}
.lb__n--total { color: #8c2f1d; }

/* Below 640px the five columns cannot fit, and a horizontally scrolled
   table reads as a broken one. Each entry becomes a stacked record instead. */
@media (max-width: 640px) {
  .roster-wrap { overflow-x: visible; }
  .roster { min-width: 0; }
  .roster thead { display: none; }
  .roster tbody, .roster tr, .roster td { display: block; }

  .roster tr {
    position: relative;
    padding: 14px 0 15px 34px;
    border-bottom: 1px dotted rgba(66,53,32,.5);
  }
  .roster tr[data-me="true"] { background: rgba(140,47,29,.09); }
  .roster td { border-bottom: 0; padding: 0; }

  .lb__rank { position: absolute; left: 0; top: 17px; width: auto; text-align: left; }

  /* .roster td above is (0,1,1) and would win over a bare .lb__n (0,1,0) —
     scope it to .roster so these three sit in a row, not stacked. */
  .roster .lb__n {
    display: inline-block; text-align: left;
    margin: 9px 20px 0 0; font-size: 14px;
  }
  .roster .lb__n:last-child { margin-right: 0; }
  .roster .lb__n::before {
    content: attr(data-label);
    display: block; margin-bottom: 1px;
    font-weight: 400; font-size: 9.5px; letter-spacing: .16em;
    text-transform: uppercase; color: #6b5737;
  }
}

.roster__empty {
  margin: 0; padding: 26px 0; text-align: center;
  font-family: 'Courier Prime', var(--mono); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: #6b5737;
}

/* ---------- nav account chip ---------- */

.nav__me {
  display: none; align-items: center; gap: 9px; flex: 0 0 auto;
  font-family: var(--display); font-weight: 800; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim);
}
.nav__me[data-on="true"] { display: inline-flex; }
.nav__me img {
  width: 26px; height: 26px; display: block; object-fit: cover;
  border: 1px solid rgba(255,255,255,.2);
}
.nav__me:hover { color: #fff; }

/* ---------- page intro ---------- */

.acct-intro { margin-bottom: 26px; }
.acct-intro h1 {
  margin: 0 0 10px; font-family: var(--display); font-weight: 900;
  font-size: clamp(32px, 5.4vw, 60px); line-height: .95;
  text-transform: uppercase; color: #fff;
}
.acct-intro p { margin: 0; color: var(--text-mute); font-size: 15px; line-height: 1.6; max-width: 58ch; }

.is-hidden { display: none !important; }
