/* ============ base ============ */
:root {
  color-scheme: dark;
  --bg: #07070d;
  --ink: #f4f5fb;
  --muted: #9298ad;
  --stroke: rgba(var(--tint), 0.085);
  --panel: rgba(17, 18, 30, 0.72);
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --danger: #fb7185;
  --radius: 26px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;

  /* оттенок полупрозрачных заливок и линий: белый в тёмной теме,
     графитовый в светлой */
  --tint: 255, 255, 255;
  --shadow: 0, 0, 0;

  /* текст второй важности, приглушённый и «почти основной» */
  --text-2: #9ba0b6;
  --text-3: #6d7288;
  --text-strong: #e7e8f2;

  --accent-soft: #c4b5fd;
  --danger-soft: #ffc2ca;
  --logo-hole: #0a0a12;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.4); }

/* ============ background ============ */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1000px 640px at 12% -5%, rgba(124, 92, 255, 0.24), transparent 62%),
    radial-gradient(820px 560px at 88% 4%, rgba(34, 211, 238, 0.15), transparent 62%),
    radial-gradient(760px 760px at 52% 112%, rgba(236, 72, 153, 0.11), transparent 66%);
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(var(--tint), 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--tint), 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 38%, #000 18%, transparent 74%);
  mask-image: radial-gradient(ellipse at 50% 38%, #000 18%, transparent 74%);
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ topbar ============ */
.topbar {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px 32px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(from 210deg, #8b5cf6, #22d3ee, #ec4899, #8b5cf6);
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.45);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--logo-hole);
  box-shadow: inset 0 0 0 1px rgba(var(--tint), 0.09);
}

.brand-name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(var(--tint), 0.03);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ============ layout ============ */
.layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 32px 32px;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) 392px;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

/* ============ wheel ============ */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.wheel-shell {
  position: relative;
  width: min(530px, 100%);
  aspect-ratio: 1 / 1;
}

.wheel-shell::before {
  content: "";
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.3), transparent 62%);
  filter: blur(34px);
  z-index: 0;
  pointer-events: none;
}

.wheel-holder {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 34px 60px rgba(var(--shadow), 0.6));
  -webkit-user-select: none;
  user-select: none;
}

.wheel-holder.is-dragging { cursor: grabbing; }
.wheel-holder.is-spinning { cursor: default; }

#wheel {
  display: block;
  width: 100%;
  height: 100%;
}

.pointer {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 26px;
  height: 38px;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(var(--shadow), 0.55));
}

.pointer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffffff 0%, #d7d9ea 100%);
  clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
}

.pointer::after {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.85), 0 0 0 3px rgba(7, 7, 13, 0.9);
}

.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 27%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(var(--tint), 0.16);
  background:
    radial-gradient(circle at 32% 24%, #2b2c42 0%, #171826 42%, #0d0d17 100%);
  color: #fff;
  font-family: var(--display);
  font-size: clamp(10px, 1.35vw, 13px);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 3;
  isolation: isolate;
  box-shadow:
    0 0 0 8px rgba(9, 9, 17, 0.92),
    0 0 0 9px rgba(var(--tint), 0.06),
    0 20px 44px rgba(var(--shadow), 0.6),
    inset 0 1px 0 rgba(var(--tint), 0.16);
  transition: transform 0.18s ease, box-shadow 0.25s ease, color 0.2s ease;
}

.hub::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 140deg,
    rgba(139, 92, 246, 0.95),
    rgba(34, 211, 238, 0.85),
    rgba(236, 72, 153, 0.8),
    rgba(139, 92, 246, 0.95));
  filter: blur(5px);
  opacity: 0.55;
  z-index: -1;
  transition: opacity 0.25s ease;
}

.hub:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow:
    0 0 0 8px rgba(9, 9, 17, 0.92),
    0 0 0 9px rgba(var(--tint), 0.1),
    0 24px 54px rgba(var(--shadow), 0.65),
    0 0 34px rgba(139, 92, 246, 0.4),
    inset 0 1px 0 rgba(var(--tint), 0.2);
}

.hub:hover:not(:disabled)::before { opacity: 0.9; }

