:root {
  color-scheme: dark;
  --bg: #080a0d;
  --panel: #12171c;
  --panel-strong: #192028;
  --line: #2d3b42;
  --text: #e8f4ee;
  --muted: #91a79d;
  --acid: #95f0a1;
  --amber: #ffc65a;
  --red: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(149, 240, 161, 0.14), transparent 30rem),
    linear-gradient(135deg, #080a0d 0%, #11161b 52%, #16110e 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
  display: flex;
}

.terminal {
  width: 100%;
  min-height: calc(100vh - 40px);
  border: 1px solid var(--line);
  background: rgba(18, 23, 28, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.topnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--acid);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 8vw, 58px);
  line-height: 0.95;
}

.nav-link,
button {
  border: 1px solid #51715c;
  border-radius: 6px;
  background: #203027;
  color: var(--text);
  min-height: 42px;
  padding: 0 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.status-grid div,
.stage-panel,
.message,
.object-card,
.admin-controls {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 8px;
}

.status-grid div {
  padding: 10px;
  min-height: 74px;
}

.status-grid span,
.object-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.status-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  color: var(--acid);
}

.stage-panel {
  padding: 12px;
}

.stage-panel span {
  color: var(--amber);
  font-weight: 800;
}

.stage-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.messages {
  flex: 1;
  min-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.message {
  padding: 12px;
  max-width: 82%;
}

.message.player {
  align-self: flex-end;
  border-color: #566f86;
  background: #18232c;
}

.message.system {
  align-self: center;
  max-width: 92%;
  border-color: #6b5b32;
  background: #2b2417;
}

.message.typing p {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 22px;
}

.message.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acid);
  opacity: 0.35;
  animation: typing-bubble 1.15s ease-in-out infinite;
}

.message.typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.message.typing span:nth-child(3) {
  animation-delay: 0.32s;
}

.message strong {
  color: var(--acid);
}

.message p {
  margin: 0;
  line-height: 1.45;
}

.message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.message-play {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
  border-color: rgba(149, 240, 161, 0.32);
  background: rgba(32, 48, 39, 0.62);
}

.composer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.composer-stack {
  display: grid;
  gap: 6px;
}

.voice-bar {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.voice-bar .checkline {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1115;
  color: var(--muted);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.chat-input-bar {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0d1115;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px;
  align-items: center;
  padding: 4px 5px 4px 16px;
}

.chat-input-bar input {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.chat-input-bar input:focus {
  outline: 0;
}

.composer-icon {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  padding: 0;
  border-color: transparent;
  background: transparent;
  position: relative;
}

.composer-icon:hover {
  border-color: rgba(149, 240, 161, 0.36);
  background: rgba(32, 48, 39, 0.52);
}

.composer-icon:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  border-color: var(--line);
  background: #17211b;
}

.send-button {
  background: #203027;
  border-color: #51715c;
}

.mic-button {
  background: #203027;
  border-color: #51715c;
}

.mic-button.listening::before,
.mic-button.listening::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(149, 240, 161, 0.62);
  border-radius: 50%;
  animation: mic-wave 1.35s ease-out infinite;
  pointer-events: none;
}

.mic-button.listening::after {
  animation-delay: 0.45s;
}

.mic-shape {
  width: 14px;
  height: 20px;
  border: 2px solid var(--muted);
  border-radius: 9px;
  display: block;
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
}

.mic-shape::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 2px;
  height: 7px;
  background: var(--muted);
  transform: translateX(-50%);
}

.mic-shape::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  transform: translateX(-50%);
}

.send-shape {
  width: 15px;
  height: 15px;
  display: block;
  margin: 0 auto;
  border-top: 3px solid var(--acid);
  border-right: 3px solid var(--acid);
  transform: translateX(-2px) rotate(45deg);
}

.send-button:disabled .send-shape {
  border-color: var(--muted);
}

@keyframes mic-wave {
  0% {
    opacity: 0.72;
    transform: scale(0.82);
  }

  100% {
    opacity: 0;
    transform: scale(1.42);
  }
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1115;
  color: var(--text);
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  padding: 10px 12px;
  resize: vertical;
}

.locator-screen {
  align-items: stretch;
}

.locator-radar {
  position: relative;
  aspect-ratio: 1 / 1;
  width: min(56vh, 440px);
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid #40624a;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(149, 240, 161, 0.14), transparent 38%),
    repeating-radial-gradient(circle, transparent 0 54px, rgba(149, 240, 161, 0.1) 55px 56px),
    linear-gradient(145deg, #09100d 0%, #101b18 52%, #050707 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow:
    inset 0 0 34px rgba(149, 240, 161, 0.12),
    0 18px 44px rgba(0, 0, 0, 0.34);
}

.radar-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes typing-bubble {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.distance-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  min-width: 58px;
  border: 1px solid rgba(149, 240, 161, 0.5);
  border-radius: 999px;
  background: rgba(8, 10, 13, 0.86);
  color: var(--text);
  font-weight: 800;
  text-align: center;
  padding: 7px 10px;
}

.locator-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.object-list {
  display: grid;
  gap: 10px;
}

.object-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.object-card strong {
  display: block;
  margin: 3px 0;
  font-size: 20px;
}

.object-card p {
  margin: 0;
  color: var(--muted);
}

.object-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.object-card.marked {
  border-color: #5db56b;
}

.admin-shell {
  width: min(100%, 1100px);
}

.admin-controls {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-controls label {
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.danger {
  border-color: #7b3434;
  background: #351d1d;
}

.admin-messages {
  min-height: 220px;
}

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

.voice-card {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.voice-card span {
  color: var(--acid);
  font-size: 12px;
  text-transform: uppercase;
}

.voice-card h2 {
  margin: 0;
  font-size: 22px;
}

.voice-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.voice-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.voice-card .checkline {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkline input {
  width: auto;
  min-height: auto;
}

.voice-answer {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1115;
  padding: 12px;
  line-height: 1.45;
}

.voice-note {
  border-left: 2px solid rgba(149, 240, 161, 0.45);
  color: var(--muted);
  padding-left: 10px;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .locator-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .shell {
    padding: 10px;
  }

  .terminal {
    min-height: calc(100vh - 20px);
    padding: 12px;
  }

  .status-grid,
  .composer,
  .voice-bar,
  .locator-controls,
  .topnav,
  .object-card,
  .admin-controls {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 96%;
  }
}
