:root {
  --scroll-track: #192530;
  --scroll-thumb: #536b80;
  --blue: #168cf0;
  --orange: #ff9d00;
  --green: #12ae25;
  --line: #ffffff14;
}
* {
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
}
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-color: auto; scrollbar-width: auto; }
  *::-webkit-scrollbar { width: 8px; height: 8px; }
  *::-webkit-scrollbar-track,
  *::-webkit-scrollbar-corner { background: var(--scroll-track); }
  *::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 0; }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
#canvas, #hud-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#hud-canvas {
  z-index: 2;
  pointer-events: none;
}
#canvas:focus {
  outline: none;
}
#overlays {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 200;
  background: transparent;
  overflow: auto;
  padding: 32px 20px;
  display: none;
}
#helloDialog {
  width: min(980px, 100%);
  position: relative;
  margin: max(0px, calc((100vh - 580px) / 2 - 32px)) auto 0;
  display: grid;
  grid-template-columns: 270px 1fr 280px;
  color: #fff;
  background: #373a3cef;
  border: 1px solid #ffffff25;
  border-radius: 5px;
  box-shadow: 0 12px 36px #0004;
  overflow: hidden;
}
.news-panel {
  background: #252729;
  display: flex;
  flex-direction: column;
}
.tab-strip {
  display: flex;
  font-weight: bold;
  font-size: 12px;
  text-align: center;
}
.tab-strip span {
  padding: 9px 12px;
  flex: 1;
}
.tab-strip .orange {
  flex: 1.4;
}
.blue {
  background: linear-gradient(#209aff, #087be2);
  color: white;
  border: 1px solid #006dcb;
}
.orange {
  background: linear-gradient(#ffb222, #ff9000);
  color: white;
  border: 1px solid #dc7700;
}
.green {
  background: linear-gradient(#20c52e, #079d16);
  color: white;
  border: 1px solid #057f10;
}
.bar {
  background: #1e2021;
  text-align: center;
  margin: 0;
  padding: 8px;
  font-size: 13px;
  font-weight: bold;
  border-bottom: 1px solid var(--line);
}
.news-item {
  padding: 15px 15px 18px;
}
.news-item h3 {
  font-size: 14px;
  margin: 6px 0 8px;
  font-weight: bold;
}
.news-item p {
  font-size: 12px;
  line-height: 1.5;
  color: #bfc4c8;
  margin: 0;
}
.date {
  font-size: 9px;
  font-weight: bold;
  color: var(--orange);
  letter-spacing: 0.6px;
}
.controls {
  padding: 9px 16px;
}
.controls p {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ccd0d2;
  font-size: 12px;
  margin: 9px 0;
}
kbd {
  display: inline-block;
  min-width: 47px;
  text-align: center;
  font: 10px Arial;
  background: #3c3f42;
  color: #fff;
  padding: 4px 6px;
  border-radius: 2px;
  box-shadow: 0 2px 0 #151617;
}
.development-note {
  margin: 10px 15px 20px;
  padding: 13px 12px;
  border-left: 3px solid var(--blue);
  background: #ffffff05;
}
.development-note strong {
  font-size: 12px;
}
.development-note p {
  font-size: 11px;
  color: #afb6bc;
  line-height: 1.6;
  margin: 7px 0 0;
}
.source-link {
  color: #949da4;
  font-size: 10px;
  margin: auto 15px 15px;
}
.source-link:hover {
  color: white;
}
.play-panel {
  padding: 20px 24px 13px;
  text-align: center;
  background: linear-gradient(140deg, #ffffff08, transparent);
}
#title {
  color: var(--orange);
  font-family:
    Arial Black,
    Arial,
    sans-serif;
  font-weight: 1000;
  font-size: 66px;
  line-height: 1;
  margin: 0;
  letter-spacing: -5px;
  transform: rotate(-3deg);
  text-shadow:
    2px 3px 0 #7c4800,
    -1px -1px 0 #ffcf56;
}
#title span {
  font-size: 25px;
  letter-spacing: -1px;
}
.subtitle {
  font-size: 9px;
  letter-spacing: 2px;
  color: #e7b050;
  margin: 10px 0 19px;
}
.guest-line {
  font-size: 11px;
  color: #c9ced0;
  margin: 0 0 9px;
}
.join-row {
  display: flex;
  gap: 4px;
}
#nick {
  width: 0;
  flex: 1;
  min-width: 0;
  height: 33px;
  background: #fff;
  color: #252525;
  border: 2px solid #262829;
  border-radius: 0;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: bold;
}
#play-btn {
  width: 64px;
  font-weight: bold;
  font-size: 13px;
  border-radius: 0;
}
.button-row {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}
.button-row button {
  flex: 1;
  font-size: 12px;
  font-weight: bold;
  padding: 7px 5px;
  line-height: 1.2;
  border-radius: 0;
  box-shadow:
    inset 0 1px 0 #ffffff30,
    0 1px 1px #0004;
}
.button-row button:hover:not(:disabled),
#play-btn:hover:not(:disabled) {
  filter: brightness(1.12);
}
.mini-soon {
  font-size: 8px;
  display: inline-block;
  background: #0002;
  padding: 2px 4px;
  margin-left: 3px;
  font-weight: normal;
}
button:disabled.blue,
button:disabled.orange {
  filter: saturate(0.7);
  opacity: 0.8;
}
#play-btn:disabled,
#spectate-btn:disabled {
  opacity: 0.55;
}
#gamemode {
  width: 100%;
  height: 27px;
  font-size: 11px;
  color: #e0e3e5;
  border: 1px solid #ffffff1c;
  background: #2a2d2f;
  margin: 5px 0 0;
  padding: 3px 6px;
  border-radius: 0;
}
#settings {
  margin: 9px 0 0;
  background: #242628;
  border: 1px solid var(--line);
  text-align: left;
  padding: 5px;
}
:is(#settings, #custom-panel) label {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: #dde0e3;
  margin: 5px 0;
  padding: 0;
}
#settings input {
  position: static;
  margin: 0 6px 0 0;
  vertical-align: middle;
}
#connection-state {
  font-size: 10px;
  color: #c6cbce;
  margin: 10px 0;
}
#connection-state.connected {
  color: #7fe88a;
}
.arena-art {
  height: 124px;
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff12;
  background-color: #292d2f;
  background-image:
    linear-gradient(#ffffff04 1px, transparent 1px),
    linear-gradient(90deg, #ffffff04 1px, transparent 1px);
  background-size: 19px 19px;
}
.cell {
  position: absolute;
  border-radius: 50%;
  border: 4px solid #0002;
  box-shadow: inset -5px -7px 0 #0001;
}
.cell-big {
  width: 82px;
  height: 82px;
  background: var(--orange);
  left: 18%;
  top: 23px;
}
.cell-medium {
  width: 49px;
  height: 49px;
  background: var(--blue);
  right: 20%;
  top: 18px;
}
.cell-small {
  width: 28px;
  height: 28px;
  background: var(--green);
  right: 22%;
  bottom: 14px;
}
.arena-art i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  left: 12%;
  top: 20%;
}
.arena-art i:nth-of-type(2) {
  background: var(--blue);
  left: 53%;
  top: 76%;
}
.arena-art i:nth-of-type(3) {
  background: var(--green);
  left: 86%;
  top: 42%;
}
.arena-art i:nth-of-type(4) {
  left: 48%;
  top: 18%;
}
.arena-art i:nth-of-type(5) {
  background: var(--green);
  left: 8%;
  top: 75%;
}
.arena-art i:nth-of-type(6) {
  background: var(--blue);
  left: 89%;
  top: 80%;
}
.arena-caption {
  font-size: 11px;
  color: #bec5ca;
  font-weight: bold;
  margin: 9px 0 0;
}
.modes-panel {
  background: #292b2d;
}
.account-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 13px 11px;
}
.guest-avatar {
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #684100;
  border: 3px solid #ffba31;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: bold;
}
.account-bar strong {
  display: block;
  font-size: 13px;
}
.account-bar small {
  display: block;
  font-size: 10px;
  color: #a6afb6;
  margin-top: 5px;
}
.feature-buttons {
  display: flex;
  gap: 5px;
  padding: 0 12px 13px;
}
.feature-buttons button {
  flex: 1;
  font-size: 10px;
  padding: 6px 3px;
  font-weight: bold;
  border-radius: 0;
}
.mode-list {
  display: flex;
  flex-direction: column;
}
.mode .player-count {
  margin-left: auto;
  white-space: nowrap;
  color: #b4c8da;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.mode .player-count.offline {
  color: #ffab89;
}
.mode {
  border: 0;
  border-bottom: 1px solid #ffffff0b;
  width: 100%;
  padding: 11px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  background: #323537;
  color: #dce1e5;
  min-height: 42px;
}
.mode:nth-child(even) {
  background: #2b2e30;
}
.mode strong {
  font-size: 14px;
}
.mode.active {
  background: linear-gradient(90deg, #078d14, #0da820);
  color: white;
  box-shadow: inset 3px 0 0 #50e65a;
}
.mode:disabled {
  color: #b9bfc4;
}
.soon {
  font-size: 8px;
  padding: 3px 5px;
  border: 1px solid #ff9d0040;
  color: #ffbd52;
  background: #ff9d000b;
}
.live {
  font-size: 8px;
  color: #d7ffdb;
}
.mode-note {
  font-size: 9px;
  color: #89969f;
  text-align: center;
  margin: 12px 0;
}
#connecting {
  display: none;
  position: absolute;
  z-index: 100;
  right: 12px;
  bottom: 12px;
  pointer-events: none;
  color: white;
}
#connecting > div {
  width: auto !important;
  max-width: 300px;
  margin: 0 !important;
  padding: 12px !important;
  background: #252729 !important;
  border-radius: 2px !important;
}
#connecting h2 {
  font-size: 13px;
  margin: 0;
}
#connecting p {
  font-size: 11px;
  color: #bbb;
  margin: 6px 0 0;
}
.modal-content {
  background: #2b2e30;
  color: white;
  border-radius: 3px;
}
.modal-header,
.modal-footer {
  border-color: var(--line);
}
.modal .close {
  color: white;
}
.skin-choice {
  background: var(--blue);
  color: white;
  border: 1px solid #006dcb;
  padding: 12px;
  margin: 5px;
  border-radius: 0;
}
.skin-choice img {
  display: block;
  width: 64px;
  margin: 0 auto 8px;
}
.loader {
  width: 32px;
  height: 32px;
  border: 4px solid #555;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.center {
  display: table;
  margin: auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 850px) {
  #helloDialog {
    grid-template-columns: 1fr 280px;
    max-width: 650px;
    margin: 0 auto;
  }
  .news-panel {
    display: none;
  }
  .play-panel {
    padding: 22px;
  }
}
@media (max-width: 580px) {
  #overlays {
    padding: 15px 10px;
  }
  #helloDialog {
    display: flex;
    flex-direction: column;
    max-width: 390px;
  }
  .play-panel {
    padding: 20px 25px;
  }
  .modes-panel {
    border-top: 1px solid var(--line);
  }
  .arena-art,
  .arena-caption {
    display: none;
  }
  .mode {
    min-height: 38px;
    padding: 9px 15px;
  }
  .account-bar {
    padding-top: 12px;
  }
  #connecting {
    display: none !important;
  }
}

/* Nickname: avoid an outer rectangle when the field is focused. */
#nick:focus,
#nick:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Cellys wordmark based on the user's sketch. */
#title {
  transform: none;
  text-shadow: none;
  font-size: 0;
  line-height: 1;
  letter-spacing: 0;
  margin: 0 auto;
}
#title .cellys-logo {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
}

