/* ==============================================================================
   SmartMCQ.org — Material Design 3 (Material You) Light Mode Stylesheet
   Clean Shapes, Tonal Surfaces, Tactile Interactivity & Zero-Scroll Mobile
   ============================================================================== */

:root {
  color-scheme: light;
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-container: #EEF2FA;
  --surface-container-high: #E4EAF6;
  --border: #DCE2EE;
  --border-strong: #C5CFE2;

  --text: #1A1C1E;
  --text-secondary: #44474E;
  --text-muted: #74777F;

  --primary: #3B5BDB;
  --primary-hover: #2B4BC8;
  --primary-container: #DBE4FF;
  --on-primary-container: #1E3A8A;

  --success: #2B8A3E;
  --warning: #D97706;
  --error: #C92A2A;

  /* Adaptive SVG variables for psychometry & matrices */
  --svg-bg: #F8FAFC;
  --svg-card: #FFFFFF;
  --svg-border: #CBD5E1;
  --svg-text: #1E293B;
  --svg-muted: #64748B;
  --svg-accent-bg: #EFF6FF;
  --svg-primary: #3B5BDB;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 20px rgba(26, 28, 30, 0.05), 0 1px 3px rgba(26, 28, 30, 0.03);
  --shadow-elevated: none;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0F19;
  --surface: #131B2E;
  --surface-container: #1C263E;
  --surface-container-high: #263352;
  --border: #2A3756;
  --border-strong: #3B4C73;

  --text: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --primary: #5C7CFA;
  --primary-hover: #748FFC;
  --primary-container: #1E2E5C;
  --on-primary-container: #DBE4FF;

  --svg-bg: #162035;
  --svg-card: #1E2B45;
  --svg-border: #3B4C73;
  --svg-text: #F1F5F9;
  --svg-muted: #94A3B8;
  --svg-accent-bg: #1E2E5C;
  --svg-primary: #748FFC;

  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.42), 0 1px 3px rgba(0, 0, 0, 0.28);
  --shadow-elevated: none;
}

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

