:root {
  font-family: Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color: #183443;
  background: #f5f7f6;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  border: 1px solid #d9e2df;
  background: white;
  border-radius: 8px;
  color: #24404d;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s,box-shadow .15s;
}
button:hover {
  background: #edf5f1;
}
button:disabled {
  opacity: .4;
  cursor: default;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #37b98f;
  outline-offset: 3px;
}
select,
input {
  border: 1px solid #d9e2df;
  border-radius: 8px;
  padding: 10px;
  background: white;
  color: #183443;
  min-width: 0;
}
header {
  height: 78px;
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e0e7e4;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #102c3a;
  font-weight: 750;
  font-size: 25px;
  letter-spacing: -1px;
}
.brand-icon {
  background: #102c3a;
  color: #a2f0d3;
  border-radius: 10px;
  font-size: 33px;
  width: 40px;
  height: 40px;
  text-align: center;
  line-height: 34px;
}
.beta {
  font-size: 9px;
  letter-spacing: 1px;
  background: #e5f5ee;
  padding: 5px 7px;
  border-radius: 5px;
  margin-left: 4px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
#save-status {
  font-size: 12px;
  color: #657b74;
}
.subtle {
  background: #102c3a;
  color: white;
  border-color: #102c3a;
}
.subtle:hover {
  background: #284d5b;
}
main {
  max-width: 1320px;
  margin: auto;
  padding: 36px 38px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 2px;
  color: #53786b;
  margin: 0 0 10px;
}
h1 {
  font-size: 34px;
  letter-spacing: -1.3px;
  margin: 0 0 9px;
  line-height: 1.2;
}
.muted {
  font-size: 14px;
  color: #74847d;
  margin: 0;
}
.workspace {
  display: grid;
  grid-template-columns: 285px minmax(0,1fr);
  gap: 28px;
  align-items: start;
}
.sidebar {
  background: white;
  border: 1px solid #e0e7e4;
  border-radius: 14px;
  padding: 20px;
  position: sticky;
  top: 18px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 750;
  color: #6b8075;
}
.section-title button {
  padding: 3px 8px;
  font-size: 20px;
  border: 0;
}
.sidebar > select {
  width: 100%;
  margin-top: 10px;
  font-weight: 650;
}
.small-actions {
  display: flex;
  gap: 12px;
  margin: 8px 0 25px;
}
.small-actions button {
  border: 0;
  padding: 2px 0;
  color: #77887e;
  font-size: 11px;
}
.roster-heading,
.bench-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
h2 {
  font-size: 15px;
  margin: 0;
}
h2 span {
  color: #87968e;
  font-size: 12px;
  margin-left: 5px;
  font-weight: 500;
}
.primary {
  background: #a2efcf;
  border-color: #a2efcf;
  color: #123d31;
}
.primary:hover {
  background: #86dfb9;
}
.small {
  font-size: 11px;
  padding: 7px 10px;
}
.hint {
  font-size: 11px;
  color: #7a8c82;
  line-height: 1.6;
}
.roster-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f3f1;
}
.roster-number {
  display: grid;
  place-items: center;
  background: #eef4f0;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  width: 30px;
  height: 30px;
}
.roster-name {
  flex: 1;
  font-size: 12px;
  font-weight: 550;
  cursor: grab;
  touch-action: none;
}
.roster-row .state {
  font-size: 9px;
  color: #5e8d73;
}
.roster-row button {
  padding: 4px 6px;
  border: 0;
  color: #8a9990;
}
.sidebar-footer {
  margin-top: 24px;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #6b8075;
}
.sidebar-footer span {
  display: block;
  font-size: 9px;
  letter-spacing: 0;
  margin-top: 5px;
  color: #9aa69f;
}
.board {
  background: white;
  border: 1px solid #e0e7e4;
  padding: 20px 26px 14px;
  border-radius: 14px;
  min-width: 0;
}
.board-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid #edf0ee;
  padding-bottom: 17px;
}
.board-toolbar > div:first-child {
  flex: 1;
}
.board-toolbar label {
  display: block;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #7c8d83;
  font-weight: 700;
  margin-bottom: 7px;
}
.lineup-controls {
  display: flex;
  gap: 5px;
}
.lineup-controls select {
  width: 100%;
  font-weight: 600;
}
.board-toolbar button {
  padding: 10px;
}
.pitch-heading {
  display: flex;
  justify-content: space-between;
  padding: 18px 0 12px;
  font-size: 12px;
  font-weight: 600;
}
#field-count {
  font-size: 10px;
  color: #6f8779;
}
#pitch {
  position: relative;
  aspect-ratio: 680/850;
  max-width: 650px;
  margin: auto;
  background: repeating-linear-gradient(0deg,#347459 0%,#347459 10%,#397b60
    10%,#397b60 20%);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: inset 0 0 70px #173e4020;
  touch-action: manipulation;
}
.pitch-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #c7e8d880;
  stroke-width: 2;
}
.pitch-lines .dot {
  fill: #c7e8d8;
  stroke: none;
}
.pitch-watermark {
  position: absolute;
  bottom: 5.3%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 4px;
  color: #d5f5df35;
  pointer-events: none;
}
.player {
  position: absolute;
  width: 88px;
  transform: translate(-50%,-50%);
  display: flex;
  align-items: center;
  flex-direction: column;
  background: none;
  border: 0;
  padding: 0;
  touch-action: none;
  user-select: none;
  z-index: 2;
  transition: left .23s ease,top .23s ease,filter .15s;
  cursor: grab;
}
.player:hover {
  background: none;
  filter: brightness(1.12);
}
.shirt {
  display: grid;
  place-items: center;
  width: 45px;
  height: 43px;
  background: #b5f4d8;
  clip-path: polygon(25% 0,40% 0,43% 8%,57% 8%,60% 0,75% 0,100% 22%,85% 42%,76%
    35%,76% 100%,24% 100%,24% 35%,15% 42%,0 22%);
  color: #153e35;
  font-size: 17px;
  font-weight: 800;
  filter: drop-shadow(0 3px 3px #0003);
}
.player.goalkeeper .shirt {
  background: #f7d88f;
  color: #5f4824;
}
.player-name {
  display: block;
  background: #153c35e6;
  color: #fff;
  font-size: 10px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 4px;
  padding: 4px 7px;
  margin-top: 5px;
  box-shadow: 0 2px 5px #0001;
}
.player.selected .player-name {
  background: #fff;
  color: #153e35;
  outline: 2px solid #a2efcf;
}
.drag-ghost {
  position: fixed!important;
  pointer-events: none!important;
  z-index: 1000!important;
  transition: none!important;
  filter: drop-shadow(0 10px 10px #001a273b);
  transform: translate(-50%,-65%) scale(1.12)!important;
}
.drag-source {
  opacity: .3;
}
.drop-active {
  outline: 3px solid #a2efcf;
  outline-offset: 3px;
}
.bench-title {
  margin: 20px 0 10px;
}
#bench {
  min-height: 104px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 2px;
  padding: 18px 5px;
  background: #f5f8f6;
  border: 1px dashed #d3dfd8;
  border-radius: 9px;
  align-items: start;
  justify-content: center;
}
#bench .player {
  position: relative;
  transform: none;
  left: auto!important;
  top: auto!important;
  width: 82px;
}
#bench .shirt {
  background: #dce9e2;
  color: #476457;
  width: 37px;
  height: 35px;
  font-size: 14px;
}
#bench .player-name {
  background: none;
  color: #526a5b;
  box-shadow: none;
  padding: 0;
  font-size: 9px;
  max-width: 80px;
}
#bench .selected .player-name {
  outline: 2px solid #78c5a5;
}
.board-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  font-size: 9px;
  color: #8a9a90;
}
.board-footer > span:first-child {
  letter-spacing: 1px;
  font-weight: 700;
  color: #5e806b;
}
dialog {
  border: 1px solid #dee7e0;
  border-radius: 16px;
  padding: 26px;
  width: min(440px,92vw);
  box-shadow: 0 20px 100px #102c3a33;
}
dialog::backdrop {
  background: #102c3a77;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dialog-heading h2 {
  font-size: 21px;
}
.dialog-heading button {
  border: 0;
  padding: 0 6px;
  font-size: 24px;
}
dialog label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 14px 0 7px;
}
dialog input {
  width: 100%;
}
dialog p {
  font-size: 13px;
  color: #6d8175;
  line-height: 1.6;
}
#dialog-error {
  color: #ad3c3c;
}
#dialog-submit {
  width: 100%;
  margin-top: 12px;
}
dialog .danger {
  color: #ad3c3c;
  margin-top: 12px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #102c3a;
  color: white;
  border-radius: 9px;
  padding: 13px 20px;
  font-size: 13px;
  box-shadow: 0 4px 20px #0002;
  z-index: 2000;
  display: none;
  max-width: 90vw;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
body.present .sidebar,
body.present .intro,
body.present .board-toolbar,
body.present header {
  display: none;
}
body.present .workspace {
  display: block;
}
body.present main {
  max-width: 850px;
  padding-top: 12px;
}
#exit-present {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 20;
}
.empty {
  font-size: 12px;
  text-align: center;
  color: #819289;
  padding: 12px;
}
.conflict-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}
@media (min-width:1250px) {
  #pitch {
    aspect-ratio: 680/790;
  }
}
@media (max-width:900px) {
  main {
    padding: 24px 16px;
  }
  .workspace {
    grid-template-columns: 220px minmax(0,1fr);
    gap: 14px;
  }
  .sidebar {
    padding: 14px;
  }
  .board {
    padding: 16px;
  }
  .board-toolbar {
    flex-wrap: wrap;
  }
  .board-toolbar > div:first-child {
    min-width: 140px;
  }
  .player {
    width: 72px;
  }
  .shirt {
    width: 36px;
    height: 35px;
    font-size: 14px;
  }
  .player-name {
    font-size: 9px;
    padding: 3px 5px;
    max-width: 77px;
  }
  .intro h1 {
    font-size: 28px;
  }
}
@media (max-width:650px) {
  header {
    height: 65px;
    padding: 0 16px;
  }
  .brand {
    font-size: 21px;
  }
  .brand-icon {
    width: 33px;
    height: 33px;
    font-size: 28px;
    line-height: 29px;
  }
  .header-right {
    gap: 7px;
  }
  #save-status {
    max-width: 90px;
    font-size: 9px;
  }
  .header-right button {
    font-size: 10px;
    padding: 8px;
  }
  .beta {
    display: none;
  }
  .intro {
    align-items: start;
    gap: 10px;
    margin-bottom: 20px;
  }
  .intro h1 {
    font-size: 25px;
  }
  .intro p.muted {
    font-size: 12px;
    line-height: 1.6;
  }
  .intro > button {
    font-size: 10px;
    padding: 9px;
    min-width: 85px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 15px;
  }
  .sidebar .small-actions {
    margin-bottom: 15px;
  }
  .sidebar #roster {
    max-height: 190px;
    overflow: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
  .sidebar-footer {
    display: none;
  }
  .roster-heading {
    margin-top: 10px;
  }
  .board {
    width: 100%;
    padding: 13px;
  }
  .board-toolbar {
    gap: 7px;
  }
  .board-toolbar button {
    font-size: 11px;
    padding: 10px 8px;
  }
  .board-toolbar select {
    font-size: 12px;
    padding: 9px 6px;
  }
  .player {
    width: 65px;
  }
  .shirt {
    width: 32px;
    height: 31px;
    font-size: 12px;
  }
  .player-name {
    font-size: 8px;
    max-width: 67px;
    padding: 3px 4px;
  }
  .board-footer {
    font-size: 8px;
  }
  .bench-title .hint {
    font-size: 9px;
  }
  h2 {
    font-size: 13px;
  }
  #bench {
    gap: 12px 0;
  }
  #bench .player {
    width: 67px;
  }
  #bench .player-name {
    max-width: 65px;
    font-size: 8px;
  }
}
@media (prefers-reduced-motion:reduce) {
  * {
    transition: none!important;
  }
}
@media print {
  header,
  .intro,
  .sidebar,
  .board-toolbar,
  #exit-present,
  #toast,
  dialog {
    display: none!important;
  }
  main {
    padding: 0;
    max-width: 700px;
  }
  .workspace {
    display: block;
  }
  .board {
    border: 0;
    padding: 0;
  }
  #pitch {
    max-height: 70vh;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .player-name,
  .shirt,
  #bench {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body {
    background: white;
  }
  .board-footer {
    display: none;
  }
}

body.present #pitch {
  width: min(100%,calc((100dvh - 215px)*.8));
  aspect-ratio: 680/850;
}
body.present .bench-title {
  margin-top: 12px;
}
body.present #bench {
  padding: 10px 5px;
  min-height: 75px;
}
body.present .board-footer {
  display: none;
}
body.present .player {
  width: 74px;
}
body.present .shirt {
  width: 32px;
  height: 31px;
  font-size: 12px;
}
body.present .player-name {
  font-size: 8px;
  padding: 3px 4px;
  max-width: 76px;
}
@media (max-width:650px) {
  body.present #pitch {
    width: 100%;
    aspect-ratio: 680/850;
  }
  body.present main {
    padding-top: 60px;
  }
}

@media (max-width:650px) {
  .player-name {
    font-size: 9px;
  }
  #bench .player-name {
    font-size: 9px;
  }
  .roster-name {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  #resolve-conflict {
    font-size: 9px;
    padding: 6px;
  }
}
