/* Future Map — a bright, flat rainbow look. No glow, no shine, no bulbs:
   just solid colours, rainbow stripes and soft white cards.
   One deliberate light look, so every colour is set here. */
:root {
  color-scheme: light;
  --bg: #F6F5FF;
  --card: #FFFFFF;
  --soft: #FAFAFF;
  --line: #E3E0F4;
  --ink: #1F1A3D;
  --muted: #5E5A7A;
  --red: #FF4D4D;
  --orange: #FF9F1C;
  --yellow: #FFC800;
  --green: #22B573;
  --blue: #3A7BFF;
  --purple: #8C52FF;
  --rainbow: linear-gradient(90deg, var(--red) 0 16.66%, var(--orange) 0 33.33%, var(--yellow) 0 50%, var(--green) 0 66.66%, var(--blue) 0 83.33%, var(--purple) 0);
  --rainbow-smooth: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--purple));
  --display: "Fredoka", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 17px/1.55 var(--body); color: var(--ink); background: var(--bg); }

/* A flat rainbow stripe across the top of the page */
.rainbow { height: 10px; background: var(--rainbow); }

.stage { max-width: 760px; margin: 0 auto; padding-inline: 16px; padding-block: 28px 72px; }
.screen { display: flex; flex-direction: column; gap: 20px; }

/* Type */
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 7vw, 3.3rem); }
h2 { font-size: 1.4rem; margin-top: 12px; }
p { margin: 0; }
.hl { background: var(--rainbow-smooth); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font: 600 .85rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--purple); }
.lead { font-size: 1.12rem; max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Cards: plain white with a rainbow stripe along the top */
.marquee {
  position: relative; overflow: hidden;
  background: var(--card); border: 2px solid var(--line); border-radius: 22px;
  padding: 30px 24px 26px; display: flex; flex-direction: column; gap: 14px;
}
.marquee::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: var(--rainbow); }

/* Buttons: solid and flat */
.btn {
  font: 600 1.05rem/1 var(--display); color: var(--ink); cursor: pointer;
  border: 0; border-radius: 999px; padding: 14px 22px; background: transparent;
}
.btn:focus-visible, textarea:focus-visible, .search:focus-visible, .clock-pick input:focus-visible + span {
  outline: 3px solid var(--purple); outline-offset: 3px;
}
.btn-go {
  align-self: flex-start; background: var(--blue); color: #fff;
  font-size: 1.15rem; padding: 16px 28px; transition: background .2s, transform .1s;
}
.btn-go:hover { background: var(--purple); }
.btn-go:active { transform: translateY(1px); }
.btn-quiet { color: var(--muted); padding: 10px 12px; }
.btn-quiet:hover { color: var(--ink); }
.btn-quiet:disabled { visibility: hidden; }
.btn-ghost { border: 2px solid var(--line); background: var(--card); }
.btn-ghost:hover { border-color: var(--ink); }

/* Start screen */
.clock-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.clock-pick legend { font: 600 1.05rem/1 var(--display); margin-bottom: 12px; }
.clock-pick label { cursor: pointer; }
.clock-pick input { position: absolute; opacity: 0; }
.clock-pick span {
  display: inline-block; padding: 12px 18px; border-radius: 999px; font-weight: 700;
  border: 2px solid var(--line); background: var(--card); color: var(--muted);
}
.clock-pick input:checked + span { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Question-count slider and accuracy meter */
.length-pick { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.length-label { font: 600 1.15rem/1.2 var(--display); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.length-label output { font: 700 2rem/1 var(--display); color: var(--purple); font-variant-numeric: tabular-nums; }
#numQ { width: 100%; accent-color: var(--purple); height: 28px; cursor: pointer; }
.acc-meter { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.acc-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--red), var(--orange) 30%, var(--yellow) 50%, var(--green) 80%); background-size: 100% 100%; transition: width .3s; }
.acc-scale { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); font-weight: 700; }
.acc-text { font-weight: 700; }
.timed { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; align-self: flex-start; }
.timed input { width: 20px; height: 20px; accent-color: var(--purple); }

/* Quiz header: ladder and clock */
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.quiz-top-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.q-count { font: 600 1rem/1 var(--display); color: var(--muted); }
/* The ladder: each finished rung fills in with the next rainbow colour. */
.ladder { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; } /* columns set per game in app.js */
.ladder span { height: 14px; border-radius: 4px; background: var(--line); transition: background .4s; }
.ladder span.now { background: var(--card); box-shadow: inset 0 0 0 2px var(--ink); }
.ladder span.done:nth-child(6n + 1) { background: var(--red); }
.ladder span.done:nth-child(6n + 2) { background: var(--orange); }
.ladder span.done:nth-child(6n + 3) { background: var(--yellow); }
.ladder span.done:nth-child(6n + 4) { background: var(--green); }
.ladder span.done:nth-child(6n + 5) { background: var(--blue); }
.ladder span.done:nth-child(6n) { background: var(--purple); }

.clock { position: relative; width: 76px; height: 76px; flex: none; }
.clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.clock-track { fill: none; stroke: var(--line); stroke-width: 7; }
.clock-ring { fill: none; stroke: var(--blue); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 213.6; transition: stroke .3s; }
.clock-text { position: absolute; inset: 0; display: grid; place-items: center; font: 600 1.15rem/1 var(--display); font-variant-numeric: tabular-nums; }
.clock.low .clock-ring { stroke: var(--red); }

