:root {
  --bg-a: #f6efe4;
  --bg-b: #dbeeff;
  --bg-c: #d8f7e8;
  --surface: #ffffff;
  --text-main: #111a28;
  --text-soft: #4e5b70;
  --line: #d7e0ee;
  --accent: #0f62fe;
  --accent-soft: #dbe7ff;
  --ok-bg: #dff8eb;
  --ok-fg: #0d6d43;
  --error-bg: #ffe1e1;
  --error-fg: #952f2f;
  --danger: #ca3f3f;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: 'Onest', sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(44rem 30rem at 12% 3%, #ffd9ae66, transparent 65%),
    radial-gradient(40rem 24rem at 100% 5%, #a5d0ff66, transparent 65%),
    radial-gradient(55rem 35rem at 50% 100%, #9ce6c666, transparent 72%),
    linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 48%, var(--bg-c) 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(#ffffff1f 1px, transparent 1px), linear-gradient(90deg, #ffffff1f 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, #000 50%, transparent 95%);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Sora', sans-serif;
  letter-spacing: -0.015em;
}

.page-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: calc(0.9rem + env(safe-area-inset-top)) 0.82rem calc(1.2rem + env(safe-area-inset-bottom));
  display: grid;
  gap: 0.9rem;
  animation: shell-in 420ms ease;
}

.hero-card,
.options-card {
  border: 1px solid #ffffffcc;
  border-radius: 22px;
  background: #ffffffe6;
  backdrop-filter: blur(7px);
  box-shadow: 0 14px 34px #24395f22;
  padding: 0.95rem;
}

.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  inset: auto -15% -62% auto;
  width: 14rem;
  aspect-ratio: 1;
  background: radial-gradient(circle, #0f62fe2e, transparent 72%);
}

.hero-card.compact {
  padding-bottom: 0.8rem;
}

.kicker {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 700;
  color: #1a4eb5;
}

.subtitle {
  margin: 0.52rem 0 0;
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1.45;
}

.status-pill {
  margin: 0.7rem 0 0;
  display: inline-block;
  border-radius: 999px;
  padding: 0.35rem 0.68rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill.live {
  color: #0d5c3b;
  background: #ddf8ea;
  border: 1px solid #b7ebd1;
}

.status-pill.ended {
  color: #8a2f2f;
  background: #ffe5e5;
  border: 1px solid #f4b9b9;
}

.ghost-link {
  text-decoration: none;
  color: #173f90;
  font-weight: 700;
  font-size: 0.88rem;
  border-bottom: 1px dashed #8caee8;
}

.options-list {
  display: grid;
  gap: 0.7rem;
}

.option-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f6faff);
  color: var(--text-main);
  display: grid;
  gap: 0.55rem;
  text-align: left;
  padding: 0.8rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  min-height: 88px;
}

.option-item:active {
  transform: scale(0.992);
}

.option-item.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #0f62fe2d, 0 8px 18px #0f62fe1f;
}

.option-item.is-locked {
  cursor: default;
}

.option-item.is-captcha {
  border-color: #9bb8f5;
  background: linear-gradient(180deg, #fbfdff, #eef4ff);
  box-shadow: 0 0 0 2px #0f62fe26;
}

.option-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.option-label {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
}

.option-percent {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0c4dcb;
  background: #e9f0ff;
  border-radius: 999px;
  padding: 0.22rem 0.52rem;
  white-space: nowrap;
}

.progress {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf2fb;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1e78ff, #18a594);
  transition: width 220ms ease;
}

.option-foot {
  color: #56657e;
  font-size: 0.8rem;
}

.option-captcha-slot {
  min-height: 64px;
  display: grid;
  place-items: center;
}

.option-captcha-slot > div {
  margin: 0 auto;
}

.alert {
  margin-bottom: 0.7rem;
  border-radius: 14px;
  padding: 0.66rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.alert.success {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.alert.error {
  background: var(--error-bg);
  color: var(--error-fg);
}

.hidden {
  display: none !important;
}

.stack-form {
  display: grid;
  gap: 0.72rem;
}

.stack-form label,
.preset-label {
  display: grid;
  gap: 0.34rem;
  color: #28354a;
  font-size: 0.88rem;
  font-weight: 700;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--text-main);
  padding: 0.72rem 0.74rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #93b7ff;
  box-shadow: 0 0 0 3px #0f62fe26;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

button {
  border: none;
  min-height: 48px;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #0f62fe, #1578ff 55%, #1c96f4);
}

button:active {
  transform: translateY(1px);
}

.soft-btn {
  border: 1px solid #c9d8f7;
  background: linear-gradient(180deg, #f8fbff, #eef4ff);
  color: #224f9e;
  font-weight: 700;
}

.danger-btn {
  border: 1px solid #f2b7b7;
  background: linear-gradient(180deg, #fff5f5, #ffe8e8);
  color: #a73333;
  font-weight: 700;
}

.danger-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.hint {
  margin: 0;
  color: #586680;
  font-size: 0.81rem;
}

.admin-topbar,
.options-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.preset-toolbar {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.admin-actions {
  display: grid;
  gap: 0.55rem;
}

.options-editor-head h3 {
  font-size: 1rem;
}

.options-editor {
  display: grid;
  gap: 0.55rem;
}

.option-edit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.46rem;
}

.option-remove {
  min-width: 48px;
  padding-inline: 0.4rem;
  border: 1px solid #f0b9b9;
  color: var(--danger);
  background: #fff0f0;
}

.stats-grid {
  margin: 0.66rem 0 1rem;
  display: grid;
  gap: 0.58rem;
}

.stats-grid article {
  border: 1px solid #d6e1f4;
  border-radius: 16px;
  padding: 0.7rem;
  background: linear-gradient(180deg, #fdfefe, #f2f8ff);
  display: grid;
  gap: 0.22rem;
}

.stats-grid span {
  font-size: 0.8rem;
  color: #5b6a83;
}

.stats-grid strong {
  font-size: 1.12rem;
  color: #203d79;
  font-family: 'Sora', sans-serif;
}

.align-center {
  text-align: center;
}

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

@media (min-width: 760px) {
  .page-shell {
    padding: 1.3rem 1.2rem 2rem;
    gap: 1rem;
  }

  .hero-card,
  .options-card {
    border-radius: 24px;
    padding: 1.15rem;
  }

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

  .preset-toolbar,
  .admin-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .option-item:hover:not(.is-locked) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px #1c4ea924;
  }
}
