:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #eaf0f2;
  background: #101719;
  --panel: #192326;
  --line: #334246;
  --muted: #b3c1c4;
  --accent: #91e4c7;
}

* { box-sizing: border-box; }
body { min-width: 0; margin: 0; }
button, input { font: inherit; }
button {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #213034;
  color: inherit;
  cursor: pointer;
}
button:hover { background: #2c4044; }
button[aria-pressed="true"] { color: var(--accent); border-color: #648e82; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); letter-spacing: -.04em; }
.muted { color: var(--muted); }

.shell { width: min(100% - 28px, 1120px); margin: clamp(14px, 5vh, 54px) auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.player { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #080d0f; }
.screen { position: relative; display: grid; place-items: center; aspect-ratio: 16/9; min-height: 158px; max-height: 70svh; overflow: hidden; }
.screen img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; user-select: none; }
.screen.is-pannable { cursor: grab; touch-action: none; }
.screen.is-pannable:active { cursor: grabbing; }
.screen p { padding: 0 16px; text-align: center; color: var(--muted); }
.player-top, .player-bottom {
  position: absolute;
  z-index: 1;
  inset-inline: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.player-top { top: 10px; }
.player-bottom { bottom: 10px; }
.player button, .status { background: #101719e8; }
.player button { min-width: 44px; pointer-events: auto; touch-action: manipulation; }
.player button:not(:disabled):hover { background: #2c4044; }
.player button:disabled { opacity: .6; cursor: default; }
.zoom-controls { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.zoom-controls button { border: 0; border-radius: 0; }
.zoom-controls button + button { border-inline-start: 1px solid var(--line); }
.zoom-controls button:focus-visible { outline-offset: -3px; }
#zoom-reset { min-width: 64px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.collapse-icon, #fullscreen[aria-pressed="true"] .expand-icon { display: none; }
#fullscreen[aria-pressed="true"] .collapse-icon { display: inline; }
.status { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: .85rem; }
.status::before { content: ''; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #f2c688; }
.status[data-state="live"] { color: var(--accent); }
.status[data-state="live"]::before { background: var(--accent); }
.status[data-state="offline"]::before { background: #ff9c9c; }
.player.is-fullscreen {
  position: fixed;
  z-index: 10;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  border: 0;
  border-radius: 0;
}
body.has-fullscreen-player { overflow: hidden; }
.player.is-fullscreen .screen { height: 100%; min-height: 0; max-height: none; aspect-ratio: auto; }
.player.is-fullscreen :is(.player-top, .player-bottom) {
  left: calc(12px + env(safe-area-inset-left));
  right: calc(12px + env(safe-area-inset-right));
}
.player.is-fullscreen .player-top { top: calc(12px + env(safe-area-inset-top)); }
.player.is-fullscreen .player-bottom { bottom: calc(12px + env(safe-area-inset-bottom)); }

.login-page { display: grid; place-items: center; min-height: 100svh; padding: 16px; }
.login-card { width: min(100%, 410px); padding: clamp(22px, 6vw, 34px); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; }
.mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #263e3a; color: var(--accent); margin-bottom: 16px; }
.login-card h1 { margin-bottom: 4px; }
.login-card form { display: grid; gap: 14px; margin-top: 22px; }
.login-card label { display: grid; gap: 6px; }
.login-card input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #637479; border-radius: 10px; color: inherit; background: #101719; }
.primary { background: var(--accent); color: #102523; font-weight: 700; }
.primary:hover { background: #b4f4e0; }
.error { margin-top: 16px; color: #ffb4af; }
