:root {
  color-scheme: dark;
  --ink: #06141d;
  --panel: rgba(8, 28, 39, 0.9);
  --cream: #fff3cf;
  --lime: #b8f43d;
  --lime-dark: #5fac2c;
  --orange: #ff6b2c;
  --orange-light: #ffad31;
  --teal: #2ed9c3;
  --blue: #1785da;
  --danger: #ff3f56;
  --white: #fffefa;
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  user-select: none;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  pointer-events: auto;
}

#game-shell,
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#game {
  display: block;
  background: linear-gradient(#7ce0e8, #c4f0c1);
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.screen.is-visible {
  display: flex;
}

#menu {
  overflow: hidden;
  align-items: center;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(3, 18, 28, 0.98) 0%, rgba(5, 28, 37, 0.92) 47%, rgba(5, 25, 35, 0.32) 70%, rgba(5, 25, 35, 0.1) 100%),
    radial-gradient(circle at 75% 35%, #e5f453 0 12%, #4ecaa8 45%, #0978a9 100%);
}

.menu-noise {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, black, transparent 82%);
}

.menu-copy {
  position: relative;
  z-index: 2;
  width: min(610px, 49vw);
  margin-left: clamp(32px, 7vw, 124px);
  padding: 24px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 44, 0.16);
}

h1 {
  margin: 0;
  max-width: 600px;
  color: var(--cream);
  font-size: clamp(3.7rem, 7vw, 7.6rem);
  font-style: italic;
  font-weight: 1000;
  line-height: 0.78;
  letter-spacing: -0.075em;
  text-shadow: 0 7px 0 #082e3a, 0 15px 32px rgba(0, 0, 0, 0.45);
  transform: skew(-4deg);
}

h1 span {
  display: block;
  color: var(--lime);
  font-size: 0.93em;
}

.tagline {
  margin: 24px 0 20px;
  color: #bde9e4;
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  font-weight: 750;
  letter-spacing: 0.015em;
}

