:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #151923;
  --muted: #667085;
  --line: #d8dde6;
  --soft: #f6f7f9;
  --paper: #ffffff;
  --accent: #e83f3f;
  --accent-dark: #b9282f;
  --green: #178a61;
  --footer: #ffffff;
  --shadow: 0 18px 42px rgba(21, 25, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.brand-mark svg {
  width: 36px;
  height: 36px;
}

.brand-title {
  font-size: clamp(1.25rem, 4vw, 1.9rem);
  font-weight: 500;
  letter-spacing: 0;
}

.top-actions {
  position: relative;
}

.icon-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.icon-button span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(270px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.menu-panel::before {
  position: absolute;
  top: -6px;
  right: 17px;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #ffffff;
  content: "";
  transform: rotate(45deg);
}

.menu-item {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--soft);
  outline: none;
}

.version-item {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  color: #98a2b3;
  font-size: 0.84rem;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 42px) clamp(16px, 4vw, 32px) 0;
}

.intro-block {
  display: grid;
  gap: 8px;
  margin: 0 auto 22px;
  text-align: center;
}

.intro-block h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  font-weight: 650;
  letter-spacing: 0;
}

.intro-block p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.wheel-stage {
  display: grid;
  place-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.result-line {
  min-height: 35px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.result-line strong {
  color: var(--ink);
}

.wheel-wrap {
  position: relative;
  display: grid;
  width: min(86vw, 520px);
  aspect-ratio: 1;
  place-items: center;
}

.wheel-wrap canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 22px 34px rgba(21, 25, 35, 0.16));
  transition: transform 4.4s cubic-bezier(0.1, 0.78, 0.08, 1);
}

.pointer {
  position: absolute;
  top: -3px;
  z-index: 3;
  width: 0;
  height: 0;
  border-right: 18px solid transparent;
  border-left: 18px solid transparent;
  border-top: 42px solid var(--accent);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.24));
}

.spin-button {
  position: absolute;
  z-index: 4;
  display: grid;
  width: clamp(92px, 23vw, 128px);
  aspect-ratio: 1;
  place-items: center;
  border: 6px solid #ffffff;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff6858, #bf2730);
  color: #ffffff;
  font-size: clamp(0.95rem, 3.2vw, 1.18rem);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow:
    inset 0 -8px 18px rgba(72, 9, 15, 0.25),
    0 14px 28px rgba(136, 36, 38, 0.25);
}

.spin-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.entry-area {
  padding: clamp(18px, 4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.section-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  letter-spacing: 0;
}

.entry-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.small-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 780;
}

.small-button.subtle {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.option-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.option-row,
.secret-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.number-badge {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 850;
}

.option-input,
.secret-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.option-input:focus,
.secret-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 138, 97, 0.16);
}

.bottom-photo {
  display: flex;
  justify-content: center;
  margin: 36px 0 28px;
}

.bottom-photo img {
  display: block;
  width: min(100%, 520px);
  height: auto;
  border: 1px solid var(--line);
}

.seo-text {
  margin: 0 auto 44px;
  padding-top: 10px;
  color: #333b48;
  font-size: 1rem;
  line-height: 1.72;
}

.seo-text h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 650;
}

.seo-text h3 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
}

.seo-text p {
  margin: 0 0 18px;
}

.faq-block {
  padding-top: 12px;
}

.site-footer {
  min-height: 430px;
  padding: 58px clamp(16px, 4vw, 44px) 70px;
  border-top: 1px solid var(--line);
  background: var(--footer);
  color: var(--ink);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.7fr);
  gap: clamp(32px, 7vw, 86px);
  width: min(1120px, 100%);
  margin: 0 auto;
}

.footer-brand h2 {
  margin: 14px 0 10px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.footer-brand p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.footer-logo {
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background:
    conic-gradient(from -45deg, #e83f3f, #f2c94c, #178a61, #2f80ed, #e83f3f);
}

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

.footer-columns h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1rem;
}

.footer-columns a {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  text-decoration: none;
}

.footer-columns a:hover,
.footer-columns a:focus-visible {
  color: var(--ink);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(18, 24, 33, 0.42);
}

.secret-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  width: min(460px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

.secret-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.secret-row {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
}

.secret-row .number-badge {
  width: 36px;
  height: 36px;
}

.secret-input {
  height: 36px;
  text-align: center;
}

@media (max-width: 720px) {
  .app-header {
    min-height: 68px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-mark svg {
    width: 32px;
    height: 32px;
  }

  .option-list,
  .secret-grid,
  .footer-inner,
  .footer-columns {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-actions,
  .modal-actions {
    width: 100%;
  }

  .entry-actions .small-button,
  .modal-actions .small-button {
    flex: 1;
  }
}
