@charset "UTF-8";
.animation-size-expand {
  position: relative;
  -webkit-transition: transform 300ms ease-in;
  -webkit-transform: scale(1);
  -ms-transition: transform 300ms ease-in;
  -ms-transform: scale(1);
  -moz-transition: transform 300ms ease-in;
  -moz-transform: scale(1);
  transition: transform 300ms ease-in;
  transform: scale(1);
}

.animation-size-expand-hover:hover.animation-size-expand, .animation-size-expand-hover:hover .animation-size-expand {
  z-index: 1000;
  -webkit-transition: transform 100ms ease-in;
  -webkit-transform: scale(1.3);
  -ms-transition: transform 100ms ease-in;
  -ms-transform: scale(1.3);
  -moz-transition: transform 100ms ease-in;
  -moz-transform: scale(1.3);
  transition: transform 100ms ease-in;
  transform: scale(1.3);
}

.animation-size-expand-hover-small:hover.animation-size-expand, .animation-size-expand-hover-small:hover .animation-size-expand {
  z-index: 1000;
  -webkit-transition: transform 100ms ease-in;
  -webkit-transform: scale(1.1);
  -ms-transition: transform 100ms ease-in;
  -ms-transform: scale(1.1);
  -moz-transition: transform 100ms ease-in;
  -moz-transform: scale(1.1);
  transition: transform 100ms ease-in;
  transform: scale(1.1);
}

.animation-size-expand-hover-tiny:hover.animation-size-expand, .animation-size-expand-hover-tiny:hover .animation-size-expand {
  z-index: 1000;
  -webkit-transition: transform 100ms ease-in;
  -webkit-transform: scale(1.05);
  -ms-transition: transform 100ms ease-in;
  -ms-transform: scale(1.05);
  -moz-transition: transform 100ms ease-in;
  -moz-transform: scale(1.05);
  transition: transform 100ms ease-in;
  transform: scale(1.05);
}

.btn {
  box-sizing: border-box;
  margin-top: 5px;
  margin-bottom: 5px;
  border: none;
  color: #eaf0ff;
  padding: 13px 28px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  width: 100%;
  cursor: pointer;
  border-radius: 4px;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.07s, box-shadow 0.07s, background-color 0.12s, border-color 0.12s;
}
.btn :focus {
  outline: 0;
}

.btn-remove-player {
  display: none;
}

.btn-clean {
  background-color: Transparent;
  background-repeat: no-repeat;
  border: none;
  cursor: pointer;
  overflow: hidden;
  outline: none;
}

.btn-slim {
  padding: 5px 15px;
  font-size: 13px;
}

