:root {
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7fafc;
  color: #17243b;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[hidden] {
  display: none !important;
}

.site-head {
  flex-wrap: wrap;
  gap: 1rem;
}

.site-head,
.hero,
.mc,
body > footer {
  min-width: 0;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 32px);
}

.site-head .brand,
.site-head nav,
body > footer nav {
  min-width: 0;
}

.site-head nav,
body > footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.site-head .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.site-head .brand img {
  width: 32px;
  height: 32px;
}

.hero {
  padding-block: 1.8rem 1rem;
}

.hero .eyebrow {
  color: #576b86;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0.4rem 0 0.8rem;
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1.05;
}

.hero .lede {
  max-width: 720px;
  color: #465a75;
  font-size: 1.08rem;
  line-height: 1.65;
}

.mc {
  padding-bottom: 3rem;
}

.mc-picker {
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid #dce4ef;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 36px #17243b08;
}

.mc-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.mc fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mc legend {
  padding: 0 0 0.7rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.mc-seats {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.8rem;
  padding: 0;
  list-style: none;
}

.mc-seat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 0.45rem;
  min-width: 0;
  padding-left: 0.45rem;
  border-left: 4px solid var(--seat-color, #ffd84d);
}

.mc select,
.mc button {
  font: inherit;
}

.mc select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cad6e5;
  border-radius: 9px;
  background: #ffffff;
  color: #17243b;
  text-overflow: ellipsis;
}

.mc .button,
.mc-remove {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid #285bd7;
  border-radius: 10px;
  background: #285bd7;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.mc .button.secondary {
  border-color: #cad6e5;
  background: #f4f7fc;
  color: #233d65;
}

.mc-remove {
  padding: 0;
  border-color: #dce4ef;
  background: #f4f7fc;
  color: #4b5e77;
  font-size: 1.4rem;
}

.mc button:hover:not(:disabled) {
  filter: brightness(0.94);
}

.mc button:disabled,
.mc select:disabled {
  cursor: default;
  opacity: 0.55;
}

.mc :is(button, select, a):focus-visible,
.site-head a:focus-visible,
body > footer a:focus-visible {
  outline: 3px solid #d47b13;
  outline-offset: 3px;
}

.mc-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
}

.mc-options label {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.mc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.mc-help {
  margin: 0.85rem 0 0;
  color: #52647b;
  font-size: 0.82rem;
  line-height: 1.5;
}

.mc-telemetry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-block: 1.1rem 0.7rem;
  color: #334d72;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.035em;
}

.mc-telemetry > span {
  padding: 0.45rem 0.7rem;
  border: 1px solid #d4dfed;
  border-radius: 8px;
  background: #ffffff;
}

#mc-fright {
  border-color: #babfff;
  background: #eeedff;
  color: #303a9b;
}

.mc-stage {
  display: grid;
  grid-template-columns: minmax(0, 756px) minmax(230px, 1fr);
  gap: 1rem;
  align-items: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid #34496c;
  border-radius: 18px;
  background: linear-gradient(145deg, #101c32, #0b1222 65%);
  color: #f4f6fb;
  box-shadow: 0 18px 45px #152b4920, inset 0 1px 0 #698ac038;
}

.mc-board {
  min-width: 0;
}

#mc-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid #2d4770;
  border-radius: 10px;
  background: #081120;
}

.mc-side-panel {
  min-width: 0;
  padding: 0.35rem;
}

.mc-tally {
  margin: 0 0 0.8rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #2b3e5c;
  color: #d0ddf2;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
}

#mc-cards {
  display: grid;
  gap: 0.5rem;
}

.mc-card {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #30415e;
  border-left: 4px solid var(--seat-color, #ffd84d);
  border-radius: 9px;
  background: #162239;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.mc-card b {
  font-size: 0.94rem;
  line-height: 1.3;
}

.mc-card small {
  color: #c5d3e9;
  line-height: 1.5;
}

.mc-score {
  color: #ffffff;
  font-weight: 750;
}

.mc-badge {
  color: var(--seat-color, #ffd84d);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.mc-out {
  opacity: 0.65;
}

.mc-ticker,
.mc-result {
  margin: 0.9rem 0 0;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.mc-ticker {
  min-height: 3em;
  padding: 0.65rem 0.7rem;
  border-left: 2px solid #6d94ff;
  background: #102039;
  color: #d6e5ff;
  font-size: 0.88rem;
}

.mc-result {
  padding: 0.85rem;
  border: 1px solid #8c783f;
  border-radius: 10px;
  background: #302c1d;
  color: #ffe8b0;
  font-weight: 750;
}

#mc-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(56px, 64px));
  grid-template-rows: repeat(2, 56px);
  justify-content: center;
  gap: 8px;
  margin: 14px auto 4px;
  touch-action: manipulation;
}

#mc-pad button {
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: 1px solid #6f8cbe;
  border-radius: 12px;
  background: #1e3455;
  color: #ffffff;
  font-size: 1.6rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

#mc-pad button:active:not(:disabled) {
  border-color: #ffe28a;
  background: #355486;
}

#mc-pad [data-dir='up'] {
  grid-column: 2;
}

#mc-pad [data-dir='left'] {
  grid-column: 1;
  grid-row: 2;
}

#mc-pad [data-dir='down'] {
  grid-column: 2;
  grid-row: 2;
}

#mc-pad [data-dir='right'] {
  grid-column: 3;
  grid-row: 2;
}

.mc-note {
  margin: 1.2rem 0 2rem;
  max-width: 95ch;
  color: #465b76;
  font-size: 0.9rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.mc a {
  color: #2459cb;
}

.mc-roster h2 {
  margin-bottom: 0.5rem;
}

.mc-roster > p {
  color: #52647b;
  line-height: 1.6;
}

#mc-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

#mc-list li {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid #dce4ef;
  border-top: 4px solid var(--bot-color, #9fb3d1);
  border-radius: 12px;
  background: #ffffff;
  overflow-wrap: anywhere;
}

#mc-list small {
  color: #52647b;
  line-height: 1.55;
}

body > footer {
  padding-block: 1.5rem 2rem;
  border-top: 1px solid #dce4ef;
  overflow-wrap: anywhere;
}

@media (max-width: 850px) {
  .mc-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  #mc-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mc-ticker {
    min-height: 0;
  }

  #mc-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 1.2rem;
  }

  .hero .lede {
    font-size: 1rem;
    line-height: 1.5;
  }

  .mc-teams {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .mc-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .mc-options label {
    font-size: 0.8rem;
  }

  .mc-options select {
    padding-inline: 0.3rem;
    font-size: 0.85rem;
  }

  .mc-stage {
    padding: 6px;
    border-radius: 12px;
  }

  .mc-card {
    padding: 0.6rem;
  }

  .mc-telemetry {
    font-size: 0.72rem;
    letter-spacing: 0;
  }

  .mc-telemetry > span {
    padding: 0.4rem 0.5rem;
  }

  .site-head .brand {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

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