:root {
  --ink: #282738;
  --paper: #f6f3e9;
  --purple: #7251d2;
  --muted: #8d8b91;
  --line: #dedbd2
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif
}

button,
a {
  -webkit-tap-highlight-color: transparent
}

button {
  font: inherit;
  cursor: pointer;
  color: inherit
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #a584ed;
  outline-offset: 4px
}

header {
  height: 89px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.7px;
  text-decoration: none
}

.brand-mark {
  background: var(--purple);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-style: italic;
  font-size: 32px;
  line-height: 34px;
  position: relative;
  text-align: center
}

.brand-mark span {
  position: absolute;
  font-size: 18px;
  right: 0;
  top: -7px
}

.edition {
  font: 9px monospace;
  letter-spacing: 1px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
  margin-left: 7px
}

.header-right {
  display: flex;
  align-items: center;
  gap: 25px
}

.online {
  font: 10px monospace;
  letter-spacing: .8px
}

.online i,
.game-footer i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #7a9f69;
  border-radius: 50%;
  margin-right: 7px
}

.icon-button {
  font: 10px monospace;
  background: none;
  border: 1px solid var(--line);
  padding: 11px;
  border-radius: 30px
}

.experimental-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.9px;
  padding: 13px 22px;
  color: #fff;
  border: 1.5px solid #ffd29d;
  background: linear-gradient(135deg, #ff7a2f 0%, #ff3d5a 50%, #ff9a3c 100%);
  background-size: 220% 220%;
  box-shadow: 0 6px 20px rgba(255, 84, 68, 0.42), 0 0 0 0 rgba(255, 122, 47, 0.55);
  animation: bevy-cta-pulse 2.2s ease-in-out infinite, bevy-cta-grad 5s ease infinite;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.experimental-button::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -60%;
  width: 45%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: skewX(-22deg);
  animation: bevy-cta-sheen 3.2s ease-in-out infinite;
  pointer-events: none;
}
.experimental-button:hover {
  transform: translateY(-2px) scale(1.07);
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(255, 84, 68, 0.6), 0 0 16px rgba(255, 166, 77, 0.55);
}
.experimental-button:active {
  transform: translateY(0) scale(1.01);
}
:root.bevy-beta .experimental-button {
  padding: 11px 16px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
  animation: none;
}
:root.bevy-beta .experimental-button::after {
  display: none;
}
@keyframes bevy-cta-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(255, 84, 68, 0.42), 0 0 0 0 rgba(255, 122, 47, 0.52);
  }
  50% {
    transform: scale(1.055);
    box-shadow: 0 8px 26px rgba(255, 84, 68, 0.58), 0 0 0 10px rgba(255, 122, 47, 0);
  }
}
@keyframes bevy-cta-grad {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes bevy-cta-sheen {
  0%, 62% { left: -60%; opacity: 0; }
  72% { opacity: 1; }
  92% { left: 135%; opacity: 1; }
  100% { left: 135%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .experimental-button,
  .experimental-button::after,
  .wasm-build-badge.compiling {
    animation: none;
  }
}

.wasm-build-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font: 800 10.5px/1 monospace;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.wasm-build-badge.compiling {
  background: rgba(255, 166, 48, 0.16);
  color: #b85d00;
  border: 1px solid rgba(255, 145, 36, 0.55);
  animation: bevy-cta-pulse 1.8s ease-in-out infinite;
}
.wasm-build-badge.ready {
  background: rgba(34, 184, 96, 0.16);
  color: #167a3e;
  border: 1px solid rgba(34, 184, 96, 0.55);
}
:root.bevy-beta .wasm-build-badge.compiling {
  color: #ffd080;
  background: rgba(255, 166, 48, 0.2);
}
:root.bevy-beta .wasm-build-badge.ready {
  color: #7df0a6;
  background: rgba(34, 184, 96, 0.22);
}

main {
  max-width: 1440px;
  padding: 0 5%;
  margin: auto
}
.special-button{bottom:177px}.special-status{position:absolute;left:50%;top:108px;transform:translateX(-50%);padding:5px 10px;background:#232955aa;color:#fbeba7;font:700 11px monospace;border-radius:7px;pointer-events:none}
.nightmare-button{bottom:229px;display:grid;gap:5px;border-color:#d799ff;background:#311748ed;color:#f1d4ff}.nightmare-button strong{font-size:10px}.nightmare-button span{font-size:9px}.nightmare-button.active{opacity:1;box-shadow:0 0 18px #b647f488;border-color:#efc9ff}.nightmare-button:not(:disabled):active{background:#62317d}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 47px 0 36px
}

.eyebrow {
  font: 10px monospace;
  font-weight: bold;
  letter-spacing: 1.5px
}

h1 {
  font-size: 68px;
  line-height: .99;
  letter-spacing: -3.5px;
  margin: 16px 0 0;
  position: relative
}

h1 em {
  font-style: normal;
  color: var(--purple)
}

.spark {
  position: absolute;
  font-size: 77px;
  font-weight: 400;
  color: #c0ca75;
  left: 355px;
  top: 36px
}

.intro-note {
  padding-top: 20px
}

.pill {
  display: inline-block;
  border: 1px solid #d6d2c8;
  border-radius: 20px;
  padding: 7px 11px;
  font: 9px monospace;
  letter-spacing: 1px
}

.intro-note p {
  font-size: 12px;
  line-height: 1.8;
  color: #797780
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 24px
}

.race-panel {
  border: 1px solid #373442;
  border-radius: 12px;
  overflow: hidden;
  background: #282738;
  align-self: start;
  box-shadow: 0 5px 0 #e3dfd5
}

.race-bar {
  height: 46px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #b5afc2;
  font: 9px monospace;
  letter-spacing: .5px
}

.race-bar strong {
  font-weight: 500;
  color: #eeeaf8
}

.divider {
  padding: 0 12px;
  color: #666071
}

.live-dot {
  display: inline-block;
  background: #d9eb83;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 9px
}

.viewport {
  position: relative;
  aspect-ratio: 1.6;
  overflow: hidden;
  background: #a6d9df
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated
}

.bevy-surface {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transform-origin: top left;
}

.bevy-surface canvas { display: block; width: 100%; height: 100%; }
.bevy-surface-mobile {
  width: var(--bevy-render-size, 20%);
  height: var(--bevy-render-size, 20%);
  transform: scale(var(--bevy-render-upscale, 5));
}
.bevy-active .bevy-surface { opacity: 1; }
.bevy-active #game { opacity: 0; }

.hud {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  gap: 25px;
  color: white;
  text-shadow: 2px 2px #39334b
}

.hud small {
  display: block;
  font: 9px monospace;
  letter-spacing: 1px;
  margin-bottom: 4px
}

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

.position b {
  font-size: 38px;
  line-height: 1;
  letter-spacing: -2px
}

.position b span {
  font-size: 15px;
  letter-spacing: 0
}

.position small {
  margin-top: 6px
}

.lap b,
.timer b {
  font: 19px monospace;
  font-weight: bold
}

.lap b span {
  opacity: .7
}

.timer {
  margin-left: auto;
  text-align: right
}

.center-message {
  position: absolute;
  top: 25%;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #fff;
  text-shadow: 1px 2px 1px #34355266
}

.center-message .pill {
  background: #29283be8;
  border: 0;
  color: #e3ddf8;
  font-size: 8px
}

.center-message h2 {
  font-size: clamp(26px, 3.8vw, 53px);
  letter-spacing: -2px;
  margin: 13px 0 0;
  text-shadow: 3px 3px #383649
}

.center-message p {
  font-size: 11px;
  margin: 10px 0 20px
}

.primary {
  border: 0;
  background: #e4ef9a;
  padding: 15px 25px;
  min-width: 180px;
  border-radius: 6px;
  color: #302d3b;
  box-shadow: 0 4px #687747;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px
}

.primary span {
  margin-left: 28px;
  font-size: 18px
}

.primary:hover {
  background: #f0ffae;
  transform: translateY(-2px)
}

.center-message>small {
  font: 8px monospace;
  margin-top: 15px
}

.bottom-hud {
  position: absolute;
  bottom: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  color: white
}

.item-box {
  display: flex;
  gap: 10px;
  align-items: center
}

.item-box>span {
  width: 43px;
  height: 43px;
  border: 2px solid #fff8;
  border-radius: 7px;
  background: #332a4eb0;
  display: grid;
  place-items: center;
  font: bold 28px monospace;
  color: #dfed91
}

.item-box strong,
.item-box small {
  display: block;
  font: 8px monospace;
  line-height: 1.8;
  letter-spacing: .6px
}

.item-box small {
  opacity: .7
}

#speed b {
  font: italic bold 36px monospace;
  text-shadow: 2px 2px #29283b
}

#speed small {
  font: 9px monospace;
  margin-left: 4px
}

.pause {
  position: absolute;
  bottom: 75px;
  right: 22px;
  border: 1px solid #fff7;
  background: #28273866;
  color: #fff;
  border-radius: 5px;
  padding: 6px 10px
}

.toast {
  position: absolute;
  top: 19%;
  width: 100%;
  text-align: center;
  font: bold 14px monospace;
  color: #fff;
  text-shadow: 2px 2px #29283b;
  pointer-events: none
}

.game-footer {
  height: 39px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  color: #c0bacb;
  font: 8px monospace;
  letter-spacing: .4px
}

.game-footer>span {
  margin-right: auto
}

.game-footer button {
  border: 0;
  background: none;
  color: #bdb6cb;
  font: 8px monospace;
  padding: 5px 0
}

aside {
  display: flex;
  flex-direction: column;
  gap: 15px
}

.racer-panel,
.track-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 19px;
  background: #faf8f0
}

.section-label {
  display: flex;
  justify-content: space-between;
  font: 9px monospace;
  letter-spacing: 1px;
  color: #827e89
}

.section-label>span:last-child {
  font-size: 16px;
  color: var(--purple)
}

.racer-panel h2 {
  font-size: 19px;
  letter-spacing: -.5px;
  margin: 13px 0 17px
}

.driver-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px
}

.driver {
  border: 1px solid #dfdbd2;
  border-radius: 8px;
  background: #edeadf;
  padding: 5px;
  aspect-ratio: 1;
  font-size: 29px;
  transition: transform .15s
}

.driver:hover {
  transform: translateY(-3px)
}

.driver.selected {
  border: 2px solid var(--purple);
  background: #e8defa;
  box-shadow: 0 2px 0 var(--purple)
}

.driver:disabled {
  cursor: default;
  opacity: .65
}

.driver-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0
}

.driver-info h3 {
  font-size: 14px;
  margin: 0 0 5px
}

.driver-info span {
  font-size: 9px;
  color: #8b8592
}

.driver-info .driver-number {
  font: italic 30px Georgia;
  color: #cfc6df
}

.stat {
  display: flex;
  align-items: center;
  margin-top: 8px;
  font: 8px monospace;
  letter-spacing: .4px
}

.stat>span {
  width: 100px
}

.stat>div {
  display: flex;
  gap: 4px;
  flex: 1
}

.stat i {
  height: 5px;
  flex: 1;
  border-radius: 2px;
  background: #e5e0da
}

.stat i.on {
  background: #9983c6
}

.track-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px
}

.track-heading h3 {
  font-size: 13px;
  margin: 0
}