/* Cellys menu refresh: compact translucent surfaces and distinct buttons. */
#helloDialog {
  background: rgba(35, 43, 52, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: 0 18px 55px #0005;
}
.news-panel {
  background: rgba(20, 27, 35, 0.67);
}
.play-panel {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.015)
  );
}
.modes-panel {
  background: rgba(21, 29, 38, 0.66);
}
.bar {
  background: rgba(9, 17, 26, 0.45);
  border-bottom: 1px solid #ffffff0d;
  letter-spacing: 0.4px;
}
.join-row {
  gap: 7px;
}
#nick {
  border: 1px solid #ffffff30;
  border-radius: 5px;
  background: rgba(247, 251, 255, 0.95);
  height: 36px;
  padding: 6px 10px;
}
#play-btn,
.button-row button,
.feature-buttons button {
  position: relative;
  border-radius: 5px;
  border: 1px solid #ffffff30;
  box-shadow:
    inset 0 1px 0 #ffffff35,
    0 3px 0 #0003;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
  letter-spacing: 0.15px;
}
#play-btn {
  background: linear-gradient(160deg, #29bf56, #139936);
  width: 68px;
  font-size: 13px;
}
.button-row {
  gap: 7px;
  margin-top: 8px;
}
.button-row button {
  padding: 9px 6px;
  font-size: 12px;
}
.button-row .blue,
.feature-buttons .blue {
  background: linear-gradient(150deg, #219bff, #087ace);
}
.button-row .orange,
.feature-buttons .orange {
  background: linear-gradient(150deg, #ffb12b, #ed8b08);
}
#play-btn:hover:not(:disabled),
.button-row button:hover:not(:disabled) {
  filter: none;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 #ffffff50,
    0 4px 0 #0003,
    0 0 14px #168cf025;
}
#play-btn:active:not(:disabled),
.button-row button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 3px #0002,
    0 1px 0 #0003;
}
.button-row button:disabled,
.feature-buttons button:disabled {
  background: rgba(255, 255, 255, 0.055);
  color: #98a6b3;
  border-color: #ffffff12;
  filter: none;
  opacity: 1;
  box-shadow: none;
}
.mini-soon {
  border: 1px solid #ffffff14;
  background: #ffffff08;
  color: #b8c3cc;
  border-radius: 3px;
}
.feature-buttons {
  gap: 7px;
}
.feature-buttons button {
  padding: 7px 3px;
}
.mode-list {
  padding: 7px;
  gap: 4px;
}
.mode {
  border: 1px solid #ffffff09;
  border-radius: 4px;
  min-height: 39px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.035);
}
.mode:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
.mode.active {
  background: linear-gradient(
    100deg,
    rgba(22, 140, 240, 0.34),
    rgba(22, 140, 240, 0.12)
  );
  border-color: #168cf077;
  box-shadow: inset 3px 0 0 #168cf0;
}
.mode.active:hover {
  background: rgba(22, 140, 240, 0.35);
}
.mode strong {
  font-size: 13px;
}
.mode:disabled {
  color: #a6b1bc;
}
.live {
  color: #8bcaff;
  font-size: 8px;
}
.soon {
  color: #d5ad72;
  border-color: #ff9d002a;
  background: #ff9d0008;
  border-radius: 3px;
}
.account-bar {
  padding-bottom: 13px;
}
.guest-avatar {
  border-color: #ffb23d;
  background: linear-gradient(145deg, #ffb12b, #ed8b08);
  box-shadow: 0 2px 8px #0003;
}
#connection-state {
  margin: 13px 0 4px;
  font-size: 10px;
}
.subtitle {
  color: #a8b5c3;
  letter-spacing: 1.5px;
}
@media (prefers-reduced-motion: reduce) {
  #play-btn,
  .button-row button,
  .feature-buttons button {
    transition: none;
  }
}
/* Apple-inspired switches; native checkbox behavior and saved settings retained. */
#settings {
  margin-top: 12px;
  padding: 4px 12px;
  background: rgba(13, 22, 31, 0.65);
  border: 1px solid #ffffff15;
  border-radius: 9px;
}
#settings > div {
  margin: 0 !important;
}
:is(#settings, #custom-panel) label {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 43px;
  padding: 7px 0;
  margin: 0;
  font-size: 12px;
  color: #e3e9ef;
  border-bottom: 1px solid #ffffff0c;
  cursor: pointer;
}
:is(#settings, #custom-panel) label:last-child {
  border-bottom: 0;
}
:is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 49px;
  width: 49px;
  height: 28px;
  margin: 0;
  border: 1px solid #ffffff15;
  border-radius: 999px;
  background: #53606b;
  box-shadow: inset 0 1px 3px #0003;
  cursor: pointer;
  transition:
    background 0.18s,
    border-color 0.18s;
}
:is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"]::before {
  content: "OFF";
  position: absolute;
  right: 5px;
  top: 8px;
  font: bold 7px Arial;
  color: #e4e9ed;
  line-height: 10px;
}
:is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0005;
  transition: transform 0.18s;
}
:is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"]:checked {
  background: #30c96b;
  border-color: #30c96b;
}
:is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"]:checked::before {
  content: "ON";
  left: 6px;
  right: auto;
  color: #fff;
}
:is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"]:checked::after {
  transform: translateX(21px);
}
@media (prefers-reduced-motion: reduce) {
  :is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"],
  :is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"]::after {
    transition: none;
  }
}

/* Switch state is conveyed by track color and thumb position. */
:is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"]::before,
:is(#settings, #display-panel, #camera-panel, #multibox-panel, #custom-panel, .bot-hotkey-card) input[type="checkbox"]:checked::before {
  content: none;
}

/* Skin chooser next to the nickname, with a compact add badge. */
.join-row {
  align-items: center;
  gap: 7px;
}
#skins-btn.skin-avatar {
  position: relative;
  flex: 0 0 45px;
  width: 45px;
  height: 45px;
  border: 2px solid #168cf0;
  border-radius: 50%;
  background: linear-gradient(145deg, #314e6d, #172a3e);
  padding: 0;
  color: white;
  box-shadow: 0 2px 6px #0004;
  cursor: pointer;
}
.skin-initial {
  font:
    bold 24px Ubuntu,
    Arial;
  line-height: 40px;
}
#skin-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
#skin-preview[hidden] {
  display: none;
}
.skin-add {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  background: #35c728;
  border: 1px solid #b6f27e;
  border-radius: 50%;
  font: bold 17px Arial;
  color: white;
  line-height: 1;
  box-shadow: 0 1px 3px #0005;
}
#skins-btn.skin-avatar:hover {
  border-color: #82caff;
  background: #254767;
}
#play-btn {
  height: 36px;
}

/* Expandable preferences area, accessible from the menu gear. */
.play-panel {
  position: relative;
}
#preferences-btn {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff25;
  border-radius: 6px;
  color: #d9e8f4;
  background: #12223166;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
#preferences-btn:hover {
  color: #fff;
  background: #168cf055;
  border-color: #168cf0;
}
#settings-dialog {
  color: #eef4fa;
  background: #111d2def;
  border: 0;
  border-radius: 8px;
  padding: 0;
  position: fixed;
  inset: auto;
  margin: 0;
  box-sizing: border-box;
  max-width: none;
  max-height: none;
  overflow: hidden;
  box-shadow: 0 18px 55px #0005;
}
#settings-dialog::backdrop {
  background: transparent;
}
body:has(#settings-dialog[open]) #helloDialog {
  visibility: hidden;
}
.preferences-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ffffff15;
  padding: 17px 20px;
}
.preferences-header h2 {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
}
#settings-close {
  background: none;
  border: 0;
  color: #b7c9d9;
  font-size: 26px;
  line-height: 1;
  padding: 0 3px;
  cursor: pointer;
}
.hotkeys-section {
  padding: 20px;
}
.hotkeys-section h3 {
  font-size: 15px;
  color: #ffad2f;
  margin: 0 0 7px;
  font-weight: bold;
}
.hotkeys-description {
  font-size: 11px;
  color: #99adbf;
  margin-bottom: 14px;
}
.hotkey-list {
  margin: 0;
}
.hotkey-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 43px;
  border-bottom: 1px solid #ffffff0c;
  padding: 9px 0;
}
.hotkey-list > div:last-child {
  border: 0;
}
.hotkey-list dt {
  font-size: 12px;
  font-weight: normal;
}
.hotkey-list dt small {
  display: block;
  color: #94a9bc;
  font-size: 10px;
  margin-top: 3px;
}
.hotkey-list dd {
  margin: 0;
  white-space: nowrap;
}
.hotkey-list kbd {
  background: #ffffff0d;
  border: 1px solid #ffffff20;
  border-bottom: 2px solid #ffffff30;
  border-radius: 5px;
  color: #fff;
  font:
    11px Ubuntu,
    Arial;
  padding: 5px 9px;
  box-shadow: none;
}

.hotkey-bind {
  box-sizing: border-box;
  width: 48px;
  height: 30px;
  padding: 0 4px;
  text-align: center;
  background: #168cf025;
  border: 1px solid #168cf077;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #fff;
  font:
    bold 12px Ubuntu,
    Arial;
  cursor: pointer;
}
.hotkey-bind:hover {
  background: #168cf050;
}
.hotkey-bind.listening {
  background: #ff9d0025;
  border-color: #ef515d;
  color: #ff727c;
}
#hotkey-status {
  font-size: 11px;
  color: #ffca7c;
  min-height: 16px;
  margin: 0 0 5px;
}
.hotkeys-description {
  margin-bottom: 6px;
}

#hotkeys-reset,
.transfer-button {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid #168cf077;
  border-radius: 5px;
  background: #168cf025;
  color: #eaf5ff;
  font:
    bold 12px Ubuntu,
    Arial;
  cursor: pointer;
}
#hotkeys-reset:hover,
.transfer-button:hover {
  background: #168cf050;
}

/* The world blurs below the HUD; menus retain their own higher layer. */
body.game-menu-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #19212960;
  pointer-events: none;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.testing-section h3 {
  font-size: 15px;
  color: #ffad2f;
  margin: 0 0 10px;
  font-weight: bold;
}
.testing-section p {
  font-size: 12px;
  line-height: 1.6;
  color: #b8c7d6;
}
#test-mass-form label {
  display: block;
  font-size: 12px;
  margin-top: 15px;
}
#test-mass {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ffffff30;
  border-radius: 5px;
  background: #101d29;
  color: white;
  margin: 7px 0 10px;
}
#test-mass-apply {
  width: 100%;
  padding: 9px;
  border: 1px solid #168cf0;
  border-radius: 5px;
  color: #fff;
  background: #168cf050;
  font-weight: bold;
}
#test-mass-apply:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#test-mass-status {
  margin-top: 12px;
  color: #ffca7c;
}

#multibox-hotkey[hidden] {
  display: none !important;
}
#settings #full-map-toggle:disabled {
  opacity: 0.55;
  background: #505d68;
  border-color: #ffffff26;
  cursor: not-allowed;
}
#animated-outlines:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.render-delay-setting {
  padding: 10px 0;
  border-top: 1px solid #ffffff15;
}
.render-delay-setting input[type="range"] {
  width: 100%;
  accent-color: #168cf0;
}
.render-delay-setting p {
  font-size: 11px;
  color: #b7c9da;
}
.render-delay-setting button {
  border: 1px solid #168cf077;
  border-radius: 5px;
  background: #168cf025;
  color: #eaf5ff;
  padding: 6px 10px;
  font-size: 11px;
}
#settings .render-delay-setting label {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 12px;
  color: #eef4fa;
}
#cell-render-delay-value {
  color: #fff;
  font-weight: bold;
}

