:root {
  --paper: #f5f2e9;
  --ink: #183b31;
  --muted: #737c70;
  --orange: #e96538;
  --line: #d9dccf;
  --green: #204c3d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 11px 17px;
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
}
button:hover {
  filter: brightness(0.93);
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
.masthead {
  max-width: 1340px;
  margin: auto;
  padding: 25px 40px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 28px;
}
.brand {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -1.5px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.brand-ball {
  font-size: 34px;
}
.edition {
  font: 10px monospace;
  letter-spacing: 1px;
  max-width: 95px;
  margin-left: 12px;
  line-height: 1.5;
}
.header-note {
  font: 10px monospace;
  letter-spacing: 1.3px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-note i {
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: var(--orange);
}
.icon-button {
  font-size: 11px;
}
main {
  max-width: 1240px;
  padding: 0 30px;
  margin: auto;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 52px 0 36px;
}
.eyebrow {
  font: 11px monospace;
  font-weight: bold;
  letter-spacing: 1.7px;
  line-height: 1.6;
}
h1 {
  font-size: clamp(44px, 6vw, 80px);
  line-height: 0.98;
  letter-spacing: -4px;
  margin: 20px 0;
}
h1 em {
  font-family: Georgia, serif;
  font-weight: normal;
  color: var(--orange);
}
.lead {
  color: #6a756a;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 0;
}
.season-stamp {
  border: 1px solid #bac3b5;
  transform: rotate(8deg);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  text-align: center;
  padding: 27px 15px;
  font: 11px monospace;
  margin-right: 65px;
}
.season-stamp strong {
  display: block;
  font-size: 29px;
  margin: 2px 0;
}
.season-stamp span {
  font-size: 8px;
  line-height: 1.3;
  display: block;
}
.home-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}
.match-card,
.manager-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #faf8f1;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  gap: 12px;
}
.tag {
  font: 9px monospace;
  letter-spacing: 0.7px;
  white-space: nowrap;
}
.mini-pitch {
  height: 235px;
  background: repeating-linear-gradient(
    90deg,
    #337353 0 12.5%,
    #397b59 12.5% 25%
  );
  position: relative;
  overflow: hidden;
  border: 12px solid #285d46;
}
.mini-pitch:before {
  content: "";
  position: absolute;
  inset: 15px;
  border: 1px solid #b5d2a985;
}
.mini-pitch:after {
  content: "";
  position: absolute;
  left: 50%;
  height: 100%;
  border-left: 1px solid #b5d2a985;
}
.pitch-circle {
  width: 105px;
  height: 105px;
  border: 1px solid #b5d2a985;
  position: absolute;
  left: calc(50% - 52px);
  top: 54px;
  border-radius: 50%;
}
.pitch-caption {
  position: absolute;
  left: 27px;
  top: 31px;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -1px;
  color: #e9f1cf;
  z-index: 1;
  text-shadow: 2px 3px #204c3d;
}
.pixel-player {
  position: absolute;
  width: 12px;
  height: 13px;
  background: #e96739;
  box-shadow:
    0 -6px #dcb58e,
    0 5px #f7ead6,
    4px 10px #193b32,
    -4px 10px #193b32,
    5px 2px #dcb58e,
    -5px 2px #dcb58e;
  z-index: 2;
}
.p1 {
  left: 58%;
  top: 33%;
}
.p2 {
  left: 77%;
  top: 63%;
  background: #e8e7da;
}
.p3 {
  left: 40%;
  top: 72%;
}
.p4 {
  left: 86%;
  top: 25%;
  background: #e8e7da;
}
.p5 {
  left: 22%;
  top: 75%;
  background: #e8e7da;
}
.little-ball {
  position: absolute;
  left: 62%;
  top: 47%;
  width: 8px;
  height: 8px;
  background: white;
  box-shadow: 2px 2px #183b31;
}
.tactics-art {
  height: 235px;
  background: #183b31;
  position: relative;
  overflow: hidden;
  color: #d8dec1;
}
.chalk-title {
  position: absolute;
  top: 24px;
  left: 25px;
  font: 10px monospace;
  letter-spacing: 2px;
  opacity: 0.5;
}
.chalk-line {
  position: absolute;
  inset: 53px 24px 20px;
  border: 1px solid #d8dec133;
}
.chalk {
  font: 40px monospace;
  position: absolute;
}
.x1 {
  left: 20%;
  top: 55%;
}
.x2 {
  left: 39%;
  top: 32%;
}
.x3 {
  left: 61%;
  top: 57%;
}
.x4 {
  left: 75%;
  top: 27%;
}
.x5 {
  left: 38%;
  top: 70%;
}
.chalk-arrow {
  font: 100px Georgia;
  position: absolute;
  top: 55px;
  left: 44%;
  color: #dc8e54;
  transform: rotate(-15deg);
}
.chalk-note {
  font: italic 20px Georgia;
  position: absolute;
  top: 135px;
  right: 25px;
  transform: rotate(-8deg);
  opacity: 0.6;
}
.card-body {
  padding: 24px;
}
h2 {
  font-size: 27px;
  letter-spacing: -0.9px;
  margin: 0 0 9px;
}
p {
  line-height: 1.5;
}
.card-body > p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
}
.team-pickers {
  display: flex;
  gap: 15px;
  align-items: center;
  margin: 22px 0;
}
.team-pickers > span {
  font: 11px monospace;
  padding-top: 19px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  flex: 1;
}
select {
  width: 100%;
  min-width: 0;
  padding: 11px 30px 11px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #faf8f1;
  color: var(--ink);
  font-size: 13px;
}
.primary {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}
.secondary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.wide {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.manager-features {
  display: flex;
  gap: 0;
  margin: 28px 0 30px;
  font: 12px monospace;
}
.manager-features span {
  padding: 0 15px;
  border-right: 1px solid var(--line);
}
.manager-features span:first-child {
  padding-left: 0;
}
.manager-features span:last-child {
  border: 0;
}
.card-body .save-note {
  font: 10px monospace;
  margin: 14px 0 0;
}
.controls-strip {
  display: flex;
  gap: 30px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 32px 0 40px;
  padding: 24px 0;
  justify-content: space-between;
}
.controls-strip > div > span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 9px;
}
kbd {
  display: inline-block;
  font: 10px monospace;
  border: 1px solid #cdd3c5;
  border-bottom: 3px solid #cdd3c5;
  padding: 6px;
  border-radius: 3px;
}
.touch-tip {
  display: flex;
  align-items: center;
  gap: 10px;
}
.touch-tip .touch-icon {
  font-size: 35px;
  margin: 0;
}
footer {
  max-width: 1240px;
  padding: 0 30px 28px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}