.hub:active:not(:disabled) { transform: translate(-50%, -50%) scale(0.965); }

.hub:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.9);
  outline-offset: 6px;
}

.hub:disabled {
  cursor: default;
  color: #7c819a;
  box-shadow:
    0 0 0 8px rgba(9, 9, 17, 0.92),
    0 0 0 9px rgba(var(--tint), 0.04),
    0 14px 30px rgba(var(--shadow), 0.5),
    inset 0 1px 0 rgba(var(--tint), 0.08);
}

.hub:disabled::before { opacity: 0.18; }

.hub-text { pointer-events: none; }

.stage-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.9;
}

kbd {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
  margin: 0 1px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  border-bottom-width: 2px;
  background: rgba(var(--tint), 0.05);
  color: var(--text-strong);
  white-space: nowrap;
}

/* ============ panel ============ */
.panel {
  position: relative;
  z-index: 1;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--tint), 0.08);
  background: linear-gradient(180deg, rgba(24, 25, 40, 0.82), rgba(11, 11, 19, 0.76));
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
  box-shadow:
    0 26px 64px rgba(var(--shadow), 0.5),
    inset 0 1px 0 rgba(var(--tint), 0.06);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.count {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(var(--tint), 0.03);
  white-space: nowrap;
}

/* add row */
.add-row {
  display: flex;
  gap: 8px;
  margin: 16px 0 8px;
}

.add-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(var(--tint), 0.04);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.add-row input::placeholder { color: var(--text-3); }

.add-row input:focus {
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(var(--tint), 0.06);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.add-row button {
  flex: none;
  width: 44px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 45%, #22d3ee 120%);
  color: #0a0a12;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.3);
}

.add-row button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.add-row button:active { transform: translateY(0) scale(0.97); }
.add-row button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.add-hint {
  margin: 0 0 12px 2px;
  font-size: 11px;
  color: var(--text-3);
}

/* options */
.options {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 278px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--tint), 0.16) transparent;
}

.options.is-scrollable {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent 100%);
}

.options::-webkit-scrollbar { width: 8px; }
.options::-webkit-scrollbar-thumb {
  background: rgba(var(--tint), 0.14);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 11px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(var(--tint), 0.026);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.option:hover {
  background: rgba(var(--tint), 0.055);
  border-color: rgba(var(--tint), 0.07);
}

.option.is-removing {
  animation: removeRow 0.3s ease forwards;
}

.option-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.option-label {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}

.option-edit {
  flex: 1;
  min-width: 0;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.6);
  background: rgba(var(--shadow), 0.35);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  outline: none;
}

.option-del {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-3);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.option:hover .option-del,
.option-del:focus-visible { opacity: 1; }

.option-del:hover {
  background: rgba(251, 113, 133, 0.14);
  color: var(--danger);
}

@media (hover: none) {
  .option-del { opacity: 1; }
}

.empty {
  margin: 12px 2px 2px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
}

.empty[hidden] { display: none; }

/* toggles */
.panel-sep {
  height: 1px;
  margin: 16px 0 12px;
  background: linear-gradient(90deg, transparent, rgba(var(--tint), 0.1), transparent);
}

.toggles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.switch:hover { background: rgba(var(--tint), 0.035); }

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.track {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(var(--tint), 0.09);
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.2, 1), background 0.22s ease;
}

.switch input:checked + .track {
  border-color: transparent;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.35);
}

.switch input:checked + .track .thumb {
  transform: translateX(18px);
  background: #fff;
  box-shadow: 0 0 10px rgba(var(--tint), 0.55);
}

.switch input:focus-visible + .track {
  outline: 2px solid rgba(139, 92, 246, 0.85);
  outline-offset: 3px;
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.switch-text strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-strong);
}

.switch-text em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-3);
}

/* actions */
.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.ghost {
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--stroke);
  background: rgba(var(--tint), 0.035);
  color: var(--text-strong);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.ghost:hover {
  background: rgba(var(--tint), 0.07);
  border-color: rgba(var(--tint), 0.16);
}

.ghost:active { transform: scale(0.985); }

