:root {
  color-scheme: dark;
  --green: #00ff66;
  --green-soft: rgba(0, 255, 102, 0.62);
  --green-line: rgba(0, 255, 102, 0.42);
  --black: #000;
  font-family:
    "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

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

button {
  min-width: 168px;
  min-height: 44px;
  border: 1px solid var(--green-line);
  border-radius: 2px;
  background: rgba(0, 255, 102, 0.08);
  color: var(--green);
  cursor: pointer;
  font: inherit;
  letter-spacing: 0;
}

button:hover,
button:focus-visible {
  border-color: var(--green);
  background: rgba(0, 255, 102, 0.16);
  outline: none;
}

.quality-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  width: 100%;
  min-width: 168px;
  border: 1px solid var(--green-line);
  background: rgba(0, 255, 102, 0.16);
}

.quality-option {
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.78);
  color: var(--green-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.quality-option[data-active="true"] {
  background: rgba(0, 255, 102, 0.18);
  color: var(--green);
  box-shadow: inset 0 0 14px rgba(0, 255, 102, 0.14);
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  isolation: isolate;
  background: var(--black);
}

.quality-panel {
  position: absolute;
  top: clamp(12px, 3vh, 28px);
  right: clamp(12px, 3vw, 28px);
  z-index: 2;
  width: 184px;
  padding: 8px;
  border: 1px solid rgba(0, 255, 102, 0.18);
  background: rgba(0, 0, 0, 0.62);
}

body.clean .quality-panel {
  display: none;
}

#avatar-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.launch-panel {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 5vh, 52px);
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 255, 102, 0.22);
  background: rgba(0, 0, 0, 0.72);
  opacity: 1;
  transform: translateX(-50%);
  transition: opacity 220ms ease;
}

body.is-live .launch-panel,
body.clean .launch-panel {
  opacity: 0;
  pointer-events: none;
}

.status {
  display: inline-grid;
  grid-template-columns: 9px auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--green-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: #003b18;
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.22);
}

.status[data-active="true"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 16px rgba(0, 255, 102, 0.72);
}

@media (max-width: 520px) {
  .quality-panel {
    top: 12px;
    right: 12px;
    width: min(184px, calc(100vw - 24px));
  }

  .launch-panel {
    width: min(260px, calc(100vw - 32px));
  }

  button {
    width: 100%;
  }
}
