@import url('data:text/css,');

:root {
  color-scheme: dark;
  --ink: #10231d;
  --ink-2: #173c31;
  --ink-3: #275348;
  --cream: #f7ead4;
  --cream-soft: #d8d7c8;
  --paper: #f2eee4;
  --orange: #ec5b39;
  --orange-dark: #c7472a;
  --gold: #f0bd45;
  --green: #62a67f;
  --line: rgba(247, 234, 212, 0.14);
  --shadow: 0 24px 70px rgba(2, 13, 10, 0.25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--ink); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--cream);
  background:
    radial-gradient(circle at 84% 8%, rgba(83, 145, 114, .23), transparent 30rem),
    linear-gradient(145deg, #0e241d 0%, #173a30 48%, #102a23 100%);
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: not-allowed; }

#app { min-height: 100vh; min-height: 100dvh; }
.site-shell { min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden; }
.site-shell.is-gameplay {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overscroll-behavior: none;
}
.site-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  z-index: 20;
}

.topbar {
  width: min(1440px, 100%);
  margin: 0 auto;
  min-height: 98px;
  padding: 14px clamp(18px, 4vw, 56px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 24px;
  border-bottom: 1px solid var(--line);
}

.club-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crest { width: 48px; height: 54px; flex: 0 0 auto; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .22)); }
.club-identity span, .eyebrow, .resource span, .objective-strip span, .division-flag {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  color: #8fb3a5;
}
.club-identity h1 { margin: 2px 0 0; font-size: clamp(17px, 3.8vw, 24px); line-height: 1; letter-spacing: -.04em; }

.top-actions { display: flex; gap: 7px; grid-column: 2; grid-row: 1; }
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cream);
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
  font-size: 18px;
  transition: background .2s, transform .15s;
}
.icon-button:hover { background: rgba(255, 255, 255, .09); }
.icon-button:active { transform: scale(.92); }
.reset-icon { font-size: 22px; }

.resources { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 64px; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.resource, .division-badge { min-height: 58px; background: rgba(10, 32, 25, .72); padding: 9px 13px; display: flex; flex-direction: column; justify-content: center; }
.resource strong { font-size: 19px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.resource span { font-size: 8px; margin-bottom: 2px; }
.cash-resource strong::before { content: "+"; color: var(--green); font-size: 0; }
.division-badge { padding: 5px; align-items: center; background: var(--orange); color: #fff8eb; }
.division-badge small { font-size: 7px; letter-spacing: .1em; font-weight: 900; }
.division-badge strong { font-size: 30px; line-height: .9; }

.objective-strip {
  min-height: 44px;
  padding: 10px max(18px, calc((100vw - 1328px) / 2));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--cream);
  color: var(--ink);
  text-align: center;
}
.objective-strip span { color: var(--orange-dark); white-space: nowrap; }
.objective-strip strong { font-size: 12px; }

.game-shell, .promoted-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 32px) 40px;
  display: grid;
  gap: 14px;
}

.is-gameplay .game-shell {
  height: 100%;
  min-height: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  grid-template-rows: minmax(0, 2fr) minmax(0, 3fr);
  overflow: hidden;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(28, 67, 56, .94), rgba(17, 47, 39, .94));
  box-shadow: 0 16px 35px rgba(0, 0, 0, .12);
}

