:root {
  --paper: #f1efe4;
  --ink: #59615b;
  --night: #07111b;
  --cyan: #75d8ea;
  --red: #b74251;
  --green: #68c993;
  --gold: #deb56d;
  --glass: rgba(10, 18, 28, 0.72);
  --line: rgba(255, 255, 255, 0.13);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #eff5f3;
  touch-action: manipulation;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
canvas {
  display: block;
}
#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}
#game > canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}
body:not(.playing) #game > canvas {
  pointer-events: none;
}
.hidden {
  display: none !important;
}
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #f2f0e7;
  color: #687068;
  transition:
    0.45s opacity,
    0.45s visibility;
}
.loading-screen.done {
  opacity: 0;
  visibility: hidden;
}
.loading-mark {
  width: 34px;
  height: 34px;
  background: #bbc1bb;
  box-shadow: -10px 9px rgba(187, 193, 187, 0.28);
  animation: loadSpin 1.25s infinite ease-in-out;
}
.loading-build {
  position: absolute;
  bottom: 28px;
  font-size: 10px;
  letter-spacing: 0.25em;
}
@keyframes loadSpin {
  50% {
    transform: rotate(45deg) scale(0.8);
  }
  100% {
    transform: rotate(90deg);
  }
}
.screen-layer,
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 9, 15, 0.62);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: 0.22s;
}
.screen-layer.open,
.pause-overlay.open,
.profile-gate:not(.hidden),
.room-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}
.game-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(
    180deg,
    rgba(19, 29, 41, 0.95),
    rgba(7, 14, 23, 0.96)
  );
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  border-radius: 26px;
}
.profile-card {
  width: min(780px, 94vw);
  padding: 30px;
}
.menu-logo {
  width: min(290px, 62vw);
  display: block;
  margin: 0 0 12px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.25em;
  opacity: 0.62;
}
.profile-card h1 {
  font:
    500 clamp(25px, 4vw, 42px) Georgia,
    serif;
  margin: 8px 0 20px;
}
.name-field {
  display: grid;
  gap: 8px;
  max-width: 420px;
  font-size: 12px;
  color: #c8d1ce;
}
.name-field input,
.join-row input,
.gift-select,
.settings-pane select {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-radius: 12px;
  padding: 11px 13px;
  outline: 0;
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.avatar-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  border-radius: 17px;
  padding: 14px 8px;
  display: grid;
  gap: 5px;
  justify-items: center;
}
.avatar-card.active {
  outline: 2px solid var(--cyan);
  background: rgba(117, 216, 234, 0.12);
}
.avatar-card small {
  font-size: 9px;
  opacity: 0.6;
}
.avatar-head {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: block;
  background: #deb793;
  box-shadow: inset 0 16px 0 #272323;
}
.avatar-head.blond {
  box-shadow: inset 0 16px 0 #e2c866;
}
.avatar-head.pink {
  box-shadow: inset 0 16px 0 #e47ca8;
}
.avatar-head.white {
  box-shadow: inset 0 16px 0 #ecf1f4;
}
.server-line {
  font-size: 10px;
  opacity: 0.5;
  margin: 12px 0 0;
}
.lobby {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: clamp(24px, 6vw, 88px);
  background: linear-gradient(
    90deg,
    rgba(4, 10, 17, 0.82),
    rgba(4, 10, 17, 0.16) 62%,
    rgba(4, 10, 17, 0.02)
  );
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}
.lobby.open {
  opacity: 1;
  visibility: visible;
}
.lobby-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 70% 30%,
    transparent,
    rgba(3, 7, 12, 0.55)
  );
  pointer-events: none;
}
.lobby-card {
  position: relative;
  width: min(520px, 88vw);
}
.lobby-logo {
  margin-bottom: 20px;
}
.lobby-kicker {
  font-size: 10px;
  letter-spacing: 0.28em;
  opacity: 0.7;
}
.lobby-card h1 {
  font:
    500 clamp(28px, 5vw, 52px) Georgia,
    serif;
  margin: 10px 0;
}
.lobby-card p {
  font-size: 13px;
  line-height: 1.65;
  opacity: 0.72;
}
.lobby-actions,
.mode-picker {
  display: grid;
  gap: 9px;
  max-width: 280px;
  margin-top: 22px;
}
.menu-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(238, 240, 233, 0.1);
  color: #f3f6f3;
  border-radius: 12px;
  padding: 11px 15px;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.menu-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.menu-btn.primary {
  background: #e9eee7;
  color: #55605a;
}
.menu-btn.danger {
  background: #a93c4e;
}
.menu-btn.ghost {
  opacity: 0.65;
}
.menu-btn.wide {
  width: 100%;
  text-align: center;
}
.mode-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 18, 29, 0.56);
  color: #fff;
  border-radius: 14px;
  padding: 13px;
  text-align: left;
}
.mode-card strong {
  display: block;
}
.mode-card span {
  font-size: 10px;
  opacity: 0.6;
}
.text-btn {
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px 0;
  opacity: 0.75;
}
.lobby-footer {
  display: flex;
  gap: 14px;
  margin-top: 20px;
  font-size: 9px;
  opacity: 0.45;
}
.room-card {
  width: min(850px, 94vw);
  padding: 22px;
}
.room-head,
.map-card header,
.inventory-window header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.room-head h2,
.map-card h2,
.inventory-window h2 {
  margin: 3px 0;
}
.room-head small,
.map-card small,
.inventory-window small {
  font-size: 9px;
  letter-spacing: 0.2em;
  opacity: 0.55;
}
.icon-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
}
.room-entry {
  display: grid;
  gap: 12px;
  max-width: 470px;
  margin: 20px auto;
}
.join-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.room-active {
  margin-top: 12px;
}
.room-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 12px;
}
.room-code-box strong {
  letter-spacing: 0.3em;
  font-size: 20px;
}
.small-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
  border-radius: 10px;
  padding: 8px 11px;
}
.small-btn.primary {
  background: #68c9d8;
  color: #10343b;
}
.small-btn.danger {
  background: #9d4150;
}
.room-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.room-slot {
  min-height: 150px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}
