:root {
  --bg: #07111f;
  --bg-2: #0c1d35;
  --panel: rgba(10, 21, 40, 0.78);
  --panel-2: rgba(14, 29, 54, 0.82);
  --line: rgba(125, 202, 255, 0.16);
  --text: #eef7ff;
  --muted: #9db9d8;
  --cyan: #7af0ff;
  --blue: #6ca8ff;
  --green: #58e5b4;
  --violet: #a48cff;
  --red: #ff8a96;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #07162b;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
}
.orb-a {
  width: 34vw; height: 34vw; left: -8vw; top: -8vw; background: #1d4ed8;
}
.orb-b {
  width: 26vw; height: 26vw; right: -7vw; top: 24vh; background: #06b6d4;
}

.app-shell {
  width: min(calc(100% - 24px), var(--max));
  margin: 0 auto;
  padding: 18px 0 30px;
}

.hero-card,
.panel {
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  background: linear-gradient(180deg, rgba(10,19,36,0.78), rgba(10,21,40,0.90));
  border-radius: var(--radius-xl);
  padding: 20px;
}

.hero-top,
.panel-head,
.control-row,
.stats-grid,
.wheel-layout,
.panel-grid {
  display: grid;
}

.hero-top {
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(122, 240, 255, 0.08);
  border: 1px solid rgba(122, 240, 255, 0.14);
  color: #ddfbff;
  font-size: 0.82rem;
  margin-bottom: 14px;
}

h1, h2, h3 { margin: 0; }
h1 {
  font-size: clamp(2rem, 7vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}
.lead {
  margin: 14px 0 0;
  max-width: 62ch;
  line-height: 1.65;
  color: var(--muted);
}

.wheel-layout {
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: center;
  margin-top: 20px;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

#wheelCanvas {
  width: 100%;
  height: auto;
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
  box-shadow: 0 18px 60px rgba(0,0,0,0.4);
}

.wheel-shadow {
  position: absolute;
  inset: 6%;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), inset 0 -24px 44px rgba(0,0,0,0.18);
  pointer-events: none;
}

.pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid #f3fbff;
  border-bottom: 0;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.3));
  z-index: 4;
}

.spin-btn {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  min-width: 112px;
}

.result-card,
.panel {
  background: linear-gradient(180deg, rgba(15,28,52,0.74), rgba(11,21,40,0.84));
  border-radius: var(--radius-lg);
  padding: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(122,240,255,0.08);
  color: #dcfbff;
  border: 1px solid rgba(122,240,255,0.14);
  margin-bottom: 14px;
}

.last-result {
  margin-top: 14px;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  min-height: 1.3em;
}

.muted, .helper, .field-label, .panel-note {
  color: var(--muted);
}
.muted, .helper {
  line-height: 1.6;
}

.stats-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.mini-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 14px;
}
.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.mini-card strong {
  font-size: 1.35rem;
}

.panel-grid {
  grid-template-columns: 1fr 0.92fr;
  gap: 18px;
  margin-top: 18px;
}

.panel-head {
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 184px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 14px 15px;
  font: inherit;
  line-height: 1.5;
  outline: none;
}
textarea:focus {
  border-color: rgba(122, 240, 255, 0.35);
}

.control-row {
  grid-template-columns: repeat(3, auto);
  gap: 10px;
  justify-content: start;
  margin-top: 14px;
}

.btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  font: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}
.spin-btn {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  min-width: 112px;
}
.spin-btn:hover {
  transform: translate(-50%, calc(-50% - 1px));
}
.spin-btn:disabled {
  transform: translate(-50%, -50%);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(122,240,255,0.18), rgba(108,168,255,0.18));
  border-color: rgba(122,240,255,0.2);
  box-shadow: 0 0 30px rgba(122,240,255,0.12);
}
.btn-secondary {
  background: rgba(255,255,255,0.06);
}
.btn-ghost {
  background: transparent;
}
.btn-ghost.danger {
  border-color: rgba(255,138,150,0.24);
  color: #ffd8dd;
}

.message-box {
  margin-top: 14px;
  min-height: 24px;
  font-size: 0.93rem;
}
.message-box.ok { color: var(--green); }
.message-box.error { color: var(--red); }

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.history-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.history-list .history-value {
  font-weight: 700;
}
.history-list .history-time {
  color: var(--muted);
  font-size: 0.84rem;
}

.btn-mobile-only { display: none; }

@media (max-width: 920px) {
  .wheel-layout,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .result-card {
    order: -1;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(calc(100% - 16px), var(--max));
    padding: 10px 0 18px;
  }

  .hero-card,
  .panel {
    padding: 16px;
    border-radius: 22px;
  }

  .hero-top {
    grid-template-columns: 1fr;
  }

  .btn-mobile-only {
    display: inline-flex;
    justify-content: center;
  }

  .spin-btn {
    min-width: 102px;
    min-height: 46px;
  }

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

  .btn {
    width: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}


html, body {
  background: #07162b;
}

body {
  overscroll-behavior-y: none;
}

.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner__inner {
  width: min(100%, 920px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10,19,36,0.94), rgba(10,21,40,0.98));
  border: 1px solid rgba(125, 202, 255, 0.18);
  box-shadow: 0 18px 60px rgba(0,0,0,0.38);
  backdrop-filter: blur(18px);
}

.cookie-banner__text {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.cookie-banner__btn {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .cookie-banner__inner {
    grid-template-columns: 1fr;
  }
}
