:root {
  --bg: #060913;
  --panel: rgba(14, 20, 38, 0.78);
  --panel-solid: #101a2f;
  --border: rgba(126, 158, 255, 0.18);
  --text: #eef4ff;
  --muted: #8e9bbd;
  --cyan: #63e6ff;
  --pink: #ff5c8a;
  --violet: #9b7cff;
  --lime: #78f0b7;
  --danger: #ff5f6d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
}

/* ------------------------------- HUD ------------------------------- */

#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 13, 27, 0.55);
  color: #cfdcff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  backdrop-filter: blur(10px);
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

.fullscreen-btn {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(8, 13, 27, 0.62);
  color: #cfdcff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

.fullscreen-btn:active {
  transform: scale(0.95);
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.78);
  }
}

.my-stats {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-left: auto;
}

.stat {
  min-width: 90px;
  padding: 9px 15px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 13, 27, 0.6);
  text-align: right;
  backdrop-filter: blur(10px);
}

.stat span {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.stat-muted {
  min-width: 68px;
  opacity: 0.72;
}

.stat-muted span {
  font-size: 15px;
  line-height: 1.55;
}

.leaderboard {
  position: absolute;
  top: 54px;
  right: max(20px, env(safe-area-inset-right));
  width: 252px;
  padding: 13px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(16, 24, 45, 0.82), rgba(8, 13, 27, 0.72));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 3px 9px;
  border-bottom: 1px solid rgba(126, 158, 255, 0.1);
  color: #cfdcff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.online-count {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: none;
}

#leaderboardList {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

#leaderboardList li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 4px 3px;
  border-radius: 8px;
  font-size: 12px;
}

#leaderboardList li.is-me {
  background: rgba(99, 230, 255, 0.08);
}

#leaderboardList .rank {
  color: #697699;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

#leaderboardList li:nth-child(1) .rank {
  color: #ffd166;
}

#leaderboardList li:nth-child(2) .rank {
  color: #c8d7ff;
}

#leaderboardList li:nth-child(3) .rank {
  color: #e9a46b;
}

#leaderboardList .lb-name {
  overflow: hidden;
  color: #dce7ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#leaderboardList .lb-score {
  color: #9fb1d8;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.perf-panel {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(126, 158, 255, 0.1);
}

.perf-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #71809f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.perf-title span {
  color: #8ff0b9;
  letter-spacing: 0;
}

.perf-lines {
  margin-top: 5px;
  color: #71809f;
  font-size: 9px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  white-space: pre-line;
}

.perf-lines b {
  color: #a8b8d8;
  font-weight: 600;
}

#killfeed {
  position: absolute;
  top: 84px;
  left: 50%;
  display: grid;
  gap: 7px;
  width: min(420px, calc(100vw - 40px));
  transform: translateX(-50%);
}

.kill-item {
  justify-self: center;
  max-width: 100%;
  padding: 7px 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 92, 138, 0.22);
  border-radius: 999px;
  background: rgba(8, 13, 27, 0.7);
  color: #dfe8ff;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  animation: kill-in 0.22s ease-out both;
}

.kill-item b {
  color: #fff;
}

.kill-item .kill-victim {
  color: #ff9cb5;
}

.kill-item.is-me {
  border-color: rgba(255, 92, 138, 0.6);
  background: rgba(60, 12, 27, 0.78);
}

@keyframes kill-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.control-hint {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  gap: 18px;
  padding: 9px 15px;
  border: 1px solid rgba(126, 158, 255, 0.11);
  border-radius: 999px;
  background: rgba(6, 10, 21, 0.52);
  color: #7f8cae;
  font-size: 10px;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.control-hint b {
  color: #b9c8ec;
  font-weight: 700;
}

#minimapWrap {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 180px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#minimap {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.minimap-meta {
  display: none;
}

#mobileControls {
  display: none;
}

