:root {
  color-scheme: dark;
  --panel-bg: rgba(13, 16, 20, 0.60);
  --panel-border: rgba(255, 255, 255, 0.16);
  --text: #f5f7fb;
  --muted: #aeb7c7;
  --accent: #76e0c1;
  --danger: #ff4f64;
  --control: #242b35;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  cursor: none;
}

body.admin-visible,
body.admin-visible * {
  cursor: default;
}

.screen,
.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
}

.scene {
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
}

.scene.is-active {
  opacity: 1;
  pointer-events: auto;
}

.scene-black {
  z-index: 1;
}

.scene-partners {
  z-index: 2;
  overflow: hidden;
  background: #F3ECEF;
}

.scene-stream {
  z-index: 3;
}

.partner-image {
  position: absolute;
  max-width: min(50vw, 960px);
  max-height: 50vh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.015);
  transition:
    opacity 1200ms ease,
    transform 7200ms ease;
  will-change: opacity, transform;
}

.partner-image.is-active {
  opacity: 1;
  transform: scale(1.075);
}

.stream-frame {
  width: 100vw;
  height: 100vh;
  border: 0;
  background: #000;
}

.login-panel,
.admin-panel {
  position: fixed;
  z-index: 20;
  color: var(--text);
}

.login-panel {
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
}

.login-card {
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 18px;
  color: var(--text);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
}

.login-card label {
  color: var(--muted);
  font-size: 12px;
}

.admin-panel {
  top: 16px;
  left: 16px;
  width: min(440px, calc(100vw - 32px));
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
}

.login-panel[hidden],
.admin-panel[hidden],
.admin-show[hidden] {
  display: none;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-title {
  font-size: 15px;
  font-weight: 700;
}

.admin-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.status-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
}

.status-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.status-item strong {
  display: block;
  min-height: 19px;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.admin-actions,
.override-row,
.settings-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.admin-actions {
  flex-wrap: wrap;
}

.override-row label,
.settings-form label {
  color: var(--muted);
  font-size: 12px;
}

button,
select,
input {
  min-height: 38px;
  border-radius: 6px;
  font: inherit;
}

input[type="checkbox"] {
  min-height: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

button {
  border: 0;
  color: var(--text);
  background: var(--control);
  padding: 0 13px;
  font-weight: 700;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.danger-button {
  background: var(--danger);
  color: #10070a;
}

.plain-button,
.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ghost-button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
}

select,
input {
  min-width: 0;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #10151d;
  padding: 0 10px;
}

.override-row select {
  flex: 1;
}

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.settings-title,
.wide-field {
  grid-column: 1 / -1;
}

.settings-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.settings-form label {
  display: grid;
  gap: 5px;
}

.settings-form input:not([type="checkbox"]) {
  width: 100%;
}

.check-field {
  grid-column: 1 / -1;
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
}

.admin-message {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
}

.admin-show {
  position: fixed;
  z-index: 21;
  top: 16px;
  left: 16px;
  min-height: 34px;
  color: var(--text);
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

@media (max-width: 560px) {
  .admin-panel {
    top: 8px;
    left: 8px;
    width: calc(100vw - 16px);
    padding: 12px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions,
  .override-row,
  .settings-form {
    align-items: stretch;
    display: flex;
    flex-direction: column;
  }

  .check-field {
    align-items: center;
    flex-direction: row;
  }
}