/* Discreet current-mode indicator. */
#mode-hud {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #202a36;
  color: #e2eaf0;
  font:
    10px Ubuntu,
    Arial,
    sans-serif;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  user-select: none;
}
#mode-hud:hover {
  background: #293441;
}
#mode-hud[hidden] {
  display: none !important;
}
#second-profile-row[hidden] {
  display: none !important;
}
#second-profile-row {
  margin-top: 7px;
  align-items: center;
}
#nick-2 {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 1px solid #ffffff30;
  border-radius: 5px;
  background: rgba(247, 251, 255, 0.95);
  color: #252525;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: bold;
}
.secondary-avatar {
  position: relative;
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  padding: 0;
  border: 2px solid #ff9d00;
  border-radius: 50%;
  background: #263b50;
  color: white;
  font-weight: bold;
  overflow: hidden;
}
#skin-preview-2 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#profiles-dialog {
  color: #eef4fa;
  background: rgba(26, 37, 48, 0.98);
  border: 1px solid #ffffff26;
  border-top: 3px solid #168cf0;
  border-radius: 10px;
  padding: 0;
  width: min(480px, calc(100vw - 32px));
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 20px 70px #0007;
}
#profiles-dialog::backdrop {
  background: transparent;
}
#profiles-form {
  padding: 16px 20px;
}
#profiles-form fieldset {
  border: 0;
  border-bottom: 1px solid #ffffff15;
  padding: 0 0 12px;
  margin-bottom: 14px;
}
#profiles-form legend {
  font:
    700 13px Ubuntu,
    Arial;
  color: #fff;
  border: 0;
  margin: 0 0 10px;
}
.profile-fields {
  display: flex;
  gap: 14px;
  align-items: center;
}
.profile-fields > img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #168cf0;
}
.profile-fields > div {
  flex: 1;
  min-width: 0;
}
.profile-fields label {
  display: block;
  font-size: 11px;
  color: #b7c9da;
  margin-bottom: 4px;
}
.profile-fields input {
  width: 100%;
  background: #101d29;
  color: white;
  border: 1px solid #ffffff30;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 12px;
  margin-bottom: 8px;
}
.profile-presets {
  display: flex;
  gap: 7px;
  margin: 4px 0 0 76px;
}
.profile-presets button,
#profiles-save {
  background: #168cf025;
  border: 1px solid #168cf077;
  border-radius: 5px;
  color: #eef4fa;
  padding: 6px 10px;
  font-size: 11px;
}
.profile-error,
#profiles-status {
  font-size: 11px;
  color: #ffca7c;
  margin: 6px 0 0;
}
.profile-help {
  font-size: 11px;
  line-height: 1.5;
  color: #a7bacb;
}
#profiles-save {
  width: 100%;
  background: #168cf0;
  font-weight: bold;
  margin-top: 10px;
  padding: 9px;
}
#second-profile-editor[hidden] {
  display: none !important;
}
#profiles-close {
  border: 0;
  background: transparent;
  color: #b7c9da;
  font-size: 24px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
#profiles-close:hover {
  color: white;
}
#second-profile-editor .profile-fields > img {
  border-color: #ff9d00;
}
.profile-fields input:focus,
#nick-2:focus {
  outline: none;
  box-shadow: none;
  border-color: #168cf0;
}

/* Shared settings workspace. */
#settings-dialog[open] {
  display: flex;
  flex-direction: column;
}
@media (prefers-reduced-motion: no-preference) {
  #settings-dialog[open] {
    animation: settings-dialog-enter 220ms cubic-bezier(0.2, 0.75, 0.25, 1);
  }
  @keyframes settings-dialog-enter {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}
#settings-dialog .preferences-header {
  flex-shrink: 0;
  justify-content: flex-end;
  padding: 9px 14px;
  background: #111d2def;
}
#settings-dialog #settings-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
}
#settings-dialog #settings-close:hover {
  background: #ffffff10;
  color: #fff;
}
#settings-dialog [hidden] {
  display: none !important;
}
.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.settings-nav {
  padding: 14px 10px;
  border-right: 1px solid #ffffff10;
  background: #111d2def;
}
.settings-nav button {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #c7d4e1;
  text-align: left;
  cursor: pointer;
}
.settings-nav button:hover {
  background: #ffffff0b;
}
.settings-nav button[aria-pressed="true"] {
  border-color: #477fb752;
  background: linear-gradient(90deg, #477fb752, transparent);
  color: #fff;
  box-shadow: inset 3px 0 #6495cd;
}
.settings-nav button[data-section="transfer"][aria-pressed="true"],
#transfer-panel .transfer-button {
  border-color: #ffffff1a;
}
#transfer-panel .transfer-button {
  background: #1d2e3e;
}
#transfer-panel .transfer-button:hover {
  background: #263b4e;
}
#transfer-panel:not([hidden]) {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px 0;
}
#transfer-panel > .settings-card {
  width: min(460px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 30px;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
#transfer-panel .transfer-button {
  height: 36px;
  margin: 0;
  padding: 0 12px;
}
#transfer-panel #settings-transfer-status {
  grid-column: 1 / -1;
  justify-self: center;
}
#settings-dialog #settings-reset {
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #202a36;
  color: #eef4fa;
  font-size: 16px;
}
#settings-dialog #settings-reset:hover { background: #293441; }
#settings-dialog #settings-reset:focus-visible { outline: 2px solid var(--menu-accent); outline-offset: 2px; }
#settings-transfer-status:empty {
  display: none;
}
.settings-nav small {
  display: block;
  margin-top: 3px;
  color: #a4b8cb;
  font-size: 10px;
}
.settings-content {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.settings-panel {
  padding: 22px 26px;
}
.settings-panel:not([hidden]) {
  animation: settings-section-enter 160ms ease-out;
}
.settings-panel h3 {
  margin: 0 0 14px;
  font-size: 19px;
  color: #eef4fa;
}
#settings-dialog #settings {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.settings-display-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.settings-card {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #ffffff13;
  border-radius: 7px;
  background: #111d2def;
}
.settings-card h4 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: bold;
  color: #ffad2f;
}
#settings-dialog #hotkeys-reset {
  width: fit-content;
  display: block;
  margin: 0 0 12px auto;
}
#test-mass-form {
  max-width: 440px;
}
@keyframes settings-section-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 850px) {
  .settings-layout {
    grid-template-columns: 155px minmax(0, 1fr);
  }
  .settings-display-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 580px) {
  .settings-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .settings-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid #ffffff15;
  }
  .settings-nav button {
    min-width: 0;
    margin: 0;
    padding: 8px 4px;
    text-align: center;
  }
  .settings-nav small {
    display: none;
  }
  .settings-panel {
    padding: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .settings-panel:not([hidden]) {
    animation: none;
  }
  .settings-nav button {
    transition: none;
  }
}

#profiles-dialog.multibox-profiles {
  width: min(840px, calc(100vw - 32px));
}
.multibox-profiles #profiles-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.multibox-profiles #profiles-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #ffffff26;
  border-radius: 10px;
  background: #101d29;
}
.multibox-profiles #profiles-form > :not(fieldset) {
  grid-column: 1 / -1;
}
.multibox-profiles .profile-fields {
  flex-direction: column;
}
.multibox-profiles .profile-fields > img {
  width: 120px;
  height: 120px;
}
.multibox-profiles .profile-fields > div {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
}
.multibox-profiles .profile-fields label {
  grid-row: 1;
}
.multibox-profiles .profile-fields input {
  grid-row: 2;
  min-width: 0;
}
.multibox-profiles .profile-presets {
  margin: 4px 0 0;
  flex-wrap: wrap;
}
#profiles-dialog[open] {
  animation: profiles-enter 180ms ease-out;
}
@keyframes profiles-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
@media (max-width: 560px) {
  .multibox-profiles #profiles-form {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  #profiles-dialog[open] {
    animation: none;
  }
}

.profile-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #009dff;
}
.multibox-profiles .profile-avatar {
  width: 120px;
  height: 120px;
}
#second-profile-editor .profile-avatar {
  background: #ff9d00;
}
.profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ring-settings {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #ffffff26;
  border-radius: 13px;
  background: #101d29;
}
.ring-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
#settings-dialog .ring-row label {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}
.ring-row output {
  padding: 4px 8px;
  border-radius: 5px;
  background: #ffffff12;
  color: #eef4fa;
  font: 600 12px monospace;
}
#custom-panel .custom-color-row {
  flex-direction: row;
}
.ring-row input[type="color"],
.custom-color-row input[type="color"] {
  width: 36px;
  height: 26px;
  padding: 2px;
  border: 1px solid #ffffff35;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}
.custom-color-row input[type="color"]:hover {
  border-color: #ffffff80;
}
#settings-dialog:focus,
#settings-dialog :focus {
  outline: none;
}

/* Menu V4 */
#helloDialog {
  background: rgba(16, 25, 36, 0.76);
  border-radius: 10px;
  border-color: #a6c8e245;
}
#helloDialog .news-panel {
  background: #0b15215c;
  border-right: 1px solid #a6c8e21a;
}
#helloDialog .play-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 32px 24px;
  background: transparent;
}
#helloDialog #title {
  margin: 0 0 14px;
}
#helloDialog .join-row {
  align-items: center;
  gap: 8px;
}
#helloDialog #nick,
#helloDialog #play-btn {
  height: 42px;
  border-radius: 7px;
}
#helloDialog #play-btn {
  width: 78px;
}
#helloDialog .button-row button {
  min-height: 36px;
  border-radius: 7px;
}
#helloDialog #spectate-btn {
  color: #20170c;
}
#helloDialog .modes-panel {
  background: #0c1623a6;
}
@media (min-width: 581px) {
  #helloDialog .modes-panel {
    border-left: 1px solid #a6c8e21a;
  }
}
#helloDialog .bar {
  background: transparent;
  color: #b4c9de;
  text-align: left;
  padding: 8px 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#helloDialog .account-bar {
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #a6c8e21a;
}
#helloDialog .guest-avatar {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-width: 2px;
  font-size: 14px;
}
#helloDialog .account-bar small {
  margin: 0 0 0 auto;
  text-align: right;
}
#helloDialog .mode-list {
  --mode-row-height: 34px;
  height: calc(10 * var(--mode-row-height) + 8px);
  padding: 4px 10px;
  gap: 0;
  overflow: hidden auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
#helloDialog .mode-list::-webkit-scrollbar {
  display: none;
}
#helloDialog .mode-list > * {
  flex-shrink: 0;
}
#helloDialog .mode {
  gap: 8px;
  min-height: var(--mode-row-height);
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom-color: #a6c8e215;
  border-radius: 7px;
}
#helloDialog .mode:not(:disabled):hover {
  background: #168cf019;
}
#helloDialog .mode.active,
#helloDialog .mode-group:not([open]):has(.room.active) > summary {
  border-color: #168cf040;
  background: #168cf027;
  color: #fff;
  box-shadow: inset 3px 0 #168cf0;
}
.mode-group-heading {
  cursor: pointer;
  list-style: none;
}
.mode-group-heading::-webkit-details-marker {
  display: none;
}
.mode-group-heading::before {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
}
.mode-group[open] > .mode-group-heading::before {
  transform: rotate(45deg);
}
.room-list {
  margin-left: 12px;
  padding-left: 6px;
  border-left: 1px solid #a6c8e225;
}
#helloDialog .room strong {
  font-size: 12px;
}
#helloDialog .shop-row {
  justify-content: center;
}
#helloDialog .shop-row button {
  flex: 0 1 auto;
  padding: 0 12px;
  min-height: 28px;
  background: transparent;
  border-color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  #profiles-dialog[open] > *,
  #settings-dialog[open] .settings-layout,
  .play-panel:has(.skin-editor:not([open])) #play-form {
    animation: menu-content-in 160ms ease-out both;
  }
}
@keyframes menu-content-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#helloDialog #preferences-btn[aria-disabled="true"] {
  cursor: default;
}
@media (max-width: 580px) {
  #helloDialog .play-panel {
    padding: 28px 18px 16px;
  }
}