.ground-panel { padding: 14px 14px 12px; min-width: 0; }
.is-gameplay .ground-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.ground-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ground-heading { padding: 2px 3px 12px; }
.ground-heading h2 { font-size: 17px; margin: 3px 0 0; letter-spacing: -.03em; }
.ground-level, .step-count, .manual-tag, .coach-live {
  color: #afc7bc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ground-wrap { position: relative; overflow: hidden; border-radius: 12px; background: #173e2c; isolation: isolate; }
.is-gameplay .ground-wrap { width: 100%; height: 100%; min-height: 0; display: grid; place-items: center; }
.ground-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 -40px 80px rgba(0, 0, 0, .12);
}
.ground-svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.is-gameplay .ground-svg { width: 100%; height: 100%; aspect-ratio: auto; }
.ground-build { animation: build-in .7s cubic-bezier(.2, .8, .2, 1) both; transform-origin: center bottom; }
.ground-cones { animation-delay: .05s; }
.ground-stall { animation-delay: .1s; }
.ground-coach { animation-delay: .15s; }
.ground-stand { animation-delay: .2s; }
.ground-lights { animation-delay: .25s; }
.ground-terrace { animation-delay: .08s; }
.ground-scout-office { animation-delay: .12s; }
.ground-training-ground { animation-delay: .16s; }
.ground-club-shop { animation-delay: .2s; }
.ground-main-stand { animation-delay: .25s; }
.supporter-dot { animation: bounce 1.25s ease-in-out infinite alternate; animation-delay: var(--delay); }
.pitch-action circle:first-child { animation: ball-roll 3s ease-in-out infinite; }

