/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  color: #e5e7eb;
  background:
    radial-gradient(circle at top, #111827 0, #020617 55%, #020617 100%);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* Links */
a {
  color: #9ca3ff;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Layout */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.06s ease;
  white-space: nowrap;
}

.btn--primary {
  background-color: #5865f2;
  border-color: #5865f2;
  color: #f9fafb;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.65);
}
.btn--primary:hover {
  background-color: #4752c4;
  border-color: #4752c4;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.8);
  transform: translateY(-1px);
}
.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.7);
}

.btn--ghost {
  background-color: #111827;
  border-color: #374151;
  color: #e5e7eb;
}
.btn--ghost:hover {
  background-color: #1f2937;
  border-color: #4b5563;
}

.btn--full { width: 100%; }

/* Main layout */
main { padding-top: 1rem; }

/* Hero */
.hero { padding: 2.5rem 0 3.5rem; }

.hero__grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  animation: fadeInUp 0.6s ease-out;
}

/* Cards / inputs */
.inputs-card {
  background-color: #111827;
  border-radius: 1.1rem;
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.7);
  border: 1px solid #1f2937;
}

.inputs-card__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #e5e7eb;
}

#optionsInput {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid #374151;
  padding: 0.65rem 0.75rem;
  font: inherit;
  resize: vertical;
  min-height: 7rem;
  background-color: #020617;
  color: #e5e7eb;
}

#optionsInput::placeholder { color: #6b7280; }

#optionsInput:focus {
  outline: none;
  border-color: #5865f2;
  box-shadow: 0 0 0 1px #5865f233;
}

.inputs-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.inputs-card__hint {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Info section */
.info { padding: 2.2rem 0 3rem; }

.info__grid {
  display: grid;
  gap: 2rem;
}

.info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
  color: #e5e7eb;
}

.info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #e5e7eb;
}

.steps {
  padding-left: 1.3rem;
  margin: 0;
  color: #9ca3af;
}

.steps li { margin-bottom: 0.3rem; }

.uses {
  list-style: disc;
  padding-left: 1.1rem;
  margin: 0;
  color: #9ca3af;
}

.uses li { margin-bottom: 0.25rem; }

/* Wheel area */
.hero__wheel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: stretch;
}

/* Match spin button + result width to wheel and center them */
.hero__wheel .btn--full,
.hero__wheel .result {
  width: 100%;
  max-width: min(620px, 96vw);
  align-self: center;
}

/* Wheel + spin button + result all share same width and are centered */
.hero__wheel .wheel-wrapper,
.hero__wheel #spinButton,
.hero__wheel #resultBox {
  max-width: min(620px, 96vw);
  margin-left: auto;
  margin-right: auto;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   TABLET+ (≥768px)
   - Wheel LEFT
   - Entries (inputs-card) RIGHT
   ========================================= */
@media (min-width: 768px){
  .hero__grid{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-areas: "wheel content";
    column-gap: 3rem;
    align-items: center;
  }

  .hero__wheel{ grid-area: wheel; }
  .hero__content{ grid-area: content; }
}

/* =========================================
   DESKTOP (≥1024px)
   - Hero fills screen height
   - 20px right padding
   - 50px bottom gap
   - Right panel stretches tall; textarea fills
   ========================================= */
@media (min-width: 1024px){

  .hero{
    padding-top: 0;
    padding-bottom: 50px;
  }

  .hero > .container.hero__grid{
    max-width: none;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;

    min-height: calc(100svh - 4.5rem - 50px);

    grid-template-columns: minmax(0, 1fr) minmax(520px, 640px);
    grid-template-areas: "wheel content";
    column-gap: 3rem;
    align-items: stretch;
  }

  .hero__wheel{
    grid-area: wheel;
    justify-self: start;
    align-self: center;
  }

  .hero__content{
    grid-area: content;
    justify-self: end;
    align-self: stretch;
    height: 100%;
    width: 100%;
    max-width: 640px;

    display: flex;
    flex-direction: column;
  }

  .inputs-card{
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  #optionsInput{
    flex: 1;
    min-height: 0;
    resize: none;
    overflow: auto;
  }
}
/* Slimmer entries panel (keep it tall) */
@media (min-width: 1024px){

  /* make the right column narrower */
  .hero > .container.hero__grid{
    grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  }

  /* keep content aligned and match the new width */
  .hero__content{
    max-width: 520px;
  }

  /* reduce left/right padding inside the card (still tall) */
  .inputs-card{
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }

  /* slightly tighter textarea padding (optional but looks slimmer) */
  #optionsInput{
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}
@media (min-width: 1024px){
  :root{
    --entries-w-min: 350px;  /* smallest it can get */
    --entries-w-max: 450px;  /* normal size */
    --entries-padding-x: 0.9rem; /* inner left/right padding */
  }

  .hero > .container.hero__grid{
    grid-template-columns: minmax(0, 1fr) minmax(var(--entries-w-min), var(--entries-w-max));
  }

  .hero__content{
    max-width: var(--entries-w-max);
  }

  .inputs-card{
    padding-left: var(--entries-padding-x);
    padding-right: var(--entries-padding-x);
  }
}
/* =========================================
   TABLET+ (≥768px)
   - Wheel LEFT
   - Entries RIGHT
   ========================================= */
