:root {
  color-scheme: dark;
  --bg: #090b0e;
  --surface: #101216;
  --surface-2: #15181d;
  --surface-3: #1b1f26;
  --line: #292e37;
  --line-strong: #3a414d;
  --text: #f4f6f8;
  --muted: #8f98a8;
  --muted-strong: #b7bfca;
  --accent: #f4c451;
  --accent-strong: #e9b52f;
  --accent-ink: #18140a;
  --cyan: #66c9eb;
  --green: #4fd19b;
  --red: #ff6675;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
}

body.career-active {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.shell {
  margin: 12px auto;
  width: min(1480px, calc(100% - 24px));
}

.app-bar {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  height: 54px;
  justify-content: space-between;
  padding: 0 16px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 6px;
  color: var(--accent-ink);
  display: inline-flex;
  flex: 0 0 32px;
  font-size: 12px;
  font-weight: 950;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong {
  font-size: 14px;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.setup,
.career {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-top: 10px;
}

.setup {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  min-height: calc(100vh - 100px);
  overflow: hidden;
}

.setup-copy {
  align-content: center;
  display: grid;
  padding: 64px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  margin: 0 0 18px;
  text-transform: uppercase;
}

h1 {
  font-size: 62px;
  line-height: 1.02;
  margin: 0;
  max-width: 760px;
}

.intro {
  color: var(--muted-strong);
  font-size: 17px;
  line-height: 1.55;
  margin: 22px 0 0;
  max-width: 650px;
}

.setup-form {
  align-content: center;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 18px;
  padding: 48px;
}

.form-heading {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 20px;
}

.form-heading > div {
  display: grid;
  gap: 5px;
}

.form-heading > div span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.form-heading strong {
  font-size: 24px;
  line-height: 1;
}

.initial-ovr {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  padding: 8px 10px;
}

label {
  color: var(--muted-strong);
  display: grid;
  font-size: 11px;
  font-weight: 800;
  gap: 8px;
  text-transform: uppercase;
}

input,
select {
  background: #0c0e12;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 50px;
  padding: 0 14px;
  transition: border-color 150ms ease, background-color 150ms ease;
}

input::placeholder {
  color: #5f6876;
}

input:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus {
  background: #0f1116;
  border-color: var(--cyan);
}

.setup-form button {
  background: var(--accent);
  border-radius: 6px;
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 900;
  min-height: 52px;
  transition: background-color 150ms ease, transform 150ms ease;
}

.setup-form button:hover {
  background: #ffd26f;
  transform: translateY(-1px);
}

body.career-active .shell {
  display: grid;
  gap: 10px;
  grid-template-rows: 54px minmax(0, 1fr);
  height: calc(100vh - 24px);
}

.career {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(420px, 500px) minmax(0, 1fr);
  height: auto;
  margin-top: 0;
  min-height: 0;
  overflow: hidden;
}

.left-panel {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px;
}

.player-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 84px minmax(0, 1fr) 82px;
  height: 92px;
  min-height: 92px;
  overflow: hidden;
}

.rating-box {
  align-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  isolation: isolate;
  justify-items: center;
  overflow: hidden;
  padding: 10px 0;
  position: relative;
}

.rating-box::after {
  bottom: 0;
  content: "";
  height: 4px;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  transition: opacity 160ms ease;
}

.rating-box.ovr-rising::after {
  background: var(--green);
  opacity: 1;
}

.rating-box.ovr-falling::after {
  background: var(--red);
  opacity: 1;
}

.rating-box span,
.age-box span {
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.rating-box strong {
  color: var(--accent-ink);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rating-box.ovr-rising strong {
  animation: ovr-count-up 420ms ease-in-out infinite alternate;
}

.rating-box.ovr-falling strong {
  animation: ovr-count-down 420ms ease-in-out infinite alternate;
}

@keyframes ovr-count-up {
  to {
    transform: translateY(-1px) scale(1.06);
  }
}

@keyframes ovr-count-down {
  to {
    transform: translateY(1px) scale(0.96);
  }
}

.identity {
  align-content: center;
  display: grid;
  min-width: 0;
  padding: 7px 16px;
}

.tags {
  display: flex;
  gap: 5px;
  margin-bottom: 4px;
  min-width: 0;
  overflow: hidden;
}

.tags span {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 850;
  line-height: 18px;
  max-width: 120px;
  overflow: hidden;
  padding: 0 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity h2 {
  font-size: 21px;
  line-height: 1.05;
  margin: 0 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.age-box {
  align-content: center;
  border-left: 1px solid var(--line);
  display: grid;
  justify-items: center;
}

.age-box span {
  color: var(--muted);
  margin-bottom: 5px;
}

.age-box strong {
  font-size: 30px;
  line-height: 1;
}

.trophy-case {
  align-items: center;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 12px 14px;
  justify-content: center;
  margin: 12px 0;
  min-height: 88px;
  overflow: visible;
  padding: 11px 4px;
}

.trophy-case:empty {
  border-bottom: 0;
  margin: 6px 0;
  min-height: 0;
  padding: 0;
}

.showcase-title {
  display: grid;
  flex: 1 1 64px;
  gap: 6px;
  justify-items: center;
  max-width: 86px;
  min-width: 60px;
}

.showcase-trophy {
  min-height: 36px;
  position: relative;
}

.showcase-trophy img {
  height: 36px;
  object-fit: contain;
  width: 36px;
}

.showcase-title > span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  max-width: 84px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.showcase-multiplier {
  align-items: center;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 999px;
  color: var(--accent-ink) !important;
  display: inline-flex;
  font-size: 9px !important;
  font-weight: 950;
  height: 20px;
  justify-content: center;
  min-width: 25px;
  padding: 0 5px;
  position: absolute;
  right: -14px;
  top: -7px;
}

.showcase-fallback {
  color: var(--accent) !important;
  display: block;
  font-size: 10px !important;
  line-height: 38px;
}

.participation-summary {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  flex: 1 0 100%;
  gap: 6px;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  padding: 9px 2px 0;
}

.participation-heading {
  color: #737d8c;
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.participation-item {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: center;
  min-width: 0;
}

.participation-item > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participation-item strong {
  align-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--text);
  display: inline-flex;
  flex: 0 0 24px;
  font-size: 10px;
  height: 22px;
  justify-content: center;
}

.market {
  flex: 0 0 auto;
  min-height: 0;
}

.market h3 {
  font-size: 24px;
  line-height: 1.1;
  margin: 0 0 7px;
}

.market > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 14px;
  max-width: 470px;
}

.offers {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.offer-card {
  align-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 112px;
  padding: 12px;
  position: relative;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.offer-card::after {
  background: transparent;
  bottom: 0;
  content: "";
  height: 2px;
  left: 12px;
  position: absolute;
  right: 12px;
  transition: background-color 150ms ease;
}

.offer-card:hover {
  background: var(--surface-3);
  border-color: #575f6c;
  transform: translateY(-2px);
}

.offer-card:hover::after {
  background: var(--accent);
}

.offer-card > span:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.team-logo,
.logo-fallback {
  height: 34px;
  width: 34px;
}

.team-logo {
  justify-self: center;
  object-fit: contain;
}

.logo-fallback {
  align-items: center;
  background: #242a33;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent);
  display: inline-flex;
  font-size: 10px;
  font-weight: 950;
  justify-content: center;
  justify-self: center;
}

.offer-card strong {
  font-size: 15px;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.offer-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.offer-card b {
  color: var(--accent);
}

.retire-icon {
  color: var(--red);
}

.event-card {
  align-content: start;
  border-color: var(--line-strong);
  gap: 7px;
  min-height: 220px;
  padding: 16px;
}

.event-card:disabled {
  cursor: default;
}

.event-card > .event-icon {
  color: var(--cyan);
  height: 30px;
  width: 30px;
}

.event-card > span:not(.event-icon) {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.event-card > strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  text-align: center;
}

.event-card > small {
  color: var(--muted-strong);
  display: block;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.event-card.is-selected {
  animation: event-card-reveal 420ms ease both;
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(102, 201, 235, 0.2), 0 18px 38px rgba(0, 0, 0, 0.24);
}

.event-card.is-dimmed {
  filter: saturate(0.3);
  opacity: 0.3;
  transform: scale(0.985);
}

.event-outcomes {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  text-align: left;
  width: 100%;
}

.event-outcome {
  align-items: center;
  background: #22262d;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-strong);
  display: grid;
  gap: 8px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  min-height: 40px;
  padding: 6px 8px;
}

.event-outcome b {
  font-size: 12px;
  line-height: 1.2;
}

.event-outcome em {
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  padding: 4px 7px;
}

.outcome-symbol {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.outcome-positive {
  background: rgba(79, 209, 155, 0.1);
  color: #62dcae;
}

.outcome-positive .outcome-symbol,
.outcome-positive em {
  background: rgba(79, 209, 155, 0.16);
}

.outcome-negative {
  background: rgba(255, 102, 117, 0.1);
  color: #ff7d89;
}

.outcome-negative .outcome-symbol,
.outcome-negative em {
  background: rgba(255, 102, 117, 0.16);
}

.outcome-neutral {
  background: rgba(183, 191, 202, 0.08);
  color: #c2c8d1;
}

.outcome-neutral .outcome-symbol,
.outcome-neutral em {
  background: rgba(183, 191, 202, 0.12);
}

.event-outcome.result-picked {
  animation: outcome-reveal 550ms ease both;
  border-color: currentColor;
}

.event-outcome.result-muted {
  filter: grayscale(0.8);
  opacity: 0.25;
}

@keyframes event-card-reveal {
  from {
    transform: translateY(0) scale(0.98);
  }
  to {
    transform: translateY(-2px) scale(1);
  }
}

@keyframes outcome-reveal {
  0% {
    opacity: 0.45;
    transform: scale(0.97);
  }
  65% {
    transform: scale(1.025);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  margin-top: auto;
  min-height: 40px;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
  width: 100%;
}

.capture-button {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 900;
  margin-top: auto;
  min-height: 40px;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
  width: 100%;
}

.capture-button:hover {
  background: #ffd26f;
  border-color: #ffd26f;
  transform: translateY(-1px);
}

.capture-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.capture-button:not(.hidden) + .ghost {
  margin-top: 8px;
}

.ghost:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text);
}

.timeline {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 18px 20px;
}

.timeline-title {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  margin-bottom: 6px;
  min-height: 40px;
  padding-bottom: 6px;
}

.timeline-title > div {
  display: grid;
  gap: 3px;
}

.timeline-title > div span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.timeline-title strong {
  font-size: 16px;
  line-height: 1.1;
}

.timeline-head,
.season {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 48px minmax(150px, 1fr) 56px 116px;
}

.timeline-head {
  color: #667080;
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 850;
  padding: 0 8px 4px;
  text-transform: uppercase;
}

#history {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  grid-template-rows: repeat(19, minmax(0, 1fr));
  min-height: 0;
  overflow: hidden;
}

.trophy-case::-webkit-scrollbar {
  height: 7px;
  width: 7px;
}

.trophy-case::-webkit-scrollbar-track {
  background: transparent;
}

.trophy-case::-webkit-scrollbar-thumb {
  background: #434a56;
  border-radius: 999px;
}

.season {
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 5px;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  padding: 1px 8px;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.season:not(.muted):hover {
  background: var(--surface-3);
  border-color: var(--line);
}

.season.champion {
  background: #1a1812;
  border-color: #42391f;
  box-shadow: inset 3px 0 0 var(--accent);
}

.season.choosing {
  background: #171b21;
  border-color: #39414c;
  color: var(--muted-strong);
}

.season.choosing .club-cell,
.season.choosing > span:nth-child(2) {
  animation: choosing-pulse 1.8s ease-in-out infinite;
}

.season.muted {
  background: transparent;
  border-color: transparent;
  color: #343b47;
  min-height: 0;
}

@keyframes choosing-pulse {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

.age-pill,
.ovr-pill {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 950;
  height: calc(100% - 2px);
  justify-content: center;
  max-height: 25px;
  min-height: 18px;
}

.age-pill {
  background: rgba(102, 201, 235, 0.14);
  border: 1px solid rgba(102, 201, 235, 0.28);
  color: var(--cyan);
}

.ovr-pill {
  background: rgba(244, 196, 81, 0.12);
  border: 1px solid rgba(244, 196, 81, 0.26);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.ovr-pill.ovr-rising {
  background: rgba(79, 209, 155, 0.15);
  border-color: rgba(79, 209, 155, 0.5);
  color: var(--green);
}

.ovr-pill.ovr-falling {
  background: rgba(255, 102, 117, 0.14);
  border-color: rgba(255, 102, 117, 0.48);
  color: var(--red);
}

.season.champion .age-pill,
.season.champion .ovr-pill {
  background: rgba(244, 196, 81, 0.14);
  border-color: rgba(244, 196, 81, 0.3);
  color: var(--accent);
}

.season.muted .age-pill {
  background: transparent;
  border-color: #252b34;
  color: #46505e;
}

.season small {
  color: var(--muted);
  display: block;
  font-size: 8px;
  margin-top: 0;
}

.club-cell {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.club-info {
  display: grid;
  gap: 0;
  min-width: 0;
}

.club-info b {
  font-size: 12px;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intl-status {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.club-cell .team-logo,
.club-cell .logo-fallback {
  flex: 0 0 22px;
  height: 22px;
  width: 22px;
}

.trophy-cell {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}

.trophy-img {
  flex: 0 0 17px;
  height: 17px;
  object-fit: contain;
  width: 17px;
}

.trophy-fallback,
.empty-trophy {
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
}

.empty-trophy {
  color: #586170;
}

.inactive-icon {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .career {
    grid-template-columns: minmax(400px, 450px) minmax(0, 1fr);
  }

  .setup-copy {
    padding: 48px;
  }

  h1 {
    font-size: 52px;
  }
}

@media (min-width: 981px) and (max-height: 760px) {
  body.career-active .shell {
    grid-template-rows: 48px minmax(0, 1fr);
  }

  .app-bar {
    height: 48px;
  }

  .left-panel,
  .timeline {
    padding: 12px 14px;
  }

  .player-card {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    height: 82px;
    min-height: 82px;
  }

  .rating-box strong {
    font-size: 28px;
  }

  .identity h2 {
    font-size: 18px;
  }

  .identity {
    padding: 5px 12px;
  }

  .tags {
    margin-bottom: 2px;
  }

  .tags span {
    line-height: 16px;
  }

  .identity h2 {
    margin-bottom: 2px;
  }

  .identity p {
    font-size: 10px;
  }

  .age-box strong {
    font-size: 25px;
  }

  .trophy-case {
    gap: 8px 10px;
    margin: 8px 0;
    min-height: 76px;
    padding: 7px 4px;
  }

  .showcase-title {
    flex-basis: 58px;
    max-width: 74px;
  }

  .showcase-trophy {
    min-height: 32px;
  }

  .showcase-trophy img {
    height: 32px;
    width: 32px;
  }

  .participation-summary {
    padding-top: 6px;
  }

  .market h3 {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .market > p {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .offers {
    gap: 7px;
  }

  .offer-card {
    min-height: 88px;
    padding: 8px;
  }

  .team-logo,
  .logo-fallback {
    height: 28px;
    width: 28px;
  }

  .offer-card strong {
    font-size: 13px;
  }

  .event-card {
    min-height: 180px;
  }

  .event-card > small {
    font-size: 10px;
  }

  .event-outcome {
    min-height: 34px;
  }

  .timeline-title {
    min-height: 42px;
  }

  .ghost {
    min-height: 36px;
  }
}

@media (max-width: 980px) {
  body.career-active {
    overflow: auto;
  }

  body.career-active .shell {
    display: block;
    height: auto;
  }

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

  .setup-copy {
    padding: 48px;
  }

  .setup-form {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 40px 48px;
  }

  .career {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .left-panel {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .timeline {
    height: 70vh;
    min-height: 520px;
  }

  .ghost {
    margin-top: 14px;
  }
}

@media (max-width: 620px) {
  .shell {
    margin: 8px auto;
    width: calc(100% - 16px);
  }

  .app-bar {
    height: 50px;
    padding: 0 12px;
  }

  .setup {
    min-height: calc(100vh - 76px);
  }

  .setup-copy {
    padding: 34px 22px;
  }

  h1 {
    font-size: 40px;
  }

  .intro {
    font-size: 15px;
  }

  .setup-form {
    padding: 30px 22px;
  }

  .left-panel,
  .timeline {
    padding: 12px;
  }

  .player-card {
    grid-template-columns: 70px minmax(0, 1fr) 68px;
    height: 86px;
    min-height: 86px;
  }

  .rating-box strong {
    font-size: 29px;
  }

  .identity {
    padding: 8px 10px;
  }

  .identity h2 {
    font-size: 18px;
  }

  .identity p {
    font-size: 10px;
  }

  .age-box strong {
    font-size: 26px;
  }

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

  .offer-card {
    min-height: 104px;
  }

  .event-card {
    min-height: 190px;
  }

  .timeline {
    height: 68vh;
    min-height: 470px;
  }

  .timeline-head {
    display: none;
  }

  .season {
    gap: 4px;
    grid-template-columns: 40px minmax(0, 1fr) 44px 68px;
  }

  .club-cell {
    gap: 5px;
  }

  .club-cell .team-logo,
  .club-cell .logo-fallback {
    flex-basis: 18px;
    height: 18px;
    width: 18px;
  }

  .club-info b {
    font-size: 10px;
  }

  .trophy-img {
    flex-basis: 10px;
    height: 14px;
    width: 10px;
  }
}

@media (max-width: 700px) {
  body.career-active {
    height: 100dvh;
    overflow: hidden;
  }

  body.career-active .shell {
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    width: 100%;
  }

  body.career-active .app-bar {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    height: 48px;
    justify-content: center;
  }

  .career {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    display: grid;
    gap: 0;
    grid-template-areas:
      "player"
      "timeline"
      "market"
      "capture"
      "restart";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(130px, 1fr) auto auto auto;
    height: 100%;
    margin: 0;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    width: 100%;
  }

  .career.career-finished {
    grid-template-areas:
      "player"
      "timeline"
      "trophies"
      "market"
      "capture"
      "restart";
    grid-template-rows: auto minmax(120px, 1fr) auto auto auto auto;
  }

  .left-panel {
    display: contents;
  }

  .player-card {
    grid-area: player;
    grid-template-columns: 68px minmax(0, 1fr) 62px;
    height: 74px;
    margin: 8px 10px 5px;
    max-width: calc(100% - 20px);
    min-width: 0;
    min-height: 74px;
  }

  .rating-box {
    padding: 7px 0;
  }

  .rating-box strong {
    font-size: 28px;
  }

  .identity {
    padding: 6px 10px;
  }

  .tags {
    margin-bottom: 2px;
  }

  .tags span {
    font-size: 8px;
    line-height: 16px;
    padding: 0 6px;
  }

  .identity h2 {
    font-size: 17px;
    margin-bottom: 2px;
  }

  .identity p {
    font-size: 10px;
  }

  .age-box span {
    margin-bottom: 3px;
  }

  .age-box strong {
    font-size: 25px;
  }

  .timeline {
    grid-area: timeline;
    height: auto;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    padding: 2px 10px 6px;
  }

  .timeline-title {
    margin-bottom: 3px;
    min-height: 34px;
    padding: 0 2px 4px;
  }

  .timeline-title > div {
    gap: 1px;
  }

  .timeline-title > div span {
    font-size: 7px;
  }

  .timeline-title strong {
    font-size: 14px;
  }

  .timeline-head,
  .season {
    gap: 4px;
    grid-template-columns: 42px minmax(0, 1fr) 44px 54px;
  }

  .timeline-head {
    display: grid;
    font-size: 7px;
    padding: 0 4px 3px;
  }

  #history {
    align-content: start;
    gap: 3px;
    grid-auto-rows: 27px;
    grid-template-rows: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-color: #454c58 transparent;
    scrollbar-width: thin;
  }

  #history::-webkit-scrollbar {
    width: 4px;
  }

  #history::-webkit-scrollbar-track {
    background: transparent;
  }

  #history::-webkit-scrollbar-thumb {
    background: #454c58;
    border-radius: 999px;
  }

  .season {
    min-height: 27px;
    padding: 2px 4px;
  }

  .age-pill,
  .ovr-pill {
    font-size: 10px;
    max-height: 22px;
    min-height: 20px;
  }

  .club-cell {
    gap: 5px;
  }

  .club-cell .team-logo,
  .club-cell .logo-fallback {
    flex-basis: 18px;
    height: 18px;
    width: 18px;
  }

  .club-info b {
    font-size: 10px;
  }

  .club-info small,
  .intl-status {
    display: none;
  }

  .trophy-cell {
    gap: 1px;
  }

  .trophy-img {
    flex-basis: 12px;
    height: 14px;
    width: 12px;
  }

  .market {
    background: var(--surface);
    border-top: 1px solid var(--line);
    grid-area: market;
    max-height: 43dvh;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 9px 10px 8px;
  }

  .market h3 {
    font-size: 19px;
    margin-bottom: 3px;
  }

  .market > p {
    font-size: 11px;
    line-height: 1.25;
    margin-bottom: 8px;
    max-width: none;
  }

  .offers {
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .offers[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .offers[data-count="2"],
  .offers[data-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offer-card {
    gap: 3px;
    min-width: 0;
    min-height: 102px;
    padding: 7px 5px;
  }

  .offer-card > span:first-child {
    font-size: 8px;
  }

  .team-logo,
  .logo-fallback {
    height: 27px;
    width: 27px;
  }

  .offer-card strong {
    display: -webkit-box;
    font-size: 11px;
    line-height: 1.12;
    max-height: 2.24em;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .offer-card small {
    font-size: 8px;
  }

  .event-card {
    min-height: 176px;
    padding: 9px 7px;
  }

  .event-card > .event-icon {
    height: 24px;
    width: 24px;
  }

  .event-card > span:not(.event-icon) {
    font-size: 8px;
  }

  .event-card > strong {
    font-size: 13px;
  }

  .event-card > small {
    font-size: 9px;
    line-height: 1.25;
  }

  .event-outcomes {
    gap: 4px;
  }

  .event-outcome {
    gap: 5px;
    grid-template-columns: 21px minmax(0, 1fr) auto;
    min-height: 31px;
    padding: 4px 5px;
  }

  .event-outcome b {
    font-size: 9px;
  }

  .event-outcome em {
    font-size: 8px;
    padding: 3px 5px;
  }

  .outcome-symbol {
    height: 21px;
    width: 21px;
  }

  .ghost {
    grid-area: restart;
    margin: 0 10px 8px;
    min-height: 34px;
    width: calc(100% - 20px);
  }

  .capture-button {
    grid-area: capture;
    margin: 0 10px 6px;
    min-height: 36px;
    width: calc(100% - 20px);
  }

  .trophy-case {
    display: none;
    grid-area: trophies;
  }

  .career.career-finished .trophy-case:not(:empty) {
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: center;
    margin: 0 10px;
    max-height: 28dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 9px 3px;
  }

  .career.career-finished .showcase-title {
    max-width: 72px;
    min-width: 0;
    width: 100%;
  }

  .career.career-finished .showcase-trophy,
  .career.career-finished .showcase-trophy img {
    height: 30px;
    min-height: 30px;
    width: 30px;
  }

  .career.career-finished .showcase-title > span {
    font-size: 9px;
    max-width: 70px;
  }

  .career.career-finished .participation-summary {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.capture-export-document,
.capture-export-body {
  height: 760px !important;
  margin: 0 !important;
  overflow: hidden !important;
  width: 1850px !important;
}

.capture-export-body .shell {
  display: block !important;
  height: 760px !important;
  margin: 0 !important;
  max-width: none !important;
  width: 1850px !important;
}

.career.capture-export {
  display: grid !important;
  gap: 0 !important;
  grid-template-areas: none !important;
  grid-template-columns: 620px minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  height: 760px !important;
  margin: 0 !important;
  max-width: none !important;
  min-height: 760px !important;
  overflow: hidden !important;
  width: 1850px !important;
}

.capture-export .left-panel {
  border-bottom: 0 !important;
  border-right: 1px solid var(--line) !important;
  display: flex !important;
  min-height: 0 !important;
  padding: 16px !important;
}

.capture-export .player-card {
  grid-template-columns: 92px minmax(0, 1fr) 90px !important;
  height: 102px !important;
  margin: 0 !important;
  max-width: none !important;
  min-height: 102px !important;
  width: 100% !important;
}

.capture-export .rating-box strong {
  font-size: 38px !important;
}

.capture-export .identity {
  padding: 8px 16px !important;
}

.capture-export .identity h2 {
  font-size: 22px !important;
}

.capture-export .identity p {
  display: none !important;
}

.capture-export .age-box strong {
  font-size: 32px !important;
}

.capture-export .trophy-case {
  align-items: center !important;
  display: flex !important;
  gap: 12px 14px !important;
  justify-content: center !important;
  margin: 10px 0 !important;
  max-height: none !important;
  min-height: 126px !important;
  overflow: hidden !important;
  padding: 10px 4px !important;
}

.capture-export .market {
  background: transparent !important;
  border-top: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
}

.capture-export .market h3 {
  font-size: 24px !important;
  margin-bottom: 7px !important;
}

.capture-export .market > p {
  font-size: 13px !important;
  margin-bottom: 14px !important;
}

.capture-export .capture-button {
  display: none !important;
}

.capture-export .ghost {
  grid-area: auto !important;
  margin: auto 0 0 !important;
  min-height: 40px !important;
  width: 100% !important;
}

.capture-export .timeline {
  height: auto !important;
  min-height: 0 !important;
  padding: 16px 18px !important;
}

.capture-export .timeline-title {
  margin-bottom: 6px !important;
  min-height: 40px !important;
  padding-bottom: 6px !important;
}

.capture-export .timeline-title > div {
  gap: 3px !important;
}

.capture-export .timeline-title > div span {
  font-size: 9px !important;
}

.capture-export .timeline-title strong {
  font-size: 18px !important;
}

.capture-export .timeline-head,
.capture-export .season {
  gap: 8px !important;
  grid-template-columns: 60px minmax(150px, 1fr) 64px 150px !important;
}

.capture-export .timeline-head {
  display: grid !important;
  font-size: 9px !important;
  padding: 0 8px 4px !important;
}

.capture-export #history {
  gap: 2px !important;
  grid-auto-rows: auto !important;
  grid-template-rows: repeat(19, minmax(0, 1fr)) !important;
  overflow: hidden !important;
  padding-right: 0 !important;
}

.capture-export .season {
  min-height: 0 !important;
  padding: 1px 8px !important;
}

.capture-export .season.champion {
  border-color: #42391f !important;
  box-shadow: none !important;
}

.capture-export .age-pill,
.capture-export .ovr-pill {
  font-size: 11px !important;
  max-height: 25px !important;
  min-height: 18px !important;
}

.capture-export .club-cell {
  gap: 8px !important;
}

.capture-export .club-cell .team-logo,
.capture-export .club-cell .logo-fallback {
  flex-basis: 22px !important;
  height: 22px !important;
  width: 22px !important;
}

.capture-export .club-info b {
  font-size: 12px !important;
}

.capture-export .trophy-img {
  flex-basis: 17px !important;
  height: 17px !important;
  width: 17px !important;
}

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