html, body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.viewport-lock {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.site-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

body.viewport-lock .site-wrapper {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.main-container {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(6px, 1.4dvh, 18px) clamp(10px, 2vw, 24px);
  width: 100%;
  max-width: min(1080px, 96vw);
  margin: 0 auto;
}

body.viewport-lock .main-container {
  overflow: hidden;
}

body.viewport-lock #app-view {
  height: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.viewport-lock .site-footer {
  padding: clamp(5px, 0.9dvh, 10px) 12px;
  flex-shrink: 0;
}

/* ==============================================================================
   HEADER & SEGMENTED LANGUAGE SWITCHER
   ============================================================================== */
.site-header {
  background: rgba(244, 246, 251, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
  transition: background-color 0.2s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(11, 15, 25, 0.88);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-inner {
  max-width: min(1080px, 96vw);
  margin: 0 auto;
  padding: clamp(8px, 1.3dvh, 14px) clamp(12px, 2vw, 24px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-badge {
  background: var(--primary-container);
  color: var(--on-primary-container);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.brand-name {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lang-toggle-btn {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.lang-toggle-btn:hover {
  background: var(--surface-container-high);
}

.lang-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

#theme-toggle-btn .lang-pill {
  padding: 5px 10px;
}

.lang-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: none;
}

/* Language Dropdown Selector (7 Languages with Flags) */
.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-dropdown-btn {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  outline: none;
}

.lang-dropdown-btn:hover,
.lang-dropdown-btn:focus-visible {
  background: var(--surface-container-high);
  border-color: var(--primary);
}

.lang-current-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-current-name {
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

.lang-caret {
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}

.lang-dropdown.open .lang-caret {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 154px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  z-index: 1000;
  padding: 6px;
  overflow: hidden;
  animation: dropDownFade 0.18s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes dropDownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-dropdown.open .lang-dropdown-menu {
  display: block;
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: var(--surface-container-high);
  color: var(--primary);
  outline: none;
}

.lang-option.active {
  background: var(--primary-container, #DBE4FF);
  color: var(--primary, #3B5BDB);
  font-weight: 700;
}

.lang-option-flag {
  font-size: 1.05rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .lang-dropdown-btn {
    padding: 5px 8px;
    gap: 4px;
  }
  .lang-current-name {
    display: none;
  }
}

/* ==============================================================================
   VIEW 1: MINIMALIST MATERIAL 3 LANDING CARD
   ============================================================================== */
.landing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(14px, 2.5dvh, 32px) clamp(16px, 3vw, 40px);
  width: 100%;
  max-width: clamp(640px, 72vw, 880px);
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: fadeUp 0.28s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-title {
  font-size: clamp(1.65rem, 3.1dvh, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: clamp(2px, 0.5dvh, 6px);
  letter-spacing: -0.03em;
  color: var(--text);
}

.landing-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.86rem, 1.4dvh, 1.1rem);
  margin-bottom: clamp(8px, 1.7dvh, 18px);
  font-weight: 500;
}

/* ==============================================================================
   COMPACT AI CHALLENGE STRIP (Zero Scroll, Big Fonts & Official Logos)
   ============================================================================== */
.llm-compact-box {
  background: var(--surface-container);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(8px, 1.4dvh, 16px) clamp(10px, 1.8vw, 20px);
  margin-bottom: clamp(8px, 1.7dvh, 18px);
  text-align: left;
  box-shadow: 0 1px 4px rgba(26, 28, 30, 0.04);
  position: relative;
  overflow: hidden;
}

.llm-compact-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #CC6B49, #10A37F, #18181B, #2563EB, #3B5BDB);
}

.llm-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(6px, 1dvh, 10px);
  padding: 0 2px;
}

.llm-compact-title {
  font-size: clamp(0.84rem, 1.35dvh, 1.02rem);
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

.llm-compact-sub {
  font-size: clamp(0.74rem, 1.1dvh, 0.88rem);
  font-weight: 700;
  color: var(--text-muted);
}

.llm-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(6px, 1vw, 12px);
}

.llm-mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(7px, 1.2dvh, 14px) 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.llm-mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.llm-mini-icon {
  width: clamp(24px, 3dvh, 34px);
  height: clamp(24px, 3dvh, 34px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.llm-mini-icon svg {
  width: clamp(20px, 2.6dvh, 28px);
  height: clamp(20px, 2.6dvh, 28px);
  display: block;
}

.llm-mini-name {
  font-size: clamp(0.78rem, 1.25dvh, 0.95rem);
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.llm-mini-score {
  font-size: clamp(1.22rem, 2.2dvh, 1.7rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* User Card Highlight */
.llm-mini-card.card-user {
  background: var(--primary-container);
  border: 1.5px dashed var(--primary);
}

.llm-mini-card.card-user .llm-mini-name {
  color: var(--primary);
}

.llm-mini-card.card-user .llm-mini-score {
  color: var(--primary);
  font-size: clamp(1.3rem, 2.35dvh, 1.82rem);
  animation: pulseQuestion 1.8s infinite ease-in-out;
}

@keyframes pulseQuestion {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@media (max-width: 480px) {
  .llm-compact-box {
    padding: 8px 8px 10px;
    margin-bottom: 12px;
  }
  .llm-cards-grid {
    gap: 4px;
  }
  .llm-mini-card {
    padding: 6px 2px 5px;
    border-radius: 9px;
  }
  .llm-mini-icon {
    width: 22px;
    height: 22px;
  }
  .llm-mini-icon svg {
    width: 19px;
    height: 19px;
  }
  .llm-mini-name {
    font-size: 0.72rem;
  }
  .llm-mini-score {
    font-size: 1.18rem;
  }
  .llm-mini-card.card-user .llm-mini-score {
    font-size: 1.25rem;
  }
}

/* Results View AI Comparison Callout */
.results-llm-comparison {
  margin: 16px 0 20px;
  padding: 12px 16px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  animation: fadeUp 0.3s ease;
}

.results-llm-comparison.beat-all {
  background: #FEF3C7;
  border: 1.5px solid #F59E0B;
  color: #92400E;
}

[data-theme="dark"] .results-llm-comparison.beat-all {
  background: rgba(245, 158, 11, 0.14);
  border-color: #F59E0B;
  color: #FDE68A;
}

.results-llm-comparison.beat-grok {
  background: #ECFDF5;
  border: 1.5px solid #10B981;
  color: #065F46;
}

[data-theme="dark"] .results-llm-comparison.beat-grok {
  background: rgba(16, 185, 129, 0.14);
  border-color: #10B981;
  color: #A7F3D0;
}

.results-llm-comparison.beat-gemini {
  background: #EFF6FF;
  border: 1.5px solid #3B82F6;
  color: #1E40AF;
}

[data-theme="dark"] .results-llm-comparison.beat-gemini {
  background: rgba(59, 130, 246, 0.16);
  border-color: #3B82F6;
  color: #BFDBFE;
}

.results-llm-comparison.beat-standard {
  background: var(--surface-container);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.results-llm-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results-llm-text {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Material 3 Interactive Age Slider Card */
.slider-calibration-box {
  background: var(--surface-container);
  border-radius: var(--radius-lg);
  padding: clamp(9px, 1.5dvh, 18px) clamp(12px, 2vw, 22px);
  margin-bottom: clamp(8px, 1.7dvh, 18px);
  text-align: left;
  transition: background-color 0.2s;
}

.slider-calibration-box:hover {
  background: var(--surface-container-high);
}

.slider-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(6px, 1dvh, 10px);
}

.slider-title {
  font-size: clamp(0.9rem, 1.4dvh, 1.08rem);
  font-weight: 700;
  color: var(--text-secondary);
}

.slider-value-readout {
  background: var(--primary-container);
  color: var(--on-primary-container);
  padding: 4px 15px;
  border-radius: var(--radius-full);
  font-size: clamp(1rem, 1.55dvh, 1.24rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s ease;
}

.slider-value-readout.pulse {
  transform: scale(1.07);
}

.age-group-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(6px, 1vw, 12px);
  margin-top: 4px;
}

.age-group-btn {
  appearance: none;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: clamp(0.88rem, 1.35dvh, 1.04rem);
  font-weight: 700;
  padding: clamp(8px, 1.35dvh, 14px) 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.16s cubic-bezier(0.2, 0, 0, 1);
  line-height: 1.2;
}

.age-group-btn:hover {
  border-color: var(--primary);
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.age-group-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(59, 91, 219, 0.28);
}

@media (max-width: 480px) {
  .age-group-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) and (max-height: 730px) {
  .age-group-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }
  .age-group-btn {
    padding: 9px 3px;
    font-size: 0.78rem;
  }
}

.range-wrap {
  position: relative;
  padding: 6px 0 2px;
}

.age-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  background: #D0D9EC;
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  touch-action: pan-y;
}

.age-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(59, 91, 219, 0.35);
  cursor: grab;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.15s ease;
}

.age-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.age-range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.18);
  box-shadow: 0 0 0 8px rgba(59, 91, 219, 0.16);
}

.age-range-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(59, 91, 219, 0.35);
  cursor: grab;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.15s ease;
}

.age-range-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.18);
  box-shadow: 0 0 0 8px rgba(59, 91, 219, 0.16);
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.landing-cta-btn {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  width: 100%;
  padding: clamp(12px, 1.9dvh, 19px) 28px;
  border-radius: var(--radius-full);
  font-size: clamp(1rem, 1.55dvh, 1.22rem);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: var(--shadow-elevated);
}

.landing-cta-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.landing-cta-btn:active {
  transform: scale(0.985);
}

/* ==============================================================================
   VIEW 2: TEST RUNNER (MATERIAL 3 CARD — CRYPTIC SCORING)
   ============================================================================== */
.runner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(12px, 2dvh, 26px) clamp(14px, 2.6vw, 32px);
  width: 100%;
  max-width: clamp(720px, 78vw, 980px);
  height: min(100%, 840px);
  max-height: 100%;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: fadeUp 0.22s cubic-bezier(0.2, 0, 0, 1);
}

.runner-header-row,
.q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.runner-q-indicator {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.runner-q-num {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.runner-q-cat,
.q-category-line {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.step-indicator-dots,
.step-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: nowrap;
}

.step-badge {
  background: var(--primary-container);
  color: var(--on-primary-container);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.82rem;
}

.timer-pill {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  background: var(--surface-container);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

/* Subtle dual progress & pace bar (no text explaining points/grace) */
.pace-bar-track {
  width: 100%;
  height: 6px;
  background: var(--surface-container);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 14px;
}

.pace-bar-fill {
  height: 100%;
  background: var(--primary);
  width: 100%;
  transition: width 0.08s linear, background-color 0.3s ease;
}

.pace-bar-fill.secondary-phase {
  background: #94A3B8;
}

/* Enlarged unified Stimulus Box: Visual on top (enlarged) + Question text at the bottom */
.stimulus-card,
.stimulus-box {
  background: var(--surface-container);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(10px, 1.8dvh, 22px) clamp(12px, 2.4vw, 28px) clamp(10px, 1.6dvh, 18px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-bottom: clamp(8px, 1.5dvh, 16px);
  overflow: hidden;
}

.stimulus-visual-area {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 4px 0;
}

.stimulus-visual-area svg,
.stimulus-box svg {
  width: 100%;
  height: 100%;
  max-width: min(100%, 760px);
  max-height: 100%;
  display: block;
}

.question-title-line,
.q-title {
  width: 100%;
  margin: clamp(6px, 1.1dvh, 14px) 0 0 0;
  padding-top: clamp(7px, 1.2dvh, 14px);
  border-top: 1.5px solid var(--border);
  font-size: clamp(0.96rem, 1.7dvh, 1.3rem);
  font-weight: 700;
  line-height: 1.34;
  color: var(--text);
  text-align: center;
  flex-shrink: 0;
}

/* Text-only stimulus mode: no visual needed -> large centered question sentence in the middle of the box */
.stimulus-card.text-only {
  justify-content: center;
  align-items: center;
  padding: clamp(18px, 3.2dvh, 36px) clamp(18px, 3.5vw, 40px);
}

.stimulus-card.text-only .stimulus-visual-area {
  display: none !important;
}

.stimulus-card.text-only .question-title-line {
  border-top: none;
  margin: 0;
  padding: 0;
  font-size: clamp(1.2rem, 2.5dvh, 1.85rem);
  font-weight: 800;
  line-height: 1.38;
  max-width: 720px;
}

.stimulus-visual-area.is-memory {
  flex-direction: column;
  gap: 10px;
}

.stimulus-visual-area.is-memory svg {
  flex: 1 1 auto;
  min-height: 0;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100% - 18px);
}

/* Clickable visual elements inside SVG stimulus (triangles, figures, cube faces) */
.stimulus-visual-area svg.has-pickable-items .vis-pickable {
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
}

.vis-pickable .vis-hit-rect {
  pointer-events: all;
  transition: fill 0.14s ease, stroke 0.14s ease;
}

.vis-pickable:hover .vis-hit-rect,
.vis-pickable:focus-visible .vis-hit-rect {
  fill: rgba(59, 91, 219, 0.08);
  stroke: var(--svg-primary, #3B5BDB);
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

.vis-pickable.is-selected .vis-hit-rect {
  fill: rgba(59, 91, 219, 0.15);
  stroke: var(--svg-primary, #3B5BDB);
  stroke-width: 2;
  stroke-dasharray: none;
}

.vis-pickable .vis-net-face {
  pointer-events: all;
  transition: fill 0.14s ease, stroke 0.14s ease, stroke-width 0.14s ease;
}

.vis-pickable:hover .vis-net-face,
.vis-pickable:focus-visible .vis-net-face {
  fill: var(--svg-accent-bg, #DBE4FF);
  stroke-width: 2.2;
}

.vis-pickable.is-selected .vis-net-face {
  fill: var(--primary-container, #DBE4FF);
  stroke: var(--svg-primary, #3B5BDB);
  stroke-width: 2.6;
}

.memo-digits {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.memo-hint {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 500;
}

.memo-timer-track {
  width: min(240px, 78%);
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.memo-timer-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #3B82F6 100%);
  border-radius: var(--radius-full);
  transform-origin: left center;
  will-change: transform;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(8px, 1.3dvh, 14px);
  margin-bottom: clamp(8px, 1.4dvh, 16px);
  flex-shrink: 0;
}

.opt-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(9px, 1.3dvh, 14px) 16px clamp(9px, 1.3dvh, 14px) 36px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.92rem, 1.5dvh, 1.15rem);
  font-weight: 600;
  line-height: 1.3;
  min-height: clamp(54px, 7.8dvh, 84px);
  text-align: center;
  transition: all 0.16s cubic-bezier(0.2, 0, 0, 1);
  user-select: none;
  position: relative;
}

.opt-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.opt-text svg {
  height: clamp(56px, 8.5dvh, 92px);
  max-height: 96px;
  width: auto;
  max-width: 100%;
  display: block;
}

.opt-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-container);
  transform: translateY(-1px);
}

.opt-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.opt-btn.selected {
  border-color: var(--primary);
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 700;
  box-shadow: none;
}

.opt-key-badge,
.opt-key-tag {
  position: absolute;
  top: 8px;
  left: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-container);
  padding: 1px 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.opt-btn.selected .opt-key-badge,
.opt-btn.selected .opt-key-tag {
  background: var(--primary);
  color: #FFFFFF;
}

.opt-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.runner-footer-actions,
.runner-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 4px;
}

.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: all 0.2s;
}

.step-dot.done {
  background: var(--primary);
}

.step-dot.current {
  width: 18px;
  border-radius: 4px;
  background: var(--primary);
}

.ok-btn {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  padding: clamp(11px, 1.6dvh, 15px) clamp(28px, 3vw, 46px);
  font-size: clamp(0.96rem, 1.5dvh, 1.1rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: var(--shadow-elevated);
}

.ok-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.ok-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.ok-btn:disabled {
  background: var(--surface-container-high);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* ==============================================================================
   VIEW 3: RESULTS CARD (MATERIAL 3 LIGHT)
   ============================================================================== */
.results-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(22px, 3vw, 38px) clamp(20px, 3vw, 36px);
  width: 100%;
  max-width: clamp(760px, 82vw, 1020px);
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.28s cubic-bezier(0.2, 0, 0, 1);
}

.results-hero-banner {
  background: var(--surface-container);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  text-align: center;
  margin-bottom: 24px;
}

.iq-title-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.iq-number-display {
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin: 6px 0 12px;
  letter-spacing: -0.04em;
}

.iq-classification-pill {
  display: inline-block;
  background: var(--primary-container);
  color: var(--on-primary-container);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.results-age-rank-pill {
  background: var(--surface);
  border: 1.5px solid var(--primary);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 auto 14px;
  max-width: 540px;
  box-shadow: 0 2px 10px rgba(59, 91, 219, 0.08);
}

.results-age-rank-pill strong {
  color: var(--primary);
  font-size: 1.14rem;
  font-weight: 900;
}

.results-summary-stats {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.results-summary-stats strong {
  color: var(--text);
}

.indices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.index-box {
  background: var(--surface-container);
  padding: 16px 18px;
  border-radius: var(--radius-md);
}

.index-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.index-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}

.index-score {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.index-progress-track {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.index-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* ==============================================================================
   Cognitive Restitution & 4D Psychometric Radar
   ============================================================================== */
.cognitive-restitution-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.restitution-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.restitution-header-text {
  flex: 1;
  min-width: 240px;
}

.restitution-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
}

.restitution-subtitle {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

.restitution-tab-bar {
  display: inline-flex;
  background: var(--surface-container);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  gap: 4px;
}

.restitution-tab-btn {
  background: transparent;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.restitution-tab-btn:hover {
  color: var(--text);
  background: var(--surface-container-high);
}

.restitution-tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  font-weight: 800;
}

.restitution-view-pane {
  animation: fadeInPane 0.25s ease-out;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.radar-svg-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.radar-svg-container svg {
  width: 100%;
  height: auto;
  max-height: 360px;
  overflow: visible;
}

.radar-label-group {
  cursor: default;
  pointer-events: none;
}

.radar-marker-dot {
  cursor: default;
  pointer-events: none;
}

.radar-legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.radar-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.radar-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.radar-legend-dot.dot-user {
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--primary);
}

.radar-legend-dot.dot-ref {
  background: var(--surface-container-high);
  border: 2px dashed var(--text-muted);
}

.pedagogical-guide-section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.pedagogical-guide-header {
  margin-bottom: 16px;
}

.pedagogical-guide-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
}

.pedagogical-guide-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
}

.pedagogical-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.ped-card {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ped-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.ped-card.active-highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-container), var(--shadow-card);
  transform: translateY(-2px);
}

.ped-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.ped-card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ped-card-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ped-card-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.ped-card-code-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 7px;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.ped-card-sub-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ped-card-score-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}

.ped-card-score-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.ped-card-domain {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.ped-card-badge-row {
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.ped-card-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.ped-card-badge.lvl-elite {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.ped-card-badge.lvl-high {
  background: rgba(43, 138, 62, 0.14);
  color: var(--success);
}

.ped-card-badge.lvl-average {
  background: var(--surface-container-high);
  color: var(--text-secondary);
}

.ped-card-badge.lvl-progress {
  background: rgba(217, 119, 6, 0.14);
  color: var(--warning);
}

.ped-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.ped-card-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ped-card-label {
  font-weight: 700;
  color: var(--text);
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ped-card-text {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.ped-card-verdict {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ped-card-verdict.lvl-elite {
  border-color: rgba(59, 91, 219, 0.35);
  background: rgba(59, 91, 219, 0.05);
}

.ped-card-verdict.lvl-high {
  border-color: rgba(43, 138, 62, 0.35);
  background: rgba(43, 138, 62, 0.05);
}

.ped-card-verdict.lvl-average {
  border-color: var(--border-strong);
  background: var(--surface);
}

.ped-card-verdict.lvl-progress {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.05);
}

.ped-verdict-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text);
}

.ped-verdict-text {
  font-size: 0.81rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.share-section {
  background: var(--surface-container);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.share-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.share-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-action-btn {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 15px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.share-action-btn:hover {
  background: var(--primary-container);
  border-color: var(--primary);
  color: var(--on-primary-container);
}

.share-action-btn.btn-wa:hover {
  background: #DCFCE7;
  border-color: #16A34A;
  color: #166534;
}

[data-theme="dark"] .share-action-btn.btn-wa:hover {
  background: rgba(22, 163, 74, 0.22);
  border-color: #22C55E;
  color: #86EFAC;
}

.share-action-btn.btn-li:hover {
  background: #DBEAFE;
  border-color: #0A66C2;
  color: #0A66C2;
}

[data-theme="dark"] .share-action-btn.btn-li:hover {
  background: rgba(10, 102, 194, 0.24);
  border-color: #60A5FA;
  color: #93C5FD;
}

.share-action-btn.btn-x:hover {
  background: #E2E8F0;
  border-color: #0F172A;
  color: #0F172A;
}

[data-theme="dark"] .share-action-btn.btn-x:hover {
  background: rgba(248, 250, 252, 0.16);
  border-color: #CBD5E1;
  color: #F8FAFC;
}

.share-action-btn.btn-ig:hover {
  background: #FCE7F3;
  border-color: #DB2777;
  color: #9D174D;
}

[data-theme="dark"] .share-action-btn.btn-ig:hover {
  background: rgba(219, 39, 119, 0.22);
  border-color: #F472B6;
  color: #FBCFE8;
}

.share-feedback-toast {
  display: none;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(59, 91, 219, 0.12);
  border: 1px solid var(--primary);
  color: var(--text);
  text-align: center;
}

.share-feedback-toast.visible {
  display: block;
}

.certificate-monetization-box {
  background: var(--primary-container);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cert-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--on-primary-container);
  margin-bottom: 2px;
}

.cert-header p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.cert-checkout-btn {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.cert-checkout-btn:hover {
  background: var(--primary-hover);
}

.results-bottom-actions {
  display: flex;
  justify-content: center;
}

.restart-btn {
  background: var(--surface-container);
  border: none;
  color: var(--text-secondary);
  padding: 11px 26px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.restart-btn:hover {
  background: var(--surface-container-high);
  color: var(--text);
}

/* ==============================================================================
   FOOTER & MODALS
   ============================================================================== */
.site-footer {
  padding: 20px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.footer-links button,
.footer-links a {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links button:hover,
.footer-links a:hover {
  color: var(--primary);
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 28, 30, 0.45);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(26, 28, 30, 0.18);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.modal-close-btn {
  background: var(--surface-container);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-body h4 {
  color: var(--text);
  font-size: 0.94rem;
  margin: 14px 0 4px 0;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.checkout-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.checkout-price-card {
  background: var(--surface-container);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-price-amount {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
}

.checkout-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.checkout-checkbox-wrap input {
  margin-top: 3px;
}

@media (max-width: 768px) {
  .main-container {
    padding: 6px 8px;
  }
  .runner-card, .results-card, .checkout-view-card {
    padding: 14px 16px;
  }
  .runner-card {
    height: 100%;
    max-width: 100%;
  }
}

@media (max-width: 620px) {
  .main-container {
    padding: 4px 6px;
  }
  .indices-grid,
  .pedagogical-guide-grid,
  .report-table-grid {
    grid-template-columns: 1fr;
  }
  .cognitive-restitution-card {
    padding: 18px 14px;
  }
  .options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
  }
  .opt-btn {
    padding: 10px 10px;
    min-height: clamp(54px, 7.6dvh, 68px);
    font-size: clamp(0.92rem, 3.6vw, 1.04rem);
  }
  .opt-text svg {
    height: clamp(54px, 7.4dvh, 72px);
    max-height: 76px;
  }
  .opt-key-badge, .opt-key-tag {
    top: 5px;
    left: 6px;
    font-size: 0.65rem;
    padding: 1px 5px;
  }
  .landing-card, .runner-card, .results-card, .checkout-view-card {
    padding: clamp(11px, 1.8dvh, 18px) 12px;
    border-radius: 20px;
    max-width: 100%;
  }
  .landing-title {
    font-size: clamp(1.55rem, 5vw, 1.85rem);
  }
  .landing-subtitle {
    font-size: clamp(0.86rem, 2.6vw, 0.96rem);
    margin-bottom: clamp(8px, 1.4dvh, 14px);
  }
  .llm-compact-box {
    padding: clamp(7px, 1.2dvh, 11px) 8px;
    margin-bottom: clamp(8px, 1.4dvh, 14px);
  }
  .slider-calibration-box {
    padding: clamp(8px, 1.3dvh, 13px) 10px;
    margin-bottom: clamp(8px, 1.4dvh, 14px);
  }
  .test-modes-wrap {
    margin-bottom: clamp(8px, 1.4dvh, 14px);
  }
  .stimulus-card, .stimulus-box {
    padding: 10px 10px 9px;
    min-height: 0;
    max-height: none;
    margin-bottom: 8px;
  }
  .stimulus-visual-area {
    min-height: 0;
  }
  .stimulus-visual-area svg, .stimulus-box svg {
    max-width: 100%;
    max-height: 100%;
  }
  .question-title-line, .q-title {
    font-size: clamp(0.96rem, 3.8vw, 1.12rem);
    line-height: 1.3;
    margin-top: 8px;
    padding-top: 9px;
  }
  .stimulus-card.text-only {
    padding: 18px 14px;
  }
  .stimulus-card.text-only .question-title-line {
    font-size: clamp(1.22rem, 4.8vw, 1.45rem);
    line-height: 1.34;
  }
  .iq-number-display {
    font-size: 3.5rem;
  }
  .ok-btn {
    width: 100%;
    padding: 13px 22px;
    font-size: 1.02rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .opt-key-badge, .opt-key-tag {
    display: none;
  }
  .opt-btn {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 420px) {
  .nav-inner {
    padding: 8px 10px;
  }
  .brand-name {
    font-size: 0.98rem;
  }
  .logo-badge {
    width: 30px;
    height: 30px;
    font-size: 0.84rem;
  }
  .header-actions {
    gap: 5px;
  }
  .lang-pill {
    padding: 4px 9px;
    font-size: 0.74rem;
  }
  #theme-toggle-btn .lang-pill {
    padding: 4px 8px;
  }
}

/* Compact-height safety net (short phones / landscape): preserve zero scroll without shrinking laptops */
@media (max-height: 660px) {
  .nav-inner {
    padding: 6px 12px;
  }
  body.viewport-lock .site-footer {
    padding: 4px 10px;
    font-size: 0.72rem;
  }
  .footer-links {
    margin-bottom: 2px;
    gap: 10px;
  }
  .landing-card, .runner-card {
    padding: 10px 14px;
  }
  .runner-header-row {
    margin-bottom: 5px;
  }
  .pace-bar-track {
    margin-bottom: 8px;
  }
  .stimulus-card, .stimulus-box {
    padding: 8px 10px;
    margin-bottom: 7px;
  }
  .question-title-line, .q-title {
    font-size: 0.9rem;
    margin-top: 6px;
    padding-top: 6px;
  }
  .options-grid {
    gap: 6px;
    margin-bottom: 6px;
  }
  .opt-btn {
    min-height: 46px;
    padding: 6px 10px;
  }
  .opt-text svg {
    height: 48px;
    max-height: 52px;
  }
  .ok-btn, .landing-cta-btn {
    padding: 10px 18px;
    font-size: 0.94rem;
  }
  .llm-compact-box {
    padding: 6px 8px 7px;
    margin-bottom: 6px;
  }
  .slider-calibration-box {
    padding: 7px 10px 8px;
    margin-bottom: 6px;
  }
  .test-modes-wrap {
    margin-bottom: 7px;
  }
}

/* ==============================================================================
   BLURRED LEGAL IDENTITY & UNLOCK POPUP
   ============================================================================== */
.blurred-identity {
  filter: blur(5px);
  -webkit-filter: blur(5px);
  user-select: none;
  -webkit-user-select: none;
  background: var(--surface-container-high);
  color: transparent !important;
  text-shadow: 0 0 8px rgba(33, 37, 41, 0.7);
  border-radius: 4px;
  padding: 0 4px;
  cursor: pointer;
  display: inline-block;
  transition: filter 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.blurred-identity:hover {
  background: #E5E7EB;
}

body.identity-unlocked .blurred-identity {
  filter: none !important;
  -webkit-filter: none !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  background: transparent !important;
  color: inherit !important;
  text-shadow: none !important;
  cursor: text !important;
}

.blur-banner-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-container);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.blur-unlock-trigger-btn {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.blur-unlock-trigger-btn:hover {
  background: var(--primary-hover);
}

body.identity-unlocked .blur-banner-notice {
  display: none !important;
}

/* ==============================================================================
   MODE SELECTOR ON LANDING (3 BUTTONS ON SAME LINE - NO PRICES)
   ============================================================================== */
.test-modes-wrap {
  margin-bottom: clamp(8px, 1.7dvh, 18px);
  text-align: center;
}

.modes-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1.1vw, 14px);
}

.mode-btn {
  position: relative;
  background: var(--surface-container);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: clamp(9px, 1.5dvh, 16px) 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.mode-btn:hover {
  background: var(--surface-container-high);
  transform: translateY(-1px);
}

.mode-btn.active {
  background: var(--primary-container);
  border-color: var(--primary);
  box-shadow: none;
}

.mode-btn-title {
  font-size: clamp(0.92rem, 1.5dvh, 1.16rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.mode-btn.active .mode-btn-title {
  color: var(--primary);
}

.mode-btn-count {
  font-size: clamp(0.78rem, 1.25dvh, 0.94rem);
  font-weight: 600;
  color: var(--text);
}

.mode-btn-time {
  font-size: clamp(0.72rem, 1.1dvh, 0.85rem);
  font-weight: 500;
  color: var(--text-secondary);
}

.mode-btn-tag {
  position: absolute;
  top: -8px;
  background: #2B8A3E;
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
}

@media (max-width: 480px) {
  .modes-row {
    gap: 6px;
  }
  .mode-btn {
    padding: clamp(9px, 1.5dvh, 14px) 5px;
  }
  .mode-btn-title {
    font-size: clamp(0.9rem, 3vw, 1rem);
  }
  .mode-btn-count {
    font-size: clamp(0.76rem, 2.3vw, 0.84rem);
  }
  .mode-btn-time {
    font-size: clamp(0.72rem, 2.1vw, 0.78rem);
  }
}

/* ==============================================================================
   VIEW: DEDICATED CHECKOUT / PAYWALL VIEW
   ============================================================================== */
.checkout-view-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(16px, 2.5dvh, 30px) clamp(18px, 3vw, 34px);
  width: 100%;
  max-width: clamp(640px, 68vw, 840px);
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.28s cubic-bezier(0.2, 0, 0, 1);
  text-align: left;
}

.checkout-ready-badge {
  display: inline-block;
  background: #DCFCE7;
  color: #166534;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

[data-theme="dark"] .checkout-ready-badge {
  background: rgba(34, 197, 94, 0.18);
  color: #4ADE80;
}

.checkout-title {
  font-size: clamp(1.38rem, 2.3dvh, 1.85rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.checkout-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.86rem, 1.3dvh, 1rem);
  margin-bottom: clamp(10px, 1.5dvh, 16px);
}

.checkout-teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1vw, 12px);
  margin-bottom: clamp(10px, 1.5dvh, 16px);
}

.checkout-teaser-item {
  background: var(--primary-container);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: clamp(8px, 1.3dvh, 13px) 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.teaser-label {
  font-size: clamp(0.74rem, 1.1dvh, 0.84rem);
  font-weight: 700;
  color: var(--text-secondary);
}

.teaser-val {
  font-size: clamp(0.84rem, 1.3dvh, 0.98rem);
  font-weight: 800;
  color: var(--primary);
}

.checkout-teaser-item.teaser-unlocked {
  background: #ECFDF5;
  border-color: #10B981;
}

.checkout-teaser-item.teaser-unlocked .teaser-val {
  color: #047857;
}

[data-theme="dark"] .checkout-teaser-item.teaser-unlocked {
  background: rgba(16, 185, 129, 0.14);
  border-color: #10B981;
}

[data-theme="dark"] .checkout-teaser-item.teaser-unlocked .teaser-val {
  color: #6EE7B7;
}

.checkout-tier-summary {
  background: var(--surface-container);
  border-radius: var(--radius-md);
  padding: clamp(12px, 1.8dvh, 18px) clamp(14px, 2vw, 22px);
  margin-bottom: clamp(10px, 1.5dvh, 16px);
  border: 1px solid var(--border);
}

.checkout-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(8px, 1.3dvh, 14px);
  padding-bottom: clamp(7px, 1.1dvh, 12px);
  border-bottom: 1px solid var(--border);
}

.checkout-tier-title {
  font-size: clamp(1rem, 1.55dvh, 1.2rem);
  font-weight: 800;
  color: var(--text);
}

.checkout-price-hero {
  font-size: clamp(1.45rem, 2.3dvh, 1.85rem);
  font-weight: 900;
  color: var(--primary);
}

.checkout-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.85dvh, 9px);
  font-size: clamp(0.84rem, 1.28dvh, 0.96rem);
  color: var(--text);
}

.checkout-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-features-list li::before {
  content: "✓";
  color: #2B8A3E;
  font-weight: 900;
}

.checkout-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.checkout-form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.checkout-form-group input {
  background: var(--surface-container);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.checkout-form-group input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.checkout-disclaimer {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

.checkout-waiver-note {
  margin-top: 4px;
  font-size: 0.67rem;
  line-height: 1.3;
}

.checkout-compact-feats {
  display: none;
}

.checkout-compact-chip {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkout-compact-chip.is-highlight {
  color: var(--primary);
  font-weight: 700;
}

.checkout-voucher-wrap {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface-container);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.checkout-main-btn {
  width: 100% !important;
  justify-content: center !important;
  font-size: 1.05rem;
  padding: 14px 18px;
}

.checkout-err-status {
  font-size: 0.8rem;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: center;
}

.checkout-pack-row {
  text-align: center;
  margin-top: 8px;
  font-size: 0.78rem;
}

.checkout-pack-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.checkout-pack-link:hover {
  text-decoration: underline;
}

/* Strict anti-deformation rules for promo/credit code input & button */
.checkout-view-card #voucher-area {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.checkout-view-card #voucher-area .voucher-label {
  display: block !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  margin: 0 0 6px 0 !important;
  line-height: 1.25 !important;
}

.checkout-view-card #voucher-area .voucher-input-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.checkout-view-card #voucher-area .voucher-input-row #voucher-code-input {
  flex: 1 1 0% !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 !important;
  padding: 8px 11px !important;
  box-sizing: border-box !important;
  background: var(--surface) !important;
  border: 1.5px solid var(--border-strong) !important;
  border-radius: 11px !important;
  color: var(--text) !important;
  outline: none !important;
  font-family: var(--font-mono) !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.checkout-view-card #voucher-area .voucher-input-row #voucher-code-input:focus {
  border-color: var(--primary) !important;
}

.checkout-view-card #voucher-area .voucher-input-row #voucher-redeem-btn {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 82px !important;
  max-width: 42% !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  border-radius: 11px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.checkout-view-card #voucher-area .voucher-stored-balance {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
}

.checkout-view-card #voucher-area .voucher-stored-btn {
  width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.9rem !important;
  border-radius: 11px !important;
}

.checkout-view-card #voucher-area .voucher-other-wrap {
  text-align: center;
  margin-top: 5px;
}

.checkout-view-card #voucher-area .voucher-other-link {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.checkout-view-card #voucher-area .voucher-msg {
  font-size: 0.76rem;
  color: #C92A2A;
  margin-top: 5px;
  text-align: center;
  line-height: 1.3;
}

.checkout-view-card #voucher-area .voucher-checking {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* Smartphone & ultra-short-height optimization: single-screen zero-scroll checkout */
@media (max-width: 620px), (max-height: 660px) {
  .checkout-view-card {
    padding: clamp(12px, 1.8dvh, 16px) 14px !important;
    border-radius: 20px !important;
  }
  .checkout-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .checkout-ready-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    margin-bottom: 0;
    order: 2;
  }
  .checkout-title {
    font-size: 1.24rem;
    line-height: 1.2;
    margin-bottom: 0;
    order: 1;
  }
  .checkout-subtitle {
    display: none;
  }
  .checkout-teaser-grid {
    gap: 6px;
    margin-bottom: 10px;
  }
  .checkout-teaser-item {
    padding: 7px 5px;
    gap: 2px;
  }
  .teaser-label {
    font-size: 0.7rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .teaser-val {
    font-size: 0.8rem;
    line-height: 1.15;
  }
  .checkout-tier-summary {
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 12px;
  }
  .checkout-tier-header {
    margin-bottom: 7px;
    padding-bottom: 6px;
  }
  .checkout-tier-title {
    font-size: 0.98rem;
  }
  .checkout-price-hero {
    font-size: 1.38rem;
  }
  .checkout-features-list {
    display: none;
  }
  .checkout-compact-feats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 8px;
  }
  .checkout-compact-chip {
    font-size: 0.78rem;
  }
  .checkout-voucher-wrap {
    padding: 9px 11px;
    margin-bottom: 10px;
    border-radius: 12px;
  }
  .checkout-view-card #voucher-area .voucher-label {
    font-size: 0.78rem !important;
    margin-bottom: 5px !important;
  }
  .checkout-view-card #voucher-area .voucher-input-row #voucher-code-input,
  .checkout-view-card #voucher-area .voucher-input-row #voucher-redeem-btn,
  .checkout-view-card #voucher-area .voucher-stored-btn {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }
  .checkout-main-btn {
    padding: 13px 16px !important;
    font-size: 1.02rem !important;
  }
  .checkout-pack-row {
    margin-top: 7px;
    font-size: 0.78rem;
  }
  .checkout-disclaimer {
    margin-top: 6px;
    font-size: 0.72rem;
    line-height: 1.25;
  }
  .checkout-waiver-note {
    margin-top: 3px;
    font-size: 0.66rem;
    line-height: 1.2;
  }
}

/* ==============================================================================
   DETAILED 1-PAGE REPORT (FOR 40-Q TIER)
   ============================================================================== */
.report-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.report-preview-box {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px 0;
}

.report-table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 0.76rem;
}

.report-subtable {
  width: 100%;
  border-collapse: collapse;
}

.report-subtable th,
.report-subtable td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.report-subtable th {
  background: var(--surface-container-high);
  font-weight: 700;
  color: var(--text);
}

.badge-corr {
  color: #2B8A3E;
  font-weight: 700;
}

.badge-incorr {
  color: #C92A2A;
  font-weight: 700;
}

@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .site-header, .app-header, .site-footer, .share-section, .landing-cta-btn, .modal-overlay, #restart-test-btn, .print-hide {
    display: none !important;
  }
  .results-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .cognitive-restitution-card {
    border: none !important;
    box-shadow: none !important;
    padding: 6px 0 !important;
    page-break-inside: avoid;
  }
  .restitution-tab-bar {
    display: none !important;
  }
  #restitution-radar-view,
  #restitution-bars-view {
    display: block !important;
  }
  .radar-svg-container {
    max-width: 360px !important;
  }
  .pedagogical-guide-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    page-break-inside: avoid;
  }
  .ped-card {
    padding: 10px !important;
    font-size: 8pt !important;
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
  }
  .report-sheet-printable {
    display: block !important;
    page-break-inside: avoid;
    font-size: 9pt;
  }
}



/* ==============================================================================
   JEU : défi du jour, série, duel, progression, correction des erreurs
   ============================================================================== */
body.viewport-lock.is-landing .main-container { overflow-y: auto; scrollbar-width: none; }
body.viewport-lock.is-landing .main-container::-webkit-scrollbar { display: none; }
body.viewport-lock.is-landing #app-view { height: auto; max-height: none; min-height: 0; margin: auto 0; }

.landing-free-note {
  margin: clamp(6px, 1.1dvh, 12px) 0 0 !important;
  font-size: clamp(0.76rem, 1.2dvh, 0.92rem) !important;
}

.game-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: clamp(7px, 1.2dvh, 14px); }
.game-daily-btn {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); color: var(--text); border: 1px dashed var(--primary); border-radius: var(--radius-full);
  padding: clamp(7px, 1.2dvh, 12px) 16px; font-size: clamp(0.82rem, 1.3dvh, 0.96rem); cursor: pointer; transition: all 0.18s;
}
.game-daily-btn:hover { background: var(--primary); color: #fff; }
.game-daily-btn span { font-size: clamp(0.74rem, 1.1dvh, 0.84rem); opacity: 0.85; }
.game-streak { flex: 0 0 auto; font-weight: 800; font-size: clamp(0.86rem, 1.3dvh, 0.98rem); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-full); padding: clamp(6px, 1.1dvh, 10px) 14px; }
.game-duel-banner { background: var(--primary); color: #fff; font-weight: 700; font-size: clamp(0.82rem, 1.3dvh, 0.95rem); line-height: 1.35; padding: clamp(8px, 1.2dvh, 12px) 14px; border-radius: 12px; margin-bottom: clamp(8px, 1.4dvh, 14px); }

.game-daily-card { max-width: clamp(560px, 68vw, 820px); margin: 0 auto; }
.game-big-score { font-size: 2.2rem; font-weight: 900; color: var(--primary); line-height: 1.15; }
.game-sub { font-size: 0.9rem; color: var(--text-secondary); margin-top: 2px; }
.game-marks { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.game-marks span { font-weight: 800; font-size: 0.82rem; padding: 5px 10px; border-radius: 8px; }
.game-marks .ok { background: #DCFCE7; color: #166534; }
.game-marks .ko { background: #FEE2E2; color: #991B1B; }
.game-chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.game-chips span { font-size: 0.82rem; font-weight: 700; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-full); padding: 5px 12px; }
.game-note { font-size: 0.8rem; line-height: 1.4; color: var(--text-secondary); margin: 8px 0; }

.game-box { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 14px 0; text-align: left; }
.game-box h4 { margin: 0 0 10px; font-size: 0.98rem; font-weight: 800; color: var(--text); }
.game-duel-result { text-align: center; font-weight: 800; font-size: 1rem; color: var(--text); }
.game-duel-result.duelWin { background: #DCFCE7; color: #166534; border-color: #86EFAC; }
.game-duel-result.duelLose { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.game-prog { display: flex; align-items: flex-end; gap: 10px; min-height: 84px; }
.game-prog-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; flex: 1 1 0; max-width: 54px; }
.game-prog-col span { font-size: 0.78rem; font-weight: 800; color: var(--text); }
.game-prog-col i { display: block; width: 100%; border-radius: 6px 6px 0 0; background: var(--primary); opacity: 0.85; }
.game-prog-col:last-child i { opacity: 1; }
.game-prog-date { font-size: 0.66rem; font-weight: 600; color: var(--text-secondary); line-height: 1.1; white-space: nowrap; }
.game-review { border-top: 1px solid var(--border); padding: 8px 0; }
.game-review summary { cursor: pointer; font-size: 0.88rem; color: var(--text); padding: 4px 0; }
.game-review summary small { color: var(--text-secondary); margin-left: 6px; }
.game-review-visual { display: flex; justify-content: center; margin: 10px 0; overflow-x: auto; }
.game-review-title { font-size: 0.9rem; font-weight: 600; color: var(--text); line-height: 1.45; margin: 8px 0; }
.game-review-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.game-review-opt { border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; font-size: 0.84rem; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.game-review-opt em { font-style: normal; font-size: 0.72rem; font-weight: 800; }
.game-review-opt.right { border-color: #22C55E; background: rgba(34, 197, 94, 0.12); }
.game-review-opt.right em { color: #16A34A; }
.game-review-opt.wrong { border-color: #EF4444; background: rgba(239, 68, 68, 0.10); }
.game-review-opt.wrong em { color: #DC2626; }
.game-review-explain { font-size: 0.85rem; line-height: 1.5; color: var(--text); background: var(--surface); border-left: 3px solid var(--primary); border-radius: 6px; padding: 8px 10px; margin: 10px 0 4px; }

/* Interactive Progression Chart & Result Stub */
.prog-chart-wrap { display: flex; flex-direction: column; gap: 10px; }
.prog-summary-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.prog-pill {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-container);
  border: 1px solid var(--border);
  color: var(--text);
}
.prog-pill-delta.up { background: rgba(34, 197, 94, 0.14); border-color: #22C55E; color: #16A34A; }
.prog-pill-delta.down { background: rgba(239, 68, 68, 0.12); border-color: #EF4444; color: #DC2626; }
[data-theme="dark"] .prog-pill-delta.up { color: #86EFAC; }
[data-theme="dark"] .prog-pill-delta.down { color: #FCA5A5; }

.prog-tooltip-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-container);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.prog-tt-iq { color: var(--primary); font-weight: 800; }
.prog-tt-sep { color: var(--text-muted); }
.prog-tt-meta { color: var(--text-secondary); font-weight: 600; }
.prog-tt-delta { margin-left: auto; font-weight: 700; color: var(--text); font-size: 0.78rem; }

.prog-svg-box { width: 100%; overflow: hidden; }
.prog-svg { display: block; width: 100%; height: auto; }
.prog-pt { cursor: pointer; outline: none; }
.prog-pt-halo { opacity: 0; transition: opacity 0.16s ease; }
.prog-pt.is-active .prog-pt-halo, .prog-pt:hover .prog-pt-halo, .prog-pt:focus .prog-pt-halo { opacity: 1; }

.result-stub-top-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.result-stub-badge, .result-stub-mode {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}
.result-stub-badge { background: var(--primary-container); color: var(--on-primary-container); }
.result-stub-mode { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-secondary); }

.result-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--primary-container);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.result-cta-copy { flex: 1 1 260px; text-align: left; }
.result-cta-copy h3 { font-size: 1.02rem; font-weight: 800; color: var(--on-primary-container); margin: 0 0 4px; }
.result-cta-copy p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; line-height: 1.45; }
.result-cta-btn { white-space: nowrap; }
@media (max-width: 600px) {
  .result-cta-btn { width: 100%; justify-content: center; }
}

/* =========================================================================
   Résultats en attente de paiement (/pending-results) + registre local
   ========================================================================= */
.pending-view-card { margin: 0 auto; }
.pending-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.pending-card {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.pending-card .checkout-tier-header { align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.pending-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }
.pending-locked { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pending-gauge {
  position: relative;
  flex: 0 0 auto;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 6px solid var(--primary-container);
  border-top-color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  user-select: none;
}
.pending-gauge-blur { font-size: 1.35rem; font-weight: 900; color: var(--primary); filter: blur(6px); }
.pending-gauge-lock { position: absolute; font-size: 1.1rem; }
.pending-locked-note { font-size: 0.84rem; font-weight: 600; color: var(--text-secondary); line-height: 1.4; }
.pending-fresh { margin-top: 4px; font-size: 0.8rem; font-weight: 700; color: var(--success); }
[data-theme="dark"] .pending-fresh { color: #6EE7B7; }
.pending-actions { display: flex; flex-direction: column; gap: 8px; }
.pending-actions .pending-pay-btn { margin: 0; }
.pending-credit-btn { width: 100%; padding: 12px 18px; font-size: 0.95rem; }
.pending-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.pending-nav .restart-btn:hover { background: var(--surface-container-high); color: var(--text); }
.pending-forget-row { text-align: center; margin-top: 12px; }
.pending-forget-link { font-size: 0.74rem; color: var(--text-muted); text-decoration: underline; }
.pending-forget-link:hover { color: var(--error); }
.pending-home-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 12px; padding: 9px 14px;
  background: #FEF3C7; color: #92400E;
  border: 1px solid #F59E0B; border-radius: var(--radius-sm);
  font-size: 0.84rem; text-decoration: none; text-align: left;
}
.pending-home-banner strong { white-space: nowrap; }
[data-theme="dark"] .pending-home-banner { background: rgba(245, 158, 11, 0.14); color: #FCD34D; border-color: rgba(245, 158, 11, 0.5); }
.llm-mini-card.card-user.is-clickable { cursor: pointer; }
.llm-mini-card.card-user.is-clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.my-result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.my-result-btn { padding: 9px 20px; font-size: 0.9rem; }
@media (max-width: 600px) {
  .pending-card { padding: 12px; }
  .pending-gauge { width: 60px; height: 60px; border-width: 5px; }
  .pending-nav .restart-btn { flex: 1 1 100%; }
}

/* Bandeau des IA : sous-titre long (« scores moyens sur la base de modèles standards grand public ») */
.llm-compact-header { gap: 10px; }
.llm-compact-title { flex: 0 0 auto; }
.llm-compact-sub { min-width: 0; text-align: right; line-height: 1.25; font-weight: 600; }

/* Logo de marque (images) : version claire / sombre selon le thème */
.brand-logo {
  display: block;
  /* 68 px sur un écran normal ; réduit sur les fenêtres basses pour ne pas couper l'accueil verrouillé à la hauteur d'écran */
  height: clamp(40px, 7.6dvh, 68px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
.logo-wrap { min-width: 0; flex-shrink: 1; }
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }
@media (max-width: 420px) {
  .brand-logo { height: clamp(40px, 6.6dvh, 56px); }
}

/* Fenêtres CGU / Mentions / Confidentialité / Déontologie / FAQ : logo carré en tête */
.modal-header-brand { align-items: flex-start; }
.modal-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; padding-left: 32px; }
.modal-brand-logo { display: block; height: 96px; width: auto; }
.modal-brand-logo.brand-logo-dark { display: none; }
[data-theme="dark"] .modal-brand-logo.brand-logo-light { display: none; }
[data-theme="dark"] .modal-brand-logo.brand-logo-dark { display: block; }
.modal-brand h3 { text-align: center; }
@media (max-width: 420px) {
  .modal-brand-logo { height: 76px; }
}
