* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #071012;
  color: #edf4ef;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
}

.shell {
  position: relative;
  width: min(100vw, 1280px);
  height: min(100vh, 720px);
  height: min(100dvh, 720px);
  background: #111;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

#view3d,
#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#view3d {
  background: #151918;
}

#game {
  background: transparent;
  cursor: crosshair;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(7, 16, 18, 0.94), rgba(7, 16, 18, 0.55)),
    radial-gradient(circle at 82% 18%, rgba(237, 92, 45, 0.22), transparent 34%),
    radial-gradient(circle at 72% 88%, rgba(69, 179, 140, 0.18), transparent 30%);
}

.hidden {
  display: none;
}

.briefing {
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 34px;
  border: 1px solid rgba(237, 244, 239, 0.18);
  border-radius: 8px;
  background: rgba(9, 15, 16, 0.82);
  backdrop-filter: blur(14px);
}

.briefing.compact {
  width: min(500px, 100%);
}

.eyebrow {
  margin: 0 0 8px;
  color: #70d7a4;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: #fff8ec;
  font-size: clamp(48px, 8vw, 88px);
  line-height: 0.94;
}

h2 {
  font-size: clamp(40px, 7vw, 72px);
}

.subtitle {
  margin: 16px 0 24px;
  max-width: 520px;
  color: rgba(237, 244, 239, 0.78);
  font-size: 18px;
}