.track-heading>span {
  font: 7px monospace;
  color: #77864d;
  background: #ecf0d7;
  border-radius: 3px;
  padding: 4px 6px
}

#map {
  width: 100%;
  height: 105px;
  display: block
}

.match-limits {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.match-limits[hidden] {
  display: none;
}

.match-limits label {
  display: grid;
  gap: 5px;
  font: 9px monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.match-limits select {
  min-height: 44px;
  min-width: 90px;
  padding: 8px 12px;
  border: 1px solid #d7cedf;
  border-radius: 7px;
  background-color: #faf8f0;
  color: var(--ink);
  font: bold 12px monospace;
  cursor: pointer;
}

.match-limits select:hover:enabled,
.match-limits select:focus-visible {
  border-color: var(--purple);
  background-color: #e8defa;
}

.match-limits select:focus-visible {
  outline: 3px solid #a584ed;
  outline-offset: 2px;
}

.match-limits select:disabled {
  cursor: default;
  opacity: .65;
}

.track-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.track-bottom>span {
  font-size: 8px;
  color: #918995
}

.track-bottom button {
  border: 1px solid var(--line);
  background: none;
  border-radius: 50%;
  width: 24px;
  height: 24px
}

.tip {
  display: flex;
  gap: 12px;
  padding: 0 7px;
  align-items: center
}

.tip>span {
  font-size: 27px;
  color: var(--purple)
}

.tip p {
  font-size: 10px;
  color: #8b8392;
  line-height: 1.8;
  margin: 0
}

.tip strong {
  color: #62586e;
  font-weight: 500
}

.controls {
  margin-top: 33px;
  padding: 26px 0 30px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 18px
}

.controls-title h3 {
  font-size: 17px;
  line-height: 1.35;
  margin: 9px 0 0;
  letter-spacing: -.3px
}

.controls-title .eyebrow {
  font-size: 8px;
  color: #827b8e
}

.control {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 1px
}

.control>div {
  display: flex;
  gap: 4px;
  margin-bottom: 3px;
  height: 28px
}

kbd {
  min-width: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #d8d3c9;
  border-bottom: 3px solid #d8d3c9;
  border-radius: 4px;
  padding: 5px;
  background: #fcfaf4;
  font: 10px monospace
}

.wide {
  padding: 5px 13px
}

.control strong {
  font-size: 10px;
  font-weight: 500
}

.control>span {
  font-size: 9px;
  color: #98909b
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 0 30px;
  font: 8px monospace;
  color: #a09aa4
}

.footer-logo {
  font: bold 11px Arial;
  color: #77717f
}

footer>span:last-child {
  letter-spacing: 1px
}

.purple {
  color: var(--purple);
  font-size: 21px;
  vertical-align: middle;
  margin-left: 8px
}

.touch-controls {
  display: none
}

.hidden {
  display: none !important
}

.viewport:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  background: #282738
}

.viewport:fullscreen #game {
  object-fit: contain
}

@media(min-width:1500px) {
  main {
    padding: 0 60px
  }

  .viewport {
    aspect-ratio: 1.6
  }
}

@media(max-width:1000px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 16px
  }

  .race-meta {
    display: none
  }

  h1 {
    font-size: 58px
  }

  .spark {
    left: 305px
  }

  .racer-panel,
  .track-panel {
    padding: 14px
  }

  .controls {
    gap: 10px
  }

  .game-footer {
    gap: 12px
  }

  .intro {
    padding-top: 30px
  }
}

@media(max-width:760px) {
  header {
    height: 68px
  }

  .online,
  .edition {
    display: none
  }

  .brand {
    font-size: 16px
  }

  .intro {
    padding: 27px 0
  }

  .intro h1 {
    font-size: 51px
  }

  .spark {
    font-size: 50px;
    left: 266px;
    top: 33px
  }

  .intro-note {
    display: none
  }

  .eyebrow {
    font-size: 8px
  }

  .game-layout {
    grid-template-columns: 1fr
  }

  .race-bar {
    font-size: 8px;
    padding: 0 11px
  }

  .viewport {
    min-height: 310px
  }

  aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
  }

  .tip {
    display: none
  }

  .racer-panel h2 {
    font-size: 14px
  }

  .driver {
    font-size: 22px
  }

  .driver-info .driver-number {
    display: none
  }

  .driver-info span {
    font-size: 8px
  }

  .stat>span {
    width: 78px;
    font-size: 7px
  }

  .controls {
    flex-wrap: wrap;
    gap: 22px
  }

  .controls-title {
    width: 100%
  }

  .controls-title h3 br {
    display: none
  }

  .control {
    width: 43%
  }

  .touch-controls {
    display: flex;
    gap: 8px;
    position: sticky;
    bottom: 10px;
    justify-content: center;
    padding: 12px;
    background: #f6f3e9ed;
    border: 1px solid var(--line);
    border-radius: 12px;
    z-index: 5;
    margin-top: 15px
  }

  .touch-controls button {
    border: 1px solid #c8bfd7;
    background: #e5dcef;
    border-radius: 6px;
    padding: 14px;
    font: bold 10px monospace;
    touch-action: none
  }

  .touch-controls button:last-child {
    background: #e0e9a7
  }

  footer>span:nth-child(2) {
    display: none
  }

  .center-message h2 {
    font-size: 34px
  }

  .center-message {
    top: 25%
  }

  .center-message p {
    font-size: 9px
  }

  .primary {
    padding: 10px 20px
  }

  .hud {
    top: 12px;
    left: 13px;
    right: 13px;
    gap: 17px
  }

  .position b {
    font-size: 29px
  }

  .lap b,
  .timer b {
    font-size: 14px
  }

  .bottom-hud {
    bottom: 12px;
    left: 13px;
    right: 13px
  }

  .item-box strong,
  .item-box small {
    font-size: 7px
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition: none !important
  }
}

@media(max-width:760px) {
  .viewport {
    aspect-ratio: auto;
    height: 310px;
    min-height: 0;
    width: 100%
  }

  aside {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)
  }

  .racer-panel,
  .track-panel {
    min-width: 0
  }

  .driver-grid {
    gap: 4px
  }

  .driver {
    min-width: 0;
    padding: 2px;
    font-size: 20px
  }

  .driver-info {
    margin: 13px 0
  }

  .driver-info h3 {
    font-size: 12px
  }

  .track-heading {
    flex-wrap: wrap;
    gap: 6px
  }

  .stat>span {
    width: 68px
  }

  .stat>div {
    gap: 2px
  }

  .center-message h2 {
    font-size: 30px;
    letter-spacing: -1px
  }

  .center-message p {
    font-size: 8px
  }

  .center-message>small {
    font-size: 7px
  }
}

#game {
  image-rendering: auto
}

.item-box>span {
  font-size: 25px
}

.viewport {
  isolation: isolate
}

.finish-flash {
  position: absolute;
  inset: 20% 5% auto;
  z-index: 4;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  text-align: center;
  filter: drop-shadow(0 4px 0 #262638);
  animation: winner-pop .35s ease-out, winner-glow 1s ease-in-out 3
}

.finish-flash strong {
  color: #fff0a6;
  font: 900 clamp(24px, 4.5vw, 66px)/1.05 Arial, sans-serif;
  letter-spacing: -1px;
  text-shadow: 0 2px #84622b
}

.finish-flash span {
  padding: 7px 15px;
  border-radius: 20px;
  background: #282738e8;
  color: #fff4cf;
  font: bold 11px monospace;
  letter-spacing: 1px
}

@keyframes winner-pop {
  from {
    transform: scale(.75);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

@keyframes winner-glow {
  50% {
    filter: drop-shadow(0 0 18px #ffd260)
  }
}

@media(prefers-reduced-motion:reduce) {
  .finish-flash {
    animation: none
  }
}

.item-box {
  display: block;
  padding: 10px;
  border: 1px solid #ffffff45;
  border-radius: 12px;
  background: #202336d9;
  box-shadow: 0 4px 18px #10142140;
  backdrop-filter: blur(7px)
}

.item-box>#item {
  display: none
}

.item-box>div:not(.ammo-rack) {
  padding-top: 7px
}

.item-box strong {
  font-size: 10px;
  letter-spacing: 1px
}

.item-box small {
  font-size: 8px
}

.ammo-rack {
  display: flex;
  gap: 7px
}

.ammo-card {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 1px 4px;
  width: 82px;
  min-height: 65px;
  padding: 6px 8px;
  background: #ffffff0b;
  color: #f9f4e8;
  border: 1px solid #ffffff36;
  border-radius: 7px;
  text-align: center;
  transition: border-color .15s, background .15s
}

.ammo-card b {
  font: bold 34px/1 monospace;
  letter-spacing: -2px;
  text-shadow: 0 2px #171927
}

.ammo-icon {
  font-size: 23px
}

.ammo-label {
  grid-column: 1/-1;
  font: bold 8px monospace;
  letter-spacing: .5px
}

.ammo-card.selected {
  background: #e2ed9d25;
  border: 2px solid #e2ed9d;
  color: #f0ffb0;
  padding: 5px 7px;
  box-shadow: 0 0 12px #e2ed9d20
}

.ammo-card:disabled {
  opacity: .4;
  cursor: default
}

.ammo-card.selected:disabled {
  opacity: .65
}

#ammo-missile.selected {
  border-color: #ff997e;
  background: #ff775526;
  color: #ffd2b3
}

.ammo-card.vulcan {
  border-color: #ffbd58;
  color: #ffe099;
  background: #ff9b2829;
  box-shadow: 0 0 14px #ff9b2844
}

.item-box>.vulcan-status {
  padding: 0 0 8px !important;
  color: #ffda85
}

.vulcan-status strong {
  font-size: 10px;
  letter-spacing: .3px
}

.vulcan-status progress {
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  appearance: none;
  margin: 4px 0 0
}

.vulcan-status progress::-webkit-progress-bar {
  background: #ffffff20
}

.vulcan-status progress::-webkit-progress-value {
  background: #ffc260
}

.vulcan-status progress::-moz-progress-bar {
  background: #ffc260
}

.chaff-button {
  position: absolute;
  right: 20px;
  bottom: 125px;
  min-height: 44px;
  width: 112px;
  padding: 10px 5px;
  border: 1px solid #bce5f3;
  border-radius: 8px;
  background: #243847e8;
  color: #e1f8ff;
  font: bold 11px monospace;
  box-shadow: 0 2px 14px #10263044;
  touch-action: manipulation
}

.chaff-button:disabled {
  opacity: .45;
  cursor: default
}

.chaff-button:not(:disabled):active {
  background: #54798b
}

.viewport:has(.chaff-button:not(.hidden)) .drift-meter {
  bottom: 190px
}

@media(max-width:760px) {
  .chaff-button {
    right: 13px;
    bottom: 124px;
    width: 104px;
    font-size: 10px
  }

  .viewport:has(.chaff-button:not(.hidden)) .drift-meter {
    bottom: auto
  }
}

.network-panel {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #c8bbdf;
  border-radius: 10px;
  background: #f0eaf8
}

.network-panel>strong {
  font: bold 11px monospace;
  letter-spacing: .7px
}

.network-controls,
.network-invite {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px
}

.network-panel input {
  min-height: 42px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #c8bbdf;
  border-radius: 6px;
  background: #fffdf7;
  color: #282738;
  font: 12px Arial
}

.network-controls input {
  width: 145px
}

.network-panel button {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid #b9a5d4;
  border-radius: 6px;
  background: #7251d2;
  color: white;
  font: bold 10px monospace
}

.network-panel button:disabled {
  opacity: .45;
  cursor: default
}

.network-panel p {
  margin: 10px 0 0;
  font: 12px Arial;
  line-height: 1.5;
  color: #645572
}

.network-players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px
}

.network-players span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 10px monospace;
  padding: 6px 8px;
  border-radius: 5px;
  background: #dfd2f0
}