.btn-select {
  background: url(http://i62.tinypic.com/15xvbd5.png) no-repeat 96% 0;
}

/* Canonical primary action button — same flat matte look as the start-screen
 * Start button. Used for Pause/Resume, Start next game, Play again, etc. */
.btn-primary {
  background-color: #28c4d4;
  color: #021019;
  transition: filter 0.12s, background-color 0.12s;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:active {
  filter: brightness(0.94);
}

.btn-secondary {
  background-color: #131b2e;
  color: #eaf0ff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  border-color: #8995b3;
}

.flex, .canvas-overlay-text {
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap;
}

.flex-no-wrap {
  flex-wrap: nowrap;
}

.flex-column {
  flex-direction: column;
}

.flex-start {
  justify-content: start;
}

.flex-space-between {
  justify-content: space-between;
}

.flex-align-end {
  align-items: flex-end;
}

.flex-align-center {
  align-items: center;
}

.flex-center {
  justify-content: center;
}

.flex-self-center {
  align-self: center;
}

.flex-self-end {
  align-self: flex-end;
}

.flex-grow-1 {
  flex-grow: 1;
}

.flex-grow-2 {
  flex-grow: 2;
}

.flex-center-xy, .canvas-overlay-text {
  align-items: center;
  justify-content: center;
}

.flex-2x2 {
  min-height: 100%;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
}

.flex-2x2 > * {
  display: flex;
  flex-basis: calc(50% - 40px);
  justify-content: center;
  flex-direction: column;
}

.flex, .canvas-overlay-text {
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap;
}

.flex-no-wrap {
  flex-wrap: nowrap;
}

.flex-column {
  flex-direction: column;
}

.flex-start {
  justify-content: start;
}

.flex-space-between {
  justify-content: space-between;
}

.flex-align-end {
  align-items: flex-end;
}

.flex-align-center {
  align-items: center;
}

.flex-center {
  justify-content: center;
}

.flex-self-center {
  align-self: center;
}

.flex-self-end {
  align-self: flex-end;
}

.flex-grow-1 {
  flex-grow: 1;
}

.flex-grow-2 {
  flex-grow: 2;
}

.flex-center-xy, .canvas-overlay-text {
  align-items: center;
  justify-content: center;
}

.flex-2x2 {
  min-height: 100%;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
}

.flex-2x2 > * {
  display: flex;
  flex-basis: calc(50% - 40px);
  justify-content: center;
  flex-direction: column;
}

.canvas-container {
  position: relative;
}

.map-canvas-z-index {
  z-index: 100 !important;
}

.power-up-canvas-z-index {
  z-index: 200;
}

.worm-body-canvas-1-z-index {
  z-index: 300;
}

.worm-body-canvas-2-z-index {
  z-index: 310;
}

.worm-body-canvas-3-z-index {
  z-index: 320;
}

.worm-head-canvas-z-index {
  z-index: 400;
}

.border-canvas-z-index {
  z-index: 500;
}

.canvas-overlay-container, .canvas-overlay-container-round {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 450;
  color: #28c4d4;
}

.canvas-overlay-container-round {
  border-radius: 50%;
}

.canvas-overlay-faded-bg, .canvas-overlay-hover-wrapper:hover .canvas-overlay-hover-effect {
  background-color: rgba(7, 10, 18, 0.6);
}

.canvas-overlay-text {
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  text-align: center;
}

.round-over-text-circle-map {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

.canvas-overlay-hover-wrapper:hover .canvas-overlay-hover-effect {
  opacity: 1;
  z-index: 450 !important;
}

table {
  line-height: inherit;
}

body {
  padding: 0;
  background: radial-gradient(1200px 700px at 70% -10%, #14213d 0%, #070a12 55%) fixed, #070a12;
  color: #eaf0ff;
}

.page-main {
  margin-right: auto;
  margin-left: auto;
  max-width: 1200px;
  padding-left: 20px;
  padding-right: 20px;
}

/**
 * Select
 */
.select {
  background: url(http://i62.tinypic.com/15xvbd5.png) no-repeat 96% 0;
  height: 29px;
  overflow: hidden;
  width: 240px;
}
.select select {
  color: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  font-size: 14px;
  height: 29px;
  padding-left: 5px; /* If you add too much padding here, the options won't show in IE */
  width: 268px;
}
.select select option {
  background-color: #28c4d4;
  color: white;
}

.select-primary {
  background-color: #28c4d4;
}

/**
 * Input
 */
.input {
  background-color: Transparent;
  background-repeat: no-repeat;
  border: none;
  cursor: text;
  overflow: hidden;
  outline: none;
  border-bottom: 2px dotted #000000;
}

/**
 * Icons
*/
.icon-remove {
  fill: "green";
}

/**
* Table
*/
.table {
  width: 100%;
}
.table td {
  padding: 8px;
}

.table-round-score {
  width: 100%;
}
.table-round-score .round-score {
  font-size: 10px;
  width: 15px;
}
.table-round-score tr {
  height: 25px;
}
.table-round-score .col-tie-score {
  position: relative;
}
.table-round-score .col-tie-score .tie-info {
  display: none;
  position: absolute;
  right: 46px;
  top: 3px;
  font-size: 13px;
  color: white;
  background-color: black;
  border-radius: 3px;
  padding-left: 8px;
  padding-right: 8px;
  padding-top: 3px;
  padding-bottom: 2px;
  white-space: nowrap;
}
.table-round-score .col-tie-score {
  min-width: 37px;
}
.table-round-score .col-tie-score .tie {
  background-color: #28c4d4;
  color: white;
  padding: 3px;
  border-radius: 5px;
  cursor: default;
  float: right;
}
.table-round-score .col-tie-score img {
  float: right;
}
.table-round-score .col-tie-score:hover .tie-info {
  display: inline;
}

/**
 * Player settings table
*/
.table-player .col-bot {
  width: 10%;
}
.table-player .col-color {
  width: 10%;
}
.table-player .col-name {
  width: 40%;
}
.table-player .col-keybinding {
  width: 20%;
  min-width: 66px;
  text-align: center;
}
.table-player .col-selected {
  outline: 4px solid;
  outline-offset: -4px;
  background-color: rgba(40, 196, 212, 0.16);
}
.table-player .col-remove {
  min-width: 40px;
}
.table-player .col-ready {
  color: #689F38;
}
.table-player tbody tr:hover td:not(:last-child) {
  background-color: rgba(40, 196, 212, 0.16);
}
.table-player tbody tr:hover .btn-remove-player {
  display: block;
}

.table-score {
  width: 100%;
}
.table-score tr {
  height: 43px;
}
.table-score td:nth-child(1) {
  width: 27px;
}
.table-score td:nth-child(3) {
  text-align: center;
}

.new-match-preview {
  position: relative;
  width: 100%;
  padding-top: 100%;
  height: 0px;
}
.new-match-preview .preview-canvas-container {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0px;
  left: 0px;
  bottom: 0px;
  right: 0px;
}

.score-graph-outer-wrapper {
  position: relative;
  width: 100%;
  padding-top: 66.667%;
  height: 0px;
}
.score-graph-outer-wrapper .score-graph-inner-wrapper {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0px;
  left: 0px;
  bottom: 0px;
  right: 0px;
}

.match-over-replay {
  width: 208px;
  height: 208px;
  margin: auto;
}

.canvas-container canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.color-picker {
  width: 25px;
  height: 25px;
  position: relative;
  float: left;
  cursor: pointer;
}

.color-picker-selected {
  width: 25px;
  height: 25px;
}

.color-picker-list {
  position: absolute;
  z-index: 1;
  top: 0px;
  left: 25px;
  width: 300px;
}

.max-score {
  max-width: 110px;
}
.max-score img {
  height: 29px;
  margin-right: 10px;
}
.max-score input {
  width: 4em;
  margin-bottom: 1px;
  text-align: center;
}

.heading h1 {
  margin-bottom: 0;
  text-align: center;
}
.heading {
  margin-bottom: 10px;
  border-bottom: 1px solid;
  border-color: #bdbdbd;
}

.hidden {
  display: none;
}

.multi-player-enter {
  display: flex;
  flex-direction: column;
  width: 30%;
  margin: auto;
}
.multi-player-enter input {
  text-align: center;
}

.replay-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.round-replay {
  cursor: pointer;
  position: relative;
}

.round-replay:hover .round-watch-replay {
  display: flex;
}

.facebook-page-link svg:hover :first-child {
  fill: #365899;
}

.fb-like span {
  margin-bottom: 4px;
}

.m-b-2 {
  margin-bottom: 10px;
}

.m-b-3 {
  margin-bottom: 20px;
}

.m-l-1 {
  margin-left: 5px;
}

.m-l-2 {
  margin-left: 10px;
}

.m-r-3 {
  margin-right: 20px;
}

.m-t-2 {
  margin-top: 10px;
}

.m-x-2 {
  margin-left: 10px;
  margin-right: 10px;
}

.m-t-0 {
  margin-top: 0;
}

.m-b-0 {
  margin-bottom: 0;
}

.m-t-3 {
  margin-top: 20px;
}

.m-x-3 {
  margin-left: 20px;
  margin-right: 20px;
}

.hidden {
  display: none;
}

.opacity-0 {
  opacity: 0;
}

.opacity-25 {
  opacity: 0.25;
}

.opacity-5 {
  opacity: 0.5;
}

.selected {
  background-color: rgba(40, 196, 212, 0.16);
}

/* ------------------------------------------------------------------
 * Mobile responsive styles
 * ------------------------------------------------------------------ */
@media (max-width: 900px), (pointer: coarse) {
  body {
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
  }
  .page-main {
    padding-left: 8px;
    padding-right: 8px;
    /* Breathing room at the bottom of scrollable pages; respect iOS home indicator. */
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
    max-width: 100%;
  }
  /* Header collapses to a compact bar; hide Facebook stuff on mobile. */
  .heading {
    margin-bottom: 6px;
  }
  .heading h1 {
    font-size: 22px;
    margin: 4px 0;
  }
  .heading .fb-like,
  .heading .facebook-page-link {
    display: none !important;
  }
  /* New-match: stack everything into a single column */
  .new-match {
    flex-direction: column;
  }
  .new-match > div {
    flex-basis: auto !important;
    min-width: 0 !important;
    width: 100%;
  }
  .new-match-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .player-card-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
  }
  .player-card-mobile .player-card-color {
    flex-shrink: 0;
  }
  .player-card-mobile .player-card-name {
    flex: 1 1 auto;
    min-width: 0;
  }
  .player-card-mobile .player-card-name input {
    width: 100%;
    font-size: 16px; /* avoid iOS zoom */
    padding: 6px 0;
  }
  .player-card-mobile .player-card-type-btn {
    flex-shrink: 0;
    padding: 8px;
  }
  .player-card-mobile .player-card-type-btn img {
    width: 32px;
    height: 32px;
  }
  .player-card-mobile .player-card-remove {
    flex-shrink: 0;
  }
  .new-match-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .new-match-mobile-map {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .new-match-mobile-map .map-choice {
    aspect-ratio: 1/1;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    position: relative;
  }
  .new-match-mobile-map .map-choice.selected {
    border-color: #28c4d4;
  }
  .new-match-mobile-controls-hint {
    font-size: 13px;
    color: #757575;
    text-align: center;
    padding: 8px 4px;
    line-height: 1.4;
  }
  /* Local game mobile: full-screen canvas + invisible touch zones */
  .local-game-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    overflow: hidden;
    z-index: 1000;
    /* Suppress Android haptic feedback / context menus / text selection on
       long-press during play. */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .local-game-mobile * {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  .local-game-mobile-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Square fit to smallest viewport edge */
    width: min(100vw, 100vh);
    height: min(100vw, 100vh);
  }
  .local-game-mobile-topbar {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 700;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    padding: 4px 8px;
    pointer-events: none;
  }
  .local-game-mobile-topbar .max-score {
    display: none;
  }
  .local-game-mobile-topbar table td {
    padding: 1px 4px;
    font-size: 12px;
  }
  .local-game-mobile-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 6px;
    z-index: 700;
  }
  .local-game-mobile-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background-color: rgba(14, 20, 34, 0.7);
    color: #eaf0ff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    padding: 0;
  }
  /* The page-main wrapper should not constrain the fullscreen game */
  .page-main:has(.local-game-mobile) {
    padding: 0;
    max-width: none;
  }
  /* Hide header behind game on mobile to maximise space */
  .page-main.in-game-mobile {
    padding: 0;
  }
  .page-main.in-game-mobile .heading {
    display: none;
  }
  /* game-over + match-over on mobile: stack canvas + score */
  .game-over-mobile,
  .match-over-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .game-over-mobile .canvas-wrapper,
  .match-over-mobile .canvas-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 1/1;
  }
  .game-over-mobile .side,
  .match-over-mobile .side {
    width: 100%;
  }
  /* game-over on mobile reuses the fullscreen .local-game-mobile layout so the map
     stays in the exact same place/size as during play (no flicker).

     The action area is pinned to the bottom of the screen so in portrait it lives
     entirely in the black letterbox band *below* the square map -- never covering
     gameplay. It stays non-tappable for ~1s after mount so reflexive turn-taps at
     round-end are ignored, then fades + slides up into view. */
  .game-over-mobile-actions {
    position: absolute;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom, 18px));
    transform: translateX(-50%) translateY(10px);
    z-index: 700;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: min(320px, 82vw);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  .game-over-mobile-actions.armed {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }
  .game-over-mobile-actions {
    /* Primary "Start next game": large CTA, prominent shadow */
  }
  .game-over-mobile-actions .btn-primary {
    margin: 0;
    padding: 16px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background-color: #28c4d4;
    color: #021019;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  }
  .game-over-mobile-actions {
    /* Secondary actions become low-key ghost chips, side-by-side under the CTA */
  }
  .game-over-mobile-actions .game-over-mobile-actions-secondary {
    display: flex;
    gap: 8px;
  }
  .game-over-mobile-actions .game-over-mobile-actions-secondary .btn-secondary {
    flex: 1 1 0;
    margin: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: none;
  }
  .match-over-rounds-heading-mobile {
    margin: 8px 0;
    font-size: 16px;
  }
  .match-over-rounds-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .match-over-rounds-mobile .round-replay {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
  }
  .match-over-rounds-mobile {
    /* Force the inner fixed-size .match-over-replay to fill the grid cell */
  }
  .match-over-rounds-mobile .match-over-replay {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1;
    margin: 0 !important;
  }
  .match-over-rounds-mobile .match-over-replay .canvas-container {
    position: relative;
    width: 100% !important;
    height: 100% !important;
  }
  /* Score graph: only shown for ≥3 rounds; force a shorter aspect for mobile */
  .match-over-score-graph-mobile .score-graph-outer-wrapper {
    padding-top: 66.667%; /* match the 3:2 map so borders aren't cropped */
  }
  /* Buttons large on mobile */
  .btn {
    padding: 14px 16px;
    font-size: 15px;
  }
  /* Prevent text size adjustments inside table inputs */
  .input {
    font-size: 16px;
  }
}
/* When the canvas-container is fullscreen, make sure its child canvases fill it */
.canvas-container-fullscreen canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------------
 * New-match (start) screen — "Neon Arena" concept, matte variant.
 * All styles scoped under .nm-root so the other (not-yet-redesigned)
 * views keep their current look.
 * ------------------------------------------------------------------ */
/* Shared "control" look for small clickable buttons (steppers, key chips,
 * human/bot toggle, color swatch, icon buttons) so they're visually cohesive. */
.nm-root .nm-stepper button, .nm-root .color-picker-list .color-picker, .nm-root .color-picker-selected, .nm-root .nm-key-chip, .nm-root .nm-ptype, .nm-root .nm-icon-btn {
  box-sizing: border-box; /* width/height include the border so all controls match exactly */
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a1020;
  color: #eaf0ff;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.nm-root .nm-stepper button:hover, .nm-root .color-picker-list .color-picker:hover, .nm-root .color-picker-selected:hover, .nm-root .nm-key-chip:hover, .nm-root .nm-ptype:hover, .nm-root .nm-icon-btn:hover {
  border-color: #8995b3;
}

/* Full-bleed dark backdrop only while the start screen is shown. */
.page-main.page-main-start {
  max-width: none;
  padding: 0;
}

.page-main-start::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(1200px 700px at 70% -10%, #14213d 0%, #070a12 55%);
}

.nm-root {
  --bg: #070a12;
  --panel: #0e1422;
  --panel2: #131b2e;
  --line: rgba(255, 255, 255, 0.08);
  --txt: #eaf0ff;
  --muted: #8995b3;
  --cyan: #00e5ff;
  --matte: #28c4d4;
  --pink: #ff2e88;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 60px;
  color: var(--txt);
  font-family: "Rajdhani", system-ui, sans-serif;
  /* ---------- topbar ---------- */
}
.nm-root .nm-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.nm-root .nm-logo {
  display: flex;
  align-items: center;
  gap: 11px;
}
.nm-root .nm-mark {
  width: 34px;
  height: 34px;
  border-radius: 3px;
  background: #10202e;
  border: 1px solid var(--line);
  position: relative;
}
.nm-root .nm-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  border-right-color: transparent;
  transform: rotate(-35deg);
}
.nm-root .nm-logo h1 {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 3px;
  margin: 0;
}
.nm-root .nm-logo h1 span {
  color: var(--cyan);
  margin: 0 2px;
}
.nm-root .nm-modes {
  margin-left: 8px;
  display: flex;
  gap: 8px;
}
.nm-root .nm-pill {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  border-radius: 5px;
  padding: 7px 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 13px;
  cursor: pointer;
  font-family: "Rajdhani", sans-serif;
}
.nm-root .nm-pill.active {
  color: #021019;
  background: var(--matte);
  border-color: transparent;
}
.nm-root .nm-pill[disabled] {
  cursor: default;
  opacity: 0.75;
}
.nm-root .nm-soon {
  font-size: 9px;
  background: var(--pink);
  color: #fff;
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 1px;
}
.nm-root .nm-topbar-right {
  margin-left: auto;
  display: flex;
  gap: 10px;
}
.nm-root .nm-icon-btn {
  width: 38px;
  height: 38px;
  font-size: 16px;
  color: var(--muted);
}
.nm-root {
  /* ---------- layout ---------- */
}
.nm-root .nm-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}
.nm-root .nm-section-h {
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 14px;
}
.nm-root .nm-col-right .nm-section-h {
  margin-top: 18px;
}
.nm-root .nm-col-right .nm-section-h:first-child {
  margin-top: 0;
}
.nm-root .nm-hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
  line-height: 1.5;
}
.nm-root {
  /* ---------- players ---------- */
}
.nm-root .nm-roster {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nm-root .nm-player {
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 13px;
  box-sizing: border-box;
  min-height: 52px; /* stable height across human/bot swap */
}
.nm-root .nm-player-color {
  flex: 0 0 auto;
  position: relative;
}
.nm-root .nm-ptype {
  width: 30px;
  height: 30px;
  padding: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nm-root .nm-ptype-icon {
  width: 15px;
  height: 15px;
  filter: invert(0.82);
}
.nm-root {
  /* disabled bot->human toggle (mobile max-humans): dimmed, no hover highlight */
}
.nm-root .nm-ptype.is-disabled {
  opacity: 0.4;
}
.nm-root .nm-ptype.is-disabled:hover {
  border-color: var(--line);
}
.nm-root .nm-name-input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--line);
  color: var(--txt);
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  font-size: 17px;
  padding: 3px 2px;
  outline: none;
}
.nm-root .nm-name-input:focus {
  border-bottom-color: var(--matte);
}
.nm-root .nm-keys {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.nm-root .nm-key-chip {
  min-width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: 0 8px;
  white-space: nowrap;
}
.nm-root .nm-key-chip-selected {
  border-color: var(--matte);
  color: var(--matte);
  background: rgba(40, 196, 212, 0.08);
  font-size: 11px;
}
.nm-root .nm-key-chip-missing {
  border-color: #ff5470;
  color: #ff5470;
  background: rgba(255, 84, 112, 0.1);
}
.nm-root .nm-key-chip-missing:hover {
  border-color: #ff7d92;
}
.nm-root .nm-cpu {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
}
.nm-root .nm-touch-tag {
  flex: 0 0 auto;
  color: var(--matte);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 10px;
  background: none;
  cursor: pointer;
  font-family: "Rajdhani", sans-serif;
}
.nm-root .nm-touch-tag:hover {
  border-color: var(--matte);
}
.nm-root .nm-premove {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  opacity: 0.55;
  flex: 0 0 auto;
  width: 26px;
}
.nm-root .nm-premove:hover {
  opacity: 1;
  color: var(--pink);
}
.nm-root .nm-premove-spacer {
  width: 26px;
  flex: 0 0 auto;
  display: inline-block;
}
.nm-root {
  /* ---------- color picker overrides ---------- */
  /* main color swatch + dropdown swatches share the same control component.
     Border is a stronger light tone than the dark-fill controls because these
     sit over bright colors and need more contrast to read as a button. */
}
.nm-root .color-picker {
  float: none;
  width: 30px;
  height: 30px;
}
.nm-root .color-picker-selected {
  width: 30px;
  height: 30px;
  filter: saturate(0.85) brightness(0.96);
}
.nm-root .color-picker-selected:hover {
  border-color: #fff;
}
.nm-root .color-picker-list {
  left: 48px;
  top: -3px;
  width: auto;
  max-width: 220px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.nm-root .color-picker-list .color-picker {
  width: 30px;
  height: 30px;
  float: none;
  filter: saturate(0.85) brightness(0.96);
}
.nm-root .color-picker-list .color-picker:hover {
  border-color: #fff;
}
.nm-root {
  /* ---------- match config ---------- */
}
.nm-root .nm-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
}
.nm-root .nm-lbl {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}
.nm-root .nm-lbl-icon {
  margin-right: 10px;
}
.nm-root .nm-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nm-root .nm-stepper button {
  width: 36px;
  height: 36px;
  font-size: 18px;
  line-height: 1;
}
.nm-root .nm-val {
  font-family: "Orbitron", sans-serif;
  font-size: 20px;
  min-width: 40px;
  text-align: center;
  color: var(--matte);
}
.nm-root {
  /* ---------- maps ---------- */
}
.nm-root .nm-maps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 4px;
}
.nm-root .nm-map {
  aspect-ratio: 1/1;
  border-radius: 5px;
  border: 2px solid var(--line);
  background: #080d16;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.nm-root .nm-map.sel {
  border-color: var(--matte);
}
.nm-root .nm-map .canvas-container {
  width: 100% !important;
  height: 100% !important;
}
.nm-root .nm-map-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
}
.nm-root .nm-map-name {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 16px;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 2px 8px rgba(0, 0, 0, 0.6);
}
.nm-root .nm-map-name small {
  display: block;
  font-size: 9px;
  letter-spacing: 3px;
  font-weight: 700;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.85);
}
.nm-root {
  /* ---------- buttons ---------- */
}
.nm-root .nm-btn {
  box-sizing: border-box;
  border: 0;
  border-radius: 4px;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  font-size: 15px;
  padding: 13px 18px;
  color: var(--txt);
}
.nm-root .nm-btn-ghost {
  background: var(--panel2);
  border: 1px solid var(--line);
}
.nm-root .nm-btn-ghost:hover {
  border-color: var(--muted);
}
.nm-root .nm-add {
  margin-top: 10px;
}
.nm-root .nm-btn-primary {
  width: 100%;
  background: var(--matte);
  color: #021019;
  transition: background-color 0.12s, filter 0.12s;
}
.nm-root .nm-btn-primary:hover {
  filter: brightness(1.06);
}
.nm-root .nm-btn-primary:active {
  filter: brightness(0.94);
}
.nm-root .nm-btn-xl {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 18px;
  font-size: 18px;
  margin-top: 18px;
}
.nm-root {
  /* ---------- how-to-play modal ---------- */
}
.nm-root .nm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 15, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.nm-root .nm-modal {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.nm-root .nm-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.nm-root .nm-modal-head h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 17px;
  letter-spacing: 2px;
  margin: 0;
}
.nm-root .nm-modal-body {
  color: var(--txt);
  line-height: 1.55;
  font-size: 15px;
}
.nm-root .nm-modal-body p {
  margin: 0 0 12px;
}
.nm-root .nm-modal-body ul {
  margin: 0 0 14px;
  padding-left: 18px;
}
.nm-root .nm-modal-body li {
  margin: 6px 0;
}
.nm-root .nm-modal-body b {
  color: #fff;
}
.nm-root .nm-modal-body h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 16px 0 8px;
}
.nm-root .nm-modal-controls {
  color: var(--muted);
}
.nm-root .nm-modal .nm-btn-primary {
  margin-top: 6px;
}
.nm-root {
  /* transient toast (e.g. max-humans-on-phone notice) */
}
.nm-root .nm-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 1100;
  max-width: 86%;
  text-align: center;
  background: rgba(20, 28, 44, 0.97);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 6px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* ---------- responsive ---------- */
