@font-face {
  font-family: "Sofia Pro";
  src: url("../fonts/sofia-pro-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sofia Pro";
  src: url("../fonts/sofia-pro-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sofia Pro";
  src: url("../fonts/sofia-pro-black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050811;
  --panel: rgba(5, 11, 28, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f5f8ff;
  --muted: rgba(229, 236, 255, 0.76);
  --accent: #0033ff;
  --accent-strong: #1f63ff;
  --error: #ff8ba4;
  --success: #96e4bf;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  --brand-line: linear-gradient(90deg, #22d5ff 0%, #1d52ff 42%, #ff24bc 76%, #ff9d1a 100%);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Sofia Pro", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(0, 179, 255, 0.14), transparent 26%),
    radial-gradient(circle at 85% 20%, rgba(67, 71, 255, 0.18), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(0, 153, 255, 0.18), transparent 36%),
    linear-gradient(180deg, #090d1a 0%, #050811 100%);
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.shell-wide {
  width: min(100%, 1120px);
}

.live-page .shell-wide {
  padding-top: 0;
  padding-bottom: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  margin: 0;
  max-width: 38ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

textarea {
  width: 100%;
  min-height: 160px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  resize: vertical;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(97, 147, 255, 0.95);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(0, 51, 255, 0.16);
}

button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

button {
  border: 0;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #fff;
  box-shadow: 0 18px 30px rgba(0, 51, 255, 0.35);
}

button[disabled] {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.secondary-button {
  border: 0;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #fff;
  box-shadow: 0 18px 30px rgba(0, 51, 255, 0.35);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.status.error {
  color: var(--error);
}

.status.success {
  color: var(--success);
}

.session-actions,
.player-header,
.player-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.session-actions {
  margin-top: 18px;
}

.hidden {
  display: none !important;
}

body[data-page="login"] {
  background:
    radial-gradient(circle at 16% 18%, rgba(3, 138, 255, 0.18), transparent 26%),
    radial-gradient(circle at 88% 22%, rgba(58, 60, 255, 0.2), transparent 24%),
    radial-gradient(circle at 60% 100%, rgba(0, 214, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #000 0%, #050811 100%);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #000;
}

.brand-rail {
  padding: 22px clamp(20px, 4vw, 48px);
  background: #000;
}

.brand-rail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-rail-top::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 22px;
  background: var(--brand-line);
}

.brand-rail-line {
  height: 2px;
  background: var(--brand-line);
}

.brand-logo {
  width: clamp(170px, 18vw, 250px);
}

.brand-logo-link {
  display: inline-flex;
}

.brand-logout-button {
  flex: 0 0 auto;
}

.live-page .brand-rail-bottom {
  display: grid;
  gap: 22px;
}

.live-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.live-question-button {
  min-height: 52px;
  padding: 0 22px;
  white-space: nowrap;
}

.login-stage {
  padding: 0 clamp(20px, 4vw, 48px);
  background: #000;
}

.login-hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(580px, 78vh, 920px);
  background:
    linear-gradient(115deg, rgba(4, 12, 34, 0.82) 0%, rgba(34, 21, 83, 0.52) 45%, rgba(9, 34, 88, 0.18) 82%),
    url("../images/index-pic.jpg") center center / cover no-repeat;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 84%, rgba(39, 134, 255, 0.32), transparent 24%),
    radial-gradient(circle at 38% 16%, rgba(255, 95, 189, 0.12), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(0, 204, 255, 0.14), transparent 20%);
}

.login-content,
.hero-figure {
  position: relative;
  z-index: 1;
}

.login-content {
  width: min(100%, 820px);
  padding: clamp(44px, 7vw, 96px) clamp(18px, 3vw, 34px) 44px;
}

.login-content h1 {
  margin: 18px 0 16px;
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.access-card {
  width: min(100%, 420px);
  margin-top: 28px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(7, 14, 34, 0.82), rgba(7, 14, 34, 0.96)),
    radial-gradient(circle at top left, rgba(31, 99, 255, 0.18), transparent 42%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.form-intro {
  margin-bottom: 20px;
}

.form-intro h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1;
}

.form-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-figure {
  position: absolute;
  top: clamp(20px, 3vw, 34px);
  right: clamp(10px, 3vw, 26px);
  bottom: 0;
  width: min(54%, 620px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}

.hero-person {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 28px 42px rgba(0, 0, 0, 0.35));
}

body[data-page="live"] .player-panel {
  padding: 28px;
}

body[data-page="stats"],
body[data-page="manage"] {
  background:
    radial-gradient(circle at 18% 14%, rgba(0, 214, 255, 0.16), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(31, 99, 255, 0.18), transparent 22%),
    linear-gradient(180deg, #02060d 0%, #050811 100%);
}

body[data-page="ask-question"] {
  background:
    radial-gradient(circle at 16% 18%, rgba(0, 196, 255, 0.18), transparent 24%),
    radial-gradient(circle at 80% 24%, rgba(31, 99, 255, 0.2), transparent 24%),
    linear-gradient(180deg, #02060d 0%, #050811 100%);
}

.stats-page .brand-rail-bottom {
  display: grid;
  gap: 22px;
}

.ask-page .brand-rail-bottom {
  display: grid;
  gap: 22px;
}

.ask-panel {
  padding: 30px;
}

.ask-panel .stats-panel-head h1 {
  margin: 0;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

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

.question-success-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}

.stats-shell {
  padding-top: 32px;
  padding-bottom: 40px;
}

.stats-panel {
  padding: 30px;
}

.stats-panel + .stats-panel {
  margin-top: 24px;
}

.stats-panel-head {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.stats-panel-head h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.stats-panel-head-spread {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.manage-login-form {
  width: min(100%, 420px);
}

.stats-toolbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.questions-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manage-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-summary-card {
  display: grid;
  gap: 10px;
  min-height: 144px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(10, 18, 42, 0.84), rgba(6, 11, 24, 0.96)),
    radial-gradient(circle at top left, rgba(34, 213, 255, 0.16), transparent 38%);
}

.stats-summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-summary-card strong {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.stats-table-toolbar {
  margin-top: 24px;
  margin-bottom: 12px;
}

.stats-search-field {
  width: min(100%, 420px);
}

.stats-table-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(7, 12, 24, 0.82);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.questions-table {
  min-width: 980px;
}

.questions-table tbody td:nth-child(3) {
  min-width: 360px;
  white-space: normal;
}

.stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 16px 18px;
  background: rgba(10, 18, 42, 0.98);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.stats-table tbody td {
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  vertical-align: top;
  line-height: 1.45;
}

.stats-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.stats-empty {
  color: var(--muted);
  text-align: center;
}

.manage-actions-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.manage-action-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(10, 18, 42, 0.84), rgba(6, 11, 24, 0.96)),
    radial-gradient(circle at top left, rgba(34, 213, 255, 0.12), transparent 42%);
}

.manage-action-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
}

.manage-action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.manage-card-actions {
  display: grid;
  gap: 10px;
}

.manage-danger-button {
  border-color: rgba(255, 139, 164, 0.5);
  background: rgba(255, 139, 164, 0.08);
  color: #ffd4de;
}

.manage-danger-button:hover {
  background: rgba(255, 139, 164, 0.16);
}

body[data-page="live"] .player-header {
  margin-bottom: 16px;
}

body[data-page="live"] .player-header h1 {
  margin: 12px 0 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.95;
}

.player-shell {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #05070b;
}

.player-shell iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
  pointer-events: none;
}

.player-placeholder {
  min-height: min(56vh, 520px);
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(circle at top, rgba(31, 99, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(7, 14, 34, 0.92), rgba(5, 7, 11, 0.98));
}

.player-placeholder.player-placeholder-video {
  position: relative;
  min-height: 0;
  display: block;
  padding: 0;
  background: #05070b;
}

.player-unmute-button {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(5, 7, 11, 0.82);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.player-placeholder strong {
  color: var(--text);
  font-size: clamp(22px, 3.2vw, 32px);
}

.player-placeholder p {
  max-width: 42ch;
  margin: 0;
}

@media (max-width: 920px) {
  .login-hero {
    min-height: auto;
    padding-bottom: 26px;
  }

  .login-content {
    width: min(100%, 560px);
    padding-bottom: 0;
  }

  .hero-figure {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: min(100%, 480px);
    height: auto;
    margin: 12px 0 0 auto;
    padding: 0 18px;
  }

  .hero-person {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .stats-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manage-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .brand-rail {
    padding-right: 20px;
    padding-left: 20px;
  }

  .brand-rail-top::after {
    margin-top: 18px;
  }

  .live-page .brand-rail-bottom {
    gap: 18px;
  }

  .live-footer-actions {
    display: grid;
    width: 100%;
  }

  .live-footer-actions .brand-logo {
    justify-self: start;
  }

  .login-stage {
    padding: 0;
  }

  .login-content {
    padding: 30px 20px 0;
  }

  .login-content h1 {
    margin-top: 16px;
    font-size: clamp(30px, 9vw, 44px);
  }

  .lede {
    font-size: 16px;
  }

  .access-card {
    padding: 22px;
    border-radius: 24px;
  }

  .form-intro h2 {
    font-size: 24px;
  }

  .session-actions,
  .player-actions,
  .stats-toolbar-actions {
    display: grid;
    width: 100%;
  }

  button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .brand-rail-row .ghost-button {
    width: auto;
  }

  .hero-figure {
    width: min(100%, 420px);
    margin-right: auto;
    padding: 0 12px;
  }

  .shell,
  .shell-wide {
    width: 100%;
    padding: 24px 16px 40px;
  }

  body[data-page="live"] .player-panel {
    padding: 22px;
    border-radius: 22px;
  }

  .ask-panel {
    padding: 22px;
    border-radius: 22px;
  }

  .stats-panel {
    padding: 22px;
    border-radius: 22px;
  }

  .stats-panel-head-spread {
    grid-template-columns: 1fr;
  }

  .stats-summary-grid {
    grid-template-columns: 1fr;
  }

  .manage-summary-grid {
    grid-template-columns: 1fr;
  }

  .stats-search-field {
    width: 100%;
  }

  .question-form-actions {
    display: grid;
  }
}
