:root {
  --ink: #102018;
  --muted: #68736b;
  --paper: #f6f4ec;
  --panel: #fffef8;
  --line: #dde1d7;
  --lime: #c8f135;
  --purple: #7357ff;
  --coral: #ee715c;
  --shadow: 0 20px 55px rgba(25, 43, 31, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(200, 241, 53, .21), transparent 27rem),
    radial-gradient(circle at 94% 32%, rgba(115, 87, 255, .07), transparent 29rem),
    var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
.site-header, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header { height: 80px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(16, 32, 24, .13); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-family: "Manrope", sans-serif; font-size: 19px; font-weight: 800; letter-spacing: -.7px; }
.brand > span:last-child > span { color: #657630; }
.brand-mark { width: 32px; height: 32px; position: relative; display: grid; place-items: center; border-radius: 50%; background: var(--ink); transform: rotate(-12deg); }
.brand-mark span { position: absolute; display: block; height: 3px; border-radius: 4px; background: var(--lime); }
.brand-mark span:nth-child(1) { top: 8px; width: 15px; }
.brand-mark span:nth-child(2) { top: 14px; left: 8px; width: 11px; }
.brand-mark span:nth-child(3) { top: 20px; left: 8px; width: 7px; }
.generation-status { display: flex; align-items: center; gap: 9px; color: #647068; font-size: 12px; font-weight: 700; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #56a658; box-shadow: 0 0 0 4px rgba(86, 166, 88, .12); }
.active-count { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border: 1px solid #d7dbd2; border-radius: 999px; background: rgba(255,255,255,.48); }
.active-count strong { font-family: "Manrope", sans-serif; font-size: 16px; }
.active-count span { color: var(--muted); font-size: 10px; font-weight: 700; }

.hero { min-height: 380px; padding: 70px 0 52px; display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; }
.hero-copy { max-width: 800px; }
.eyebrow { margin: 0 0 13px; color: #687462; font-size: 10px; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase; }
h1, h2, h3 { font-family: "Manrope", sans-serif; letter-spacing: -.045em; }
h1 { margin: 0; font-size: clamp(54px, 7.3vw, 92px); font-weight: 800; line-height: .92; }
h1 em { color: #718339; font-style: normal; }
.hero-description { max-width: 760px; margin: 27px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.generation-card { flex: 0 0 280px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,254,248,.8); box-shadow: var(--shadow); }
.generation-card-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.generation-card > strong { display: block; font-family: "Manrope", sans-serif; font-size: 16px; }
.generation-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #e1e3db; color: #748076; font-size: 10px; font-weight: 700; }

.state-card { min-height: 110px; padding: 25px; display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.state-card strong { display: block; margin-bottom: 4px; }
.state-card p { margin: 0; color: var(--muted); font-size: 12px; }
.spinner { width: 27px; height: 27px; border: 3px solid #e3e7dd; border-top-color: #78912a; border-radius: 50%; animation: spin .8s linear infinite; }
.error-state > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--coral); font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }

.balance-strip { min-height: 108px; padding: 22px 28px; display: grid; grid-template-columns: auto minmax(220px, 1fr) minmax(250px, 380px); align-items: center; gap: 36px; border: 1px solid #d9ddd2; border-radius: 20px; background: rgba(255,255,255,.62); }
.balance-score { display: flex; align-items: center; }
.balance-score > span { font-family: "Manrope", sans-serif; font-size: 46px; font-weight: 800; letter-spacing: -3px; line-height: 1; }
.balance-score > small { align-self: flex-start; margin: 4px 13px 0 3px; font-size: 14px; font-weight: 800; }
.balance-score > div { padding-left: 15px; border-left: 1px solid #d8dcd3; white-space: nowrap; }
.balance-score strong { font-size: 12px; }
.balance-score p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.balance-meter { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; font-weight: 800; }
.balance-meter > span:first-child { color: var(--purple); }
.balance-meter > span:last-child { color: var(--coral); }
.balance-meter div { height: 7px; flex: 1; display: flex; overflow: hidden; border-radius: 99px; }
.balance-meter i, .balance-meter b { width: 50%; display: block; }
.balance-meter i { background: var(--purple); }
.balance-meter b { border-left: 2px solid white; background: var(--coral); }
.balance-strip > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.teams-grid { position: relative; margin: 26px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.team-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: 0 14px 40px rgba(31,45,35,.05); }
.team-heading { min-height: 94px; padding: 26px 28px 21px; display: flex; align-items: center; justify-content: space-between; }
.team-heading p { margin: 0 0 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.team-heading h2 { margin: 0; font-size: 30px; line-height: 1; }
.team-count { padding: 7px 10px; border: 1px solid #e0e2da; border-radius: 999px; color: #667169; background: #f7f7f1; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.team-accent { height: 4px; background: linear-gradient(90deg, var(--purple), #aa98ff); }
.team-b .team-accent { background: linear-gradient(90deg, var(--coral), #ffac75); }
.roster { padding: 11px 20px; }
.player-row { min-height: 75px; padding: 13px 8px; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(130px, .8fr); align-items: center; gap: 13px; border-bottom: 1px solid #ecece4; animation: player-in .35s both; animation-delay: var(--delay); }
.player-row:last-child { border-bottom: 0; }
@keyframes player-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: white; background: linear-gradient(145deg, #8971ff, #5741ce); font-family: "Manrope", sans-serif; font-size: 12px; font-weight: 800; }
.row-b .avatar { background: linear-gradient(145deg, #ff937c, #de5641); }
.player-info { min-width: 0; }
.player-info strong { display: block; margin-bottom: 3px; font-size: 13px; }
.player-info span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.role-info { min-width: 0; text-align: right; }
.role-info > strong { display: block; color: #536057; font-size: 9px; font-weight: 700; line-height: 1.35; }
.goalkeeper-pill { display: inline-block; margin-top: 5px; padding: 4px 7px; border: 1px solid #e8d993; border-radius: 999px; color: #77611a; background: #fff7d2; font-size: 7px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.team-plan { min-height: 222px; padding: 22px 28px 26px; border-top: 1px solid #e7e8e0; background: #f9f8f2; }
.team-plan p { margin: 0 0 7px; color: #7b857e; font-size: 8px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.team-plan strong, .team-plan span { display: block; color: #4e5b52; font-size: 11px; font-weight: 500; line-height: 1.55; }
.team-plan p:nth-of-type(2) { margin-top: 17px; }
.versus { position: absolute; z-index: 2; top: 44px; left: 50%; width: 40px; height: 40px; display: grid; place-items: center; border: 5px solid var(--paper); border-radius: 50%; color: white; background: var(--ink); transform: translateX(-50%) rotate(-7deg); font-family: "Manrope", sans-serif; font-size: 9px; font-weight: 800; }

.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.analysis-card, .detail-card { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,254,248,.78); }
.section-heading { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; }
.section-heading .eyebrow, .detail-card > .eyebrow { margin-bottom: 5px; }
.section-heading h3, .detail-card h3 { margin: 0; font-size: 21px; }
.section-heading > span { color: #87a131; font-size: 20px; }
.reason-list, .matchup-list { display: grid; gap: 10px; }
.reason-item, .matchup-item, .rotation-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.list-index { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #dfe2da; border-radius: 8px; color: #7a857c; background: white; font-size: 8px; font-weight: 800; }
.reason-item p, .matchup-item p, .rotation-item p { margin: 3px 0 0; color: #556158; font-size: 11px; line-height: 1.55; }

.details-grid { margin: 26px 0 70px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; align-items: start; }
.detail-card h3 { margin-bottom: 22px; }
.detail-group + .detail-group { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e3e5de; }
.detail-label { display: inline-block; margin-bottom: 8px; font-size: 8px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.detail-label.positive { color: #668116; }
.detail-label.caution { color: #c05e4d; }
.detail-group ul { margin: 0; padding: 0; list-style: none; }
.detail-group li { position: relative; margin-top: 7px; padding-left: 13px; color: #58645c; font-size: 10px; line-height: 1.5; }
.detail-group li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: #a6b285; }
.rotation-detail { color: white; border-color: #1b3024; background: #13251b; }
.rotation-detail .eyebrow { color: #91a096; }
.rotation-detail h3 { color: white; }
.rotation-detail .rotation-item { margin-top: 12px; }
.rotation-detail .list-index { color: #cbea69; border-color: #425346; background: #1e3326; }
.rotation-detail .rotation-item p { color: #b4c0b7; }
.adjustment { margin-top: 23px; padding: 14px; border: 1px solid #3b4d40; border-radius: 13px; background: #192d21; }
.adjustment span { display: block; margin-bottom: 5px; color: #86968a; font-size: 7px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.adjustment strong { color: var(--lime); font-size: 10px; }

footer { min-height: 92px; display: flex; align-items: center; gap: 18px; border-top: 1px solid #d9ddd4; color: #7b847d; font-size: 10px; }
footer > span { color: var(--ink); font-family: "Manrope", sans-serif; font-weight: 800; }
footer p { margin: 0; }
footer code { color: #5b675e; font-family: ui-monospace, monospace; }
footer a { margin-left: auto; color: #59645c; text-decoration: none; font-weight: 700; }

@media (max-width: 920px) {
  .hero { align-items: stretch; flex-direction: column; gap: 30px; }
  .generation-card { flex-basis: auto; }
  .balance-strip { grid-template-columns: auto 1fr; }
  .balance-strip > p { grid-column: 1 / -1; }
  .details-grid { grid-template-columns: 1fr 1fr; }
  .rotation-detail { grid-row: span 2; }
}

@media (max-width: 700px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .generation-status { display: none; }
  .hero { min-height: 0; padding: 48px 0 36px; }
  h1 { font-size: 49px; }
  .hero-description { font-size: 13px; }
  .balance-strip { padding: 20px; grid-template-columns: 1fr; gap: 18px; }
  .balance-strip > p { grid-column: auto; }
  .teams-grid, .analysis-grid, .details-grid { grid-template-columns: 1fr; }
  .versus { top: 50%; transform: translate(-50%, -50%) rotate(-7deg); }
  .player-row { grid-template-columns: 42px minmax(0, 1fr); }
  .role-info { grid-column: 2; margin-top: -8px; padding-bottom: 3px; text-align: left; }
  .team-plan { min-height: auto; }
  .rotation-detail { grid-row: auto; }
  footer p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
