:root {
  color-scheme: dark;
  --bg: #080a10;
  --panel: rgba(15, 18, 28, 0.82);
  --panel-strong: rgba(22, 26, 38, 0.96);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f7f7ff;
  --muted: #9ea8ba;
  --mint: #7ef4d5;
  --blue: #56d6ff;
  --gold: #ffd166;
  --red: #ff5d73;
  --green: #8ef66f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(126, 244, 213, 0.14), transparent 30%),
    radial-gradient(circle at 82% 0%, rgba(255, 209, 102, 0.13), transparent 28%),
    linear-gradient(135deg, #070910 0%, #141827 54%, #171018 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.join-screen {
  position: relative;
  min-height: 100vh;
  padding: 28px;
  background-image: linear-gradient(rgba(8, 10, 16, 0.2), rgba(8, 10, 16, 0.62)), url("/assets/hero-station.svg");
  background-size: cover;
  background-position: center;
}

.brand-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-strip img {
  width: 164px;
  height: auto;
}

.join-layout {
  width: min(1120px, 100%);
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  gap: 42px;
  margin: 0 auto;
  padding-bottom: 44px;
}

.hero-copy {
  max-width: 700px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(56px, 10vw, 132px);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy p {
  width: min(560px, 100%);
  margin: 22px 0 0;
  color: #d9e1f2;
  font-size: 20px;
  line-height: 1.6;
}

.join-panel,
.side-panel,
.meeting-dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.join-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 14px;
  letter-spacing: 0;
}

input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(126, 244, 213, 0.12);
}

.join-actions,
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary,
.secondary,
.danger,
.warning {
  min-height: 44px;
  border-radius: 6px;
  color: #061017;
  font-weight: 800;
}

.primary {
  background: linear-gradient(135deg, var(--mint), var(--blue));
}

.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger {
  background: linear-gradient(135deg, #ff5d73, #ff9f43);
}

.warning {
  background: linear-gradient(135deg, var(--gold), #ff9f43);
}

.small {
  min-height: 38px;
  padding: 0 18px;
}

.status-line,
.feed {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.game-screen {
  min-height: 100vh;
  padding: 18px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto auto;
  gap: 10px;
  align-items: center;
  width: min(1320px, 100%);
  margin: 0 auto 14px;
}

.hud > div {
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 18, 28, 0.7);
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hud strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
}

.stage-wrap {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 14px;
  align-items: start;
}

.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101622;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.48);
  touch-action: none;
}

.world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 1000px;
  transform-origin: 0 0;
  will-change: transform;
}

.map-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-layer,
.body-layer,
.player-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.vision-vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 35%, rgba(3, 5, 10, 0.22) 58%, rgba(3, 5, 10, 0.72) 100%);
  mix-blend-mode: multiply;
}

.task-node,
.body-marker,
.player-token {
  position: absolute;
  transform: translate(-50%, -50%);
}

.task-node {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(126, 244, 213, 0.14);
  border: 1px solid rgba(126, 244, 213, 0.55);
  box-shadow: 0 0 22px rgba(126, 244, 213, 0.24);
}

.task-node.done {
  background: rgba(142, 246, 111, 0.18);
  border-color: rgba(142, 246, 111, 0.8);
}

.task-node svg,
.body-marker svg {
  width: 24px;
  height: 24px;
}

.body-marker {
  width: 42px;
  height: 42px;
  color: var(--red);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.42));
}

.player-token {
  width: 54px;
  height: 62px;
  color: var(--player-color);
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.42));
  transition: left 80ms linear, top 80ms linear, opacity 120ms ease;
}

.player-token.dead {
  opacity: 0.35;
  filter: grayscale(0.9);
}

.player-token.you {
  width: 62px;
  height: 72px;
}

.name-tag {
  position: absolute;
  left: 50%;
  top: -18px;
  max-width: 96px;
  transform: translateX(-50%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.emergency-button {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ff4f63;
  color: white;
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 0 0 8px rgba(255, 79, 99, 0.16), 0 8px 20px rgba(0, 0, 0, 0.45);
}

.side-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.panel-section {
  display: grid;
  gap: 10px;
}

.player-list {
  display: grid;
  gap: 8px;
}

.player-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--swatch);
}

.player-row span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  color: var(--muted);
  font-size: 12px;
}

.meeting {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 6, 12, 0.74);
  z-index: 20;
}

.meeting-dialog {
  width: min(560px, 100%);
  padding: 20px;
}

.meeting-dialog.compact {
  text-align: center;
}

.meeting-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.meeting h2 {
  margin: 0 0 16px;
  font-size: 30px;
}

#meetingTimer {
  min-width: 48px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
  font-weight: 900;
}

.vote-list {
  display: grid;
  gap: 8px;
}

.vote-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--line);
  text-align: left;
}

.vote-button.voted {
  border-color: var(--mint);
}

@media (max-width: 980px) {
  .join-layout,
  .stage-wrap {
    grid-template-columns: 1fr;
  }

  .join-layout {
    align-items: end;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .join-screen,
  .game-screen {
    padding: 12px;
  }

  .brand-strip {
    justify-content: space-between;
  }

  .brand-strip img {
    width: 128px;
  }

  .hero-copy h1 {
    font-size: 54px;
  }

  .hero-copy p {
    font-size: 16px;
  }

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

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

  .player-token {
    width: 42px;
    height: 50px;
  }

  .stage {
    min-height: 360px;
  }
}
