:root {
  --bg: #eeeeee;
  --fg: #000;
  --muted: #000;
  --accent: #000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

body {
  display: grid;
  /* Header and footer take their intrinsic size; the canvas row absorbs the
     rest and is allowed to shrink to 0 so the footer can never be pushed off
     screen on narrow/short windows. */
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh; /* respect mobile dynamic viewport */
  overflow: hidden;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  font-size: 14px;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.5px;
}
.brand span {
  color: var(--accent);
  font-weight: 400;
}

.status {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #000;
}
.status.connecting { color: #000; border-color: #000; }
.status.live       { color: #000; border-color: #000; }
.status.error      { color: #000; border-color: #000; }

.memory {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  max-width: 60vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.memory.has-data { color: var(--fg); border-color: rgba(255,255,255,0.45); }

main {
  position: relative;
  overflow: hidden;
  min-height: 0; /* let the grid row actually shrink */
}

#wave {
  position: absolute;
  inset: 0;          /* fill <main> exactly */
  width: 100%;
  height: 100%;
  display: block;
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  /* clamp() keeps the footer compact on short windows so the button never
     gets clipped against the viewport edge. */
  padding: clamp(10px, 2vh, 20px) 28px clamp(14px, 6vh, 60px);
}

button.primary {
  background: transparent;
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 100;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid black;
  transition: transform 0.1s ease, background 0.2s ease;
}
button.primary:hover { transform: translateY(-1px); }
button.primary.live  { background: transparent; color: #000; }
button.primary:disabled { opacity: 0.5; cursor: progress; }

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  font-weight: 300;
  padding: 14px 28px;
  text-transform: uppercase;
  font-size: 15px;
  border: 1px solid black;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.secondary.icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}
.secondary.icon svg { display: block; }
.secondary.icon:disabled { opacity: 0.6; cursor: progress; }
.secondary.black {
  background: black;
  color: white;
}

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