.ghost.danger:hover {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.35);
  color: var(--danger-soft);
}

.ghost:focus-visible,
.primary:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.9);
  outline-offset: 2px;
}

.foot {
  padding: 0 32px 26px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ============ result ============ */
.result {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 10, 0.66);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: fadeIn 0.22s ease both;
}

.result[hidden] { display: none; }

.result-card {
  position: relative;
  width: min(470px, 100%);
  padding: 34px 30px 26px;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(30, 31, 50, 0.97), rgba(12, 12, 21, 0.98));
  box-shadow:
    0 44px 110px rgba(var(--shadow), 0.72),
    inset 0 1px 0 rgba(var(--tint), 0.08);
  animation: pop 0.42s cubic-bezier(0.2, 1.15, 0.32, 1) both;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(34, 211, 238, 0.55) 45%, rgba(var(--tint), 0.06) 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.result-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}

.result-value {
  margin: 12px 0 6px;
  font-family: var(--display);
  font-size: clamp(30px, 5.4vw, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  word-break: break-word;
  background: linear-gradient(115deg, #ffffff 8%, var(--accent-soft) 46%, #7ee7f7 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-note {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.result-note[hidden] { display: none; }

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}

.primary {
  padding: 12px 22px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #a78bfa, #8b5cf6 50%, #22d3ee 130%);
  color: #08080f;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.35);
  transition: transform 0.15s ease, filter 0.2s ease;
}

.primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(0) scale(0.98); }

.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============ confetti ============ */
#confetti {
  position: fixed;
  inset: 0;
  z-index: 65;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

/* ============ toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(22, 23, 37, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 50px rgba(var(--shadow), 0.5);
  color: var(--text-strong);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.2, 0.9, 0.2, 1);
  max-width: min(520px, calc(100vw - 32px));
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast button {
  flex: none;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.16);
  color: var(--accent-soft);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.toast button:hover { background: rgba(139, 92, 246, 0.28); }
.toast button[hidden] { display: none; }

/* ============ animations ============ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.955); }
  to { opacity: 1; transform: none; }
}

@keyframes removeRow {
  to { opacity: 0; transform: translateX(14px); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; }
}

/* ============ responsive ============ */
@media (max-width: 920px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    padding: 8px 22px 28px;
  }

  .stage { order: 1; }
  .panel { order: 2; width: min(560px, 100%); margin: 0 auto; }
  .wheel-shell { width: min(430px, 100%); }
  .topbar { padding: 20px 22px 4px; }
  .foot { padding: 0 22px 22px; }
}

