@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #000000;
  --fg: #ffffff;
  --lines: 20;
  --line-height: 1.2;
  --pad: 1rem;
  --button: min(13vh, 8rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  overflow: hidden;
}

#transcript {
  height: 100dvh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: var(--pad) calc(var(--pad) * 2);
  font-size: calc((100dvh - 2 * var(--pad)) / (var(--lines) * var(--line-height)));
  line-height: var(--line-height);
  overflow-wrap: anywhere;
}
#transcript::-webkit-scrollbar { display: none; }
#live { opacity: 0.85; }

#message {
  position: fixed;
  inset: auto 0 2rem 0;
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
}
#message:empty { display: none; }

#controls {
  position: fixed;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: opacity 0.4s;
  z-index: 10;
}
body.idle #controls { opacity: 0; pointer-events: none; }
body.idle { cursor: none; }

#controls > button {
  position: relative;
  width: var(--button);
  height: var(--button);
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid var(--fg);
  border-radius: 1rem;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}
#controls > button:focus-visible { outline: 4px solid var(--fg); outline-offset: 4px; }
#controls svg {
  width: 60%;
  height: 60%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#schemes {
  width: min(52rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 1.5rem;
  border: 3px solid var(--fg);
  border-radius: 1rem;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
}
#schemes::backdrop { background: rgb(0 0 0 / 0.6); }
#schemes h2 { margin: 0 0 1rem; font-size: 1.75rem; }
#scheme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 1rem;
}
#scheme-grid button {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
}
#scheme-grid .swatch {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px solid var(--fg);
  border-radius: 0.75rem;
  font-size: 3.5rem;
  font-weight: 700;
}
#scheme-grid button[aria-checked="true"] .swatch { outline: 5px solid var(--fg); outline-offset: 3px; }
#scheme-grid button[aria-checked="true"] .name { font-weight: 700; text-decoration: underline; }
#scheme-grid button:focus-visible { outline: 3px dashed var(--fg); outline-offset: 6px; border-radius: 0.75rem; }
#schemes-close {
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  border: 3px solid var(--fg);
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
}
#schemes-close:focus-visible { outline: 4px solid var(--fg); outline-offset: 4px; }

#status {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: #888888;
}
#status[data-state="live"] { background: #22c55e; }
#status[data-state="error"] { background: #ef4444; }

#mics {
  position: absolute;
  right: calc(var(--button) + 1rem);
  bottom: 0;
  min-width: 18rem;
  max-width: 70vw;
  padding: 0.5rem;
  border: 3px solid var(--fg);
  border-radius: 1rem;
  background: var(--bg);
}
#mics button {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 1.25rem;
  text-align: left;
  cursor: pointer;
}
#mics button[aria-checked="true"] { font-weight: 700; text-decoration: underline; }
#mics button:hover, #mics button:focus-visible { outline: 3px solid var(--fg); }

body.login main {
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
body.login form { display: flex; flex-direction: column; gap: 1rem; width: min(24rem, 100%); font-size: 1.5rem; }
body.login input, body.login button {
  font: inherit;
  padding: 0.75rem 1rem;
  border: 3px solid var(--fg);
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--fg);
}
body.login button { cursor: pointer; font-weight: 700; }
body.login input:focus-visible, body.login button:focus-visible { outline: 4px solid var(--fg); outline-offset: 4px; }
body.login p { margin: 0; }