.room-slot.filled {
  border-style: solid;
  background: rgba(117, 216, 234, 0.08);
}
.room-slot .mini-avatar {
  width: 54px;
  height: 74px;
  border-radius: 24px 24px 12px 12px;
  background: #dcb696;
  position: relative;
}
.room-slot small {
  font-size: 9px;
  opacity: 0.6;
}
.room-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 16px;
}
.online-block {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  font-size: 10px;
  opacity: 0.7;
}
#onlinePlayersList {
  margin-top: 6px;
}
.legacy-story {
  display: none !important;
}
.crosshair {
  position: fixed;
  z-index: 25;
  width: 15px;
  height: 15px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
}
.crosshair::before {
  left: 7px;
  top: 2px;
  width: 1px;
  height: 11px;
}
.crosshair::after {
  left: 2px;
  top: 7px;
  width: 11px;
  height: 1px;
}
.utility-settings {
  position: fixed;
  z-index: 28;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  background: rgba(239, 240, 232, 0.9);
  color: #677068;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
}
.comment-toggle {
  position: fixed;
  z-index: 29;
  right: 14px;
  top: 58px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(239, 240, 232, 0.9);
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
}
.unread {
  position: absolute;
  right: -4px;
  top: -5px;
  background: #b43b4b;
  color: #fff;
  border-radius: 20px;
  font-size: 8px;
  padding: 2px 5px;
}
.comment-panel {
  position: fixed;
  z-index: 35;
  right: 14px;
  top: 98px;
  width: min(310px, 72vw);
  max-height: 190px;
  border-radius: 14px;
  background: rgba(7, 14, 22, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: 0.2s;
}
.comment-panel.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.comment-panel header {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 10px;
}
.comment-panel header button {
  border: 0;
  background: none;
  color: #fff;
}
.comment-feed {
  max-height: 150px;
  overflow: auto;
  padding: 8px 10px;
  display: grid;
  gap: 7px;
}
.comment-line {
  font-size: 10px;
  line-height: 1.45;
  color: #d7dfdc;
}
.comment-line b {
  color: #78d8e8;
  font-weight: 700;
}
.comment-line.system b {
  color: #f1cd7b;
}
.minimap-wrap {
  position: fixed;
  z-index: 27;
  left: 14px;
  top: 14px;
  width: 128px;
  height: 128px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
}
.minimap-wrap canvas {
  width: 100%;
  height: 100%;
}
.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(3, 8, 14, 0.74);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
}
.map-overlay.open {
  opacity: 1;
  visibility: visible;
}
.map-card {
  width: min(1020px, 96vw);
  padding: 18px;
}
.map-card canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: #333;
}
.map-legend {
  display: flex;
  gap: 20px;
  font-size: 10px;
  margin-top: 8px;
}
.map-card p {
  font-size: 10px;
  opacity: 0.6;
}
.objective {
  position: fixed;
  z-index: 26;
  left: 14px;
  top: 153px;
  max-width: 350px;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.6);
  opacity: 0;
  visibility: hidden;
}
.objective span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.22em;
  opacity: 0.6;
}
.objective strong {
  font-size: 11px;
  font-weight: 500;
}
.health-hud {
  position: fixed;
  z-index: 26;
  left: 14px;
  top: 130px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  opacity: 0;
  visibility: hidden;
}
.health-hud > div {
  width: 124px;
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
}
.health-hud i {
  display: block;
  height: 100%;
  width: 100%;
  background: #d65a67;
}
.waypoint-hud {
  position: fixed;
  z-index: 25;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
}
.player-name-hud {
  position: fixed;
  z-index: 24;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  font-size: 9px;
  opacity: 0.55;
}
.inventory-bag {
  position: fixed;
  z-index: 29;
  right: 14px;
  top: 102px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(239, 240, 232, 0.9);
  font-size: 16px;
  opacity: 0;
  visibility: hidden;
}
.inventory-window {
  width: min(820px, 94vw);
  padding: 20px;
}
.inventory-hud {
  margin-top: 14px;
}
.inventory-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.15em;
  opacity: 0.7;
}
.inventory-slots {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 9px;
  margin: 12px 0;
}
.inventory-slot {
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 13px;
  min-height: 86px;
  padding: 8px 4px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
}
.inventory-slot.active {
  outline: 2px solid var(--cyan);
  background: rgba(117, 216, 234, 0.1);
}
.inventory-slot b {
  font-size: 22px;
}
.inventory-slot span,
.inventory-slot i {
  font-size: 9px;
  font-style: normal;
}
.inventory-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.gift-select {
  padding: 8px;
  color: #fff;
}
.item-effect-flash {
  position: fixed;
  inset: 0;
  z-index: 23;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 110px var(--effect, #75d8ea);
}
.item-effect-flash.active {
  animation: itemFx 0.65s ease-out;
}
@keyframes itemFx {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}
.toast {
  position: fixed;
  z-index: 41;
  left: 14px;
  bottom: 16px;
  max-width: 220px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(6, 13, 21, 0.82);
  font-size: 10px;
  opacity: 0;
  transform: translateY(5px);
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.settings-card {
  position: relative;
  width: min(660px, 94vw);
  padding: 28px 28px 22px 72px;
  background: linear-gradient(180deg, #efc37d, #f2d29d) !important;
  border: 6px solid #a9562e !important;
  color: #674629;
  border-radius: 28px;
  box-shadow:
    0 10px 0 #87431f,
    0 30px 70px rgba(0, 0, 0, 0.38);
}
.settings-card h1 {
  width: max-content;
  margin: -48px auto 24px;
  background: linear-gradient(#d66c35, #b94c24);
  border: 3px solid #9d401e;
  border-radius: 20px;
  padding: 8px 36px;
  color: #fff5e8;
  box-shadow: 0 5px 0 #813419;
}
.settings-tabs {
  position: absolute;
  left: -52px;
  top: 78px;
  display: grid;
  gap: 10px;
}
.settings-tab {
  width: 56px;
  height: 52px;
  border: 4px solid #a9562e;
  border-right: 0;
  border-radius: 15px 0 0 15px;
  background: #df9650;
  color: #fff;
  font-size: 20px;
}
.settings-tab.active {
  background: #4eb92b;
}
.settings-back {
  position: absolute;
  left: 14px;
  top: 12px;
  border: 0;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  background: #fff0cf;
}
.settings-card > .icon-close {
  position: absolute;
  right: 12px;
  top: 10px;
  background: #df4a38;
}
.settings-pane {
  display: none;
}
.settings-pane.active {
  display: block;
}
.settings-pane h2 {
  margin-top: 0;
}
.settings-pane p {
  font-size: 11px;
}
.settings-pane label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  font-size: 11px;
}
.settings-pane select {
  background: #fff2d5;
  color: #66482e;
}
.speed-setting {
  flex-wrap: wrap;
}
.speed-setting input {
  width: 100%;
}
.check input {
  accent-color: #45b825;
}
.game-over-card,
.victory-card {
  width: min(540px, 92vw);
  padding: 30px;
  text-align: center;
}
.game-over-card h1 {
  font-size: clamp(38px, 8vw, 66px);
  letter-spacing: 0.12em;
  margin: 8px 0;
  color: #f0dce1;
}
.game-over-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.victory-card label {
  display: grid;
  gap: 6px;
  margin: 12px;
}
.victory-card input {
  padding: 10px;
  border-radius: 10px;
  border: 0;
}
.victory-card ol {
  text-align: left;
  max-height: 170px;
  overflow: auto;
}
.mobile-controls {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.joystick,
.look-pad,
.action-btn {
  pointer-events: auto;
  touch-action: none;
}
.joystick {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
}
.stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin: -21px;
  border-radius: 50%;
  background: rgba(239, 240, 232, 0.72);
}
.look-pad {
  position: absolute;
  right: 130px;
  bottom: 22px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.14);
}
.action-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(238, 240, 232, 0.72);
  color: #58615b;
  font-size: 15px;
  font-weight: 700;
}
.action-btn.shoot {
  right: 18px;
  bottom: 20px;
}
.action-btn.jump {
  right: 18px;
  bottom: 74px;
}
.action-btn.aim {
  right: 70px;
  bottom: 73px;
}
.action-btn.run {
  right: 72px;
  bottom: 19px;
  font-size: 8px;
}
.action-btn.flyup {
  right: 18px;
  bottom: 132px;
}
.action-btn.flydown {
  right: 70px;
  bottom: 132px;
}
.action-btn.flyup,
.action-btn.flydown {
  display: none;
}
.action-btn.active {
  outline: 2px solid var(--cyan);
}
body.playing .minimap-wrap,
body.playing .objective,
body.playing .health-hud,
body.playing .crosshair,
body.playing .utility-settings,
body.playing .comment-toggle,
body.playing .inventory-bag {
  opacity: 1;
  visibility: visible;
}
body.flight-mode .flyup,
body.flight-mode .flydown {
  display: block;
}
body:not(.playing) .mobile-controls {
  display: none !important;
}
body.menu-paused .mobile-controls {
  display: none !important;
}
@media (pointer: coarse), (max-width: 820px) {
  body.playing:not(.menu-paused) .mobile-controls {
    display: block;
  }
  .minimap-wrap {
    width: 96px;
    height: 96px;
    left: 8px;
    top: 8px;
    border-radius: 14px;
  }
  .health-hud {
    left: 8px;
    top: 110px;
  }
  .health-hud > div {
    width: 96px;
  }
  .objective {
    left: 8px;
    top: 129px;
    max-width: 255px;
  }
  .objective strong {
    font-size: 9px;
  }
  .utility-settings {
    right: 8px;
    top: 8px;
    width: 30px;
    height: 30px;
  }
  .comment-toggle {
    right: 8px;
    top: 45px;
    width: 30px;
    height: 30px;
  }
  .inventory-bag {
    right: 8px;
    top: 82px;
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .comment-panel {
    right: 8px;
    top: 80px;
    width: 250px;
    max-height: 150px;
  }
  .comment-feed {
    max-height: 112px;
  }
  .player-name-hud {
    display: none;
  }
}
@media (max-width: 760px) {
  .avatar-picker {
    grid-template-columns: repeat(2, 1fr);
  }
  .room-slots {
    grid-template-columns: repeat(5, minmax(82px, 1fr));
    overflow-x: auto;
  }
  .inventory-slots {
    grid-template-columns: repeat(4, 1fr);
  }
  .settings-card {
    padding: 24px 14px 18px 50px;
  }
  .settings-tabs {
    left: -40px;
  }
  .settings-tab {
    width: 44px;
    height: 43px;
  }
  .settings-card h1 {
    font-size: 21px;
  }
  .menu-logo {
    width: 210px;
  }
}
@media (orientation: landscape) and (pointer: coarse) {
  .profile-card {
    max-height: 92vh;
    overflow: auto;
    padding: 15px 20px;
  }
  .profile-card h1 {
    font-size: 22px;
    margin: 5px 0 10px;
  }
  .avatar-picker {
    grid-template-columns: repeat(4, 1fr);
    margin: 10px 0;
  }
  .avatar-card {
    padding: 7px;
  }
  .avatar-head {
    width: 34px;
    height: 34px;
  }
  .lobby {
    padding: 20px 36px;
  }
  .lobby-logo {
    width: 170px;
    margin-bottom: 7px;
  }
  .lobby-card h1 {
    font-size: 28px;
  }
  .lobby-card p {
    font-size: 10px;
  }
  .lobby-actions,
  .mode-picker {
    margin-top: 10px;
    gap: 5px;
  }
  .menu-btn {
    padding: 7px 10px;
  }
  .joystick {
    width: 88px;
    height: 88px;
    left: 12px;
    bottom: 10px;
  }
  .stick {
    width: 34px;
    height: 34px;
    margin: -17px;
  }
  .look-pad {
    width: 76px;
    height: 76px;
    right: 112px;
    bottom: 12px;
  }
  .action-btn {
    width: 39px;
    height: 39px;
    font-size: 12px;
  }
  .action-btn.shoot {
    right: 12px;
    bottom: 12px;
  }
  .action-btn.jump {
    right: 12px;
    bottom: 56px;
  }
  .action-btn.aim {
    right: 56px;
    bottom: 56px;
  }
  .action-btn.run {
    right: 58px;
    bottom: 12px;
    font-size: 7px;
  }
  .action-btn.flyup {
    right: 12px;
    bottom: 102px;
  }
  .action-btn.flydown {
    right: 56px;
    bottom: 102px;
  }
  .inventory-window {
    max-height: 88vh;
    overflow: auto;
    padding: 12px;
  }
  .inventory-slots {
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
  }
  .inventory-slot {
    min-height: 55px;
    padding: 4px;
  }
  .inventory-slot b {
    font-size: 16px;
  }
  .settings-card {
    max-height: 90vh;
    overflow: auto;
  }
  .map-card {
    max-height: 92vh;
  }
  .map-card canvas {
    max-height: 67vh;
  }
}

/* Final UI correction */
:root {
  --mobile-control-scale: 0.8;
}
.loading-build {
  display: none !important;
}
.lobby-description {
  font-size: 14px !important;
  max-width: 450px;
  color: rgba(242, 246, 244, 0.82) !important;
  letter-spacing: 0.015em;
}
.comment-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.comment-compose input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 10px;
  outline: 0;
}
.comment-compose button {
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  background: #77d3df;
  color: #123842;
  font-size: 9px;
  font-weight: 700;
}
.server-config {
  display: grid !important;
  grid-template-columns: 1fr auto;
  gap: 7px !important;
  align-items: center !important;
}
.server-config small {
  grid-column: 1/-1;
  letter-spacing: 0.14em;
}
.server-config input {
  min-width: 0;
  border: 1px solid rgba(111, 71, 42, 0.25);
  background: #fff1d3;
  color: #674629;
  border-radius: 10px;
  padding: 9px;
}
.server-config span {
  grid-column: 1/-1;
  font-size: 9px;
  opacity: 0.7;
}
.control-edit-done {
  position: fixed;
  z-index: 90;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 9px 15px;
  background: #72d6e4;
  color: #123942;
  font-weight: 800;
  font-size: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22);
}
body.control-edit .mobile-controls {
  display: block !important;
  pointer-events: none;
}
body.control-edit .mobile-movable {
  outline: 2px dashed #7de4ef !important;
  pointer-events: auto !important;
}
body.control-edit .mobile-movable::after {
  content: "";
}
.mobile-controls {
  transform-origin: center center;
}
.action-btn {
  transform: scale(var(--mobile-control-scale));
  transform-origin: center;
}
.joystick,
.look-pad {
  transform: scale(var(--mobile-control-scale));
  transform-origin: center;
}
body:not(.playing):not(.control-edit) .mobile-controls {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body:not(.playing) .utility-settings,
body:not(.playing) .comment-toggle,
body:not(.playing) .inventory-bag,
body:not(.playing) .minimap-wrap,
body:not(.playing) .objective,
body:not(.playing) .health-hud {
  opacity: 0 !important;
  visibility: hidden !important;
}
.profile-gate.screen-layer:not(.hidden),
.room-overlay.screen-layer:not(.hidden) {
  display: grid;
}
@media (pointer: coarse), (max-width: 820px) {
  .profile-card {
    width: min(660px, 96vw);
  }
  .menu-logo {
    width: min(180px, 40vw);
  }
  .lobby {
    padding: 18px 24px;
  }
  .lobby-card {
    width: min(390px, 74vw);
  }
  .lobby-card h1 {
    font-size: 26px;
  }
  .lobby-description {
    font-size: 10px !important;
    line-height: 1.5 !important;
  }
  .lobby-actions {
    max-width: 220px;
  }
  .menu-btn {
    padding: 7px 10px;
    font-size: 9px;
  }
  .inventory-window {
    width: min(690px, 94vw);
    max-height: 88vh;
    overflow: auto;
  }
  .inventory-slots {
    grid-template-columns: repeat(8, minmax(48px, 1fr));
    gap: 5px;
  }
  .inventory-slot {
    min-height: 54px;
    padding: 4px 2px;
  }
  .inventory-slot b {
    font-size: 15px;
  }
  .inventory-slot span,
  .inventory-slot i {
    font-size: 7px;
  }
  .inventory-actions {
    gap: 4px;
  }
  .small-btn,
  .gift-select {
    font-size: 8px;
    padding: 6px 8px;
  }
  .comment-panel {
    width: min(260px, 60vw);
    max-height: 175px;
  }
  .comment-feed {
    max-height: 105px;
  }
  .comment-line {
    font-size: 9px;
  }
}
@media (orientation: landscape) and (pointer: coarse) {
  .lobby {
    align-items: center;
  }
  .lobby-card {
    width: 360px;
  }
  .lobby-logo {
    width: 145px;
  }
  .lobby-card h1 {
    font-size: 24px;
    margin: 4px 0;
  }
  .lobby-description {
    max-width: 330px;
    margin: 6px 0;
  }
  .lobby-footer {
    margin-top: 8px;
  }
  .room-card {
    max-height: 92vh;
    overflow: auto;
    padding: 12px;
  }
  .room-slot {
    min-height: 88px;
  }
  .room-slot .mini-avatar {
    width: 36px;
    height: 52px;
  }
  .room-actions {
    margin: 8px;
  }
  .profile-card {
    max-height: 92vh;
  }
  .avatar-card small {
    display: none;
  }
  .minimap-wrap {
    width: 82px;
    height: 82px;
  }
  .health-hud {
    top: 96px;
  }
  .objective {
    top: 114px;
    max-width: 200px;
  }
  .objective strong {
    font-size: 8px;
  }
  .utility-settings,
  .comment-toggle,
  .inventory-bag {
    width: 27px;
    height: 27px;
    font-size: 11px;
  }
  .utility-settings {
    top: 7px;
    right: 7px;
  }
  .comment-toggle {
    top: 39px;
    right: 7px;
  }
  .inventory-bag {
    top: 71px;
    right: 7px;
  }
}
.boot-error {
  display: grid;
  gap: 10px;
  width: min(420px, 88vw);
  padding: 22px;
  border-radius: 18px;
  background: #fff;
  color: #59615b;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.2);
  text-align: center;
}
.boot-error b {
  font-size: 18px;
}
.boot-error span {
  font-size: 11px;
  line-height: 1.5;
}
.boot-error button {
  justify-self: center;
  border: 0;
  border-radius: 999px;
  background: #66746c;
  color: #fff;
  padding: 9px 14px;
}

/* Share-ready responsive shell */
html,
body {
  min-width: 0;
  min-height: 0;
  overscroll-behavior: none;
}
body {
  overflow: hidden;
}
button,
input,
select,
textarea {
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}
#game,
canvas,
.mobile-controls,
.joystick,
.look-pad,
.action-btn {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.screen-layer,
.pause-overlay {
  min-height: 100dvh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
.profile-gate {
  align-items: center;
}
.profile-card {
  position: relative;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  scrollbar-width: thin;
  padding: clamp(18px, 3.2vh, 30px);
}
.profile-card .menu-logo {
  width: clamp(170px, 19vw, 265px);
  margin-bottom: clamp(8px, 1.5vh, 14px);
}
.profile-card h1 {
  font-size: clamp(25px, 3.1vw, 42px);
  line-height: 1.12;
  margin: 6px 0 clamp(12px, 2vh, 20px);
}
.name-field {
  max-width: none;
}
.name-field input {
  width: 100%;
  min-height: 46px;
  caret-color: #7de4ef;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}
.name-field input:focus {
  border-color: #79dbe9;
  box-shadow: 0 0 0 3px rgba(117, 216, 234, 0.13);
}
.avatar-picker {
  margin: clamp(10px, 2vh, 18px) 0;
  gap: 9px;
}
.avatar-card {
  min-width: 0;
  padding: clamp(8px, 1.4vh, 13px) 7px;
}
.avatar-card b {
  font-size: clamp(11px, 1.15vw, 15px);
}
.profile-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-radius: 50%;
  font-size: 21px;
}
.profile-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 9px;
  opacity: 0.58;
}
.profile-meta-line .server-line {
  margin: 0;
}
.rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #07111b;
  color: #eef5f3;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.rotate-hint p {
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin: 14px 0 0;
}
.phone-rotate-icon {
  width: 52px;
  height: 82px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 11px;
  position: relative;
  animation: phoneRotate 1.8s ease-in-out infinite;
}
.phone-rotate-icon:after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}
.phone-rotate-icon span {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid #75d8ea;
  border-left-color: transparent;
  border-radius: 50%;
  right: -28px;
  top: 25px;
}
.phone-rotate-icon span:after {
  content: "";
  position: absolute;
  right: -3px;
  top: 1px;
  border: 5px solid transparent;
  border-top-color: #75d8ea;
  transform: rotate(-28deg);
}
@keyframes phoneRotate {
  0%,
  25% {
    transform: rotate(0);
  }
  65%,
  100% {
    transform: rotate(90deg);
  }
}
.compact-panel {
  position: relative;
  width: min(470px, 92vw);
  padding: 26px;
}
.compact-panel h2,
.account-card h2 {
  font:
    500 clamp(24px, 4vw, 34px) Georgia,
    serif;
  margin: 8px 0;
}
.compact-panel p {
  font-size: 11px;
  line-height: 1.65;
  opacity: 0.72;
}
.auth-choice-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.auth-card > .icon-close,
.account-card > .icon-close {
  position: absolute;
  right: 12px;
  top: 12px;
}
.account-card {
  position: relative;
  width: min(520px, 92vw);
  max-height: calc(100dvh - 30px);
  overflow: auto;
  padding: 26px;
}
.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 14px 0;
}
.account-tab {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 9px;
  border-radius: 11px;
}
.account-tab.active {
  background: #75d8ea;
  color: #123842;
}
.account-form {
  display: none;
  gap: 10px;
}
.account-form.active {
  display: grid;
}
.account-form label {
  display: grid;
  gap: 6px;
  font-size: 10px;
}
.account-form input {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 11px;
  padding: 11px;
  outline: none;
}
.account-status {
  min-height: 20px;
  font-size: 10px;
  opacity: 0.72;
}
.lobby {
  overflow: auto;
  min-height: 100dvh;
  height: 100dvh;
  align-items: center;
  gap: clamp(30px, 5vw, 90px);
}
.lobby-card {
  flex: 0 1 520px;
}
.lobby-profile-panel {
  position: relative;
  z-index: 2;
  margin-left: auto;
  width: min(330px, 33vw);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(
    180deg,
    rgba(15, 25, 38, 0.78),
    rgba(7, 14, 23, 0.76)
  );
  backdrop-filter: blur(16px);
  border-radius: 22px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.26);
}
.profile-rank-frame {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(222, 181, 109, 0.25);
  background: linear-gradient(
    135deg,
    rgba(222, 181, 109, 0.12),
    rgba(255, 255, 255, 0.02)
  );
  border-radius: 16px;
}
.rank-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #deb793;
  box-shadow:
    inset 0 17px 0 #262323,
    0 0 0 3px #aeb7b2;
}
.profile-rank-frame div:last-child {
  display: grid;
}
.profile-rank-frame small {
  color: #deb56d;
  font-size: 8px;
  letter-spacing: 0.14em;
}
.profile-rank-frame strong {
  font-size: 15px;
}
.profile-rank-frame span {
  font-size: 9px;
  opacity: 0.6;
}
.currency-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 3px 7px;
  font-size: 11px;
}
.currency-row span:first-child {
  color: #7ee8f3;
}
.xp-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.xp-track i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #71d9e7, #deb56d);
  transition: 0.3s;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}
.stat-grid div {
  display: grid;
  text-align: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}
.stat-grid b {
  font-size: 14px;
}
.stat-grid span {
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.52;
}
.global-board-card {
  width: min(760px, 94vw);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 22px;
}
.global-board-card > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.global-board-card h2 {
  margin: 2px 0;
  font:
    500 30px Georgia,
    serif;
}
.global-board-card header small {
  font-size: 9px;
  letter-spacing: 0.22em;
  opacity: 0.55;
}
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 10px;
  margin: 22px auto 16px;
  max-width: 560px;
}
.podium-card {
  min-height: 116px;
  padding: 12px;
  border-radius: 17px;
  text-align: center;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.podium-card span {
  font:
    600 27px Georgia,
    serif;
}
.podium-card b {
  font-size: 12px;
}
.podium-card small {
  font-size: 8px;
  opacity: 0.55;
}
.podium-card.gold {
  min-height: 145px;
  background: linear-gradient(
    180deg,
    rgba(222, 181, 109, 0.32),
    rgba(222, 181, 109, 0.08)
  );
  border-color: rgba(250, 215, 132, 0.45);
  box-shadow: 0 0 28px rgba(222, 181, 109, 0.12);
}
.podium-card.silver {
  background: rgba(196, 207, 213, 0.11);
}
.podium-card.bronze {
  background: rgba(187, 121, 78, 0.12);
}
.board-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.board-tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 9px;
}
.board-tab.active {
  background: #75d8ea;
  color: #123842;
}
.global-board-list {
  margin: 15px auto 0;
  padding: 0;
  list-style: none;
  max-width: 610px;
  display: grid;
  gap: 5px;
}
.global-board-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 11px;
  font-size: 10px;
}
.global-board-list li strong {
  font-weight: 600;
}
.global-board-list li em {
  font-style: normal;
  color: #deb56d;
}
.leave-card {
  text-align: center;
}
.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.leave-game-btn {
  position: fixed;
  z-index: 29;
  right: 14px;
  top: 146px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(239, 240, 232, 0.9);
  font-size: 16px;
  color: #59615b;
  opacity: 0;
  visibility: hidden;
}
body.playing .leave-game-btn {
  opacity: 1;
  visibility: visible;
}
@media (max-height: 760px) and (min-width: 900px) {
  .profile-card {
    padding: 16px 22px;
  }
  .profile-card .menu-logo {
    width: 190px;
  }
  .profile-card h1 {
    font-size: 28px;
    margin: 4px 0 11px;
  }
  .avatar-picker {
    margin: 9px 0;
  }
  .avatar-card {
    padding: 7px;
  }
  .avatar-head {
    width: 36px;
    height: 36px;
  }
  .name-field input {
    min-height: 40px;
    padding: 8px 11px;
  }
  .profile-meta-line {
    margin-top: 6px;
  }
  .lobby {
    padding: 20px 45px;
  }
  .lobby-logo {
    width: 190px;
    margin-bottom: 8px;
  }
  .lobby-card h1 {
    font-size: 36px;
    margin: 5px 0;
  }
  .lobby-description {
    font-size: 11px !important;
    max-width: 400px;
  }
  .lobby-actions,
  .mode-picker {
    margin-top: 12px;
    gap: 6px;
  }
  .menu-btn {
    padding: 8px 11px;
  }
  .lobby-profile-panel {
    padding: 13px;
  }
  .stat-grid {
    margin-top: 8px;
  }
}
@media (max-width: 980px) {
  .lobby-profile-panel {
    width: min(300px, 38vw);
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  .profile-card {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }
  .profile-card h1 {
    font-size: 25px;
  }
  .profile-close {
    right: 9px;
    top: 9px;
  }
  .confirm-actions {
    grid-template-columns: 1fr;
  }
}
@media (orientation: landscape) and (pointer: coarse) {
  .screen-layer,
  .pause-overlay {
    padding: 8px 14px;
  }
  .profile-card {
    width: min(760px, 94vw);
    max-height: calc(100dvh - 14px);
    padding: 10px 16px;
  }
  .profile-card .menu-logo {
    width: 128px;
    margin-bottom: 2px;
  }
  .profile-card .eyebrow {
    font-size: 7px;
  }
  .profile-card h1 {
    font-size: 18px;
    margin: 2px 0 6px;
  }
  .name-field {
    font-size: 8px;
    gap: 3px;
  }
  .name-field input {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 10px;
  }
  .avatar-picker {
    grid-template-columns: repeat(4, 1fr) !important;
    margin: 6px 0;
    gap: 5px;
  }
  .avatar-card {
    padding: 4px;
    gap: 2px;
    border-radius: 11px;
  }
  .avatar-head {
    width: 28px !important;
    height: 28px !important;
  }
  .avatar-card b {
    font-size: 9px;
  }
  .profile-card .menu-btn {
    padding: 6px 8px;
    font-size: 8px;
  }
  .profile-meta-line {
    font-size: 7px;
    margin-top: 4px;
  }
  .lobby {
    padding: 10px 24px;
    gap: 26px;
  }
  .lobby-card {
    width: min(330px, 48vw);
  }
  .lobby-logo {
    width: 125px !important;
  }
  .lobby-kicker {
    font-size: 7px;
  }
  .lobby-card h1 {
    font-size: 23px !important;
  }
  .lobby-description {
    font-size: 8px !important;
    line-height: 1.4 !important;
  }
  .lobby-actions,
  .mode-picker {
    max-width: 190px;
    margin-top: 8px;
    gap: 4px;
  }
  .lobby .menu-btn {
    font-size: 7px;
    padding: 6px 8px;
  }
  .lobby-profile-panel {
    width: min(250px, 37vw);
    padding: 9px;
    border-radius: 15px;
  }
  .profile-rank-frame {
    padding: 7px;
  }
  .rank-avatar {
    width: 36px;
    height: 36px;
  }
  .profile-rank-frame strong {
    font-size: 10px;
  }
  .currency-row {
    padding: 7px 2px 4px;
    font-size: 8px;
  }
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 6px;
  }
  .stat-grid div {
    padding: 4px 2px;
  }
  .stat-grid b {
    font-size: 10px;
  }
  .stat-grid span {
    font-size: 5px;
  }
  .leave-game-btn {
    right: 7px;
    top: 104px;
    width: 27px;
    height: 27px;
    font-size: 11px;
  }
  .global-board-card {
    max-height: calc(100dvh - 14px);
    padding: 12px;
  }
  .podium {
    margin: 10px auto 8px;
  }
  .podium-card {
    min-height: 72px;
    padding: 6px;
  }
  .podium-card.gold {
    min-height: 88px;
  }
  .global-board-card h2 {
    font-size: 20px;
  }
  .global-board-list {
    margin-top: 8px;
  }
  .global-board-list li {
    padding: 5px 8px;
    font-size: 8px;
  }
  .account-card {
    max-height: calc(100dvh - 14px);
    padding: 14px;
  }
  .account-card h2 {
    font-size: 20px;
  }
  .account-form label {
    font-size: 8px;
  }
  .account-form input {
    padding: 7px;
  }
}
@media (orientation: portrait) and (pointer: coarse) {
  #rotateHint {
    display: none;
  }
  body.playing #rotateHint {
    display: grid;
  }
  body.playing > *:not(#rotateHint) {
    visibility: hidden !important;
  }
  body.playing #rotateHint,
  body.playing #rotateHint * {
    visibility: visible !important;
  }
}

