/* SPDX-License-Identifier: MIT OR Apache-2.0 */

:root {
  --bg: #05050a;
  --panel: #0e0e16f2;
  --line: #24243a;
  --text: #e8e8f2;
  --muted: #9a9ab4;
  --accent: #6ce5c8;
  --error: #ff8a8a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* The visualizer fills the viewport; everything else floats over it. Bevy's
   `fit_canvas_to_parent` sizes the canvas from this element. */
#stage {
  position: fixed;
  inset: 0;
}

#bava-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

/* --- panel ---------------------------------------------------------------- */

#panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100vw);
  height: 100%;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

#panel.open {
  transform: none;
}

#panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#panel h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--accent);
}

#panel h2 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

#panel section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

#panel section:first-of-type {
  border-top: none;
  padding-top: 0;
}

#panel footer {
  margin-top: auto;
  font-size: 12px;
}

#panel a {
  color: var(--muted);
}

/* --- controls ------------------------------------------------------------- */

button,
input {
  font: inherit;
  color: inherit;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #191924;
  padding: 8px 12px;
}

button {
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06120f;
  font-weight: 600;
}

#panel-toggle,
#panel-show {
  padding: 4px 10px;
  background: transparent;
}

#panel-show {
  position: fixed;
  top: 14px;
  right: 14px;
  background: var(--panel);
}

#yt-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

#yt-url {
  flex: 1;
  min-width: 0;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The single primary call to action. Full width so it reads as *the* thing to
   do, rather than one option among the secondary buttons under it. */
button.big {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  margin-bottom: 4px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--line);
}

#capture-retry {
  margin-top: 8px;
  padding: 5px 10px;
  font-size: 12px;
}

#file-audio {
  width: 100%;
}

/* Keeps the 16:9 iframe from collapsing before the API swaps the div for it. */
#yt-wrap {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

#yt-wrap iframe,
#yt-player {
  width: 100%;
  height: 100%;
  border: 0;
}

.hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.status {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.status.ok {
  color: var(--accent);
}

.status.error {
  color: var(--error);
}

code {
  font-size: 11px;
  background: #191924;
  padding: 1px 5px;
  border-radius: 4px;
}

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0;
  font-size: 12px;
}

.keys dt {
  color: var(--accent);
  font-family: ui-monospace, monospace;
}

.keys dd {
  margin: 0;
  color: var(--muted);
}

/* --- boot overlay --------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 10;
}

.boot-card {
  text-align: center;
}

.boot-card h1 {
  margin: 0;
  font-size: 42px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.loading {
  color: var(--muted);
}

@media (max-width: 640px) {
  #panel {
    width: 100vw;
  }
}
