:root {
  --bg: #050b11;
  --bg-soft: #0b1622;
  --panel: rgba(9, 19, 30, 0.92);
  --panel-strong: rgba(7, 14, 23, 0.96);
  --line: rgba(162, 201, 255, 0.16);
  --line-strong: rgba(162, 201, 255, 0.28);
  --text: #f4f8ff;
  --muted: #94a7bf;
  --yellow: #ecff4f;
  --yellow-deep: #d4b510;
  --cyan: #56d8ff;
  --cyan-deep: #13678c;
  --red: #ff667e;
  --red-deep: #5b1324;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Bricolage Grotesque", sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(236, 255, 79, 0.14), transparent 22%),
    radial-gradient(circle at 82% 10%, rgba(86, 216, 255, 0.16), transparent 20%),
    linear-gradient(180deg, #09111a 0%, #04070c 100%);
  user-select: none;
  -webkit-user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
  opacity: 0.6;
}

input,
button {
  font: inherit;
}

input {
  user-select: text;
  -webkit-user-select: text;
}

.app-shell {
  width: min(1380px, 94vw);
  margin: 0 auto;
  padding: 28px 0 36px;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow:
    0 24px 48px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 45%);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr minmax(320px, 380px);
  gap: 22px;
  padding: 28px;
}

.hero__copy {
  display: grid;
  gap: 10px;
  align-content: start;
}

.eyebrow,
.panel-kicker,
.overlay__tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(3.6rem, 8vw, 6.6rem);
  letter-spacing: -0.04em;
  line-height: 0.92;
}

h2 {
  font-size: 1.8rem;
  line-height: 1.06;
}

.hero__sub,
.status-line,
.leaderboard-status,
.legend-list span,
.overlay p {
  color: var(--muted);
}

.hero__sub {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
}

.control-card {
  display: grid;
  gap: 16px;
  align-content: end;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(86, 216, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--panel-strong);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input::placeholder {
  color: rgba(148, 167, 191, 0.72);
}

.field input:focus {
  border-color: rgba(86, 216, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(86, 216, 255, 0.12);
}

.control-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.start-button,
.ghost-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.start-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.start-button {
  flex: 1;
  min-height: 54px;
  padding: 0 20px;
  border-radius: 16px;
  font-weight: 800;
  color: #0b1015;
  background: linear-gradient(135deg, var(--yellow), #fff18a 60%, #ffcf4a);
  box-shadow: 0 14px 26px rgba(236, 255, 79, 0.18);
}

.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.pressure-pill,
.hud-pill {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.pressure-pill {
  min-width: 116px;
  padding: 11px 14px;
  display: grid;
  gap: 2px;
}

.pressure-pill span,
.hud-pill span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pressure-pill strong,
.hud-pill strong {
  font-size: 1.3rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.72fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.game-card {
  padding: 18px;
}

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

.hud-pill {
  padding: 14px 16px;
}

.hud-pill--time.is-warning {
  border-color: rgba(255, 102, 126, 0.4);
  background: rgba(255, 102, 126, 0.08);
}

.arena {
  position: relative;
  min-height: 700px;
  margin-top: 14px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 6%, rgba(255, 255, 255, 0.06), transparent 26%),
    linear-gradient(180deg, rgba(86, 216, 255, 0.04), rgba(0, 0, 0, 0) 18%),
    linear-gradient(180deg, #101d2c 0%, #0d1722 48%, #071019 100%);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.arena::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

.arena__lights,
.arena__floor,
.layer {
  position: absolute;
  inset: 0;
}

.arena__lights,
.arena__floor {
  pointer-events: none;
}

.arena__lights {
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at 80% 8%, rgba(255, 255, 255, 0.08), transparent 18%);
}

.arena__floor {
  top: auto;
  height: 170px;
  background:
    linear-gradient(180deg, rgba(236, 255, 79, 0), rgba(236, 255, 79, 0.05)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.3));
}

.crosshair {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 6px rgba(86, 216, 255, 0.08),
    0 0 28px rgba(86, 216, 255, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, 0.88);
  transform: translate(-50%, -50%);
}

.crosshair::before {
  width: 2px;
  height: 30px;
}

.crosshair::after {
  width: 30px;
  height: 2px;
}

.pee-stream {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 12px;
  opacity: 0;
  border-radius: 999px;
  transform-origin: 0 50%;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 241, 103, 0.98), rgba(255, 255, 255, 0.14)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0) 10px,
      rgba(255, 255, 255, 0.2) 10px,
      rgba(255, 255, 255, 0.2) 18px
    );
  box-shadow:
    0 0 22px rgba(236, 255, 79, 0.35),
    0 0 8px rgba(255, 255, 255, 0.18) inset;
}

.pee-stream::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  animation: stream-shift 0.9s linear infinite;
}

.pee-stream.is-on {
  opacity: 0.97;
}

.player {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 130px;
  height: 244px;
  transform: translateX(-50%);
  pointer-events: none;
}

.player__head,
.player__torso,
.player__arm,
.player__leg,
.player__shoe {
  position: absolute;
}

.player__head {
  left: 50%;
  top: 8px;
  width: 56px;
  height: 56px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd8b5, #efb387);
  border: 2px solid rgba(0, 0, 0, 0.12);
}

.player__head::before,
.player__head::after {
  content: "";
  position: absolute;
  top: 21px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1b2430;
}

.player__head::before {
  left: 15px;
}

.player__head::after {
  right: 15px;
}