#helloDialog .skins-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 18px 12px;
}
.skins-panel h2 {
  margin: 0;
  font-size: 16px;
}
.menu-skins {
  display: flex;
  justify-content: center;
  gap: 14px;
}
#helloDialog .menu-skins .skin-avatar {
  position: relative;
  flex: none;
  width: 88px;
  height: 88px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: white;
  background: #102134;
  overflow: hidden;
}
#helloDialog #skins-btn-2 {
  border-color: #ff9d00;
}
.menu-skins img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.menu-skins .skin-avatar[hidden],
.menu-skins img[hidden] {
  display: none;
}
#helloDialog .menu-skins .skin-avatar:hover {
  filter: brightness(1.25);
}
@media (min-width: 581px) and (max-width: 850px) {
  #helloDialog .skins-panel {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.skin-carousel {
  display: flex;
  align-items: center;
  gap: 5px;
}
.skin-carousel > button {
  border: 0;
  border-radius: 5px;
  background: #202a36;
  min-width: 26px;
  min-height: 38px;
  color: #d9e8f4;
  padding: 0 6px;
  font-size: 24px;
  line-height: 28px;
}
.skin-carousel > button:is(:hover, :focus-visible) {
  background: #394859;
  color: #fff;
}

.profile-avatar:has(img:not([hidden])),
#second-profile-editor .profile-avatar:has(img:not([hidden])) {
  background: transparent;
}

.play-panel:has(.skin-editor[open]) > :not(.skin-editor) {
  visibility: hidden;
}
#profiles-dialog.skin-editor {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #111d2def;
}
.skin-editor[open] {
  display: flex;
  flex-direction: column;
}
.skin-editor #profiles-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.skin-editor #profiles-form fieldset {
  flex: 1;
  margin: 0;
  border: 0;
  min-width: 0;
}
.skin-editor #profiles-form fieldset[hidden],
.skin-editor legend {
  display: none;
}
.skin-editor .profile-fields {
  height: 100%;
  flex-direction: column;
}
.skin-editor .profile-avatar {
  width: min(155px, calc(100vw - 120px));
  height: auto;
  aspect-ratio: 1;
  flex: none;
  margin: 0 auto;
}
.skin-editor .profile-fields > div {
  flex: none;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
  text-align: left;
}
.skin-editor .profile-fields label {
  grid-row: 1;
}
.skin-editor .profile-fields input {
  grid-row: 2;
  min-width: 0;
}

.menu-skins .skin-initial {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 4px #0009;
  pointer-events: none;
}

.skin-editor .profile-fields input[type="search"] {
    width: min(180px, 100%);
    justify-self: center;
}

.skin-editor .preferences-header {
    display: grid;
    background: #111d2def;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
}

#profiles-title {
    grid-column: 2;
    text-align: center;
}
.skin-editor .profile-player-badge {
  grid-column: 1;
  grid-row: 1;
  place-self: center;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #1f57fd;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.skin-editor .profile-player-badge[data-player="2"] {
  background: #ff9d00;
  color: #17212c;
}

.skin-editor .profile-fields [hidden] {
  display: none;
}
.skin-editor .profile-fields > .vanilla-gallery {
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  max-height: 114px;
  overflow-y: auto;
  padding: 3px;
}
.skin-editor .vanilla-gallery button {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 50%;
  background: #102134;
  padding: 0;
  overflow: hidden;
}
.skin-editor .vanilla-gallery button:is(:hover, :focus-visible, [aria-pressed="true"]) {
  border-color: #168cf0;
}
.skin-editor .vanilla-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.skin-editor .profile-fields > div:has(input[hidden]) {
  display: block;
  width: min(210px, 100%);
  margin-inline: auto;
}

.skin-editor .profile-avatar.skin-in-use {
  outline: 2px solid #168cf0;
  outline-offset: 3px;
}
.skin-editor #second-profile-editor .profile-avatar.skin-in-use {
  outline-color: #ff9d00;
}

.skin-source {
  grid-column: 1 / -1;
  margin: 4px auto;
  display: block;
  border: 0;
  background: transparent;
  color: #a4d6ff;
  font-size: 12px;
}

.imgur-profile-arrow {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #eef4fa;
  padding: 0 8px;
  font-size: 30px;
}
#second-profile-editor .imgur-profile-arrow { left: auto; right: calc(100% + 8px); }

/* Menu profile captions and Custom appearance preview. */
.skin-slot {
  position: relative;
  display: grid;
  justify-items: center;
}
.skin-profile-name {
  position: absolute;
  top: calc(100% + 6px);
  max-width: 100%;
  overflow: hidden;
  color: #c4d2de;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skin-profile-name[hidden] {
  display: none;
}
.custom-preview {
  margin: 12px 0 0;
}
.custom-preview figcaption {
  margin-bottom: 6px;
  color: #b4c9de;
  font-size: 11px;
}
.custom-preview svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background-color: #f2fbff;
  background-image: linear-gradient(#19384720 1px, transparent 1px),
    linear-gradient(90deg, #19384720 1px, transparent 1px);
  background-size: 15px 15px;
}
.preview-cell {
  fill: #168cf0;
  stroke: #0d72c9;
  stroke-width: 1.5;
}
.preview-virus {
  fill: #33ff33;
  stroke: #2ee62e;
  stroke-width: 1.5;
}
.preview-virus-ring,
.preview-border {
  display: none;
  fill: none;
}
.preview-virus-ring {
  stroke: var(--preview-virus, #fff);
  stroke-width: var(--preview-virus-thickness, 1.5px);
}
.preview-border {
  stroke: var(--preview-border, #808080);
  stroke-width: var(--preview-border-thickness, 2px);
}
.preview-pellets circle {
  fill: var(--pellet);
}
#custom-panel:has([data-box-id="11"]:checked) .custom-preview svg {
  background: var(--preview-background, #000);
}
#custom-panel:has([data-box-id="11"]:checked) .preview-border,
#custom-panel:has([data-box-id="11"]:checked):has([data-box-id="13"]:checked) .preview-virus-ring {
  display: inline;
}
#custom-panel:has([data-box-id="11"]:checked):has([data-box-id="13"]:checked) .preview-virus {
  display: none;
}
#custom-panel:has([data-box-id="11"]:checked):not(:has([data-box-id="16"]:checked)) .preview-pellets circle {
  fill: var(--preview-pellet, #8746e8);
}
@media (prefers-reduced-motion: no-preference) {
  #custom-panel:has([data-box-id="8"]:checked) .preview-cell,
  #custom-panel:has([data-box-id="12"]:checked) .preview-virus {
    transform-box: fill-box;
    transform-origin: center;
    animation: preview-outline 1.2s ease-in-out infinite alternate;
  }
  #custom-panel:has([data-box-id="15"]:checked) .preview-border {
    animation: preview-border-pulse 1.4s ease-in-out infinite alternate;
  }
}
#custom-panel:has([data-box-id="11"]:checked):has([data-box-id="16"]:checked) .preview-pellets circle {
  fill: hsl(var(--rainbow-hue), 90%, 58%);
}
.preview-pellets circle:nth-child(1) { --rainbow-hue: 0deg; }
.preview-pellets circle:nth-child(2) { --rainbow-hue: 60deg; }
.preview-pellets circle:nth-child(3) { --rainbow-hue: 120deg; }
.preview-pellets circle:nth-child(4) { --rainbow-hue: 180deg; }
.preview-pellets circle:nth-child(5) { --rainbow-hue: 240deg; }
.preview-pellets circle:nth-child(6) { --rainbow-hue: 300deg; }
@keyframes preview-outline {
  to { transform: scale(1.05, 0.95) rotate(5deg); }
}
@keyframes preview-border-pulse {
  to { opacity: 0.42; }
}

/* Shared finish for menu fields and settings controls. */
#helloDialog #nick,
#profiles-dialog .profile-fields input,
#settings-dialog #test-mass {
  color-scheme: dark;
  color: #eef4fa;
  background: #111e2b;
  border: 1px solid #a6c8e240;
  border-radius: 7px;
}
#helloDialog #nick:hover,
#profiles-dialog .profile-fields input:hover,
#settings-dialog #test-mass:hover {
  border-color: #a6c8e273;
}
#helloDialog #nick:focus,
#profiles-dialog .profile-fields input:focus,
#settings-dialog #test-mass:focus {
  border-color: #168cf0;
}
#settings-dialog input[type="color"] {
  appearance: none;
  color-scheme: dark;
  width: 48px;
  height: 32px;
  padding: 4px;
  background: #111e2b;
  border: 1px solid #a6c8e21f;
  border-radius: 8px;
  cursor: pointer;
}
#settings-dialog input[type="color"]:is(:hover, :focus-visible) {
  border-color: #168cf0;
}
#settings-dialog input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
#settings-dialog input[type="color"]::-webkit-color-swatch {
  border: 1px solid #ffffff1a;
  border-radius: 4px;
}
#settings-dialog input[type="color"]::-moz-color-swatch {
  border: 1px solid #ffffff1a;
  border-radius: 4px;
}
#settings-dialog input[type="range"] {
  accent-color: #168cf0;
  color-scheme: dark;
}

#settings-dialog .hex-color-field {
  width: 9ch;
  padding: 5px 6px;
  border: 1px solid #a6c8e240;
  border-radius: 6px;
  background: #111e2b;
  color: #eef4fa;
  font: 600 12px monospace;
  text-align: center;
}
#settings-dialog .hex-color-field:focus {
  border-color: #168cf0;
}
#settings-dialog .slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(60px, 34%);
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
#settings-dialog .slider-row label {
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
#settings-dialog .slider-row output {
  padding: 0;
  color: #eef4fa;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#settings-dialog .hotkey-list > .render-delay-setting {
  display: block;
}
#settings-dialog .slider-row input[type="range"] {
  appearance: none;
  width: 100%;
  height: 12px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: #0c1723;
  box-shadow: inset 0 0 0 1px #a6c8e22b;
  cursor: pointer;
}
#settings-dialog .slider-row input[type="range"]:focus-visible {
  box-shadow: inset 0 0 0 1px #168cf0;
}
#settings-dialog .slider-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 17px;
  height: 12px;
  border: 1px solid #5182bc;
  border-radius: 4px;
  background: #6495cd;
}
#settings-dialog .slider-row input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 10px;
  border: 1px solid #5182bc;
  border-radius: 4px;
  background: #6495cd;
}

.ring-preview svg {
  background-color: #101b27;
}
.ring-preview circle {
  fill: #253a50;
}
.ring-preview text {
  fill: #dceaf6;
  font: 600 11px Arial, sans-serif;
  text-anchor: middle;
}