.ground-timeline { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 12px; position: relative; gap: 3px; }
.ground-timeline-upgrades { display: none; margin: 0 0 14px; }
.ground-timeline::before { content: ""; height: 1px; background: var(--line); position: absolute; top: 11px; left: 8%; right: 8%; }
.timeline-step { display: flex; flex-direction: column; align-items: center; position: relative; gap: 5px; color: #78998d; text-align: center; }
.timeline-step i { width: 22px; height: 22px; border: 1px solid #557a6d; background: var(--ink-2); border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 900; font-style: normal; z-index: 1; }
.timeline-step span { display: none; font-size: 8px; font-weight: 700; }
.timeline-step.done { color: #b8d0c5; }
.timeline-step.done i { background: var(--green); color: var(--ink); border-color: var(--green); }
.timeline-step.current i { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 189, 69, .14); color: var(--gold); }

.controls-column { display: grid; gap: 14px; min-width: 0; }
.is-gameplay .controls-column {
  height: 100%;
  min-height: 0;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-color: rgba(240, 189, 69, .42) rgba(4, 23, 17, .3);
  scrollbar-width: thin;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.is-gameplay .controls-column:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 12px; }
.is-gameplay .controls-column::-webkit-scrollbar { width: 8px; }
.is-gameplay .controls-column::-webkit-scrollbar-track { background: rgba(4, 23, 17, .3); }
.is-gameplay .controls-column::-webkit-scrollbar-thumb { border-radius: 8px; background: rgba(240, 189, 69, .42); }
.team-panel, .scouting-panel, .upgrade-panel, .promotion-panel, .division-seven-panel { padding: 17px; }
.section-heading { margin-bottom: 15px; }
.section-heading > strong { font-size: 18px; color: var(--gold); }
.coach-live { color: #83d4a5; display: flex; gap: 6px; align-items: center; }
.coach-live i { width: 7px; height: 7px; border-radius: 50%; background: #83d4a5; box-shadow: 0 0 0 0 rgba(131, 212, 165, .5); animation: pulse 1.5s infinite; }

.strength-row { display: flex; justify-content: space-between; align-items: end; }
.strength-row div { display: flex; align-items: baseline; gap: 5px; }
.strength-row strong { font-size: clamp(38px, 12vw, 56px); line-height: .9; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.strength-row span { color: #87aa9d; font-weight: 800; }
.strength-row p { margin: 0 0 4px; color: #91aca1; font-size: 9px; font-weight: 900; letter-spacing: .11em; }
.strength-bar { height: 12px; margin: 14px 0 20px; background: #0c2a21; border-radius: 2px; position: relative; overflow: visible; }
.strength-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4a9670, #8cc68c); border-radius: 2px; transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.strength-bar b { position: absolute; top: -4px; width: 2px; height: 20px; background: var(--gold); }
.strength-bar b::after { content: attr(data-target); position: absolute; top: 22px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: 7px; font-weight: 900; }

.training-detail { margin: 0 0 13px; }
.training-progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.training-progress-copy span { color: #86a79a; font-size: 8px; font-weight: 900; letter-spacing: .11em; }
.training-progress-copy strong { color: #bcd0c7; font-size: 9px; font-variant-numeric: tabular-nums; }
.training-xp-bar { height: 4px; margin-top: 6px; background: #0c2a21; overflow: hidden; }
.training-xp-bar i { display: block; height: 100%; background: var(--gold); transition: width .25s; }
.training-detail > small { display: block; margin-top: 6px; color: #78978b; font-size: 8px; }
.training-ceiling-note { margin: -3px 0 14px; padding: 9px 10px; display: flex; flex-direction: column; border-left: 3px solid var(--green); background: rgba(104, 170, 134, .08); }
.training-ceiling-note.reached { border-left-color: var(--orange); background: rgba(236, 91, 57, .08); }
.training-ceiling-note strong { color: #a8cfb8; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.training-ceiling-note.reached strong { color: #efb29e; }
.training-ceiling-note strong b { color: var(--cream); font-size: 11px; }
.training-ceiling-note span { margin-top: 2px; color: #9eb1a9; font-size: 8px; }

.button-row { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; }
.train-button, .match-button, .scout-button, .upgrade-button, .primary-button, .secondary-button {
  min-height: 62px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .13s, filter .2s, box-shadow .2s;
}
.train-button:active, .match-button:active, .scout-button:active, .upgrade-button:active, .primary-button:active { transform: translateY(3px) scale(.985); }
.train-button:disabled, .match-button:disabled, .scout-button:disabled, .upgrade-button:disabled { filter: saturate(.35); opacity: .58; }
.train-button { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); background: var(--cream); box-shadow: 0 4px 0 #c7bba7; }
.match-button { display: flex; align-items: center; justify-content: center; gap: 9px; color: #fff8eb; background: var(--orange); box-shadow: 0 4px 0 #a63821; }
.match-button.promotion-ready { color: var(--ink); background: var(--gold); box-shadow: 0 4px 0 #a57418, 0 0 28px rgba(240, 189, 69, .2); animation: ready-glow 1.8s ease-in-out infinite alternate; }
.train-button > span:last-child, .match-button > span:last-child { display: flex; flex-direction: column; align-items: flex-start; }
.train-button strong, .match-button strong { font-size: 12px; letter-spacing: .05em; }
.train-button small, .match-button small { font-size: 8px; font-weight: 700; opacity: .68; white-space: nowrap; }
.ball-icon { font-size: 20px; filter: grayscale(1); }
.whistle-icon { width: 25px; height: 25px; border: 2px solid currentColor; border-radius: 50%; display: grid; place-items: center; font-size: 21px; line-height: 1; }

.scouting-panel { position: relative; overflow: hidden; }
.scouting-panel::before { content: ""; position: absolute; width: 170px; height: 170px; right: -70px; top: -90px; border: 1px solid rgba(240, 189, 69, .12); border-radius: 50%; box-shadow: 0 0 0 24px rgba(240, 189, 69, .025); pointer-events: none; }
.league-badge { color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.prospect-row { display: grid; grid-template-columns: 58px 1fr; align-items: start; gap: 12px; }
.prospect-icon { width: 58px; height: 64px; display: grid; place-items: center; background: linear-gradient(155deg, var(--orange), #9e3420); color: #fff4df; clip-path: polygon(7% 0, 93% 0, 88% 75%, 50% 100%, 12% 75%); font-size: 16px; font-weight: 950; }
.prospect-row > div > span { color: var(--gold); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.prospect-row h2 { margin: 3px 0; font-size: 20px; letter-spacing: -.04em; }
.prospect-row p { margin: 0; color: #9eb4aa; font-size: 10px; line-height: 1.45; }
.scouting-progress-copy { margin-top: 14px; display: flex; justify-content: space-between; gap: 10px; color: #87a89b; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.scouting-progress-copy strong { color: #c4d5cd; font-size: 9px; }
.scouting-progress-bar { height: 6px; margin-top: 6px; overflow: hidden; background: #0c2a21; }
.scouting-progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width .2s; }
.recruitment-effects { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 11px 0; background: var(--line); border: 1px solid var(--line); }
.recruitment-effects span { padding: 9px; display: flex; flex-direction: column; gap: 2px; background: rgba(7, 28, 22, .58); color: #7e9c90; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.recruitment-effects strong { color: var(--cream); font-size: 11px; letter-spacing: 0; }
.scout-button { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid rgba(240, 189, 69, .32); color: var(--cream); background: rgba(240, 189, 69, .1); box-shadow: 0 4px 0 rgba(5, 20, 15, .45); }
.scout-button.shortlist-ready { color: var(--ink); background: var(--gold); border-color: var(--gold); box-shadow: 0 4px 0 #a57418; }
.scout-button > span:last-child { display: flex; flex-direction: column; align-items: flex-start; }
.scout-button strong { font-size: 12px; letter-spacing: .06em; }
.scout-button small { font-size: 8px; font-weight: 700; opacity: .7; }
.scout-icon { font-size: 25px; line-height: 1; }
.signing-timeline { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 13px; gap: 5px; }
.signing-timeline span { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 5px; color: #68897d; border: 1px solid rgba(255, 255, 255, .07); background: rgba(5, 22, 17, .2); }
.signing-timeline b { font-size: 9px; }
.signing-timeline small { font-size: 7px; font-weight: 900; letter-spacing: .05em; }
.signing-timeline .current { color: var(--gold); border-color: rgba(240, 189, 69, .28); }
.signing-timeline .signed { color: #9bd0af; border-color: rgba(117, 195, 147, .22); background: rgba(117, 195, 147, .07); }
.scouting-complete { text-align: center; }
.scouting-complete .section-heading { text-align: left; }
.scouting-complete h2 { margin: 4px 0; font-size: 18px; }
.scouting-complete p { margin: 0; color: #91aa9f; font-size: 11px; }
.recruitment-complete-mark { width: 42px; height: 42px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--green); font-size: 20px; font-weight: 900; }

.upgrade-title-row { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; }
.upgrade-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(240, 189, 69, .25); color: var(--gold); background: rgba(240, 189, 69, .08); font-size: 24px; }
.upgrade-title-row h2 { font-size: 20px; margin: 0 0 3px; letter-spacing: -.04em; }
.upgrade-title-row p { margin: 0; color: #96b1a6; font-size: 11px; font-weight: 700; }
.upgrade-description { color: #b5c3bc; font-size: 12px; line-height: 1.55; margin: 13px 0; }
.upgrade-button { width: 100%; min-height: 50px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, .06); color: #7f9b90; border: 1px solid var(--line); }
.upgrade-button.can-buy { color: var(--ink); background: var(--gold); border-color: var(--gold); box-shadow: 0 4px 0 #a57418; }
.upgrade-button strong { font-size: 16px; }
.complete-panel { text-align: center; }
.complete-panel .section-heading { text-align: left; }
.complete-panel h2 { margin: 4px 0; }
.complete-panel p { color: #9cb4aa; line-height: 1.5; font-size: 12px; }
.complete-mark { margin: 4px auto 9px; width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #77bd91; color: #8ed0a6; font-size: 24px; transform: rotate(-3deg); }

.promotion-bar { height: 7px; background: #0c2a21; overflow: hidden; }
.promotion-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--gold)); transition: width .4s; }
.requirements { margin-top: 10px; }
.requirement { min-height: 36px; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, .07); color: #76978a; }
.requirement:last-child { border-bottom: 0; }
.requirement > span { font-size: 16px; }
.requirement p { font-size: 11px; margin: 0; font-weight: 700; }
.requirement strong { font-size: 10px; }
.requirement.met { color: #a9cab9; }
.requirement.met > span { color: #75c393; }
.promotion-panel.ready { border-color: rgba(240, 189, 69, .5); }
.ready-banner { display: flex; align-items: center; gap: 10px; background: var(--gold); color: var(--ink); margin: 13px -8px -8px; padding: 10px 12px; }
.ready-banner > span { font-size: 20px; }
.ready-banner div { display: flex; flex-direction: column; }
.ready-banner strong { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ready-banner small { font-size: 9px; font-weight: 700; opacity: .65; }

.match-overlay { position: absolute; z-index: 4; inset: 0; background: linear-gradient(160deg, rgba(6, 21, 17, .88), rgba(9, 31, 24, .94)); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5%; animation: match-open .45s ease both; }
.match-overlay.promotion-match { background: radial-gradient(circle at 50% 110%, rgba(236, 91, 57, .25), transparent 50%), rgba(6, 21, 17, .94); }
.match-kicker { color: var(--gold); font-size: clamp(8px, 2vw, 11px); font-weight: 900; letter-spacing: .2em; margin-bottom: clamp(8px, 3vw, 18px); }
.scoreboard { width: min(540px, 100%); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(7px, 4vw, 30px); }
.score-team { display: flex; align-items: center; gap: 8px; font-size: clamp(9px, 2.5vw, 14px); text-transform: uppercase; }
.score-away { flex-direction: row-reverse; text-align: right; }
.mini-crest, .away-colors { width: clamp(28px, 8vw, 44px); aspect-ratio: 1; display: grid; place-items: center; flex: 0 0 auto; background: var(--orange); color: #fff7e7; font-size: 9px; font-weight: 900; clip-path: polygon(8% 0, 92% 0, 88% 70%, 50% 100%, 12% 70%); }
.away-colors { background: linear-gradient(90deg, var(--home) 0 50%, var(--away) 50%); }
.score { display: flex; gap: 9px; align-items: center; font-size: clamp(37px, 13vw, 70px); font-weight: 900; letter-spacing: -.08em; font-variant-numeric: tabular-nums; }
.score i { color: #78988c; font-style: normal; font-weight: 300; }
.match-minute { margin-top: clamp(10px, 3vw, 20px); min-height: 24px; display: flex; gap: 12px; align-items: center; color: #adc0b8; }
.match-minute span { color: var(--gold); font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.match-minute strong { font-size: clamp(9px, 2vw, 12px); letter-spacing: .1em; }
.momentum { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; width: min(420px, 90%); gap: 8px; margin-top: clamp(9px, 3vw, 18px); color: #819b91; font-size: 8px; font-weight: 900; text-align: center; }
.momentum > div { height: 5px; background: #6e3940; position: relative; }
.momentum i { display: block; height: 100%; background: var(--green); transition: width .18s linear; }
.momentum b { position: absolute; width: 2px; height: 11px; background: var(--cream); top: -3px; transition: left .18s linear; }
.match-clock { width: min(420px, 90%); height: 2px; background: rgba(255, 255, 255, .1); margin-top: 10px; }
.match-clock i { display: block; height: 100%; width: 0; background: var(--orange); }
.goal-shake { animation: screen-shake .42s linear; }
.loss-dim::before { content: ""; position: absolute; inset: 0; background: rgba(50, 2, 8, .25); z-index: 8; pointer-events: none; animation: fade-out .7s forwards; }

.float-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.float-text { position: absolute; left: var(--x); top: 57%; color: #fff7df; font-weight: 900; text-shadow: 0 3px 10px rgba(0, 0, 0, .6); font-size: 13px; animation: float-up 1.15s ease-out forwards; }
.float-coach { color: #a9e2bd; }

.toast-stack { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { width: min(390px, 100%); display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; padding: 11px 13px; color: var(--ink); background: var(--cream); border-left: 4px solid var(--green); box-shadow: 0 16px 45px rgba(0, 0, 0, .3); animation: toast-in .35s ease both; }
.toast-warning { border-color: var(--orange); }
.toast > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: var(--ink); font-weight: 900; }
.toast-warning > span { background: var(--orange); color: #fff; }
.toast div { display: flex; flex-direction: column; }
.toast strong { font-size: 12px; }
.toast small { font-size: 10px; color: #50655d; }
.toast.leaving { animation: toast-out .5s ease forwards; }

.promoted-shell { align-items: start; }
.promoted-ground { padding: 14px; }
.division-seven-panel { text-align: center; }
.division-flag { color: var(--gold); }
.division-number { margin: 5px 0 13px; font-size: clamp(23px, 7vw, 42px); font-weight: 300; letter-spacing: -.05em; }
.division-number strong { color: var(--orange); font-size: 1.35em; }
.division-seven-panel > p { color: #a9bdb4; font-size: 13px; line-height: 1.6; max-width: 480px; margin: 0 auto 18px; }
.next-objective { padding: 17px; background: rgba(0, 0, 0, .16); border: 1px solid var(--line); text-align: left; display: flex; flex-direction: column; }
.next-objective span { color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.next-objective strong { margin-top: 5px; font-size: 15px; }
.next-objective small { margin-top: 3px; color: #7b9a8e; }
.final-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border-block: 1px solid var(--line); }
.final-stats div { padding: 12px 5px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.final-stats div:last-child { border: 0; }
.final-stats small { color: #7e9c90; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.final-stats strong { margin-top: 3px; font-size: 13px; }
.secondary-button { min-height: 45px; padding: 0 18px; color: var(--cream); background: transparent; border: 1px solid var(--line); }

.promotion-curtain { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 55%, rgba(60, 131, 88, .72), transparent 45%), #071b15; overflow: hidden; animation: curtain-in .6s ease both; }
.promotion-copy { position: relative; z-index: 2; width: min(560px, 100%); text-align: center; }
.promotion-copy .crest { width: 70px; height: 78px; }
.promotion-copy h1 { color: var(--cream); font-size: clamp(58px, 18vw, 112px); line-height: .85; letter-spacing: -.09em; margin: 18px 0 12px; text-shadow: 0 9px 0 rgba(0, 0, 0, .18); animation: promoted-pop .7s .3s cubic-bezier(.15, .9, .2, 1.2) both; }
.division-rise { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: clamp(12px, 3vw, 16px); font-weight: 800; letter-spacing: .08em; }
.division-rise span { color: #789b8d; }
.division-rise b { color: var(--gold); font-size: 27px; }
.division-rise strong { color: var(--cream); }
.promotion-copy > p { color: #a9c1b7; font-size: 13px; }
.promotion-rewards { display: flex; justify-content: center; gap: 9px; margin: 17px 0; }
.promotion-rewards span { color: var(--ink); background: var(--gold); padding: 7px 10px; font-size: 11px; font-weight: 900; }
.primary-button { min-height: 54px; padding: 0 25px; color: #fff8eb; background: var(--orange); box-shadow: 0 5px 0 #a63821; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; left: var(--x); top: -5%; width: 8px; height: 18px; background: var(--color); animation: confetti-fall 3.6s var(--delay) linear infinite; }

footer { width: min(1360px, 100%); margin: 0 auto; min-height: 58px; padding: 15px clamp(18px, 4vw, 42px); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; color: #729084; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.game-footer { width: 100%; min-height: 0; padding-inline: 4px; flex-wrap: wrap; justify-content: flex-start; }

@media (min-width: 700px) {
  .topbar { grid-template-columns: 1fr auto auto; }
  .top-actions { grid-column: 3; grid-row: 1; }
  .resources { grid-column: 2; grid-row: 1; width: 440px; }
  .objective-strip { justify-content: flex-start; }
  .game-shell { padding-top: 26px; gap: 20px; }
  .ground-panel { padding: 18px; }
  .timeline-step span { display: block; }
  .team-panel, .scouting-panel, .upgrade-panel, .promotion-panel, .division-seven-panel { padding: 20px; }
  .promoted-shell { grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr); padding-top: 28px; gap: 20px; }
}

@media (min-width: 1040px) {
  .game-shell { grid-template-columns: minmax(0, 1.58fr) minmax(350px, .72fr); align-items: start; }
  .is-gameplay .game-shell { grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .ground-panel { position: sticky; top: 16px; }
  .is-gameplay .ground-panel { position: static; top: auto; }
  .controls-column { grid-template-columns: 1fr 1fr; }
  .is-gameplay .controls-column { scrollbar-gutter: stable; }
  .team-panel, .scouting-panel, .promotion-panel { grid-column: 1 / -1; }
  .game-footer { grid-column: 1 / -1; }
  .upgrade-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; column-gap: 18px; }
  .upgrade-panel .section-heading { grid-column: 1 / -1; }
  .upgrade-title-row { grid-column: 1; }
  .upgrade-description { grid-column: 1; }
  .upgrade-button { grid-column: 2; grid-row: 2 / 4; min-width: 170px; align-self: stretch; flex-direction: column; justify-content: center; }
  .complete-panel { display: block; }
}

@media (max-width: 1039px) {
  .ground-timeline-ground { display: none; }
  .ground-timeline-upgrades { display: grid; }
  .ground-timeline-upgrades .timeline-step span { display: none; }
}

@media (max-width: 1039px) and (orientation: portrait) {
  .is-gameplay .game-shell { grid-template-rows: auto minmax(170px, 1fr); }
  .is-gameplay .ground-panel { height: auto; grid-template-rows: auto auto; }
  .is-gameplay .ground-wrap { height: auto; aspect-ratio: 16 / 9; }
  .is-gameplay .ground-svg { height: auto; aspect-ratio: 16 / 9; }
}

@media (max-width: 699px) {
  .is-gameplay .topbar { min-height: 0; padding: 8px 12px; gap: 6px 12px; }
  .is-gameplay .crest { width: 40px; height: 45px; }
  .is-gameplay .club-identity { gap: 8px; }
  .is-gameplay .club-identity span { font-size: 8px; }
  .is-gameplay .club-identity h1 { font-size: 17px; }
  .is-gameplay .icon-button { width: 36px; height: 36px; }
  .is-gameplay .resources { grid-template-columns: 1fr 1fr 54px; border-radius: 9px; }
  .is-gameplay .resource, .is-gameplay .division-badge { min-height: 44px; padding: 6px 10px; }
  .is-gameplay .resource strong { font-size: 17px; }
  .is-gameplay .division-badge strong { font-size: 24px; }
  .is-gameplay .objective-strip { min-height: 38px; padding: 6px 12px; gap: 8px; }
  .is-gameplay .objective-strip span { font-size: 8px; }
  .is-gameplay .objective-strip strong { font-size: 11px; }
  .is-gameplay .game-shell { padding: 12px; gap: 10px; }
  .is-gameplay .ground-panel { padding: 10px; }
  .is-gameplay .ground-heading { padding: 0 2px 8px; }
}

@media (max-height: 700px) {
  .is-gameplay .topbar { min-height: 0; padding-block: 6px; gap-block: 5px; }
  .is-gameplay .crest { width: 38px; height: 43px; }
  .is-gameplay .icon-button { width: 36px; height: 36px; }
  .is-gameplay .resource, .is-gameplay .division-badge { min-height: 42px; padding-block: 5px; }
  .is-gameplay .resource strong { font-size: 16px; }
  .is-gameplay .division-badge strong { font-size: 23px; }
  .is-gameplay .objective-strip { min-height: 34px; padding-block: 6px; }
  .is-gameplay .game-shell { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); gap: 8px; }
  .is-gameplay .ground-panel { padding: 8px; }
  .is-gameplay .ground-heading { padding-bottom: 6px; }
  .is-gameplay .ground-level, .is-gameplay .ground-timeline-ground { display: none; }
}

@media (max-width: 420px) {
  .is-gameplay .objective-strip span, .is-gameplay .ground-level { display: none; }
  .is-gameplay .objective-strip { justify-content: center; }
}

@media (max-width: 390px) {
  .is-complete .topbar { padding-inline: 13px; }
  .is-complete .club-identity span { font-size: 8px; }
  .is-complete .crest { width: 41px; }
  .is-complete .objective-strip { align-items: flex-start; flex-direction: column; gap: 2px; padding-inline: 16px; }
  .button-row { grid-template-columns: 1fr; }
  .train-button, .match-button { min-height: 54px; }
  .ground-heading h2 { font-size: 15px; }
  .ground-level { font-size: 7px; }
  .score-team strong { max-width: 80px; }
  .final-stats { grid-template-columns: 1fr; }
  .final-stats div { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 1039px) and (orientation: landscape) {
  .is-gameplay .topbar {
    min-height: 0;
    padding: 5px 10px;
    grid-template-columns: minmax(125px, 1fr) minmax(170px, 1.25fr) auto;
    gap: 8px;
  }
  .is-gameplay .club-identity { grid-column: 1; grid-row: 1; gap: 7px; }
  .is-gameplay .club-identity > div > span { display: none; }
  .is-gameplay .club-identity h1 { font-size: 14px; white-space: nowrap; }
  .is-gameplay .crest { width: 30px; height: 34px; }
  .is-gameplay .resources { grid-column: 2; grid-row: 1; width: auto; grid-template-columns: 1fr 1fr 42px; }
  .is-gameplay .resource, .is-gameplay .division-badge { min-height: 34px; padding: 3px 7px; }
  .is-gameplay .resource span, .is-gameplay .division-badge small { display: none; }
  .is-gameplay .resource strong { font-size: 14px; }
  .is-gameplay .division-badge strong { font-size: 20px; }
  .is-gameplay .top-actions { grid-column: 3; grid-row: 1; }
  .is-gameplay .icon-button { width: 32px; height: 32px; }
  .is-gameplay .objective-strip { min-height: 30px; padding: 4px 10px; justify-content: center; }
  .is-gameplay .objective-strip span { display: none; }
  .is-gameplay .objective-strip strong { font-size: 10px; }
  .is-gameplay .game-shell { padding: 8px; gap: 8px; grid-template-rows: minmax(0, 1fr) clamp(96px, 28%, 220px); }
  .is-gameplay .ground-panel { height: 100%; padding: 6px; grid-template-rows: minmax(0, 1fr); }
  .is-gameplay .ground-heading { display: none; }
  .is-gameplay .ground-wrap { height: 100%; aspect-ratio: auto; }
  .is-gameplay .ground-svg { height: 100%; aspect-ratio: auto; }
  .is-gameplay .match-overlay { padding: 2%; }
  .is-gameplay .match-kicker { margin-bottom: 4px; }
  .is-gameplay .score { font-size: clamp(28px, 6vw, 44px); }
  .is-gameplay .mini-crest, .is-gameplay .away-colors { width: 28px; }
  .is-gameplay .match-minute { min-height: 16px; margin-top: 4px; }
  .is-gameplay .momentum { display: none; }
  .is-gameplay .match-clock { margin-top: 4px; }
}

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

@keyframes build-in { from { transform: translateY(-12px) scale(.93); } 70% { transform: translateY(2px) scale(1.02); } to { transform: none; } }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes ball-roll { 0%, 100% { transform: translateX(-7px) rotate(0); } 50% { transform: translateX(14px) rotate(180deg); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(131, 212, 165, 0); } 100% { box-shadow: 0 0 0 0 rgba(131, 212, 165, 0); } }
@keyframes ready-glow { to { box-shadow: 0 4px 0 #a57418, 0 0 36px rgba(240, 189, 69, .42); } }
@keyframes match-open { from { transform: scale(1.05); } to { transform: none; } }
@keyframes screen-shake { 0%, 100% { transform: none; } 20% { transform: translate(-5px, 3px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-3px, -2px); } 80% { transform: translate(3px, 2px); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes float-up { from { opacity: 0; transform: translate(-50%, 12px) scale(.8); } 20% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -65px) scale(1.05); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(25px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes curtain-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes promoted-pop { from { opacity: 0; transform: translateY(30px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes confetti-fall { 0% { transform: translateY(-10vh) rotate(0); } 100% { transform: translateY(112vh) rotate(var(--spin)); } }
