:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #f5ead6;
  background: #0d0d0c;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #0d0d0c;
}

button,
input {
  font: inherit;
}

#app {
  position: fixed;
  inset: 0;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

#reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.84;
}

#reticle::before,
#reticle::after {
  position: absolute;
  content: "";
  background: rgba(245, 234, 214, 0.9);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.65);
}

#reticle::before {
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
}

#reticle::after {
  left: 0;
  top: 8px;
  width: 18px;
  height: 2px;
}

html.is-scoped #reticle {
  opacity: 0;
}

#scope-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(20, 20, 20, 0.84) calc(50% - 1px), rgba(20, 20, 20, 0.84) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(transparent calc(50% - 1px), rgba(20, 20, 20, 0.84) calc(50% - 1px), rgba(20, 20, 20, 0.84) calc(50% + 1px), transparent calc(50% + 1px)),
    radial-gradient(circle at 50% 50%, transparent min(42vh, 42vw), rgba(0, 0, 0, 0.94) calc(min(42vh, 42vw) + 2px));
}

html.is-scoped #scope-overlay {
  display: block;
}

#topbar {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(245, 234, 214, 0.9);
  font-size: 13px;
  font-weight: 750;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.topbar-right {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

#hud {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1;
  display: flex;
  align-items: end;
  gap: 8px;
  pointer-events: none;
}

.hud-money {
  min-width: 86px;
  padding: 6px 8px;
  color: #e7b13e;
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.86);
}

.hud-pill {
  min-width: 78px;
  min-height: 44px;
  display: grid;
  gap: 2px;
  padding: 5px 9px;
  border: 0;
  border-radius: 2px;
  background: rgba(16, 16, 12, 0.42);
  color: #f3c04c;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.hud-pill span {
  color: rgba(236, 183, 72, 0.86);
  font-size: 9px;
  font-weight: 900;
}

.hud-pill strong {
  font-size: 22px;
  line-height: 1;
}

.hud-pill.weapon {
  min-width: 130px;
}

#player-tag {
  position: fixed;
  left: 18px;
  bottom: 70px;
  z-index: 1;
  padding: 5px 8px;
  border-radius: 5px;
  color: rgba(245, 234, 214, 0.9);
  background: rgba(15, 13, 10, 0.56);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

#killfeed {
  position: fixed;
  right: 16px;
  top: 44px;
  z-index: 1;
  display: grid;
  gap: 6px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.killfeed-row {
  justify-self: end;
  max-width: 100%;
  padding: 7px 9px;
  border-radius: 5px;
  color: #fff2d6;
  background: rgba(10, 9, 7, 0.72);
  font-size: 12px;
  font-weight: 850;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.killfeed-row .weapon {
  color: #f2d29a;
}

#scoreboard {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}

#scoreboard.is-visible {
  display: flex;
}