.display-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
#settings-dialog .display-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#settings-dialog .display-select-row label {
  min-height: 0;
  padding: 0;
  border: 0;
}
#settings-dialog .display-select-row select {
  appearance: none;
  color-scheme: dark;
  color: #eef4fa;
  background-color: #202a36;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23b6c4d2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  border: 1px solid transparent;
  border-radius: 4px;
  width: 132px;
  max-width: 52%;
  height: 29px;
  padding: 4px 28px 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
#settings-dialog .display-select-row select:hover:not(:disabled) {
  background-color: #293441;
}
#settings-dialog .display-select-row select:focus-visible {
  outline: none;
  border-color: rgb(31, 87, 253);
}
#settings-dialog .display-select-row select option {
  background: #202a36;
  color: #eef4fa;
}
#settings-dialog .display-select-row select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#settings-dialog .display-select-row {
  min-height: 36px;
}
#settings-dialog #pixel-density-value {
  letter-spacing: 0;
}

@media (prefers-reduced-motion: no-preference) {
  #custom-panel:has([data-box-id="17"]:checked) .preview-virus-ring {
    animation: preview-ring-pulse 2.64s ease-in-out infinite;
  }
  #custom-panel:has([data-box-id="11"]:checked):has([data-box-id="18"]:checked) .preview-pellets {
    animation: preview-pellet-pulse 2.64s ease-in-out infinite;
  }
  #custom-panel:has([data-box-id="11"]:checked):has([data-box-id="18"]:checked):has([data-box-id="16"]:checked) .preview-pellets {
    animation: preview-pellet-rainbow 6.48s linear infinite;
  }
}
@keyframes preview-ring-pulse {
  50% { opacity: 0.65; stroke-width: calc(var(--preview-virus-thickness, 1.5px) + 1px); }
}
@keyframes preview-pellet-pulse {
  50% { opacity: 0.62; }
}
@keyframes preview-pellet-rainbow {
  to { filter: hue-rotate(360deg); }
}

#custom-panel .custom-control-group {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid #ffffff15;
}

#custom-panel label + .custom-control-group {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#custom-panel .custom-control-group .custom-color-row {
  margin-top: 0;
  min-height: 43px;
  padding: 5px 0;
  border-bottom: 1px solid #ffffff0c;
}

#custom-panel .custom-preview-card .custom-preview {
  margin: 0;
}
@media (max-width: 850px) {
  #custom-panel .custom-preview-card {
    position: sticky;
    top: 0;
    z-index: 1;
  }
  #custom-panel .custom-preview-card svg {
    max-height: 18vh;
  }
}
#custom-panel .custom-preview-card figcaption {
  margin-bottom: 10px;
  color: #eef4fa;
  font-size: 13px;
  font-weight: 600;
}
#custom-panel .custom-settings-scroll > label {
  border-bottom: 1px solid #ffffff0c;
}
@media (min-width: 851px) {
  .settings-content:has(> #custom-panel:not([hidden])) {
    overflow: hidden;
  }
  #custom-panel {
    height: 100%;
    padding-top: 16px;
  }
  #custom-panel .custom-layout {
    height: 100%;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: start;
  }
  #custom-panel .custom-settings-scroll {
    align-self: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
}

#custom-panel .custom-color-row {
  grid-template-columns: minmax(0, 1fr) 9ch 48px 27px;
  align-items: center;
  gap: 5px;
}
#settings-dialog #custom-panel .custom-color-row :is(.hex-color-field, input[type="color"]) {
  box-sizing: border-box;
  width: 100%;
  height: 27px;
  margin: 0;
}
#settings-dialog #custom-panel .custom-color-row .hex-color-field:not(:disabled) {
  cursor: pointer;
}
#custom-panel .reset-color {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid #a6c8e240;
  border-radius: 6px;
  background: #111e2b;
  color: #dceaf6;
}
#custom-panel .reset-color:hover:not(:disabled) {
  border-color: #168cf0;
}
#custom-panel :is(label, .custom-color-row, .slider-row):has(:disabled) {
  opacity: 0.55;
}
#custom-panel input:disabled {
  cursor: not-allowed;
}

.test-mass-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.test-mass-presets .transfer-button {
  width: auto;
  min-width: 66px;
  margin: 0;
}

#helloDialog .mode-list > .bar { margin: 0; padding-inline: 10px; justify-self: stretch; }
#helloDialog.menu-v6 .mode-list > .bar { text-align: center; }
.hotkey-columns { align-items: start; margin-bottom: 12px; }
.bot-hotkey-card .bot-panel-toggle {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-weight: normal;
}
#settings-dialog .slider-row:has(.reset-slider) {
  grid-template-columns: minmax(0, 1fr) auto minmax(40px, 30%) auto;
}
#settings-dialog :is(#display-panel, #camera-panel, #multibox-panel, #hotkeys-panel) .slider-row {
  grid-template-columns: minmax(0, 1fr) 60px minmax(40px, 30%) 27px;
}
#settings-dialog :is(#display-panel, #camera-panel, #multibox-panel, #hotkeys-panel) .slider-row output {
  grid-column: 2;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#settings-dialog :is(#display-panel, #camera-panel, #multibox-panel, #hotkeys-panel) .slider-row input[type="range"] {
  grid-column: 3;
  min-width: 0;
}
#settings-dialog .reset-slider {
  width: 27px;
  height: 23px;
  margin: 0;
  padding: 0;
  border: 1px solid #168cf077;
  border-radius: 5px;
  background: #168cf025;
  color: #eaf5ff;
  font-size: 11px;
  cursor: pointer;
}
#settings-dialog .reset-slider:hover:not(:disabled) {
  background: #168cf050;
}
#settings-dialog .reset-slider:disabled {
  opacity: 0.55;
  cursor: default;
}
#settings-dialog .slider-row:has(#special-start-zoom:disabled) {
  opacity: 0.55;
  pointer-events: none;
}
#bots-hud {
  position: fixed;
  z-index: 201;
  left: 12px;
  top: 48px;
  width: 165px;
  padding: 10px 12px;
  background: #111d2def;
  color: #eef4fa;
  border: 0;
  border-radius: 8px;
  pointer-events: none;
  font-size: 12px;
}
#bots-hud header, #bots-hud dl div { display: flex; justify-content: space-between; gap: 6px; }
#bots-hud output { padding: 0; color: #ffad2f; font: inherit; }
#bots-hud header { align-items: center; }
#bots-hud-count { margin-left: auto; }
#bots-hud-toggle {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  padding: 0;
  line-height: 1;
  border: 1px solid #ffffff24;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}
#bots-hud-toggle:hover { border-color: #168cf0; }
#bots-hud.collapsed {
  width: auto;
  padding: 0;
  margin: 10px 0 0 12px;
  background: transparent;
  border-color: transparent;
}
#bots-hud.collapsed header > :not(#bots-hud-toggle) { display: none; }
#bots-hud.collapsed #bots-hud-toggle { background: #111d2def; }

#bot-mode-picker { margin: 6px 0; user-select: none; }
#bot-mode-picker .bot-mode-readout {
  padding: 4px;
  border: 1px solid transparent;
  background: #101923;
  border-radius: 4px;
  color: #b4c9de;
  font-size: 11px;
}
#bot-mode-picker .bot-mode-readout strong { float: right; color: #eef4fa; }
#bot-mode[hidden] { display: none; }
#bot-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}
#bot-mode label {
  position: relative;
  margin: 0;
  pointer-events: auto;
  cursor: pointer;
}
#bot-mode input {
  position: absolute;
  opacity: 0;
}
#bot-mode span {
  display: block;
  padding: 4px 2px;
  border: 1px solid transparent;
  background: #101923;
  border-radius: 4px;
  text-align: center;
  font-size: 10px;
  white-space: nowrap;
}
#bot-mode label:hover > span {
  background: #293441;
}
#bot-mode input:focus-visible + span {
  outline: 1px solid #eef4fa;
}
#bots-hud dl { margin: 0; }
#bots-hud dl div { border-top: 1px solid #ffffff15; }
#bots-hud dt { font-weight: 500; }
#bots-hud dd { margin: 0; }
#bots-hud dl div { align-items: center; padding: 3px 0; }
#bots-hud .hotkey-bind {
  pointer-events: auto;
  width: 43px;
  height: 22px;
  font-size: 11px;
}

/* Menu V5 */
#helloDialog.menu-v5 {
  gap: 8px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}
#helloDialog.menu-v5 > :is(.skins-panel, .play-panel, .modes-panel) {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: #111d2def;
  box-shadow: 0 8px 24px #0003;
}
#helloDialog.menu-v5 > .modes-panel {
  position: relative;
  padding-bottom: 24px;
}
.menu-panel-caption {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 12px;
  color: #b4bac0;
  font-size: 10px;
}
.modes-panel > .menu-panel-caption {
  inset-inline-start: auto;
  inset-inline-end: 12px;
  color: var(--orange);
}
#helloDialog.menu-v5 > .play-panel {
  box-shadow: none;
}
#helloDialog.menu-v5 .cellys-logo {
  max-width: 220px;
}
#helloDialog.menu-v6 #play-form .button-row {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#helloDialog.menu-v6 #play-form .button-row button {
  width: 100%;
  border: 0;
}
#helloDialog.menu-v6 #settings-btn {
  grid-column: 1 / -1;
  height: 36px;
  min-height: 0;
}
@media (min-width: 851px) {
  #helloDialog.menu-v6 {
    width: min(866px, 100%);
  }
  #helloDialog.menu-v6 .play-panel {
    padding-inline: 20px;
  }
  #helloDialog.menu-v6 :is(#nick, #play-btn, #spectate-btn) {
    height: 38px;
  }
  #helloDialog.menu-v6 #settings-btn {
    height: 34px;
  }
}
#helloDialog.menu-v6 :is(#play-btn, #spectate-btn, #settings-btn) {
  background: #454c56;
  color: #fff;
}
#helloDialog.menu-v6 :is(#play-btn, #spectate-btn, #settings-btn):hover:not(:disabled) {
  background: #505965;
}
#helloDialog.menu-v6 #play-btn {
  background: #1f57fd;
}
#helloDialog.menu-v6 #play-btn:hover:not(:disabled) {
  background: #3260f8;
}
#helloDialog.menu-v6 #nick:focus {
  border-color: #168cf0;
  outline: none;
  box-shadow: none;
}
#helloDialog.menu-v6 #spectate-btn {
  color: #fff;
  text-shadow: 0 1px 2px #0004;
}
#helloDialog.menu-v6 :is(#play-btn, #spectate-btn, #settings-btn) {
  font-family: Ubuntu, Arial, sans-serif;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.menu-action-icon {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
}
#spectate-btn .menu-action-icon {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 1px 1px #0004);
}
#helloDialog.menu-v6 .mode-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 4px;
}
#helloDialog.menu-v6 .mode-list > :not(.mode-group) {
  grid-column: 1 / -1;
}
#helloDialog.menu-v6 .mode-list > .mode-group > summary {
  position: relative;
  aspect-ratio: 1;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-inline: 2px;
}
#helloDialog.menu-v6 .mode-list > .mode-group > summary .player-count {
  order: -1;
  margin-inline: 0;
  font-size: 10px;
}
.vanilla-mode-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
#helloDialog.menu-v6 .mode-list > .mode-group strong {
  max-width: 100%;
  font-size: clamp(10px, 2vw, 12px);
  line-height: 1.1;
}
#helloDialog.menu-v6 .mode-list > .mode-group > summary::before {
  position: absolute;
  right: 7px;
  top: 7px;
}
#helloDialog.menu-v6 .mode-list > .mode-group .room {
  flex-wrap: wrap;
  justify-content: center;
  padding-inline: 2px;
  gap: 2px;
}
#helloDialog.menu-v6 .mode-list > .mode-group .room .player-count {
  margin-inline: 0;
  font-size: 10px;
}
#helloDialog.menu-v6 .modes-panel .mode {
  background-color: #202a36;
  border-color: transparent;
  min-height: 32px;
  padding-block: 4px;
  justify-content: space-between;
}
#helloDialog.menu-v6 .mode-group {
  border-radius: 7px;
  overflow: hidden;
}
#helloDialog.menu-v6 .mode-group[open] > summary {
  border-radius: 0;
}
#helloDialog.menu-v6 .mode-group > .room-list {
  margin: 0;
  padding: 0;
  gap: 0;
}
@media (prefers-reduced-motion: no-preference) {
  #helloDialog.menu-v6 .mode-group::details-content {
    interpolate-size: allow-keywords;
    block-size: 0;
    overflow: clip;
    opacity: 0;
    transition: block-size 180ms ease, opacity 140ms ease, content-visibility 180ms allow-discrete;
  }
  #helloDialog.menu-v6 .mode-group[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
}
#helloDialog.menu-v6 .mode-group .room {
  background-color: #17212c;
  border-radius: 0;
  padding-inline-start: 14px;
}
#helloDialog.menu-v6 .mode-group-heading::before {
  order: 1;
  width: 7px;
  height: 7px;
  transform: translateY(-2px) rotate(45deg);
}
#helloDialog.menu-v6 .mode-group[open] > .mode-group-heading::before {
  transform: translateY(2px) rotate(225deg);
}
#helloDialog.menu-v6 .mode-group-heading .player-count {
  margin-inline-start: auto;
}
#helloDialog.menu-v6 .modes-panel .mode:not(.mode-group-heading) .player-count {
  margin-inline-end: 15px;
}
#helloDialog.menu-v6 .modes-panel .mode:not(.active):not(:disabled):hover {
  background-color: #293441;
}
#helloDialog.menu-v6 .modes-panel .mode.active,
#helloDialog.menu-v6 .modes-panel .mode-group:not([open]):has(.room.active) > summary {
  background-image: linear-gradient(90deg, #477fb752, transparent);
  background-color: #17212c;
  border-color: transparent;
  box-shadow: inset 3px 0 #6495cd;
}
@media (prefers-reduced-motion: no-preference) {
  #helloDialog.menu-v6 .modes-panel .mode {
    transition: background-color 150ms ease-out, border-color 150ms ease-out;
  }
}
#helloDialog.menu-v5 #profiles-dialog.skin-editor {
  border-radius: inherit;
}
@media (max-width: 580px) {
  #helloDialog.menu-v5 > .play-panel {
    min-height: 310px;
  }
}

