:root {
  --bg: #0d0d0d;
  --panel: #171717;
  --panel-2: #201b12;
  --text: #f5f5f5;
  --muted: #b0b0b0;
  --gold: #d4af37;
  --gold-2: #f2c94c;
  --green: #37d67a;
  --blue: #74a7ff;
  --amber: #ffbf47;
  --red: #ff6b6b;
  --border: rgba(212,175,55,.26);
  --shadow: rgba(0,0,0,.42);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(212,175,55,.18), transparent 34rem),
    linear-gradient(180deg, #111111, var(--bg));
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0 18px;
}

.site-logo {
  width: 112px;
  max-width: 34vw;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.55));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 900;
  font-size: .8rem;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.55rem, 7vw, 2.85rem); line-height: .98; margin-bottom: 8px; }
h2 { color: var(--gold-2); font-size: 1.08rem; margin-bottom: 14px; }
.hero-copy p:not(.eyebrow) { color: var(--muted); margin-bottom: 9px; }

.version-pill {
  display: inline-block;
  color: #1a1200;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 900;
  font-size: .75rem;
}


/* v2.3.4 UI Patch - restored polished navigation pills */
.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid rgba(212, 175, 55, .28);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(12,12,12,.96), rgba(8,8,8,.94));
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(242,201,76,.50);
  background: rgba(242,201,76,.10);
  color: var(--gold-2);
  outline: none;
}

.site-nav a.active,
.site-nav a[aria-current="page"] {
  color: #211600;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-color: rgba(242,201,76,.82);
  box-shadow: 0 8px 20px rgba(212,175,55,.18), inset 0 1px 0 rgba(255,255,255,.22);
}

@media (max-width: 520px) {
  .site-nav {
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 12px;
    font-size: .88rem;
    white-space: nowrap;
  }
}

.card {
  background: linear-gradient(180deg, rgba(30,30,30,.98), rgba(16,16,16,.98));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 16px 34px var(--shadow);
}

.hero-card {
  border-color: rgba(242,201,76,.55);
  background:
    radial-gradient(circle at 88% 0%, rgba(242,201,76,.12), transparent 22rem),
    linear-gradient(145deg, #241d10, #111111 72%);
}

.card-kicker {
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 1000;
  margin-bottom: 12px;
}

.quality-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.stars {
  color: var(--gold-2);
  font-size: 1.45rem;
  letter-spacing: .05em;
}

.quality-label {
  color: var(--text);
  font-weight: 900;
  text-transform: uppercase;
}

.grade-badge {
  display: grid;
  place-items: center;
  min-width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(242,201,76,.65);
  color: #1a1200;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  font-size: 1.35rem;
  font-weight: 1000;
}

.hero-stats, .grid { display: grid; gap: 12px; }
.hero-stats { grid-template-columns: repeat(2, 1fr); margin: 12px 0; }
.hero-stats div, .stat-box {
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  padding: 13px;
}
.hero-stats span { display: block; color: var(--muted); font-size: .78rem; }
.hero-stats strong { display: block; color: var(--gold-2); font-size: 1.35rem; margin-top: 4px; }

.note { color: var(--muted); line-height: 1.45; }

.grid.two, .grid.three { grid-template-columns: 1fr; }
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .92rem;
}

input, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: #080808;
  color: var(--text);
  padding: 14px 12px;
  font-size: 1rem;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(242,201,76,.14);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  color: var(--text);
}
.check-row input { width: 21px; height: 21px; accent-color: var(--gold); }
.leader-settings { margin-top: 14px; }

.go-button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #1a1200;
  font-weight: 1000;
  font-size: 1.05rem;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(212,175,55,.24);
}
.go-button:active { transform: translateY(1px); }
.secondary-button {
  width: 100%;
  border: 1px solid rgba(242,201,76,.45);
  border-radius: 16px;
  padding: 13px;
  margin-top: 16px;
  background: rgba(0,0,0,.28);
  color: var(--gold-2);
  font-weight: 900;
  cursor: pointer;
}
.secondary-button:active { transform: translateY(1px); }
.hidden { display: none; }
.details.highlight .card:first-child { animation: pulse 850ms ease; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(242,201,76,.5); }
  100% { box-shadow: 0 0 0 18px rgba(242,201,76,0); }
}

