:root {
  --navy: #14205c;
  --blue: #1d3a8a;
  --blue-light: #2f56c9;
  --red: #e63946;
  --red-dark: #b71f2c;
  --yellow: #ffd23f;
  --yellow-light: #fff3b0;
  --cream: #fffaf0;
  --ink: #1b1b2f;
  --muted: #5b5f7a;
  --radius: 18px;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background-color: var(--navy);
  /* Game-show sunburst behind everything. */
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 210, 63, 0.25), transparent 55%),
    repeating-conic-gradient(from 0deg at 50% 0%, var(--blue) 0deg 7.5deg, var(--navy) 7.5deg 15deg);
  background-attachment: fixed;
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ header */

.marquee-wrap {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.marquee-sign {
  display: inline-block;
  padding: 1rem 2.2rem 1.4rem;
  background: var(--red);
  border-radius: 24px;
  border: 10px dotted var(--yellow-light);
  outline: 6px solid var(--yellow);
  outline-offset: -2px;
  box-shadow: 0 0 0 10px var(--red-dark), 0 0 40px 14px rgba(255, 210, 63, 0.55), var(--shadow);
  animation: bulbs 0.9s steps(1) infinite;
  max-width: 100%;
}

@keyframes bulbs {
  0%   { border-color: var(--yellow-light); }
  50%  { border-color: #ffb703; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-sign { animation: none; }
}

.presents {
  margin: 0 0 0.25rem;
  font-family: 'Bungee', 'Rubik', sans-serif;
  color: var(--yellow-light);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.title-link { text-decoration: none; }

.title {
  margin: 0;
  font-family: 'Bungee Shade', 'Bungee', 'Rubik', sans-serif;
  font-weight: 400;
  line-height: 1.05;
  color: var(--yellow);
  font-size: clamp(2rem, 8vw, 4.2rem);
  text-shadow: 3px 3px 0 var(--red-dark);
}

.title span { color: #fff; }

.tagline {
  margin: 1.6rem auto 0;
  max-width: 36rem;
  color: #fff;
  font-size: 1.1rem;
}

.tagline strong { color: var(--yellow); }

/* ------------------------------------------------------------------ form */

main {
  flex: 1;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem;
}

.panel {
  background: var(--cream);
  border: 5px solid var(--yellow);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.prompt {
  margin: 0 0 1.25rem;
  text-align: center;
  font-family: 'Bungee', 'Rubik', sans-serif;
  font-weight: 400;
  color: var(--blue);
  font-size: clamp(1.3rem, 4.5vw, 1.9rem);
}

.field-label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-weight: 800;
  font-size: 1.1rem;
}

.difficulty-value { color: var(--red); }

.select {
  width: 100%;
  padding: 0.9rem 1rem;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--blue);
  border-radius: 12px;
}

.select:focus-visible,
.slider:focus-visible,
button:focus-visible {
  outline: 4px solid var(--red);
  outline-offset: 3px;
}

.slider {
  width: 100%;
  accent-color: var(--red);
  margin: 0.25rem 0 0;
  height: 1.6rem;
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0 2px;
}

.big-button {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem;
  font-family: 'Bungee', 'Rubik', sans-serif;
  font-size: 1.6rem;
  color: #fff;
  background: var(--red);
  border: 4px solid var(--red-dark);
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--red-dark);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}

.big-button:hover:not(:disabled) { background: #f04b58; }
.big-button:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--red-dark); }
.big-button:disabled { opacity: 0.7; cursor: progress; }

.surprise-button {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  font-family: 'Bungee', 'Rubik', sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--yellow);
  border: 4px solid #d9a800;
  border-radius: 999px;
  box-shadow: 0 5px 0 #b88f00;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}

.surprise-button:hover:not(:disabled) { background: #ffdb66; }
.surprise-button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #b88f00; }
.surprise-button:disabled { opacity: 0.7; cursor: progress; }

.surprise-hint {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ messages */

.message {
  margin: 1.25rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: var(--yellow-light);
  border-left: 8px solid var(--yellow);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.message.error {
  background: #ffe1e3;
  border-left-color: var(--red);
  color: var(--red-dark);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.chip {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.chip:hover { background: var(--blue-light); }

/* ------------------------------------------------------------------ results */

.results { margin-top: 1.5rem; }

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.results-heading {
  margin: 0;
  font-family: 'Bungee', 'Rubik', sans-serif;
  font-weight: 400;
  color: var(--yellow);
  font-size: 1.3rem;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.small-button {
  font-family: 'Bungee', 'Rubik', sans-serif;
  font-size: 0.95rem;
  padding: 0.55rem 1.1rem;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid #d9a800;
  border-radius: 999px;
  box-shadow: 0 4px 0 #b88f00;
  cursor: pointer;
}

.small-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #b88f00; }

.results-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.question-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  border: 4px solid var(--blue);
  padding: 1.1rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.card-number {
  display: inline-grid;
  place-items: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.4rem;
  font-family: 'Bungee', 'Rubik', sans-serif;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 999px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  color: #fff;
}

.badge-category { color: var(--ink); background: var(--yellow-light); border: 2px solid #d9a800; }

.badge[data-difficulty="Easy"] { background: #2a9d4b; }
.badge[data-difficulty="Medium"] { background: var(--blue-light); }
.badge[data-difficulty="Hard"] { background: #e07a00; }
.badge[data-difficulty="Impossible"] { background: var(--red); }

.card-question {
  margin: 0.25rem 0 0.9rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}

.reveal-button {
  font: inherit;
  font-weight: 800;
  padding: 0.45rem 1rem;
  color: var(--blue);
  background: transparent;
  border: 3px dashed var(--blue);
  border-radius: 999px;
  cursor: pointer;
}

.reveal-button:hover { background: #eef2ff; }

.card-answer {
  margin: 0;
  padding: 0.7rem 1rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--red-dark);
  background: var(--yellow-light);
  border-radius: 10px;
  animation: pop 0.25s ease-out;
}

@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ------------------------------------------------------------------ footer */

.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .marquee-sign { padding: 0.8rem 1.2rem 1rem; border-width: 7px; }
  .panel { padding: 1.1rem; }
  .card-question { font-size: 1.1rem; }
}

/* ------------------------------------------------------------------ print */

.print-sheet { display: none; }

@media print {
  @page { margin: 1.6cm; }

  body {
    display: block;
    min-height: 0;
    color: #000;
    background: #fff;
    font-size: 12pt;
  }

  body > :not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; }

  .print-page + .print-page { break-before: page; }

  .print-brand {
    margin: 0;
    font-family: 'Bungee', 'Rubik', sans-serif;
    font-size: 10pt;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .print-title {
    margin: 0.2rem 0 0.8rem;
    font-family: 'Bungee', 'Rubik', sans-serif;
    font-weight: 400;
    font-size: 18pt;
  }

  .print-fields {
    display: flex;
    gap: 2rem;
    margin: 0 0 1.2rem;
    font-weight: 600;
  }

  .print-fields span { flex: 1; padding-bottom: 1.4rem; border-bottom: 1px solid #000; }
  .print-fields span:last-child { flex: 0 0 8rem; }

  .print-questions,
  .print-answers { margin: 0; padding-left: 1.8rem; }

  .print-questions li {
    margin-bottom: 0.9rem;
    line-height: 1.35;
    break-inside: avoid;
  }

  /* A blank line under each question for players to write on. */
  .print-questions li::after {
    content: '';
    display: block;
    height: 1.6rem;
    border-bottom: 1px solid #888;
  }

  .print-answers li { margin-bottom: 0.45rem; line-height: 1.35; break-inside: avoid; }

  .print-difficulty { color: #555; font-size: 0.85em; }
}