.network-players span.speaking {
  background: #d2f3dc;
  box-shadow: 0 0 0 2px #36a868
}

.network-panel button.mic-button {
  background: #2f5e6e;
  border-color: #6298aa
}

.network-panel button.mic-button.talking {
  background: #229954;
  border-color: #7ee8a9;
  box-shadow: 0 0 0 2px rgba(126, 232, 169, .45)
}

.network-panel button.voice-mute {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1;
  background: rgba(40, 39, 56, .12);
  border-color: rgba(40, 39, 56, .2);
  color: #282738
}

.voice-indicator {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 6;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 22, 34, .82);
  border: 1px solid rgba(188, 229, 243, .45);
  color: #f9f4e8;
  font: bold 11px monospace;
  letter-spacing: .6px;
  pointer-events: none;
  white-space: nowrap
}

.voice-indicator.talking {
  background: rgba(26, 118, 66, .92);
  border-color: #9bf5be
}

.network-invite input {
  flex: 1;
  min-width: 200px
}

.leaderboard div {
  overflow-wrap: anywhere
}

@media(max-width:760px) {
  .network-panel {
    padding: 12px
  }

  .network-controls input,
  .network-controls button {
    flex: 1;
    min-width: 120px
  }

  .network-invite input {
    width: 100%;
    flex-basis: 100%
  }
}

.network-panel select {
  min-height: 42px;
  padding: 10px;
  border: 1px solid #c8bbdf;
  border-radius: 6px;
  background: #fffdf7;
  color: #282738;
  font: 12px Arial
}

.network-panel select:disabled {
  opacity: .65
}

@media(max-width:760px) {
  .network-panel select {
    flex: 1;
    min-width: 120px
  }
}

.render-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid #ffffff15;
  background: #242334;
  color: #cfc5df;
  font: 9px monospace
}

.render-controls label {
  display: flex;
  align-items: center;
  gap: 7px
}

.render-controls a { color: inherit; padding: 8px 2px; }

.render-controls select {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #7f7299;
  border-radius: 5px;
  background: #39334c;
  color: #f7f0ff;
  font: 11px Arial
}

.render-controls>span:last-child:not(#render-fps) {
  color: #f4c97c
}

#build-version {
  color: #cfc5df;
  font: 9px monospace;
  white-space: nowrap
}

.viewport.vulcan-active::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 3px #ffbd58, inset 0 0 55px #ff9c0040;
  animation: vulcan-breathe 1.6s ease-in-out infinite alternate
}

.route-hint.vulcan-banner {
  top: 14%;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: max-content;
  max-width: 94%;
  padding: 9px 18px;
  border: 1px solid #ffd36f;
  border-radius: 8px;
  background: #3c2819ee;
  color: #ffe4a0;
  font: bold 17px monospace;
  letter-spacing: 1px;
  text-shadow: 0 2px #211b26;
  box-shadow: 0 0 22px #fdb84b55;
  z-index: 3
}

.route-hint.vulcan-ending {
  color: #ffd2a0;
  border-color: #ff8b53;
  background: #4a281fee
}

.vulcan-active .toast {
  top: 25%
}

@keyframes vulcan-breathe {
  from {
    opacity: .65
  }

  to {
    opacity: 1
  }
}

@media(max-width:760px) {
  .route-hint.vulcan-banner {
    top: 64px;
    padding: 7px 12px;
    font-size: 12px;
    letter-spacing: .5px
  }

  .vulcan-active .toast {
    top: 103px;
    font-size: 10px
  }

  .vulcan-active .drift-meter {
    top: 128px;
    bottom: auto
  }
}

@media(prefers-reduced-motion:reduce) {
  .viewport.vulcan-active::after {
    animation: none
  }
}

@media(max-width:760px) {
  .item-box {
    padding: 7px;
    border-radius: 9px
  }

  .ammo-rack {
    gap: 4px
  }

  .ammo-card {
    width: 59px;
    min-height: 52px;
    padding: 4px;
    grid-template-columns: 19px 1fr;
    gap: 1px
  }

  .ammo-card.selected {
    padding: 3px
  }

  .ammo-card b {
    font-size: 28px
  }

  .ammo-icon {
    font-size: 18px
  }

  .ammo-label {
    font-size: 6px;
    letter-spacing: 0
  }

  .item-box strong {
    font-size: 8px
  }

  .item-box small {
    font-size: 6px
  }

  .item-box>div:not(.ammo-rack) {
    padding-top: 4px
  }

  #speed b {
    font-size: 28px
  }

  #speed small {
    font-size: 7px
  }
}

.center-message {
  z-index: 3
}

@media(max-width:760px) {
  .viewport {
    height: 380px
  }
}

.mode-switch {
  display: flex;
  gap: 8px;
  margin: 0 0 12px
}

.mode-switch button {
  border: 1px solid #d7cedf;
  background: #efeadf;
  border-radius: 7px;
  padding: 12px 18px;
  font: bold 11px monospace;
  letter-spacing: .6px
}

.mode-switch button[aria-pressed=true] {
  background: #7251d2;
  color: white;
  border-color: #7251d2
}

.map-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px
}

.map-switch>strong {
  font: 9px monospace;
  letter-spacing: 1px;
  margin-right: 4px
}

.map-switch button {
  min-height: 44px;
  border: 1px solid #d7cedf;
  border-radius: 7px;
  background: #faf8f0;
  padding: 10px 15px;
  font: bold 11px Arial;
  touch-action: manipulation
}

.map-switch button[aria-pressed=true] {
  background: #e8defa;
  border: 2px solid #7251d2;
  padding: 9px 14px;
  color: #6241b8
}

.map-switch small {
  font: 10px Arial;
  color: #797180;
  margin-left: 5px
}

.track-bottom {
  flex-wrap: wrap;
  gap: 8px
}

.track-bottom #change-track {
  width: auto;
  height: auto;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 6px;
  flex-shrink: 0;
  font: bold 9px monospace
}

@media(max-width:760px) {
  .map-switch>strong {
    width: 100%
  }

  .map-switch button {
    flex: 1;
    min-width: 0;
    padding: 10px 8px
  }

  .map-switch button[aria-pressed=true] {
    padding: 9px 7px
  }

  .map-switch small {
    width: 100%;
    margin: 2px 0 0
  }
}

.drift-meter {
  position: absolute;
  bottom: 135px;
  right: 20px;
  width: 180px;
  padding: 10px;
  border: 1px solid #fbb369;
  border-radius: 9px;
  background: #252437e8;
  color: #ffd18d;
  pointer-events: none;
  font: 10px monospace;
  box-shadow: 0 0 18px #ef8d4533
}

.drift-meter strong,
.drift-meter small {
  display: block
}

.drift-meter small {
  font-size: 8px;
  margin-top: 5px
}

.drift-meter progress {
  display: block;
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 5px;
  margin-top: 7px;
  overflow: hidden;
  appearance: none
}

.drift-meter progress::-webkit-progress-bar {
  background: #ffffff20
}

.drift-meter progress::-webkit-progress-value {
  background: #ffad54
}

.drift-meter progress::-moz-progress-bar {
  background: #ffad54
}

.drift-meter.charged {
  color: #97eaff;
  border-color: #59dfff;
  box-shadow: 0 0 20px #59dfff44
}

.drift-meter.charged progress::-webkit-progress-value {
  background: #59dfff
}

.drift-meter.charged progress::-moz-progress-bar {
  background: #59dfff
}

.drift-meter.super {
  color: #e3bbff;
  border-color: #c285ff;
  box-shadow: 0 0 22px #b354ff66
}

.drift-meter.super progress::-webkit-progress-value {
  background: #c285ff
}

.drift-meter.super progress::-moz-progress-bar {
  background: #c285ff
}

@media(max-width:760px) {
  .drift-meter {
    bottom: 124px;
    right: 13px;
    width: 146px;
    padding: 8px;
    font-size: 9px
  }

  .drift-meter small {
    font-size: 7px
  }

  .touch-controls {
    gap: 5px;
    padding: 10px
  }

  .touch-controls button {
    flex: 1;
    min-width: 0;
    padding: 14px 5px
  }

  .touch-controls button[data-key=arrowup] {
    background: #e0e9a7
  }

  .touch-controls button[data-key=arrowdown] {
    background: #e5dcef
  }
}

.route-hint {
  position: absolute;
  top: 15%;
  left: 15%;
  right: 15%;
  text-align: center;
  pointer-events: none;
  color: #fff0af;
  text-shadow: 1px 2px #29283b;
  font: bold 12px monospace;
  letter-spacing: .5px
}

.leaderboard {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f0;
  padding: 15px;
  font: 11px monospace
}

.leaderboard>strong {
  display: block;
  font-size: 9px;
  letter-spacing: .5px;
  margin-bottom: 10px
}

.leaderboard>div {
  padding: 5px 8px;
  border-radius: 4px
}

.leaderboard>.you {
  background: #e7dff8;
  color: #6241b8;
  font-weight: bold
}

.position b {
  white-space: nowrap
}

.lap b {
  white-space: nowrap
}

@media(max-width:760px) {
  .mode-switch button {
    padding: 10px 13px;
    font-size: 9px
  }

  .route-hint {
    top: 18%;
    left: 5%;
    right: 5%;
    font-size: 9px
  }

  .leaderboard {
    grid-column: 1/-1
  }

  .drift-meter {
    top: 90px;
    bottom: auto
  }
}

.network-name-status {
  align-self: center;
  font: 11px Arial;
  color: #645572
}

.center-message.results-visible {
  inset: 0;
  top: 0;
  height: 100%;
  padding: 14px 18px;
  background: #242033f5;
  overflow-y: auto;
  gap: 6px;
  justify-content: flex-start;
  text-shadow: none
}

.results-visible h2 {
  font-size: 25px;
  letter-spacing: -.5px;
  margin: 0
}

.results-visible p {
  margin: 0;
  font-size: 11px
}

.results-visible>small {
  margin-top: 2px
}

.results-visible .primary {
  padding: 10px 20px;
  min-height: 38px;
  flex-shrink: 0
}

.match-results {
  width: min(520px, 100%);
  margin: 3px 0
}

.match-results table {
  width: 100%;
  border-collapse: collapse;
  font: 11px monospace;
  text-align: left;
  table-layout: fixed
}

.match-results caption {
  font: bold 10px monospace;
  letter-spacing: 1px;
  padding: 4px 0 8px;
  color: #e4ef9a
}

.match-results th,
.match-results td {
  padding: 5px 8px;
  border-bottom: 1px solid #ffffff20;
  overflow-wrap: anywhere
}

.match-results th {
  color: #c6bbdf;
  font-size: 9px
}

.match-results th:nth-child(2) {
  width: 52%
}