.scoreboard-shell {
  width: min(820px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid rgba(220, 224, 218, 0.34);
  border-radius: 2px;
  background: rgba(10, 13, 14, 0.76);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}

.scoreboard-title {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  color: #f2eee0;
  background: rgba(18, 26, 30, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.score-team {
  padding: 7px 10px;
  color: #f3ecd8;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-team.is-t {
  background: rgba(91, 61, 32, 0.78);
}

.score-team.is-ct {
  background: rgba(35, 59, 92, 0.78);
}

.score-row {
  display: grid;
  grid-template-columns: 38px 1fr 64px 64px 72px;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-top: 1px solid rgba(245, 234, 214, 0.08);
  color: rgba(245, 234, 214, 0.88);
  font-size: 13px;
  font-weight: 760;
}

.score-row.is-self {
  color: #fff4d8;
  background: rgba(198, 151, 45, 0.34);
}

.score-row span:not(.score-name) {
  text-align: right;
}

.score-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#weapon-view {
  position: fixed;
  right: 44px;
  bottom: 18px;
  z-index: 1;
  width: min(360px, 32vw);
  height: 122px;
  pointer-events: none;
  transform-origin: right bottom;
}

#weapon-view.is-firing {
  animation: weapon-kick 95ms ease-out;
}

.weapon-body {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 72px;
  border: 2px solid rgba(20, 16, 12, 0.9);
  border-radius: 8px 8px 18px 18px;
  background:
    linear-gradient(90deg, rgba(55, 38, 22, 0.96), rgba(22, 18, 14, 0.98) 45%, rgba(80, 58, 36, 0.96)),
    #241b13;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
  transform: skewX(-12deg);
}

.weapon-body::before {
  position: absolute;
  right: -34px;
  top: 20px;
  width: 68px;
  height: 12px;
  content: "";
  border-radius: 0 8px 8px 0;
  background: #191611;
}

.weapon-body::after {
  position: absolute;
  left: 64px;
  bottom: -44px;
  width: 44px;
  height: 66px;
  content: "";
  border-radius: 5px;
  background: linear-gradient(#2a2118, #11100d);
  transform: skewX(10deg);
}

.weapon-body span {
  position: absolute;
  left: 18px;
  top: 19px;
  color: rgba(245, 234, 214, 0.82);
  font-size: 13px;
  font-weight: 900;
  transform: skewX(12deg);
}

@keyframes weapon-kick {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(10px, 8px) rotate(1.4deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

#gate,
#loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(18, 16, 12, 0.48), rgba(18, 16, 12, 0.68)),
    transparent;
}

#gate {
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

#gate.is-visible {
  opacity: 1;
  pointer-events: auto;
}

#loading {
  z-index: 3;
  color: rgba(245, 234, 214, 0.9);
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

#loading.is-hidden {
  display: none;
}

#loading.is-error {
  padding: 14px 18px;
  border: 1px solid rgba(255, 210, 154, 0.34);
  border-radius: 6px;
  background: rgba(16, 12, 8, 0.78);
}

#menu {
  width: min(980px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
}

#auth-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(245, 234, 214, 0.22);
  border-radius: 8px;
  background: rgba(15, 13, 10, 0.72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.brand-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.brand-strip img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.brand-strip div {
  display: grid;
  gap: 2px;
}

.brand-strip strong {
  color: #fff5dd;
  font-size: 16px;
}

.brand-strip span {
  color: rgba(245, 234, 214, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.auth-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
}

.auth-controls input,
.auth-controls button {
  min-height: 40px;
  border: 1px solid rgba(245, 234, 214, 0.24);
  border-radius: 6px;
}

.auth-controls input {
  padding: 0 11px;
  color: #fff2d6;
  background: rgba(6, 5, 4, 0.62);
  outline: none;
}

.auth-controls input:focus {
  border-color: rgba(242, 210, 154, 0.82);
}

.auth-controls button,
.team-card {
  color: #191610;
  background: #f2d29a;
  font-weight: 900;
  cursor: pointer;
}

.auth-controls button:hover,
.team-card:hover {
  background: #ffe0a7;
}

.auth-controls button:disabled,
.team-card:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

#auth-status {
  min-height: 16px;
  margin: 0;
  color: rgba(245, 234, 214, 0.72);
  font-size: 12px;
  font-weight: 750;
}

#team-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.team-card {
  position: relative;
  min-height: clamp(270px, 40vw, 500px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(245, 234, 214, 0.2);
  border-radius: 8px;
  background: #15120e;
  color: #fff3d8;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

.team-card::after {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  content: "";
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(9, 8, 6, 0.86));
}

.team-card img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
}

.team-card span {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 1;
  display: block;
  color: #fff3d8;
  font-size: clamp(19px, 2.6vw, 28px);
  font-weight: 950;
  text-align: left;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
}

.team-card:active {
  transform: translateY(1px);
}

#buy-menu {
  display: none;
  width: min(1040px, calc(100vw - 36px));
  min-height: min(650px, calc(100vh - 48px));
  padding: 0 0 18px;
  border-radius: 7px;
  color: #e8e2d3;
  background: rgba(10, 10, 10, 0.74);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

#gate.is-buying #auth-panel,
#gate.is-buying #team-select {
  display: none;
}

#gate.is-buying #buy-menu {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.buy-title {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 90px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(190, 220, 225, 0.78);
  background: linear-gradient(90deg, rgba(14, 16, 18, 0.9), rgba(24, 28, 31, 0.72));
}

