@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Playfair+Display:wght@700;800&family=Roboto:wght@400;700&display=swap');

:root {
  --color-primary-dark: #1976d2;
  --color-success: #0aba83;
  --color-success-dark: #185a9d;
  --color-error: #ff5858;
  --color-error-accent: #f09819;
  --color-info-bg: #e3f2fd;
  --color-bg:  #e0e8f0;
  --color-base-light: #f0f0f0;
  --color-base-dark: #1a1a1a;
  --color-soft-black: #333;
  --color-muted-text: #666;

  --font-main: 'Lato', Arial, Helvetica, sans-serif;
  --font-heading: 'Playfair Display', serif;
  --font-choice: 'Roboto', Arial, Helvetica, sans-serif;
  --font-size-base: 14px;
  --font-size-lg: 1.3em;
  --font-size-xl: 1.5em;
  --font-size-h1: 1.35em;
  --font-size-h2: 1.2em;
  --font-size-h3: 1.1em;
  --font-size-h4: 1.05em;
  --font-size-choice: 1em;
  --font-size-feedback: 1.2em;
  --font-size-congrats: 1.3em;
  --font-size-congrats-mobile: 1em;

  --radius-default: 6px;
  --radius-strong: 18px;
  --radius-btn: 4px;
  --radius-input: 10px;
  --radius-badge: 16px;
  --radius-error: 4px;
  --shadow-small: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-large: 0 10px 28px rgba(33,150,243,0.13),
                 0 2px 8px rgba(0,0,0,0.10);

  --gradient-bg: linear-gradient(135deg, #42a5f5 0%, #7b1fa2 60%, #ab47bc 100%);
  --gradient-btn: linear-gradient(90deg, #3949ab 0%, #7c4dff 100%);
  --gradient-btn-hover: linear-gradient(90deg, #7c4dff 0%, var(--color-primary) 100%);
  --gradient-feedback-ok: linear-gradient(90deg, var(--color-success) 0%, var(--color-success-dark) 100%);
  --gradient-feedback-bad: linear-gradient(90deg, var(--color-error) 0%, var(--color-error-accent) 100%);

  --transition-default: 0.3s;
  --transition-btn: 0.3s;
  --progress-bar-height: 28px;
  --progress-bar-radius: 16px;
  --congrats-anim: 0.7s cubic-bezier(.68,-0.55,.27,1.55);

  --hero-img-mobile-width: 90vw;
  --hero-img-tablet-width: 90vw;
  --hero-img-desktop-width: 380px;
}

html {
  font-size: var(--font-size-base);
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, p {
  margin-top: 20px;
  font-family: var(--font-heading);
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-base-light);
  margin: 5rem 0 0 0;
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: 600;
  color: var(--color-base-light);
  margin-bottom: 0.75rem;
}

.container {
  overflow: hidden;
  min-height: fit-content;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-default);
  background: var(--gradient-bg);
  box-shadow: var(--shadow-small);
  position: relative;
  flex-direction: column;
  padding-bottom: 20px;
}

#result-label {
  color: var(--color-base-light);
  font-size: var(--font-size-h1);
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity var(--transition-default) ease;
  padding: 0;
  width: 100%;
  min-width: unset;
}

.hidden {
  display: none;
  opacity: 0;
}

button {
  font-size: 1em;
  padding: 12px 0;
  width: 100%;
  min-height: 24px;
  margin: 10px 10px;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--gradient-btn);
  color: var(--color-base-light);
  font-weight: 700;
  font-family: var(--font-choice);
  box-shadow: 0 2px 8px rgba(60,60,120,0.10);
  transition: background var(--transition-btn), box-shadow var(--transition-btn), color var(--transition-btn);
  text-align: left;
  padding-left: 1em;
}

button:focus {
  outline: 3px solid var(--color-soft-black);
  outline-offset: 2px;
}