.skin-editor .skin-source[aria-pressed="true"] {
  background: #168cf027;
  border-color: #168cf0;
  color: #fff;
}
#helloDialog.menu-v6:has(.skin-editor[open]) > .play-panel {
  position: static;
}
#helloDialog.menu-v6 #profiles-dialog.skin-editor[open] {
  position: absolute;
  inset: 0;
  z-index: 5;
  box-sizing: border-box;
  height: 100%;
  overflow: auto;
  border-radius: 8px;
}
.skin-editor .profile-fields > .vanilla-gallery:not([hidden]) {
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  max-height: none;
  overflow: visible;
}
.skin-editor fieldset[data-profile="1"] .vanilla-gallery button[aria-pressed="true"] {
  border-color: #ff9d00;
}
.skin-editor :is([id^="profile-name-"], label[for^="profile-name-"]) {
  display: none;
}
.skin-editor .profile-fields :is([id^="profile-skin-"], label[for^="profile-skin-"]) {
  grid-column: 1 / -1;
}
.gallery-preview-arrows {
  display: none;
}
.skin-editor .profile-avatar .gallery-preview-arrows {
  position: absolute;
  inset: 0 -36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.gallery-preview-arrows button {
  pointer-events: auto;
  border: 0;
  border-radius: 5px;
  background: #263747;
  color: #eef4fa;
  font-size: 22px;
  padding: 0 8px;
}
.skin-editor .gallery-clear-skin {
  display: none;
}
.skin-editor .profile-avatar .gallery-clear-skin:not([hidden]) {
  display: grid;
  place-items: center;
  position: absolute;
  top: 4px;
  right: -36px;
  z-index: 1;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #536b80;
  border-radius: 50%;
  background: #182632;
  color: #fff;
  font-size: 18px;
}

#helloDialog.menu-v6 .modes-panel .mode.vanilla-ffa {
  background-color: #773044;
}
#helloDialog.menu-v6 .modes-panel .mode.vanilla-party {
  background-color: #244e80;
}
#helloDialog.menu-v6 .modes-panel .mode:is(.vanilla-ffa, .vanilla-party):hover {
  filter: brightness(1.12);
}
#helloDialog.menu-v6 .modes-panel .mode-group:has(.room.active) > .vanilla-ffa,
#helloDialog.menu-v6 .vanilla-ffa + .room-list .room.active {
  background-image: linear-gradient(90deg, #de597b66, transparent);
  box-shadow: inset 3px 0 #ed7292;
}
#helloDialog.menu-v6 .mode-list > .vanilla-upcoming {
  position: relative;
  cursor: default;
}
#helloDialog.menu-v6 .mode-list > .vanilla-upcoming::after {
  content: "Soon";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-end: 3px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #121923;
  color: #ffce89;
  font-size: 9px;
  opacity: 0;
}
#helloDialog.menu-v6 .mode-list > .vanilla-upcoming:is(:hover, :focus-visible)::after {
  opacity: 1;
}
#helloDialog.menu-v6 .mode-list > :is(.vanilla-direct, .vanilla-upcoming) {
  grid-column: auto;
  width: 100%;
  aspect-ratio: 1;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-inline: 2px;
}
#helloDialog.menu-v6 .mode-list > :is(.vanilla-direct, .vanilla-upcoming):not(.mode-group-heading) .player-count {
  margin-inline: 0;
  align-self: center;
  text-align: center;
  font-size: 10px;
}
#helloDialog.menu-v6 .vanilla-upcoming .player-count {
  visibility: hidden;
}
#helloDialog.menu-v6 .mode-list > .vanilla-direct .player-count {
  position: relative;
  top: -3px;
}
#helloDialog.menu-v6 .player-count {
  display: inline-flex;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
#helloDialog.menu-v6 .player-count > span {
  min-width: 2ch;
  text-align: end;
}
#helloDialog.menu-v6 .player-count:not(.offline)::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 10px;
  margin-inline-end: 1px;
  flex-shrink: 0;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Ccircle cx='6' cy='3' r='2.5'/%3E%3Ccircle cx='12' cy='4' r='2'/%3E%3Cpath d='M1 11V9a5 4 0 0 1 10 0v2zm11 0V9a5 5 0 0 0-1-3 4 4 0 0 1 4 4v1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#helloDialog.menu-v6 .modes-panel .mode {
  transition: none;
}
#helloDialog.menu-v6 .modes-panel .mode.active {
  background: #244e80;
  box-shadow: none;
}
#helloDialog.menu-v6 .modes-panel .vanilla-direct:not(.active) {
  background-color: #202a36;
}
#helloDialog.menu-v6 .modes-panel .vanilla-ffa.active {
  background: #a4314a;
}
#settings-dialog :is(.settings-nav button, .transfer-button, .hotkey-bind, .reset-slider) {
  background: #202a36;
  border-color: transparent;
  border-radius: 7px;
}
#settings-dialog :is(.settings-nav button:not([aria-pressed="true"]), .transfer-button, .hotkey-bind, .reset-slider):hover:not(:disabled) {
  background: #293441;
}
#settings-dialog .settings-nav button[aria-pressed="true"] {
  background: #244e80;
  border-color: transparent;
  box-shadow: none;
  color: #fff;
}
#hotkeys-panel .hotkey-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
#hotkeys-panel .hotkey-list .hotkey-bind,
#bots-hud .hotkey-bind {
  display: grid;
  place-items: center;
  width: 100%;
  height: 34px;
  background: #101923;
  border: 1px solid transparent;
  border-radius: 5px;
  text-transform: uppercase;
}
#hotkeys-panel .hotkey-list .hotkey-bind:hover {
  background: #202a36;
}
#bots-hud .hotkey-bind:hover {
  background: #293441;
}
#hotkeys-panel .hotkey-list .hotkey-bind.listening,
#bots-hud .hotkey-bind.listening {
  background: #24272a;
  border-color: #743239;
  color: #ff505a;
}
#bots-hud .hotkey-bind {
  width: 43px;
  height: 22px;
}
#hotkeys-panel .hotkey-list .hotkey-bind:active {
  transform: none;
  translate: none;
}
.keybind-card-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.keybind-card-header > [data-reset-keybinds] {
  position: absolute;
  inset-block-start: -3px;
  inset-inline-end: 0;
}
.keybind-card-header button:disabled {
  opacity: 0.45;
  cursor: default;
}
#settings-dialog .settings-card h4,
#settings-dialog .settings-card figcaption {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 10px;
}
#settings-dialog .settings-card :is(h4, figcaption)::after {
  content: "";
  display: block;
  width: calc(100% + 32px);
  height: 1px;
  margin: 7px -16px 0;
  background: #ffffff0c;
}
.keybind-card-header h4 {
  width: 100%;
}

/* Shared accent for the menu and settings. */
:root { --menu-accent: #1f57fd; }
#helloDialog.menu-v6 #play-btn,
#helloDialog.menu-v6 .modes-panel .mode.active:not(.vanilla-ffa),
#settings-dialog .settings-nav button[aria-pressed="true"],
#settings-dialog #test-mass-apply {
  background: var(--menu-accent);
  color: #fff;
}
#settings-dialog #test-mass-apply {
  border: 0;
  border-radius: 7px;
}
#settings-dialog #test-mass-apply:disabled {
  opacity: 0.5;
  cursor: default;
}
#settings-dialog #test-mass-apply:hover:not(:disabled),
#helloDialog.menu-v6 #play-btn:hover:not(:disabled) {
  background: #3260f8;
}
#helloDialog.menu-v6 #nick:focus,
#settings-dialog #test-mass:focus,
#settings-dialog .skin-source[aria-pressed="true"],
#profiles-dialog .skin-source[aria-pressed="true"] {
  border-color: var(--menu-accent);
}
#settings-dialog input[type="range"] {
  accent-color: var(--menu-accent);
}
#settings-dialog .slider-row input[type="range"]::-webkit-slider-thumb {
  background: var(--menu-accent);
  border-color: var(--menu-accent);
}
#settings-dialog .slider-row input[type="range"]::-moz-range-thumb {
  background: var(--menu-accent);
  border-color: var(--menu-accent);
}
#settings-dialog :is(.transfer-button, .reset-slider):active:not(:disabled):not(#settings-import, #settings-export, #settings-reset) {
  background: var(--menu-accent);
  color: #fff;
}
#settings-dialog :is(#settings-import, #settings-export, #settings-reset):active:not(:disabled) {
  background: #202a36;
}
#helloDialog.menu-v6 #settings-btn:active:not(:disabled) {
  background: #454c56;
}
#helloDialog.menu-v6 #spectate-btn {
  background: var(--orange);
}
#helloDialog.menu-v6 #spectate-btn:hover:not(:disabled) {
  background: #ffad26;
}
#profiles-dialog.skin-editor .skin-source {
  background: #202a36;
  border-color: transparent;
  border-radius: 7px;
  color: #eef4fa;
}
#profiles-dialog.skin-editor .skin-source:not([aria-pressed="true"]):hover {
  background: #293441;
}
#profiles-dialog.skin-editor .skin-source[aria-pressed="true"] {
  background: var(--menu-accent);
  color: #fff;
}
#profiles-dialog.skin-editor #profiles-save {
  background: var(--menu-accent);
  border-color: var(--menu-accent);
}
#profiles-dialog.skin-editor #profiles-save:hover:not(:disabled) {
  background: #3260f8;
}
#profiles-dialog.skin-editor .profile-fields > .skin-source-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
}
#profiles-dialog.skin-editor .skin-source-tabs > .skin-source {
  margin: 0;
  box-sizing: border-box;
  width: 96px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
}
#helloDialog.menu-v6 #profiles-dialog.skin-editor[open] {
  scrollbar-width: none;
}
.skin-editor .profile-fields > div:has([id^="profile-skin-"]:not([hidden])) {
  width: min(220px, 100%);
  margin-inline: auto;
  text-align: center;
}