.breakdown-list, .report-list { display: grid; gap: 10px; }
.breakdown-list div, .report-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.08);
}
.breakdown-list span { color: var(--muted); }
.breakdown-list strong { color: var(--text); text-align: right; }
.report-list div { justify-content: flex-start; line-height: 1.35; color: var(--text); }
.report-list .good { border-color: rgba(55,214,122,.26); }
.report-list .warn { border-color: rgba(255,191,71,.35); }
.report-list .bad { border-color: rgba(255,107,107,.35); }
.coach-text { color: var(--text); font-size: 1.05rem; line-height: 1.45; margin-bottom: 0; }
.alt-card { border-color: rgba(116,167,255,.25); }
.report-card { border-color: rgba(55,214,122,.22); }
.coach-card { border-color: rgba(242,201,76,.34); }
.insights-card { border-color: rgba(116,167,255,.24); }

.site-footer {
  margin-top: 28px;
  padding: 20px 8px 28px;
  text-align: center;
  border-top: 1px solid rgba(212,175,55,.22);
  color: var(--muted);
  font-size: .86rem;
}
.site-footer p { margin: 4px 0; }

@media (max-width: 620px) {
  .hero-header { flex-direction: column; text-align: center; }
  .site-logo { width: 132px; }
}

@media (min-width: 760px) {
  .app-shell { padding: 28px; }
  .site-logo { width: 150px; }
  .grid.two { grid-template-columns: repeat(2, 1fr); }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .details.hidden { display: none; }
  .details .card { margin-bottom: 0; }
  .details .card:nth-last-child(-n+2) { grid-column: 1 / -1; }
}

/* v2.1.1 UI Dev - Hero Recommendation Card polish */
.hero-card-v2 {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 4vw, 28px);
  border-color: rgba(242, 201, 76, .72);
  background:
    radial-gradient(circle at 90% -8%, rgba(242, 201, 76, .22), transparent 23rem),
    radial-gradient(circle at 5% 110%, rgba(116, 167, 255, .10), transparent 24rem),
    linear-gradient(145deg, #2a210f, #121212 68%);
  box-shadow:
    0 20px 46px rgba(0,0,0,.52),
    0 0 32px rgba(212,175,55,.14);
}

.hero-card-v2::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(242,201,76,.10), transparent);
  opacity: .42;
}

.hero-topline,
.quality-hero,
.hero-stats-v2,
.hero-note,
.hero-card-v2 .go-button {
  position: relative;
  z-index: 1;
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.hero-subtitle {
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.35;
  font-size: .92rem;
}

.engine-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(242,201,76,.45);
  color: var(--gold-2);
  background: rgba(0,0,0,.28);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 900;
  font-size: .72rem;
  white-space: nowrap;
}

.quality-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  background: rgba(0,0,0,.26);
  margin-bottom: 16px;
}

.grade-badge-large {
  width: 76px;
  height: 76px;
  min-width: 76px;
  border-radius: 22px;
  font-size: 1.7rem;
  box-shadow: 0 12px 24px rgba(212,175,55,.20);
}

.quality-copy {
  min-width: 0;
}

.stars-large {
  font-size: clamp(1.35rem, 7vw, 2rem);
  line-height: 1;
}

.quality-label-large {
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  margin-top: 5px;
}