button:hover,
button:focus-visible {
  background: var(--gradient-btn-hover);
  color: var(--color-base-light);
  box-shadow: 0 4px 16px var(--color-success-dark);
}

#nextBtn {
  font-size: 1.2em;
  min-height: 52px;
  padding: 16px 16px;
  max-width: fit-content;
}

#restartBtn {
  max-width: fit-content;
  padding: 16px 16px;
  margin: 10px;
}

#startBtn {
  max-width: fit-content;
  padding: 16px 16px;
  margin: 10px;
}

#choices {
  margin-top: 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  color: var(--color-base-light);
}

.choice {
  font-size: var(--font-size-choice);
  min-height: 44px;
  padding: 0;
  margin: 6px 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-choice);
}

.choice input[type="radio"] {
  margin-right: 10px;
}

.choice input[type="radio"]:checked {
  accent-color: var(--color-base-dark);
}

.choice:has(input[type="radio"]:checked) {
  color: var(--color-base-dark);
  font-weight: bold;
}

#feedback {
  font-size: 1em;
  padding: 10px;
  margin-top: 15px;
  font-weight: bold;
  max-width: 80vw;
  overflow-wrap: break-word;
  color: var(--color-base-light);
  width: fit-content;
  min-width: 170px;
}

#feedback.correct {
  color: var(--color-base-light);
  background: var(--gradient-feedback-ok);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--color-success-dark);
  transition: background var(--transition-btn), color var(--transition-btn);
  margin-left: 10px;
}

#feedback.incorrect {
  color: var(--color-base-light);
  background: var(--gradient-feedback-bad);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--color-error);
  transition: background var(--transition-btn), color var(--transition-btn);
  margin-left: 10px;
}

#timer {
  font-size: var(--font-size-choice);
  font-weight: bold;
  color: var(--color-base-light);
  margin-top: 0.5rem;
  padding: 10px 15px;
  background: linear-gradient(90deg, var(--color-error) 0%, var(--color-error-accent) 100%);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(120,60,60,0.10);
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  align-self: flex-start;
  width: fit-content;
  margin-left: 10px;
}

#timer.urgent {
  animation: flash-red 1s infinite;
}

@keyframes flash-red {
  0%, 50% {
    background: linear-gradient(90deg, #ff0000 0%, #cc0000 100%);
    box-shadow: 0 2px 8px var(--color-error);
  }
  51%, 100% {
    background: linear-gradient(90deg, var(--color-error) 0%, var(--color-error-accent) 100%);
    box-shadow: 0 2px 8px var(--color-error);
  }
}

header {
  width: 100%;
}

#quiz-label {
  text-align: left;
  color: var(--color-base-light);
  font-size: var(--font-size-h2);
  max-width: 100%;
  overflow-wrap: break-word;
  font-weight: 600;
  width: 100%;
  align-self: flex-start;
  margin: 10px;
}

#progress-container { 
  width: 100%; 
  padding: 0;
  margin-left: 1.5rem;
}

#progress {
  text-align: left;
  color: var(--color-base-light);
  font-size: var(--font-size-h3);
  margin: 1rem 0 1rem 0;
  overflow-wrap: break-word;
}

#question-container { 
  width: 100%; 
}

#question {
  font-size: var(--font-size-h4);
  margin: 10px 10px 0 10px;
  color: var(--color-base-light);
  text-align: left;
  overflow-wrap: break-word;
}

#progress-bar-container {
  width: 100%;
  margin: 8px 0 0 0;
  display: block;
  margin-left: 10px;
}

#progress-bar {
  max-width: 70vw;
  height: var(--progress-bar-height);
  width: 80%;
  background: #e3e3e3;
  border-radius: var(--progress-bar-radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px var(--color-success-dark);
  outline: none;
  transition: background 0.2s;
  display: block;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #66bb6a 0%, #4caf50 100%);
  border-radius: var(--progress-bar-radius) 0 0 var(--progress-bar-radius);
  transition: width 0.4s cubic-bezier(.68,-0.55,.27,1.55);
  width: 0%;
  z-index: 1;
}

