:root {
  --bg: #09080f;
  --bg-soft: #13101c;
  --panel: rgba(19, 16, 28, 0.92);
  --panel-alt: rgba(24, 20, 36, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f7fb;
  --muted: #b8b8c8;
  --muted-2: #8f8fa7;
  --orange: #ff8a3d;
  --orange-strong: #ff6f1a;
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.14);
  --green: #00d087;
  --danger: #ff5d73;
  --warning: #ffbe4d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 138, 61, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.2), transparent 26%),
    linear-gradient(180deg, #120f1d 0%, #09080f 42%, #07060d 100%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(10, 9, 16, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--orange), var(--purple));
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 14px 32px rgba(255, 111, 26, 0.28);
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand-copy span {
  font-size: 0.8rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: 180ms ease;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.main-content {
  flex: 1;
  padding: 24px 0 60px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 36px;
  background:
    linear-gradient(145deg, rgba(255, 138, 61, 0.12), rgba(139, 92, 246, 0.08)),
    rgba(11, 10, 18, 0.84);
  box-shadow: var(--shadow);
  padding: 28px;
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto -8% -40% auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.18), transparent 66%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  gap: 24px;
}

.overline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1,
.page-heading h1 {
  margin: 14px 0 12px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.gradient-text {
  background: linear-gradient(135deg, #ffd0ab 0%, var(--orange) 34%, #cfb9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p,
.page-heading p,
.card p,
.list-muted,
.empty-state p {
  color: var(--muted);
  line-height: 1.65;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button,
.button-secondary,
.button-ghost,
.button-danger {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button {
  color: #140b03;
  background: linear-gradient(135deg, #ffb36d, var(--orange));
  box-shadow: 0 16px 32px rgba(255, 138, 61, 0.28);
}

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

.button-secondary {
  color: var(--text);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.92), rgba(98, 48, 192, 0.92));
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.24);
}

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

.button-danger {
  color: white;
  background: rgba(255, 93, 115, 0.18);
  border: 1px solid rgba(255, 93, 115, 0.35);
}

.pill,
.pill-success,
.pill-danger,
.pill-warning {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid transparent;
}

.pill {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.pill-success {
  background: rgba(0, 208, 135, 0.14);
  color: #abffd9;
  border-color: rgba(0, 208, 135, 0.24);
}

.pill-danger {
  background: rgba(255, 93, 115, 0.12);
  color: #ffc5d0;
  border-color: rgba(255, 93, 115, 0.2);
}

.pill-warning {
  background: rgba(255, 190, 77, 0.12);
  color: #ffe1a0;
  border-color: rgba(255, 190, 77, 0.22);
}

.grid,
.cards-grid,
.stats-grid,
.info-grid,
.two-column,
.dashboard-grid,
.question-grid,
.settings-grid {
  display: grid;
  gap: 18px;
}

.cards-grid,
.stats-grid,
.info-grid,
.dashboard-grid,
.settings-grid {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.card,
.stat-card,
.panel,
.question-card,
.table-card,
.user-card,
.rank-card,
.form-panel,
.metric-card,
.summary-card,
.admin-tab-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card,
.panel,
.form-panel,
.table-card,
.admin-tab-panel,
.summary-card {
  padding: 22px;
}

.stat-card,
.metric-card,
.rank-card,
.user-card,
.question-card {
  padding: 20px;
}

.section {
  margin-top: 28px;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title h2,
.card h3,
.panel h3,
.form-panel h3,
.table-card h3,
.summary-card h3,
.admin-tab-panel h3,
.question-card h3,
.rank-card h3,
.user-card h3 {
  margin: 0;
}

.section-title p,
.card small,
.form-note,
.helper-text {
  color: var(--muted-2);
}

.stats-grid {
  margin-top: 18px;
}

.stat-value,
.metric-value {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 4px 0 8px;
}

.stat-label,
.metric-label {
  color: var(--muted);
}

.accent-bar {
  width: 70px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--purple));
  margin-bottom: 18px;
}

.info-list,
.rule-list,
.check-list,
.inline-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.info-list li,
.rule-list li,
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
}

.info-list li::before,
.rule-list li::before,
.check-list li::before {
  content: '•';
  color: var(--orange);
  font-weight: 900;
  line-height: 1;
  margin-top: 2px;
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.page-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notice-banner {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 190, 77, 0.26);
  background: rgba(255, 190, 77, 0.1);
  color: #ffe3ab;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field,
.field-inline {
  display: grid;
  gap: 8px;
}

.field label,
.fieldset-label {
  font-weight: 700;
  color: var(--text);
}

.field input,
.field select,
.field textarea,
.search-input,
.password-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus,
.password-input:focus {
  border-color: rgba(255, 138, 61, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.14);
}

.field textarea {
  min-height: 110px;
}

.helper-row,
.action-row,
.filter-row,
.inline-actions,
.answer-meta,
.question-actions,
.toolbar,
.export-row,
.settings-row,
.rank-actions,
.hero-pills,
.identity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-pills {
  margin-top: 18px;
}

.question-groups {
  display: grid;
  gap: 20px;
}

.round-group {
  display: grid;
  gap: 14px;
}

.round-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}

.round-title h2 {
  margin: 0;
  font-size: 1.15rem;
}

.question-card {
  display: grid;
  gap: 14px;
  border-radius: 24px;
}

.question-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.question-top h3 {
  font-size: 1.08rem;
  line-height: 1.35;
}

.question-tags,
.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.answer-options {
  display: grid;
  gap: 10px;
}

.answer-option {
  position: relative;
}

.answer-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.answer-option label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.answer-option input:checked + label {
  border-color: rgba(255, 138, 61, 0.7);
  background: rgba(255, 138, 61, 0.12);
  transform: translateY(-1px);
}

.answer-option input:disabled + label {
  opacity: 0.58;
  cursor: not-allowed;
}

.option-marker {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  flex-shrink: 0;
}

.answer-option input:checked + label .option-marker {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 4px var(--orange);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 96px;
}

.status-open {
  color: #c8ffe4;
  background: rgba(0, 208, 135, 0.14);
  border: 1px solid rgba(0, 208, 135, 0.22);
}

.status-locked {
  color: #ffe5ad;
  background: rgba(255, 190, 77, 0.14);
  border: 1px solid rgba(255, 190, 77, 0.22);
}

.status-resolved {
  color: #d9cfff;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.24);
}

.result-strip,
.answer-summary,
.lock-note,
.resolved-box,
.admin-summary-box {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.result-strip strong,
.answer-summary strong,
.resolved-box strong {
  display: block;
  margin-bottom: 4px;
}

.good {
  color: #8ef3bf;
}

.bad {
  color: #ffb4c0;
}

.neutral {
  color: #cbc7dc;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: rgba(255, 255, 255, 0.02);
}

.table th,
.table td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.rank-top {
  display: grid;
  gap: 14px;
}

.rank-card.top-1 {
  background: linear-gradient(145deg, rgba(255, 138, 61, 0.18), rgba(255, 138, 61, 0.05)), var(--panel-alt);
}

.rank-card.top-2 {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.14), rgba(139, 92, 246, 0.04)), var(--panel-alt);
}

.rank-card.top-3 {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)), var(--panel-alt);
}

.rank-position {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.rank-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 6px 0;
}

.rank-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}

.admin-layout {
  display: grid;
  gap: 20px;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 4px;
}

.admin-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 12px 16px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 700;
}