/* Heat meter: a rainbow track, revealed as the game gets closer */
.heat { display: flex; align-items: center; gap: 12px; }
.heat-icon { font-size: 1.6rem; width: 2.4rem; text-align: center; }
.heat-track { position: relative; flex: 1; height: 16px; border-radius: 999px; overflow: hidden; background: linear-gradient(90deg, var(--blue), var(--green), var(--yellow), var(--orange), var(--red)); }
.heat-cover { position: absolute; top: 0; right: 0; bottom: 0; width: 96%; background: var(--line); transition: width 1.1s ease-out; }
.heat-label { font: 600 .95rem/1 var(--display); min-width: 7.5em; text-align: right; }
.heat.blazing .heat-icon { animation: sway 2.4s ease-in-out infinite; }
@keyframes sway { 50% { transform: scale(1.08); } }

/* Host bubble: a soft pastel that changes colour each question */
.host {
  align-self: flex-start; max-width: 100%; font-weight: 700;
  border-radius: 18px 18px 18px 4px; padding: 10px 16px; background: #DCE8FF;
  animation: fade .6s ease-out;
}
.host::before { content: "🎤 "; }
.host.tone-0 { background: #FFE1E1; }
.host.tone-1 { background: #FFEACC; }
.host.tone-2 { background: #FFF2BF; }
.host.tone-3 { background: #D3F3E3; }
.host.tone-4 { background: #DCE8FF; }
.host.tone-5 { background: #EBDFFF; }
@keyframes fade { from { opacity: 0; } }

/* Question card */
.q-card.pop { animation: glide .5s ease-out; }
@keyframes glide { from { transform: translateY(10px); opacity: 0; } }
.q-text { font-size: clamp(1.6rem, 5.4vw, 2.3rem); }
.answer-form { display: flex; flex-direction: column; gap: 12px; }
#answer {
  width: 100%; resize: vertical; min-height: 116px;
  font: 700 1.2rem/1.45 var(--body); color: var(--ink);
  background: var(--soft); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px;
}
#answer:focus { border-color: var(--blue); outline: none; }
#answer::placeholder { color: var(--muted); font-weight: 400; opacity: .8; }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nav-right { display: flex; gap: 6px; align-items: center; }
.btn-next { align-self: auto; padding: 13px 24px; font-size: 1.05rem; }
.key-hint { font-size: .85rem; color: var(--muted); text-align: center; }

/* Drumroll */
.drumroll { min-height: 60vh; align-items: center; justify-content: center; text-align: center; }
.drum-text {
  font: 700 clamp(2.4rem, 9vw, 4rem)/1.1 var(--display);
  background: var(--rainbow-smooth); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: breathe 1.4s ease-in-out infinite;
}
.drum-sticks { font-size: 4rem; animation: bounce .7s ease-in-out infinite alternate; }
@keyframes breathe { 50% { transform: scale(1.04); } }
@keyframes bounce { to { transform: translateY(-8px); } }

/* Reveal */
.reveal.flip { animation: rise .8s ease-out; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.guess-name { font-size: clamp(2.3rem, 9vw, 4rem); color: var(--purple); }
.guess-desc { font-size: 1.2rem; font-weight: 700; }
.guess-why { color: var(--muted); max-width: 62ch; }
.guess-why strong { color: var(--ink); }
.time-up { color: var(--red); }
.guess-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.guess-actions .btn-go { align-self: auto; background: var(--green); }
.guess-actions .btn-go:hover { background: #1B9A61; }
.ask { font: 600 1.1rem/1 var(--display); }
.guess-done { font: 700 1.35rem/1.3 var(--display); color: var(--green); }

/* Shortlist: each row gets a rainbow colour tab */
.top-jobs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.top-jobs li {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: 10px; align-items: center;
  background: var(--card); border: 2px solid var(--line); border-left-width: 8px; border-radius: 14px; padding: 10px 14px;
}
.top-jobs li:nth-child(6n + 1) { border-left-color: var(--red); }
.top-jobs li:nth-child(6n + 2) { border-left-color: var(--orange); }
.top-jobs li:nth-child(6n + 3) { border-left-color: var(--yellow); }
.top-jobs li:nth-child(6n + 4) { border-left-color: var(--green); }
.top-jobs li:nth-child(6n + 5) { border-left-color: var(--blue); }
.top-jobs li:nth-child(6n) { border-left-color: var(--purple); }
.tj-rank { font: 700 1.1rem/1 var(--display); color: var(--muted); text-align: center; }
.tj-name { font-weight: 700; }
.tj-pct, .jl-pct { font: 600 .95rem/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }

.search {
  width: 100%; font: 1rem var(--body); color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.job-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 2px solid var(--line); border-radius: 14px; }
.job-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.job-list li:last-child { border-bottom: 0; }
.jl-name { font-weight: 700; }
.jl-desc { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

@media (max-width: 560px) {
  .marquee { padding: 26px 18px 22px; }
  .top-jobs { grid-template-columns: 1fr; }
  .ladder { gap: 3px; }
  .clock { width: 64px; height: 64px; }
  .heat-label { min-width: 0; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