#progress-bar-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95em;
  font-weight: 700;
  color: var(--color-base-dark);
  z-index: 2;
  pointer-events: none;
  text-align: left;
}

#progress-bar[aria-valuenow]:focus {
  box-shadow: 0 0 0 3px var(--color-primary-dark);
}

.close-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: var(--color-base-light);
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10), 0 1.5px 4px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow var(--transition-btn), background var(--transition-btn), transform 0.12s;
  outline: none;
  z-index: 20;
  padding: 0;
}

.close-x:focus {
  box-shadow: 0 0 0 3px var(--color-primary-dark), 0 2px 12px rgba(0,0,0,0.10);
  background: #f5faff;
}

.close-x:hover {
  background: #ffeaea;
  transform: scale(1.08) rotate(-8deg);
  box-shadow: 0 4px 20px rgba(211,47,47,0.13);
}

.close-x:active {
  background: #f8d7da;
  transform: scale(0.98);
}

.close-x__icon {
  width: 24px;
  height: 24px;
  display: block;
}

.close-x__icon line {
  stroke: var(--color-error);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke var(--transition-btn);
}

.close-x:hover .close-x__icon line,
.close-x:focus .close-x__icon line {
  stroke: var(--color-error);
}

.close-x__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
  background: var(--color-primary-dark);
  color: var(--color-base-light);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 1em;
  text-decoration: none;
  transition: left var(--transition-btn), box-shadow var(--transition-btn);
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  outline: 3px solid var(--color-primary-dark);
  box-shadow: 0 2px 8px var(--color-success-dark);
}

form:focus-within {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

.congrats-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fffbe6;
  color: var(--color-base-dark);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  font-size: var(--font-size-congrats-mobile);
  font-weight: bold;
  margin: 20px 0;
  padding: 16px 20px;
  box-shadow: 0 2px 12px rgba(255, 214, 0, 0.10);
  animation: pop-in var(--congrats-anim);
  max-width: 75vw;
  overflow-wrap: break-word;
  overflow: hidden;
}

.congrats-emoji {
  font-size: 2em;
  animation: confetti-bounce 1.2s infinite alternate cubic-bezier(.68,-0.55,.27,1.55);
}

@keyframes pop-in {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes confetti-bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px) rotate(-8deg); }
}

#welcome-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  overflow-wrap: break-word;
  outline: none;
}

#welcome-form label {
  font-size: 1.2em;
  text-align: left;
  width: 100%;
  display: block;
  margin-bottom: 2px;
}

#welcome-form label[for="username"] {
  font-size: 1.18em;
  font-weight: 700;
  color: var(--color-base-light);
  margin-bottom: 2px;
  margin-top: 0;
  display: block;
  text-align: left;
  letter-spacing: 0.01em;
  font-family: var(--font-main);
  background: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

#welcome-form input {
  width: 90vw;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1.1em;
  padding: 14px 14px;
  min-height: 48px;
  margin-bottom: 14px;
  border: 1.5px solid #b3e5fc;
  border-radius: var(--radius-input);
  background: rgba(255,255,255,0.95);
  color: var(--color-base-dark);
  transition: border-color var(--transition-btn), box-shadow var(--transition-btn);
  outline: none;
  font-family: inherit;
}

#welcome-form input:focus,
#welcome-form input:focus-visible {
  outline: none;
  border-color: var(--color-primary-dark);
  box-shadow: none;
}

#welcome-form input::placeholder {
  font-size: 1rem;
  color: var(--color-muted-text);
  opacity: 1;
  font-family: inherit;
}

#welcome-form button {
  max-width: fit-content;
  box-sizing: border-box;
  font-size: 1.1em;
  min-height: 48px;
  padding: 14px 14px;
  border-radius: 8px;
  margin-top: 0;
  align-self: center;
  padding-left: 1rem;
  align-self: flex-start;
}

