/* Wired Up Quiz — loaded edition. Dark "wired up" theme. */

* { box-sizing: border-box; margin: 0; }

body {
  font-family: "Fredoka", system-ui, sans-serif;
  background: radial-gradient(circle at 20% 0%, #1b2b22, transparent 45%),
              radial-gradient(circle at 90% 10%, #1a2236, transparent 45%),
              linear-gradient(160deg, #11131a, #0d0f15);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #e8edf6;
}
/* in a showcase the dropdown sits on top, so anchor to the top and tighten the gaps */
body.showcase { justify-content: flex-start; padding: 10px 12px 16px; }

/* ===== the in-pane switcher (dropdown) ===== */
.switcher {
  width: 100%;
  max-width: 460px;
  background: #161a26;
  border: 1px solid #2a3042;
  border-radius: 14px;
  padding: 9px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.switch-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.switch-label { font-size: 0.82rem; color: #9aa6bf; font-weight: 500; white-space: nowrap; }

.feat-select {
  flex: 1;
  min-width: 150px;
  font-family: inherit; font-size: 0.92rem; font-weight: 500;
  color: #e8edf6; background: #262c3e;
  border: 2px solid #353d54; border-radius: 10px;
  padding: 7px 30px 7px 12px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239af86a' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.feat-select:hover, .feat-select:focus { border-color: #9af86a; outline: none; }

/* score control on the results showcase */
.score-pills { display: flex; gap: 6px; }
.score-pill {
  font-family: inherit; font-size: 0.86rem; font-weight: 500;
  color: #cdd6e6; background: #262c3e;
  border: 2px solid #353d54; border-radius: 999px;
  padding: 5px 13px; cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.score-pill:hover { border-color: #9af86a; }
.score-pill.active { background: #9af86a; color: #07120a; border-color: #9af86a; font-weight: 600; }

/* the card */
#quiz {
  width: 100%;
  max-width: 440px;
  background: #1c2030;
  border: 1px solid #2a3042;
  border-radius: 18px;
  padding: 22px 22px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}
body.showcase #quiz { padding: 20px 20px 18px; }

.hidden { display: none; }

#rocket { width: 64px; height: 64px; margin-bottom: 6px; }
body.showcase #rocket { width: 52px; height: 52px; }

h1 { font-size: 1.9rem; font-weight: 600; color: #9af86a; }

.subtitle { color: #9aa6bf; margin: 6px 0 18px; font-size: 0.98rem; }

.start {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 500;
  color: #07120a;
  background: #9af86a;
  border: none;
  border-radius: 12px;
  padding: 12px 26px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.start:hover { filter: brightness(1.08); transform: translateY(-2px); }

.how-link, .best-line, .band-msg { color: #9aa6bf; }

/* =========================================================
   WELCOME EXTENSIONS
   ========================================================= */

/* "a logo or picture" — a real logo sat on a clean badge */
.welcome-pic {
  display: inline-block;
  background: #fff;
  border-radius: 14px;
  padding: 12px 18px;
  margin: 0 auto 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.welcome-pic img { height: 40px; display: block; }

/* "greet by name" — a real input → validate → greet flow */
.name-field { margin: 4px 0 16px; }
#nameInput {
  font-family: inherit; font-size: 1rem; text-align: center;
  color: #e8edf6; background: #262c3e;
  border: 2px solid #353d54; border-radius: 10px;
  padding: 10px 14px; width: 80%; max-width: 240px;
}
#nameInput:focus { outline: none; border-color: #9af86a; }
.name-error { color: #ff9db0; font-size: 0.9rem; margin-top: 10px; }
.name-greeting { margin-top: 4px; }
.greet-big { font-size: 1.5rem; font-weight: 600; color: #9af86a; }
.greet-sub { color: #9aa6bf; margin: 8px 0 16px; }
.ghost-btn {
  font-family: inherit; font-size: 0.9rem; color: #9aa6bf;
  background: transparent; border: 1px solid #353d54; border-radius: 999px;
  padding: 6px 16px; cursor: pointer;
}
.ghost-btn:hover { border-color: #9af86a; color: #cdd6e6; }

/* "a colour theme" — a genuinely different design language (brutalist, B&W + purple) */
#quiz.theme-brutal {
  background: #f5f4ef;
  color: #0a0a0a;
  border: 3px solid #0a0a0a;
  border-radius: 0;
  box-shadow: 10px 10px 0 #7c3aed;
  font-family: "Space Mono", ui-monospace, monospace;
}
#quiz.theme-brutal #rocket { display: none; }
#quiz.theme-brutal h1 {
  font-family: "Archivo Black", system-ui, sans-serif; font-weight: 400;
  text-transform: uppercase; letter-spacing: -1px; line-height: 0.95; font-size: 2rem;
  background: linear-gradient(100deg, #7c3aed, #c026d3 55%, #0a0a0a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#quiz.theme-brutal .subtitle {
  color: #0a0a0a; font-weight: 700; text-transform: uppercase;
  font-size: 0.78rem; letter-spacing: 1.5px; margin: 10px 0 18px;
}
#quiz.theme-brutal .start {
  background: #0a0a0a; color: #fff; border: 3px solid #0a0a0a; border-radius: 0;
  box-shadow: 5px 5px 0 #7c3aed; font-family: "Space Mono", monospace; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
#quiz.theme-brutal .start:hover { background: #7c3aed; box-shadow: 7px 7px 0 #0a0a0a; transform: translate(-2px, -2px); filter: none; }

/* =========================================================
   QUESTION SCREEN
   ========================================================= */
.qtop {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.step { font-size: 0.82rem; color: #7f8aa3; }
.chip { font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: #07120a; }
.chip-html { background: #ff8a5c; }
.chip-css { background: #5cc8ff; }
.chip-js { background: #ffd166; }
.chip-wild { background: #c08cff; }
.kind { font-size: 0.78rem; color: #7f8aa3; }

.question { font-size: 1.12rem; font-weight: 500; margin-bottom: 12px; line-height: 1.3; }

/* progress bar extension */
.q-progress { margin-bottom: 14px; }
.q-progress .bar {
  display: block; height: 9px; border-radius: 999px;
  background: #2a3042; overflow: hidden; margin-bottom: 6px;
}
.q-progress .bar-fill { display: block; height: 100%; width: 43%; border-radius: 999px; background: linear-gradient(90deg, #5cc8ff, #9af86a); }
.q-progress-label { font-size: 0.8rem; color: #9aa6bf; }

/* picture-in-a-question extension — a real screenshot */
.q-pic { margin: 0 auto 12px; max-width: 230px; }
.q-pic img { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid #232a3b; }

.code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem; text-align: left;
  background: #0c0e14; color: #cfe3ff;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 12px;
  white-space: pre; overflow-x: auto; line-height: 1.5;
  border: 1px solid #232a3b;
}

.answers { display: grid; gap: 8px; }
.answers button {
  font-family: inherit; font-size: 0.98rem;
  color: #e8edf6; background: #262c3e;
  border: 2px solid transparent; border-radius: 11px;
  padding: 11px 12px; cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.answers button:hover { background: #2e3650; border-color: #9af86a; }

/* plain pick: neutral highlight, no right/wrong */
.answers button.selected { background: #2e3650; border-color: #5cc8ff; }

/* instant-feedback after a pick */
.answers button.right { background: #173a26; border-color: #36d17e; color: #b6f7cf; }
.answers button.wrong { background: #3a1a1f; border-color: #ff6b81; color: #ffc4cd; }
.answers button.show-correct { border-color: #36d17e; box-shadow: 0 0 0 2px rgba(54,209,126,0.4) inset; }

.feedback { margin-top: 12px; font-weight: 600; font-size: 1.05rem; }

.next {
  font-family: inherit; font-size: 1rem; font-weight: 500;
  color: #07120a; background: #9af86a; border: none;
  border-radius: 11px; padding: 10px 24px; margin-top: 14px; cursor: pointer;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.next:hover { filter: brightness(1.08); transform: translateY(-2px); }

/* =========================================================
   RESULTS
   ========================================================= */
#scoreText { color: #9af86a; }
.band-msg { font-size: 1.05rem; color: #cdd6e6; margin: 8px 0 4px; min-height: 1.2em; }
.best-line { font-size: 0.95rem; margin: 6px 0 14px; }

.celebrate {
  font-size: 1.6rem; letter-spacing: 6px; margin-bottom: 8px;
  animation: pop 0.55s ease;
}
.celebrate.celebrate-hint {
  font-size: 0.9rem; letter-spacing: normal; color: #9aa6bf; animation: none;
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}

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