/* ------------------------------ Screens ----------------------------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(55, 82, 158, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(4, 7, 15, 0.42), rgba(4, 7, 15, 0.82));
  backdrop-filter: blur(7px);
}

#startScreen {
  background:
    radial-gradient(circle at 50% 42%, rgba(39, 66, 139, 0.14), transparent 44%),
    linear-gradient(180deg, rgba(4, 7, 15, 0.24), rgba(4, 7, 15, 0.72));
}

.start-card {
  position: relative;
  z-index: 2;
  width: min(470px, 100%);
  padding: 38px 40px 30px;
  border: 1px solid rgba(126, 158, 255, 0.2);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(20, 29, 55, 0.88), rgba(10, 16, 32, 0.9));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  backdrop-filter: blur(18px);
}

.start-card::before {
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(130deg, rgba(99, 230, 255, 0.18), transparent 35%, transparent 65%, rgba(255, 92, 138, 0.15));
  content: "";
  opacity: 0.7;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-bottom: 13px;
}

.logo-train {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-right: 2px;
}

.logo-train i {
  position: relative;
  display: block;
  width: 19px;
  height: 13px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: #63e6ff;
  box-shadow: 0 0 12px rgba(99, 230, 255, 0.22);
}

.logo-train i::after {
  position: absolute;
  right: 2px;
  bottom: -4px;
  left: 2px;
  height: 4px;
  border-radius: 999px;
  background: #1b2942;
  content: "";
}

.logo-train i:first-child {
  width: 30px;
  height: 20px;
  border-radius: 5px;
  background: #a9f7ff;
}

.logo-train i:first-child::before {
  position: absolute;
  top: -8px;
  right: 6px;
  width: 7px;
  height: 8px;
  border-radius: 2px 2px 0 0;
  background: #63e6ff;
  content: "";
}

.logo-train i:nth-child(2) {
  width: 22px;
  height: 15px;
  background: #7c8dff;
}

.logo-train i:nth-child(3) {
  width: 20px;
  height: 14px;
  background: #9b7cff;
}

.logo-train i:nth-child(4) {
  width: 17px;
  height: 12px;
  background: #63e6ff;
  opacity: 0.72;
}

.logo-text {
  color: #f5f8ff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
}

.logo-text span {
  color: var(--cyan);
}

.tagline {
  margin: 0 0 28px;
  color: #9aa9cc;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.name-field {
  display: block;
  margin-bottom: 14px;
  text-align: left;
}

.name-field span {
  display: block;
  margin: 0 0 7px 4px;
  color: #8c9bbc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.name-field input {
  width: 100%;
  height: 52px;
  padding: 0 17px;
  border: 1px solid rgba(126, 158, 255, 0.22);
  border-radius: 15px;
  outline: none;
  background: rgba(4, 8, 18, 0.55);
  color: #f2f7ff;
  font-size: 16px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.name-field input::placeholder {
  color: #5d6b8d;
}

.appearance-grid {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 10px;
  margin: -2px 0 14px;
}

.appearance-field {
  display: block;
  text-align: left;
}

.appearance-field > span {
  display: block;
  margin: 0 0 7px 4px;
  color: #8c9bbc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.appearance-field input[type="color"] {
  width: 100%;
  height: 46px;
  padding: 5px;
  border: 1px solid rgba(126, 158, 255, 0.22);
  border-radius: 13px;
  outline: none;
  background: rgba(4, 8, 18, 0.55);
  cursor: pointer;
}

.appearance-field select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(126, 158, 255, 0.22);
  border-radius: 13px;
  outline: none;
  background: rgba(4, 8, 18, 0.55);
  color: #eef4ff;
  font-size: 13px;
  cursor: pointer;
}

.appearance-field select:focus,
.appearance-field input[type="color"]:focus {
  border-color: rgba(99, 230, 255, 0.66);
  box-shadow: 0 0 0 4px rgba(99, 230, 255, 0.08);
}

#effects {
  position: absolute;
  bottom: max(74px, calc(env(safe-area-inset-bottom) + 62px));
  left: 50%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: min(520px, calc(100vw - 36px));
  transform: translateX(-50%);
}

.effect-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(101, 229, 255, 0.28);
  border-radius: 999px;
  background: rgba(7, 15, 30, 0.78);
  color: #dff8ff;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.effect-chip b {
  color: #8ff0ff;
}

.effect-chip small {
  color: #91a1c0;
  font-size: 9px;
  font-weight: 600;
}

.name-field input:focus {
  border-color: rgba(99, 230, 255, 0.66);
  background: rgba(4, 8, 18, 0.78);
  box-shadow: 0 0 0 4px rgba(99, 230, 255, 0.08);
}

.primary-btn {
  position: relative;
  width: 100%;
  height: 54px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(100deg, #63e6ff, #7c8dff 55%, #b084ff);
  box-shadow: 0 13px 34px rgba(85, 140, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  color: #081021;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.primary-btn::after {
  position: absolute;
  top: 0;
  left: -40%;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  content: "";
  transform: skewX(-22deg);
  animation: btn-shine 3.4s ease-in-out infinite;
}

@keyframes btn-shine {
  0%,
  55% {
    left: -45%;
  }
  82%,
  100% {
    left: 120%;
  }
}

.primary-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 17px 40px rgba(85, 140, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.995);
}

.primary-btn:disabled {
  cursor: default;
  filter: saturate(0.55) brightness(0.8);
  opacity: 0.7;
  transform: none;
}

.start-status {
  min-height: 17px;
  margin: 13px 0 0;
  color: #7887a8;
  font-size: 11px;
}

.start-status.is-error {
  color: #ff8da2;
}

.start-footer {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 23px;
  padding-top: 19px;
  border-top: 1px solid rgba(126, 158, 255, 0.1);
}

.start-footer div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.start-footer kbd {
  padding: 4px 7px;
  border: 1px solid rgba(126, 158, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(8, 14, 29, 0.7);
  color: #c6d5f9;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
}

.start-footer span {
  color: #6e7c9f;
  font-size: 9px;
}

.admin-link {
  position: absolute;
  right: 20px;
  bottom: 16px;
  z-index: 3;
  color: #536184;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.18s;
}

.admin-link:hover {
  color: #9cadd3;
}

.aurora {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(26px);
  opacity: 0.3;
  pointer-events: none;
}

.aurora-a {
  top: -220px;
  left: -160px;
  background: radial-gradient(circle, rgba(39, 183, 255, 0.38), transparent 66%);
  animation: aurora-a 11s ease-in-out infinite alternate;
}

.aurora-b {
  right: -180px;
  bottom: -220px;
  background: radial-gradient(circle, rgba(255, 76, 150, 0.26), transparent 66%);
  animation: aurora-b 13s ease-in-out infinite alternate;
}

@keyframes aurora-a {
  to {
    transform: translate(80px, 55px) scale(1.12);
  }
}

@keyframes aurora-b {
  to {
    transform: translate(-65px, -50px) scale(1.16);
  }
}

#deathScreen,
#disconnectScreen {
  z-index: 40;
  background: rgba(3, 6, 13, 0.72);
  backdrop-filter: blur(10px);
}

.death-card {
  width: min(390px, 100%);
  padding: 34px 36px 30px;
  border: 1px solid rgba(255, 92, 138, 0.22);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(27, 22, 44, 0.94), rgba(12, 14, 28, 0.95));
  box-shadow: var(--shadow);
  text-align: center;
}

.skull {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid rgba(255, 92, 138, 0.26);
  border-radius: 18px;
  background: rgba(255, 92, 138, 0.08);
  color: #ff8ea8;
  font-size: 28px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: #7f8eb3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.death-card h2 {
  margin: 0;
  color: #fff;
  font-size: 27px;
  letter-spacing: -0.02em;
}

.death-by {
  min-height: 18px;
  margin: 9px 0 20px;
  color: #9baacd;
  font-size: 12px;
}

.death-score {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid rgba(126, 158, 255, 0.14);
  border-radius: 16px;
  background: rgba(8, 12, 24, 0.46);
}

.death-score span {
  display: block;
  color: #fff;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.death-score small {
  display: block;
  margin-top: 4px;
  color: #7887a8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.respawn-timer {
  min-height: 16px;
  margin: 12px 0 0;
  color: #7887a8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 60;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid rgba(126, 158, 255, 0.22);
  border-radius: 12px;
  background: rgba(12, 19, 35, 0.92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color: #dce7ff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: rgba(255, 95, 109, 0.4);
  color: #ffb7c1;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #070b18;
  color: #fff;
  font-size: 16px;
}

@media (pointer: coarse) {
  .fullscreen-btn {
    display: grid;
    place-items: center;
  }

  .leaderboard {
    display: none !important;
  }

  #coords {
    display: none;
  }
}

/* ---------------------------- Mobile UI ---------------------------- */