.match-results .you {
  background: #7251d24d;
  color: #e4ef9a;
  font-weight: bold
}

@media(max-width:760px) {
  .center-message.results-visible {
    padding: 10px;
    gap: 4px
  }

  .results-visible h2 {
    font-size: 21px
  }

  .match-results th,
  .match-results td {
    padding: 4px 5px
  }

  .match-results table {
    font-size: 10px
  }
}

.incoming-warning {
  position: absolute;
  top: 31%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  max-width: 92%;
  width: max-content;
  padding: 11px 18px;
  border: 2px solid #ffad80;
  border-radius: 9px;
  background: #721e20f5;
  color: #fff4df;
  text-align: center;
  pointer-events: none;
  animation: incoming-pulse 1s steps(2, end) infinite;
  box-shadow: 0 0 22px #f33a2255
}

.incoming-warning strong {
  display: block;
  font: bold 18px monospace;
  letter-spacing: 1px
}

.incoming-warning span {
  display: block;
  margin-top: 5px;
  font: bold 10px monospace
}

@keyframes incoming-pulse {
  50% {
    background: #d53b25;
    border-color: #fff1b2;
    box-shadow: 0 0 32px #ff512599
  }
}

@media(max-width:760px) {
  .incoming-warning {
    top: 43%;
    padding: 9px 12px
  }

  .incoming-warning strong {
    font-size: 14px
  }

  .incoming-warning span {
    font-size: 9px
  }
}

@media(prefers-reduced-motion:reduce) {
  .incoming-warning {
    animation: none
  }
}

.somersault-button {
  left: 20px;
  right: auto;
  bottom: 150px;
  width: 152px
}

@media(max-width:760px) {
  .somersault-button {
    left: 13px;
    width: 138px
  }
}

.whack-banner {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 88%;
  z-index: 5;
  pointer-events: none;
  text-align: center
}

.whack-card {
  padding: 10px 22px;
  border: 3px solid #ffdc6a;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff7b7, #ffe2fa);
  color: #5829a4;
  box-shadow: 0 5px 0 #381e69, 0 0 24px #ffb33f80;
  font: bold 22px monospace;
  animation: whack-hop .65s ease-in-out infinite
}

.whack-card span {
  display: block;
  background: linear-gradient(90deg, #b523b8, #d13336, #825000, #16894b, #5544d6);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: 17px
}

.whack-card strong {
  display: block;
  margin-top: 5px;
  max-width: 360px;
  overflow-wrap: anywhere;
  text-shadow: 1px 1px #fff;
  color: #42266c
}

@keyframes whack-hop {

  0%,
  100% {
    transform: translateY(0) rotate(-2deg)
  }

  50% {
    transform: translateY(-13px) rotate(2deg)
  }
}

@media(max-width:760px) {
  .whack-card {
    padding: 8px 14px;
    font-size: 18px
  }

  .whack-card span {
    font-size: 13px
  }
}

@media(prefers-reduced-motion:reduce) {
  .whack-card {
    animation: none
  }
}

.averted-notice {
  padding: 5px 9px;
  border-width: 1px;
  background: #14573566;
  border-color: #99efad88;
  color: #effff1;
  box-shadow: 0 0 12px #42d57a33;
  animation: averted-pulse .75s ease-in-out 3
}

.averted-notice strong {
  font-size: 12px
}

.averted-notice span {
  display: none
}

@keyframes averted-pulse {
  50% {
    background: #26864a77;
    border-color: #dcffb999;
    box-shadow: 0 0 16px #63f59b44
  }
}

@media(prefers-reduced-motion:reduce) {
  .averted-notice {
    animation: none
  }
}

.play-request-popup {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 3px solid #b79ae9;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff8ce, #f0e4ff);
  color: #35284d;
  text-align: center;
  box-shadow: 0 8px 0 #60408b, 0 0 65px #a676e788;
  overflow-y: auto
}

.play-request-popup::backdrop {
  background: #211932b8;
  backdrop-filter: blur(4px)
}

.play-request-popup[open] {
  animation: play-request-pop .35s ease-out
}

.play-request-art {
  font-size: 52px;
  line-height: 1.2
}

.play-request-popup h2 {
  margin: 12px 0 8px;
  font-size: 30px;
  letter-spacing: -.8px;
  overflow-wrap: anywhere
}

.play-request-popup>p {
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 0 14px
}

.play-request-popup>p:empty {
  display: none
}

.play-request-people {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  margin: 18px 0
}

.play-request-person {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 8px 12px;
  border: 2px solid;
  border-radius: 12px;
  background: #fff9
}

.play-request-person span {
  font-size: 30px
}

.play-request-person strong {
  font-size: 14px;
  overflow-wrap: anywhere
}

.play-request-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px
}

.play-request-actions>button {
  min-height: 44px;
  border-radius: 8px
}

.play-request-actions>button:not(.primary) {
  padding: 10px 16px;
  border: 1px solid #9c84bd;
  background: #fff8;
  color: #5b4277;
  font: bold 11px monospace
}

.play-request-actions>button:disabled {
  opacity: .6;
  cursor: wait
}

@keyframes play-request-pop {
  from {
    opacity: 0;
    transform: translateY(28px) scale(.85)
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1)
  }
}

@media(max-width:760px) {
  .play-request-popup {
    padding: 18px
  }

  .play-request-popup h2 {
    font-size: 24px
  }

  .play-request-art {
    font-size: 42px
  }
}

@media(prefers-reduced-motion:reduce) {
  .play-request-popup[open] {
    animation: none
  }
}

.kart-nameplates {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden
}

.kart-nameplate {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: 160px;
  padding: 4px 7px;
  border-top: 3px solid;
  border-radius: 5px;
  background: #211932dd;
  color: white;
  font: bold 11px monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px #000
}

.hud,
.bottom-hud {
  z-index: 2
}

.mobile-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #eee7f7;
  color: #382748
}

.mobile-panel button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #b39bd1;
  border-radius: 7px;
  background: #fff7df;
  font: bold 10px monospace
}

.mobile-panel>span {
  flex-basis: 100%;
  font: 11px Arial;
  line-height: 1.5
}

.mobile-lock {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border: 1px solid #d4f78d;
  border-radius: 6px;
  background: #24432bdf;
  color: #e7ffba;
  font: bold 10px monospace;
  pointer-events: none;
  z-index: 2
}

body.mobile-playing {
  overflow: hidden;
  overscroll-behavior: none
}

.race-panel.mobile-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0
}

.mobile-fullscreen .viewport {
  flex: 1;
  width: 100%;
  height: auto !important;
  min-height: 0;
  aspect-ratio: auto
}

.mobile-fullscreen .race-bar {
  height: 30px;
  flex-shrink: 0
}

.mobile-fullscreen .game-footer,
.mobile-fullscreen .render-controls {
  display: none
}

.mobile-fullscreen .mobile-panel {
  padding: 4px;
  gap: 4px;
  flex-shrink: 0
}

.mobile-fullscreen .mobile-panel>span {
  display: block;
  font-size: 10px
}

.mobile-fullscreen .mobile-panel button {
  flex: 1;
  min-width: 70px;
  padding: 6px 4px;
  font-size: 9px
}

.mobile-fullscreen .touch-controls {
  position: static;
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  padding: 5px;
  margin: 0;
  border: 0;
  border-radius: 0;
  width: 100%
}

.mobile-fullscreen .touch-controls button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 3px
}

.mobile-bomber .touch-controls,
.mobile-bomber .controls,
.bomber-view .bottom-hud,
.bomber-view .lap {
  display: none !important
}

.bomber-view #game {
  touch-action: none;
  cursor: crosshair
}

.bomber-view .kart-nameplate {
  font-size: 9px;
  padding: 2px 4px;
  margin-top: -9px;
  max-width: 100px
}

.bomber-view .toast {
  top: 14%;
  font-size: 10px
}

.bomber-view .hud {
  pointer-events: none
}

.bomber-view .pause {
  bottom: 10px
}

.mobile-bomber .mobile-panel {
  align-items: center;
  flex-wrap: nowrap
}

.mobile-bomber .mobile-panel>span {
  flex: 1;
  font: 11px monospace
}

.mobile-bomber .mobile-panel button {
  flex: 0 0 auto;
  min-width: 75px
}

.bomb-hud {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 7px;
  background: #392e50;
  color: #fff2c6
}

.bomb-hud strong,
.bomb-hud span {
  display: block;
  font: bold 15px monospace;
  white-space: nowrap
}

.bomb-hud span {
  font-size: 9px;
  margin-top: 4px;
  color: #d4ef92
}

.bomb-hud.empty strong {
  color: #b7a9be
}

.bomber-view .center-message p {
  max-width: 90%;
  line-height: 1.6
}

.bomber-view .whack-card {
  padding: 5px 10px;
  font-size: 14px
}

.bomber-view .whack-card span {
  font-size: 10px
}

.bomber-camera-switch {
  position: absolute;
  bottom: 10px;
  left: 12px;
  z-index: 3;
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #fff7;
  border-radius: 9px;
  background: #282738d9
}

.bomber-camera-switch button {
  min-height: 40px;
  padding: 8px 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #ddd3ee;
  font: bold 10px monospace;
  touch-action: manipulation
}

.bomber-camera-switch button[aria-pressed=true] {
  background: #e4ef9a;
  color: #302d3b
}

.bomber-camera-tools {
  position: absolute;
  top: 100px;
  right: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid #fff7;
  border-radius: 9px;
  background: #282738d9
}

.bomber-camera-tools button {
  min-width: 40px;
  min-height: 40px;
  padding: 5px;
  border: 0;
  border-radius: 5px;
  background: #f6f3e915;
  color: #fff;
  font: bold 23px monospace;
  touch-action: manipulation
}

.bomber-camera-tools button:active {
  background: #e4ef9a;
  color: #302d3b
}

.play-request-countdown {
  display: block;
  margin: 14px auto;
  padding: 10px;
  border-radius: 9px;
  background: #44315d;
  color: #f0ffae;
  font: bold 22px monospace
}

.play-request-actions>button:not(.primary) {
  font-weight: 900
}

@media(max-height:500px) {
  .play-request-popup {
    padding: 12px
  }

  .play-request-art {
    display: none
  }

  .play-request-popup h2 {
    font-size: 22px;
    margin: 4px 0
  }

  .play-request-popup>p {
    margin: 5px 0
  }

  .play-request-countdown {
    font-size: 18px;
    padding: 6px;
    margin: 6px auto
  }

  .play-request-people {
    margin: 8px 0;
    max-height: 80px
  }

  .play-request-person {
    padding: 4px 8px
  }

  .play-request-person span {
    font-size: 24px
  }
}

.bomb-hud {
  display: flex;
  gap: 4px;
  background: none;
  padding: 0
}

.mobile-bomber .mobile-panel .bomb-choice {
  min-width: 82px;
  flex: 0 0 auto;
  padding: 6px;
  border: 2px solid transparent;
  background: #392e50;
  color: #fff2c6;
  text-align: left
}

.mobile-bomber .mobile-panel .bomb-choice[aria-pressed=true] {
  border-color: #e4ef9a;
  background: #50406c
}

.bomb-choice strong {
  font-size: 13px
}

.bomb-choice span {
  font-size: 8px
}