@media (max-width: 480px) {
  .brand-name { display: none; }
  .wheel-shell { width: min(360px, 100%); }
  .panel { padding: 18px; border-radius: 22px; }
  .options { max-height: 230px; }
  .hub { font-size: 10px; letter-spacing: 0.12em; }
  .stage-hint { font-size: 11.5px; }
  .result-card { padding: 28px 20px 22px; border-radius: 22px; }
  .result-actions { flex-direction: column-reverse; }
  .result-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============ публичный сайт: слоты под баннеры ============ */
.ad-slot {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Пустой слот не занимает места и не ломает вид */
.ad-slot:empty { display: none; }

/* Верхний блок стоит над шапкой, а не над колесом: баннер не должен
   примыкать к кнопке «Крутить» (правила РСЯ о случайных кликах) */
.ad-slot--top { margin: 14px auto 4px; }

/* Нижний блок — под колесом, с отступом от панели управления */
.ad-slot--bottom { margin: 26px auto 16px; }

@media (max-width: 720px) {
  .ad-slot { padding: 0 16px; }
  .ad-slot--top { margin: 10px auto 2px; }
  .ad-slot--bottom { margin: 20px auto 8px; }
}

.ad-slot img,
.ad-slot iframe {
  max-width: 100%;
  display: block;
}

/* ============ уведомление о cookie ============ */
.cookie-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  width: min(720px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(17, 18, 30, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(var(--shadow), 0.5);
  font-size: 13px;
  color: var(--muted);
}

.cookie-bar p { margin: 0; flex: 1; }
.cookie-bar a { color: var(--accent-soft); }

.cookie-bar[hidden] { display: none; }

.cookie-bar button { flex: none; padding: 9px 18px; font-size: 13px; }

/* ============ ссылки в подвале ============ */
.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.foot-links a {
  color: #6b7186;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.foot-links a:hover {
  color: var(--text-2);
  border-color: rgba(var(--tint), 0.2);
}

/* ============ текстовые страницы (о сайте, политика, 404) ============ */
.doc {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.doc-back:hover { color: var(--ink); }

.doc h1 {
  font-family: var(--display);
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.15;
  margin: 0 0 10px;
}

.doc .doc-date {
  margin: 0 0 26px;
  font-size: 12.5px;
  color: var(--text-3);
}

.doc h2 {
  font-family: var(--display);
  font-size: 19px;
  margin: 32px 0 10px;
}

.doc p,
.doc li {
  font-size: 15px;
  line-height: 1.68;
  color: var(--text-strong);
}

.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc a { color: var(--accent-soft); }

.doc .card {
  margin: 26px 0;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--panel);
}

.doc .card p { margin: 0; }

@media (max-width: 480px) {
  .cookie-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .cookie-bar button { width: 100%; }
}

/* ============ навигация по разделам сайта ============ */
.site-nav {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 32px 6px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(var(--tint), 0.03);
  color: var(--text-2);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
  color: var(--ink);
  border-color: rgba(var(--tint), 0.2);
}

.site-nav a[aria-current="page"] {
  color: var(--accent-soft);
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.42);
}

a.pill { text-decoration: none; }
a.pill:hover { color: var(--ink); border-color: rgba(var(--tint), 0.22); }

a.primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* ============ текстовые страницы: доп. блоки ============ */
.doc-kicker {
  margin: 0 0 10px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.doc-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-strong);
}

.doc h3 {
  font-family: var(--display);
  font-size: 16px;
  margin: 24px 0 8px;
}

.doc code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(var(--tint), 0.06);
  font-size: 13.5px;
}

.doc .note {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 2px solid rgba(139, 92, 246, 0.6);
  background: rgba(139, 92, 246, 0.07);
  border-radius: 0 14px 14px 0;
}

.doc .note p { margin: 0; }

.doc-cta {
  margin: 40px 0 10px;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.doc-cta p { margin: 0; color: var(--text-strong); }

/* ============ карточки готовых колёс ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
  margin: 28px 0 8px;
}

.preset-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.preset-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(23, 24, 40, 0.9);
}

.preset-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.25;
}

.preset-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.preset-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-card li {
  margin: 0;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(var(--tint), 0.05);
  border: 1px solid var(--stroke);
  color: var(--text-2);
}

.preset-card .go {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-soft);
}

/* ============ список статей ============ */
.article-list {
  list-style: none;
  margin: 26px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-list a {
  display: block;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(var(--tint), 0.02);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.article-list a:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.07);
}

.article-list strong {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  margin-bottom: 6px;
}

.article-list span {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ============ вопросы и ответы ============ */
.faq {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq details {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(var(--tint), 0.02);
  padding: 0 18px;
}

.faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  float: right;
  color: var(--text-3);
  font-weight: 400;
}

.faq details[open] summary::after { content: "–"; }

.faq details p { margin: 0 0 16px; }

@media (max-width: 480px) {
  .site-nav { padding: 0 20px 6px; }
  .doc-cta { flex-direction: column; align-items: stretch; }
  .doc-cta a.primary { justify-content: center; }
}


/* ============ переключатель темы ============ */
.topbar-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.theme-toggle {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(var(--tint), 0.04);
  color: var(--text-strong);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.theme-toggle:hover {
  background: rgba(var(--tint), 0.08);
  border-color: rgba(var(--tint), 0.2);
  color: var(--ink);
}

.theme-toggle:active { transform: scale(0.94); }

.theme-toggle:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.9);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-icon--moon { display: none; }

:root[data-theme="light"] .theme-icon--sun { display: none; }
:root[data-theme="light"] .theme-icon--moon { display: block; }

@media (max-width: 480px) {
  .theme-toggle { width: 34px; height: 34px; }
}

/* ============ светлая тема ============ */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3fa;
  --ink: #12142b;
  --muted: #5a6079;
  --stroke: rgba(18, 20, 43, 0.12);
  --panel: rgba(255, 255, 255, 0.78);
  --tint: 18, 20, 43;
  --shadow: 24, 30, 54;
  --text-2: #4d5473;
  --text-3: #767d99;
  --text-strong: #1b1f36;
  --accent-soft: #6d3fd6;
  --danger-soft: #b81d3a;
  --logo-hole: #f2f3fa;
}

:root[data-theme="light"] .aurora { opacity: 0.5; }
:root[data-theme="light"] .grid-bg { opacity: 0.4; }

:root[data-theme="light"] .brand-mark {
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.3);
}

