@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=DM+Sans:wght@400;500;600;650;700&display=swap");

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #686868;
  --line: #dddddd;
  --mint: #eeeeee;
  --accent: #111111;
  --dark: #111111;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
canvas {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
button,
a,
input,
select,
canvas {
  outline-offset: 4px;
}
:focus-visible {
  outline: 3px solid #6f6f6f;
}
[hidden] {
  display: none !important;
}
.sm-app {
  max-width: 1720px;
  margin: 0 auto;
  padding: 0 52px;
}
.sm-header {
  height: 105px;
  display: flex;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}
.sm-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -1.7px;
}
.sm-brand svg {
  width: 32px;
  height: 38px;
  stroke: var(--ink);
  stroke-width: 2.8;
  fill: none;
  stroke-linecap: round;
}
.sm-brand-dot {
  color: var(--accent);
}
.sm-header-tag {
  font-size: 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 27px;
}
.sm-header-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}
.sm-connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.sm-connection i {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #a0a0a0;
}
.sm-connection.is-online i {
  background: #6d6d6d;
  box-shadow: 0 0 0 3px #6d6d6d19;
}
.sm-button {
  border: 1px solid transparent;
  padding: 12px 17px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  transition:
    background 0.15s,
    transform 0.15s,
    border-color 0.15s;
}
.sm-button:not(:disabled):active {
  transform: translateY(1px);
}
.sm-button-primary {
  color: white;
  background: var(--ink);
}
.sm-button-primary:hover:not(:disabled) {
  background: #434343;
}
.sm-button-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.sm-button-secondary:hover:not(:disabled) {
  background: #e7e7e7;
  border-color: #c0c0c0;
}
.sm-button-quiet {
  color: var(--ink);
  background: transparent;
  padding: 8px 0;
}
.sm-button-quiet:hover:not(:disabled) {
  color: #636363;
}
.sm-main {
  display: grid;
  grid-template-columns: minmax(315px, 0.8fr) minmax(0, 1.44fr);
  gap: 62px;
  padding: 54px 0 46px;
  align-items: start;
}
.sm-eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  font-weight: 700;
}
.sm-small-cross {
  font-size: 20px;
  color: var(--accent);
  vertical-align: -2px;
  margin-right: 8px;
}
.sm-intro h1 {
  font-family: "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  font-weight: 700;
  font-size: clamp(50px, 5.1vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.9px;
  margin: 20px 0;
}
.sm-intro h1 > span {
  color: #696969;
}
.sm-intro-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
  margin: 20px 0 28px;
}
.sm-profile {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}
.sm-profile label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
}
.sm-profile input,
.sm-profile select {
  min-width: 0;
  width: 100%;
  border: 1px solid #d0d0d0;
  color: var(--ink);
  background: transparent;
  height: 42px;
  border-radius: 4px;
  padding: 0 12px;
  font-size: 12px;
}
.sm-profile input::placeholder {
  color: #8f8f8f;
}
.sm-loadout-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 12px;
}
.sm-loadout-heading h2,
.sm-panel-heading h2 {
  font-size: 12px;
  margin: 0;
}
.sm-loadout-heading > span {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.sm-weapons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.sm-weapon {
  position: relative;
  background: transparent;
  border: 1px solid #d6d6d6;
  border-radius: 5px;
  padding: 10px 8px 12px;
  color: var(--ink);
  min-width: 0;
  text-align: left;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.sm-weapon:hover {
  background: #e8e8e8;
  border-color: #9f9f9f;
}
.sm-weapon[aria-pressed="true"] {
  background: #e6e6e6;
  border-color: #767676;
  box-shadow: inset 0 0 0 0.5px #767676;
}
.sm-weapon svg {
  width: 47px;
  height: 46px;
  display: block;
  margin: 0 0 5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sm-weapon-number {
  position: absolute;
  top: 9px;
  right: 9px;
  font-size: 9px;
  color: #8c8c8c;
}
.sm-weapon[aria-pressed="true"] .sm-weapon-number {
  color: #616161;
  font-weight: 700;
}
.sm-weapon-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.sm-weapon small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
  color: var(--muted);
}
.sm-selection-help {
  min-height: 14px;
  font-size: 9px;
  color: var(--muted);
  margin: 11px 0 17px;
}
.sm-enter,
.sm-training-entry {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 49px;
  padding: 0 18px;
  font-size: 13px;
}
.sm-enter {
  background: var(--accent);
  color: #ffffff;
  border-color: #747474;
}
.sm-enter:hover:not(:disabled) {
  background: #767676;
}
.sm-enter > span {
  font-size: 22px;
  font-weight: 400;
}
.sm-training-entry {
  margin-top: 9px;
  height: 41px;
  font-size: 11px;
}
.sm-entry-note {
  color: var(--muted);
  font-size: 9px;
  margin-top: 14px;
  text-align: center;
}
.sm-play-column {
  min-width: 0;
}
.sm-stage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  height: 36px;
}
.sm-stage-toolbar > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.sm-stage-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6b6b6b;
}
.sm-stage-map {
  color: var(--muted);
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.sm-stage-tools [data-tick] {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.sm-icon-button {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 2px 7px;
  min-width: 28px;
  min-height: 28px;
  font-size: 22px;
  line-height: 1;
}
.sm-icon-button:hover {
  background: #9b9b9b22;
  border-radius: 4px;
}
.sm-canvas-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  aspect-ratio: 1.5;
  box-shadow: 0 10px 28px #26262612;
}
.sm-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.sm-canvas:focus-visible {
  outline-offset: -5px;
  outline-color: #111111;
}
.sm-canvas-wrap:fullscreen {
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}
.sm-preview-label {
  position: absolute;
  left: 28px;
  top: 28px;
  pointer-events: none;
  color: #111111;
}
.sm-preview-label > span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #555555;
}
.sm-preview-label > p {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(23px, 2.2vw, 36px);
  margin: 9px 0 7px;
  font-weight: 600;
}
.sm-preview-label > small {
  color: #666666;
  font-size: 9px;
}
.sm-focus-hint {
  position: absolute;
  inset: 0;
  background: #ffffffd9;
  color: #111111;
  display: grid;
  place-items: center;
  font-size: 14px;
  text-align: center;
  padding: 30px;
  pointer-events: none;
}
.sm-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  border-bottom: 1px solid var(--line);
}
.sm-notice-icon {
  color: #646464;
  font-size: 15px;
}
.sm-principles {
  display: grid;
  gap: 21px;
  padding: 26px 0;
}
.sm-principles article {
  display: flex;
  align-items: baseline;
  gap: 15px;
}
.sm-principles article > span {
  color: #828282;
  font-size: 9px;
  font-weight: 700;
}
.sm-principles h3 {
  margin: 0 0 5px;
  font-size: 12px;
}
.sm-principles p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}
.sm-future {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 17px 0 0;
}
.sm-future > span {
  font-size: 9px;
  color: var(--muted);
  margin-right: auto;
}
.sm-future button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 9px;
  border-radius: 4px;
  padding: 8px;
  opacity: 0.7;
}
.sm-future small {
  font-size: 8px;
  color: var(--muted);
  margin-left: 6px;
}
.sm-footer {
  min-height: 67px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  gap: 20px;
  font-size: 9px;
}
.sm-footer > span:first-child {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1px;
}
.sm-footer > span:first-child span {
  margin: 0 10px;
  color: #b1b1b1;
}
.sm-footer button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  padding: 10px;
}
.sm-footer button > span {
  margin-left: 10px;
}