/* Final UI-state hardening */
.screen-layer:not(.hidden) {
  opacity: 1;
  visibility: visible;
}
body:not(.playing) .player-name-hud {
  opacity: 0;
  visibility: hidden;
}
body.playing .player-name-hud {
  opacity: 0.55;
  visibility: visible;
}
.lobby.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.auth-choice:not(.hidden),
.account-overlay:not(.hidden),
.global-board:not(.hidden),
.leave-confirm:not(.hidden) {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Final authentication flow and text-entry hardening */
.compatibility-shell {
  display: none !important;
}
.access-card {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: clamp(20px, 3.5vh, 34px);
  border-radius: 24px;
}
.access-logo {
  width: clamp(150px, 18vw, 220px);
  margin: 0 0 12px;
}
.access-card h2 {
  margin: 5px 0 8px;
  font:
    500 clamp(28px, 4vw, 42px) / 1.05 Georgia,
    serif;
  color: #f5f6f2;
}
.access-copy {
  max-width: 420px;
  margin: 0 0 18px;
  font-size: 11px;
  line-height: 1.65;
  color: rgba(245, 247, 246, 0.66);
}
.guest-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.58);
}
.guest-entry .text-btn {
  flex: none;
  color: #83dfe9;
  text-decoration: none;
  font-weight: 700;
  padding: 6px 0;
}
.account-close {
  display: none;
}
.account-form input,
.name-field input,
.comment-compose input,
.join-row input,
#winnerName,
#serverUrlInput {
  position: relative;
  z-index: 3;
  pointer-events: auto !important;
  touch-action: auto !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text !important;
  caret-color: #84e9f2 !important;
}
.account-form input:focus,
.name-field input:focus,
.comment-compose input:focus,
.join-row input:focus,
#winnerName:focus,
#serverUrlInput:focus {
  outline: none !important;
  border-color: #78ddea !important;
  box-shadow: 0 0 0 3px rgba(120, 221, 234, 0.14) !important;
}
.account-form button,
.account-tab,
.guest-entry button {
  touch-action: manipulation !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.profile-gate .profile-card {
  overscroll-behavior: contain;
}
@media (max-height: 680px) and (min-width: 720px) {
  .access-card {
    padding: 14px 20px;
    max-height: calc(100dvh - 16px);
  }
  .access-logo {
    width: 130px;
    margin-bottom: 5px;
  }
  .access-card h2 {
    font-size: 25px;
  }
  .access-copy {
    margin-bottom: 8px;
  }
  .account-tabs {
    margin: 8px 0;
  }
  .account-form {
    gap: 7px;
  }
  .account-form input {
    padding: 8px;
  }
  .guest-entry {
    margin-top: 8px;
    padding-top: 7px;
  }
}
@media (orientation: landscape) and (pointer: coarse) {
  .access-card {
    width: min(600px, 91vw);
    max-height: calc(100dvh - 12px);
    padding: 10px 16px;
    border-radius: 16px;
  }
  .access-logo {
    width: 105px;
    margin: 0 0 1px;
  }
  .access-card .eyebrow {
    font-size: 6px;
  }
  .access-card h2 {
    font-size: 17px;
    margin: 1px 0 3px;
  }
  .access-copy {
    font-size: 7px;
    line-height: 1.3;
    margin-bottom: 5px;
  }
  .account-tabs {
    margin: 5px 0;
    gap: 4px;
  }
  .account-tab {
    padding: 5px;
    font-size: 7px;
  }
  .account-form {
    gap: 4px;
  }
  .account-form label {
    font-size: 6px;
    gap: 2px;
  }
  .account-form input {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 9px;
    border-radius: 8px;
  }
  .account-form .menu-btn {
    padding: 5px 7px;
    font-size: 7px;
  }
  .guest-entry {
    margin-top: 5px;
    padding-top: 4px;
    font-size: 6px;
  }
  .guest-entry .text-btn {
    font-size: 7px;
    padding: 3px;
  }
  .account-status {
    min-height: 10px;
    font-size: 6px;
    margin: 3px 0 0;
  }
}

/* Revision: direct profile flow, larger mobile controls, global look drag, ghost HP */
:root {
  --mobile-control-scale: 0.95;
}
#ghostHealthLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 24;
}
.ghost-health {
  position: absolute;
  min-width: 74px;
  transform: translate(-50%, -100%);
  display: grid;
  justify-items: center;
  gap: 3px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}
.ghost-health span {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.ghost-health-bar {
  width: 86px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.ghost-health-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #74e0a0, #f2da6a, #e86472);
}
.look-pad {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.joystick {
  width: 112px;
  height: 112px;
  left: 18px;
  bottom: 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
}
.stick {
  width: 48px;
  height: 48px;
  margin: -24px;
}
.action-btn {
  width: 54px;
  height: 54px;
  font-size: 16px;
  backdrop-filter: blur(4px);
}
.action-btn.run {
  font-size: 11px;
  letter-spacing: 0.04em;
}
.action-btn.shoot {
  right: 18px;
  bottom: 24px;
}
.action-btn.jump {
  right: 18px;
  bottom: 88px;
}
.action-btn.aim {
  right: 82px;
  bottom: 88px;
}
.action-btn.run {
  right: 82px;
  bottom: 24px;
}
.action-btn.flyup {
  right: 18px;
  bottom: 152px;
}
.action-btn.flydown {
  right: 82px;
  bottom: 152px;
}
.profile-card .menu-btn,
.lobby .menu-btn {
  min-height: 46px;
}
.profile-close {
  display: none;
}
@media (orientation: landscape) and (pointer: coarse) {
  .joystick {
    width: 96px;
    height: 96px;
    left: 12px;
    bottom: 12px;
  }
  .stick {
    width: 42px;
    height: 42px;
    margin: -21px;
  }
  .action-btn {
    width: 46px;
    height: 46px;
    font-size: 13px;
  }
  .action-btn.run {
    font-size: 9px;
  }
  .action-btn.shoot {
    right: 12px;
    bottom: 14px;
  }
  .action-btn.jump {
    right: 12px;
    bottom: 66px;
  }
  .action-btn.aim {
    right: 64px;
    bottom: 66px;
  }
  .action-btn.run {
    right: 64px;
    bottom: 14px;
  }
  .action-btn.flyup {
    right: 12px;
    bottom: 118px;
  }
  .action-btn.flydown {
    right: 64px;
    bottom: 118px;
  }
}

/* Lobby refresh: compact center menu, floating utilities, profile modal, download link */
.lobby {
  justify-content: center;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  background: linear-gradient(
    180deg,
    rgba(3, 10, 18, 0.22),
    rgba(3, 10, 18, 0.54)
  );
  overflow: hidden;
}
.lobby-vignette {
  background: radial-gradient(
    circle at 50% 40%,
    rgba(81, 177, 226, 0.08),
    rgba(3, 8, 14, 0.58) 72%,
    rgba(2, 5, 9, 0.82)
  );
}
.lobby-card-centered {
  z-index: 2;
  flex: none !important;
  width: min(440px, 88vw) !important;
  text-align: center;
  display: grid;
  justify-items: center;
  padding: 24px 26px;
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(9, 19, 31, 0.54),
    rgba(7, 14, 24, 0.28)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.18);
}
.lobby-card-centered .lobby-logo {
  width: min(230px, 58vw);
  margin: 0 0 8px;
}
.lobby-card-centered h1 {
  margin: 2px 0 6px;
  font-size: clamp(30px, 5vw, 48px);
}
.lobby-card-centered .lobby-description {
  max-width: 360px;
  margin: 0 auto;
  color: rgba(239, 247, 245, 0.72) !important;
  font-size: 11px !important;
  line-height: 1.55 !important;
}
.lobby-actions-centered {
  width: 100%;
  max-width: 320px !important;
  margin: 18px auto 0 !important;
  gap: 9px !important;
}
.lobby-main-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 58px !important;
  padding: 10px 15px !important;
  text-align: left !important;
  border-radius: 17px !important;
  display: grid;
  align-content: center;
  gap: 2px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.115),
    rgba(255, 255, 255, 0.055)
  );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 10px 28px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}
.lobby-main-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(117, 224, 239, 0.14),
    transparent 68%
  );
  transform: translateX(-120%);
  transition: 0.45s;
}
.lobby-main-btn:hover::after {
  transform: translateX(120%);
}
.lobby-main-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(117, 224, 239, 0.32);
}
.lobby-main-btn.pressed {
  transform: scale(0.97);
}
.lobby-main-btn span {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lobby-main-btn small {
  font-size: 8px;
  letter-spacing: 0.02em;
  opacity: 0.55;
  text-transform: none;
}
.lobby-main-btn.primary {
  background: linear-gradient(135deg, #f3f6ef, #dfe9df);
  color: #42504b;
}
.lobby-tools {
  position: absolute;
  z-index: 4;
  right: max(18px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 8px;
}
.lobby-tool-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 17, 29, 0.54);
  color: #eef6f4;
  backdrop-filter: blur(10px);
  font-size: 16px;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.15);
  transition: 0.18s;
}
.lobby-tool-btn:hover {
  background: rgba(117, 216, 234, 0.18);
  transform: translateY(-2px);
}
.lobby-tool-btn.pressed {
  transform: scale(0.92);
}
.lobby-download {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: rgba(237, 245, 243, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(7, 17, 29, 0.34);
  backdrop-filter: blur(8px);
  border-radius: 13px;
  padding: 8px 10px;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: 0.18s;
}
.lobby-download .download-icon {
  font-size: 15px;
  color: #75d8ea;
}
.lobby-download:hover {
  color: #fff;
  background: rgba(117, 216, 234, 0.13);
}
.lobby-download.pressed {
  transform: scale(0.96);
}
.lobby-rank-btn {
  position: absolute;
  z-index: 4;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 17, 29, 0.4);
  color: #dec47d;
  border-radius: 14px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  backdrop-filter: blur(9px);
  transition: 0.18s;
}
.lobby-rank-btn span {
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 247, 243, 0.58);
}
.lobby-rank-btn:hover {
  background: rgba(222, 196, 125, 0.13);
  transform: translateY(-2px);
}
.lobby-rank-btn.pressed {
  transform: scale(0.94);
}
.lobby-footer {
  justify-content: center;
  margin-top: 12px !important;
  font-size: 7px !important;
  opacity: 0.36 !important;
}
.mode-picker {
  width: 100%;
  max-width: 320px !important;
  margin: 16px auto 0 !important;
}
.mode-card {
  border-radius: 17px !important;
  transition: 0.18s;
}
.mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(117, 216, 234, 0.28);
}
.profile-stats-overlay:not(.hidden) {
  display: grid;
  opacity: 1;
  visibility: visible;
}
.profile-stats-card {
  width: min(500px, 92vw);
  padding: 20px;
}
.profile-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.profile-stats-head small {
  font-size: 8px;
  letter-spacing: 0.18em;
  opacity: 0.55;
}
.profile-stats-head h2 {
  margin: 2px 0;
  font:
    500 27px Georgia,
    serif;
}
.profile-stats-card .profile-rank-frame {
  margin-bottom: 8px;
}
.profile-power-chart {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.profile-power-chart > div {
  display: grid;
  grid-template-columns: 85px 1fr;
  align-items: center;
  gap: 9px;
}
.profile-power-chart span {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}
.chart-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.chart-track i {
  display: block;
  height: 100%;
  width: 10%;
  border-radius: inherit;
  background: linear-gradient(90deg, #69e3f1, #8ce077, #f2c66b);
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.settings-identity-btn {
  margin-top: 8px;
  width: 100%;
  border-color: rgba(117, 216, 234, 0.22) !important;
}
/* Portrait orientation hint is only for active gameplay. Lobby/profile remain usable in portrait. */
@media (orientation: portrait) and (pointer: coarse) {
  body:not(.playing) #rotateHint {
    display: none !important;
    visibility: hidden !important;
  }
  body:not(.playing) > *:not(#rotateHint) {
    visibility: visible !important;
  }
  body.playing #rotateHint {
    display: grid !important;
    visibility: visible !important;
  }
  body.playing > *:not(#rotateHint) {
    visibility: hidden !important;
  }
  body.playing #rotateHint,
  body.playing #rotateHint * {
    visibility: visible !important;
  }
}
@media (orientation: landscape) and (pointer: coarse) {
  .lobby {
    padding: 8px 14px !important;
  }
  .lobby-card-centered {
    width: min(390px, 62vw) !important;
    max-height: calc(100dvh - 12px);
    padding: 10px 16px;
    border-radius: 19px;
  }
  .lobby-card-centered .lobby-logo {
    width: 120px !important;
    margin-bottom: 1px;
  }
  .lobby-card-centered .lobby-kicker {
    font-size: 6px;
  }
  .lobby-card-centered h1 {
    font-size: 20px !important;
    margin: 1px 0 3px;
  }
  .lobby-card-centered .lobby-description {
    font-size: 7px !important;
    max-width: 310px;
    line-height: 1.35 !important;
  }
  .lobby-actions-centered {
    max-width: 250px !important;
    margin-top: 7px !important;
    gap: 4px !important;
  }
  .lobby-main-btn {
    min-height: 38px !important;
    padding: 5px 10px !important;
    border-radius: 11px !important;
  }
  .lobby-main-btn span {
    font-size: 8px;
  }
  .lobby-main-btn small {
    font-size: 6px;
  }
  .lobby-footer {
    margin-top: 5px !important;
    font-size: 5px !important;
  }
  .lobby-tools {
    right: 9px;
    top: 9px;
    gap: 5px;
  }
  .lobby-tool-btn {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    font-size: 12px;
  }
  .lobby-download {
    padding: 5px 7px;
    border-radius: 10px;
    font-size: 6px;
    gap: 4px;
  }
  .lobby-download .download-icon {
    font-size: 11px;
  }
  .lobby-rank-btn {
    left: 9px;
    bottom: 9px;
    padding: 6px 8px;
    border-radius: 10px;
  }
  .lobby-rank-btn span {
    font-size: 6px;
  }
  .profile-stats-card {
    width: min(520px, 90vw);
    max-height: calc(100dvh - 14px);
    overflow: auto;
    padding: 11px 14px;
  }
  .profile-stats-head h2 {
    font-size: 18px;
  }
  .profile-stats-card .profile-rank-frame {
    padding: 7px;
  }
  .profile-power-chart {
    margin: 8px 0;
    gap: 5px;
  }
  .profile-power-chart > div {
    grid-template-columns: 65px 1fr;
  }
  .profile-power-chart span {
    font-size: 6px;
  }
  .profile-stats-card .stat-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }
  .profile-stats-card .stat-grid div {
    padding: 5px 2px;
  }
  .profile-stats-card .stat-grid b {
    font-size: 10px;
  }
  .profile-stats-card .stat-grid span {
    font-size: 5px;
  }
  .mode-picker {
    max-width: 250px !important;
    margin-top: 6px !important;
  }
  .mode-card {
    padding: 7px 9px !important;
  }
  .mode-card strong {
    font-size: 8px;
  }
  .mode-card span {
    font-size: 6px;
  }
}
@media (max-width: 520px) and (orientation: portrait) {
  .lobby-card-centered {
    width: min(92vw, 420px) !important;
    padding: 20px 18px;
  }
  .lobby-tools {
    top: 12px;
    right: 12px;
  }
  .lobby-download span:last-child {
    display: none;
  }
  .lobby-rank-btn span {
    display: none;
  }
}
/* Compact enemy HP only, without labels */
.ghost-health {
  min-width: 0 !important;
  display: block !important;
  transform: translate(-50%, -100%) !important;
}
.ghost-health span {
  display: none !important;
}
.ghost-health-bar {
  width: 54px !important;
  height: 5px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  background: rgba(0, 0, 0, 0.42) !important;
}
@media (pointer: coarse) {
  .ghost-health-bar {
    width: 46px !important;
    height: 4px !important;
  }
}