.deploy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.panel-label {
  margin: 0 0 8px;
  color: rgba(237, 244, 239, 0.64);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.room-bar {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 18px;
}

.room-bar label {
  display: grid;
  gap: 5px;
  color: rgba(237, 244, 239, 0.64);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.room-bar input {
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid rgba(237, 244, 239, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff8ec;
  font: inherit;
}

.net-status {
  min-width: 88px;
  color: rgba(237, 244, 239, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.loadout {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.loadout-card,
.weapon-card,
.spawn-card,
.map-card,
.attachment-card,
.secondary,
.primary {
  border: 0;
  color: inherit;
  font: inherit;
}

.loadout-card {
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(237, 244, 239, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  cursor: pointer;
}

.loadout-card span,
.weapon-card span,
.spawn-card span,
.map-card span,
.attachment-card span {
  display: block;
  margin-bottom: 8px;
  color: #fff8ec;
  font-weight: 800;
}

.loadout-card small,
.weapon-card small,
.spawn-card small,
.map-card small,
.attachment-card small {
  display: block;
  color: rgba(237, 244, 239, 0.7);
  line-height: 1.35;
}

.loadout-card.selected,
.weapon-card.selected,
.spawn-card.selected,
.map-card.selected,
.attachment-card.selected {
  border-color: #70d7a4;
  background: rgba(112, 215, 164, 0.13);
}

.weapon-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 236px;
  overflow: auto;
  padding-right: 2px;
}

.map-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.weapon-card,
.spawn-card,
.map-card,
.attachment-card {
  min-height: 66px;
  padding: 10px;
  border: 1px solid rgba(237, 244, 239, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  cursor: pointer;
}

.spawn-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.spawn-card.unavailable {
  cursor: not-allowed;
  opacity: 0.43;
}

.attachment-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.attachment-group {
  display: grid;
  gap: 6px;
}

.attachment-group > span {
  color: rgba(237, 244, 239, 0.6);
  font-size: 11px;
  font-weight: 900;
}

.attachment-card {
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(237, 244, 239, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  cursor: pointer;
}

.weapon-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: rgba(237, 244, 239, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.weapon-stats span {
  padding: 6px 8px;
  border: 1px solid rgba(237, 244, 239, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.secondary {
  height: 38px;
  padding: 0 13px;
  border-radius: 6px;
  background: rgba(112, 215, 164, 0.16);
  color: #edf4ef;
  font-weight: 900;
  cursor: pointer;
}

.primary {
  width: 180px;
  height: 48px;
  border-radius: 6px;
  background: #ed5c2d;
  color: #fff8ec;
  font-weight: 900;
  cursor: pointer;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.keys span {
  padding: 7px 9px;
  border: 1px solid rgba(237, 244, 239, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(237, 244, 239, 0.72);
  font-size: 13px;
}

.keybind-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.keybind-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid rgba(237, 244, 239, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.keybind-card span {
  color: rgba(237, 244, 239, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.keybind-card button {
  min-width: 58px;
  height: 30px;
  border: 1px solid rgba(112, 215, 164, 0.28);
  border-radius: 6px;
  background: rgba(7, 16, 18, 0.58);
  color: #fff8ec;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.keybind-card button.listening {
  border-color: #ed5c2d;
  color: #ffd0c2;
}

.rotate-prompt {
  display: none;
}

.touch-controls {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
}

.touch-device {
  place-items: stretch;
}

.touch-device .shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-shadow: none;
}

.touch-device .touch-controls {
  display: block;
}

.touch-device .overlay:not(.hidden) ~ .touch-controls {
  display: none;
}

.touch-move,
.touch-actions {
  pointer-events: auto;
  position: absolute;
}

.touch-move {
  left: max(28px, env(safe-area-inset-left));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: 216px;
  height: 112px;
  border: 1px solid rgba(237, 244, 239, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(237, 244, 239, 0.13) 49% 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(237, 244, 239, 0.13) 49% 51%, transparent 51%),
    rgba(7, 16, 18, 0.24);
  backdrop-filter: blur(4px);
}

.touch-actions {
  right: max(18px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 286px;
  height: 238px;
}

.move-track,
.move-knob,
.touch-actions button {
  position: absolute;
}

.move-track {
  inset: 8px;
  border: 1px solid rgba(237, 244, 239, 0.15);
  border-radius: 999px;
  background: rgba(237, 244, 239, 0.055);
}

.move-knob {
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(237, 244, 239, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 38%, rgba(255, 255, 255, 0.22), transparent 30%),
    rgba(237, 244, 239, 0.16);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  touch-action: none;
}

.touch-controls button {
  min-width: 0;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(237, 244, 239, 0.27);
  border-radius: 50%;
  background: rgba(7, 16, 18, 0.58);
  color: #fff8ec;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  touch-action: none;
  user-select: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(7px);
}

.touch-controls button:active {
  background: rgba(112, 215, 164, 0.32);
  border-color: #70d7a4;
  transform: scale(0.96);
}

.touch-actions .action-fire {
  right: 12px;
  bottom: 8px;
  width: 92px;
  height: 92px;
  border-color: rgba(237, 92, 45, 0.78);
  background: rgba(237, 92, 45, 0.34);
  font-size: 18px;
}

.touch-actions .action-ads {
  right: 126px;
  bottom: 60px;
  width: 66px;
  height: 66px;
}

.touch-actions .action-reload {
  right: 108px;
  bottom: 0;
}

.touch-actions .action-kit {
  right: 64px;
  bottom: 112px;
}

.touch-actions .action-revive {
  right: 0;
  bottom: 114px;
}

.touch-actions .action-deploy {
  right: 178px;
  bottom: 14px;
  width: 58px;
  height: 58px;
}

.touch-actions .action-map {
  right: 194px;
  bottom: 86px;
  width: 58px;
  height: 58px;
  border-color: rgba(79, 177, 255, 0.48);
}

.touch-actions .action-giveup {
  right: 150px;
  bottom: 128px;
  width: 58px;
  height: 58px;
  color: #ffd0c2;
  border-color: rgba(237, 92, 45, 0.46);
}

@media (hover: none) and (pointer: coarse) {
  .shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    box-shadow: none;
  }

  .overlay {
    padding: 10px;
    place-items: stretch;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .briefing {
    max-height: none;
    padding: 16px;
    overflow: visible;
  }

  h1,
  h2 {
    font-size: 40px;
  }

  .subtitle {
    margin: 10px 0 14px;
    font-size: 14px;
  }

  .loadout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .deploy-grid,
  .room-bar {
    grid-template-columns: 1fr;
  }

  .weapon-list,
  .attachment-list,
  .map-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .keys {
    display: none;
  }

  .primary {
    width: 100%;
  }
}

.touch-device .rotate-prompt {
  display: none;
}

@media (orientation: portrait) {
  .touch-device .rotate-prompt {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: grid;
    place-items: center;
    background: rgba(7, 16, 18, 0.84);
    color: #fff8ec;
    font-size: 22px;
    font-weight: 900;
  }

  .touch-device .rotate-prompt div {
    padding: 16px 22px;
    border: 1px solid rgba(237, 244, 239, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
  }
}

@media (orientation: landscape) {
  .touch-device .rotate-prompt {
    display: none;
  }

  .touch-device .briefing {
    max-height: calc(100dvh - 20px);
    overflow: auto;
  }

  .touch-device .keybind-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (hover: none) and (pointer: coarse) and (max-width: 760px) {
  .touch-move {
    left: max(14px, env(safe-area-inset-left));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 184px;
    height: 96px;
  }

  .touch-controls button {
    width: 48px;
    height: 48px;
    font-size: 13px;
  }

  .move-knob {
    width: 52px;
    height: 52px;
  }

  .touch-actions {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: 244px;
    height: 214px;
  }

  .touch-actions .action-fire {
    right: 8px;
    bottom: 6px;
    width: 80px;
    height: 80px;
    font-size: 16px;
  }

  .touch-actions .action-ads {
    right: 108px;
    bottom: 54px;
    width: 58px;
    height: 58px;
  }

  .touch-actions .action-reload {
    right: 94px;
    bottom: 0;
  }

  .touch-actions .action-kit {
    right: 56px;
    bottom: 102px;
  }

  .touch-actions .action-revive {
    right: 0;
    bottom: 104px;
  }

  .touch-actions .action-deploy {
    right: 154px;
    bottom: 10px;
  }

  .touch-actions .action-map {
    right: 166px;
    bottom: 80px;
  }

  .touch-actions .action-giveup {
    right: 132px;
    bottom: 118px;
  }
}
