@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --koan-orange:     #FF4D00;
  --koan-black:      #0A0A0A;
  --koan-white:      #F5F0EB;
  --koan-grey-dark:  #1A1A1A;
  --koan-grey-mid:   #2E2E2E;
  --koan-grey-light: #6B6B6B;

  --team-mercedes:   #00D2BE;
  --team-aston:      #006F44;
  --team-williams:   #37BEDD;
  --team-mclaren:    #FF8000;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #1D1D1D;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  margin: 0;
  padding: 20px 0;
}

/* ── Quiz Wrapper ── */
.quiz-wrapper {
  width: 100%;
  max-width: 680px;
  min-height: 520px;
  margin: 0 auto;
  background: #1D1D1D;
  border-radius: 4px;
  font-family: var(--font-body);
  color: var(--koan-white);
  overflow: hidden;
  position: relative;
}

/* ── Progress Bar ── */
.progress-bar {
  height: 3px;
  background: var(--koan-grey-mid);
  width: 100%;
}

.progress-fill {
  height: 3px;
  background: var(--koan-orange);
  width: 0%;
  transition: width 0.4s ease;
}

/* ── Screens ── */
.screen {
  display: none;
  padding: 48px 40px;
}

.screen.active {
  display: block;
}

/* ── Logos ── */
.koan-logo {
  width: 100px;
  height: auto;
  margin-bottom: 32px;
  opacity: 0.9;
}

.koan-symbol {
  width: 36px;
  height: auto;
  margin-bottom: 16px;
  opacity: 0.7;
}

/* ── Intro Screen ── */
.intro-screen {
  text-align: center;
  animation: fadeInUp 0.6s ease both;
}

.intro-screen h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--koan-white);
}

.intro-screen p {
  font-size: 0.95rem;
  color: var(--koan-grey-light);
  margin-bottom: 36px;
  font-weight: 300;
  line-height: 1.5;
}

.intro-disclaimer {
  font-size: 0.75rem !important;
  color: var(--koan-grey-light) !important;
  margin-top: 16px;
  margin-bottom: 0 !important;
  font-style: italic;
  opacity: 0.7;
}

/* ── Question Card ── */
.question-card {
  animation: slideInRight 0.35s ease both;
}

.question-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.back-button {
  background: none;
  border: 1px solid var(--koan-grey-mid);
  color: var(--koan-grey-light);
  width: 32px;
  height: 32px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.back-button:hover {
  border-color: var(--koan-orange);
  color: var(--koan-white);
}

.question-number {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--koan-orange);
  text-transform: uppercase;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 28px;
}

/* ── Answer Options ── */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-option {
  border: 1px solid var(--koan-grey-mid);
  border-radius: 2px;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--koan-white);
  background: transparent;
  text-align: left;
  width: 100%;
  line-height: 1.4;
}

.answer-option:hover,
.answer-option:focus-visible {
  border-color: var(--koan-orange);
  background: rgba(255, 77, 0, 0.08);
  outline: none;
}

.answer-option.selected {
  border-color: var(--koan-orange);
  background: rgba(255, 77, 0, 0.08);
}

/* ── CTA / Buttons ── */
.cta-button {
  background: var(--koan-orange);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  padding: 14px 32px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-block;
  text-decoration: none;
}

.cta-button:hover {
  opacity: 0.88;
  transform: scale(1.02);
}

/* ── Results Screen ── */
.results-screen {
  text-align: center;
  animation: fadeInUp 0.6s ease both;
}

.results-label {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--koan-grey-light);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.results-team-name {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  min-height: 1.2em;
}

.results-tagline {
  font-size: 0.95rem;
  color: var(--koan-grey-light);
  margin-bottom: 24px;
  font-weight: 300;
}

/* ── Score Breakdown ── */
.score-breakdown {
  max-width: 440px;
  margin: 0 auto 28px;
  text-align: left;
}

.score-row {
  margin-bottom: 14px;
  animation: fadeInUp 0.4s ease both;
}

.score-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.score-dim-name {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--koan-white);
  letter-spacing: 0.02em;
}

.score-dim-value {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--koan-grey-light);
  letter-spacing: 0.05em;
}

.score-bar-track {
  height: 6px;
  background: var(--koan-grey-mid);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--bar-color);
  border-radius: 3px;
  animation: barGrow 0.8s ease forwards;
  animation-delay: var(--bar-delay, 0.4s);
}

@keyframes barGrow {
  from { width: 0%; }
  to { width: var(--bar-width); }
}

/* ── Grid Canvas ── */
.grid-container {
  width: 560px;
  max-width: 100%;
  margin: 0 auto 28px;
  position: relative;
  overflow: visible;
}

.grid-container canvas {
  display: block;
  width: 100%;
  height: auto;
}

.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
}

/* ── Results Description ── */
.results-description {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--koan-white);
  margin-bottom: 28px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Results Action Buttons ── */
.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--koan-grey-mid);
  color: var(--koan-white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  padding: 10px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.action-button:hover {
  border-color: var(--koan-orange);
  background: rgba(255, 77, 0, 0.08);
}

.action-button svg {
  flex-shrink: 0;
}

/* ── CTA Section ── */
.cta-section {
  border-top: 1px solid var(--koan-grey-mid);
  padding-top: 28px;
}

.cta-section h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.cta-section p {
  font-size: 0.85rem;
  color: var(--koan-grey-light);
  font-weight: 300;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Restart Button ── */
.restart-button {
  background: none;
  border: 1px solid var(--koan-grey-mid);
  color: var(--koan-grey-light);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 10px 20px;
  margin-top: 24px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.restart-button:hover {
  border-color: var(--koan-grey-light);
  color: var(--koan-white);
}

/* ── Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-40px);
  }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .screen {
    padding: 32px 20px;
  }

  .intro-screen h1 {
    font-size: 1.7rem;
  }

  .results-team-name {
    font-size: 1.8rem;
  }

  .question-text {
    font-size: 1.05rem;
  }

  .results-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .action-button {
    justify-content: center;
  }
}

/* ── Print ── */
@media print {
  body {
    background: #fff;
    padding: 0;
  }

  .quiz-wrapper {
    background: #fff;
    color: #0A0A0A;
    max-width: 100%;
  }

  .progress-bar,
  .results-actions,
  .restart-button,
  .cta-button {
    display: none !important;
  }

  .screen.active {
    padding: 20px;
  }

  .results-team-name {
    color: #FF4D00;
  }

  .results-tagline,
  .results-label,
  .score-dim-name,
  .results-description {
    color: #333;
  }

  .score-bar-track {
    background: #ddd;
  }

  .grid-container canvas {
    border: 1px solid #ccc;
  }

  .cta-section {
    border-top-color: #ccc;
  }

  .cta-section h3 {
    color: #FF4D00;
  }

  .cta-section p {
    color: #333;
  }
}
