/* geese.fm - no framework, no webfonts, no CDN. */

:root {
  --bg: #0e1210;
  --bg-2: #151b18;
  --bg-3: #1c241f;
  --line: #2a352e;
  --fg: #e8efe9;
  --fg-dim: #93a398;
  --accent: #7bd88f;
  --accent-ink: #06120a;
  --danger: #ff8a7a;
  --radius: 12px;
  --bar-h: 56px;
}

html.theme-light {
  --bg: #f6f8f5;
  --bg-2: #ffffff;
  --bg-3: #eef2ec;
  --line: #d9e1da;
  --fg: #16201a;
  --fg-dim: #5e6d63;
  --accent: #1f8f45;
  --accent-ink: #ffffff;
  --danger: #b3341f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4rem; }
h2 { font-size: 1.05rem; letter-spacing: .01em; }
h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; color: var(--fg-dim); }
p { margin: 0 0 .6rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .87em;
       background: var(--bg-3); padding: .12em .4em; border-radius: 5px; }
.muted { color: var(--fg-dim); }
.hidden { display: none !important; }

/* ------------------------------------------------------------------- header */

.bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .85rem;
  height: var(--bar-h); padding: 0 .9rem;
  background: color-mix(in oklab, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { font-size: 1.15rem; }
.bar-spacer { flex: 1; }
.bar-group { display: flex; align-items: center; gap: .4rem; }
.bar-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--fg-dim);
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

.icon {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-3);
}
.icon:hover { border-color: var(--accent); }
.icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor;
            stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Each toggle holds both glyphs; state decides which one shows. */
.i-eye-off, .i-mute, .i-sun { display: none; }
#video-toggle[aria-pressed="false"] .i-eye { display: none; }
#video-toggle[aria-pressed="false"] .i-eye-off { display: block; }
#audio-toggle[aria-pressed="false"] .i-vol { display: none; }
#audio-toggle[aria-pressed="false"] .i-mute { display: block; }
html.theme-light .i-moon { display: none; }
html.theme-light .i-sun { display: block; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 92px; height: 20px; background: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 3px; background: var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px;
  border-radius: 50%; background: var(--accent);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 3px; background: var(--line); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0;
  border-radius: 50%; background: var(--accent); }

.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-size: .8rem; font-variant-numeric: tabular-nums;
}
.pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8;
            stroke-linecap: round; stroke-linejoin: round; }
.conn { color: var(--danger); }
.conn.on { color: var(--accent); }

/* -------------------------------------------------------------------- body */

.wrap { max-width: 940px; margin: 0 auto; padding: 1.1rem .9rem 3rem; }

.twitch { aspect-ratio: 16/9; margin-bottom: 1rem; border-radius: var(--radius); overflow: hidden; }
.twitch iframe { width: 100%; height: 100%; border: 0; }

.stage { margin-bottom: 1rem; }
.stage-inner {
  position: relative; aspect-ratio: 16/9; width: 100%;
  background: #000; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: aspect-ratio .18s ease;
}
.stage-inner iframe, .stage-inner video, .stage-inner > div:first-child { width: 100%; height: 100%; border: 0; }

/*
 * Hiding the video must never interrupt the audio, so the player is shrunk to
 * a pixel rather than display:none'd - a hidden iframe is fair game for the
 * browser to throttle, and a throttled player drifts out of sync.
 */
body.video-off .stage-inner { aspect-ratio: auto; height: 0; border-width: 0; }
body.video-off #player-youtube,
body.video-off #player-soundcloud,
body.video-off #player-direct {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
body.video-off .overlay { display: none; }

.overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; padding: 1rem;
  background: color-mix(in oklab, #000 68%, transparent);
  color: #fff; border: 0; width: 100%;
}
.overlay h2 { font-size: 1.1rem; }
.overlay p { color: #c9d6cd; margin: 0; font-size: .9rem; }
.overlay-button { cursor: pointer; }

.progress { margin-top: .5rem; }
.progress-fill {
  height: 4px; width: 0%; border-radius: 3px; background: var(--accent);
  transition: width .2s linear;
}
.progress::before {
  content: ""; display: block; height: 4px; border-radius: 3px;
  background: var(--line); margin-bottom: -4px;
}
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: .76rem; color: var(--fg-dim);
  font-variant-numeric: tabular-nums; margin-top: .3rem;
}

/* --------------------------------------------------------------- now / queue */

.now { margin-bottom: 1.1rem; }
.now-empty { padding: .6rem 0; }

.track { display: flex; gap: .7rem; align-items: flex-start; }
.track-badge {
  flex: none; margin-top: .15rem;
  font-size: .66rem; letter-spacing: .09em; text-transform: uppercase;
  padding: .18rem .45rem; border-radius: 5px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.track-badge.replay { background: var(--bg-3); color: var(--fg-dim); border: 1px solid var(--line); }
.track-title { font-size: 1.12rem; font-weight: 650; letter-spacing: -.01em; }
.track-title a { color: inherit; text-decoration: none; }
.track-title a:hover { text-decoration: underline; }
.track-sub { font-size: .82rem; color: var(--fg-dim); }

.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
              margin-bottom: .5rem; }
.ghost {
  padding: .32rem .7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-3); font-size: .84rem;
}
.ghost:hover:not(:disabled) { border-color: var(--accent); }
.ghost:disabled { opacity: .45; cursor: not-allowed; }
.ghost.voted { border-color: var(--accent); color: var(--accent); }

.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.queue-list li {
  display: flex; gap: .7rem; align-items: baseline;
  padding: .5rem .65rem; border-radius: 9px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.queue-n { color: var(--fg-dim); font-variant-numeric: tabular-nums; font-size: .82rem; min-width: 1.5rem; }
.queue-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-title a { color: inherit; text-decoration: none; }
.queue-title a:hover { text-decoration: underline; }
.queue-meta { color: var(--fg-dim); font-size: .8rem; white-space: nowrap; }
.queue-empty { margin-top: .3rem; font-size: .88rem; }

/* ----------------------------------------------------------------- console */

.console { margin: 1.2rem 0; }
#command-form { display: flex; gap: .5rem; }
#command {
  flex: 1; min-width: 0;
  padding: .62rem .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg);
  font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem;
}
#command:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.primary {
  padding: .62rem 1.05rem; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 650;
}
.console-hint { margin-top: .4rem; font-size: .8rem; color: var(--fg-dim); }
.linkish { color: var(--accent); text-decoration: underline; padding: 0; font-size: inherit; }

/* ------------------------------------------------------------------ footer */

.foot {
  margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  font-size: .87rem; color: var(--fg-dim);
}
.cmds {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .3rem 1.2rem;
}

/* ------------------------------------------------------------------ toasts */

.toasts {
  position: fixed; right: .8rem; bottom: .8rem; z-index: 60;
  display: grid; gap: .4rem; max-width: min(380px, calc(100vw - 1.6rem));
}
.toast {
  padding: .55rem .75rem; border-radius: 9px; font-size: .86rem;
  background: var(--bg-3); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  animation: rise .18s ease-out;
}
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.ok { border-color: var(--accent); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
