/* =========================================================
   narigule-duel.css
   Scoped styles for duel.php ("Scout Duel" VS experience) only.
   All selectors are prefixed .ngd- so nothing here can leak into
   or be affected by any other page's styles.
   ========================================================= */

:root {
  --ngd-bg-1: #100b1c;
  --ngd-bg-2: #1a1330;
  --ngd-gold: #f4c94b;
  --ngd-gold-dim: #a9924f;
  --ngd-green: #2ecc5f;
  --ngd-green-dim: #1f8f43;
  --ngd-ink: #f5f1ff;
  --ngd-ink-dim: rgba(245, 241, 255, 0.55);
  --ngd-line: rgba(255, 255, 255, 0.1);
}

.ngd-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(244, 201, 75, 0.14) 0%, transparent 55%),
    linear-gradient(180deg, var(--ngd-bg-2) 0%, var(--ngd-bg-1) 45%);
  font-family: var(--font, 'Vazirmatn', sans-serif);
  color: var(--ngd-ink);
}

.ngd-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px 40px;
  box-sizing: border-box;
}

.ngd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ngd-ink-dim);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.ngd-back:hover { color: var(--ngd-ink); }

/* ── Picker / fallback states ─────────────────────────────── */
.ngd-picker {
  text-align: center;
  padding: 40px 8px;
}
.ngd-picker__title {
  font-size: 1.15rem;
  margin: 10px 0 14px;
}
.ngd-picker__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}
.ngd-picker__form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  font-size: 0.82rem;
  color: var(--ngd-ink-dim);
}
.ngd-picker__form input {
  direction: ltr;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ngd-line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ngd-ink);
  font-size: 0.95rem;
}
.ngd-picker__error {
  margin-top: 14px;
  color: #ff8a8a;
  font-size: 0.85rem;
}

/* ── 1. Header: SCOUT DUEL + VS line ──────────────────────── */
.ngd-eyebrow {
  text-align: center;
  color: var(--ngd-green);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  margin: 4px 0 14px;
}
.ngd-vsline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.ngd-vsline__name {
  color: var(--ngd-gold);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  max-width: 40%;
  overflow-wrap: anywhere;
  text-align: center;
}
.ngd-vs {
  color: var(--ngd-green);
  font-weight: 900;
  font-style: italic;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  transform: skewX(-8deg);
}

/* ── 2. Cards row ──────────────────────────────────────────── */
.ngd-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 4px;
}
.ngd-cards__col {
  flex: 1 1 160px;
  /* Matches the reused .ngc-card--mini's real non-shrinkable content floor
     (52px avatar + gap + OVR pill min-width + card/panel padding ≈ 144px,
     plus a small buffer). Below this width the card's own internal content
     overflows its box and visually bleeds into the neighbouring card — that
     was the actual cause of the overlap, not insufficient gap. Below this
     floor the row wraps (flex-wrap above) instead of forcing an
     overlapping squeeze. */
  min-width: 152px;
  display: flex;
  justify-content: center;
}

/* ── 3. Radar + handle + archetype ────────────────────────── */
.ngd-identity {
  display: flex;
  gap: 14px;
  margin: 10px 0 26px;
}
.ngd-identity__col {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}
.ngd-radar { width: 100%; max-width: 140px; height: auto; }
.ngd-radar__ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}
.ngd-radar__shape {
  fill: color-mix(in srgb, var(--ngd-radar-color, var(--ngd-gold)) 28%, transparent);
  stroke: var(--ngd-radar-color, var(--ngd-gold));
  stroke-width: 1.6;
}
.ngd-identity__handle {
  margin: 6px 0 2px;
  font-size: 0.8rem;
  color: var(--ngd-ink-dim);
  direction: ltr;
}
.ngd-identity__tags {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ngd-ink);
  font-weight: 600;
}

/* ── 4. FULL TIME score ───────────────────────────────────── */
.ngd-fulltime { text-align: center; margin-bottom: 18px; }
.ngd-label {
  color: var(--ngd-gold-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 0;
}
.ngd-score {
  color: var(--ngd-gold);
  font-size: 3rem;
  font-weight: 900;
  margin: 4px 0 0;
  line-height: 1;
}
.ngd-score__dash { color: var(--ngd-gold-dim); padding: 0 8px; }

/* ── 5. Dominance bar ─────────────────────────────────────── */
.ngd-dominance { margin-bottom: 22px; }
.ngd-dominance__labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ngd-gold-dim);
  font-weight: 700;
  margin-bottom: 6px;
}
.ngd-dominance__bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.ngd-dominance__fill { height: 100%; }
.ngd-dominance__fill--left { background: var(--ngd-gold-dim); }
.ngd-dominance__fill--right { background: var(--ngd-gold); }