/* Mobile viewport + text-entry hardening */
.profile-gate,
.profile-gate *,
.screen-layer,
.screen-layer * {
  pointer-events: auto;
}
.profile-gate {
  touch-action: pan-y;
  background: rgba(4, 9, 15, 0.72);
}
.profile-card {
  position: relative;
  z-index: 2;
}
.name-field input,
#profileName {
  touch-action: manipulation !important;
  -webkit-user-select: text !important;
  user-select: text !important;
  pointer-events: auto !important;
  caret-color: #7ee8f3 !important;
}
.avatar-card {
  touch-action: manipulation !important;
  pointer-events: auto !important;
}
body.playing #game,
body.playing #game canvas,
body.playing .mobile-controls,
body.playing .joystick,
body.playing .action-btn {
  touch-action: none;
}
.lobby {
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  background: linear-gradient(
    90deg,
    rgba(4, 10, 17, 0.76),
    rgba(4, 10, 17, 0.1) 66%,
    rgba(4, 10, 17, 0.02)
  ) !important;
}
.lobby-vignette {
  width: 100%;
  height: 100%;
}
@media (orientation: landscape) and (pointer: coarse) {
  .lobby {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 8px 18px !important;
    justify-content: center !important;
    align-items: center !important;
  }
  .lobby-card-centered {
    width: min(500px, 72vw) !important;
    margin: 0 auto !important;
  }
  .lobby-tools {
    right: max(10px, env(safe-area-inset-right)) !important;
    top: max(10px, env(safe-area-inset-top)) !important;
  }
  .lobby-rank-btn {
    left: max(10px, env(safe-area-inset-left)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }
  .profile-gate {
    padding: 8px !important;
    overflow: auto !important;
    align-items: flex-start !important;
  }
  .profile-card {
    width: min(760px, calc(100vw - 16px)) !important;
    max-height: none !important;
    min-height: min-content !important;
    margin: auto !important;
    overflow: visible !important;
  }
  .name-field input {
    font-size: 16px !important;
    min-height: 42px !important;
  }
  .avatar-card {
    min-height: 68px !important;
  }
}

/* Keep the 3D lobby scenery edge-to-edge on phones. */
@media (pointer: coarse) {
  .lobby {
    background: linear-gradient(
      90deg,
      rgba(4, 10, 17, 0.45),
      rgba(4, 10, 17, 0.08) 62%,
      rgba(4, 10, 17, 0.03)
    ) !important;
  }
  .lobby-vignette {
    background: radial-gradient(
      circle at 55% 40%,
      transparent 30%,
      rgba(3, 7, 12, 0.24) 100%
    ) !important;
  }
}

/* Energy combat + orientation + responsive interaction update */
.rotate-hint {
  display: none !important;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(2, 8, 14, 0.46) !important;
  backdrop-filter: blur(8px);
  padding: 14px;
  pointer-events: none;
}
.rotate-hint.show {
  display: grid !important;
  place-items: center;
}
.rotate-card {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(440px, 92vw);
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(
    145deg,
    rgba(8, 18, 30, 0.94),
    rgba(13, 28, 42, 0.94)
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  text-align: left;
  color: #eff7f5;
}
.rotate-card b {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
.rotate-card p {
  margin: 0 !important;
  font-size: 10px !important;
  line-height: 1.55;
  letter-spacing: 0.02em !important;
}
.rotate-card .phone-rotate-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 58px;
}
.rotate-close {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 20px;
}
@media (orientation: landscape) {
  .rotate-hint.show {
    display: none !important;
  }
}
@media (orientation: portrait) and (pointer: coarse) {
  body.playing > *:not(#rotateHint) {
    visibility: visible !important;
  }
  body.playing #rotateHint {
    visibility: visible !important;
  }
}
.comment-panel header button,
#commentCloseBtn {
  min-width: 34px;
  min-height: 34px;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  font-size: 20px !important;
  line-height: 1 !important;
  touch-action: manipulation !important;
}
.inventory-bag,
.comment-toggle {
  touch-action: manipulation !important;
  min-width: 34px;
  min-height: 34px;
}
.action-btn.aim.active {
  background: linear-gradient(145deg, #f0d27a, #c89735) !important;
  color: #241b0b !important;
  box-shadow:
    0 0 0 2px rgba(255, 219, 118, 0.4),
    0 0 25px rgba(238, 185, 67, 0.35);
}
.action-btn.shoot.charging {
  background: radial-gradient(circle, #fff2b3, #d89d25) !important;
  color: #3b2400 !important;
  box-shadow:
    0 0 0 2px rgba(255, 226, 126, 0.35),
    0 0 26px rgba(255, 193, 61, 0.6);
  transform: scale(1.08);
}
.ghost-health-bar i {
  background: #e64e5d !important;
}
.level-up-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: 0.22s;
}
.level-up-overlay.open {
  opacity: 1;
  visibility: visible;
}
.level-up-card {
  pointer-events: auto;
  position: relative;
  width: min(360px, 86vw);
  padding: 22px;
  text-align: center;
  border-radius: 22px;
  background: linear-gradient(
    145deg,
    rgba(12, 25, 38, 0.96),
    rgba(8, 16, 26, 0.96)
  );
  border: 1px solid rgba(246, 207, 94, 0.3);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(243, 196, 66, 0.12);
  color: #f7f3e6;
}
.level-up-card small {
  font-size: 8px;
  letter-spacing: 0.22em;
  color: #e6c36c;
}
.level-up-card h2 {
  font:
    500 34px Georgia,
    serif;
  margin: 8px 0;
}
.level-up-card p {
  font-size: 11px;
  opacity: 0.72;
}
.level-up-card button {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 19px;
}
.developer-card {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(226, 185, 102, 0.12),
    rgba(117, 216, 234, 0.08)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.developer-card span {
  font-size: 7px;
  letter-spacing: 0.2em;
  color: #d9bd7c;
}
.developer-card strong {
  font-size: 15px;
}
.developer-card small {
  font-size: 8px;
  opacity: 0.58;
}
.energy-charge-hud {
  position: fixed;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  z-index: 31;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: 0.12s;
}
.energy-charge-hud.active {
  opacity: 1;
  visibility: visible;
}
.energy-charge-hud .orb {
  width: var(--charge-size, 22px);
  height: var(--charge-size, 22px);
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #fff8cb 0 12%,
    #ffe16c 24%,
    var(--charge-color, #d39c27) 58%,
    rgba(255, 190, 41, 0.05) 72%
  );
  box-shadow:
    0 0 18px var(--charge-color, #d39c27),
    0 0 42px color-mix(in srgb, var(--charge-color, #d39c27) 70%, transparent);
  transition:
    width 0.04s,
    height 0.04s;
}
@media (pointer: coarse) {
  .comment-panel.open {
    width: min(300px, 72vw) !important;
  }
  .comment-panel header {
    min-height: 38px;
    align-items: center;
  }
  .comment-panel header button {
    min-width: 38px;
    min-height: 38px;
  }
  .inventory-bag,
  .comment-toggle {
    width: 36px !important;
    height: 36px !important;
  }
  .action-btn {
    touch-action: none !important;
  }
}

/* === Settings / combat / mobile layout hardening === */
.settings-overlay {
  padding: 12px !important;
  align-items: center !important;
  overflow: hidden !important;
}
.settings-card {
  width: min(860px, 96vw) !important;
  height: min(650px, 92dvh) !important;
  max-height: 92dvh !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 24px !important;
  background: linear-gradient(
    180deg,
    rgba(18, 28, 40, 0.98),
    rgba(7, 14, 23, 0.99)
  ) !important;
  color: #e9efec !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
.settings-header {
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}
.settings-header small {
  font-size: 8px;
  letter-spacing: 0.22em;
  color: #7ed9e7;
}
.settings-header h1,
.settings-card h1 {
  margin: 2px 0 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #f4f8f5 !important;
  font:
    600 25px/1.05 Georgia,
    serif !important;
  width: auto !important;
}
.settings-back,
.settings-card > .icon-close,
.settings-header .icon-close {
  position: static !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  color: #eef5f2 !important;
  font-size: 20px !important;
}
.settings-shell {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
}
.settings-tabs {
  position: static !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 14px 10px !important;
  background: rgba(255, 255, 255, 0.025);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}
.settings-tab {
  width: 100% !important;
  height: 56px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: #aebbb7 !important;
  display: grid !important;
  grid-template-columns: 24px 1fr !important;
  align-items: center !important;
  text-align: left !important;
  padding: 0 10px !important;
  gap: 5px !important;
}
.settings-tab span {
  font-size: 17px;
}
.settings-tab b {
  font-size: 10px;
  font-weight: 700;
}
.settings-tab.active {
  background: linear-gradient(
    135deg,
    rgba(77, 204, 220, 0.25),
    rgba(99, 128, 255, 0.16)
  ) !important;
  color: #f7ffff !important;
  border-color: rgba(108, 220, 236, 0.55) !important;
}
.settings-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px 28px;
  scrollbar-width: thin;
}
.settings-pane {
  display: none !important;
}
.settings-pane.active {
  display: block !important;
}
.settings-pane h2 {
  font-size: 23px;
  margin: 0 0 6px;
  color: #f3f7f5;
}
.setting-note {
  font-size: 11px !important;
  color: #9eaaa6 !important;
  margin: 0 0 16px !important;
}
.settings-pane label,
.setting-toggle,
.range-row,
.select-row {
  display: grid !important;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.2fr) !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 8px 0 !important;
  padding: 11px 13px !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 13px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  color: #dfe7e4 !important;
  font-size: 11px !important;
}
.setting-toggle {
  grid-template-columns: 1fr auto !important;
}
.setting-toggle input {
  width: 20px;
  height: 20px;
  accent-color: #69d5e4;
}
.range-row {
  grid-template-columns: 1fr !important;
}
.range-row span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.range-row input {
  width: 100% !important;
  accent-color: #69d5e4;
}
.select-row select,
.server-config input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #121e2a !important;
  color: #f2f6f4 !important;
  border-radius: 10px !important;
  padding: 9px 11px !important;
  outline: 0 !important;
}
.settings-action {
  width: 100%;
  min-height: 40px;
  margin: 7px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf4f1;
  font-weight: 650;
  font-size: 11px;
}
.settings-action:hover {
  background: rgba(110, 214, 231, 0.14);
}
.settings-action.danger {
  background: rgba(160, 64, 78, 0.22);
  border-color: rgba(222, 105, 121, 0.3);
}
.settings-action.compact {
  width: auto;
  min-width: 120px;
  margin: 0;
}
.control-hints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.control-hints span {
  padding: 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
}
.setting-footnote {
  font-size: 9px !important;
  color: #93a09c !important;
  line-height: 1.5;
}
.server-config {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(107, 218, 234, 0.14);
  border-radius: 14px;
  background: rgba(67, 150, 165, 0.06);
}
.server-config small {
  display: block;
  margin-bottom: 8px;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: #7bd2e0;
}
.server-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.server-row span {
  font-size: 9px;
  color: #aeb8b4;
}
.developer-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(239, 207, 118, 0.22);
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(214, 172, 73, 0.12),
    rgba(96, 214, 230, 0.06)
  );
  display: grid;
  gap: 5px;
}
.developer-card span {
  font-size: 8px;
  letter-spacing: 0.22em;
  color: #f0cc73;
}
.developer-card strong {
  font:
    600 23px Georgia,
    serif;
}
.developer-card small {
  font-size: 9px;
  color: #aab7b2;
}

/* Comment appears above the movement analog, not on the aiming side. */
.comment-panel {
  left: 14px !important;
  right: auto !important;
  top: auto !important;
  bottom: 152px !important;
  width: min(310px, 66vw) !important;
  max-height: 170px !important;
  border-radius: 16px !important;
}
.comment-panel header {
  min-height: 40px;
  align-items: center !important;
}
.comment-panel header button,
#commentCloseBtn {
  min-width: 40px !important;
  min-height: 40px !important;
  font-size: 22px !important;
  display: grid !important;
  place-items: center !important;
}
.comment-feed {
  max-height: 92px !important;
}
.comment-compose {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 6px !important;
  padding: 7px 8px !important;
}
.comment-compose input {
  min-width: 0 !important;
}

/* Slightly larger analog and cleaner mobile control sizes. */
.joystick {
  width: 122px !important;
  height: 122px !important;
  left: 18px !important;
  bottom: 16px !important;
}
.stick {
  width: 50px !important;
  height: 50px !important;
  margin: -25px !important;
}
.action-btn {
  width: 52px !important;
  height: 52px !important;
}
.action-btn.run {
  font-size: 9px !important;
}
.skill-btn {
  position: absolute;
  z-index: 32;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(
    145deg,
    rgba(31, 53, 70, 0.88),
    rgba(12, 23, 34, 0.92)
  );
  color: #eaf7f8;
  display: grid;
  place-items: center;
  pointer-events: auto;
  touch-action: none;
  transform: scale(var(--mobile-control-scale));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.skill-btn span {
  font-size: 10px;
  font-weight: 800;
}
.skill-btn b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(4, 10, 16, 0.72);
  font-size: 13px;
}
.skill-btn b:empty {
  display: none;
}
.skill-btn.active-skill {
  border-color: #7de9f8;
  box-shadow: 0 0 22px rgba(99, 228, 246, 0.35);
}
.skill-btn.cooldown {
  opacity: 0.78;
}
.skill1 {
  right: 128px;
  bottom: 18px;
}
.skill2 {
  right: 128px;
  bottom: 72px;
}
.skill3 {
  right: 128px;
  bottom: 126px;
}

/* Energy charge feedback. */
.energy-charge-hud {
  bottom: 18% !important;
}
.energy-charge-hud .orb {
  animation: energyPulse 0.45s ease-in-out infinite alternate;
  filter: saturate(1.25);
}
@keyframes energyPulse {
  from {
    transform: scale(0.92);
    filter: brightness(1);
  }
  to {
    transform: scale(1.08);
    filter: brightness(1.35);
  }
}

@media (orientation: landscape) and (pointer: coarse) {
  .settings-overlay {
    padding: 7px !important;
  }
  .settings-card {
    width: min(900px, 96vw) !important;
    height: calc(100dvh - 14px) !important;
    max-height: calc(100dvh - 14px) !important;
    border-radius: 18px !important;
  }
  .settings-header {
    height: 54px;
    flex-basis: 54px;
    padding: 7px 11px;
    grid-template-columns: 36px 1fr 36px;
  }
  .settings-header h1,
  .settings-card h1 {
    font-size: 19px !important;
  }
  .settings-back,
  .settings-header .icon-close {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
  }
  .settings-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }
  .settings-tabs {
    padding: 8px 6px !important;
    gap: 5px !important;
  }
  .settings-tab {
    height: 42px !important;
    border-radius: 10px !important;
    padding: 0 7px !important;
    grid-template-columns: 18px 1fr !important;
  }
  .settings-tab span {
    font-size: 13px;
  }
  .settings-tab b {
    font-size: 7px;
  }
  .settings-content {
    padding: 11px 13px 18px;
  }
  .settings-pane h2 {
    font-size: 17px;
  }
  .setting-note {
    font-size: 8px !important;
    margin-bottom: 8px !important;
  }
  .settings-pane label,
  .setting-toggle,
  .range-row,
  .select-row {
    margin: 5px 0 !important;
    padding: 7px 9px !important;
    font-size: 8px !important;
    grid-template-columns: minmax(95px, 1fr) minmax(130px, 1.25fr) !important;
  }
  .range-row {
    grid-template-columns: 1fr !important;
  }
  .control-hints {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 7px 0;
  }
  .control-hints span {
    padding: 6px;
    font-size: 7px;
  }
  .settings-action {
    min-height: 31px;
    font-size: 8px;
    margin: 4px 0;
  }
  .developer-card {
    padding: 10px;
    margin-top: 10px;
  }
  .developer-card strong {
    font-size: 17px;
  }
  .server-config {
    margin-top: 7px;
    padding: 7px;
  }
  .server-config input {
    padding: 6px 8px !important;
    font-size: 8px;
  }
  .joystick {
    width: 112px !important;
    height: 112px !important;
    left: 12px !important;
    bottom: 10px !important;
  }
  .stick {
    width: 46px !important;
    height: 46px !important;
    margin: -23px !important;
  }
  .comment-panel {
    left: 10px !important;
    bottom: 130px !important;
    width: min(285px, 48vw) !important;
    max-height: 142px !important;
  }
  .comment-feed {
    max-height: 72px !important;
  }
  .comment-line {
    font-size: 8px !important;
  }
  .comment-compose input,
  .comment-compose button {
    font-size: 8px !important;
    min-height: 28px !important;
  }
  .action-btn {
    width: 48px !important;
    height: 48px !important;
  }
  .skill-btn {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .skill1 {
    right: 118px;
    bottom: 12px;
  }
  .skill2 {
    right: 118px;
    bottom: 60px;
  }
  .skill3 {
    right: 118px;
    bottom: 108px;
  }
}