/* Display diagnostics and settings controls. */
#performance-hud {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 10px;
  border-radius: 4px;
  background: #202a36dd;
  color: #aebdcb;
  font: 500 10px Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
#performance-hud[hidden] { display: none; }
.performance-stat { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.performance-stat strong { color: #eef4fa; font-size: 12px; font-weight: 700; }
#settings-dialog .view-shortcut-start { margin-top: 0; border-top: 0; }
#settings-dialog label:has(> input[type="checkbox"][data-display-option]),
#settings-dialog #display-panel label.minimap-visibility {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid #ffffff0c;
  font-size: 12px;
  color: #e3e9ef;
  cursor: pointer;
}

/* Display groups stack independently to keep related controls together. */
.settings-column { display: grid; align-content: start; gap: 14px; min-width: 0; }
#settings-dialog :is(#display-panel, #camera-panel, #multibox-panel) .settings-card label:has(> input[type="checkbox"]) {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid #ffffff0c;
  font-size: 12px;
  color: #e3e9ef;
}
#multibox-panel .ring-settings { margin: 0; padding: 0; border: 0; background: none; }
#settings-dialog .minimap-grid-color { display: grid; grid-template-columns: minmax(0, 1fr) 76px 32px 27px; gap: 8px; align-items: center; margin: 10px 0; }
#settings-dialog .minimap-grid-color label { display: block; text-align: left; padding: 0; border: 0; min-height: 0; font-size: 12px; }
#settings-dialog .minimap-grid-color input { height: 27px; width: 100%; }
#settings-dialog .minimap-grid-color .hex-color-field { text-align: center; cursor: pointer; }
#settings-dialog .minimap-grid-color:has(:disabled) { opacity: 0.45; }

@media (max-width: 760px) {
  #display-panel .settings-display-grid { grid-template-columns: 1fr; }
}

/* The active tab chooses which player's skin receives the URL or gallery selection. */
#profiles-dialog .profile-fields > .profile-tab-bar {
  display: flex;
  justify-content: center;
  width: min(336px, calc(100% - 24px));
  gap: 8px;
  margin: 0 auto;
}
#profiles-dialog .profile-tab-bar > button {
  flex: 1;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #202c39;
  color: #aebdcb;
  font: inherit;
  cursor: pointer;
}
#profiles-dialog [data-profile-tab="0"][aria-pressed="true"] { background: #1f57fd; color: #fff; }
#profiles-dialog [data-profile-tab="1"][aria-pressed="true"] { background: #bd7600; color: #fff; }
#profiles-dialog.skin-editor .profile-fields > .skin-source-tabs {
  width: min(336px, calc(100% - 24px));
  margin: 0 auto;
  gap: 8px;
}
#profiles-dialog.skin-editor .skin-source-tabs > .skin-source { width: calc((100% - 8px) / 2); }
#profiles-dialog.skin-editor .profile-avatar { order: 0; }
#profiles-dialog.skin-editor .profile-tab-bar { order: 1; }
#profiles-dialog.skin-editor .profile-fields > .profile-custom-url {
  order: 2;
  display: block;
  width: min(336px, calc(100% - 24px));
  margin: 0 auto;
}
#profiles-dialog.skin-editor .profile-custom-url[hidden] { display: none; }
#profiles-dialog.skin-editor .profile-custom-url label { display: none; }
#profiles-dialog.skin-editor .profile-custom-url input {
  display: block;
  width: 100%;
  height: 32px;
  box-sizing: border-box;
}
#profiles-dialog.skin-editor .skin-source-tabs { order: 3; }
#profiles-dialog.skin-editor .vanilla-gallery { order: 4; }

/* Full-width server accordion; vanilla tiles keep their separate layout. */
#helloDialog.menu-v6 .mode-list > .game-server-group { grid-column: 1 / -1; }
#helloDialog.menu-v6 .mode-list > .game-server-group > summary {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  aspect-ratio: auto;
  min-height: 32px;
  padding: 4px 10px;
}
#helloDialog.menu-v6 .mode-list > .game-server-group > summary strong,
#helloDialog.menu-v6 .mode-list > .game-server-group .room strong { font-size: inherit; line-height: inherit; }
#helloDialog.menu-v6 .mode-list > .game-server-group > summary::before {
  position: static;
  margin-inline-end: 4px;
}
#helloDialog.menu-v6 .mode-list > .game-server-group .room {
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px 4px 18px;
}
#helloDialog.menu-v6 .mode-list > .game-server-group .room .player-count { margin-inline-start: auto; font-size: inherit; }
#helloDialog.menu-v6 .mode-list > .game-server-group:not([open]):has(.room.active) > summary {
  background: rgb(31, 87, 253);
  border-color: transparent;
  box-shadow: none;
  color: #fff;
}

/* Reclaim the account row for the server list without enlarging the menu. */
#helloDialog.menu-v6 > .skins-panel { position: relative; }
#helloDialog.menu-v6 .skins-panel > .account-bar {
  position: absolute;
  inset: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  border-bottom: 0;
}
#helloDialog.menu-v6 > .modes-panel { padding-bottom: 0; }
#helloDialog.menu-v6 .mode-list {
  height: 419px;
  gap: 3px;
  padding: 4px 8px;
  box-sizing: border-box;
}
#helloDialog.menu-v6 .mode-list > .bar { padding-block: 5px; }
#helloDialog.menu-v6 .mode-list > .game-server-group > summary {
  min-height: 26px;
  height: 26px;
  box-sizing: border-box;
  padding-block: 2px;
  font-size: 12px;
  line-height: 18px;
}
#helloDialog.menu-v6 .mode-list > .game-server-group .room {
  min-height: 22px;
  height: 22px;
  box-sizing: border-box;
  padding-block: 1px;
  font-size: 12px;
  line-height: 18px;
}

/* Center the actual menu height; keep tall layouts reachable by scrolling. */
#overlays { flex-direction: column; }
#overlays > #helloDialog { margin: auto; flex-shrink: 0; }

/* Keep the two-name layout and skin thumbnails inside the fixed dialog. */
#profiles-dialog.skin-editor > .preferences-header { min-height: 48px; padding-block: 10px; }
#profiles-dialog.skin-editor #profiles-form { min-height: 0; padding: 8px 20px 12px; }
#profiles-dialog.skin-editor #profiles-form fieldset { display: flex; flex-direction: column; min-height: 0; padding: 0; }
#profiles-dialog.skin-editor #profiles-form fieldset[hidden] { display: none; }
#profiles-dialog.skin-editor .profile-fields { flex: 1; min-height: 0; height: auto; gap: 6px; }
#profiles-dialog.skin-editor .profile-fields > .vanilla-gallery:not([hidden]) {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
}

#profiles-dialog.skin-editor .profile-fields > .vanilla-gallery:not([hidden]) { grid-auto-rows: 64px; }
#profiles-dialog.skin-editor .vanilla-gallery button { height: 64px; min-height: 64px; }

/* Two nicknames share one quiet field, with a subtle central divider. */
#helloDialog.menu-v6 .menu-nicknames {
  display: flex;
  gap: 0;
  height: 42px;
  box-sizing: border-box;
  border: 1px solid #a6c8e240;
  border-radius: 7px;
  overflow: hidden;
  background: #111e2b;
}
#helloDialog.menu-v6 .menu-nicknames:focus-within { border-color: rgb(31, 87, 253); }
#helloDialog.menu-v6 .menu-nicknames > :is(#nick, #nick-2) {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: #eef4fa;
  font: 700 13px Ubuntu, Arial, sans-serif;
}
#helloDialog.menu-v6 .menu-nicknames { position: relative; }
#helloDialog.menu-v6 .menu-nicknames::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: #a6c8e218;
  pointer-events: none;
}
#helloDialog.menu-v6 .menu-nicknames input::placeholder { color: #8797a8; font-weight: 400; }

/* Consistent icon, label and population slots inside the vanilla tiles. */
#helloDialog.menu-v6 .mode-list > :is(.vanilla-direct, .vanilla-upcoming) {
  display: grid;
  grid-template-rows: 24px 16px 10px;
  align-content: center;
  justify-content: stretch;
  justify-items: center;
  align-items: center;
  gap: 1px;
  padding: 6px 2px 3px;
}
#helloDialog.menu-v6 .mode-list > :is(.vanilla-direct, .vanilla-upcoming) .vanilla-mode-icon {
  width: 24px;
  height: 24px;
}
#helloDialog.menu-v6 .mode-list > .vanilla-direct .player-count { top: 0; line-height: 10px; }
#helloDialog.menu-v6 .mode-list > .vanilla-direct .player-count:not(.offline)::before {
  width: 10px;
  height: 8px;
}

#helloDialog.menu-v6 .mode-list > :is(.vanilla-direct, .vanilla-upcoming) > strong {
  font-size: 11px;
  line-height: 14px;
}

/* Subtle inset surface and a short entrance for the expanded arenas. */
#helloDialog.menu-v6 .game-server-group > .room-list { background: #25313e; }
#helloDialog.menu-v6 .mode-list > .game-server-group .room:not(.active):not(:hover) { background: #25313e; }
@media (prefers-reduced-motion: no-preference) {
  #helloDialog.menu-v6 .game-server-group[open] > .room-list {
    animation: arena-list-enter 180ms ease-out;
  }
  #helloDialog.menu-v6 .game-server-group > summary::before { transition: transform 180ms ease-out; }
}
@keyframes arena-list-enter {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Expanded arenas use plain surfaces without ornamental outlines. */
#helloDialog.menu-v6 .game-server-group > .room-list {
  border: 0;
  box-shadow: none;
}
#helloDialog.menu-v6 .mode-list > .game-server-group .room {
  border-color: transparent;
  box-shadow: none;
}


/* A quieter wordmark and more even spacing in the central panel. */
#helloDialog.menu-v6 .cellys-logo { max-width: 140.4px; max-height: 140.4px; }
#helloDialog.menu-v6 #title { margin-bottom: 20px; }
#helloDialog.menu-v6 #play-form .button-row { margin-top: 14px; row-gap: 8px; }
#helloDialog.menu-v6 .menu-skins .skin-avatar {
  cursor: pointer;
  transition: filter 120ms ease-out, transform 120ms ease-out, background-color 120ms ease-out;
}
#helloDialog.menu-v6 .menu-skins .skin-avatar:hover {
  filter: brightness(1.08);
  transform: scale(1.025);
  background-color: #172a3d;
}
#helloDialog.menu-v6 .menu-skins .skin-avatar:focus-visible {
  outline: 2px solid #aebdcb;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  #helloDialog.menu-v6 .menu-skins .skin-avatar { transition: none; }
  #helloDialog.menu-v6 .menu-skins .skin-avatar:hover { transform: none; }
}

