:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b0c10;
  color: #f4f4f5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #858995;
  --line: rgba(255, 255, 255, 0.09);
  --green: #c5f36a;
  --green-ink: #17220b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 49% 0%, rgba(98, 124, 55, 0.13), transparent 35rem),
    #0b0c10;
}

button, a { font: inherit; }

.app-shell {
  width: min(1160px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  font-weight: 800;
}

.brand-mark { font-size: 23px; letter-spacing: -1.8px; color: var(--green); }
.mode-tabs { display: flex; justify-content: center; gap: 7px; margin: 20px 0 -18px; }
.mode-tab { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; color: #a8abb2; text-decoration: none; font-size: 13px; font-weight: 700; transition: background 120ms ease, color 120ms ease; }
.mode-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.mode-tab[aria-current="page"] { border-color: rgba(197, 243, 106, 0.35); background: rgba(197, 243, 106, 0.12); color: var(--green); }
.mode-tab:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.brand-domain { color: #8d9098; font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }

.room-indicator, .eyebrow, .connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9da19e;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.indicator-dot, .connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #575b63;
}

.room { width: 100%; margin: auto 0; padding: 50px 0 54px; }

.room-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.eyebrow { margin: 0 0 12px; color: var(--green); }
h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.055em;
  font-weight: 700;
}

.room-status { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.viewer-count {
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.viewer-count strong { color: #f4f4f5; font-size: 27px; line-height: 1.1; }

.stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(67vh, 690px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: #050608;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

.stage video { width: 100%; height: 100%; object-fit: contain; background: #050608; }
.stage video[hidden] { display: none; }

.stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.screen-icon {
  position: relative;
  width: 53px;
  height: 38px;
  margin-bottom: 23px;
  border: 1px solid rgba(197, 243, 106, 0.45);
  border-radius: 8px;
}

.screen-icon::before { content: ''; position: absolute; left: 9px; right: 9px; top: 8px; height: 1px; background: rgba(197, 243, 106, 0.7); }
.screen-icon span { position: absolute; left: 15px; right: 15px; bottom: -6px; height: 5px; border-bottom: 1px solid rgba(197, 243, 106, 0.45); }
.screen-icon i { position: absolute; width: 1px; height: 5px; left: 25px; bottom: -5px; background: rgba(197, 243, 106, 0.45); }
.stage-empty p { margin: 0; color: #e3e5df; font-size: 16px; font-weight: 600; }
.stage-empty .stage-hint { max-width: 430px; margin-top: 8px; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.55; }

.fullscreen-button {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 15px 21px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(20, 22, 26, 0.9);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.fullscreen-button:hover { background: #fff; color: #111; }
.fullscreen-button:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.fullscreen-button:disabled { opacity: 0.72; cursor: wait; }
.fullscreen-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.stage-error {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  max-width: 620px;
  margin: 0 auto;
  padding: 13px 16px;
  border: 1px solid rgba(255, 177, 160, 0.3);
  border-radius: 10px;
  background: rgba(49, 20, 18, 0.9);
  color: #ffd3cb;
  font-size: 13px;
  line-height: 1.5;
}

.controls { display: flex; align-items: center; gap: 16px; margin-top: 22px; }

.primary-button {
  min-width: 260px;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  border: 0;
  border-radius: 11px;
  background: var(--green);
  color: var(--green-ink);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.primary-button:hover:not(:disabled) { background: #d7ff86; transform: translateY(-1px); }
.primary-button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.primary-button:disabled { opacity: 0.5; cursor: wait; }
.button-icon { width: 17px; text-align: center; font-size: 13px; }
.controls-note { color: #858995; font-size: 12px; }
.notice { margin: 15px 0 0; color: #ffb9ab; font-size: 13px; line-height: 1.5; }

.footer {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: #727681;
  font-size: 11px;
}

.connection { font-size: 10px; letter-spacing: 0.08em; }
.connection.is-connected .connection-dot { background: var(--green); box-shadow: 0 0 10px rgba(197, 243, 106, 0.5); }
.room-indicator.is-live .indicator-dot { background: #f36862; box-shadow: 0 0 10px rgba(243, 104, 98, 0.55); }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .app-shell { width: min(100% - 28px, 1160px); }
  .topbar { height: 66px; }
  .mode-tabs { margin: 15px 0 -10px; }
  .mode-tab { min-height: 35px; padding: 0 13px; font-size: 12px; }
  .room { padding: 38px 0 36px; }
  .room-heading { align-items: flex-start; }
  .room-status { max-width: 220px; font-size: 13px; line-height: 1.45; }
  .stage { border-radius: 12px; }
  .stage-empty p { font-size: 14px; }
  .stage-empty .stage-hint { font-size: 12px; }
  .fullscreen-button { right: 10px; bottom: 10px; padding: 10px 12px; font-size: 12px; }
  .controls { flex-direction: column; align-items: stretch; gap: 11px; }
  .primary-button { width: 100%; }
  .controls-note { text-align: center; }
  .footer { min-height: 58px; font-size: 10px; }
  .connection { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