footer .brand {
  font-size: 19px;
  color: var(--ink);
}
footer .brand span,
footer > span {
  font: 9px monospace;
  letter-spacing: 0.4px;
}
footer .brand span {
  max-width: 90px;
  font-size: 8px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0;
  gap: 12px;
}
.back,
.text-button {
  border: 0;
  padding: 8px 0;
  font-size: 12px;
}
.match-tools {
  display: flex;
  gap: 8px;
}
.scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  padding: 20px 30px;
  border-radius: 7px 7px 0 0;
}
.scoreboard > div {
  flex: 1;
}
.scoreboard > div:last-child {
  text-align: right;
}
.scoreboard small {
  display: block;
  font: 9px monospace;
  letter-spacing: 1px;
  opacity: 0.6;
  margin-top: 8px;
}
.scoreboard strong {
  font-size: 18px;
}
.score {
  text-align: center;
  font: bold 36px monospace !important;
}
.team-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin: 0 10px;
}
.stadium {
  position: relative;
  background: #203e30;
}
canvas {
  width: 100%;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
}
.match-status {
  display: flex;
  justify-content: space-between;
  background: #e7e8dc;
  padding: 13px 18px;
  font: 11px monospace;
  gap: 14px;
}
.match-status > span:last-child {
  font-size: 9px;
  opacity: 0.6;
}
.match-help {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
  margin: 20px 0 35px;
}
.match-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #102c26d9;
  color: var(--paper);
  text-align: center;
  padding: 20px;
}
.match-overlay h2 {
  font-size: 45px;
}
.match-overlay p {
  margin: 8px 0 20px;
}
.match-overlay .overlay-stats {
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.85;
}
.match-overlay .primary {
  min-width: 170px;
}
.touch-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 18px 25px;
  user-select: none;
  touch-action: none;
}
#joystick {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid #b4c1ae;
  background: #e2e5d7;
  position: relative;
  touch-action: none;
}
#stick {
  position: absolute;
  width: 46px;
  height: 46px;
  left: 31px;
  top: 31px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 3px 0 #10271f;
}
.touch-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.touch-actions button {
  width: 73px;
  height: 73px;
  border-radius: 50%;
  font-size: 11px;
  background: var(--ink);
  color: white;
  touch-action: none;
  border: 0;
}
.touch-actions #touch-shoot {
  background: var(--orange);
  width: 85px;
  height: 85px;
}
.touch-actions small {
  font-size: 8px;
  display: block;
  opacity: 0.65;
  margin-top: 4px;
}
.career-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 25px 0 32px;
}
.career-heading h1 {
  font-size: 52px;
  letter-spacing: -2px;
}
.budget {
  padding: 22px 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.budget span {
  font: 9px monospace;
  letter-spacing: 1px;
}
.budget strong {
  display: block;
  font: 30px monospace;
  margin-top: 10px;
}
.career-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  margin-bottom: 35px;
}
.panel {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #faf8f1;
  margin-bottom: 20px;
}
.panel h2 {
  font-size: 22px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.panel-heading h2 {
  margin: 0;
}
.fixture-panel {
  background: var(--ink);
  color: var(--paper);
}
.fixture-panel h2 {
  font-size: 30px;
  margin: 18px 0 8px;
}
.fixture-panel > p:not(.eyebrow) {
  font-size: 12px;
  opacity: 0.7;
}
.fixture-panel .secondary {
  border-color: #ffffff44;
}
.button-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 22px 0;
}
.muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0 0;
  font-size: 12px;
}
th {
  font: 9px monospace;
  color: var(--muted);
  text-align: left;
  padding: 10px 8px;
}
td {
  border-top: 1px solid var(--line);
  padding: 15px 8px;
}
tr.our-club {
  background: #e8ecdc;
  font-weight: bold;
}
.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
  font-size: 12px;
}
.player-row label {
  flex-direction: row;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
}
.player-row input {
  accent-color: var(--ink);
  width: 17px;
  height: 17px;
}
.player-row .rating {
  font: bold 14px monospace;
  color: var(--orange);
}
.player-row .position {
  font: 9px monospace;
  color: var(--muted);
  width: 25px;
}
.player-row .player-name {
  flex: 1;
}
.player-row button {
  font-size: 11px;
  padding: 7px 10px;
}
.results {
  font-size: 12px;
}
.results p {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  box-shadow: 0 3px 20px #0003;
  padding: 16px 24px;
  border-radius: 5px;
  z-index: 10;
  font-size: 13px;
  max-width: 90vw;
}
dialog {
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  padding: 35px;
  max-width: 420px;
  width: 90%;
}
dialog::backdrop {
  background: #12352bd1;
}
dialog h2 {
  font-size: 36px;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
dialog label {
  margin: 25px 0;
}
.dialog-close {
  float: right;
  border: 0;
  padding: 0;
  font-size: 24px;
}
#watch-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  background: #e7e8dc;
}
#watch-controls label {
  max-width: 200px;
}
#watch-controls p {
  font-size: 12px;
  color: var(--muted);
}
@media (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}
@media (max-width: 760px) {
  .masthead {
    padding: 16px 20px;
    gap: 10px;
  }
  .header-note {
    display: none;
  }
  .icon-button {
    margin-left: auto;
  }
  .edition {
    font-size: 8px;
    margin-left: 5px;
  }
  .brand {
    font-size: 25px;
  }
  main {
    padding: 0 18px;
  }
  .intro {
    padding: 35px 0 26px;
  }
  .intro h1 {
    font-size: 58px;
  }
  .season-stamp {
    margin-right: 6px;
    width: 100px;
    height: 100px;
    padding: 17px 10px;
    font-size: 9px;
  }
  .season-stamp strong {
    font-size: 22px;
  }
  .season-stamp span {
    font-size: 6px;
  }
  .lead {
    font-size: 13px;
  }
  .home-grid,
  .career-grid {
    grid-template-columns: 1fr;
  }
  .controls-strip {
    flex-wrap: wrap;
    gap: 22px;
    justify-content: flex-start;
  }
  .controls-strip > .eyebrow {
    width: 100%;
  }
  .controls-strip .touch-tip {
    margin-left: auto;
  }
  .card-top {
    padding: 16px 20px;
  }
  .card-body {
    padding: 22px;
  }
  .mini-pitch,
  .tactics-art {
    height: 210px;
  }
  footer {
    padding: 0 18px 25px;
    flex-wrap: wrap;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  .scoreboard {
    padding: 16px 8px;
  }
  .scoreboard strong {
    font-size: 13px;
  }
  .team-dot {
    margin: 0 5px;
  }
  .score {
    font-size: 26px !important;
  }
  .scoreboard small {
    font-size: 7px;
  }
  .match-status > span:last-child {
    display: none;
  }
  .section-heading > .eyebrow {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .match-tools button {
    font-size: 11px;
    padding: 8px;
  }
  .touch-controls {
    display: flex;
  }
  .match-help {
    font-size: 10px;
  }
  .career-heading {
    align-items: flex-start;
  }
  .career-heading h1 {
    font-size: 36px;
  }
  .budget {
    padding: 14px 12px;
    min-width: 100px;
  }
  .budget span {
    font-size: 7px;
  }
  .budget strong {
    font-size: 23px;
  }
  .panel {
    padding: 20px;
  }
  .match-overlay h2 {
    font-size: 32px;
  }
  .match-overlay p {
    margin: 4px 0 12px;
    font-size: 12px;
  }
  .match-overlay .eyebrow {
    font-size: 9px;
  }
  .button-row button {
    font-size: 12px;
  }
  .career-heading .lead {
    font-size: 11px;
  }
}
@media (max-width: 390px) {
  .season-stamp {
    display: none;
  }
  .team-pickers {
    gap: 8px;
  }
  .team-pickers select {
    font-size: 12px;
  }
  .tag {
    font-size: 8px;
  }
  .touch-controls {
    padding: 15px 0;
  }
  .career-heading {
    flex-wrap: wrap;
  }
  .scoreboard strong {
    font-size: 11px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  #match-screen .stadium {
    max-width: 650px;
    margin: auto;
  }
  #match-screen canvas {
    max-height: 65vh;
    object-fit: contain;
  }
  .touch-controls {
    position: fixed;
    bottom: 10px;
    left: 8px;
    right: 8px;
    padding: 0;
    pointer-events: none;
    z-index: 2;
  }
  .touch-controls > * {
    pointer-events: auto;
  }
  .match-help,
  .match-status {
    display: none;
  }
}
.player-row .skills {
  display: block;
  margin-top: 3px;
  font: 9px monospace;
  color: var(--muted);
}