/* The playing layout gives the stage the full width, keeping the own HUD nearby. */
.sm-playing .sm-main {
  display: block;
  padding-top: 22px;
}
.sm-playing .sm-intro,
.sm-playing .sm-principles,
.sm-playing .sm-future {
  display: none;
}
.sm-playing .sm-canvas-wrap {
  aspect-ratio: 2.5;
  max-height: 66vh;
  min-height: 330px;
}
.sm-hud {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 23px;
  color: #111111;
  background: #f5f5f5;
  border-radius: 6px;
  margin: 15px 0;
  border: 1px solid var(--line);
  border-left: 4px solid #f2c500;
}
.sm-hud-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 130px;
}
.sm-player-symbol {
  font-size: 23px;
  display: inline-block;
  width: 31px;
  text-align: center;
  flex-shrink: 0;
}
.sm-hud-identity > div {
  display: grid;
  gap: 3px;
}
.sm-hud-identity small {
  letter-spacing: 2px;
  font-size: 8px;
  color: #555555;
}
.sm-hud-identity strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.sm-hud-identity [data-local-weapon] {
  font-size: 10px;
  color: #666666;
}
.sm-damage {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 49px;
  line-height: 1;
  min-width: 90px;
  font-variant-numeric: tabular-nums;
}
.sm-damage small {
  font-size: 22px;
  margin-left: 2px;
}
.sm-resources {
  display: grid;
  gap: 5px;
  font-size: 9px;
  min-width: 160px;
  color: #555555;
}
.sm-resources progress {
  appearance: none;
  width: 100%;
  height: 3px;
  border: 0;
  background: #dddddd;
}
.sm-resources progress::-webkit-progress-bar {
  background: #dddddd;
}
.sm-resources progress::-webkit-progress-value {
  background: #111111;
}
.sm-resources progress::-moz-progress-bar {
  background: #111111;
}
.sm-resources .is-warning {
  color: #b5b5b5;
}
.sm-score {
  display: grid;
  grid-template-columns: auto auto;
  gap: 3px 7px;
  margin-left: auto;
  align-items: baseline;
  text-align: right;
}
.sm-score strong {
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}
.sm-score > span {
  font-size: 9px;
  color: #555555;
}
.sm-score small {
  grid-column: 1 / -1;
  font-size: 9px;
  color: #666666;
}
.sm-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.sm-panel-heading > span {
  color: var(--muted);
  font-size: 10px;
}
.sm-training-panel,
.sm-participants {
  margin-top: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.sm-training-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.sm-training-controls > label {
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sm-training-controls input[type="number"] {
  width: 65px;
}
.sm-training-controls input[type="number"],
.sm-training-controls select {
  border: 1px solid #cdcdcd;
  padding: 7px 5px;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
}
.sm-frame-analysis {
  color: #5c5c5c;
  font-size: 11px;
  padding: 10px 13px;
  border-radius: 4px;
  margin: 15px 0 0;
  background: #e5e5e5;
}
.sm-player-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 15px;
}
.sm-player-row {
  border: 1px solid var(--line);
  background: #ededed;
  border-radius: 5px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sm-player-row.is-local {
  border-color: #f2c500;
  box-shadow: inset 3px 0 #f2c500;
}
.sm-player-row .sm-player-symbol {
  font-size: 17px;
  width: 22px;
  text-shadow: 0 1px 3px #00000000;
}
.sm-player-info {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.sm-player-info strong {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-player-info small {
  font-size: 9px;
  color: var(--muted);
}
.sm-row-damage {
  font-size: 13px;
  font-weight: 700;
  background: #ffffff;
  border-radius: 4px;
  padding: 5px 8px;
  min-width: 56px;
  text-align: center;
}
.sm-row-score {
  font-size: 11px;
  font-weight: 600;
  min-width: 28px;
}
.sm-challenge {
  color: var(--ink);
  background: transparent;
  border: 1px solid #c2c2c2;
  font-size: 9px;
  border-radius: 3px;
  padding: 6px;
}
.sm-casual-note {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 0;
}

.sm-settings {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #cccccc;
  border-radius: 10px;
  width: min(660px, calc(100vw - 28px));
  max-height: calc(100dvh - 36px);
  padding: 26px;
  box-shadow: 0 28px 110px #00000033;
}
.sm-settings::backdrop {
  background: #00000088;
  backdrop-filter: blur(3px);
}
.sm-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sm-dialog-heading h2 {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 38px;
  margin: 5px 0 0;
}
.sm-dialog-heading .sm-eyebrow {
  color: #767676;
  font-size: 9px;
}
.sm-settings-description {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  max-width: 470px;
}
.sm-settings-scroll {
  max-height: calc(100dvh - 280px);
  overflow-y: auto;
  padding-right: 9px;
  scrollbar-width: thin;
}
.sm-settings h3 {
  font-size: 13px;
  margin: 22px 0 12px;
}
.sm-settings section p {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.sm-binding,
.sm-binding-heading {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.sm-binding-heading {
  font-size: 9px;
  color: #7d7d7d;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.sm-binding > span {
  font-size: 11px;
}
.sm-binding-key {
  border: 1px solid #cdcdcd;
  color: var(--ink);
  background: #ececec;
  border-radius: 4px;
  font-size: 11px;
  min-height: 31px;
  padding: 6px;
}
.sm-binding-key:hover {
  background: #e0e0e0;
}
.sm-binding-key.is-capturing {
  color: #565656;
  background: #e1e1e1;
  border-color: #848484;
}
.sm-range {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 15px 0;
  font-size: 11px;
}
.sm-range input {
  flex: 1;
  min-width: 30px;
  accent-color: #656565;
}
.sm-range output {
  min-width: 34px;
  text-align: right;
  font-size: 10px;
  color: var(--muted);
}
.sm-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  margin: 11px 0;
}
.sm-check input {
  accent-color: #656565;
  width: 15px;
  height: 15px;
  margin: 0;
}
.sm-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.sm-dialog-footer > span {
  color: var(--muted);
  font-size: 9px;
}

@media (min-width: 1500px) {
  .sm-main {
    gap: 88px;
  }
  .sm-intro {
    max-width: 470px;
  }
  .sm-canvas-wrap {
    aspect-ratio: 1.65;
  }
}
@media (max-width: 1150px) {
  .sm-app {
    padding: 0 30px;
  }
  .sm-main {
    gap: 30px;
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.2fr);
    padding-top: 37px;
  }
  .sm-intro h1 {
    font-size: 58px;
  }
  .sm-header-tag {
    display: none;
  }
  .sm-canvas-wrap {
    aspect-ratio: 1.2;
  }
  .sm-future > span {
    width: 100%;
  }
  .sm-preview-label {
    left: 21px;
    top: 22px;
  }
  .sm-preview-label > p {
    max-width: 210px;
  }
}
@media (max-width: 850px) {
  .sm-app {
    padding: 0 22px;
  }
  .sm-header {
    height: 81px;
  }
  .sm-main {
    gap: 24px;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr);
  }
  .sm-intro h1 {
    font-size: 51px;
  }
  .sm-intro-copy {
    font-size: 11px;
  }
  .sm-weapon-name {
    font-size: 10px;
  }
  .sm-header-actions {
    gap: 18px;
  }
  .sm-canvas-wrap {
    aspect-ratio: 0.85;
  }
  .sm-preview-label > p {
    font-size: 26px;
  }
  .sm-preview-label > small {
    display: block;
    max-width: 160px;
    line-height: 1.8;
  }
  .sm-stage-map {
    display: none;
  }
  .sm-player-list {
    grid-template-columns: 1fr;
  }
  .sm-hud {
    gap: 16px;
    padding: 16px;
  }
  .sm-hud-identity {
    min-width: 110px;
  }
  .sm-resources {
    min-width: 135px;
  }
  .sm-damage {
    font-size: 43px;
    min-width: 72px;
  }
  .sm-footer {
    flex-wrap: wrap;
    gap: 5px 20px;
    padding: 13px 0;
  }
  .sm-footer > span:last-child {
    display: none;
  }
}
@media (max-width: 660px) {
  .sm-app {
    padding: 0 18px;
  }
  .sm-header {
    gap: 10px;
  }
  .sm-brand {
    font-size: 27px;
  }
  .sm-brand svg {
    width: 27px;
  }
  .sm-header-actions {
    gap: 12px;
  }
  .sm-header-actions [data-settings] > span {
    display: none;
  }
  .sm-header-actions [data-settings] {
    font-size: 19px;
  }
  .sm-connection {
    font-size: 9px;
  }
  .sm-main {
    display: flex;
    flex-direction: column;
    padding: 28px 0;
    gap: 26px;
  }
  .sm-intro,
  .sm-play-column {
    width: 100%;
  }
  .sm-intro h1 {
    font-size: 64px;
  }
  .sm-intro-copy {
    font-size: 12px;
  }
  .sm-canvas-wrap {
    aspect-ratio: 1.5;
  }
  .sm-principles {
    gap: 17px;
  }
  .sm-future > span {
    width: auto;
  }
  .sm-preview-label > small {
    max-width: none;
  }
  .sm-playing .sm-canvas-wrap {
    aspect-ratio: 1.4;
    min-height: 270px;
    max-height: none;
  }
  .sm-hud {
    flex-wrap: wrap;
    gap: 14px;
  }
  .sm-hud-identity {
    flex: 1;
  }
  .sm-damage {
    text-align: right;
  }
  .sm-resources {
    width: 55%;
  }
  .sm-score {
    min-width: 100px;
  }
  .sm-settings {
    padding: 18px;
  }
  .sm-binding {
    gap: 7px;
  }
  .sm-binding > span {
    font-size: 10px;
  }
  .sm-binding-key {
    font-size: 10px;
  }
  .sm-dialog-footer > span {
    display: none;
  }
  .sm-dialog-footer {
    justify-content: flex-end;
  }
  .sm-footer > span:first-child {
    font-size: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* Team identity is relative to the current player, never a cosmetic color. */
.sm-mode-choice { display: grid; gap: 8px; margin-top: 15px; font-size: 10px; font-weight: 700; }
.sm-mode-choice select { width: 100%; height: 40px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.sm-team-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 0 0; color: var(--muted); font-size: 10px; }
.sm-team-legend span { border-bottom: 3px solid; padding-bottom: 4px; }
[data-relation="self"] { --relationship: #f2c500; }
[data-relation="teammate"] { --relationship: #2877e8; }
[data-relation="enemy"] { --relationship: #df3535; }
.sm-team-legend span { border-color: var(--relationship); }
.sm-player-row[data-relation] { border-left: 3px solid var(--relationship); }
.sm-player-row.is-local { box-shadow: none; }
.sm-team-score { margin-top: 14px; padding: 12px 15px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }


/* Minimal interface: the arena, one compact resource readout, optional tools. */
.sm-app { max-width: 1600px; padding: 0 24px; }
.sm-header { height: 56px; gap: 16px; border-bottom: 0; }
.sm-brand { font-size: 24px; }
.sm-brand svg { width: 25px; height: 30px; }
.sm-header-tag, .sm-footer, .sm-intro .sm-eyebrow, .sm-intro-copy,
.sm-principles, .sm-future, .sm-entry-note, .sm-weapon small,
.sm-preview-label > p, .sm-preview-label > small { display: none; }
.sm-main { max-width: 1120px; margin: auto; grid-template-columns: 320px minmax(0, 1fr); gap: 56px; padding: 28px 0; }
.sm-intro h1 { font: 600 24px system-ui, sans-serif; margin: 0 0 24px; letter-spacing: -0.6px; }
.sm-profile, .sm-mode-choice, .sm-loadout-heading { font-size: 11px; }
.sm-weapon { padding: 9px; border-radius: 2px; }
.sm-weapon svg { width: 36px; height: 36px; }
.sm-weapon-name { font-size: 10px; }
.sm-weapon[aria-pressed="true"] { background: #f5f5f5; border-color: #111; box-shadow: none; }
.sm-button { border-radius: 2px; }
.sm-canvas-wrap { box-shadow: none; border: 0; border-radius: 0; }
.sm-canvas:focus-visible { outline-width: 1px; outline-color: #ddd; outline-offset: -1px; }
.sm-preview-label { top: 20px; left: 20px; }
.sm-team-legend { display: none; }
.sm-notice { border: 0; padding: 8px 0; }
.sm-notice-icon { display: none; }
.sm-playing .sm-main { max-width: none; padding: 0; }
.sm-playing .sm-header { height: 44px; }
.sm-playing .sm-stage-toolbar { height: 28px; font-size: 10px; }
.sm-playing .sm-stage-map, .sm-playing [data-tick] { display: none; }
.sm-is-training [data-tick] { display: inline; }
.sm-playing .sm-canvas-wrap { height: calc(100dvh - 130px); min-height: 260px; max-height: none; aspect-ratio: auto; }
.sm-hud { position: absolute; bottom: 16px; left: 16px; display: flex; gap: 12px; padding: 4px 8px; margin: 0; border: 0; border-radius: 0; background: #ffffffed; pointer-events: none; }
.sm-hud-identity, .sm-hud .sm-score, .sm-resources [data-dodge], .sm-resources [data-wall] { display: none; }
.sm-damage { font: 700 28px system-ui, sans-serif; min-width: 0; line-height: 1; }
.sm-damage small { font-size: 14px; }
.sm-resources { min-width: 42px; gap: 4px; font-size: 10px; }
.sm-resources progress { height: 2px; }
.sm-team-score { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); margin: 0; padding: 4px 8px; border: 0; font-size: 13px; background: #fffffff0; pointer-events: none; }
.sm-team-score::before, .sm-team-score::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; vertical-align: 2px; }
.sm-team-score::before { background: #2877e8; margin-right: 10px; }
.sm-team-score::after { background: #df3535; margin-left: 10px; }
.sm-training-panel, .sm-participants { margin: 0; padding: 0; border-top: 0; }
.sm-training-panel > summary, .sm-participants > summary { cursor: pointer; width: fit-content; padding: 8px 4px; font-size: 11px; color: var(--muted); }
.sm-participants > summary [data-player-count] { margin-left: 12px; font-size: 10px; }
.sm-training-panel[open], .sm-participants[open] { padding-bottom: 14px; }
.sm-training-controls { padding-top: 8px; }
.sm-player-row { background: white; border-radius: 0; }
.sm-player-row .sm-challenge:disabled { display: none; }
.sm-casual-note { font-size: 9px; }
@media (max-width: 850px) {
  .sm-app { padding: 0 16px; }
  .sm-main { grid-template-columns: 300px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 660px) {
  .sm-app { padding: 0 12px; }
  .sm-main { display: flex; padding-top: 16px; gap: 20px; }
  .sm-intro h1 { font-size: 22px; margin-bottom: 16px; }
  .sm-canvas-wrap { aspect-ratio: 1.8; }
  .sm-playing .sm-canvas-wrap { height: calc(100dvh - 145px); min-height: 240px; aspect-ratio: auto; }
  .sm-hud { flex-wrap: nowrap; gap: 10px; }
  .sm-resources { width: 42px; }
  .sm-header-actions { gap: 12px; }
}

.sm-duel-tools { border-top: 1px solid var(--line, #ddd); padding: 14px 0; font-size: 13px; }
.sm-duel-tools summary { cursor: pointer; font-weight: 700; }
.sm-duel-tools p { line-height: 1.6; }
.sm-duel-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.sm-duel-tools input { max-width: 200px; padding: 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; color: #111; }
.sm-duel-tools [data-private-code] { width: 140px; text-transform: uppercase; }
.sm-replay-import { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sm-duel-hud { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; color: #111; font-size: 13px; font-weight: 700; pointer-events: none; max-width: 90%; text-align: center; }
.sm-duel-hud.is-countdown, .sm-duel-hud.is-result { top: 35%; font-size: clamp(18px, 3vw, 30px); padding: 12px 18px; }
.sm-challenge-prompts { position: absolute; right: 12px; top: 12px; max-width: min(420px, calc(100% - 24px)); font-size: 12px; }
.sm-challenge-prompts:empty { display: none; }
.sm-challenge-prompts p { margin: 0; padding: 12px; background: #fff; border: 1px solid #999; box-shadow: 0 2px 8px #0001; line-height: 1.8; }
.sm-challenge-prompts .sm-button { margin: 8px 6px 0 0; padding: 6px 10px; }
.sm-stage-feedback { position: absolute; top: 12px; left: 12px; max-width: 65%; padding: 8px 12px; border: 1px solid #ddd; background: #fff; font-size: 12px; pointer-events: none; }

.sm-guide { border-top: 1px solid var(--line); padding: 12px 0; font-size: 12px; line-height: 1.7; }
.sm-guide summary { cursor: pointer; font-weight: 700; }
.sm-hud { gap: 8px; }
.sm-resources { grid-template-columns: auto auto; gap: 2px 6px; font-size: 9px; line-height: 1.2; width: auto; }
.sm-resources [data-dodge], .sm-resources [data-recovery] { display: block; font-size: 9px; }
.sm-resources [data-dodge] { grid-area: 1 / 1; }
.sm-resources [data-air] { grid-area: 1 / 2; text-align: right; }
.sm-resources progress { grid-area: 2 / 1 / 3 / 3; }
.sm-resources [data-recovery] { grid-area: 3 / 1 / 4 / 3; }
.sm-resources .is-warning { color: #ae2c2c; }
.sm-is-training:has(.sm-training-panel[open]) .sm-canvas-wrap { height: 52dvh; min-height: 300px; }
.sm-training-panel[open] { padding: 8px 12px 16px; border: 1px solid #ddd; }
.sm-lab-help { font-size: 11px; color: #666; line-height: 1.6; margin: 10px 0; }
.sm-frame-panel { font-size: 12px; }
.sm-frame-panel summary { cursor: pointer; padding: 6px 0; }
.sm-frame-legend { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.sm-frame-legend [data-phase] { padding: 3px 5px; border-radius: 2px; }
[data-phase="startup"] { --phase: #d8c382; }
[data-phase="active"] { --phase: #e77979; }
[data-phase="recovery"] { --phase: #8db3d7; }
[data-phase="hitstop"] { --phase: #b19bcf; }
[data-phase="hitstun"] { --phase: #f3a771; }
[data-phase="dodge"] { --phase: #88c6ad; }
[data-phase="charge"] { --phase: #dac394; }
.sm-frame-legend [data-phase] { background: var(--phase, #eee); color: #111; }
.sm-invuln-legend { text-decoration: underline 3px #111; }
.sm-frame-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sm-frame-card { border: 1px solid #ddd; padding: 12px; min-width: 0; border-top: 4px solid var(--phase, #bbb); }
.sm-frame-card h3 { font-size: 12px; margin: 0 0 6px; }
.sm-frame-card p { font-size: 11px; margin: 5px 0; line-height: 1.6; overflow-wrap: anywhere; }
.sm-frame-card pre { font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sm-frame-timeline { margin: 14px 0; }
.sm-timeline-row { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 8px; align-items: center; margin: 5px 0; font-size: 10px; }
.sm-timeline-strip { display: grid; grid-template-columns: repeat(60, minmax(0, 1fr)); gap: 2px; }
.sm-timeline-strip span { height: 18px; background: var(--phase, #e5e5e5); }
.sm-timeline-strip .is-invulnerable { border-bottom: 3px solid #111; }
[data-frame-link] { padding: 10px; background: #f1f1f1; font-weight: 600; line-height: 1.6; }
.sm-input-log { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; font: 11px/1.8 monospace; padding: 10px; background: #f5f5f5; }
@media (max-width: 650px) { .sm-frame-cards { grid-template-columns: 1fr; } .sm-connection { max-width: 48vw; font-size: 10px; } }

/* Account, ladder and wardrobe stay in one optional dialog. */
.sm-ranked-choice { border: 1px solid #111; display: flex; gap: 24px; margin: 0 0 20px; padding: 12px 16px; }
.sm-ranked-choice legend { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.sm-ranked-choice label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.sm-ranked-choice input { accent-color: #111; }
.sm-account-dialog { color: #111; background: white; border: 2px solid #111; border-radius: 3px; width: min(660px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 30px; box-sizing: border-box; overflow: auto; }
.sm-account-dialog::backdrop { background: #ffffffdd; backdrop-filter: blur(5px); }
.sm-auth { width: min(440px, calc(100vw - 32px)); }
.sm-account-dialog h2 { font-size: 30px; letter-spacing: -.04em; margin: 12px 0; }
.sm-account-dialog p { line-height: 1.6; }
.sm-account-dialog label { display: grid; gap: 7px; font-size: 12px; font-weight: 650; margin: 16px 0; }
.sm-account-dialog input, .sm-account-dialog select { border: 1px solid #aaa; border-radius: 2px; padding: 12px; background: #fff; color: #111; font: inherit; min-width: 0; width: 100%; box-sizing: border-box; }
.sm-account-dialog input:focus, .sm-account-dialog select:focus { outline: 2px solid #111; outline-offset: 2px; }
.sm-account-art svg { width: 100%; height: 110px; fill: none; stroke: #111; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sm-auth .sm-button-primary { width: 100%; justify-content: space-between; }
.sm-account-footnote { font-size: 11px; color: #666; }
.sm-account-status { font-size: 12px; min-height: 18px; }
.sm-account-tabs { display: flex; border-bottom: 1px solid #ddd; gap: 26px; margin: 24px 0; }
.sm-account-tabs button { background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 10px 0; font: inherit; cursor: pointer; }
.sm-account-tabs [aria-selected=true] { border-bottom-color: #111; font-weight: 750; }
.sm-ladder-switch { display: flex; gap: 10px; }
.sm-ladder-switch [aria-pressed=true] { background: #111; color: white; }
.sm-ladder-scroll { max-height: 300px; overflow: auto; margin-top: 20px; }
.sm-ladder-table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
.sm-ladder-table th, .sm-ladder-table td { border-bottom: 1px solid #ddd; padding: 12px 6px; }
.sm-ladder-table .is-self { background: #fff8cc; font-weight: bold; }
.sm-wardrobe { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 20px; }
.sm-wardrobe canvas { width: 100%; max-width: 220px; }
.sm-account-footer { border-top: 1px solid #ddd; padding-top: 16px; margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; color: #666; }
.sm-match-history { margin: 20px 0; font-size: 12px; }
.sm-ranked-result { font-size: 12px; }
@media (max-width: 600px) { .sm-account-dialog { padding: 20px; } .sm-header-actions { gap: 4px; } .sm-header-actions > [data-account-open] { max-width: 100px; overflow: hidden; text-overflow: ellipsis; } }