.bomb-choice.empty strong {
  color: #b7a9be
}

.dizzy-notice {
  position: absolute;
  top: 100px;
  left: 20px;
  padding: 6px 10px;
  border: 1px solid #dcefa888;
  border-radius: 7px;
  background: #39592b88;
  color: #efffd4;
  font: bold 12px monospace;
  pointer-events: none;
  z-index: 3
}

.dizzy-active {
  box-shadow: inset 0 0 20px #90ad4c66
}

@media(max-width:500px) {
  .mobile-bomber .mobile-panel>span {
    display: none
  }
}

.whack-card.co-whack {
  border-color: #9ce6b3;
  background: linear-gradient(135deg, #e4ffd0, #d5f4ef);
  box-shadow: 0 5px 0 #315950, 0 0 24px #7dcf9b80
}

.whack-card.cherno-whack {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-color: #d7f264;
  background: linear-gradient(135deg, #741d29, #34321a);
  color: #edff91;
  box-shadow: 0 5px 0 #391019, 0 0 22px #a7d64988, inset 0 0 0 1px #ffda6b66
}

.cherno-emblem {
  display: block;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 4px #eaff6b66)
}

.whack-card.cherno-whack span {
  background: none;
  color: #eaff79;
  font-size: clamp(10px, 1.6vw, 15px);
  letter-spacing: .4px
}

.whack-card.cherno-whack strong {
  color: #fff0bd;
  text-shadow: 1px 1px #3f1721
}

.bomber-view .whack-card.cherno-whack {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px
}

.bomber-view .cherno-emblem {
  width: 30px;
  height: 30px
}

.character-preview {
  margin: 0 0 16px;
  border: 1px solid #d6cbe2;
  border-radius: 10px;
  overflow: hidden;
  background: #e5deef
}

.character-preview canvas {
  display: block;
  width: 100%;
  height: 180px
}

.character-preview figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: #f1eaf7;
  font: 8px monospace;
  color: #635474;
  letter-spacing: .5px
}

.character-preview button {
  min-height: 32px;
  border: 1px solid #c5b4d7;
  border-radius: 5px;
  background: #fffaf2;
  padding: 5px 8px;
  font: bold 8px monospace;
  white-space: nowrap
}

@media(max-width:760px) {
  .character-preview canvas {
    height: 150px
  }

  .character-preview figcaption {
    flex-wrap: wrap;
    padding: 6px
  }
}

.item-box>.hedgeguard-status {
  max-width: 260px;
  padding: 0 0 7px !important;
  color: #9af5d8;
  font: bold 9px/1.4 monospace;
  letter-spacing: .3px
}

@media(max-width:760px) {
  .item-box>.hedgeguard-status {
    max-width: 190px;
    font-size: 7px
  }
}

.whack-card .whack-subtitle {
  display: block;
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 12px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: .02em;
  color: #fff1ce;
  text-shadow: 0 1px 2px #302637;
}

.item-box>.tehilim-status {
  max-width: 280px;
  padding: 0 0 7px !important;
  color: #c5d9ff;
  font: bold 9px/1.4 monospace;
  letter-spacing: .3px
}

.item-box>.intelligence-status {
  max-width: 280px;
  padding: 0 0 7px !important;
  color: #dcb9ff;
  font: bold 9px/1.4 monospace;
  letter-spacing: .3px
}

.bicycle-results {
  width: 100%;
  max-width: 370px;
  margin: 8px auto 4px;
  padding-top: 7px;
  border-top: 1px solid #c6adff55;
  font: 10px monospace
}

.bicycle-results table {
  width: 100%;
  border-collapse: collapse
}

.bicycle-results caption {
  padding: 0 0 4px;
  color: #dec5ff;
  font-size: 10px;
  letter-spacing: 1px
}

.bicycle-results td {
  padding: 2px 9px;
  text-align: left;
  color: #efe8ff
}

.bicycle-results td:last-child {
  text-align: right;
  color: #ffe897;
  font-weight: bold
}

.bicycle-results .you td {
  color: #c6f4a5
}

.reward-notice {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  pointer-events: none;
  width: max-content;
  max-width: 90%;
  text-align: center;
  --reward-color: #c6adff
}

.reward-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  padding: 12px 24px;
  border: 2px solid var(--reward-color);
  border-radius: 18px;
  background: linear-gradient(135deg, #291a49e8, #48306ace);
  color: #fff8da;
  box-shadow: 0 0 30px #b18aff77, inset 0 0 22px #c6adff22;
  font: bold 18px/1.35 monospace;
  animation: reward-arrive 3s both
}

.reward-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px var(--reward-color));
  animation: reward-brain .6s ease-out both
}

.reward-card>strong {
  letter-spacing: 1.5px;
  color: var(--reward-color)
}

.reward-card>small {
  grid-column: 1/-1;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: .6px;
  color: #f4eaff
}

.reward-counter {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font: bold 54px/64px monospace;
  height: 64px;
  font-variant-numeric: tabular-nums
}

.reward-before {
  color: #e3d4ff80;
  font-size: 34px
}

.reward-arrow {
  font-size: 25px;
  color: #ffdf93;
  animation: reward-arrow .7s .2s both
}

.reward-window {
  display: block;
  height: 64px;
  overflow: hidden;
  color: #fff9c4;
  text-shadow: 0 0 18px var(--reward-color), 0 2px #754da7
}

.reward-roll {
  display: block;
  animation: reward-tick .9s .2s cubic-bezier(.2, .8, .2, 1) both
}

.reward-roll>span {
  display: block;
  height: 64px
}

.reward-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff3ad;
  box-shadow: 0 0 9px var(--reward-color);
  animation: reward-spark 1s .15s ease-out both;
  transform: rotate(var(--spark-angle)) translateX(15px)
}

@keyframes reward-arrive {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(.7) rotate(-5deg)
  }

  12% {
    opacity: 1;
    transform: translateY(0) scale(1.06) rotate(1deg)
  }

  22%,
  84% {
    opacity: 1;
    transform: scale(1)
  }

  100% {
    opacity: 0;
    transform: translateY(-22px) scale(.95)
  }
}

@keyframes reward-tick {
  from {
    transform: translateY(0)
  }

  to {
    transform: translateY(calc(var(--reward-steps)*-64px))
  }
}

@keyframes reward-brain {
  from {
    transform: scale(.4) rotate(-25deg)
  }

  65% {
    transform: scale(1.25) rotate(8deg)
  }

  to {
    transform: scale(1) rotate(0)
  }
}

@keyframes reward-arrow {
  from {
    opacity: 0;
    transform: translateX(-12px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

@keyframes reward-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--spark-angle)) translateX(15px) scale(0)
  }

  20% {
    opacity: 1
  }

  100% {
    opacity: 0;
    transform: rotate(var(--spark-angle)) translateX(125px) scale(.2)
  }
}

@media(max-width:600px) {
  .reward-notice {
    top: 22%
  }

  .reward-card {
    padding: 9px 16px;
    font-size: 16px
  }

  .reward-card>small {
    font-size: 14px
  }
}

@media(prefers-reduced-motion:reduce) {
  .reward-card {
    animation: none
  }

  .reward-icon,
  .reward-arrow,
  .reward-spark {
    animation: none
  }

  .reward-spark {
    display: none
  }

  .reward-roll {
    animation: none;
    transform: translateY(calc(var(--reward-steps)*-64px))
  }
}

@media(max-width:760px) {
  .item-box>.tehilim-status {
    max-width: 190px;
    font-size: 7px
  }
}

.special-button {
  bottom: 177px
}

.special-status {
  position: absolute;
  left: 50%;
  top: 108px;
  transform: translateX(-50%);
  padding: 5px 10px;
  background: #232955aa;
  color: #fbeba7;
  font: 700 11px monospace;
  border-radius: 7px;
  pointer-events: none
}

.viewport.time-stopped {
  box-shadow: inset 0 0 55px 12px #7bafff88
}

.time-stopped .special-status {
  background: #17294cbb;
  color: #baf4ff;
  border: 1px solid #a4eaff88
}

.viewport.time-stopped::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-radial-gradient(ellipse at center, transparent 0 13%, #a4eaff18 13.2% 13.6%, transparent 14% 22%);
  box-shadow: inset 0 0 90px #641baf88;
  mix-blend-mode: screen;
  animation: time-warp-wave 1.2s ease-in-out infinite alternate
}

@keyframes time-warp-wave {
  from {
    opacity: .45;
    transform: scale(1)
  }

  to {
    opacity: .95;
    transform: scale(1.12)
  }
}

.preview-ability {
  padding: 10px 11px;
  border-top: 1px solid #d6cbe2;
  background: #faf5ff;
  color: #45384f
}

.preview-ability strong {
  display: block;
  font: 700 11px monospace;
  letter-spacing: .5px
}

.preview-ability p {
  margin: 6px 0;
  font: 11px/1.5 sans-serif
}

.preview-ability span {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 5px;
  background: #e7dcf4;
  font: 700 10px monospace
}

.preview-ability small {
  display: block;
  margin-top: 7px;
  font: 10px/1.5 sans-serif;
  color: #746681
}

.preview-ability.disabled span {
  background: #eadfdf;
  color: #7e4343
}

.preview-ability span:empty,
.preview-ability small:empty {
  display: none
}