:root[data-theme="light"] .wheel-shell::before {
  background: radial-gradient(circle, rgba(124, 92, 255, 0.16), transparent 62%);
}

:root[data-theme="light"] .wheel-holder {
  filter: drop-shadow(0 24px 46px rgba(24, 30, 54, 0.2));
}

:root[data-theme="light"] .pointer {
  filter: drop-shadow(0 6px 14px rgba(24, 30, 54, 0.22));
}

:root[data-theme="light"] .pointer::before {
  background: linear-gradient(180deg, #2f3350 0%, #545a80 100%);
}

:root[data-theme="light"] .pointer::after {
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.7), 0 0 0 3px rgba(242, 243, 250, 0.95);
}

:root[data-theme="light"] .hub {
  border-color: rgba(18, 20, 43, 0.12);
  background: radial-gradient(circle at 32% 24%, #ffffff 0%, #f3f4fb 42%, #e6e8f4 100%);
  color: #14162b;
  box-shadow:
    0 0 0 8px rgba(242, 243, 250, 0.96),
    0 0 0 9px rgba(18, 20, 43, 0.06),
    0 18px 40px rgba(24, 30, 54, 0.22),
    inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .hub:hover:not(:disabled) {
  box-shadow:
    0 0 0 8px rgba(242, 243, 250, 0.96),
    0 0 0 9px rgba(18, 20, 43, 0.1),
    0 22px 50px rgba(24, 30, 54, 0.26),
    0 0 34px rgba(139, 92, 246, 0.28),
    inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .hub:disabled {
  color: #8b90a8;
  box-shadow:
    0 0 0 8px rgba(242, 243, 250, 0.96),
    0 0 0 9px rgba(18, 20, 43, 0.04),
    0 12px 26px rgba(24, 30, 54, 0.16),
    inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .hub::before { opacity: 0.16; }
:root[data-theme="light"] .hub:hover:not(:disabled)::before { opacity: 0.45; }

:root[data-theme="light"] .panel {
  border-color: rgba(18, 20, 43, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 251, 255, 0.88));
  box-shadow:
    0 26px 64px rgba(24, 30, 54, 0.12),
    inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .option-edit {
  background: rgba(18, 20, 43, 0.05);
}

:root[data-theme="light"] .preset-card:hover {
  background: rgba(255, 255, 255, 0.98);
}

:root[data-theme="light"] .result {
  background: rgba(28, 32, 58, 0.38);
}

:root[data-theme="light"] .result-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(247, 248, 254, 0.99));
  box-shadow:
    0 40px 100px rgba(24, 30, 54, 0.22),
    inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .result-value {
  background-image: linear-gradient(115deg, #241a52 8%, #7c3aed 46%, #0e7490 92%);
}

:root[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: 0 22px 50px rgba(24, 30, 54, 0.16);
}

:root[data-theme="light"] .toast button {
  border-color: rgba(109, 63, 214, 0.35);
  background: rgba(139, 92, 246, 0.12);
  color: #5b21b6;
}

:root[data-theme="light"] .toast button:hover {
  background: rgba(139, 92, 246, 0.2);
}

:root[data-theme="light"] .cookie-bar {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(24, 30, 54, 0.16);
}

:root[data-theme="light"] .cookie-bar a { color: #6d3fd6; }