.quality-caption {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.hero-stats-v2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-stats-v2 div {
  min-height: 82px;
}

.hero-stats-v2 .primary-stat {
  border-color: rgba(242,201,76,.24);
  background: linear-gradient(180deg, rgba(242,201,76,.10), rgba(0,0,0,.30));
}

.hero-stats-v2 .primary-stat strong {
  font-size: clamp(1.55rem, 8vw, 2.2rem);
}

.hero-note {
  border-left: 3px solid rgba(242,201,76,.72);
  padding: 10px 12px;
  background: rgba(0,0,0,.22);
  border-radius: 12px;
}

@media (max-width: 560px) {
  .hero-topline {
    display: grid;
  }
  .engine-chip {
    width: fit-content;
  }
  .quality-hero {
    align-items: flex-start;
  }
}

@media (min-width: 820px) {
  .hero-card-v2 {
    padding: 30px;
  }
  .hero-stats-v2 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* v2.1.2 UI Dev - Report, Coach, and Composition polish */
.report-card h2, .coach-card h2, .insights-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-list div {
  align-items: flex-start;
  font-weight: 650;
}

.report-list .good {
  background: linear-gradient(90deg, rgba(55,214,122,.12), rgba(0,0,0,.24));
}

.report-list .warn {
  background: linear-gradient(90deg, rgba(255,191,71,.12), rgba(0,0,0,.24));
}

.report-list .bad {
  background: linear-gradient(90deg, rgba(255,107,107,.14), rgba(0,0,0,.24));
}

.coach-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(242,201,76,.14), transparent 18rem),
    linear-gradient(180deg, rgba(32,27,18,.98), rgba(15,15,15,.98));
}

.coach-text {
  border-left: 3px solid rgba(242,201,76,.85);
  padding: 12px 14px;
  background: rgba(0,0,0,.24);
  border-radius: 14px;
}

.insights-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(116,167,255,.12), transparent 18rem),
    linear-gradient(180deg, rgba(17,22,32,.98), rgba(15,15,15,.98));
}

.breakdown-list strong {
  color: var(--gold-2);
}

.quality-label-large {
  color: var(--gold-2);
  text-shadow: 0 0 16px rgba(242,201,76,.18);
}