@media (max-width: 760px) {
  .topbar {
    top: max(10px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
  }

  .fullscreen-btn {
    display: grid;
    place-items: center;
  }

  .leaderboard {
    display: none !important;
  }

  .brand-mini {
    padding: 8px 10px;
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .my-stats {
    gap: 5px;
  }

  .stat {
    min-width: 62px;
    padding: 7px 10px 6px;
    border-radius: 11px;
  }

  .stat span {
    font-size: 17px;
  }

  .stat small {
    font-size: 8px;
  }

  .stat-muted {
    display: none;
  }

  .leaderboard {
    top: 62px;
    right: 12px;
    width: 196px;
    padding: 10px 11px;
    border-radius: 14px;
  }

  .leaderboard-head {
    font-size: 9px;
  }

  #leaderboardList li {
    font-size: 10px;
    padding: 3px 2px;
  }

  #leaderboardList .lb-score {
    font-size: 9px;
  }

  #leaderboardList li:nth-child(n + 6) {
    display: none;
  }

  #killfeed {
    top: 62px;
    width: min(320px, calc(100vw - 24px));
  }

  .kill-item {
    font-size: 9px;
    padding: 6px 9px;
  }

  .control-hint {
    display: none;
  }

  #minimapWrap {
    right: 12px;
    bottom: calc(116px + env(safe-area-inset-bottom));
    width: 90px;
    padding: 0;
  }

  #effects {
    bottom: calc(132px + env(safe-area-inset-bottom));
    width: calc(100vw - 28px);
  }

  .effect-chip {
    padding: 5px 8px;
    font-size: 9px;
  }

  .minimap-meta {
    justify-content: center;
    font-size: 8px;
  }

  #coords {
    display: none;
  }

  .start-card {
    padding: 30px 24px 25px;
    border-radius: 24px;
  }

  .logo-text {
    font-size: 25px;
  }

  .start-footer {
    gap: 9px;
  }

  .admin-link {
    right: 14px;
    bottom: 10px;
  }

  .death-card {
    padding: 28px 25px 24px;
  }
}