.buy-title strong {
  color: #f6f2e6;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: 0;
}

.buy-icon {
  width: 38px;
  height: 54px;
  display: block;
  background:
    linear-gradient(90deg, transparent 0 22px, #f6f2e6 22px 31px, transparent 31px),
    linear-gradient(145deg, transparent 0 21px, #f6f2e6 21px 31px, transparent 31px),
    linear-gradient(35deg, transparent 0 22px, #f6f2e6 22px 31px, transparent 31px);
  transform: skewX(-8deg);
}

.buy-content {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 44px);
  padding: 34px 38px 16px;
}

.weapon-list {
  display: grid;
  align-content: start;
  gap: 9px;
}

.weapon-list button,
#buy-confirm {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(185, 167, 128, 0.3);
  border-radius: 0;
  color: rgba(242, 236, 218, 0.78);
  background: rgba(10, 10, 9, 0.46);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.weapon-list button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.weapon-list .is-selected {
  color: #fff4dc;
  background: rgba(184, 135, 29, 0.88);
}

.weapon-list [data-buy-cancel] {
  margin-top: 92px;
}

.weapon-details {
  min-width: 0;
}

.weapon-preview {
  position: relative;
  height: min(180px, 24vh);
  margin-bottom: 24px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.78);
}

#weapon-preview-render canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#weapon-view.has-model .weapon-body {
  display: none;
}

.weapon-details dl {
  display: grid;
  grid-template-columns: minmax(160px, 0.65fr) minmax(160px, 1fr);
  gap: 8px 28px;
  margin: 0;
  font-size: 13px;
  font-weight: 760;
}

.weapon-details dt {
  color: rgba(242, 236, 218, 0.86);
}

.weapon-details dd {
  margin: 0;
  color: rgba(242, 236, 218, 0.74);
}

#buy-confirm {
  justify-self: end;
  margin: 0 38px;
  min-width: 150px;
  color: #17120d;
  background: #d2a23c;
  text-align: center;
}

#buy-confirm:hover,
.weapon-list button:not(:disabled):hover {
  filter: brightness(1.12);
}

#notice {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 4;
  max-width: min(520px, calc(100vw - 32px));
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(245, 234, 214, 0.24);
  border-radius: 6px;
  color: #fff4dc;
  background: rgba(20, 17, 13, 0.82);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

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

@media (max-width: 760px) {
  #gate {
    align-items: start;
    overflow: auto;
    padding: 12px;
  }

  #topbar {
    left: 12px;
    right: 12px;
    top: 12px;
    font-size: 12px;
  }

  #hud {
    left: 12px;
    bottom: 12px;
    gap: 6px;
  }

  .hud-pill {
    min-width: 62px;
    min-height: 40px;
    padding: 6px 8px;
  }

  .hud-pill strong {
    font-size: 18px;
  }

  #weapon-view {
    right: 16px;
    bottom: 66px;
    width: 210px;
    height: 92px;
  }

  #menu {
    width: min(430px, calc(100vw - 24px));
    gap: 12px;
    align-self: start;
    margin: 0 auto;
  }

  .auth-controls {
    grid-template-columns: 1fr;
  }

  #team-select {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .team-card {
    min-height: 176px;
  }

  #buy-menu {
    max-height: calc(100vh - 24px);
    overflow: auto;
  }

  .buy-title {
    min-height: 68px;
    padding: 0 16px;
  }

  .buy-title strong {
    font-size: 18px;
  }

  .buy-content {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 16px 12px;
  }

  .weapon-list [data-buy-cancel] {
    margin-top: 16px;
  }

  .weapon-preview {
    height: 128px;
    margin-bottom: 16px;
  }

  .weapon-details dl {
    grid-template-columns: 1fr 1fr;
    gap: 7px 14px;
    font-size: 12px;
  }

  #buy-confirm {
    justify-self: stretch;
    margin: 0 16px 16px;
  }

  .score-row {
    grid-template-columns: 28px 1fr 48px 54px 56px;
    gap: 5px;
    font-size: 12px;
  }
}