.admin-tab.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 138, 61, 0.22), rgba(139, 92, 246, 0.22));
  border-color: rgba(255, 138, 61, 0.28);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

.split-grid {
  display: grid;
  gap: 18px;
}

.question-list,
.user-list {
  display: grid;
  gap: 14px;
}

.auth-panel {
  max-width: 560px;
  margin: 0 auto;
}

.login-panel {
  max-width: 460px;
  margin: 0 auto;
}

.login-panel .button,
.login-panel .button-secondary,
.auth-panel .button,
.auth-panel .button-secondary {
  width: 100%;
}

.dialog {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #120f1d;
  color: var(--text);
  width: min(720px, calc(100% - 24px));
  padding: 0;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.dialog-content {
  padding: 24px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.close-button {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}

.toast-container {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 10px;
  z-index: 100;
}

.toast {
  padding: 14px 16px;
  border-radius: 16px;
  min-width: 220px;
  max-width: 300px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  animation: toast-in 220ms ease;
}

.toast-success {
  background: rgba(0, 208, 135, 0.14);
}

.toast-warning {
  background: rgba(255, 190, 77, 0.14);
}

.toast-error {
  background: rgba(255, 93, 115, 0.14);
}

.toast-hide {
  opacity: 0;
  transform: translateY(8px);
}

.empty-state {
  padding: 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  text-align: center;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 7, 14, 0.92);
}

.footer-inner {
  padding: 22px 0 40px;
  color: var(--muted-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

code.inline-code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.92em;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .hero {
    padding: 36px;
  }

  .hero-grid,
  .split-grid,
  .two-column {
    grid-template-columns: 1.25fr 0.9fr;
    align-items: start;
  }

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

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

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

  .page-heading {
    flex-direction: row;
    justify-content: space-between;
    align-items: end;
  }
}

@media (min-width: 980px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .admin-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .admin-tabs {
    position: sticky;
    top: 110px;
    flex-direction: column;
  }

  .admin-tab {
    width: 100%;
    text-align: left;
  }

  .split-grid {
    grid-template-columns: 380px minmax(0, 1fr);
  }
}

@media (max-width: 719px) {
  .nav-links {
    display: none;
  }

  .header-inner {
    padding: 16px 0;
  }

  .site-header .mobile-nav {
    display: grid;
  }
}

.mobile-nav {
  display: none;
  gap: 10px;
  padding-bottom: 18px;
}

.mobile-nav .nav-link {
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}