#helloDialog.menu-v6 .skins-panel > .account-bar small { color: #83909f; }

/* Softer depth on the three main menu actions. */
#helloDialog.menu-v6 :is(#play-btn, #spectate-btn, #settings-btn) {
  box-shadow: inset 0 1px 0 #ffffff12, 0 1px 2px #0002;
}
#helloDialog.menu-v6 :is(#play-btn, #spectate-btn, #settings-btn):hover:not(:disabled) {
  box-shadow: inset 0 1px 0 #ffffff18, 0 1px 3px #0002;
}
#helloDialog.menu-v6 :is(#play-btn, #spectate-btn, #settings-btn):active:not(:disabled) {
  box-shadow: inset 0 1px 2px #0001;
}

/* Dedicated sections reuse the existing cards and controls. */
.settings-options-panel > .settings-card { max-width: 520px; margin-inline: auto; }

/* Colors and effects continue the existing right column without a preview. */
#display-panel .settings-column > #custom-panel,
#display-panel .settings-column > #custom-panel .custom-layout { display: contents; }
#display-panel .settings-column > #custom-panel {
  margin: 0;
  padding: 0;
  height: auto;
}
#display-panel .settings-column > #custom-panel .custom-settings-scroll { overflow: visible; }

#custom-panel .custom-control-group:has(> .custom-color-row:first-child #custom-virus-color) { border-top: 0; }

/* One compact reset button style for sliders, colors and keybind cards. */
#settings-dialog :is(#settings-reset, .reset-slider, .reset-color) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 27px;
  width: 27px;
  height: 23px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #202a36;
  color: #eaf5ff;
  font: 600 12px/1 Arial, sans-serif;
  box-shadow: none;
  transform: none;
}
#settings-dialog :is(#settings-reset, .reset-slider, .reset-color):hover:not(:disabled) {
  background: #293441;
  border-color: transparent;
}
#settings-dialog :is(#settings-reset, .reset-slider, .reset-color):active:not(:disabled) {
  background: #202a36;
  border-color: transparent;
  transform: none;
}
#settings-dialog :is(#settings-reset, .reset-slider, .reset-color):disabled {
  opacity: 0.55;
  cursor: default;
}

#settings-dialog .display-select-row:has(> .reset-slider) > label { flex: 1; }

#settings-dialog .display-select-row > label { display: block; text-align: left; justify-self: stretch; }
#settings-dialog #game-font { text-align: left; padding-left: 10px; padding-right: 24px; }

/* Consistent card spacing and one control column for settings dropdowns. */
#settings-dialog { --settings-block-gap: 12px; }
#settings-dialog :is(.settings-display-grid, .settings-column) { gap: var(--settings-block-gap); }
#settings-dialog .display-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 27px;
  align-items: center;
  column-gap: 5px;
}
#settings-dialog .display-select-row > select {
  grid-column: 2;
  box-sizing: border-box;
  width: 132px;
  max-width: 100%;
  margin: 0;
}
#settings-dialog .display-select-row > .reset-slider { grid-column: 3; }
@media (max-width: 580px) {
  #settings-dialog .display-select-row { grid-template-columns: minmax(0, 1fr) 110px 27px; }
  #settings-dialog .display-select-row > select { width: 110px; }
}

/* Give long labels more room without changing the settings panel dimensions. */
#settings-dialog :is(#display-panel, #camera-panel, #multibox-panel, #hotkeys-panel) .slider-row {
  grid-template-columns: minmax(0, 1fr) 54px minmax(40px, 25%) 27px;
}
#settings-dialog .slider-row > label { min-width: 0; overflow-wrap: normal; }
#settings-dialog .settings-card { --settings-separator: #ffffff0c; }
#settings-dialog .settings-card :is(label, .slider-row, .custom-color-row) {
  border-bottom-color: var(--settings-separator);
}
#settings-dialog .settings-card .custom-control-group {
  border-top-color: var(--settings-separator);
}
#settings-dialog .settings-card :is(h4, figcaption)::after {
  background: var(--settings-separator);
}
/* Dim controls separately so disabled labels remain readable. */
#settings-dialog :is(label, .slider-row, .custom-color-row, .minimap-grid-color):has(:disabled) {
  opacity: 1;
  color: #aebbc9;
}
#settings-dialog :is(input, select, button):disabled {
  opacity: 0.65;
}
#settings-dialog select:disabled { background-color: #1b2531; }

/* Separate bot panel visibility from its key bindings. */
#settings-dialog .bot-hotkey-card .bot-panel-toggle {
  padding-bottom: 10px;
  border-bottom: 1px solid #ffffff0c;
}

/* Complete Display row separators without increasing control or card heights. */
#settings-dialog #display-panel :is(.slider-row, .display-select-row, .minimap-grid-color):not(:last-child) {
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--settings-separator, #ffffff0c);
}

/* Keep the paused Cellys mode visible without offering selection. */
#helloDialog.menu-v6 .modes-panel .vanilla-cellys:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* Keep the original symbol centered, then unfold the wordmark and reuse its blue dot. */
#loading-screen {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: #101b29; opacity: 1;
  transition: opacity 500ms ease;
  animation: loading-safety-exit 500ms 12s forwards;
}
.loading-brand {
  --loading-size: clamp(110px, 19vw, 190px);
  position: relative; width: var(--loading-size); height: var(--loading-size);
  color: #fff; transition: width 1100ms cubic-bezier(.22,.68,.26,1);
}
.loading-symbol {
  position: relative; width: var(--loading-size); height: var(--loading-size);
  transform-origin: 50% 50%;
  will-change: transform;
  animation: loading-symbol-turn 1800ms linear infinite;
}
.loading-symbol svg { display: block; width: 100%; height: 100%; }
.loading-dot {
  position: absolute; left: calc(var(--loading-size) * .75); top: 50%;
  width: calc(var(--loading-size) * .1875); height: calc(var(--loading-size) * .1875);
  border-radius: 50%; background: rgb(31,87,253); transform: translate(-50%,-50%);
  transition: left 1100ms cubic-bezier(.22,.68,.26,1), top 1100ms ease, width 1100ms ease, height 1100ms ease;
}
.loading-word {
  position: absolute; left: calc(var(--loading-size) * .84); top: 50%;
  display: flex; align-items: baseline; white-space: nowrap;
  font: 700 calc(var(--loading-size) * .60)/1.35 Ubuntu, sans-serif;
  letter-spacing: -.025em; transform: translateY(-50%);
  clip-path: inset(0 100% 0 0); opacity: 0;
  transition: clip-path 1100ms cubic-bezier(.22,.68,.26,1), opacity 650ms ease;
}
.loading-domain { color: rgb(31,87,253); margin-left: .23em; opacity: 0; transition: opacity 650ms 500ms ease; }
#loading-screen.is-ready .loading-symbol { animation: loading-symbol-settle 650ms ease-out both; }
#loading-screen.is-unfolded .loading-brand { width: var(--loading-width); }
#loading-screen.is-unfolded .loading-word { clip-path: inset(0); opacity: 1; }
#loading-screen.is-unfolded .loading-domain { opacity: 1; }
#loading-screen.is-unfolded .loading-brand > .loading-dot {
  left: var(--loading-dot-x); top: 69%;
  width: calc(var(--loading-size) * .085); height: calc(var(--loading-size) * .085);
}
#loading-screen.is-finished { opacity: 0; pointer-events: none; }
@keyframes loading-symbol-turn { to { transform: rotate(360deg); } }
@keyframes loading-symbol-settle { from { transform: rotate(var(--loading-angle,0deg)); } to { transform: rotate(360deg); } }
@keyframes loading-safety-exit { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) {
  .loading-symbol, #loading-screen.is-ready .loading-symbol { animation: none; }
  .loading-brand, .loading-dot, .loading-word, .loading-domain { transition-duration: 150ms; transition-delay: 0ms; }
}

/* A compact shared tag sits beside the two tab nicknames. */
#helloDialog.menu-v6 .menu-nicknames::after { display: none; }
#helloDialog.menu-v6 .menu-nicknames > #nick-2 { border-left: 1px solid #a6c8e218; }
#helloDialog.menu-v6 .menu-nicknames > #multibox-tag {
  flex: 0 0 54px;
  width: 54px;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0 6px;
  border: 0;
  border-left: 1px solid #a6c8e218;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: #eef4fa;
  font: 700 13px Ubuntu, Arial, sans-serif;
  text-align: center;
}
#helloDialog.menu-v6 .menu-nicknames > #multibox-tag:disabled { opacity: .5; cursor: not-allowed; }


#stop-bots {
  pointer-events: auto;
  width: 100%;
  margin: 4px 0;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: #253445;
  color: #eef4fa;
  font: inherit;
  cursor: pointer;
}
#stop-bots:hover:enabled { background: #33465b; }
#stop-bots:disabled { opacity: .55; cursor: default; }

#arena-chat {
  position: fixed;
  z-index: 3;
  left: 12px;
  bottom: 44px;
  width: min(270px, calc(100% - 24px));
  color: #eef4fa;
  font: 700 12px Ubuntu, Arial, sans-serif;
}
body.game-menu-open #arena-chat { z-index: 202; }
#arena-chat :is(.chat-entry, .chat-tools) { display: flex; gap: 4px; }
#arena-chat button {
  min-height: 26px;
  padding: 4px 9px;
  border: 0;
  border-radius: 4px;
  background: #172638e8;
  color: #ced9e6;
  cursor: pointer;
}
#arena-chat button:hover { background: #263c55; color: #fff; }
#arena-chat button[aria-pressed="true"] {
  background: #192e51;
  box-shadow: inset 0 -2px #4374ff;
  color: #fff;
}
#arena-chat { display: flex; flex-direction: column-reverse; gap: 5px; }
#arena-chat[hidden] { display: none; }
#chat-content { display: flex; flex-direction: column; gap: 5px; }
#chat-messages {
  max-height: min(220px, 28vh);
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
#chat-messages:empty { display: none; }
#chat-messages li {
  justify-self: start;
  max-width: 100%;
  padding: 1px 2px;
  line-height: 1.35;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
  overflow-wrap: anywhere;
}
#chat-messages time {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #16263ce8;
  color: #bdcff2;
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
#chat-messages strong { color: #81a2ff; }
#chat-form {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 5px;
  background: #101a29eb;
  border-radius: 5px;
}
@media (max-width: 950px) {
  #chat-form { bottom: 80px; }
}
#arena-chat #chat-tag[hidden] { display: none; }
#chat-form button { background: #264782; }
#chat_textbox {
  flex: 1;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid #293c56;
  border-radius: 4px;
  background: #121e31;
  color: inherit;
}
#chat_textbox::placeholder { color: #a4b3c6; }
#chat_textbox:focus { border-color: #4374ff; outline: none; }
#arena-chat button:focus-visible { outline: 2px solid #90afff; outline-offset: 1px; }

#arena-chat #chat-form[hidden] { display: none; }
.chat-tools { margin-bottom: 4px; }
.chat-tools #chat-command-select {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-command-row {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.chat-command-row label,
.chat-command-row input {
  text-align: center;
}
.chat-command-row .hotkey-bind {
  display: grid;
  place-items: center;
}
.chat-command-row span.hotkey-bind {
  cursor: default;
}
.chat-command-settings input {
  min-width: 0;
  border: 1px solid #344861;
  border-radius: 4px;
  padding: 6px 9px;
  color: #eef4fa;
  background: #121e31;
}