input:focus, textarea:focus, select:focus, button:focus { outline: none; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible { outline: none; }
#result-screen { outline: none; }
#result-screen:focus { outline: none; }
#result-screen *:focus { outline: none; }

.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100vw;
  align-items: stretch;
  min-height: 340px;
  margin-bottom: 10px;
  width: 100%;
}

.hero-left {
  order: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 0 10px;
  max-width: 100%;
  box-sizing: border-box;
}

.badge {
  font-size: 1em;
  padding: 4px 12px;
  margin-bottom: 8px;
  display: inline-block;
  background: var(--color-info-bg);
  color: var(--color-base-dark);
  font-weight: 600;
  border-radius: var(--radius-badge);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
}

.hero-title-group {
  max-width: 100%;
  font-size: var(--font-size-h4);
  line-height: 1.15;
  margin-bottom: 0.2em;
  overflow-wrap: break-word;
  margin-bottom: 0.5rem;
}

.hero-title-group, .hero-title-main, .hero-title-accent {
  font-weight: 800;
  letter-spacing: -1px;
}

.hero-title-group .hero-title-main:nth-child(1),
.hero-title-group .hero-title-main:nth-child(2) {
  color: var(--color-base-light);
}

.hero-title-group .hero-title-main,
.hero-title-group .hero-title-accent {
  font-size: var(--font-size-xl);
}

.hero-title-accent {
  color: #006837;
  font-weight: 800;
}

.hero-desc {
  max-width: 90vw;
  font-size: 1.05em;
  margin-bottom: 0.7em;
  margin-top: 0.2em;
  overflow-wrap: break-word;
  color: var(--color-base-light);
  font-family: var(--font-main);
  font-weight: 400;
}

.hero-right {
  order: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 10px;
  max-width: 100%;
  box-sizing: border-box;
}

.hero-img-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 18px 0 0 0;
  padding: 0;
  display: block;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  animation: hero-float 4s ease-in-out infinite;
  transition: transform 0.5s cubic-bezier(.22,1,.36,1), box-shadow 0.4s cubic-bezier(.22,1,.36,1);
  will-change: transform, box-shadow;
  z-index: 1;
}

.hero-img-wrapper::after {
  content: '';
  display: block;
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: var(--radius-strong);
  background: linear-gradient(120deg, rgba(255,255,255,0.11) 20%, rgba(255,255,255,0.02) 80%);
  opacity: 0;
  z-index: 2;
  transition: opacity var(--transition-btn), box-shadow var(--transition-btn), border var(--transition-btn);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 2px 8px 0 rgba(33,150,243,0.06);
  backdrop-filter: blur(0.7px);
}

.hero-img-wrapper:hover::after, .hero-img-wrapper:focus-within::after { opacity: 1; }
.hero-img-wrapper:hover, .hero-img-wrapper:focus-within {
  animation: none;
  transform: scale(1.06);
  box-shadow: var(--shadow-large);
}

.hero-img {
  width: var(--hero-img-mobile-width);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border-radius: var(--radius-strong);
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0) scale(1) rotateZ(0); }
  50% { transform: translateY(-8px) scale(1.02) rotateZ(-1deg); }
}

.stats-row {
  border-radius: var(--radius-default);
  max-width: 100vw;
  padding: 10px 10px;
  gap: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,0.7);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  flex-direction: row;
  margin: 1rem 0;
  text-align: center;
}

.stat {
  min-width: 60px;
  font-size: 0.9em;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2px;
  flex: 1;
  max-width: 45%;
}