@media (pointer: coarse), (max-width: 760px) {
  #mobileControls {
    position: absolute;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    pointer-events: none;
  }

  #joystick {
    position: relative;
    width: 104px;
    height: 104px;
    border: 1px solid rgba(126, 158, 255, 0.3);
    border-radius: 50%;
    background: rgba(12, 20, 38, 0.4);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(6px);
    pointer-events: auto;
    touch-action: none;
  }

  #joystick::before {
    position: absolute;
    inset: 24px;
    border: 1px dashed rgba(126, 158, 255, 0.18);
    border-radius: 50%;
    content: "";
  }

  #joystickKnob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(99, 230, 255, 0.75), rgba(124, 141, 255, 0.72));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
    transform: translate(-50%, -50%);
    will-change: transform;
  }

  .boost-btn {
    width: 88px;
    height: 88px;
    border: 1px solid rgba(255, 92, 138, 0.44);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 143, 171, 0.44), rgba(130, 27, 62, 0.65));
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32), inset 0 0 24px rgba(255, 92, 138, 0.14);
    color: #ffd5df;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    pointer-events: auto;
    touch-action: none;
  }

  .boost-btn.is-active {
    background: radial-gradient(circle at 35% 30%, rgba(255, 190, 210, 0.78), rgba(173, 32, 77, 0.85));
    transform: scale(0.96);
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  #joystick {
    width: 86px;
    height: 86px;
  }

  #joystickKnob {
    width: 36px;
    height: 36px;
  }

  .boost-btn {
    width: 74px;
    height: 74px;
    font-size: 8px;
  }

  #minimapWrap {
    top: 58px;
    right: 12px;
    bottom: auto;
    width: 74px;
  }

  .minimap-meta {
    display: none;
  }

  #effects {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .brand-mini {
    padding: 6px 9px;
  }

  .control-hint {
    display: none;
  }
}

@media (max-height: 620px) {
  .start-card {
    padding-top: 24px;
    padding-bottom: 20px;
  }

  .tagline {
    margin-bottom: 18px;
  }

  .start-footer {
    display: none;
  }

  .logo {
    margin-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
