@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Bebas+Neue&display=swap");

:root {
  --bg: #081126;
  --bg-2: #101a33;
  --glass: rgba(16, 26, 51, 0.6);
  --line: rgba(190, 219, 255, 0.18);
  --text: #f2f7ff;
  --muted: #b4c0d8;
  --accent: #00f0ff;
  --accent-2: #00d48c;
  --warn: #ffc35b;
  --danger: #ff5d7c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 15% -10%, #243f80 0%, var(--bg) 42%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: drift 16s ease-in-out infinite;
}

.bg-glow-a {
  width: 42vw;
  height: 42vw;
  background: #00e7ff;
  left: -14vw;
  top: 34vh;
}

.bg-glow-b {
  width: 45vw;
  height: 45vw;
  background: #00b86a;
  right: -18vw;
  top: -10vh;
  animation-delay: -8s;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.12;
  background-image: radial-gradient(rgba(255, 255, 255, 0.45) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

.app-shell {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}

.glass {
  background: linear-gradient(165deg, rgba(24, 37, 66, 0.75), rgba(11, 20, 39, 0.65));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.title-wrap h1 {
  margin: 0;
  line-height: 1;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.08em;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
}

.status-wrap {
  display: flex;
  gap: 0.5rem;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: #dce8ff;
}

.pill-warn {
  color: #161616;
  background: var(--warn);
  border-color: transparent;
}

.pill-ok {
  color: #03231c;
  background: #8bffd5;
  border-color: transparent;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1rem;
}

.controls,
.people {
  padding: 1.15rem;
}

.controls h2,
.people h2 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.sub {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.keybind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(6, 18, 40, 0.8);
}

.mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 0.42rem 0.7rem;
  background: linear-gradient(180deg, #25467f, #16345a);
  color: #f3f8ff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.mini-btn.ghost {
  background: rgba(12, 23, 44, 0.7);
}

.mini-btn.armed {
  background: linear-gradient(180deg, #2a8f6b, #1a664b);
  border-color: rgba(151, 255, 212, 0.8);
}

.key-state {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.key-state.armed {
  color: #a4ffe0;
}

.mode-box {
  margin-bottom: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.55rem;
  background: rgba(8, 18, 38, 0.7);
}

.mode-title {
  margin: 0 0 0.4rem;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #d6e7ff;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  padding: 0.38rem 0.35rem;
  background: rgba(19, 36, 65, 0.78);
  color: #dbe7ff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.mode-btn.active {
  background: linear-gradient(180deg, #2585ff, #2352a1);
  border-color: rgba(149, 201, 255, 0.8);
  color: #f8fcff;
}

.vox-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: #a8bddf;
}

.mode-state {
  margin: 0.4rem 0 0;
  font-size: 0.73rem;
  color: #9fb7dd;
}

.game-helper {
  margin-bottom: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.55rem;
  background: rgba(6, 16, 34, 0.62);
}

.helper-title {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #cde2ff;
}

.helper-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.token-code {
  flex: 1;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #b4ffc4;
  border: 1px solid rgba(145, 247, 167, 0.3);
  background: rgba(2, 13, 9, 0.45);
  border-radius: 8px;
  padding: 0.32rem 0.45rem;
  overflow-wrap: anywhere;
}

.helper-state {
  margin: 0.42rem 0 0;
  font-size: 0.73rem;
  color: #9eb3d5;
}

.helper-state.ok {
  color: #9cffcf;
}

.helper-links {
  margin: 0.32rem 0 0;
  font-size: 0.73rem;
}

.helper-links a {
  color: #9dd2ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ptt {
  width: 100%;
  min-height: 78px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, #244c8f, #153258);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.03rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.ptt:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ptt.active {
  background: linear-gradient(180deg, #0cbf81, #068959);
  box-shadow: 0 0 0 3px rgba(0, 212, 140, 0.25), 0 16px 28px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ff9a9a;
}

.ptt.active .dot {
  background: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.9);
}

.state {
  margin: 0.8rem 0;
  font-size: 0.92rem;
}

.state-idle {
  color: var(--muted);
}

.state-live {
  color: #97ffd4;
}

.tips {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.people-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.85rem;
}

.peer-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.peer-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.7rem;
  background: rgba(8, 17, 38, 0.72);
  transform: translateY(0);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.peer-card.speaking {
  border-color: rgba(151, 255, 212, 0.9);
  box-shadow: 0 0 0 2px rgba(10, 180, 118, 0.33), 0 0 28px rgba(83, 202, 255, 0.2);
  transform: translateY(-2px);
}

.peer-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f73ff, #00d48c);
  display: grid;
  place-items: center;
  color: #001a23;
  font-weight: 700;
  text-transform: uppercase;
}

.meta h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.meta p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.77rem;
}

.viz {
  width: 100%;
  height: 82px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.24);
  margin-bottom: 0.45rem;
}

.volume-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.volume {
  width: 100%;
}

.audio-tools {
  margin-top: 0.42rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.mute-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  padding: 0.28rem 0.52rem;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(18, 33, 59, 0.8);
  color: #e9f2ff;
  cursor: pointer;
}

.mute-btn.active {
  background: rgba(255, 93, 124, 0.2);
  border-color: rgba(255, 124, 149, 0.6);
  color: #ffc1d0;
}

.volume-db {
  font-size: 0.72rem;
  color: #94a6c4;
  font-variant-numeric: tabular-nums;
}

.join-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}

.join-card {
  width: min(460px, 100%);
  padding: 1.25rem;
}

.join-card h2 {
  margin: 0.2rem 0 0.6rem;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.08em;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
}

.join-card p {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.join-card label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  color: #d6e5ff;
}

.join-card input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(7, 14, 30, 0.86);
  color: white;
  border-radius: 10px;
  padding: 0.72rem 0.84rem;
  font-size: 1rem;
}

.join-card button {
  margin-top: 0.85rem;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.86rem;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(110deg, #00d4ff, #26d379);
  color: #052032;
  cursor: pointer;
}

.join-card button:disabled {
  opacity: 0.6;
  cursor: wait;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(18px, -22px) scale(1.04);
  }
}

@media (max-width: 960px) {
  .stage-grid {
    grid-template-columns: 1fr;
  }
}