.stat-num {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.stat-label {
  font-size: 0.98em;
  color: var(--color-soft-black);
  opacity: 0.7;
}

.mobile-hero-img-top { display: block; margin-bottom: 0.5em; }

.error-message {
  width: 90vw;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 0.85em;
  padding: 4px 0 4px 10px;
  margin-top: 1px;
  margin-bottom: 2px;
  color: var(--color-error);
  min-height: 1.2em;
  font-weight: 400;
  font-family: var(--font-main);
  line-height: 1.4;
  transition: opacity var(--transition-btn) ease, transform 0.2s ease;
  border-left: 3px solid var(--color-error);
  background-color: var(--color-base-light);
  border-radius: 0 4px 4px 0;
  text-align: left;
  box-shadow: 0 1px 3px var(--color-base-dark);
  margin-left: 0;
  margin-right: 0;
}

.error-message:empty { display: none; }
.error-message.error-active { animation: shake 0.5s ease-in-out; }
.error-message.success-message {
  color: #2e7d32;
  border-left-color: #2e7d32;
  background-color: var(--color-base-light);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

#welcome-form input:invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 2px var(--color-error);
  font-size: 1em; 
}

#welcome-form input:invalid:focus {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.3);
}

#welcome-form input::placeholder {
  color: #999;
  font-style: italic;
  font-size: 1em; 
}

#result-screen.screen {
  align-items: flex-start;
  max-width: 100%;
  padding-left: 1rem;
}

@media (min-width: 601px) and (max-width: 1200px) {
   :root {
    --font-size-base: 15px; 
    --font-size-lg: 1.4em;
    --font-size-xl: 1.6em;
    --font-size-h1: 1.5em;
    --font-size-h2: 1.4em; 
    --font-size-h3: 1.3em;
    --font-size-h4: 1.15em;
    --font-size-choice: 1.1em;
    --font-size-feedback: 1.3em;
    --font-size-congrats: 1.4em;
  }
  
  body { 
    padding: 20px; 
  }

  .container {
    max-width: 90vw;
    min-height: fit-content; 
    margin: 12px auto 0 auto; 
    background: var(--gradient-bg);
    padding: 30px 24px;
    border-radius: var(--radius-strong); 
    box-shadow: var(--shadow-small);
    position: relative; 
    overflow: hidden;
  }

  #result-label {
    color: var(--color-base-light);
    font-size: var(--font-size-h1);
  }

  #quiz-label {
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-h2);
  }

  #progress {
    font-size: var(--font-size-h3);
  }

  #progress-container {
    width: 100%;
    margin: 0;
    padding: 1rem 0;
  }

  #question { 
    font-size: var(--font-size-h4);
    margin: 0; 
    max-width: 90vw; 
    margin: 10px 10px 0 10px;
  }

  .hero-left {
    order: 1; 
    width: 100%;
    display: flex; 
    flex-direction: column; 
    align-items: center;
  }

  .hero-grid { 
    flex-direction: column;
   }

  .hero-right { 
    order: 0; 
    width: 100%; 
    display: flex; 
    justify-content: center; 
  }

  .hero-img-wrapper {
    max-width: 320px;
    margin: 18px auto 0 auto; 
    width: 100%;
    display: block; 
    overflow: hidden; 
    border-radius: 14px;
    box-shadow: 0 4px 24px var(--color-base-dark);
  }
  
  .hero-img { 
    width: var(--hero-img-tablet-width); 
    max-width: 320px; 
    height: auto; 
    margin: 0 auto; 
  }

  .hero-title-group, .hero-desc, .badge {
    text-align: center; 
    margin-left: auto; 
    margin-right: auto; 
    max-width: 60vw;
  }

  .hero-title-group { 
    font-size: 2em; 
    margin-bottom: 0.3em; 
  }

  .hero-desc { 
    font-size: 1.2em; 
    margin-bottom: 1em; 
  }

  .badge { 
    font-size: 1.15em; 
    padding: 6px 20px; 
    margin-bottom: 12px; 
  }

  #welcome-form {
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    outline: none;
  }

  #welcome-form label[for="username"] {
    font-size: 1.15em; 
    text-align: center; 
    margin-left: auto; 
    margin-right: auto;
    width: 90vw; 
    max-width: 320px; 
    display: block;
  }

  #welcome-form input {
    width: 90vw; 
    max-width: 320px; 
    margin-left: auto; 
    margin-right: auto;
    padding-left: 1rem; 
    font-size: 1.2em; 
    min-height: 52px; 
    padding: 18px 0;
    border-radius: 12px; 
    padding-left: 1rem;
    text-align: center; 
  }

  #welcome-form button {
    padding: 14px 14px;
    max-width: fit-content; 
    align-self: center;
  }

  .error-message {
    width: 90vw; 
    max-width: 320px; 
    margin-left: auto; 
    margin-right: auto;
    box-sizing: border-box; 
    font-size: 0.9em; 
    padding: 6px 0 6px 12px;
    margin-top: 2px; 
    margin-bottom: 3px;
  }

  .choice { 
    font-size: var(--font-size-choice);
    min-height: 48px; 
    padding: 10px 0;
    margin: 0px 0;
    font-size: var(--font-size-choice);
  }

  .stats-row {
    flex-direction: row; 
    gap: 18px; 
    padding: 20px 10px; 
    max-width: 700px;
    margin: 24px auto 0 auto; 
    width: auto;
  }
  
  .stat-num { 
    font-size: 1.4em; 
  }

  .stat-label { 
    font-size: 1.1em; 
  }

  #timer { 
    font-size: 1.2em; 
  }

  #startBtn {
    padding: 0 1rem;
    max-width: fit-content;
    text-align: center;
  }

  #nextBtn { 
    font-size: var(--font-size-choice); 
    min-height: 52px; 
    padding: 16px 16px; 
    max-width: fit-content;
   }

  #progress-bar { 
    max-width: 340px; 
    height: 28px; 
    margin: 0 0 20px 0;
  }

  .congrats-message { 
    max-width: 75vw; 
   }

  .close-x {
    top: 14px; 
    right: 14px; 
    width: 40px;
    height: 40px;
  }

  .close-x__icon { 
    width: 20px;
    height: 20px; 
  }

}