/* Clip horizontally WITHOUT becoming a scroll container. (overflow-x: hidden would
   force overflow-y to compute to `auto`, creating a nested scroller that can fight
   the window scroll after the fixed fullscreen game unmounts.) */
.page-main.page-main-start {
  overflow-x: clip;
}

@media (max-width: 900px), (pointer: coarse) {
  .nm-root {
    padding: 0 10px calc(40px + env(safe-area-inset-bottom));
    /* let flex/grid children shrink instead of forcing horizontal overflow */
  }
  .nm-root .nm-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    min-width: 0;
  }
  .nm-root .nm-col {
    min-width: 0;
  }
  .nm-root .nm-player {
    min-width: 0;
  }
  .nm-root .nm-name-input {
    min-width: 0;
    font-size: 16px;
  }
  .nm-root { /* avoid iOS auto-zoom */ }
  .nm-root .nm-maps {
    min-width: 0;
  }
  .nm-root .nm-add {
    width: 100%;
  }
  .nm-root { /* full-width Add player on mobile */ }
  .nm-root .nm-topbar {
    flex-wrap: wrap;
    padding: 14px 4px;
  }
  .nm-root .nm-logo h1 {
    font-size: 16px;
    letter-spacing: 1.5px;
  }
  .nm-root .nm-modes {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
  }
  .nm-root .nm-pill {
    flex: 1;
    text-align: center;
  }
  .nm-root .nm-map-name {
    font-size: 14px;
  }
}
/* ------------------------------------------------------------------
 * Dark "Neon Arena" theme for the non-start views:
 * header, in-game, game-over, match-over, replay.
 * Imported after main + new-match so it can override.
 * ------------------------------------------------------------------ */