.ring-of-fire-announcement {
  position: absolute;
  top: 17%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  text-align: center;
  width: max-content;
  max-width: 88%;
  padding: 8px 22px 10px;
  border: 1px solid #ff9b3c99;
  border-radius: 8px;
  background: radial-gradient(ellipse at bottom, #b53d1577, #32120d88 65%, #32120d22);
  box-shadow: 0 0 24px #ff5c1644, inset 0 -3px 14px #ff862a66;
  animation: ring-fire-arrive .35s ease-out, ring-fire-flicker .4s ease-in-out infinite alternate
}

.ring-of-fire-announcement strong {
  display: block;
  font: bold clamp(22px, 4vw, 36px)/1.1 monospace;
  letter-spacing: 3px;
  color: #fff3bb;
  text-shadow: 0 -2px 2px #fff6ba, 0 -5px 6px #ffb125, 0 -10px 15px #ff5416, 0 -17px 25px #d8250c, 2px 2px 0 #6e1c0a
}

.ring-of-fire-announcement span {
  display: block;
  margin-top: 6px;
  color: #ffd996cc;
  font: bold 10px monospace;
  letter-spacing: 2px
}

.ring-of-fire-announcement::before,
.ring-of-fire-announcement::after {
  content: '';
  position: absolute;
  bottom: 20%;
  left: 10%;
  width: 3px;
  height: 5px;
  border-radius: 50%;
  background: #ffd371;
  box-shadow: 40px 8px #ff8c28, 95px -3px #ffe4a2, 145px 5px #ffaf32, 190px -8px #ffc647;
  animation: ring-fire-embers 1.1s linear infinite
}

.ring-of-fire-announcement::after {
  left: 18%;
  animation-delay: -.55s
}

@keyframes ring-fire-arrive {
  from {
    opacity: 0;
    translate: 0 12px;
    scale: .75
  }

  to {
    opacity: 1;
    translate: 0 0;
    scale: 1
  }
}

@keyframes ring-fire-flicker {
  from {
    filter: brightness(1);
    box-shadow: 0 0 22px #ff5c1644, inset 0 -3px 14px #ff862a66
  }

  to {
    filter: brightness(1.2);
    box-shadow: 0 0 34px #ff6a2166, inset 0 -4px 20px #ff9e3577
  }
}

@keyframes ring-fire-embers {
  from {
    opacity: 0;
    translate: 0 0
  }

  20% {
    opacity: 1
  }

  to {
    opacity: 0;
    translate: 12px -55px
  }
}

@media(prefers-reduced-motion:reduce) {

  .ring-of-fire-announcement,
  .ring-of-fire-announcement::before,
  .ring-of-fire-announcement::after {
    animation: none
  }
}

.ring-of-fire-announcement.blue-fire {
  border-color: #63d6ff99;
  background: radial-gradient(ellipse at bottom, #2462c577, #121f3d88 65%, #12243d22);
  animation: ring-fire-arrive .35s ease-out, ring-blue-flicker .4s ease-in-out infinite alternate
}

.ring-of-fire-announcement.blue-fire strong {
  color: #ecfbff;
  text-shadow: 0 -2px 2px #edfcff, 0 -5px 6px #67deff, 0 -10px 15px #258cff, 0 -17px 25px #4431ee, 2px 2px 0 #172a65
}

.ring-of-fire-announcement.blue-fire span {
  color: #b3eaffdd
}

.ring-of-fire-announcement.blue-fire::before,
.ring-of-fire-announcement.blue-fire::after {
  background: #d4f7ff;
  box-shadow: 40px 8px #369dff, 95px -3px #e4fcff, 145px 5px #86ddff, 190px -8px #a3e8ff
}

@keyframes ring-blue-flicker {
  from {
    filter: brightness(1);
    box-shadow: 0 0 22px #327fff55, inset 0 -3px 14px #39b9ff66
  }

  to {
    filter: brightness(1.2);
    box-shadow: 0 0 34px #338cff77, inset 0 -4px 20px #6cdbff77
  }
}

@media(prefers-reduced-motion:reduce) {
  .ring-of-fire-announcement.blue-fire {
    animation: none
  }
}

/* A dedicated service offers only its shared arena, from the first paint. */
.dedicated-server .mode-switch,
.dedicated-server #restart,
.dedicated-server #change-track {
  display: none !important
}

.arena-connection {
  display: none
}

.dedicated-server:not(.arena-connected) .viewport>*:not(.arena-connection) {
  visibility: hidden
}

.dedicated-server:not(.arena-connected) .network-panel,
.dedicated-server:not(.arena-connected) aside,
.dedicated-server:not(.arena-connected) .map-switch,
.dedicated-server:not(.arena-connected) .touch-controls {
  display: none !important
}

.dedicated-server:not(.arena-connected) .arena-connection {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #594472, #29283b 75%);
  color: #fff3d7
}

.arena-connection>strong {
  font: bold clamp(16px, 3vw, 28px) monospace;
  letter-spacing: 2px
}

.arena-connection>p {
  max-width: 420px;
  font: 13px/1.6 monospace;
  margin: 0;
  overflow-wrap: anywhere
}

.bevy-loading-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #4b3968, #1d1b2d 78%);
  color: #fff3d7;
  visibility: visible !important
}

.bevy-loading-screen.hidden {
  display: none
}

.bevy-loading-screen>strong {
  font: bold clamp(16px, 2.8vw, 26px) monospace;
  letter-spacing: 2px;
  color: #ffe28a
}

.bevy-loading-screen>p {
  margin: 0;
  font: 13px/1.5 monospace;
  color: #f3e8ff
}

.bevy-loading-screen>small {
  font: 11px/1.4 monospace;
  color: #bfb2d6
}

.bevy-loading-track {
  width: min(340px, 82%);
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 226, 138, 0.35);
  overflow: hidden
}

.bevy-loading-bar {
  width: 6%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8a3d, #ffd84d, #6cf5d4);
  transition: width 160ms ease-out
}

.preview-ability-entry+.preview-ability-entry {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #ded0ec
}

.preview-ability-entry.disabled span {
  background: #eadfdf;
  color: #7e4343
}

.photo-button {
  position: absolute;
  bottom: 11px;
  right: 61px;
  z-index: 4;
  padding: 12px 9px;
  border: 1px solid #fff9;
  border-radius: 8px;
  background: #322b42e8;
  color: #fff4d3;
  font: bold 10px monospace;
  touch-action: manipulation;
  cursor: pointer
}

.photo-button:disabled {
  opacity: .6;
  cursor: default
}

.photo-status {
  position: absolute;
  bottom: 58px;
  right: 64px;
  z-index: 4;
  color: #fff4d3;
  background: #322b42aa;
  border-radius: 5px;
  font: 10px monospace;
  padding: 4px;
  pointer-events: none
}

.photo-status:empty {
  display: none
}

.camera-flash {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #fff;
  opacity: 0;
  pointer-events: none
}

.photo-slideshow {
  position: absolute;
  z-index: 9;
  inset: 5% 5% 8%;
  padding: 14px;
  border: 1px solid #f9e7b8;
  border-radius: 13px;
  background: #242131ed;
  color: #fff4d9;
  box-shadow: 0 10px 40px #0008;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center
}

.photo-slideshow>strong {
  font: bold 14px monospace;
  letter-spacing: 2px
}

.photo-slideshow img {
  min-height: 0;
  max-height: 70%;
  width: 100%;
  object-fit: contain;
  box-sizing: border-box;
  border: 7px solid #fff9e8;
  box-shadow: 0 5px 20px #0008;
  transform: rotate(-1deg)
}

.photo-slideshow p {
  font: 11px monospace;
  text-align: center;
  margin: 2px 0;
  overflow-wrap: anywhere
}

.photo-slideshow-controls {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap
}

.photo-slideshow button,
.photo-reopen {
  padding: 9px;
  border: 1px solid #a18bb6;
  border-radius: 6px;
  background: #504064;
  color: #fff4d9;
  font: bold 10px monospace;
  cursor: pointer;
  touch-action: manipulation
}

.photo-reopen {
  position: absolute;
  right: 12px;
  top: 60px;
  z-index: 8
}

@media(max-width:500px) {
  .photo-slideshow {
    padding: 9px;
    gap: 7px;
    inset: 4% 3%
  }

  .photo-slideshow>strong {
    font-size: 11px
  }

  .photo-slideshow img {
    border-width: 4px
  }

  .photo-slideshow p {
    font-size: 9px
  }

  .photo-slideshow button {
    font-size: 9px;
    padding: 8px
  }

  .photo-button {
    right: 58px
  }
}

/* Keep chat next to the game vertically, independent of the sidebar height. */
.game-column {
  min-width: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px
}

.game-column>.race-panel {
  align-self: stretch;
  width: 100%;
  min-width: 0
}

.chat-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  color: var(--ink);
  min-width: 0
}

.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px
}

.chat-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.5px
}

.chat-room {
  font: 9px monospace;
  letter-spacing: 1px;
  color: #796b94;
  background: #eee8f8;
  padding: 6px 9px;
  border-radius: 20px
}

.chat-recipient {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px
}

.chat-recipient>span {
  font: 9px monospace;
  letter-spacing: 1px;
  color: #81788d
}

.chat-recipient select {
  font: 600 13px Arial;
  max-width: 100%;
  min-width: 180px;
  padding: 9px 32px 9px 12px;
  border: 1px solid #d9cee9;
  border-radius: 9px;
  background: #f5f0fd;
  color: #594078
}

.chat-context {
  font-size: 12px;
  color: #82778d;
  margin: 14px 0 10px
}

.chat-messages {
  height: 250px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  margin: 0 0 12px;
  padding: 16px;
  background: #f3f0e9;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.chat-messages:empty:before {
  content: attr(data-empty);
  margin: auto;
  color: #8a8192;
  font-size: 13px;
  text-align: center
}

.chat-log-wrap {
  position: relative;
  margin-bottom: 12px;
}

.chat-log-wrap>.chat-messages {
  margin-bottom: 0;
}

.chat-scroll-down {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #c5b4d7;
  border-radius: 50%;
  background: #fffdf7;
  color: var(--purple);
  font: bold 18px/1 sans-serif;
  box-shadow: 0 2px 6px #30204026;
  cursor: pointer;
}

.chat-scroll-down:hover {
  background: #eee8f8;
}

.chat-scroll-down:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.chat-messages li {
  display: flex;
  flex-shrink: 0;
  min-width: 0
}

.chat-own {
  justify-content: flex-end
}

.chat-other {
  justify-content: flex-start
}

.chat-bubble {
  max-width: 84%;
  padding: 10px 13px;
  background: #fffdf7;
  border-radius: 14px 14px 14px 3px;
  box-shadow: 0 1px 2px #28273808;
  overflow-wrap: anywhere
}

.chat-own .chat-bubble {
  background: #e6ddf7;
  border-radius: 14px 14px 3px 14px
}

.chat-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 5px
}

.chat-meta strong {
  font-size: 11px;
  color: #66517f
}

.chat-meta time {
  font-size: 9px;
  color: #8d809c;
  white-space: nowrap
}

.chat-bubble>span {
  display: block;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45
}

.chat-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px 6px 14px;
  border: 1px solid #dcd3e8;
  border-radius: 28px;
  background: #fff
}

.chat-compose:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px #7251d214
}

.chat-compose input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: 14px Arial;
  padding: 8px 0;
  color: var(--ink);
  outline: none
}

.chat-compose button {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 20px;
  cursor: pointer
}

.chat-compose button:hover {
  background: #6040bb
}

.chat-panel :disabled {
  opacity: .5;
  cursor: default
}

.chat-status {
  min-height: 14px;
  margin: 9px 4px 0;
  color: #8a7f96;
  font-size: 10px
}

@media(max-width:600px) {
  .chat-panel {
    padding: 16px
  }

  .chat-messages {
    height: 230px;
    padding: 12px
  }

  .chat-bubble {
    max-width: 90%
  }

  .chat-heading h2 {
    font-size: 20px
  }

  .game-column {
    gap: 12px
  }
}

.chat-notification {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 2000;
  max-width: min(380px, calc(100vw - 32px));
  padding: 16px 20px;
  border: 1px solid #bba5ea;
  border-radius: 14px;
  background: #46316d;
  color: #fff;
  box-shadow: 0 8px 30px #28273830;
  font: 600 13px Arial;
  text-align: left;
  cursor: pointer;
  animation: chat-arrive .2s ease-out
}

.game-chat-notices {
  position: absolute;
  top: 88px;
  left: 14px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(280px, calc(100% - 28px));
  max-height: calc(100% - 108px);
  overflow-y: auto;
  pointer-events: none;
}

.game-chat-notice {
  padding: 10px 12px;
  border: 1px solid #c5b4d7;
  border-radius: 10px;
  background: #fffdf7cc;
  color: var(--ink);
  box-shadow: 0 3px 12px #28273825;
  font: 12px/1.4 sans-serif;
  overflow-wrap: anywhere;
  pointer-events: auto;
  animation: game-chat-drop .5s cubic-bezier(.2, .75, .3, 1) both;
}