/* ── 6. Six stat rows ─────────────────────────────────────── */
.ngd-stats { margin-bottom: 22px; }
.ngd-stat-row {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
}
.ngd-stat-row__val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ngd-ink-dim);
  display: flex;
  align-items: center;
  gap: 3px;
}
.ngd-stat-row__val--left { justify-content: flex-end; }
.ngd-stat-row__val--right { justify-content: flex-start; }
.ngd-stat-row__val.is-winner { color: var(--ngd-gold); }
.ngd-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ngd-gold); display: inline-block;
}
.ngd-dot.is-hidden { visibility: hidden; }
.ngd-stat-row__mid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}
.ngd-stat-row__bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  max-width: 100%;
}
.ngd-stat-row__bar--left { justify-self: end; }
.ngd-stat-row__bar--right { justify-self: start; }
.ngd-stat-row__bar.is-winner { background: var(--ngd-gold); }
.ngd-stat-row__code {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ngd-ink-dim);
  text-align: center;
}

/* ── 7. Winner statement ──────────────────────────────────── */
.ngd-winner { text-align: center; margin-bottom: 22px; }
.ngd-winner__label {
  color: var(--ngd-gold-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 0 0 6px;
}
.ngd-winner__name {
  color: var(--ngd-gold);
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ngd-line);
  display: inline-block;
}
.ngd-winner__sub {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--ngd-ink-dim);
}

/* ── 8. Receipts ───────────────────────────────────────────── */
.ngd-receipts {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ngd-line);
  border-radius: 16px;
  padding: 14px 16px 6px;
  margin-bottom: 22px;
}
.ngd-receipts__label {
  text-align: center;
  color: var(--ngd-gold-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 0 0 10px;
}
.ngd-receipts__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-top: 1px solid var(--ngd-line);
  font-size: 0.82rem;
  font-weight: 700;
}
.ngd-receipts__row:first-of-type { border-top: none; }
.ngd-receipts__mid { color: var(--ngd-ink-dim); font-weight: 500; font-size: 0.78rem; }
.ngd-receipts__empty {
  text-align: center;
  color: var(--ngd-ink-dim);
  font-size: 0.82rem;
  padding-bottom: 10px;
}

/* ── 9. Primary share CTA ─────────────────────────────────── */
.ngd-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #3fe073, var(--ngd-green));
  color: #0b2312;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(46, 204, 95, 0.55);
}
.ngd-btn-primary:hover { filter: brightness(1.05); }

/* Download — same width/shape as .ngd-btn-primary (full-width pill CTA),
   kept in the existing secondary color scheme since it's not the primary
   action. Sits as its own row directly below the share button + secondary
   row, rather than squeezed into the 3-item secondary grid above. */
.ngd-btn-download {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--ngd-line);
  border-radius: 999px;
  padding: 14px 18px;
  margin: 10px 0 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ngd-ink);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.ngd-btn-download:hover { background: rgba(255, 255, 255, 0.1); }
.ngd-btn-download:disabled { opacity: 0.7; cursor: default; }

/* ── 10. Secondary actions ────────────────────────────────── */
.ngd-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.ngd-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ngd-line);
  border-radius: 999px;
  padding: 10px 6px;
  color: var(--ngd-ink);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.ngd-btn-secondary:hover { background: rgba(255, 255, 255, 0.1); color: var(--ngd-ink); }
.ngd-btn-secondary.is-copied { color: var(--ngd-green); border-color: var(--ngd-green); }

/* ── Desktop enhancement: 3-column layout ─────────────────── */
@media (min-width: 900px) {
  .ngd-page { max-width: 1080px; }

  .ngd-duel {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    column-gap: 28px;
    align-items: start;
  }
  .ngd-head { grid-column: 1 / -1; }

  .ngd-cards { display: contents; }
  .ngd-cards__col:first-child { grid-row: 2; grid-column: 1; }
  .ngd-cards__col:last-child { grid-row: 2; grid-column: 3; }

  .ngd-identity { display: contents; }
  .ngd-identity__col:first-child { grid-row: 3; grid-column: 1; }
  .ngd-identity__col:last-child { grid-row: 3; grid-column: 3; }

  .ngd-fulltime,
  .ngd-dominance,
  .ngd-stats,
  .ngd-winner,
  .ngd-receipts,
  .ngd-share-btn,
  .ngd-secondary,
  .ngd-btn-download {
    grid-column: 2;
  }
  .ngd-fulltime { grid-row: 2; }
  .ngd-dominance { grid-row: 3; }
  .ngd-stats { grid-row: 4; }
  .ngd-winner { grid-row: 5; }
  .ngd-receipts { grid-row: 6; }
  .ngd-share-btn { grid-row: 7; }
  .ngd-secondary { grid-row: 8; }
  .ngd-btn-download { grid-row: 9; }
}