/* Colors follow almanie.dev (the Chirpy theme), in light and dark. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #34343c;
  --heading: #2a2a2a;
  --muted: #757575;
  --line: #e9ecef;
  --accent: #0056b2;
  --on-accent: #ffffff;
  --soft: #f6f8fa;
  --live: #2f9e5b;
  --danger: #c0392b;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1e;
    --surface: #1e1e1e;
    --text: rgb(175 176 177);
    --heading: #cccccc;
    --muted: #868686;
    --line: #2c2d2d;
    --accent: rgb(138 180 248);
    --on-accent: #1b1b1e;
    --soft: #262628;
    --live: #4cc38a;
    --danger: #e07a66;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
main { max-width: 760px; margin: 0 auto; padding: 32px 16px 32px; min-height: 100vh; display: flex; flex-direction: column; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
h1 { font-size: 28px; font-weight: 600; color: var(--heading); letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 18px; font-weight: 600; color: var(--heading); margin: 0 0 4px; }
h3 { font-size: 16px; font-weight: 600; color: var(--heading); margin: 28px 0 10px; }
.screen { flex: 1; }
.lede { font-size: 17px; color: var(--muted); margin: 0 0 20px; max-width: 34em; }
.status { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; text-align: right; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: var(--live); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.center { justify-content: center; }
.row input { flex: 1; min-width: 0; }

input {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-height: 42px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
#joinInput { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: .25em; }

button, .btn {
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 10px; white-space: nowrap; min-height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: none; padding: 0; min-height: 0; color: var(--accent); font-size: inherit; }
button.ghost { background: none; border-color: transparent; color: var(--muted); }
.aside { color: var(--muted); font-size: 15px; margin: 20px 0 0; }
.center-text { text-align: center; }

.label { color: var(--muted); font-size: 14px; margin: 18px 0 8px; }
#wait { text-align: center; padding-top: 16px; }
.code {
  font: 600 clamp(48px, 16vw, 80px)/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--heading); letter-spacing: .12em; margin: 4px 0 20px; user-select: all;
}
.hint { color: var(--muted); text-align: center; margin: 18px 0 0; }
.hint strong { color: var(--heading); }
#connecting, #ended { padding-top: 48px; text-align: center; }
.spinner { width: 28px; height: 28px; margin: 0 auto; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 170px; padding: 24px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--soft); }
.drop strong { font-size: 18px; color: var(--heading); }
.drop span { color: var(--muted); font-size: 15px; }
.drop input { display: none; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); margin-top: 14px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; min-height: 0; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.name { font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.name .dir { color: var(--muted); font-weight: 500; margin-right: 6px; }
.meta { grid-column: 1; color: var(--muted); font-size: 14px; }
.actions { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; }
.bar { grid-column: 1 / -1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); }
.item.error .meta { color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 28px 0; font-size: 15px; }

.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}

footer { color: var(--muted); font-size: 14px; line-height: 1.6; text-align: center; margin-top: 48px; }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; }
  .actions { grid-row: auto; grid-column: 1; margin-top: 6px; }
  .actions .btn.primary { flex: 1; }
}