@media (min-width: 1201px) {
   :root {
    --font-size-base: 16px;
    --font-size-lg: 1.6em;
    --font-size-xl: 2em;
    --font-size-h1: 1.7em;
    --font-size-h2: 1.6em;
    --font-size-h3: 1.5em;
    --font-size-h4: 1.3em;
    --font-size-choice: 1.2em;
    --font-size-feedback: 1.4em;
    --font-size-congrats: 1.5em;
  }

  body { 
    padding: 10px; 
  }

  h2 { 
    margin: 1rem 0 0 0; 
  }

  header {
    width: 100%;
  }

  header.welcome-header {
    width: 450px;
  }

  header.quiz-game {
    width: 100%;
  }

  .container {
    max-width: 90vw;
    min-height: fit-content; 
    margin: 12px auto 0 auto; 
    background: var(--gradient-bg);
    padding: 30px 24px;
    border-radius: var(--radius-strong); 
    box-shadow: var(--shadow-small);
    position: relative; 
    overflow: hidden;
  }

  button { 
    padding: 18px 36px; 
    margin-top: 20px; 
    font-size: 1.35em; 
    width: auto;
    min-height: auto; 
  }

  #result-label {
    color: var(--color-base-light);
    font-size: var(--font-size-h1);
  }

  #choices { 
    gap: 0; 
  }

  .choice { 
    font-size: 1.1em; 
    min-height: auto; 
    padding: 10px 0;
    margin: 8px 0;
    font-size: var(--font-size-choice);
  }

  #feedback { 
    font-size: var(--font-size-feedback); 
    padding: 10px 18px; 
  }

  #progress-bar { 
    max-width: 340px; 
    height: 28px; 
    margin-bottom: 20px;
  }

  #progress-bar-label { 
    font-size: 1em; 
  }

  #welcome-form { 
    max-width: none; 
    overflow-wrap: break-word; 
    outline: none;
  }

  #welcome-form input {
    width: 450px; 
    max-width: 100%; 
    box-sizing: border-box;
    padding: 14px 18px; 
    font-size: 1.15em; 
    min-height: auto; 
    margin-bottom: 0;
  }

  #welcome-form input::placeholder { 
    font-size: 1.3em; 
  }

  #welcome-form button {
    width: auto; 
    max-width: none; 
    box-sizing: border-box;
    font-size: 1.35em; 
    min-height: auto; 
    padding: 18px 36px;
    border-radius: 4px; 
    margin-top: 8px; 
    padding-left: 1rem;
  }

  .hero-grid {
    display: flex; 
    flex-direction: row; 
    align-items: center;
    justify-content: space-around; 
    gap: 4px; 
    min-height: 340px; 
    margin-bottom: 32px;
    width: 100%; 
    max-width: none; 
    align-items: stretch;
  }

  .hero-left {
    flex: 1 1 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    gap: 18px; 
    padding: 0 10px; 
    order: 0; 
    width: auto; 
    max-width: none;
  }

  .hero-right {
    flex: 1 1 0; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    padding: 0 10px; 
    order: 0; 
    width: auto; 
    max-width: none;
  }

  .hero-title-group { 
    max-width: none; 
    font-size: 2em; 
    margin-bottom: 0.5rem; 
    overflow-wrap: break-word; 
  }

  .hero-title-group .hero-title-main,
  .hero-title-group .hero-title-accent { 
    font-size: 2em; 
  }

  .hero-desc { 
    max-width: 450px; 
    font-size: 1.15em; 
    margin-bottom: 8px; 
    margin-top: 0; 
    overflow-wrap: break-word; 
  }

  .badge-container {
    min-width: 450px;
  }
  
  .badge { 
    font-size: 1em; 
    padding: 4px 16px; 
    margin-bottom: 8px; 
  }

  .hero-img-wrapper {
    position: relative; 
    display: inline-block; 
    border-radius: var(--radius-strong);
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    animation: hero-float 4s ease-in-out infinite;
    transition: transform 0.5s cubic-bezier(.22,1,.36,1),
                box-shadow 0.4s cubic-bezier(.22,1,.36,1);
    will-change: transform, box-shadow; z-index: 1; overflow: hidden;
    width: auto; 
    max-width: none; 
    margin: 0; 
    padding: 0; 
    border-radius: var(--radius-strong);
  }

  .hero-img {
    width: var(--hero-img-desktop-width);
    max-width: 100%;
    border-radius: var(--radius-strong);
    display: block;
    margin: 0;
  }

  #question { 
    font-size: var(--font-size-h4);
  }

  .stats-row {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background: rgba(255,255,255,0.7); 
    border-radius: 12px;
    margin: 24px auto 0 auto;
    padding: 24px 12px; 
    max-width: 900px; 
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
    gap: 8px;
    width: auto; 
    max-width: 900px; 
    padding: 24px 12px;
    gap: 8px; 
    margin: 24px auto 0 auto;
  }

  #quiz-label {
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-h2);
  }

  #progress-container {
    width: 100%;
    margin: 0;
  }

  #progress {
    font-size: var(--font-size-h3);
  }

  .stat { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    min-width: 90px; 
  }

  .stat-num { 
    font-size: 1.5em; 
  }
  .stat-label { 
    font-size: 1em; 
  }

  .error-message {
    width: 450px; 
    max-width: 100%; 
    box-sizing: border-box; 
    font-size: 0.9em;
    padding: 6px 0 6px 12px; 
    margin-top: 2px; 
    margin-bottom: 4px; 
    margin-left: 0; 
    margin-right: 0;
  }

  .close-x { 
    top: 16px; 
    right: 16px; 
    width: 48px;
    height: 48px;
  }

  .close-x__icon { 
    width: 28px;
    height: 28px; 
    }

  .congrats-message { 
    max-width: 75vw;
   }

  #result-screen.screen {
    align-items: flex-start;
  }

}