.player__torso {
  left: 50%;
  top: 64px;
  width: 78px;
  height: 96px;
  transform: translateX(-50%);
  border-radius: 28px 28px 18px 18px;
  background: linear-gradient(180deg, var(--yellow), #f3b30a);
  border: 2px solid rgba(0, 0, 0, 0.14);
}

.player__arm {
  top: 78px;
  width: 18px;
  height: 82px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd9b9, #efb385);
}

.player__arm--left {
  left: 22px;
  transform: rotate(18deg);
}

.player__arm--right {
  right: 20px;
  transform: rotate(-26deg);
}

.player__leg {
  bottom: 28px;
  width: 18px;
  height: 94px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3d5570, #1a2736);
}

.player__leg--left {
  left: 42px;
  transform: rotate(7deg);
}

.player__leg--right {
  right: 38px;
  transform: rotate(-4deg);
}

.player__shoe {
  bottom: 16px;
  width: 30px;
  height: 12px;
  border-radius: 999px;
  background: #06090e;
}

.player__shoe--left {
  left: 30px;
}

.player__shoe--right {
  right: 24px;
}

.npc {
  position: absolute;
  width: 62px;
  height: 130px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.npc__head,
.npc__hair,
.npc__torso,
.npc__arm,
.npc__leg,
.npc__feet,
.npc__badge,
.npc__meter {
  position: absolute;
}

.npc__head {
  left: 50%;
  top: 8px;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd6b3, #efb88c);
  border: 2px solid rgba(0, 0, 0, 0.14);
  z-index: 3;
}

.npc__hair {
  left: 50%;
  top: 4px;
  width: 38px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 14px 14px 8px 8px;
  background: var(--hair, #55351d);
  z-index: 4;
}

.npc__torso {
  left: 50%;
  top: 38px;
  width: 42px;
  height: 52px;
  transform: translateX(-50%);
  border-radius: 16px 16px 12px 12px;
  background: linear-gradient(180deg, var(--shirt, #56d8ff), var(--shirt-dark, #13678c));
  border: 2px solid rgba(0, 0, 0, 0.16);
  z-index: 2;
}

.npc__arm {
  top: 44px;
  width: 10px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd8b8, #eeb585);
}

.npc__arm--left {
  left: 6px;
  transform: rotate(8deg);
}

.npc__arm--right {
  right: 6px;
  transform: rotate(-8deg);
}

.npc__leg {
  bottom: 18px;
  width: 12px;
  height: 50px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pants, #26384a), #101720);
}

.npc__leg--left {
  left: 19px;
}

.npc__leg--right {
  right: 19px;
}

.npc__feet {
  left: 50%;
  bottom: 12px;
  width: 36px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
}

.npc__badge {
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  line-height: 18px;
  text-align: center;
  color: #091019;
  background: rgba(236, 255, 79, 0.9);
}

.npc__meter {
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.npc__meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--yellow));
}

.npc--guard .npc__torso {
  background: linear-gradient(180deg, var(--red), var(--red-deep));
}

.npc--guard .npc__badge {
  color: #fff;
  background: rgba(255, 102, 126, 0.9);
}

.npc--guard .npc__hair {
  height: 12px;
  border-radius: 5px 5px 10px 10px;
}

.splash {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px currentColor;
}

.float-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.float-text--good {
  color: var(--yellow);
}

.float-text--bad {
  color: #ff92a5;
}

.overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100% - 36px));
  padding: 26px 28px;
  text-align: center;
  transform: translate(-50%, -50%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(13, 28, 44, 0.94), rgba(8, 14, 22, 0.88)),
    var(--panel-strong);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.46);
  transition: opacity 180ms ease, transform 180ms ease;
}

.overlay strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.overlay p {
  margin: 10px 0 0;
  font-size: 1rem;
}

.overlay.is-hidden {
  opacity: 0;
  transform: translate(-50%, -45%);
  pointer-events: none;
}

.status-line {
  margin: 14px 0 0;
  min-height: 24px;
  font-size: 0.98rem;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.leaderboard-card,
.legend-card {
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head > div {
  display: grid;
  gap: 8px;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.board-row,
.board-empty {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.board-row.is-highlighted {
  border-color: rgba(236, 255, 79, 0.34);
  background: rgba(236, 255, 79, 0.08);
}

.board-place,
.board-score {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

.board-place {
  color: var(--muted);
}

.board-name {
  display: grid;
  gap: 2px;
}

.board-name strong {
  font-size: 1rem;
}

.board-name span {
  color: var(--muted);
  font-size: 0.82rem;
}

.leaderboard-status {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.legend-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.legend-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.legend-list strong {
  display: block;
  margin-bottom: 2px;
  font-size: 1rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  box-shadow: 0 0 14px currentColor;
}

.legend-dot--good {
  color: var(--cyan);
  background: linear-gradient(180deg, var(--cyan), var(--yellow));
}

.legend-dot--bad {
  color: var(--red);
  background: linear-gradient(180deg, var(--red), var(--red-deep));
}

.legend-dot--tap {
  color: var(--yellow);
  background: linear-gradient(180deg, var(--yellow), #ffe37a);
}

@keyframes stream-shift {
  from {
    transform: translateX(-20%);
  }
  to {
    transform: translateX(20%);
  }
}

@media (max-width: 1120px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(96vw, 100%);
    padding-top: 18px;
  }

  .card {
    border-radius: 22px;
  }

  .hero,
  .leaderboard-card,
  .legend-card,
  .game-card {
    padding: 18px;
  }

  .hud {
    grid-template-columns: 1fr;
  }

  .control-row {
    flex-direction: column;
  }

  .pressure-pill {
    min-width: 0;
  }

  .panel-head {
    flex-direction: column;
  }

  .arena {
    min-height: 560px;
  }

  .player {
    transform: translateX(-50%) scale(0.9);
    transform-origin: bottom center;
  }
}