/* ---------- header ---------- */
.heading {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}
.heading h1 {
  text-align: left;
  margin: 6px 0;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  letter-spacing: 3px;
  font-size: 20px;
  color: #eaf0ff;
}

/* ---------- generic dark inputs / icons ---------- */
.input {
  color: #eaf0ff;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* plain (black) trophy used for the score target -> make visible on dark + smaller */
.max-score img {
  height: 19px;
  margin-right: 7px;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.max-score {
  color: #eaf0ff;
  font-family: "Orbitron", sans-serif;
  margin-bottom: 12px; /* breathing room between target score and the player stats */
}

/* ---------- score tables (in-game / replay / game-over side) ---------- */
.table-round-score td {
  color: #eaf0ff;
}
.table-round-score .round-score {
  color: #8995b3;
}

.table-score td {
  color: #eaf0ff;
}

.tie {
  background-color: #28c4d4 !important;
  color: #021019 !important;
}

/* ---------- in-game (desktop) ---------- */
.local-game-desktop {
  align-items: flex-start;
}

.local-game-canvas-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(40, 196, 212, 0.08) inset;
}

.local-game-side {
  background: #0e1422;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 16px 18px;
  min-width: 240px;
}

/* ---------- replay (desktop) ---------- */
.replay-container .canvas-container {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

/* ---------- match-over (desktop) ---------- */
.table-score tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.round-replay .canvas-container {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}
.round-replay > div:first-child {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  margin-bottom: 6px;
}

.score-graph-outer-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

/* ---------- mobile: dark glass HUD ---------- */
@media (max-width: 900px), (pointer: coarse) {
  .local-game-mobile {
    background-color: #070a12;
  }
  /* Round-over scoreboard (the only place this topbar now appears — it's hidden
     during live play). Keep it inside the top letterbox band above the square
     arena so it never covers the play area; scroll within the band if there are
     many players. */
  .local-game-mobile-topbar {
    top: 8px;
    background-color: rgba(11, 16, 26, 0.82) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    pointer-events: auto;
    max-height: calc((100vh - 100vw) / 2 - 14px);
    max-height: calc((100dvh - 100vw) / 2 - 14px);
    overflow-y: auto;
    /* size to content on one line instead of squashing long names onto two */
  }
  .local-game-mobile-topbar table {
    width: auto;
  }
  .local-game-mobile-topbar td {
    color: #eaf0ff;
    white-space: nowrap;
    font-size: 13px;
    padding: 2px 6px;
  }
  /* Replay (mobile): card the score + controls below the canvas, centered,
     to match the carded desktop layout. */
  .game-over-mobile {
    max-width: 480px;
    margin: 0 auto;
  }
  .game-over-mobile .side {
    box-sizing: border-box;
    background: #0e1422;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 14px 16px;
  }
  .game-over-mobile .side .table-round-score td {
    color: #eaf0ff;
  }
  .local-game-mobile-icon-btn {
    background-color: rgba(14, 20, 34, 0.7);
    color: #eaf0ff;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .match-over-rounds-heading-mobile {
    color: #eaf0ff;
    font-family: "Orbitron", sans-serif;
    letter-spacing: 2px;
    font-size: 14px;
  }
}
