:root {
  color-scheme: light;
  --green: #7cff6b;
  --green-dim: #57d148;
  --green-deep: #1a3d22;
  --bg: #eef6e8;
  --wash-a: #d8f8b8;
  --wash-b: #c8f08a;
  --card: #ffffff;
  --card-edge: #d7e3ce;
  --text: #161916;
  --muted: #6b746d;
  --ink: #06120a;
  --hover: #e4efd8;
  --amber: #c4921a;
  --red: #e23b3b;
  --dot-idle: #6b6b6b;
  --dot-on: #32d74b;
  --dot-off: #ff5c5c;
}

@font-face {
  font-family: "Material Icons";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/MaterialIcons-Regular.woff2") format("woff2");
}

.material-icons {
  display: inline-block;
  font-family: "Material Icons";
  font-weight: 400;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 18%, var(--wash-a) 0%, transparent 36%),
    radial-gradient(circle at 88% 82%, var(--wash-b) 0%, transparent 32%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

h1, h2, .code, .code-input, .res-chip, .topbar-code, .brand-mark {
  font-family: inherit;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

button {
  appearance: none;
  min-height: 40px;
  border: 1px solid var(--green-deep);
  border-radius: 999px;
  padding: 8px 18px;
  background: var(--green);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--green-dim); }
button:disabled { opacity: 0.35; cursor: not-allowed; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border-color: transparent;
  border-radius: 50%;
}

.icon-btn:hover:not(:disabled) { background: var(--hover); }

.icon-btn .material-icons { font-size: 22px; }

.icon-btn--danger { color: var(--red); }
.icon-btn--danger:hover:not(:disabled) { background: #fde8e8; }

.icon-btn.is-copied { color: var(--green); }
.icon-btn.is-muted { opacity: 0.35; }

.btn-big {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 32px;
  font-size: 17px;
}

.btn-big .material-icons { font-size: 22px; }

.btn-ghost {
  background: #fff;
  border-color: var(--card-edge);
  color: var(--text);
  font-weight: 700;
}

.btn-ghost:hover:not(:disabled) { background: var(--hover); }

.btn-danger {
  background: #fff;
  border-color: var(--red);
  color: var(--red);
}

.btn-danger:hover:not(:disabled) { background: #fde8e8; }

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--card-edge);
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--card);
  color: var(--text);
}

input::placeholder { color: var(--muted); }
input:focus {
  border-color: var(--green);
  outline: none;
}

.status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status.ok { color: #2a9a3a; }
.status.err { color: var(--red); }

.brand-mark {
  margin: 0;
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3em;
}

.cook-logo {
  display: block;
  width: 180px;
  overflow: visible;
}

.cook-logo .cook-bubble-shadow path { fill: var(--green); }
.cook-logo .cook-bubble path { fill: #000; }
.cook-logo .cook-letters path { fill: #fff; }

.cook-logo--sm { width: 240px; }

.cook-logo--login {
  margin: 0 0 24px;
  justify-self: center;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-idle);
  box-shadow: 0 0 0 3px rgba(107, 107, 107, 0.18);
}

.dot[data-state="on"] {
  background: var(--dot-on);
  box-shadow: 0 0 0 3px rgba(50, 215, 75, 0.22);
}

.dot[data-state="off"] {
  background: var(--dot-off);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.22);
}

/* ── 登录：浅色卡片 ── */
.page-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card {
  display: grid;
  gap: 6px;
  justify-items: stretch;
  width: min(360px, calc(100% - 32px));
  border: 0;
  border-radius: 28px;
  padding: 36px 28px 28px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(20, 40, 10, 0.08);
}

.login-card label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-card input {
  margin-bottom: 10px;
}

.login-card input:focus { border-color: var(--green); }

.login-card button { margin-top: 8px; }

.login-card .status {
  margin-top: 8px;
  text-align: center;
  color: #6b746d;
}

.login-card .status.err { color: #c62828; }

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #06120a;
  font-size: 13px;
  font-weight: 800;
}

/* ── 顶栏 ── */
.topbar-mark {
  width: 32px;
  height: 32px;
  flex: none;
  margin: 0 2px 0 4px;
  filter: drop-shadow(3px 3px 0 var(--green));
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.topbar-user .avatar {
  width: 28px;
  height: 28px;
  margin-right: 4px;
  background: var(--ink);
  color: var(--green);
  font-size: 12px;
}

.page-watch.is-in-room .topbar-user { display: none; }

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid var(--card-edge);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.55);
}