/* Free-aim visual hardening */
.crosshair {
  transition:
    left 0.035s linear,
    top 0.035s linear,
    transform 0.12s ease !important;
  will-change: left, top;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.65));
}
.crosshair.combat {
  transform: scale(1.08);
  opacity: 0.96;
}
.comment-panel {
  max-height: min(190px, 42dvh) !important;
  overflow: hidden !important;
}
.comment-feed {
  max-height: min(104px, 24dvh) !important;
  overscroll-behavior: contain;
}
.settings-content {
  padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
}
@media (orientation: landscape) and (pointer: coarse) {
  .comment-panel {
    max-height: min(150px, 43dvh) !important;
  }
  .comment-feed {
    max-height: min(78px, 22dvh) !important;
  }
  .settings-card {
    max-width: calc(
      100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 12px
    ) !important;
  }
}

/* checkpoint + skill final pass */
.desktop-skill-hud {
  position: fixed;
  left: 18px;
  top: 184px;
  z-index: 25;
  display: flex;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
}
.desktop-skill-hud > div {
  min-width: 54px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(8, 17, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 5px;
  color: #eef7f6;
  font-size: 11px;
}
.desktop-skill-hud b {
  font-size: 9px;
  font-weight: 700;
  color: #d8e6e2;
}
.desktop-skill-hud span {
  font-size: 15px;
}
body.playing .desktop-skill-hud {
  opacity: 1;
  visibility: visible;
}
@media (pointer: coarse), (max-width: 820px) {
  .desktop-skill-hud {
    display: none !important;
  }
}
.skill-btn span {
  font-size: 18px !important;
  line-height: 1;
}
.skill-btn b {
  font-size: 12px !important;
}
.friend-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.friend-row span {
  font-size: 10px;
  color: var(--muted);
}
.friend-row input {
  min-width: 0;
}

/* Owner/admin control and desktop pointer-lock hardening */
body.pointer-locked,
body.pointer-locked #game,
body.pointer-locked #game canvas {
  cursor: none !important;
}
.owner-pin-overlay,
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 9, 15, 0.76);
  backdrop-filter: blur(14px);
}
.owner-pin-overlay.hidden,
.admin-overlay.hidden {
  display: none !important;
}
.owner-pin-card {
  position: relative;
  width: min(390px, 92vw);
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(
    160deg,
    rgba(10, 22, 34, 0.98),
    rgba(5, 12, 20, 0.98)
  );
  border: 1px solid rgba(80, 235, 255, 0.22);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.55),
    0 0 35px rgba(58, 224, 255, 0.08);
  color: #eaf8f8;
}
.owner-pin-card small {
  letter-spacing: 0.22em;
  color: #68ddec;
}
.owner-pin-card h2 {
  margin: 8px 0;
  font:
    600 27px Georgia,
    serif;
}
.owner-pin-card p {
  opacity: 0.72;
  font-size: 12px;
  line-height: 1.5;
}
.owner-pin-card input {
  width: 100%;
  box-sizing: border-box;
  margin: 12px 0;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid rgba(104, 225, 240, 0.24);
  background: #091520;
  color: #f4ffff;
  outline: none;
  font-size: 16px;
}
.owner-pin-card input:focus {
  border-color: #67e6f4;
  box-shadow: 0 0 0 3px rgba(68, 218, 240, 0.12);
}
.admin-card {
  width: min(980px, 96vw);
  height: min(660px, 92dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
  border-radius: 24px;
  background: linear-gradient(155deg, #07111b, #0b1723 48%, #061018);
  border: 1px solid rgba(66, 240, 255, 0.2);
  box-shadow:
    0 35px 100px rgba(0, 0, 0, 0.6),
    0 0 45px rgba(43, 222, 255, 0.07);
  color: #e8f8f8;
}
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(90deg, rgba(24, 72, 86, 0.22), rgba(0, 0, 0, 0));
}
.admin-head small {
  letter-spacing: 0.2em;
  color: #4ee8f1;
}
.admin-head h2 {
  margin: 3px 0 0;
  font:
    600 24px Georgia,
    serif;
}
.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px;
}
.admin-summary span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.admin-summary b {
  float: right;
  color: #68f6c3;
}
.admin-ghost-select {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px 12px;
  font-size: 11px;
}
.admin-ghost-select .active {
  border-color: #5ae8f3;
  background: rgba(57, 207, 224, 0.16);
}
.admin-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
  flex: 1;
  padding: 0 16px 12px;
}
.admin-columns section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.17);
  overflow: hidden;
}
.admin-columns h3 {
  font-size: 11px;
  letter-spacing: 0.16em;
  margin: 0;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #8be9f4;
}
.admin-list {
  overflow: auto;
  padding: 8px;
}
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.055);
}
.admin-row strong {
  display: block;
  font-size: 11px;
}
.admin-row small {
  font-size: 8px;
  opacity: 0.6;
}
.admin-row-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-row-actions button {
  font-size: 7px;
  padding: 6px 7px;
}
.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.owner-security-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(76, 206, 223, 0.06);
  border: 1px solid rgba(74, 220, 236, 0.12);
  display: grid;
  gap: 4px;
}
.owner-security-note small {
  color: #6ee9f2;
  letter-spacing: 0.15em;
}
.owner-security-note span {
  font-size: 9px;
  opacity: 0.68;
}
#ghostModeBtn {
  margin-top: 8px;
}
.admin-ghost-avatar {
  pointer-events: none;
}
@media (orientation: landscape) and (pointer: coarse) {
  .owner-pin-card {
    width: min(420px, 82vw);
    max-height: 88dvh;
    overflow: auto;
    padding: 15px;
  }
  .admin-card {
    height: calc(100dvh - 12px);
    width: calc(100vw - 12px);
    border-radius: 17px;
  }
  .admin-head {
    padding: 8px 10px;
  }
  .admin-head h2 {
    font-size: 17px;
  }
  .admin-summary {
    padding: 7px 9px;
    gap: 5px;
  }
  .admin-summary span {
    padding: 7px;
    font-size: 7px;
  }
  .admin-ghost-select {
    padding: 0 9px 7px;
    font-size: 8px;
  }
  .admin-columns {
    gap: 7px;
    padding: 0 9px 7px;
  }
  .admin-columns h3 {
    padding: 7px 8px;
    font-size: 8px;
  }
  .admin-list {
    padding: 5px;
  }
  .admin-row {
    padding: 6px 7px;
  }
  .admin-row strong {
    font-size: 8px;
  }
  .admin-row small {
    font-size: 6px;
  }
  .admin-actions {
    padding: 7px 9px;
  }
}

/* ===== Photon / TPS / Inventory / Ghost Mode update ===== */
.mode-picker {
  max-width: 360px;
}
.ghost-mode-card {
  border-color: rgba(208, 89, 112, 0.35);
  background: linear-gradient(
    145deg,
    rgba(69, 20, 30, 0.58),
    rgba(10, 18, 29, 0.58)
  );
}
.ghost-mode-card:hover {
  border-color: rgba(255, 113, 136, 0.65);
}
.ghost-picker-card,
.social-card {
  width: min(760px, 94vw);
  max-height: 90dvh;
  overflow: auto;
  padding: 22px;
}
.ghost-picker-card header,
.social-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.ghost-picker-copy {
  opacity: 0.72;
  line-height: 1.55;
}
.ghost-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.ghost-choice {
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: linear-gradient(
    155deg,
    rgba(235, 239, 234, 0.12),
    rgba(12, 19, 28, 0.72)
  );
  color: #f5f7f4;
  padding: 18px;
  text-align: left;
  transition: 0.18s;
}
.ghost-choice:hover {
  transform: translateY(-3px);
  border-color: #9ee5ef;
}
.ghost-choice b {
  display: block;
  font-size: 17px;
  letter-spacing: 0.09em;
}
.ghost-choice span {
  display: block;
  margin-top: 12px;
  font-size: 10px;
  line-height: 1.55;
  opacity: 0.7;
}
.ghost-choice.red {
  background: linear-gradient(
    155deg,
    rgba(161, 32, 54, 0.42),
    rgba(18, 12, 19, 0.8)
  );
}
.ghost-choice.dark {
  background: linear-gradient(
    155deg,
    rgba(63, 50, 44, 0.72),
    rgba(10, 10, 12, 0.86)
  );
}
.social-self-id {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}
.social-self-id strong {
  letter-spacing: 0.16em;
  color: #8fe8f4;
}
.social-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.social-tab,
.inv-category {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 8px 12px;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.social-tab.active,
.inv-category.active {
  background: rgba(111, 218, 235, 0.18);
  border-color: rgba(111, 218, 235, 0.55);
}
.social-pane {
  display: none;
}
.social-pane.active {
  display: block;
}
.social-pane label {
  display: grid;
  gap: 6px;
  font-size: 10px;
}
.social-note {
  font-size: 9px;
  opacity: 0.58;
  line-height: 1.55;
}
.friend-list {
  display: grid;
  gap: 8px;
  min-height: 100px;
}
.friend-row-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}
.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(#ddba99 55%, #292625 55%);
}
.friend-row-card strong {
  display: block;
  font-size: 11px;
}
.friend-row-card small {
  font-size: 8px;
  opacity: 0.6;
}
.friend-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  background: #59626b;
}
.friend-status-dot.online {
  background: #51db79;
  box-shadow: 0 0 8px #51db79;
}
.friend-actions {
  display: flex;
  gap: 5px;
}
.friend-empty {
  padding: 25px;
  text-align: center;
  opacity: 0.5;
  font-size: 10px;
}
.lobby-tools {
  flex-wrap: wrap;
  max-width: 220px;
}
.lobby-tool-btn {
  transition: 0.18s;
}
.lobby-tool-btn:hover {
  transform: translateY(-2px);
}

.inventory-two-panel {
  width: min(900px, 95vw);
  max-height: 90dvh;
  overflow: auto;
}
.inventory-categories {
  display: flex;
  gap: 6px;
  margin: 13px 0;
}
.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.8fr);
  gap: 14px;
}
.inventory-left,
.inventory-detail {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}
.inventory-grid {
  grid-template-columns: repeat(4, minmax(66px, 1fr)) !important;
  margin: 0 !important;
}
.inventory-slot {
  position: relative;
  min-height: 78px !important;
  padding: 8px !important;
}
.inventory-slot b {
  font-size: 25px !important;
}
.inventory-slot span {
  display: none !important;
}
.inventory-slot i {
  position: absolute;
  right: 7px;
  bottom: 6px;
  font-size: 9px !important;
  background: rgba(4, 9, 15, 0.74);
  padding: 2px 5px;
  border-radius: 8px;
}
.inventory-detail {
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
  gap: 8px;
}
.inventory-detail-icon {
  width: 86px;
  height: 86px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 46px;
  background: radial-gradient(
    circle,
    rgba(117, 216, 234, 0.22),
    rgba(255, 255, 255, 0.035)
  );
  border: 1px solid rgba(117, 216, 234, 0.2);
}
.inventory-detail h3 {
  margin: 4px 0 0;
  font-size: 19px;
}
.inventory-detail p {
  font-size: 10px;
  line-height: 1.55;
  opacity: 0.68;
  min-height: 42px;
}
.inventory-detail-meta {
  display: flex;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.72;
}
.inventory-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  gap: 6px;
}
.inventory-detail-actions .gift-select {
  grid-column: 1/2;
}
.inventory-detail-actions #itemGiveBtn {
  grid-column: 2/3;
}
.inventory-detail-actions #itemUseBtn,
.inventory-detail-actions #itemDropBtn {
  width: 100%;
}

.quick-hotbar {
  position: fixed;
  z-index: 29;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
}
.quick-hotbar button {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(7, 15, 24, 0.72);
  color: #fff;
  backdrop-filter: blur(5px);
}
.quick-hotbar span {
  font-size: 18px;
}
.quick-hotbar b {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 4px;
  border-radius: 6px;
}
body.playing .quick-hotbar {
  opacity: 1;
  visibility: visible;
}
body.menu-paused .quick-hotbar {
  display: none;
}
.ghost-timer-hud {
  position: fixed;
  z-index: 28;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 92, 126, 0.25);
  border-radius: 13px;
  background: rgba(16, 7, 12, 0.7);
  backdrop-filter: blur(6px);
}
.ghost-timer-hud span {
  font-size: 7px;
  letter-spacing: 0.18em;
  color: #ff92a8;
}
.ghost-timer-hud b {
  font-size: 18px;
}
.ghost-timer-hud small {
  font-size: 7px;
  opacity: 0.65;
}

/* Mobile HUD layout: map/HP top-left, utilities top-right, movement left, action cluster right, hotbar center */
@media (pointer: coarse), (max-width: 820px) {
  .minimap-wrap {
    left: 10px !important;
    top: 10px !important;
    width: 92px !important;
    height: 92px !important;
  }
  .health-hud {
    left: 10px !important;
    top: 108px !important;
  }
  .objective {
    left: 10px !important;
    top: 132px !important;
    max-width: 240px !important;
  }
  .utility-settings {
    right: 10px !important;
    top: 10px !important;
    width: 35px !important;
    height: 35px !important;
  }
  .comment-toggle {
    right: 51px !important;
    top: 10px !important;
    width: 35px !important;
    height: 35px !important;
  }
  .inventory-bag {
    right: 92px !important;
    top: 10px !important;
    width: 35px !important;
    height: 35px !important;
  }
  .leave-game-btn {
    right: 133px !important;
    top: 10px !important;
    width: 35px !important;
    height: 35px !important;
  }
  .joystick {
    left: 18px !important;
    bottom: 18px !important;
    width: 124px !important;
    height: 124px !important;
  }
  .stick {
    width: 50px !important;
    height: 50px !important;
    margin: -25px !important;
  }
  .action-btn.shoot {
    right: 18px !important;
    bottom: 18px !important;
    width: 62px !important;
    height: 62px !important;
  }
  .action-btn.jump {
    right: 24px !important;
    bottom: 92px !important;
    width: 50px !important;
    height: 50px !important;
  }
  .action-btn.run {
    left: 42px !important;
    right: auto !important;
    bottom: 153px !important;
    width: 48px !important;
    height: 48px !important;
  }
  .action-btn.aim {
    right: 88px !important;
    bottom: 28px !important;
    width: 48px !important;
    height: 48px !important;
  }
  .skill1 {
    right: 92px !important;
    bottom: 88px !important;
  }
  .skill2 {
    right: 145px !important;
    bottom: 60px !important;
  }
  .skill3 {
    right: 146px !important;
    bottom: 116px !important;
  }
  .quick-hotbar {
    bottom: 12px;
  }
  .comment-panel {
    left: 12px !important;
    right: auto !important;
    bottom: 154px !important;
    top: auto !important;
    width: min(310px, 56vw) !important;
    max-height: 160px !important;
  }
  .look-pad {
    display: none !important;
  }
}
@media (orientation: landscape) and (pointer: coarse) {
  .inventory-two-panel {
    width: min(780px, 94vw);
    max-height: 94dvh;
    padding: 10px;
  }
  .inventory-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
  .inventory-grid {
    grid-template-columns: repeat(4, minmax(54px, 1fr)) !important;
  }
  .inventory-slot {
    min-height: 57px !important;
  }
  .inventory-detail-icon {
    width: 60px;
    height: 60px;
    font-size: 32px;
  }
  .inventory-detail h3 {
    font-size: 14px;
  }
  .inventory-detail p {
    font-size: 8px;
    min-height: 28px;
  }
  .ghost-choice-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .ghost-choice {
    min-height: 100px;
    padding: 12px;
  }
  .social-card,
  .ghost-picker-card {
    max-height: 94dvh;
    padding: 12px;
  }
  .friend-row-card {
    padding: 6px 8px;
  }
  .quick-hotbar button {
    width: 42px;
    height: 42px;
  }
  .ghost-timer-hud {
    top: 7px;
    padding: 5px 10px;
  }
  .ghost-timer-hud b {
    font-size: 14px;
  }
}
@media (max-width: 620px) {
  .inventory-layout {
    grid-template-columns: 1fr;
  }
  .inventory-detail {
    min-height: 160px;
  }
  .ghost-choice-grid {
    grid-template-columns: 1fr;
  }
  .friend-row-card {
    grid-template-columns: 36px 1fr;
  }
  .friend-actions {
    grid-column: 1/3;
    justify-content: flex-end;
  }
}