@keyframes game-chat-drop {
  from {
    transform: translateY(-120px);
    opacity: 0;
  }
  80% {
    transform: translateY(3px);
    opacity: 1;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-chat-notice {
    animation: none;
  }
}

.game-chat-notice-heading,
.game-chat-notice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-chat-notice-heading small {
  color: #746681;
  flex-shrink: 0;
}

.game-chat-notice p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 5px 0;
}

.game-chat-notice button {
  border: 0;
  border-radius: 4px;
  padding: 3px 6px;
  background: #eee8f8;
  color: #6040a3;
  font: 600 11px sans-serif;
  cursor: pointer;
}

.game-chat-notice button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.chat-reply-button {
  display: block;
  margin: 7px 0 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #7251a0;
  font-size: 11px
}

.chat-quote {
  margin: 0 0 8px;
  padding: 6px 9px;
  border-left: 3px solid #a48acd;
  background: #7251d20c;
  border-radius: 4px;
  font-size: 12px;
  color: #71627e;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 85px;
  overflow: auto
}

.chat-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--purple);
  border-radius: 8px;
  background: #eee7fa;
  font-size: 12px;
  color: #635179
}

.chat-reply-preview span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis
}

.chat-reply-preview button {
  border: 0;
  background: none;
  font-size: 21px;
  flex-shrink: 0
}

@keyframes chat-arrive {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* Conversation buttons keep their identity stable while unread counts change. */
.chat-recipient {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px
}

.chat-recipient>span {
  flex-basis: 100%
}

.chat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  max-width: 100%
}

.chat-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid #d9cee9;
  border-radius: 10px;
  background: #faf7ff;
  color: #655278;
  font-size: 12px
}

.chat-tab[aria-selected=true] {
  background: #e8def9;
  border-color: var(--purple);
  color: #4b2f7a;
  box-shadow: 0 0 0 1px var(--purple)
}

.chat-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 50%;
  background: #23834b;
  color: white;
  font: bold 11px Arial
}

.chat-recipient .chat-notification {
  position: static;
  max-width: 100%;
  padding: 10px 12px;
  border-color: #91c6a2;
  border-radius: 10px;
  background: #e0f3e6;
  color: #185f35;
  box-shadow: 0 2px 8px #20653512;
  font-size: 12px;
  z-index: auto
}

.chat-message-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 7px
}

.chat-message-actions .chat-reply-button {
  margin: 0
}

.chat-delete {
  display: grid;
  place-items: center;
  padding: 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #85708e
}

.chat-delete:hover {
  background: #f4dce2;
  color: #a72b48
}

.chat-deleted {
  font-style: italic;
  color: #8d8196
}

.start-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 94%;
  margin: 0 auto
}

.start-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-shadow: none;
  text-align: left
}

.start-name>span {
  font: 9px monospace;
  letter-spacing: 1px;
  color: #e2d8ef
}

.start-name input {
  width: 180px;
  max-width: 100%;
  height: 44px;
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  background: #e4ef9a;
  color: #302d3b;
  box-shadow: 0 4px #687747;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  outline-offset: 3px
}

.start-name input::placeholder {
  color: #626b3c;
  font: inherit;
  letter-spacing: inherit
}

.start-name input:focus {
  background: #f0ffae;
  outline: 2px solid #a584ed
}

.start-row .primary,
.arena-connection .primary {
  width: 180px;
  min-width: 180px;
  height: 44px;
  padding: 12px 16px
}

.start-row .primary:disabled,
.arena-connection .primary:disabled {
  opacity: .5;
  cursor: default;
  transform: none
}

.arena-connection .start-name {
  margin: 0 auto
}

.arena-connection .start-name input {
  width: 180px
}

@media(max-width:600px) {
  .start-row {
    gap: 8px
  }

  .start-name input,
  .arena-connection .start-name input {
    width: 140px;
    height: 40px
  }

  .start-row .primary,
  .arena-connection .primary {
    width: 140px;
    min-width: 140px;
    height: 40px;
    min-height: 40px
  }

  .center-message .start-row {
    max-width: 96%
  }
}

/* Live chat uses the sidebar; the same map canvas continues updating in the HUD. */
.match-layout>aside {
  min-width: 0
}

.game-layout>aside>.chat-panel {
  width: 100%;
  padding: 15px
}

.game-layout>aside>.chat-panel .chat-heading {
  gap: 6px
}

.game-layout>aside>.chat-panel h2 {
  font-size: 18px
}

.game-layout>aside>.chat-panel .chat-room {
  font-size: 8px;
  letter-spacing: 0
}

.game-layout>aside>.chat-panel .chat-messages {
  height: 280px;
  padding: 10px
}

.game-layout>aside>.chat-panel .chat-tab {
  padding: 7px 9px;
  font-size: 11px
}

.game-layout>aside>.chat-panel .chat-bubble {
  max-width: 96%
}

.game-layout>aside>.chat-panel .chat-meta {
  gap: 8px
}

.live-minimap {
  position: absolute;
  right: 20px;
  top: 70px;
  width: 150px;
  padding: 0;
  z-index: 2;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  pointer-events: none
}

.live-minimap>span {
  display: block;
  text-align: center;
  font: 8px monospace;
  letter-spacing: 1px;
  color: #625271;
  margin-bottom: 3px
}

.live-minimap #map {
  width: 100%;
  height: auto
}

.live-minimap.combat-minimap {
  width: 90px;
  height: 90px
}

.live-minimap.combat-minimap #map {
  width: 210px;
  height: 94.5px;
  max-width: none;
  position: relative;
  left: 50%;
  top: -2.25px;
  transform: translateX(-50%)
}

@media(max-width:760px) {
  .match-layout>aside {
    display: flex;
    flex-direction: column
  }

  .game-layout>aside>.chat-panel .chat-messages {
    height: 230px
  }

  .live-minimap {
    right: 13px;
    top: 56px;
    width: 116px
  }

  .live-minimap.combat-minimap {
    width: 75px;
    height: 75px
  }

  .live-minimap.combat-minimap #map {
    width: 175px;
    height: 78.75px;
    top: -1.875px
  }
}

.bomber-view .live-minimap {
  bottom: auto
}

.match-layout>aside>.leaderboard {
  order: 0
}

.match-layout>aside>.tip {
  order: 1;
}


.game-layout>aside>.chat-panel {
  order: -1
}

.match-layout>aside>.racer-panel {
  order: 0
}

.viewport .ability-announcement.special-status {
  top: 15%;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  z-index: 6;
  color: #fff
}

.ability-announcement .reward-card {
  min-width: min(260px, 100%);
  max-width: min(440px, 100%);
  animation-duration: 2.4s;
  border-color: var(--reward-color);
  padding: 13px 21px
}

.ability-announcement .reward-icon {
  font-size: 35px
}

.ability-announcement .reward-card>strong {
  font-size: clamp(16px, 2vw, 18px)
}

.ability-announcement .reward-card>small {
  line-height: 1.5
}

