:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #66736b;
  --line: #dfe7df;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --green: #24563b;
  --green-2: #dceade;
  --gold: #b8892f;
  --coral: #d96d4a;
  --blue: #2f6f9f;
  --shadow: 0 18px 50px rgba(29, 42, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
a,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 5vw, 64px);
  background: rgba(251, 250, 246, 0.9);
  border-bottom: 1px solid rgba(36, 86, 59, 0.12);
  backdrop-filter: blur(14px);
}

.brand {
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 22px;
  font-weight: 850;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav button,
nav a,
.quiet {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 12px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 42px 0 64px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.1;
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
}

.hero-actions,
.result-actions,
.card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.primary,
.secondary,
.card-footer button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid var(--green);
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 800;
}

.primary,
.card-footer button {
  background: var(--green);
  color: #fff;
}

.secondary {
  background: transparent;
  color: var(--green);
}

.secondary.dark {
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}

.wide {
  width: 100%;
}

.hero-media {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #e9eee6;
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.stat-strip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-strip span {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 24px;
}

.filter-row span,
.score-pill,
.question-count {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 72px;
}

.quiz-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(29, 42, 33, 0.08);
}

.quiz-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.quiz-card > div {
  padding: 18px;
}

.quiz-card p {
  color: var(--muted);
  line-height: 1.5;
}

.card-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.card-meta span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.card-footer {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.play-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  padding: 28px 0 64px;
}

.play-panel,
.sponsor-panel,
.results-card,
.feedback-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.play-panel {
  padding: clamp(18px, 3vw, 30px);
}

.play-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}

.play-head h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  margin: 22px 0;
  border-radius: 999px;
  background: var(--green-2);
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--coral));
}

.question-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(280px, 1fr);
  gap: 26px;
  align-items: start;
}

.question-image {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 8px;
  background: #edf1ea;
}

.question-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.map-overlay {
  position: absolute;
  right: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  border-radius: 6px;
  padding: 5px 8px;
  background: rgba(23, 33, 27, 0.72);
  color: #fff;
  font-size: 12px;
}

.question-copy h2 {
  font-size: clamp(26px, 3vw, 38px);
}

.answers {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.answers button {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
  text-align: left;
  font-weight: 800;
}

.answers button:hover,
.answers .selected {
  border-color: var(--green);
  background: var(--green-2);
}

.answers .correct {
  border-color: #2f7d4a;
  background: #d8f1df;
}

.answers .wrong {
  border-color: #b94d3d;
  background: #f8ddd8;
}

.reveal {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  background: #fff8e8;
  color: var(--ink);
}

.reveal a {
  color: var(--green);
  font-weight: 800;
}

.sponsor-panel {
  align-self: start;
  position: sticky;
  top: 92px;
  padding: 22px;
  background: var(--green);
  color: #fff;
}

.sponsor-panel p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.results-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  padding: 44px 0 72px;
}

.results-card,
.feedback-form {
  padding: clamp(20px, 4vw, 36px);
}

.results-card img {
  width: min(360px, 100%);
  margin-bottom: 22px;
  border-radius: 8px;
}

.feedback-form {
  display: grid;
  gap: 12px;
  align-self: start;
}

select,
textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.error {
  padding: 64px 0;
}


.setup-shell,
.sponsor-break-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 72px;
}

.setup-panel,
.sponsor-break-head {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 42px);
}

.setup-panel h1,
.sponsor-break-head h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.98;
  max-width: 760px;
}

.postcode-form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.postcode-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.setup-control {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.setup-label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.setup-label strong {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.setup-label span {
  color: var(--muted);
  font-weight: 750;
  text-align: right;
}

input[type="range"] {
  accent-color: var(--green);
  min-height: 44px;
  cursor: pointer;
}

.availability-grid,
.setup-actions,
.sponsor-break-grid {
  display: grid;
  gap: 12px;
}

.availability-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.availability-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: var(--muted);
  font-weight: 800;
}

.availability-grid strong {
  display: block;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.setup-actions {
  grid-template-columns: 1fr 1fr auto;
  margin-top: 30px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.sponsor-break-shell {
  display: grid;
  gap: 18px;
}

.sponsor-break-grid {
  grid-template-columns: repeat(2, 1fr);
}

.sponsor-ad-card {
  position: relative;
  display: grid;
  min-height: 280px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #e9eee6;
  box-shadow: 0 10px 28px rgba(29, 42, 33, 0.08);
  color: #fff;
  text-decoration: none;
}

.sponsor-ad-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  grid-area: 1 / 1;
}

.sponsor-ad-card span {
  grid-area: 1 / 1;
  align-self: end;
  padding: 18px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  font-size: 22px;
  font-weight: 900;
}


@media (max-width: 920px) {
  .hero,
  .quiz-grid,
  .play-shell,
  .question-layout,
  .results-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .sponsor-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 12px 16px;
  }

  nav {
    gap: 2px;
  }

  nav button,
  nav a,
  .quiet {
    padding: 8px;
    font-size: 14px;
  }

  main {
    width: min(100% - 20px, 1180px);
  }

  h1 {
    font-size: 40px;
  }

  .play-head {
    grid-template-columns: 1fr;
  }

  .stat-strip {
    position: static;
    grid-template-columns: 1fr;
    padding: 10px;
  }


  .setup-label,
  .setup-actions,
  .sponsor-break-grid {
    grid-template-columns: 1fr;
  }

  .setup-label {
    display: grid;
  }

  .setup-label span {
    text-align: left;
  }

  .availability-grid {
    grid-template-columns: 1fr;
  }

  .sponsor-ad-card {
    min-height: 220px;
  }
}

.map-overlay {
  z-index: 5;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  text-decoration: none;
}

.question-image img {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.auth-shell,
.account-shell,
.legal-shell {
  padding: 44px 0 72px;
}

.auth-shell {
  display: grid;
  place-items: start center;
}

.auth-panel,
.account-panel,
.privacy-panel,
.legal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-panel,
.legal-panel {
  width: min(720px, 100%);
  padding: clamp(22px, 4vw, 40px);
}

.auth-panel h1,
.account-panel h1,
.legal-panel h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px !important;
  color: var(--muted) !important;
  font-weight: 650 !important;
  line-height: 1.4;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.form-error,
.form-success {
  margin: 18px 0 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
}

.form-error {
  border: 1px solid #d9a39a;
  background: #fff1ee;
  color: #8d2f21;
}

.form-success {
  border: 1px solid #acd0b7;
  background: #eef9f1;
  color: #225f39;
}

.smallprint,
.switch-auth,
.legal-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.smallprint button,
.switch-auth button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  font-weight: 850;
  text-decoration: underline;
}

.account-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.account-panel,
.privacy-panel {
  padding: clamp(20px, 4vw, 36px);
}

.privacy-panel {
  align-self: start;
  display: grid;
  gap: 12px;
}

.privacy-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.danger {
  width: 100%;
  border-color: #d9a39a;
  color: #8d2f21;
  text-align: left;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 920px) {
  .account-shell {
    grid-template-columns: 1fr;
  }
}