/* Global broadcast, clean lobby state, license and tamper-warning UI */
.broadcast-banner {
  position: fixed;
  z-index: 96;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  width: min(760px, calc(100vw - 32px));
  min-height: 44px;
  transform: translate(-50%, -130%);
  opacity: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 225, 128, 0.7);
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    rgba(111, 22, 18, 0.96),
    rgba(182, 91, 26, 0.95),
    rgba(103, 17, 21, 0.96)
  );
  box-shadow:
    0 12px 42px rgba(0, 0, 0, 0.35),
    inset 0 0 24px rgba(255, 214, 94, 0.16);
  color: #fff7df;
  transition:
    transform 0.28s ease,
    opacity 0.28s ease;
  overflow: hidden;
}
.broadcast-banner.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.broadcast-banner strong {
  font-size: 11px;
  letter-spacing: 0.16em;
}
.broadcast-banner span {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.broadcast-banner small {
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
.broadcast-banner-glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(
    circle,
    rgba(255, 228, 113, 0.16),
    transparent 55%
  );
  animation: broadcastPulse 2s infinite;
  pointer-events: none;
}
@keyframes broadcastPulse {
  50% {
    transform: scale(1.1);
    opacity: 0.45;
  }
}
.admin-broadcast-box {
  border: 1px solid rgba(112, 217, 255, 0.18);
  background: linear-gradient(
    135deg,
    rgba(8, 24, 37, 0.76),
    rgba(14, 15, 29, 0.78)
  );
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.admin-broadcast-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.admin-broadcast-head small {
  letter-spacing: 0.15em;
  color: #78eaff;
}
.admin-broadcast-head h3 {
  margin: 2px 0 0;
}
.admin-broadcast-head > span {
  font-size: 11px;
  color: #9aaab2;
}
.admin-broadcast-box textarea {
  width: 100%;
  resize: vertical;
  min-height: 62px;
  max-height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(1, 7, 13, 0.7);
  color: #eefaff;
  padding: 11px 12px;
  outline: none;
}
.admin-broadcast-box textarea:focus {
  border-color: #63e2ff;
  box-shadow: 0 0 0 3px rgba(99, 226, 255, 0.1);
}
.admin-broadcast-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.admin-broadcast-actions label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.admin-broadcast-actions input {
  width: 62px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  padding: 7px;
}
.admin-broadcast-status {
  font-size: 11px;
  color: #9bb2be;
  margin: 0;
}
.security-warning {
  position: fixed;
  z-index: 110;
  right: 14px;
  top: max(14px, env(safe-area-inset-top));
  max-width: min(420px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 116, 93, 0.5);
  background: rgba(48, 10, 12, 0.94);
  color: #ffe9e3;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
  transform: translateY(-140%);
  opacity: 0;
  transition: 0.25s;
}
.security-warning.show {
  transform: none;
  opacity: 1;
}
.security-warning div {
  display: grid;
  gap: 2px;
}
.security-warning b {
  font-size: 10px;
  letter-spacing: 0.16em;
}
.security-warning span {
  font-size: 12px;
}
.security-warning button {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
}
.license-overlay {
  z-index: 105;
  background: rgba(3, 8, 13, 0.78);
  backdrop-filter: blur(10px);
}
.license-card {
  width: min(720px, calc(100vw - 30px));
  max-height: min(78vh, 620px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.license-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.license-card header small {
  letter-spacing: 0.18em;
}
.license-card h2 {
  margin: 3px 0 0;
}
.license-scroll {
  padding: 18px 22px 24px;
  overflow: auto;
  line-height: 1.6;
}
.license-scroll p {
  margin: 0 0 13px;
}
.license-note {
  opacity: 0.68;
  font-size: 12px;
}
body:not(.playing) #commentPanel,
body:not(.playing) #commentToggleBtn,
body:not(.playing) #ghostHealthLayer,
body:not(.playing) #ghostTimerHud,
body:not(.playing) #desktopSkillHud,
body:not(.playing) #quickHotbar {
  display: none !important;
}
@media (max-width: 760px) {
  .broadcast-banner {
    grid-template-columns: 1fr auto;
    padding: 9px 12px;
  }
  .broadcast-banner strong {
    display: none;
  }
  .broadcast-banner span {
    text-align: left;
    font-size: 12px;
  }
  .admin-broadcast-actions {
    align-items: stretch;
  }
  .admin-broadcast-actions .small-btn {
    width: 100%;
  }
  .license-card {
    max-height: 82vh;
  }
}

/* =========================================================
   GHOSTLAND ULTIMATE UI PASS
   Dedicated lobby pages, premium social/room/profile,
   compact HUD, MOBA-like mobile action cluster.
   ========================================================= */
.profile-stats-overlay,
.social-overlay,
.room-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 62 !important;
  padding: clamp(12px, 2vw, 28px) !important;
  display: grid !important;
  place-items: center !important;
  background: radial-gradient(
      circle at 18% 20%,
      rgba(73, 110, 127, 0.22),
      transparent 32%
    ),
    linear-gradient(135deg, rgba(4, 10, 16, 0.97), rgba(8, 17, 27, 0.985)) !important;
  overflow: auto !important;
}
.profile-stats-overlay.hidden,
.social-overlay.hidden,
.room-overlay.hidden {
  display: none !important;
}
.profile-stats-card,
.social-card,
.room-card {
  width: min(1120px, 96vw) !important;
  min-height: min(680px, 92dvh) !important;
  max-height: none !important;
  overflow: visible !important;
  background: linear-gradient(
    160deg,
    rgba(13, 24, 36, 0.98),
    rgba(7, 13, 21, 0.99)
  ) !important;
  border: 1px solid rgba(140, 224, 238, 0.13) !important;
  border-radius: 28px !important;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.45) !important;
  padding: clamp(18px, 3vw, 34px) !important;
  color: #edf6f6 !important;
}
.page-head {
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  gap: 16px !important;
  align-items: start !important;
  margin-bottom: 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding-bottom: 16px !important;
}
.page-head p {
  margin: 4px 0 0 !important;
  opacity: 0.55 !important;
  font-size: 11px !important;
}
.page-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e8f5f6;
  font-size: 21px;
  cursor: pointer;
}
.page-back:hover {
  background: rgba(121, 218, 235, 0.14);
  transform: translateX(-2px);
}
.locked-mode {
  position: relative !important;
  filter: saturate(0.55) !important;
  opacity: 0.72 !important;
  cursor: not-allowed !important;
}
.locked-mode::after {
  content: "DALAM PENGEMBANGAN";
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 7px;
  letter-spacing: 0.12em;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 184, 76, 0.13);
  border: 1px solid rgba(255, 184, 76, 0.2);
  color: #ffc777;
}
.mode-lock {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 13px;
}
.ghost-mode-card strong {
  padding-left: 18px;
}
.profile-id-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0 18px;
  padding: 15px 17px;
  border-radius: 17px;
  background: linear-gradient(
    135deg,
    rgba(102, 220, 234, 0.12),
    rgba(255, 255, 255, 0.025)
  );
  border: 1px solid rgba(102, 220, 234, 0.18);
}
.profile-id-card div {
  display: grid;
  gap: 2px;
}
.profile-id-card small {
  font-size: 8px;
  letter-spacing: 0.18em;
  opacity: 0.55;
}
.profile-id-card strong {
  font-size: 17px;
  letter-spacing: 0.16em;
  color: #8cecf4;
}
.profile-id-card span {
  font-size: 9px;
  opacity: 0.5;
}
.profile-analytics {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) 1.15fr;
  gap: 20px;
  align-items: center;
}
.radar-wrap {
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.16);
  display: grid;
  place-items: center;
  padding: 10px;
}
.radar-wrap canvas {
  width: 100%;
  height: auto;
  max-height: 230px;
}
.room-entry {
  display: grid !important;
  max-width: 680px !important;
  margin: 0 auto !important;
  gap: 14px !important;
}
.room-entry-hero {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(89, 204, 223, 0.11),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(89, 204, 223, 0.14);
}
.room-entry-hero .room-emblem {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: rgba(100, 220, 237, 0.12);
  box-shadow: inset 0 0 30px rgba(100, 220, 237, 0.12);
}
.room-entry-hero div:last-child {
  display: grid;
  gap: 4px;
}
.room-entry-hero b {
  font-size: 15px;
}
.room-entry-hero span,
.room-wait-title span {
  font-size: 9px;
  opacity: 0.54;
}
.join-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 8px;
  letter-spacing: 0.14em;
}
.join-divider::before,
.join-divider::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  flex: 1;
}
.room-code-box {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  grid-template-areas: "small button" "code button" !important;
  gap: 3px 14px !important;
  padding: 16px 18px !important;
  border-radius: 17px !important;
  background: rgba(89, 204, 223, 0.08) !important;
  border: 1px solid rgba(89, 204, 223, 0.16) !important;
}
.room-code-box span {
  grid-area: small;
  font-size: 7px;
  letter-spacing: 0.16em;
  opacity: 0.5;
}
.room-code-box strong {
  grid-area: code;
  font-size: 26px;
  letter-spacing: 0.22em;
  color: #8beaf4;
}
.room-code-box button {
  grid-area: button;
  align-self: center;
}
.room-wait-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 14px 0 8px;
}
.room-slots {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 12px !important;
}
.room-slot {
  min-height: 205px !important;
  border-radius: 19px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: radial-gradient(
      circle at 50% 35%,
      rgba(109, 205, 221, 0.1),
      transparent 40%
    ),
    rgba(255, 255, 255, 0.025) !important;
  position: relative !important;
  overflow: hidden !important;
  padding: 12px !important;
  display: grid !important;
  align-content: end !important;
  justify-items: center !important;
}
.room-slot::before {
  content: "";
  position: absolute;
  width: 72px;
  height: 132px;
  bottom: 48px;
  border-radius: 38% 38% 20% 20%;
  background: linear-gradient(
    180deg,
    var(--avatar-hair, #282625) 0 20%,
    #e5bd9a 20% 36%,
    var(--avatar-shirt, #5f82a7) 36% 76%,
    #293542 76%
  );
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.25);
}
.room-slot.host::after {
  content: "HOST";
  position: absolute;
  top: 9px;
  right: 9px;
  font-size: 6px;
  letter-spacing: 0.12em;
  padding: 4px 6px;
  border-radius: 999px;
  background: #d8b75d;
  color: #1b170d;
}
.room-slot b,
.room-slot span {
  position: relative;
  z-index: 2;
}
.room-slot.empty::before {
  opacity: 0.14;
  filter: grayscale(1);
}
.social-card {
  display: grid !important;
  grid-template-rows: auto auto auto 1fr !important;
}
.social-self-id {
  display: grid !important;
  grid-template-columns: 48px 1fr auto !important;
  align-items: center !important;
  gap: 13px !important;
  padding: 14px 16px !important;
  border-radius: 17px !important;
  background: linear-gradient(
    135deg,
    rgba(107, 222, 237, 0.1),
    rgba(255, 255, 255, 0.02)
  ) !important;
  border: 1px solid rgba(107, 222, 237, 0.16) !important;
}
.social-id-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(
    circle,
    #d8b18d 0 44%,
    #22262c 45% 64%,
    #4d718a 65%
  );
  color: #fff;
}
.social-self-id > div:nth-child(2) {
  display: grid;
}
.social-self-id small {
  font-size: 7px;
  letter-spacing: 0.17em;
  opacity: 0.5;
}
.social-self-id strong {
  font-size: 15px !important;
  letter-spacing: 0.18em;
}
.social-self-id span {
  font-size: 9px;
  opacity: 0.5;
}
.invite-inbox {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    rgba(235, 192, 91, 0.13),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(235, 192, 91, 0.2);
}
.invite-inbox.hidden {
  display: none !important;
}
.invite-inbox > div {
  display: grid;
}
.invite-inbox b {
  font-size: 11px;
}
.invite-inbox span {
  font-size: 9px;
  opacity: 0.55;
}
.friend-row-card {
  grid-template-columns: 48px 1fr auto !important;
  padding: 12px 14px !important;
  border-radius: 16px !important;
  background: linear-gradient(
    145deg,
    rgba(19, 31, 45, 0.9),
    rgba(9, 15, 24, 0.96)
  ) !important;
  border: 1px solid rgba(109, 222, 238, 0.14) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18) !important;
}
.friend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #e2bd99 0 44%,
    #26272d 45% 62%,
    #486e87 63%
  );
}
.friend-status.online {
  color: #7df1a2;
}
.friend-status.playing {
  color: #f1c96d;
}
.friend-status.offline {
  color: #7b858d;
}
.friend-action {
  min-width: 82px;
}
/* compact Minecraft-style chat */
.comment-panel {
  width: min(218px, 48vw) !important;
  max-height: 118px !important;
  right: 10px !important;
  left: auto !important;
  top: 78px !important;
  bottom: auto !important;
  border-radius: 12px !important;
  background: rgba(3, 9, 14, 0.66) !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.comment-panel header {
  min-height: 28px !important;
  padding: 5px 7px !important;
  font-size: 8px !important;
}
.comment-panel header button {
  width: 28px !important;
  height: 28px !important;
  font-size: 17px !important;
}
.comment-feed {
  max-height: 55px !important;
  padding: 4px 7px !important;
  gap: 3px !important;
}
.comment-line {
  font-size: 7.5px !important;
  line-height: 1.28 !important;
}
.comment-compose {
  padding: 4px !important;
}
.comment-compose input {
  height: 25px !important;
  font-size: 8px !important;
  padding: 4px 7px !important;
}
.comment-compose button {
  height: 25px !important;
  font-size: 7px !important;
  padding: 0 7px !important;
}
/* refined inventory */
.inventory-two-panel {
  width: min(790px, 90vw) !important;
  max-height: 78dvh !important;
  border-radius: 24px !important;
}
.inventory-layout {
  grid-template-columns: 1.15fr 0.85fr !important;
  gap: 14px !important;
}
.inventory-grid {
  grid-template-columns: repeat(4, minmax(62px, 1fr)) !important;
  gap: 8px !important;
}
.inventory-slot {
  aspect-ratio: 1/1 !important;
  min-height: 62px !important;
  border-radius: 13px !important;
}
.inventory-slot b {
  font-size: 25px !important;
}
.inventory-slot i {
  font-size: 9px !important;
}
.inventory-detail {
  border-radius: 17px !important;
}
.inventory-detail-icon {
  font-size: 52px !important;
}
/* mission hologram */
.mission-hologram {
  position: fixed;
  z-index: 42;
  left: 50%;
  top: 18%;
  transform: translate(-50%, 0);
  width: min(440px, 72vw);
  padding: 15px 18px 16px;
  border: 1px solid rgba(96, 235, 248, 0.38);
  border-radius: 15px;
  background: linear-gradient(
    135deg,
    rgba(5, 29, 38, 0.9),
    rgba(7, 16, 27, 0.83)
  );
  color: #d8fbff;
  box-shadow:
    0 0 45px rgba(50, 220, 244, 0.15),
    inset 0 0 30px rgba(50, 220, 244, 0.05);
  backdrop-filter: blur(9px);
  overflow: hidden;
  animation: holoIn 0.28s ease-out;
}
.mission-hologram.hidden {
  display: none;
}
.mission-hologram button {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #eaffff;
}
.mission-hologram small {
  font-size: 7px;
  letter-spacing: 0.2em;
  color: #7eeaf3;
}
.mission-hologram strong {
  display: block;
  font-size: 16px;
  margin-top: 3px;
}
.mission-hologram p {
  font-size: 9px;
  line-height: 1.45;
  opacity: 0.72;
  margin: 5px 24px 0 0;
}
.holo-scan {
  position: absolute;
  left: -20%;
  right: -20%;
  height: 1px;
  top: 0;
  background: #7ff5ff;
  box-shadow: 0 0 8px #7ff5ff;
  animation: holoScan 1.5s linear infinite;
}
.oxygen-hud {
  position: fixed;
  z-index: 30;
  left: 18px;
  top: 172px;
  display: grid;
  grid-template-columns: auto 110px auto;
  gap: 5px;
  align-items: center;
  font-size: 8px;
  color: #dffaff;
}
.oxygen-hud.hidden {
  display: none;
}
.oxygen-hud > div {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.oxygen-hud i {
  display: block;
  height: 100%;
  width: 100%;
  background: #60daf1;
}
.boss-hud {
  position: fixed;
  z-index: 35;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  width: min(520px, 66vw);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "small name label" "bar bar bar";
  gap: 3px 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(24, 4, 7, 0.8);
  border: 1px solid rgba(255, 76, 99, 0.28);
  color: #fff;
}
.boss-hud.hidden {
  display: none;
}
.boss-hud small {
  grid-area: small;
  font-size: 6px;
  letter-spacing: 0.16em;
  color: #ff8b9c;
}
.boss-hud strong {
  grid-area: name;
  font-size: 10px;
}
.boss-hud span {
  grid-area: label;
  font-size: 8px;
  opacity: 0.7;
}
.boss-hud > div {
  grid-area: bar;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.boss-hud i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff3f5d, #ffae54);
}
/* control editor */
.control-edit-actions {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px;
  border-radius: 14px;
  background: rgba(5, 12, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.control-edit-actions.hidden {
  display: none;
}
.control-edit-actions button {
  border: 0;
  border-radius: 10px;
  padding: 9px 13px;
  background: #e5ece7;
  color: #27302b;
  font-size: 9px;
}
.control-edit-actions button:first-child {
  background: #2b3640;
  color: #eaf3f3;
}
.controls-edit-mode .mobile-movable {
  outline: 1px dashed rgba(116, 235, 247, 0.8) !important;
  box-shadow: 0 0 0 4px rgba(116, 235, 247, 0.08) !important;
}
.controls-edit-mode .mobile-movable::after {
  content: "↕";
  position: absolute;
  right: -5px;
  top: -8px;
  font-size: 11px;
  color: #8ff4ff;
}
/* MOBA mobile cluster */
@media (pointer: coarse) {
  .joystick {
    left: 16px !important;
    bottom: 15px !important;
    width: 136px !important;
    height: 136px !important;
  }
  .stick {
    width: 56px !important;
    height: 56px !important;
    margin: -28px !important;
  }
  .action-btn.shoot {
    right: 17px !important;
    bottom: 16px !important;
    width: 72px !important;
    height: 72px !important;
    border: 2px solid rgba(255, 255, 255, 0.16) !important;
    background: radial-gradient(
      circle,
      rgba(255, 255, 255, 0.24),
      rgba(111, 220, 234, 0.12)
    ) !important;
  }
  .action-btn.jump {
    right: 29px !important;
    bottom: 101px !important;
    width: 54px !important;
    height: 54px !important;
  }
  .action-btn.aim {
    right: 97px !important;
    bottom: 28px !important;
    width: 50px !important;
    height: 50px !important;
  }
  .action-btn.run {
    left: 43px !important;
    right: auto !important;
    bottom: 160px !important;
    width: 50px !important;
    height: 50px !important;
  }
  .skill-btn {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
  }
  .skill1 {
    right: 101px !important;
    bottom: 91px !important;
  }
  .skill2 {
    right: 154px !important;
    bottom: 61px !important;
  }
  .skill3 {
    right: 154px !important;
    bottom: 121px !important;
  }
  .quick-hotbar {
    bottom: 8px !important;
  }
  .quick-hotbar button {
    width: 42px !important;
    height: 42px !important;
  }
  .desktop-skill-hud {
    display: none !important;
  }
  .utility-settings {
    right: 12px !important;
    top: 12px !important;
  }
  .comment-toggle {
    right: 58px !important;
    top: 12px !important;
  }
  .inventory-bag {
    right: 104px !important;
    top: 12px !important;
  }
  .leave-game-btn {
    right: 150px !important;
    top: 12px !important;
  }
}
@media (orientation: landscape) and (pointer: coarse) {
  .comment-panel {
    top: 58px !important;
    width: min(205px, 39vw) !important;
    max-height: 110px !important;
  }
  .profile-stats-card,
  .social-card,
  .room-card {
    min-height: 94dvh !important;
    padding: 14px 18px !important;
    border-radius: 20px !important;
  }
  .page-head {
    margin-bottom: 10px !important;
    padding-bottom: 9px !important;
  }
  .room-slots {
    gap: 7px !important;
  }
  .room-slot {
    min-height: 155px !important;
  }
  .room-slot::before {
    height: 96px !important;
    width: 55px !important;
    bottom: 40px !important;
  }
  .profile-analytics {
    grid-template-columns: 220px 1fr !important;
  }
  .radar-wrap {
    min-height: 150px !important;
  }
  .inventory-two-panel {
    max-height: 88dvh !important;
    width: min(720px, 92vw) !important;
  }
}
@media (max-width: 700px) {
  .profile-analytics {
    grid-template-columns: 1fr;
  }
  .radar-wrap {
    display: none;
  }
  .room-slots {
    grid-template-columns: repeat(5, minmax(72px, 1fr)) !important;
    overflow-x: auto;
  }
  .social-card,
  .room-card,
  .profile-stats-card {
    width: 96vw !important;
  }
  .inventory-layout {
    grid-template-columns: 1fr 0.78fr !important;
  }
  .inventory-grid {
    grid-template-columns: repeat(3, minmax(54px, 1fr)) !important;
  }
}
@keyframes holoIn {
  from {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
@keyframes holoScan {
  0% {
    top: 0;
  }
  100% {
    top: 100%;
  }
}

/* Ultimate polish */
#serverStatusLobby {
  opacity: 0.55;
  font-size: 9px;
  letter-spacing: 0.05em;
}
.profile-stats-card,
.social-card,
.room-card {
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.38),
    inset 0 1px rgba(255, 255, 255, 0.05);
}
.room-slot {
  min-height: 170px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 30%,
    rgba(83, 190, 215, 0.11),
    rgba(8, 14, 22, 0.78) 65%
  );
}
.room-character {
  height: 92px;
  width: 62px;
  margin: 2px auto 7px;
  position: relative;
  filter: drop-shadow(0 14px 10px rgba(0, 0, 0, 0.36));
}
.room-character i {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  left: 14px;
  top: 0;
  background: #e4c0a0;
  box-shadow: inset 0 12px #262426;
}
.room-character b {
  position: absolute;
  width: 44px;
  height: 49px;
  border-radius: 14px 14px 11px 11px;
  left: 9px;
  top: 31px;
  background: #8ca7b9;
}
.room-character em {
  position: absolute;
  width: 42px;
  height: 24px;
  left: 10px;
  top: 71px;
  border-radius: 0 0 12px 12px;
  background: #526474;
}
.room-character-richard i {
  box-shadow: inset 0 12px #dfc257;
}
.room-character-alexa i {
  box-shadow: inset 0 12px #e678a3;
}
.room-character-lucy i {
  box-shadow: inset 0 12px #eef3f5;
}
.room-slot-plus {
  font-size: 38px;
  opacity: 0.22;
  margin: 20px 0 14px;
}
.friend-row-card:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 218, 235, 0.4);
}
.friend-row-card {
  transition:
    0.18s transform,
    0.18s border-color;
}
.profile-id-card {
  background: linear-gradient(
    135deg,
    rgba(77, 209, 228, 0.12),
    rgba(255, 255, 255, 0.025)
  );
  border: 1px solid rgba(104, 224, 239, 0.28);
}
.control-edit .mobile-movable {
  outline: 2px dashed rgba(81, 231, 248, 0.75) !important;
  outline-offset: 4px !important;
  animation: controlPulse 1s ease-in-out infinite alternate;
}
@keyframes controlPulse {
  to {
    filter: drop-shadow(0 0 12px rgba(81, 231, 248, 0.6));
  }
}
#controlEditActions {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(6, 11, 18, 0.86);
  backdrop-filter: blur(14px);
}
#controlEditActions.hidden {
  display: none;
}
#oxygenHud,
#bossHud {
  backdrop-filter: blur(10px);
}
.locked-mode {
  position: relative;
  opacity: 0.56 !important;
  filter: saturate(0.35);
}
.locked-mode::after {
  content: "🔒";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

.inventory-slot.rarity-common {
  border-color: rgba(210, 219, 218, 0.18);
}
.inventory-slot.rarity-rare {
  border-color: rgba(73, 176, 255, 0.42);
  box-shadow: inset 0 0 18px rgba(73, 176, 255, 0.08);
}
.inventory-slot.rarity-epic {
  border-color: rgba(177, 93, 255, 0.46);
  box-shadow: inset 0 0 18px rgba(177, 93, 255, 0.1);
}
.inventory-slot.rarity-legendary {
  border-color: rgba(255, 198, 70, 0.55);
  box-shadow:
    inset 0 0 20px rgba(255, 198, 70, 0.12),
    0 0 12px rgba(255, 198, 70, 0.06);
}
.skill-btn {
  position: fixed;
  overflow: hidden;
}
.skill-btn.cooldown::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    rgba(3, 7, 12, 0.68) var(--cd-angle, 0deg),
    transparent 0
  );
  pointer-events: none;
}
.skill-btn .skill-cd {
  z-index: 2;
}