.topbar-spring { flex: 1; }

.route-chip {
  width: 22px;
  height: 22px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.route-chip .material-icons { font-size: 20px; }

.route-chip.is-direct { color: var(--green); }
.route-chip.is-relay { color: var(--amber); }

.res-chip {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.topbar-code {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.page-share.is-room .topbar-code {
  font-size: 18px;
  letter-spacing: 0.2em;
}

.copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border-color: transparent;
  padding: 4px 12px 4px 8px;
  background: var(--ink);
  color: var(--green);
  font-size: 13px;
}

.copy-link-btn:hover:not(:disabled) {
  background: #1a1a1a;
  color: var(--green);
}

.copy-link-btn .material-icons { font-size: 18px; }

.copy-link-btn.is-copied {
  background: var(--green);
  color: var(--ink);
}

.stop-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 4px 14px 4px 8px;
  border-color: transparent;
  background: var(--red);
  color: #fff;
  font-size: 13px;
}

.stop-pill:hover:not(:disabled) {
  background: #c92f2f;
  color: #fff;
}

.stop-pill .material-icons { font-size: 18px; }

.topbar-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.open-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  border: 0;
  border-radius: 0;
  padding: 0 4px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.open-download:hover:not(:disabled) {
  background: transparent;
  color: var(--green-deep);
}

.open-download .material-icons { font-size: 18px; }

@media (max-width: 480px) {
  .topbar-brand { display: none; }
}

/* ── 首页 / 共享 / 观看 ── */
.page-home,
.page-share,
.page-watch {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.share-main,
.watch-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 0;
  padding: 24px;
}

.page-share.is-setup .share-main {
  align-items: center;
  justify-content: center;
}

.setup {
  display: none;
  width: min(460px, calc(100% - 32px));
}

.page-share.is-setup .setup { display: block; }
.page-share.is-setup .room { display: none !important; }

.page-share.is-room.is-tuning .setup {
  display: block;
  position: fixed;
  z-index: 6;
  top: 58px;
  left: 50%;
  width: min(460px, calc(100% - 280px));
  transform: translateX(-50%);
}

.page-share.is-live:not(.is-tuning) .setup { display: none; }

.setup-card {
  display: grid;
  gap: 12px;
  width: 100%;
  border-radius: 28px;
  padding: 28px 24px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(20, 40, 10, 0.08);
}

.setup-card .btn-big { width: 100%; }

.page-share.is-room .share-main,
.page-watch.is-in-room .watch-main {
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  padding: 0;
}

.room {
  display: none;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) 240px;
  min-height: 0;
  width: 100%;
}

.page-share.is-room .room,
.page-watch.is-in-room .room { display: grid; }

.room-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-width: 0;
  min-height: 0;
  padding: 24px;
}

.room-lobby {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: min(460px, 100%);
}

.room-wait {
  text-align: center;
}

.room-roster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  border-left: 1px solid var(--card-edge);
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.55);
}

.room-roster-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 8px 8px;
}

.room-roster-head small {
  color: var(--muted);
  font-size: 12px;
}

.member-list { display: grid; gap: 4px; }

.member {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 8px 10px;
}

.member .avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.member strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-tag {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.member.is-host .member-tag {
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--green);
  color: var(--ink);
}

.member.is-direct .member-tag { color: var(--green-deep); }
.member.is-relay .member-tag { color: var(--amber); }

.lobby {
  display: grid;
  gap: 20px;
  justify-items: center;
  width: min(460px, 100%);
}

.plaque {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 20px;
  padding: 26px 16px;
  background: #111;
  box-shadow: 0 12px 32px rgba(20, 40, 10, 0.08);
}