.ability-announcement[data-theme=locust] .reward-card {
  background: radial-gradient(ellipse at 15% 30%, #b6f14c55, transparent 40%), linear-gradient(125deg, #133d20ef, #34581bea);
  border-radius: 30px 9px 30px 9px;
  box-shadow: 0 0 25px #9bf43c77
}

.ability-announcement[data-theme=gravity] .reward-card {
  background: repeating-radial-gradient(ellipse at 25% 50%, #bca0ff33 0 2px, transparent 3px 14px), #1f1438eb;
  box-shadow: 0 0 30px #ad8aff88
}

.ability-announcement[data-theme=relativity] .reward-card {
  background: repeating-linear-gradient(110deg, #42f6ef22 0 2px, transparent 3px 18px), linear-gradient(135deg, #123b59ed, #602f7bee);
  border-radius: 5px 28px 5px 28px;
  box-shadow: -9px 0 20px #63ecff66, 9px 0 20px #f67bff66
}

.ability-announcement[data-theme=fashion] .reward-card {
  background: repeating-linear-gradient(45deg, #e2b85a22 0 2px, transparent 2px 12px), linear-gradient(120deg, #783654ed, #3b223ded);
  border: 3px double #ffe0a1;
  border-radius: 28px 8px;
  box-shadow: 0 0 30px #ffacd477
}

.ability-announcement[data-theme=providence] .reward-card {
  background: conic-gradient(from 0deg at 17% 50%, #fff0b333, transparent 20%, #fff0b344 35%, transparent 55%, #fff0b333), #5c482be8;
  border: 3px double #fff1bf;
  border-radius: 50px 50px 12px 12px;
  box-shadow: 0 0 32px #fff2b477
}

.ability-announcement[data-theme=heartbeat] .reward-card {
  background: linear-gradient(140deg, #6a1836ed, #351d37ee);
  border-radius: 22px;
  box-shadow: 0 0 24px #ff739577
}

.ability-announcement[data-theme=heartbeat] .reward-icon {
  animation: ability-heartbeat .6s ease-in-out 4
}

.ability-announcement[data-theme=audit] .reward-card {
  background: #49352cf2;
  outline: 2px dashed #e19176;
  outline-offset: -7px;
  border-radius: 3px;
  border-width: 3px;
  box-shadow: 5px 5px #34191699
}

.ability-announcement[data-theme=audit] .reward-icon {
  color: #ff9d83;
  transform: rotate(-14deg);
  font-size: 44px
}

.ability-announcement[data-theme=xylophone] .reward-card {
  background: linear-gradient(0deg, #202038ed, #202038bd), repeating-linear-gradient(90deg, #f7788c 0 30px, #ffd574 30px 60px, #b4e97e 60px 90px, #7adbf0 90px 120px, #b697f2 120px 150px);
  border-radius: 9px;
  box-shadow: 0 0 28px #e1c27388
}

.ability-announcement[data-theme=darkness] .reward-card {
  background: radial-gradient(ellipse at 70% 30%, #9c4fe355, transparent 65%), #160e28f0;
  border-radius: 8px 30px;
  box-shadow: 0 0 35px #7d39d499, inset 0 0 25px #a261de33
}

.ability-announcement[data-theme=reefer] .reward-card {
  background: radial-gradient(ellipse at 15% 40%, #b6daba55, transparent 60%), #182a22e8;
  border-radius: 26px 10px;
  box-shadow: 0 0 28px #b0d4b955
}

.ability-announcement[data-theme=karma] .reward-card {
  max-width: min(520px, 100%);
  animation-duration: 3.8s;
  background: radial-gradient(ellipse at 20% 25%, #f8dc7d44, transparent 50%), radial-gradient(ellipse at 82% 75%, #88efc455, transparent 55%), linear-gradient(135deg, #1b4438f2, #2e5947ee 55%, #4f462af0);
  border: 3px double #f8df8c;
  border-radius: 26px 12px 26px 12px;
  box-shadow: 0 0 36px #86edc488, inset 0 0 22px #f6db7b33
}

.ability-announcement[data-theme=karma] .reward-icon {
  color: #fff2be;
  font-size: 42px;
  text-shadow: 0 0 16px #8ef0c8;
  animation: ability-karma-spin 1.8s ease-in-out 2
}

.ability-announcement[data-theme=euler] .reward-card {
  max-width: min(500px, 100%);
  animation-duration: 3.8s;
  background: radial-gradient(ellipse at 20% 25%, #f5d77f44, transparent 52%), radial-gradient(ellipse at 82% 75%, #5ea9ce44, transparent 55%), linear-gradient(135deg, #163047f2, #234966ee 55%, #5b4a26f0);
  border: 3px double #f5d77f;
  border-radius: 22px 10px 22px 10px;
  box-shadow: 0 0 34px #f5d77f88, inset 0 0 22px #5ea9ce33
}

.ability-announcement[data-theme=euler] .reward-icon {
  font-size: 40px;
  filter: drop-shadow(0 0 12px #f5d77f)
}

@keyframes ability-karma-spin {
  0% {
    transform: rotate(0deg) scale(.85)
  }

  50% {
    transform: rotate(180deg) scale(1.18)
  }

  100% {
    transform: rotate(360deg) scale(1)
  }
}

.setup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: 24px;
  margin-bottom: 18px;
}

.setup-row>* {
  min-width: 0;
}

.setup-row>.network-panel {
  margin-bottom: 0;
}

.game-layout>aside {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@keyframes ability-heartbeat {

  0%,
  100% {
    transform: scale(1)
  }

  20% {
    transform: scale(1.3)
  }

  40% {
    transform: scale(.94)
  }

  60% {
    transform: scale(1.14)
  }
}

@media(max-width:600px) {
  .viewport .ability-announcement.special-status {
    top: 17%
  }

  .ability-announcement .reward-card {
    min-width: 220px;
    max-width: 300px;
    padding: 10px 15px
  }

  .ability-announcement .reward-card>strong {
    font-size: 11px
  }
}

@media(prefers-reduced-motion:reduce) {
  .ability-announcement .reward-icon {
    animation: none
  }
}

@media (max-width: 760px) {
  .setup-row {
    grid-template-columns: 1fr;
  }
}

.setup-row>.racer-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.setup-row>.racer-panel>div {
  min-width: 0;
}

/* Keep the character buttons compact. */
.driver-choices .driver-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 6px;
}

.driver-choices .driver {
  width: 100%;
  height: 44px;
  aspect-ratio: auto;
  font-size: 22px;
}

.driver-presentation .driver-info {
  margin: 0 0 12px;
}

.driver-presentation {
  width: 100%;
  max-width: 360px;
  justify-self: center;
}

.driver-presentation .driver-info h3 {
  font-size: 13px;
}

.character-preview figcaption button {
  min-height: 26px;
}

.driver-presentation .character-preview {
  margin: 0;
}

.driver-features .stat:first-child {
  margin-top: 0;
}

/* Stack sections when the screen cannot fit the full row. */
@media (max-width: 1100px) {
  .setup-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .setup-row>.racer-panel {
    grid-template-columns: 1fr;
  }
}

.lobby-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.lobby-column>.network-panel,
.lobby-column>.mode-switch,
.lobby-column>.map-switch {
  margin-bottom: 0;
}

.lobby-column>.mode-switch {
  flex-wrap: wrap;
}

.lobby-column .map-switch small {
  flex-basis: 100%;
  margin-left: 0;
}

.driver-choices>.driver-features {
  margin-top: 18px;
}

.player-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 18px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.player-colors legend {
  padding: 0 6px;
  font: bold 10px monospace;
}

.color-swatch {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: transform .15s;
}

.color-swatch:not(:disabled):hover {
  transform: translateY(-3px);
}


.color-swatch:disabled {
  filter: grayscale(1);
  opacity: .35;
  cursor: not-allowed;
}

.color-swatch.taken:disabled {
  filter: none;
  opacity: 1;
}

.color-swatch.taken::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 2px;
  background: #30283c;
  box-shadow: 0 0 0 1px #fffdf7cc;
  transform: translate(-50%, -50%) rotate(-45deg);
  pointer-events: none;
}

.color-swatch[aria-pressed="true"] {
  box-shadow:
    0 0 0 3px #e8defa,
    0 0 0 5px var(--purple);
}

.color-feedback {
  margin: 8px 0 0;
  font: 12px/1.5 Arial;
  color: #645572;
}

.color-feedback:empty {
  display: none;
}

/* Compact character information during a match. */
body.match-active .setup-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

body.match-active .driver-choices>.section-label,
body.match-active .driver-choices>h2,
body.match-active .character-preview,
body.match-active #driver-desc,
body.match-active #driver-number,
body.match-active .color-feedback,
body.match-active .player-colors legend,
body.match-active .driver:not(.selected),
body.match-active .color-swatch:not([aria-pressed="true"]) {
  display: none;
}

body.match-active .setup-row>.racer-panel {
  align-self: end;
  grid-template-columns: 44px 30px minmax(140px, 1fr) minmax(0, 2fr);
  grid-template-areas: "symbol color name stats";
  align-items: center;
  gap: 20px;
  padding: 16px;
}

body.match-active .driver-choices,
body.match-active .driver-presentation {
  display: contents;
}

body.match-active .driver-grid {
  grid-area: symbol;
  display: flex;
  width: 44px;
}

body.match-active .driver.selected {
  opacity: 1;
  pointer-events: none;
}

body.match-active .driver-info {
  grid-area: name;
  margin: 0;
}

body.match-active .player-colors {
  grid-area: color;
  margin: 0;
  padding: 0;
  border: 0;
}

body.match-active .color-swatch[aria-pressed="true"] {
  filter: none;
  opacity: 1;
  pointer-events: none;
}

body.match-active .driver-features {
  grid-area: stats;
  margin-top: 0;
}

@media (max-width: 760px) {
  body.match-active .setup-row>.racer-panel {
    grid-template-columns: 44px 30px minmax(0, 1fr);
    grid-template-areas:
      "symbol color name"
      "stats stats stats";
  }

  body.match-active .setup-row {
    grid-template-columns: 1fr;
  }
}

body.match-active .lobby-column>.mode-switch,
body.match-active .lobby-column>.map-switch {
  display: none;
}

.ability-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ability-summary-row p {
  flex: 1;
  min-width: 0;
}

.ability-summary-row.truncated p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-ability .ability-read-more {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  padding: 4px;
  color: var(--purple);
  font: bold 11px sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.ability-dialog {
  position: fixed;
  inset: auto;
  margin: 0;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 32px));
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #c5b4d7;
  border-radius: 14px;
  background: #faf5ff;
  color: #45384f;
}

.ability-dialog::backdrop {
  background: transparent;
}

.ability-dialog h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.ability-dialog p {
  font-size: 14px;
  line-height: 1.6;
}

.ability-dialog button {
  padding: 4px 10px;
  font-size: 11px;
  border: 0;
  border-radius: 6px;
  background: var(--purple);
  color: white;
  cursor: pointer;
}

.chat-compose {
  position: relative;
  gap: 4px;
}

.chat-compose>.chat-emoji-toggle {
  width: 30px;
  height: 30px;
  background: transparent;
  color: var(--purple);
}

.chat-compose>.chat-emoji-toggle:hover {
  background: #eee8f8;
}

.chat-emoji-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(6, 30px);
  gap: 5px;
  padding: 10px;
  border: 1px solid #c5b4d7;
  border-radius: 10px;
  background: #fffdf7;
  box-shadow: 0 4px 16px #28273825;
}

.chat-emoji-picker button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  font-size: 21px;
}

.chat-emoji-picker button:hover {
  background: #eee8f8;
}

:root.bevy-beta {
  color-scheme: dark;
  --ink: #edeaf6;
  --paper: #111017;
  --muted: #b6aec5;
  --line: #494155;
  --beta-surface: #1c1925;
  --beta-raised: #2b2538;
  --beta-inset: #15121d;
  --beta-active: #3e2e55;
  --beta-accent: #cbb9ff;
}

.bevy-beta .race-panel {
  box-shadow: 0 5px 0 var(--beta-inset);
}

.bevy-beta :is(
  .racer-panel, .track-panel, .network-panel, .chat-panel, .leaderboard,
  .preview-ability, .ability-dialog, .chat-emoji-picker, .game-chat-notice
) {
  background: var(--beta-surface);
  border-color: var(--line);
  color: var(--ink);
}

.bevy-beta :is(
  .driver, .mode-switch button, .map-switch button, .character-preview figcaption button,
  .chat-tab, .chat-scroll-down, .mobile-panel button, .touch-controls button,
  .network-panel button.voice-mute, kbd
) {
  background: var(--beta-raised);
  border-color: var(--line);
  color: var(--ink);
}

.bevy-beta :is(.driver.selected, .mode-switch button[aria-pressed=true], .map-switch button[aria-pressed=true], .chat-tab[aria-selected=true]) {
  background: var(--beta-active);
  border-color: #a584ed;
  color: var(--beta-accent);
}

.bevy-beta :is(.network-panel input, .network-panel select, .match-limits select, .chat-recipient select, .chat-compose, .start-name input) {
  background: var(--beta-inset);
  border-color: var(--line);
  color: var(--ink);
}

.bevy-beta :is(.match-limits select:hover:enabled, .match-limits select:focus-visible, .chat-compose:focus-within) {
  background: var(--beta-inset);
  border-color: #a584ed;
}

.bevy-beta .start-name input {
  border: 1px solid var(--line);
  box-shadow: 0 4px var(--beta-active);
}

.bevy-beta :is(.pill, .character-preview, .preview-ability-entry+.preview-ability-entry, .player-colors) {
  border-color: var(--line);
}

.bevy-beta :is(.character-preview, .character-preview figcaption, .mobile-panel, .chat-messages, .chat-quote) {
  background: var(--beta-inset);
  color: var(--muted);
}

.bevy-beta :is(
  .intro-note p, .section-label, .driver-info span, .driver-info .driver-number,
  .track-bottom>span, .tip p, .map-switch small, .controls-title .eyebrow,
  .control>span, footer, .footer-logo,
  .network-panel p, .color-feedback, .preview-ability small, .chat-context,
  .chat-recipient>span, .chat-status, .chat-meta time, .chat-deleted, .game-chat-notice-heading small
),
.bevy-beta .chat-messages:empty::before,
.bevy-beta input::placeholder {
  color: var(--muted);
}

.bevy-beta :is(
  h1 em, .section-label>span:last-child, .tip>span, .tip strong, .purple,
  .preview-ability .ability-read-more, .chat-meta strong, .chat-compose>.chat-emoji-toggle,
  .chat-reply-button, .chat-delete
) {
  color: var(--beta-accent);
}

.bevy-beta :is(.network-players span, .chat-bubble, .chat-compose>.chat-emoji-toggle:hover, .chat-emoji-picker button:hover) {
  background: var(--beta-raised);
}

.bevy-beta :is(.leaderboard>.you, .preview-ability span, .chat-room, .chat-own .chat-bubble, .chat-reply-preview, .chat-scroll-down:hover, .game-chat-notice button) {
  background: var(--beta-active);
  color: var(--beta-accent);
}

.bevy-beta .stat i:not(.on) {
  background: var(--beta-raised);
}

.bevy-beta :is(.preview-ability.disabled span, .preview-ability-entry.disabled span, .chat-delete:hover) {
  background: #49283a;
  color: #ffb9c9;
}

.bevy-beta :is(.network-players span.speaking, .chat-recipient .chat-notification) {
  background: #20392c;
  color: #bdebd1;
}

.bevy-beta .touch-controls {
  background: #201c2af2;
}

.bevy-beta :is(.track-heading>span, .touch-controls button[data-key=arrowup]) {
  background: #36432b;
  color: #e3eeaa;
}