/* v2.1.3 UI Dev - Premium color hierarchy + LET'S GOOOO micro-interaction */
.hero-card-v2 {
  border-color: rgba(212,175,55,.55);
  background:
    radial-gradient(circle at 88% -8%, rgba(212,175,55,.15), transparent 23rem),
    radial-gradient(circle at 5% 110%, rgba(116,167,255,.08), transparent 24rem),
    linear-gradient(145deg, #211a0e, #111111 70%);
  box-shadow:
    0 20px 46px rgba(0,0,0,.50),
    0 0 24px rgba(212,175,55,.10);
}

.hero-card-v2::before {
  opacity: .22;
}

.card-kicker,
.engine-chip,
.eyebrow,
h2 {
  color: var(--gold);
}

.hero-subtitle,
.quality-caption,
.hero-stats span,
.breakdown-list span,
.note {
  color: #b9b9b9;
}

.hero-stats strong,
.breakdown-list strong {
  color: var(--text);
}

.hero-stats-v2 .primary-stat {
  border-color: rgba(212,175,55,.18);
  background: rgba(0,0,0,.28);
}

.quality-label-large {
  color: var(--text);
  text-shadow: none;
}

.grade-badge-large,
.grade-badge {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #171000;
}

.report-card {
  border-color: rgba(116,167,255,.28);
}
.report-card h2 {
  color: var(--blue);
}

.coach-card {
  border-color: rgba(55,214,122,.25);
  background:
    radial-gradient(circle at 100% 0%, rgba(55,214,122,.10), transparent 18rem),
    linear-gradient(180deg, rgba(20,30,24,.98), rgba(15,15,15,.98));
}
.coach-card h2 {
  color: var(--green);
}
.coach-text {
  border-left-color: rgba(55,214,122,.85);
}

.insights-card {
  border-color: rgba(172,129,255,.28);
  background:
    radial-gradient(circle at 100% 0%, rgba(172,129,255,.10), transparent 18rem),
    linear-gradient(180deg, rgba(22,18,32,.98), rgba(15,15,15,.98));
}
.insights-card h2 {
  color: #b99cff;
}

.go-button {
  transition: transform .18s ease, filter .18s ease, background .22s ease, box-shadow .22s ease, color .22s ease;
}

.go-button.is-working {
  background: linear-gradient(135deg, #8fc0ff, var(--blue));
  color: #061326;
  box-shadow: 0 14px 28px rgba(116,167,255,.22);
}

.go-button.is-complete {
  background: linear-gradient(135deg, #6df0a2, var(--green));
  color: #04170b;
  box-shadow: 0 14px 28px rgba(55,214,122,.22);
}

.go-button.is-working,
.go-button.is-complete {
  transform: translateY(-1px);
}

/* v2.1.4 UI Dev - Visual Identity Pass */
:root {
  --archer: #37d67a;
  --cavalry: #74a7ff;
  --infantry: #ff6b6b;
  --purple: #b99cff;
}

/* Gold is now reserved for APX branding, frames, and recommendation emphasis. */
.hero-card-v2 {
  border-color: rgba(212,175,55,.52);
  background:
    radial-gradient(circle at 88% -8%, rgba(212,175,55,.12), transparent 23rem),
    radial-gradient(circle at 5% 110%, rgba(116,167,255,.06), transparent 24rem),
    linear-gradient(145deg, #1c160b, #101010 72%);
}

.hero-stats strong {
  color: var(--text);
  letter-spacing: -.02em;
}

.hero-stats span,
.quality-caption,
.hero-subtitle {
  color: #aaa;
}

.card-kicker {
  color: var(--gold-2);
}

/* Formation cards */
.formation-card h2 {
  color: var(--text);
}

.formation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.troop-card {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 118px;
  padding: 14px 8px;
  background: rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  text-align: center;
}

.troop-card .troop-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.troop-card strong {
  color: var(--text);
  font-size: clamp(1.15rem, 5.5vw, 1.75rem);
  line-height: 1;
  letter-spacing: -.03em;
}

.troop-card span:last-child {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.troop-archer {
  border-color: rgba(55,214,122,.28);
  background: linear-gradient(180deg, rgba(55,214,122,.08), rgba(0,0,0,.30));
}
.troop-archer .troop-icon,
.troop-archer strong { color: var(--archer); }

.troop-cavalry {
  border-color: rgba(116,167,255,.30);
  background: linear-gradient(180deg, rgba(116,167,255,.08), rgba(0,0,0,.30));
}
.troop-cavalry .troop-icon,
.troop-cavalry strong { color: var(--cavalry); }

.troop-infantry {
  border-color: rgba(255,107,107,.28);
  background: linear-gradient(180deg, rgba(255,107,107,.08), rgba(0,0,0,.30));
}
.troop-infantry .troop-icon,
.troop-infantry strong { color: var(--infantry); }

.compact-breakdown {
  margin-top: 6px;
}

.compact-breakdown div {
  padding: 10px 12px;
}

/* Section color identities */
.report-card h2 { color: var(--blue); }
.coach-card h2 { color: var(--green); }
.insights-card h2 { color: var(--purple); }

.report-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(116,167,255,.08), transparent 18rem),
    linear-gradient(180deg, rgba(17,22,32,.98), rgba(15,15,15,.98));
}

.report-list .good {
  border-color: rgba(55,214,122,.22);
  background: rgba(0,0,0,.24);
}
.report-list .warn {
  border-color: rgba(255,191,71,.30);
  background: rgba(0,0,0,.24);
}
.report-list .bad {
  border-color: rgba(255,107,107,.34);
  background: rgba(0,0,0,.24);
}

.site-footer strong {
  color: var(--gold-2);
  font-weight: 900;
}

@media (max-width: 430px) {
  .formation-grid {
    grid-template-columns: 1fr;
  }
  .troop-card {
    min-height: 92px;
    grid-template-columns: auto 1fr auto;
    justify-items: start;
    text-align: left;
    padding: 12px 14px;
  }
  .troop-card span:last-child {
    justify-self: end;
  }
}


/* v2.1.7 UX Polish Pass - number readability, status badges, shadows, and spacing */
.card { box-shadow: 0 14px 30px rgba(0,0,0,.34); }
.card:hover { border-color: rgba(255,255,255,.14); }
.hero-card-v2 { box-shadow: 0 20px 44px rgba(0,0,0,.48), 0 0 22px rgba(212,175,55,.09); }
input, select { font-variant-numeric: tabular-nums; }
.hero-stats strong, .troop-card strong, .breakdown-list strong { font-variant-numeric: tabular-nums; }
.status-ready, .status-caution, .status-danger, .status-neutral { display: inline-flex; justify-content: center; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: .78rem; line-height: 1.2; text-align: center; font-weight: 1000; }
.status-ready { color: #04170b !important; background: linear-gradient(135deg, #6df0a2, var(--green)); }
.status-caution { color: #1f1400 !important; background: linear-gradient(135deg, #ffd175, var(--amber)); }
.status-danger { color: #210303 !important; background: linear-gradient(135deg, #ff9a9a, var(--red)); }
.status-neutral { color: var(--text) !important; background: rgba(255,255,255,.12); }
.grade-badge-large { transform: translateZ(0); }
.report-list div, .breakdown-list div { transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.report-list div:hover, .breakdown-list div:hover { transform: translateY(-1px); }

/* v2.1.5 Mobile UX Pass - spacing, tap targets, and phone readability */
html { scroll-behavior: smooth; }

input, select, button {
  min-height: 48px;
}

.go-button,
.secondary-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.section-title-tight {
  margin-bottom: 10px;
}

@media (max-width: 700px) {
  .app-shell {
    padding: 14px 12px 22px;
  }

  .card {
    border-radius: 18px;
    padding: 15px;
    margin-bottom: 13px;
  }

  .hero-header {
    padding-bottom: 12px;
    gap: 10px;
  }

  .site-logo {
    width: 118px;
  }

  h1 {
    font-size: clamp(1.55rem, 8vw, 2.15rem);
    margin-bottom: 6px;
  }

  h2 {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .eyebrow {
    font-size: .72rem;
    letter-spacing: .13em;
  }

  .version-pill {
    font-size: .68rem;
    padding: 4px 9px;
  }

  .hero-card-v2 {
    padding: 16px;
  }

  .hero-topline {
    margin-bottom: 12px;
  }

  .card-kicker {
    font-size: .78rem;
    margin-bottom: 8px;
  }

  .hero-subtitle {
    font-size: .84rem;
  }

  .quality-hero {
    padding: 12px;
    border-radius: 18px;
    gap: 12px;
    margin-bottom: 12px;
  }

  .grade-badge-large {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 18px;
    font-size: 1.35rem;
  }

  .stars-large {
    font-size: 1.32rem;
  }

  .quality-label-large {
    font-size: 1.02rem;
  }

  .quality-caption {
    font-size: .68rem;
  }

  .hero-stats-v2 {
    gap: 9px;
  }

  .hero-stats-v2 div,
  .hero-stats div,
  .stat-box {
    padding: 11px;
    border-radius: 14px;
  }

  .hero-stats-v2 div {
    min-height: 72px;
  }

  .hero-stats span {
    font-size: .70rem;
  }

  .hero-stats strong {
    font-size: 1.22rem;
  }

  .hero-stats-v2 .primary-stat strong {
    font-size: 1.55rem;
  }

  label {
    font-size: .86rem;
    gap: 6px;
  }

  input, select {
    font-size: 16px; /* prevents iOS zoom */
    padding: 13px 12px;
    border-radius: 13px;
  }

  .check-row {
    align-items: flex-start;
    line-height: 1.3;
  }

  .go-button {
    padding: 14px;
    border-radius: 15px;
    font-size: 1rem;
  }

  .secondary-button {
    padding: 12px;
    border-radius: 15px;
    margin-top: 12px;
  }

  .breakdown-list,
  .report-list {
    gap: 8px;
  }

  .breakdown-list div,
  .report-list div {
    padding: 10px;
    border-radius: 13px;
  }

  .coach-text {
    font-size: .96rem;
    padding: 11px 12px;
  }

  .site-footer {
    margin-top: 20px;
    padding-bottom: 22px;
    font-size: .78rem;
  }
}

@media (max-width: 520px) {
  .hero-stats-v2,
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formation-grid {
    grid-template-columns: 1fr;
  }

  .troop-card {
    min-height: 84px;
    grid-template-columns: auto 1fr auto;
    justify-items: start;
    text-align: left;
    padding: 12px 14px;
  }

  .troop-card .troop-icon {
    font-size: 1.45rem;
  }

  .troop-card strong {
    font-size: 1.35rem;
  }

  .troop-card span:last-child {
    justify-self: end;
    font-size: .72rem;
  }
}

@media (max-width: 360px) {
  .hero-stats-v2,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .quality-hero {
    display: grid;
    justify-items: start;
  }
}

/* v2.1.8 QoL Dev - Copy Recommendation, badges, and release candidate polish */
.copy-button {
  width: 100%;
  border: 1px solid rgba(116,167,255,.35);
  border-radius: 16px;
  padding: 13px;
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(116,167,255,.18), rgba(0,0,0,.28));
  color: var(--text);
  font-weight: 950;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.copy-button:hover { border-color: rgba(116,167,255,.62); }
.copy-button:active { transform: translateY(1px); }
.copy-button.is-complete {
  background: linear-gradient(135deg, #6df0a2, var(--green));
  color: #04170b;
  border-color: transparent;
}
.copy-status {
  min-height: 1.1rem;
  margin: 8px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: .82rem;
}
.grade-badge,
.grade-badge-large {
  border-radius: 999px;
  min-width: 74px;
  width: auto;
  padding: 0 16px;
  height: 46px;
  font-size: 1.15rem;
}
.grade-badge-large {
  height: 58px;
  min-width: 96px;
  font-size: 1.45rem;
}
.status-ready::before { content: "✅ "; }
.status-caution::before { content: "⚠️ "; }
.status-danger::before { content: "⛔ "; }
#developerModePanel {
  border-color: rgba(116,167,255,.36);
}
#developerModePanel h2 {
  color: var(--blue);
}
@media (max-width: 700px) {
  .copy-button { padding: 12px; border-radius: 15px; }
  .grade-badge-large { height: 52px; min-width: 86px; font-size: 1.25rem; }
}

/* v2.3.2 Rally Leader percentage display */
.troop-card .troop-percent {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .04em;
}
.troop-archer .troop-percent { color: rgba(72, 211, 138, .9); }
.troop-cavalry .troop-percent { color: rgba(93, 169, 255, .9); }
.troop-infantry .troop-percent { color: rgba(255, 95, 117, .9); }
@media (max-width: 520px) {
  .troop-card .troop-percent {
    justify-self: center;
    font-size: .72rem;
  }
}


/* v2.3.5 UI patch: Rally Leader priority switch */
.leader-priority-panel { width: 100%; align-self: end; }
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  cursor: pointer;
  color: var(--text);
  box-sizing: border-box;
}
.switch-row:hover { border-color: rgba(242,201,76,.32); background: rgba(0,0,0,.30); }
.switch-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.switch-box {
  width: 48px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  position: relative;
  flex: 0 0 auto;
  margin-top: 2px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.switch-box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .18s ease, background .18s ease;
}
.switch-row input:checked + .switch-box {
  border-color: rgba(242,201,76,.75);
  background: rgba(212,175,55,.38);
  box-shadow: 0 0 0 3px rgba(242,201,76,.10);
}
.switch-row input:checked + .switch-box::after {
  transform: translateX(22px);
  background: var(--gold-2);
}
.switch-row:focus-within {
  border-color: rgba(242,201,76,.60);
  box-shadow: 0 0 0 3px rgba(242,201,76,.10);
}
.switch-copy { display: flex; flex-direction: column; gap: 4px; line-height: 1.35; }
.switch-copy strong { color: var(--text); font-weight: 900; }
.switch-copy span { color: var(--muted); font-size: .88rem; }
@media (max-width: 760px) {
  .leader-priority-panel { align-self: stretch; }
  .switch-row { margin-top: 2px; }
}