@media (min-width: 768px){
  .hero__grid{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-areas: "wheel content";
    column-gap: 3rem;
    align-items: center;
  }

  .hero__wheel{ grid-area: wheel; }
  .hero__content{ grid-area: content; }
}

/* ✅ Remove the "Spin the wheel" button + all status text ("Wheel updated...") */
#spinButton,
#resultBox{
  display: none !important;
}

/* =========================================
   DESKTOP (≥1024px)
   - Keep entries panel same (right)
   - Make wheel centered in the whole page
   - Keep tall layout
   ========================================= */
@media (min-width: 1024px){

  :root{
    --entries-w-min: 350px;
    --entries-w-max: 450px;
    --entries-padding-x: 0.9rem;
    --bottom-gap: 50px;
    --top-gap: 1rem; /* your main padding-top */
  }

  .hero{
    padding-top: 0;
    padding-bottom: var(--bottom-gap);
  }

  .hero > .container.hero__grid{
    max-width: none;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;

    /* fill viewport nicely while keeping your top gap + bottom gap */
    min-height: calc(100svh - var(--bottom-gap) - var(--top-gap));

    /* ✅ 3 columns: left spacer | wheel (center) | entries (right) */
    grid-template-columns:
      minmax(var(--entries-w-min), var(--entries-w-max))
      minmax(0, 1fr)
      minmax(var(--entries-w-min), var(--entries-w-max));

    grid-template-areas: "spacer wheel content";
    column-gap: 3rem;
    align-items: stretch;
  }

  /* ✅ Wheel in the middle of the page */
  .hero__wheel{
    grid-area: wheel;
    justify-self: center;
    align-self: center;
  }

  /* ✅ Entries stay on the right (same) */
  .hero__content{
    grid-area: content;
    justify-self: end;
    align-self: stretch;

    width: 100%;
    max-width: var(--entries-w-max);

    display: flex;
    flex-direction: column;
  }

  /* keep entries tall */
  .inputs-card{
    height: 100%;
    display: flex;
    flex-direction: column;

    padding-left: var(--entries-padding-x);
    padding-right: var(--entries-padding-x);
  }

  #optionsInput{
    flex: 1;
    min-height: 0;
    resize: none;
    overflow: auto;
  }
}
@media (min-width: 1024px){
  .hero__wheel{ justify-self: center !important; }
}
/* ===== FIX: hero fits in the first screen (no initial scroll) ===== */
@media (min-width: 1024px){

  :root{
    --header-h: 3.2rem;   /* match .header__inner height */
    --hero-top: 16px;     /* gap under header (control this) */
    --hero-bottom: 15px;  /* bottom breathing room (control this) */
  }

  /* Header is sticky (in flow), so don't add extra top padding here */
  main{ padding-top: 0 !important; }

  /* Control the visible gaps */
  .hero{
    padding-top: var(--hero-top) !important;
    padding-bottom: var(--hero-bottom) !important;
  }

  /* Make hero grid fit exactly inside the remaining viewport space */
  .hero > .container.hero__grid{
    min-height: calc(100svh - var(--header-h) - var(--hero-top) - var(--hero-bottom)) !important;
  }

  /* Keep entries card inside the screen */
  .inputs-card{
    max-height: 100% !important;
  }

  /* textarea scrolls inside the card instead of pushing page down */
  #optionsInput{
    min-height: 0;
    overflow: auto;
  }
}