.plaque .icon-btn { color: #fff; }
.plaque .icon-btn:hover:not(:disabled) { background: #2a2a2a; }

.watch-link {
  margin: 0;
  max-width: min(460px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  word-break: break-all;
  text-align: center;
}

.code {
  color: var(--green);
  font-size: clamp(34px, 8vw, 46px);
  font-weight: 800;
  letter-spacing: 0.18em;
}

.quality {
  display: grid;
  gap: 12px;
  width: min(460px, 100%);
}

.quality-label {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-audio {
  justify-self: start;
  margin-top: 4px;
}

.is-live .quality:not(.setup-card) {
  position: fixed;
  z-index: 5;
  top: 58px;
  right: 252px;
  width: 300px;
  border: 0;
  border-radius: 20px;
  padding: 14px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(20, 40, 10, 0.12);
}

.quality-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quality-option { cursor: pointer; }

.quality-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.quality-option__body {
  display: grid;
  gap: 2px;
  justify-items: center;
  border: 1px solid var(--card-edge);
  border-radius: 16px;
  padding: 12px 6px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.quality-option__body span { font-size: 11px; }

.quality-option input:checked + .quality-option__body {
  border-color: transparent;
  background: var(--green);
  color: var(--ink);
}

.quality-option input:disabled + .quality-option__body { opacity: 0.35; }

.helper {
  margin: 0;
  color: var(--amber);
  font-size: 12px;
  text-align: center;
}

.viewers {
  display: grid;
  gap: 8px;
  width: 100%;
}

.viewers-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.viewer-list { display: grid; gap: 6px; }

.viewer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  padding: 8px 12px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(20, 40, 10, 0.06);
}

.viewer-card.is-empty { display: none; }

.viewer-card__avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.viewer-card strong { display: block; font-size: 14px; }

.viewer-card span {
  color: var(--muted);
  font-size: 11px;
}

.viewer-card.is-direct span { color: var(--green); }
.viewer-card.is-relay span { color: var(--amber); }
.viewer-card.is-relay .viewer-card__avatar {
  background: #fff3d0;
  color: #9a6b00;
}

.stage {
  position: relative;
  display: none;
  flex: 1;
  place-items: center;
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}

.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.stage-empty {
  position: absolute;
  z-index: 1;
  display: grid;
  justify-items: center;
}

.page-share.is-room .room-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 10px;
}

.page-share.is-room .stage {
  display: grid;
  flex: 1;
}

.is-live .share-main,
.is-watching .watch-main { padding: 0; }

.is-live .lobby,
.page-share.is-room .lobby,
.is-watching .join-box,
.page-watch.is-in-room .join-box { display: none; }

.is-live .room-lobby,
.is-watching .room-wait { display: none; }

.is-live .room-main,
.is-watching .room-main {
  align-items: stretch;
  justify-content: stretch;
  padding: 10px;
}

.is-live .stage,
.is-watching .stage { display: grid; flex: 1; }

.join-box {
  display: grid;
  gap: 14px;
  width: min(380px, 100%);
}

.code-input {
  min-height: 56px;
  border-radius: 20px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  box-shadow: 0 8px 20px rgba(20, 40, 10, 0.06);
}

.page-admin {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-admin .topbar strong {
  font-size: 16px;
}

.page-admin .topbar .avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  width: min(720px, calc(100% - 32px));
  margin: 24px auto 0;
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px var(--card-edge);
}

.admin-tab {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  padding: 6px 16px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.admin-tab .material-icons { font-size: 20px; }
.admin-tab:hover:not(.is-on) { background: rgba(255, 255, 255, 0.7); }

.admin-tab.is-on {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(20, 40, 10, 0.1);
}

.admin-tab.is-on:hover { background: var(--card); }

.admin-tab small:not(:empty) {
  min-width: 20px;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--green);
  color: var(--ink);
  font-size: 11px;
  line-height: 18px;
}

.console {
  display: grid;
  width: min(720px, calc(100% - 32px));
  margin: 16px auto 40px;
}

.panel {
  display: grid;
  gap: 12px;
  border-radius: 28px;
  padding: 20px 20px 16px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(20, 40, 10, 0.08);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.panel-sum {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 36px;
}

.live-tick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf3e6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.live-tick i,
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-on);
  flex: none;
}

.live-tick i { animation: live-pulse 3s ease-in-out infinite; }
.live-tick.is-stale i { background: var(--dot-off); animation: none; }

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .live-tick i { animation: none; }
}

.live-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-legend span { display: inline-flex; align-items: center; gap: 6px; }
.live-legend i { width: 10px; height: 10px; border-radius: 3px; }
.live-legend small { margin-left: auto; font-size: 11px; }

.m-cap { --m: #1a3d22; }
.m-enc { --m: var(--green-dim); }
.m-see { --m: var(--amber); }
.live-legend .m-cap,
.live-legend .m-enc,
.live-legend .m-see { background: var(--m); }

.live-list { display: grid; gap: 12px; }

.live-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 1px dashed var(--card-edge);
  border-radius: 20px;
  padding: 36px 16px;
  color: var(--muted);
}

.live-empty .material-icons { font-size: 32px; opacity: 0.6; }
.live-empty p { margin: 0; font-size: 14px; font-weight: 700; }

.room-card {
  display: grid;
  gap: 2px;
  border: 1px solid var(--card-edge);
  border-radius: 20px;
  padding: 14px 16px 10px;
}

.room-card.is-off { border-color: #f3c2c2; background: #fff8f8; }
.room-card.is-off .live-dot { background: var(--dot-off); }

.room-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
}

.room-code {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.room-host {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
}

.room-age {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 12px;
  border-top: 1px solid #edf3e6;
  padding: 10px 0;
}

.viewer-who {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  min-width: 0;
}

.viewer-who strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-who small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.avatar-sm {
  grid-row: span 2;
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.viewer-wait {
  margin: 0;
  padding: 8px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.viewer .viewer-wait { padding: 0; }

.meters { display: grid; gap: 4px; }

.meter {
  display: grid;
  grid-template-columns: 1fr 28px;
  align-items: center;
  gap: 8px;
}

.meter-bar {
  height: 6px;
  border-radius: 999px;
  background: #edf3e6;
  overflow: hidden;
}

.meter-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--m);
  transition: width 400ms ease;
}

.meter b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 14px;
}

.btn-add .material-icons { font-size: 18px; }

.people-find {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 14px;
  background: #f3f7ef;
  color: var(--muted);
}

.people-find .material-icons { font-size: 18px; }

.people-find input {
  flex: 1;
  min-height: 38px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.people-find input:focus-visible { outline: none; }
.people-find:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }

.panel-people .status:empty { display: none; }
.panel-people .status { margin: 0; padding: 0 4px; }

.admin-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.admin-sheet-card input:not([type="checkbox"]) { width: 100%; }

@media (max-width: 520px) {
  .viewer { grid-template-columns: 1fr; gap: 8px; }
  .live-legend small { display: none; }
}

.admin-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.admin-switch input {
  appearance: none;
  width: 36px;
  min-height: 22px;
  height: 22px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #d7e3ce;
  box-shadow: inset 0 0 0 1px var(--card-edge);
  cursor: pointer;
}

.admin-switch input::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 40, 10, 0.18);
  transition: transform 140ms ease;
}