/* Focused profile, social, and compact-message revision. */
.profile-gate-nav {
  position: absolute;
  z-index: 8;
  left: 14px;
  right: 14px;
  top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.profile-gate-nav button {
  pointer-events: auto;
  position: static !important;
  display: grid !important;
  place-items: center;
  width: 38px !important;
  height: 38px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 12px !important;
  background: rgba(8, 18, 27, 0.76) !important;
  color: #effbfb !important;
  font-size: 21px !important;
  line-height: 1 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}
.profile-gate-nav button:hover {
  background: rgba(99, 217, 234, 0.17) !important;
  border-color: rgba(99, 217, 234, 0.42) !important;
}
.profile-gate-back {
  display: grid;
}

.social-card {
  position: relative !important;
  overflow: hidden !important;
}
.social-list-note {
  margin: 0 0 10px;
  color: rgba(225, 240, 242, 0.55);
  font-size: 9px;
  line-height: 1.45;
}
.social-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(103, 226, 239, 0.14);
  color: #8feaf2;
  font-size: 8px;
}
.friend-list {
  max-height: 390px;
  overflow: auto;
  padding: 2px 4px 8px 0;
  align-content: start;
}
.friend-row-card {
  grid-template-columns: 50px minmax(0, 1fr) auto !important;
  gap: 13px !important;
  min-height: 76px;
  padding: 11px 13px !important;
}
.friend-row-card.is-online {
  border-color: rgba(83, 220, 127, 0.2) !important;
  background: linear-gradient(
    145deg,
    rgba(17, 37, 43, 0.94),
    rgba(8, 16, 24, 0.97)
  ) !important;
}
.friend-avatar {
  position: relative;
  display: block;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}
.friend-avatar::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: -4px;
  height: 20px;
  border-radius: 9px 9px 0 0;
  background: #567994;
}
.friend-avatar i {
  position: absolute;
  z-index: 2;
  width: 17px;
  height: 10px;
  left: 12px;
  top: 20px;
  border-radius: 0 0 10px 10px;
  background: #dab493;
}
.friend-avatar.avatar-richard {
  background: radial-gradient(
    circle,
    #e1bd98 0 44%,
    #dbc45e 45% 64%,
    #496a80 65%
  );
}
.friend-avatar.avatar-alexa {
  background: radial-gradient(
    circle,
    #e2b998 0 44%,
    #df719e 45% 64%,
    #76566f 65%
  );
}
.friend-avatar.avatar-lucy {
  background: radial-gradient(
    circle,
    #e7c7aa 0 44%,
    #e9eff0 45% 64%,
    #637d8d 65%
  );
}
.friend-identity {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
}
.friend-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.friend-name-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px !important;
}
.friend-chip {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid rgba(102, 226, 238, 0.25);
  border-radius: 999px;
  background: rgba(102, 226, 238, 0.09);
  color: #8ee9f2;
  font-size: 6px;
  letter-spacing: 0.1em;
}
.friend-chip.recent {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #9caab1;
}
.friend-id {
  display: block !important;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.08em;
  color: rgba(226, 239, 241, 0.42);
  font-size: 7px !important;
}
.friend-status {
  display: block;
  font-size: 8px;
  line-height: 1.35;
}
.friend-status.online {
  color: #72e49a;
}
.friend-status.playing {
  color: #efca71;
}
.friend-status.offline {
  color: #7d8991;
}
.friend-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 250px;
}
.friend-actions .small-btn {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.friend-message-btn {
  border-color: rgba(104, 222, 238, 0.25) !important;
}
.friend-remove-btn {
  min-width: 30px;
  padding: 5px !important;
  color: #cc8b91 !important;
}
.friend-empty {
  display: grid;
  gap: 5px;
}
.friend-empty b {
  font-size: 11px;
}
.friend-empty span {
  font-size: 8px;
}

.social-message-panel {
  position: absolute;
  z-index: 12;
  right: 22px;
  top: 96px;
  bottom: 22px;
  width: min(440px, calc(100% - 44px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid rgba(102, 224, 238, 0.22);
  border-radius: 20px;
  background: linear-gradient(
    155deg,
    rgba(12, 25, 36, 0.985),
    rgba(5, 12, 19, 0.995)
  );
  box-shadow: -18px 24px 70px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}
.social-message-panel.hidden {
  display: none !important;
}
.social-message-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.message-profile {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
}
.message-profile .friend-avatar {
  width: 38px;
  height: 38px;
}
.message-profile > div:last-child {
  display: grid;
  gap: 1px;
}
.message-profile small {
  font-size: 6px;
  letter-spacing: 0.15em;
  opacity: 0.45;
}
.message-profile strong {
  font-size: 12px;
}
.message-profile span {
  font-size: 8px;
  color: #7a8990;
}
.message-profile span.online {
  color: #70e69a;
}
.social-message-panel .icon-close {
  width: 34px;
  height: 34px;
  font-size: 18px;
}
.social-message-thread {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}
.message-empty {
  margin: auto;
  padding: 20px;
  text-align: center;
  color: rgba(229, 241, 242, 0.45);
  font-size: 9px;
  line-height: 1.55;
}
.direct-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 82%;
}
.direct-message.out {
  align-self: flex-end;
  align-items: flex-end;
}
.direct-message span {
  padding: 8px 10px;
  border-radius: 12px 12px 12px 3px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.direct-message.out span {
  border-radius: 12px 12px 3px 12px;
  background: rgba(83, 204, 222, 0.2);
  color: #e8fcff;
}
.direct-message small {
  margin-top: 2px;
  font-size: 6px;
  opacity: 0.35;
}
.social-message-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.social-message-compose input {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #effafa;
  padding: 7px 10px;
  outline: none;
  font-size: 9px;
}
.social-message-compose input:focus {
  border-color: rgba(105, 226, 240, 0.48);
}

/* Story guidance now lives only in the compact communication column. */
.mission-hologram {
  display: none !important;
}
.comment-panel,
.comment-panel.open {
  width: min(202px, 44vw) !important;
  max-height: 106px !important;
}
.comment-panel header {
  min-height: 25px !important;
  padding: 3px 6px !important;
  font-size: 7px !important;
}
.comment-panel header button,
#commentCloseBtn {
  min-width: 25px !important;
  min-height: 25px !important;
  width: 25px !important;
  height: 25px !important;
  font-size: 15px !important;
}
.comment-feed {
  max-height: 49px !important;
  padding: 3px 6px !important;
  gap: 2px !important;
}
.comment-line {
  font-size: 6.7px !important;
  line-height: 1.25 !important;
  overflow-wrap: anywhere;
}
.comment-compose {
  gap: 3px !important;
  padding: 3px !important;
}
.comment-compose input,
.comment-compose button {
  height: 23px !important;
  min-height: 23px !important;
  font-size: 6.8px !important;
  padding: 3px 6px !important;
}

@media (max-width: 700px) {
  .profile-gate-nav {
    left: 9px;
    right: 9px;
    top: 9px;
  }
  .social-card {
    overflow: auto !important;
  }
  .friend-list {
    max-height: none;
  }
  .friend-row-card {
    grid-template-columns: 42px minmax(0, 1fr) !important;
  }
  .friend-avatar {
    width: 40px !important;
    height: 40px !important;
  }
  .friend-actions {
    grid-column: 1/3;
    max-width: none;
    justify-content: flex-start;
    padding-left: 55px;
    margin-top: -7px;
  }
  .social-message-panel {
    position: fixed;
    inset: 10px;
    width: auto;
    border-radius: 17px;
  }
  .comment-panel,
  .comment-panel.open {
    width: min(190px, 43vw) !important;
    max-height: 100px !important;
  }
}

/* Ultimate 5: profile is a real lobby popup, never a separate full page. */
.profile-stats-overlay {
  padding: clamp(10px, 2.2vw, 26px) !important;
  place-items: center !important;
  background: rgba(2, 7, 12, 0.62) !important;
  backdrop-filter: blur(7px) saturate(0.86) !important;
  overflow: hidden !important;
}
.profile-stats-card {
  position: relative !important;
  width: min(760px, 94vw) !important;
  min-height: 0 !important;
  max-height: min(88dvh, 760px) !important;
  overflow: auto !important;
  padding: clamp(18px, 2.4vw, 28px) !important;
  border: 1px solid rgba(119, 229, 242, 0.24) !important;
  border-radius: 24px !important;
  background: linear-gradient(
    155deg,
    rgba(13, 27, 39, 0.985),
    rgba(6, 13, 21, 0.995)
  ) !important;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.035) inset,
    0 0 42px rgba(73, 205, 225, 0.07) !important;
}
.profile-stats-card::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #77e8f3, transparent);
  opacity: 0.72;
}
.profile-stats-card .profile-stats-head {
  position: relative !important;
  grid-template-columns: minmax(0, 1fr) 44px !important;
  align-items: start !important;
  gap: 14px !important;
  margin: 0 0 15px !important;
  padding: 0 0 14px !important;
}
.profile-stats-card #profileBackBtn {
  display: none !important;
}
.profile-stats-card #profileStatsClose {
  display: grid !important;
  place-items: center !important;
  position: sticky !important;
  right: 0 !important;
  top: 0 !important;
  z-index: 5 !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(255, 255, 255, 0.17) !important;
  background: rgba(255, 255, 255, 0.075) !important;
  color: #f4fcfc !important;
  font-size: 25px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25) !important;
}
.profile-stats-card #profileStatsClose:hover {
  background: rgba(238, 94, 111, 0.2) !important;
  border-color: rgba(255, 128, 142, 0.45) !important;
  transform: scale(1.04);
}
.profile-stats-card .profile-rank-frame {
  border-radius: 17px !important;
  border: 1px solid rgba(255, 255, 255, 0.085) !important;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.025)
  ) !important;
}
.profile-stats-card .profile-id-card {
  margin: 12px 0 14px !important;
}
.profile-stats-card .profile-analytics {
  grid-template-columns: minmax(220px, 0.78fr) 1.22fr !important;
  gap: 16px !important;
}
.profile-stats-card .radar-wrap {
  min-height: 190px !important;
}
.profile-stats-card .stat-grid {
  margin-top: 14px !important;
}

