:root {
  --bg: #050707;
  --bg-2: #101314;
  --panel: rgba(10, 12, 12, 0.84);
  --panel-strong: rgba(18, 22, 21, 0.94);
  --border: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f5ef;
  --muted: #b7bdb9;
  --accent: #6bbd56;
  --accent-strong: #7cd164;
  --accent-deep: #244f27;
  --accent-soft: rgba(107, 189, 86, 0.16);
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(107, 189, 86, 0.18), transparent 24%),
    radial-gradient(circle at 85% 14%, rgba(118, 35, 93, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(16, 97, 48, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.42)),
    linear-gradient(155deg, var(--bg) 0%, var(--bg-2) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0, rgba(255, 255, 255, 0.06) 1px, transparent 1px, transparent 25%),
    linear-gradient(rgba(255, 255, 255, 0.05) 0, rgba(255, 255, 255, 0.05) 1px, transparent 1px, transparent 25%);
  background-size: 240px 240px;
  opacity: 0.22;
  mask-image: linear-gradient(180deg, black, rgba(0, 0, 0, 0.25));
}

body::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 14%, transparent 86%, rgba(107, 189, 86, 0.08)),
    radial-gradient(circle at center, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.28));
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.login-shell,
.dashboard-shell {
  display: grid;
  place-items: center;
  padding: 32px;
}

.stage,
.dashboard-stage {
  width: 100%;
  max-width: 720px;
}

.dashboard-stage {
  max-width: 1040px;
}

.panel,
.dashboard-panel {
  position: relative;
  overflow: hidden;
  padding: 48px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel::before,
.dashboard-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.brand-stack {
  display: grid;
  gap: 6px;
  margin-bottom: 36px;
}

.brand-kicker,
.identity-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.75rem, 7vw, 4.8rem);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-mark.compact {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

.copy-block {
  display: grid;
  gap: 12px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
}

.panel-title,
.identity-name {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.panel-copy,
.support-copy,
.identity-meta,
.action-copy,
.config-notice {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.auth-zone {
  display: grid;
  gap: 14px;
  padding: 28px 0 24px;
}

.google-slot {
  min-height: 44px;
}

.auth-message {
  min-height: 24px;
  color: #ffd8a3;
}

.config-notice {
  padding: 16px 18px;
  border: 1px dashed rgba(107, 189, 86, 0.4);
  border-radius: 14px;
  background: rgba(107, 189, 86, 0.08);
}

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

.dashboard-title-block {
  min-width: 0;
}

.dashboard-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}

.account-actions form {
  margin: 0;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ghost-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
  text-decoration: none;
}

.identity-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #4e9241, #77c960);
  color: #081007;
  font-weight: 700;
  font-size: 1.5rem;
}

.avatar-compact {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.identity-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.identity-inline-name,
.identity-inline-meta {
  margin: 0;
}

.identity-inline-name {
  font-size: 0.98rem;
  font-weight: 700;
}

.identity-inline-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.player-panel {
  display: grid;
  gap: 14px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.stream-player {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.stream-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.player-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
}

.settings-panel {
  display: grid;
  gap: 24px;
}

.settings-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.settings-label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.settings-help,
.settings-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.settings-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(3, 5, 5, 0.78);
  color: var(--text);
  font: inherit;
}

.settings-select {
  appearance: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.settings-textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(140px, 0.7fr) auto;
  gap: 10px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(140px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-field {
  min-width: 0;
}

.user-row .settings-input {
  min-height: 42px;
  padding: 10px 12px;
}

.user-remove {
  min-height: 42px;
  padding: 10px 14px;
}

.settings-input:focus {
  outline: 2px solid rgba(107, 189, 86, 0.35);
  outline-offset: 2px;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.user-actions {
  gap: 10px;
  justify-content: space-between;
}

.primary-button {
  border: 1px solid rgba(107, 189, 86, 0.5);
  background: linear-gradient(180deg, #72c25a, #58a947);
  color: #f5f8f1;
  padding: 12px 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.settings-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-message.success {
  background: rgba(107, 189, 86, 0.12);
  border-color: rgba(107, 189, 86, 0.3);
}

.settings-message.error {
  background: rgba(167, 86, 86, 0.12);
  border-color: rgba(167, 86, 86, 0.26);
}

.action-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.action-card {
  display: grid;
  gap: 8px;
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 180ms ease, border-color 180ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(107, 189, 86, 0.38);
  text-decoration: none;
}

.action-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 720px) {
  .login-shell,
  .dashboard-shell {
    padding: 16px;
  }

  .panel,
  .dashboard-panel {
    padding: 28px;
    border-radius: 24px;
  }

  .dashboard-head,
  .dashboard-controls,
  .player-meta,
  .identity-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-pill,
  .account-actions {
    width: 100%;
  }

  .account-actions {
    margin-left: 0;
  }

  .identity-inline {
    width: 100%;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-list-header {
    display: none;
  }
}