.admin-switch input:checked {
  background: var(--green);
  box-shadow: none;
}

.admin-switch input:checked::after { transform: translateX(14px); }

.admin-list { display: grid; }

.admin-user {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  padding: 10px 12px;
}

.admin-user:hover { background: var(--hover); }

.admin-user-meta { min-width: 0; }

.admin-user-meta strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.admin-user-line small { color: var(--muted); font-size: 11px; }

.admin-badge {
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  background: #edf3e6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-badge:hover:not(:disabled) { background: #dce8d0; }

.admin-badge.is-admin {
  background: var(--green);
  color: var(--ink);
}

.admin-points {
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  background: #111;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.admin-points:hover:not(:disabled) { background: #2a2a2a; }

.admin-user-actions {
  display: flex;
  gap: 2px;
}

.admin-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 25, 22, 0.28);
}

.admin-sheet[hidden] { display: none !important; }

.admin-sheet-card {
  display: grid;
  gap: 10px;
  width: min(320px, 100%);
  border-radius: 24px;
  padding: 24px;
  background: var(--card);
  box-shadow: 0 18px 40px rgba(20, 40, 10, 0.16);
}

.admin-sheet-card strong { font-size: 18px; }

.admin-sheet-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-sheet-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.join-box .status { text-align: center; }

.stage:fullscreen,
.stage:-webkit-full-screen {
  border-radius: 0;
  background: #000;
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 8px 10px; }
  .page-share.is-room.is-tuning .setup {
    left: 12px;
    width: calc(100% - 24px);
    transform: none;
  }
  .page-share.is-room .room,
  .page-watch.is-in-room .room {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .room-roster {
    order: -1;
    max-height: 36vh;
    border-left: 0;
    border-bottom: 1px solid var(--card-edge);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