/* Larger, more polished social cards and friend-ID entry. */
.social-overlay {
  background: rgba(2, 7, 12, 0.68) !important;
  backdrop-filter: blur(7px) !important;
}
.social-card {
  width: min(1040px, 95vw) !important;
  min-height: min(620px, 88dvh) !important;
  max-height: 90dvh !important;
  overflow: hidden !important;
  border-color: rgba(117, 225, 239, 0.22) !important;
}
.social-tabs {
  gap: 10px !important;
  margin: 16px 0 14px !important;
}
.social-tab {
  min-height: 42px !important;
  padding: 10px 16px !important;
  border-radius: 13px !important;
  font-size: 9px !important;
}
.social-pane.active {
  min-height: 0;
}
.friend-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px !important;
  max-height: 410px !important;
  padding: 3px 5px 10px 2px !important;
}
.friend-row-card {
  grid-template-columns: 62px minmax(0, 1fr) !important;
  grid-template-areas: "avatar identity" "actions actions";
  gap: 10px 14px !important;
  min-height: 132px !important;
  padding: 15px !important;
  border-radius: 20px !important;
  background: radial-gradient(
      circle at 10% 0,
      rgba(94, 218, 235, 0.11),
      transparent 42%
    ),
    linear-gradient(150deg, rgba(20, 35, 49, 0.96), rgba(7, 14, 22, 0.98)) !important;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.24),
    inset 0 1px rgba(255, 255, 255, 0.035) !important;
}
.friend-row-card.is-online {
  border-color: rgba(83, 229, 132, 0.35) !important;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.25),
    0 0 22px rgba(66, 214, 119, 0.055) !important;
}
.friend-row-card .friend-avatar {
  grid-area: avatar;
  width: 58px !important;
  height: 58px !important;
  border-width: 2px !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32) !important;
}
.friend-row-card .friend-avatar::before {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  z-index: 4;
  width: 11px;
  height: 11px;
  border: 3px solid #0c1721;
  border-radius: 50%;
  background: #59636a;
}
.friend-row-card.is-online .friend-avatar::before {
  background: #5ee58c;
  box-shadow: 0 0 11px rgba(94, 229, 140, 0.72);
}
.friend-row-card .friend-avatar i {
  left: 18px !important;
  top: 28px !important;
  width: 20px !important;
}
.friend-row-card .friend-identity {
  grid-area: identity;
  gap: 4px !important;
}
.friend-row-card .friend-name-line strong {
  font-size: 14px !important;
}
.friend-row-card .friend-id {
  font-size: 8px !important;
  letter-spacing: 0.13em !important;
}
.friend-row-card .friend-status {
  font-size: 8.5px !important;
}
.friend-row-card .friend-actions {
  grid-area: actions;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.friend-row-card .friend-actions .small-btn {
  min-height: 34px !important;
  padding: 7px 9px !important;
  border-radius: 11px !important;
  font-size: 7.5px !important;
}
.friend-empty {
  grid-column: 1/-1;
  min-height: 170px !important;
  place-content: center;
  border: 1px dashed rgba(120, 224, 238, 0.17);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.018);
}
.friend-empty b {
  font-size: 13px !important;
}
.friend-empty span {
  font-size: 9px !important;
}

.add-friend-card {
  position: relative;
  width: min(760px, 100%);
  margin: 8px auto 0;
  padding: 24px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px 20px;
  align-items: center;
  border: 1px solid rgba(113, 226, 240, 0.25);
  border-radius: 24px;
  background: radial-gradient(
      circle at 8% 10%,
      rgba(98, 225, 240, 0.18),
      transparent 30%
    ),
    linear-gradient(145deg, rgba(18, 36, 50, 0.97), rgba(7, 15, 24, 0.99));
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.045);
  overflow: hidden;
}
.add-friend-card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(107, 222, 237, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 30px rgba(107, 222, 237, 0.025),
    0 0 0 64px rgba(107, 222, 237, 0.018);
  pointer-events: none;
}
.add-friend-icon {
  grid-row: 1/3;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 235, 246, 0.3);
  border-radius: 23px;
  background: linear-gradient(
    145deg,
    rgba(99, 223, 238, 0.22),
    rgba(99, 223, 238, 0.06)
  );
  color: #9af2f7;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.2),
    0 0 25px rgba(80, 220, 238, 0.08);
}
.add-friend-icon span {
  font-size: 38px;
  font-weight: 200;
  line-height: 1;
}
.add-friend-copy {
  min-width: 0;
}
.add-friend-copy small {
  font-size: 7px;
  letter-spacing: 0.2em;
  color: #78e1ec;
}
.add-friend-copy h3 {
  margin: 4px 0 5px;
  font:
    500 24px Georgia,
    serif;
}
.add-friend-copy p {
  max-width: 580px;
  margin: 0;
  color: rgba(231, 243, 244, 0.58);
  font-size: 9.5px;
  line-height: 1.55;
}
.friend-id-field {
  grid-column: 1/-1 !important;
  display: grid !important;
  gap: 7px !important;
  margin-top: 4px !important;
  font-size: 7px !important;
  letter-spacing: 0.16em !important;
  color: rgba(221, 240, 242, 0.56) !important;
}
.friend-id-field > div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  min-height: 54px;
  border: 1px solid rgba(124, 230, 242, 0.27);
  border-radius: 15px;
  background: rgba(2, 9, 15, 0.5);
  overflow: hidden;
  transition:
    0.18s border-color,
    0.18s box-shadow;
}
.friend-id-field > div:focus-within {
  border-color: rgba(125, 237, 248, 0.72);
  box-shadow:
    0 0 0 3px rgba(103, 224, 238, 0.08),
    0 0 24px rgba(70, 210, 229, 0.08);
}
.friend-id-field b {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(103, 224, 238, 0.08);
  color: #86e8f1;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.friend-id-field input {
  width: 100%;
  height: 52px !important;
  border: 0 !important;
  background: transparent !important;
  color: #f4fbfb !important;
  padding: 0 15px !important;
  outline: 0 !important;
  font-size: 14px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
}
.friend-id-field input::placeholder {
  color: rgba(224, 241, 242, 0.28);
  text-transform: none;
  letter-spacing: 0.04em;
}
.add-friend-submit {
  grid-column: 1/-1 !important;
  position: relative !important;
  z-index: 1 !important;
  min-height: 52px !important;
  border-radius: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
}
.add-friend-submit span {
  font-size: 10px !important;
  letter-spacing: 0.07em;
}
.add-friend-submit small {
  font-size: 7px !important;
  opacity: 0.6;
}
.add-friend-info {
  grid-column: 1/-1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(229, 242, 243, 0.53);
}
.add-friend-info > span {
  color: #66e18f;
  font-size: 9px;
}
.add-friend-info p {
  margin: 0;
  font-size: 8.5px;
  line-height: 1.5;
}

@media (orientation: landscape) and (pointer: coarse) {
  .profile-stats-card {
    width: min(700px, 91vw) !important;
    max-height: 91dvh !important;
    min-height: 0 !important;
    padding: 14px 18px !important;
  }
  .profile-stats-card .profile-stats-head {
    margin-bottom: 10px !important;
    padding-bottom: 9px !important;
  }
  .profile-stats-card #profileStatsClose {
    width: 36px !important;
    height: 36px !important;
    border-radius: 11px !important;
    font-size: 21px !important;
  }
  .profile-stats-card .profile-id-card {
    margin: 8px 0 10px !important;
    padding: 10px 13px !important;
  }
  .profile-stats-card .profile-analytics {
    grid-template-columns: 210px 1fr !important;
  }
  .profile-stats-card .radar-wrap {
    min-height: 145px !important;
  }
  .social-card {
    min-height: 92dvh !important;
    max-height: 94dvh !important;
  }
  .friend-list {
    max-height: 310px !important;
  }
  .friend-row-card {
    min-height: 112px !important;
    padding: 10px 12px !important;
  }
  .add-friend-card {
    padding: 16px 20px;
    gap: 12px 16px;
  }
  .add-friend-icon {
    width: 62px;
    height: 62px;
    border-radius: 19px;
  }
  .add-friend-icon span {
    font-size: 31px;
  }
  .add-friend-copy h3 {
    font-size: 19px;
  }
  .friend-id-field > div {
    min-height: 46px;
  }
  .friend-id-field input {
    height: 44px !important;
  }
  .add-friend-submit {
    min-height: 44px !important;
  }
  .add-friend-info {
    padding: 8px 11px;
  }
}
@media (max-width: 760px) {
  .profile-stats-overlay {
    padding: 8px !important;
  }
  .profile-stats-card {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 19px !important;
    padding: 15px !important;
  }
  .profile-stats-card .profile-analytics {
    grid-template-columns: 1fr !important;
  }
  .profile-stats-card .radar-wrap {
    display: none !important;
  }
  .profile-stats-card .stat-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .friend-list {
    grid-template-columns: 1fr;
  }
  .friend-row-card {
    min-height: 125px !important;
  }
  .add-friend-card {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 16px;
    gap: 13px;
    border-radius: 19px;
  }
  .add-friend-icon {
    grid-row: auto;
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }
  .add-friend-icon span {
    font-size: 27px;
  }
  .add-friend-copy h3 {
    font-size: 18px;
  }
  .add-friend-copy p {
    font-size: 8px;
  }
  .add-friend-submit {
    display: grid !important;
    gap: 2px !important;
  }
  .add-friend-info p {
    font-size: 7.5px;
  }
}

/* v1.1 — compact mobile profile: the radar remains visible on phone screens. */
@media (pointer: coarse), (max-width: 820px) {
  .profile-stats-overlay {
    padding: 5px !important;
    overflow: hidden !important;
  }
  .profile-stats-card {
    width: min(680px, calc(100vw - 10px)) !important;
    max-height: calc(100dvh - 10px) !important;
    padding: 9px 11px !important;
    border-radius: 15px !important;
    font-size: 8px !important;
  }
  .profile-stats-card .profile-stats-head {
    min-height: 32px !important;
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
    grid-template-columns: 1fr 30px !important;
    gap: 7px !important;
  }
  .profile-stats-card .profile-stats-head small {
    font-size: 5.5px !important;
    letter-spacing: 0.14em !important;
  }
  .profile-stats-card .profile-stats-head h2 {
    font-size: 13px !important;
    margin: 1px 0 !important;
    line-height: 1.05 !important;
  }
  .profile-stats-card .profile-stats-head p {
    font-size: 6.5px !important;
    margin: 1px 0 !important;
    line-height: 1.2 !important;
  }
  .profile-stats-card #profileStatsClose {
    width: 29px !important;
    height: 29px !important;
    border-radius: 8px !important;
    font-size: 18px !important;
  }
  .profile-stats-card .profile-rank-frame {
    min-height: 42px !important;
    padding: 5px 8px !important;
    border-radius: 11px !important;
    gap: 7px !important;
  }
  .profile-stats-card .rank-avatar {
    width: 33px !important;
    height: 33px !important;
    min-width: 33px !important;
  }
  .profile-stats-card .profile-rank-frame small {
    font-size: 5px !important;
  }
  .profile-stats-card .profile-rank-frame strong {
    font-size: 10px !important;
  }
  .profile-stats-card .profile-rank-frame span {
    font-size: 6px !important;
  }
  .profile-stats-card .profile-id-card {
    min-height: 38px !important;
    margin: 5px 0 !important;
    padding: 5px 8px !important;
    border-radius: 10px !important;
    gap: 7px !important;
  }
  .profile-stats-card .profile-id-card small {
    font-size: 5px !important;
  }
  .profile-stats-card .profile-id-card strong {
    font-size: 9px !important;
  }
  .profile-stats-card .profile-id-card span {
    font-size: 5.5px !important;
  }
  .profile-stats-card .profile-id-card button {
    min-height: 25px !important;
    padding: 4px 7px !important;
    font-size: 6px !important;
  }
  .profile-stats-card .profile-analytics {
    display: grid !important;
    grid-template-columns: minmax(120px, 0.8fr) minmax(170px, 1.2fr) !important;
    gap: 7px !important;
    align-items: stretch !important;
  }
  .profile-stats-card .radar-wrap {
    display: grid !important;
    min-height: 92px !important;
    height: 92px !important;
    padding: 2px !important;
    border-radius: 10px !important;
  }
  .profile-stats-card .radar-wrap canvas {
    display: block !important;
    width: 100% !important;
    height: 88px !important;
    max-height: 88px !important;
  }
  .profile-stats-card .profile-power-chart {
    gap: 4px !important;
    padding: 5px !important;
  }
  .profile-stats-card .profile-power-chart span {
    font-size: 5.5px !important;
  }
  .profile-stats-card .chart-track {
    height: 4px !important;
  }
  .profile-stats-card .stat-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 4px !important;
    margin-top: 5px !important;
  }
  .profile-stats-card .stat-grid > div {
    min-height: 35px !important;
    padding: 4px !important;
    border-radius: 8px !important;
  }
  .profile-stats-card .stat-grid small {
    font-size: 4.8px !important;
  }
  .profile-stats-card .stat-grid b {
    font-size: 9px !important;
  }
}
@media (max-width: 470px) and (orientation: portrait) {
  .profile-stats-card .profile-analytics {
    grid-template-columns: 1fr !important;
  }
  .profile-stats-card .radar-wrap {
    height: 82px !important;
    min-height: 82px !important;
  }
  .profile-stats-card .radar-wrap canvas {
    height: 78px !important;
    max-height: 78px !important;
  }
  .profile-stats-card .stat-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* v1.1 update centre and five-second release notice. */
.update-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(92, 218, 232, 0.22);
  background: linear-gradient(
    135deg,
    rgba(72, 204, 221, 0.12),
    rgba(255, 255, 255, 0.025)
  );
}
.update-version-row div {
  display: grid;
  gap: 3px;
}
.update-version-row small {
  font-size: 7px;
  letter-spacing: 0.16em;
  opacity: 0.55;
}
.update-version-row strong {
  font-size: 16px;
}
.update-version-row > span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(83, 220, 123, 0.14);
  color: #77e79d;
  font-size: 7px;
  letter-spacing: 0.12em;
}
.update-notes {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 12px 12px 12px 28px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 9px;
  line-height: 1.4;
}
.update-action {
  border-color: rgba(93, 224, 238, 0.35) !important;
  background: linear-gradient(
    135deg,
    rgba(59, 201, 221, 0.28),
    rgba(61, 126, 223, 0.18)
  ) !important;
}
.update-status {
  margin: 8px 0 0 !important;
  font-size: 8px !important;
  opacity: 0.62;
}
.game-update-notice {
  position: fixed;
  z-index: 115;
  right: 12px;
  top: max(12px, env(safe-area-inset-top));
  width: min(350px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: 10px;
  align-items: start;
  padding: 11px 11px 11px 13px;
  border: 1px solid rgba(111, 230, 242, 0.32);
  border-radius: 14px;
  background: linear-gradient(
    155deg,
    rgba(11, 27, 39, 0.97),
    rgba(5, 13, 21, 0.985)
  );
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.42),
    0 0 30px rgba(73, 211, 230, 0.07);
  color: #edfafa;
  transform: translateY(-140%);
  opacity: 0;
  transition: 0.28s;
}
.game-update-notice.show {
  transform: none;
  opacity: 1;
}
.game-update-notice div {
  display: grid;
  gap: 2px;
}
.game-update-notice small {
  font-size: 6px;
  letter-spacing: 0.18em;
  color: #73e4ef;
}
.game-update-notice strong {
  font-size: 13px;
}
.game-update-notice span {
  font-size: 8px;
  line-height: 1.4;
  opacity: 0.62;
}
.game-update-notice button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 17px;
}
.build-mode-hud {
  position: fixed;
  z-index: 28;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 16px);
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  align-items: center;
  min-width: 220px;
  padding: 8px 11px;
  border: 1px solid rgba(94, 255, 151, 0.32);
  border-radius: 12px;
  background: rgba(5, 26, 18, 0.86);
  color: #dffff0;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s;
  pointer-events: none;
}
.build-mode-hud.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.build-mode-hud span {
  font-size: 7px;
  letter-spacing: 0.15em;
  color: #6ff09d;
}
.build-mode-hud b {
  justify-self: end;
  font-size: 10px;
}
.build-mode-hud small {
  grid-column: 1/-1;
  font-size: 7px;
  opacity: 0.62;
}
@media (pointer: coarse), (max-width: 820px) {
  .settings-tabs {
    overflow: auto !important;
  }
  .settings-tab {
    min-height: 36px !important;
  }
  .game-update-notice {
    top: 8px;
    right: 8px;
    width: min(300px, calc(100vw - 16px));
    padding: 8px 8px 8px 10px;
  }
  .build-mode-hud {
    bottom: 8px;
    min-width: 180px;
    padding: 6px 8px;
  }
  .build-mode-hud small {
    font-size: 6px;
  }
}