.match-card {
  width: min(520px, 100%);
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(8, 31, 41, 0.83);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.match-card-title {
  margin-bottom: 12px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.match-card > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 9px 0 6px;
  color: #c6dcdf;
  font-size: 0.88rem;
  font-weight: 800;
}

.arena-picker {
  min-width: 0;
  margin: 12px 0 10px;
  padding: 0;
  border: 0;
}

.arena-picker legend {
  margin-bottom: 7px;
  padding: 0;
  color: #c6dcdf;
  font-size: 0.88rem;
  font-weight: 800;
}

.arena-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.arena-card {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.arena-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.arena-card-body {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 4px 4px 7px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.arena-card canvas {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 6px;
  border-radius: 6px;
  background: #275d68;
}

.arena-card strong,
.arena-card small {
  display: block;
  overflow: hidden;
  padding: 0 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-card strong {
  color: #eaf5e7;
  font-size: 0.67rem;
  font-weight: 950;
}

.arena-card small {
  margin-top: 1px;
  color: rgba(210, 234, 230, 0.5);
  font-size: 0.54rem;
  font-weight: 750;
}

.arena-card i {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #153214;
  background: var(--lime);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 1000;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 140ms ease, transform 140ms ease;
}

.arena-card:hover .arena-card-body {
  border-color: rgba(184, 244, 61, 0.4);
  background: rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.arena-card input:checked + .arena-card-body {
  border-color: var(--lime);
  background: rgba(184, 244, 61, 0.1);
  box-shadow: 0 0 0 1px rgba(184, 244, 61, 0.18), 0 8px 18px rgba(0, 0, 0, 0.17);
}

.arena-card input:checked + .arena-card-body i {
  opacity: 1;
  transform: scale(1);
}

.arena-card input:focus-visible + .arena-card-body {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.match-card output {
  min-width: 64px;
  color: var(--lime);
  text-align: right;
}

select {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  color: var(--white);
  background: #123846;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  height: 7px;
  margin: 2px 0 7px;
  border-radius: 10px;
  appearance: none;
  background: linear-gradient(90deg, var(--lime) 0 25%, #264c56 25% 100%);
}

input[type="range"]::-webkit-slider-thumb {
  width: 19px;
  height: 19px;
  border: 3px solid #fff;
  border-radius: 50%;
  appearance: none;
  background: var(--lime-dark);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.4);
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  color: #10240f;
  background: linear-gradient(135deg, #d7fa50, #8bd332);
  box-shadow: 0 6px 0 #458c2b, 0 13px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 1000;
  letter-spacing: 0.11em;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.primary-button:active {
  box-shadow: 0 2px 0 #458c2b, 0 6px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(4px);
}

.primary-button kbd {
  color: rgba(16, 36, 15, 0.55);
}

kbd {
  display: inline-grid;
  min-width: 25px;
  min-height: 22px;
  place-items: center;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  color: #e9f5f0;
  background: rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.17);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 21px;
  color: rgba(222, 242, 238, 0.58);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.controls-row span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.menu-art {
  position: absolute;
  z-index: 1;
  top: 4vh;
  right: -1vw;
  width: min(56vw, 880px);
  height: 96vh;
  pointer-events: none;
}

.menu-art img {
  position: absolute;
  z-index: 2;
  right: 5%;
  bottom: -3%;
  width: min(52vw, 790px);
  height: 96%;
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(-22px 24px 22px rgba(2, 24, 29, 0.4));
}

.sunburst {
  position: absolute;
  z-index: 0;
  top: 4%;
  right: -10%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.42;
  background: repeating-conic-gradient(from 2deg, rgba(255, 255, 190, 0.8) 0 8deg, transparent 8deg 18deg);
  animation: spin 80s linear infinite;
}

.player-shadow {
  position: absolute;
  right: 10%;
  bottom: 1%;
  width: 67%;
  height: 9%;
  border-radius: 50%;
  background: rgba(2, 20, 24, 0.34);
  filter: blur(12px);
}

.sticker {
  position: absolute;
  z-index: 3;
  right: 9%;
  bottom: 7%;
  display: grid;
  width: 120px;
  aspect-ratio: 1;
  place-content: center;
  border: 4px solid #082f3f;
  border-radius: 50%;
  color: #072939;
  background: var(--orange-light);
  box-shadow: 0 6px 0 rgba(7, 41, 57, 0.35);
  font-size: 1.25rem;
  font-weight: 1000;
  line-height: 0.9;
  text-align: center;
  transform: rotate(9deg);
}

.sticker small {
  font-size: 0.52rem;
  letter-spacing: 0.06em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  pointer-events: none;
  color: var(--white);
}

.hud.is-visible {
  display: block;
}

.hud-top {
  position: absolute;
  top: 18px;
  left: 50%;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  transform: translateX(-50%);
}

.score-strip {
  display: flex;
  gap: 5px;
  min-height: 44px;
}

.score-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 78px;
  padding: 7px 11px;
  border-top: 3px solid var(--chip-color);
  border-radius: 5px 5px 9px 9px;
  background: rgba(4, 23, 32, 0.78);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(9px);
}

.score-chip.is-player {
  background: rgba(167, 228, 54, 0.88);
  color: #0c2d21;
}

.score-chip span {
  max-width: 65px;
  overflow: hidden;
  font-size: 0.66rem;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.score-chip strong {
  margin-left: auto;
  font-size: 1.12rem;
}

.clock-card {
  display: grid;
  min-width: 76px;
  padding: 5px 12px 7px;
  border-radius: 8px;
  background: rgba(4, 23, 32, 0.9);
  text-align: center;
}

.clock-card span {
  color: #78c7c6;
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.clock-card strong {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.event-feed {
  position: absolute;
  top: 82px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.event-item {
  padding: 5px 9px;
  border-right: 3px solid var(--orange);
  border-radius: 5px 0 0 5px;
  background: rgba(4, 23, 32, 0.68);
  font-size: 0.7rem;
  font-weight: 800;
  animation: event-in 220ms ease both;
}

@keyframes event-in {
  from { opacity: 0; transform: translateX(15px); }
}

.announcement {
  position: absolute;
  top: 24%;
  left: 50%;
  color: var(--lime);
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-style: italic;
  font-weight: 1000;
  letter-spacing: -0.04em;
  text-align: center;
  text-shadow: 0 5px 0 #103528, 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7) rotate(-3deg);
}

.announcement.pop {
  animation: announcement 1.25s ease both;
}

@keyframes announcement {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55) rotate(-5deg); }
  18%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1.08) rotate(-1deg); }
}

.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
}

.crosshair i {
  position: absolute;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.crosshair i:nth-child(1),
.crosshair i:nth-child(2) { top: 19px; width: 8px; height: 2px; }
.crosshair i:nth-child(1) { left: 3px; }
.crosshair i:nth-child(2) { right: 3px; }
.crosshair i:nth-child(3),
.crosshair i:nth-child(4) { left: 19px; width: 2px; height: 8px; }
.crosshair i:nth-child(3) { top: 3px; }
.crosshair i:nth-child(4) { bottom: 3px; }

#hit-marker::before,
#hit-marker::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 11px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  opacity: 0;
  transform: rotate(45deg);
}

#hit-marker::after { transform: rotate(-45deg); }
#hit-marker.active::before,
#hit-marker.active::after { animation: hit 190ms ease; }
#hit-marker.head::before,
#hit-marker.head::after { background: var(--orange-light); }

@keyframes hit {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; transform: rotate(45deg) scale(1.3); }
}

.hud-bottom {
  position: absolute;
  right: 25px;
  bottom: 23px;
  left: 25px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.vitals-panel,
.ammo-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(4, 23, 32, 0.76);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.vitals-panel {
  width: 220px;
  padding: 10px 12px;
}

.vitals-head,
.meter-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.vitals-head span,
.ammo-panel > span {
  color: #8fd7d2;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.vitals-head strong {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.meter {
  height: 9px;
  margin: 5px 0;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
}

.meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #75cc36, #d4f64b);
  transition: width 150ms ease, background 150ms ease;
}

.meter-label {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.51rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ammo-panel {
  min-width: 138px;
  padding: 9px 13px;
  text-align: right;
}

.ammo-panel strong {
  margin-left: 14px;
  font-size: 2.1rem;
  line-height: 1;
}

.ammo-panel small {
  color: rgba(255, 255, 255, 0.44);
  font-weight: 800;
}

.reload-label {
  margin-top: 3px;
  color: var(--orange-light);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.reload-label.is-urgent {
  animation: reload-pulse 700ms ease-in-out infinite alternate;
}

@keyframes reload-pulse {
  to { color: #fff2bf; }
}

.damage-flash {
  position: absolute;
  inset: 0;
  border: 0 solid rgba(255, 48, 63, 0);
  box-shadow: inset 0 0 90px rgba(255, 37, 53, 0);
  transition: border 160ms ease, box-shadow 160ms ease;
}

.damage-flash.active {
  border-width: 12px;
  border-color: rgba(255, 74, 45, 0.32);
  box-shadow: inset 0 0 150px rgba(255, 37, 53, 0.42);
}

.modal-screen {
  z-index: 30;
  align-items: center;
  justify-content: center;
  background: rgba(3, 16, 23, 0.72);
  backdrop-filter: blur(11px);
}

.modal-card {
  width: min(420px, calc(100vw - 36px));
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 21px;
  color: #fff;
  background: linear-gradient(150deg, #103642, #071a25);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.48);
  text-align: center;
}

.modal-card .eyebrow {
  justify-content: center;
}

.modal-card h2 {
  margin: 0;
  color: var(--lime);
  font-size: 3rem;
  font-style: italic;
  font-weight: 1000;
  letter-spacing: -0.05em;
}

.modal-card p {
  color: #a8c9c8;
}

.text-button {
  margin-top: 16px;
  border: 0;
  color: #9ec4c3;
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.respawn-screen {
  z-index: 25;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(10, 16, 22, 0.58);
  backdrop-filter: grayscale(0.8) blur(3px);
  text-align: center;
}

.respawn-screen div {
  display: grid;
}

.respawn-screen span {
  color: var(--orange-light);
  font-size: 1rem;
  font-weight: 1000;
  letter-spacing: 0.18em;
}

.respawn-screen strong {
  font-size: 8rem;
  font-style: italic;
  line-height: 0.95;
  text-shadow: 0 8px 0 #103541;
}

.respawn-screen small {
  color: #b5cfce;
  font-size: 0.85rem;
  font-weight: 800;
}

.results-list {
  display: grid;
  gap: 6px;
  margin: 20px 0;
  padding: 0;
  list-style-position: inside;
}

.results-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-left: 4px solid var(--result-color);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
  font-weight: 850;
}

.pointer-hint {
  position: fixed;
  z-index: 14;
  bottom: 92px;
  left: 50%;
  display: none;
  padding: 8px 13px;
  border-radius: 7px;
  color: #d9eeea;
  background: rgba(5, 24, 33, 0.82);
  font-size: 0.69rem;
  font-weight: 850;
  transform: translateX(-50%);
}

.pointer-hint.is-visible { display: block; }

.loading {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #d9eeea;
  background: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.loading.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loading span {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

#mobile-notice {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  place-items: center;
  padding: 30px;
  color: var(--cream);
  background: #071a26;
  font-size: 1.15rem;
  font-weight: 850;
  text-align: center;
}

@media (max-width: 800px) {
  .menu-copy { width: calc(100vw - 48px); margin-left: 24px; }
  .menu-art { opacity: 0.22; width: 100vw; }
  .menu-art img { width: 100vw; }
  .sticker { display: none; }
  .score-chip { min-width: 51px; padding: 6px; }
  .score-chip span { display: none; }
}

@media (hover: none) and (pointer: coarse) {
  #mobile-notice { display: grid; }
}

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