:root {
  color-scheme: dark;
  --page: #191924;
  --panel: #242431;
  --surface: #30303f;
  --line: #424251;
  --text: #fbf7f2;
  --muted: #c1bfc9;
  --accent: #ffbc76;
  --ink: #352415;
  font: 100%/1.45 "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--page); }
button, select, input { font: inherit; }
button, select {
  min-height: 2.75rem;
  border: 1px solid #656371;
  border-radius: .55rem;
  background-color: var(--surface);
  color: var(--text);
}
button { padding: .55rem .95rem; font-weight: 600; cursor: pointer; }
button:enabled:hover, summary:hover { background-color: #3b3a4a; }
button:disabled { color: #c2bfca; background: #393846; border-color: #484755; cursor: not-allowed; }
:where(button, input, select, summary, a):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.primary, .invite { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.primary:enabled:hover, .invite:enabled:hover { background: #ffd29f; border-color: #ffd29f; }
.stop { color: #ffe7df; background: #763a3b; border-color: #a45b58; }
.stop:enabled:hover { background: #8a4546; }
button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.15rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
h2 { font-size: 1.1rem; font-weight: 600; }
a { color: var(--accent); }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 5; padding: .65rem 1rem; background: var(--panel); }
.skip-link:focus { top: .5rem; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
  max-width: 54rem; margin: 0 auto; min-height: 3.7rem; padding: .65rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 650; text-decoration: none; }
.brand img { border-radius: .3rem; }
.product-name { color: var(--muted); border-left: 1px solid var(--line); padding-left: 1rem; font-size: .9rem; }
main { max-width: 54rem; margin: 0 auto; padding: 1.65rem 1.5rem 2.5rem; }
.room-status { font-size: .95rem; color: var(--muted); }
#status { display: flex; align-items: baseline; gap: .5rem; overflow-wrap: anywhere; }
#status::before { content: ""; background: var(--accent); display: block; flex: 0 0 .45rem; height: .45rem; border-radius: 100%; }
#notice:not(:empty) { margin-top: .45rem; border-left: 2px solid var(--accent); padding: .4rem .65rem; color: var(--text); overflow-wrap: anywhere; }
.title-row, .preview-header, .label-row, .room-actions, .client-tools, .volume-control, .action-row {
  display: flex; align-items: center; gap: .6rem;
}
.title-row { margin: .8rem 0 1.2rem; justify-content: space-between; flex-wrap: wrap; }
.controller { border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); overflow: hidden; }
.preview-header { justify-content: space-between; padding: .55rem 1.35rem; }
.text-button { background: transparent; border-color: transparent; color: var(--accent); font-size: .9rem; }
.track {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(115deg, #fcaa50 0%, #f88449 48%, #ee6047 100%);
}
.track[data-theme="dark"] { background: linear-gradient(110deg, #171a29, #0b0f19 80%); }
.mini { height: clamp(5rem, 14vh, 8rem); margin: 0 1.35rem; border-radius: .55rem; }
.target {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 2.45rem; height: 2.45rem; border-radius: 50%;
  background: #38213a; box-shadow: 0 0 0 2px #fff7e477;
}
.track[data-theme="dark"] .target { background: #a1bada; box-shadow: 0 0 12px #728cbd66; }
.track[data-size="large"] .target { width: 3.75rem; height: 3.75rem; }
.mini .target { width: 1.35rem; height: 1.35rem; }
.mini[data-size="large"] .target { width: 2.1rem; height: 2.1rem; }
.control-body, .settings-content { padding: 1.15rem 1.35rem; }
.transport { display: flex; align-items: center; gap: 1.25rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
#toggle-set { min-height: 3.1rem; min-width: min(13rem, 55%); font-size: 1.1rem; }
.counter { display: flex; align-items: baseline; gap: .4rem; color: var(--muted); }
#passes { color: var(--text); font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.set-fields, .options-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 1.65rem; }
.set-fields { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.field { display: flex; flex-direction: column; justify-content: space-between; gap: .35rem; min-width: 0; }
label, legend { font-weight: 600; }
.label-row { justify-content: space-between; flex-wrap: wrap; gap: .3rem; }
.value { color: var(--accent); font-size: .9rem; font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--accent); width: 100%; min-width: 0; height: 2.75rem; margin: 0; cursor: pointer; }
select { width: 100%; padding: .5rem .7rem; }
.shortcuts, .privacy-link, .headphones p { font-size: .9rem; color: var(--muted); }
.shortcuts { margin-top: .95rem; line-height: 1.7; }
kbd { padding: .06rem .3rem; border: 1px solid #63616e; border-radius: .25rem; font: .85rem/1.2 ui-monospace, monospace; }
.settings { border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: .8rem 1.35rem; font-weight: 600; }
summary::marker { color: var(--accent); }
.settings-content { padding-top: .3rem; }
.checks { margin: 1rem 0 0; border: 0; padding: 0; }
.checks legend { margin-bottom: .3rem; }
.checks label { display: flex; align-items: center; gap: .55rem; min-height: 2.6rem; color: var(--muted); font-weight: 400; }
input[type="checkbox"] { margin: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.room-actions { flex-wrap: wrap; margin: 1rem 0; }
.quiet-danger { border-color: transparent; background: transparent; color: #f5bcb6; }
.privacy-link { text-underline-offset: .2em; }
body:has(#client-view:not([hidden])) main { max-width: none; }
#client-view {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .8rem;
  margin-top: .6rem;
}
.client-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.client-actions button { min-width: 4rem; }
.join-panel, .full, .client-tools { grid-column: 1 / -1; }
.join-panel { padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--panel); }
.join-panel > p { margin-bottom: .7rem; }
.action-row, .client-tools, .volume-control { flex-wrap: wrap; }
.headphones { margin-top: .65rem; }
.headphones summary { padding: .4rem 0; width: fit-content; color: var(--accent); }
.headphones p { margin-bottom: .5rem; }
.full { height: clamp(10rem, 46vh, 38rem); border-radius: .85rem; }
.client-tools { justify-content: space-between; gap: .65rem 1rem; }
.volume-control { color: var(--muted); font-size: .95rem; }
.volume-control input { width: clamp(4rem, 17vw, 10rem); }
body[data-slim="true"] .masthead, body[data-slim="true"] #client-title { display: none; }
body[data-slim="true"] main { padding: .35rem .6rem; }
body[data-slim="true"] #client-view { margin-top: .25rem; gap: .35rem; }
body[data-slim="true"] .client-actions { grid-column: 1 / -1; justify-content: flex-start; }
body[data-slim="true"] .full { height: 4rem; }
body[data-fullscreen="true"], body.is-fullscreen { position: fixed; inset: 0; overflow: auto; z-index: 5; }
body:is([data-fullscreen="true"], .is-fullscreen) .masthead, :fullscreen .masthead { display: none; }
body:is([data-fullscreen="true"], .is-fullscreen):not([data-slim="true"]) .full,
:fullscreen body:not([data-slim="true"]) .full { height: max(9rem, calc(100dvh - 14rem)); }
@media (max-width: 36rem) {
  main { padding: .85rem .8rem 1.4rem; }
  .masthead-inner { min-height: 3rem; padding: .45rem .8rem; gap: .7rem; }
  .product-name { padding-left: .7rem; }
  .title-row { margin: .65rem 0 .8rem; }
  .preview-header { padding: .4rem .8rem; }
  .mini { margin: 0 .8rem; }
  .control-body, .settings-content { padding: .85rem; }
  .set-fields, .options-grid { gap: .7rem; }
  .set-fields { grid-template-columns: minmax(0, 1.3fr) minmax(7rem, 1fr); }
  .shortcuts { font-size: .85rem; }
  .value { font-size: .85rem; }
  .full { height: clamp(8rem, 35vh, 17rem); }
  .room-actions { margin: .65rem 0; }
}
@media (max-width: 22rem) {
  .set-fields, .options-grid { grid-template-columns: minmax(0, 1fr); }
  .product-name { border: 0; padding: 0; }
  .masthead-inner { justify-content: space-between; }
}
@media (max-height: 30rem) {
  .mini { height: 3.3rem; }
  .full { height: clamp(5rem, 27vh, 9rem); }
}
