/* ═══════════════════════════════════════════════════════
   VISUAL IQ — style.css
   Aesthetic: Swiss International Style meets museum wall
   ═══════════════════════════════════════════════════════ */

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

:root {
  --bg:       #f4f2ee;
  --surface:  #ffffff;
  --surface2: #eceae6;
  --ink:      #0f0f0d;
  --ink2:     #2a2a26;
  --muted:    #7a7870;
  --faint:    #c8c6c0;
  --accent:   #1a1a18;
  --red:      #c0392b;
  --green:    #1e6e42;
  --green2:   #28a05f;
  --gold:     #b8960c;
  --border:   #d8d6d0;

  --sans: 'DM Sans', -apple-system, sans-serif;
  --mono: 'DM Mono', monospace;
  --serif: 'Cormorant Garamond', Georgia, serif;

  --radius: 4px;
  --radius-lg: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 80px;
}

/* ── HEADER ── */
.app-header {
  width: 100%;
  background: var(--ink);
  padding: 0 20px;
}

.header-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 0 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 1px;
  line-height: 1;
}

.logo-v {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.02em;
}

.logo-iq {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: -0.02em;
}

.logo-full {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.logo-sub {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
}

/* ── SCORE BAR ── */
.score-bar {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--ink2);
  border-bottom: 2px solid var(--gold);
}

.sb-item { text-align: center; }

.sb-val {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--gold);
  line-height: 1;
}

.sb-key {
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

.round-pips { display: flex; gap: 6px; align-items: center; }

.pip {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: transparent;
  transition: all 0.3s;
}
.pip.done    { background: var(--gold); border-color: var(--gold); }
.pip.current { border-color: #fff; box-shadow: 0 0 6px rgba(255,255,255,0.4); }

/* ── MAIN ── */
main {
  width: 100%;
  max-width: 600px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.screen { display: none; flex-direction: column; gap: 16px; }
.screen.active { display: flex; }

/* ── INTRO ── */
.intro-hero { text-align: center; padding: 8px 0; }

.intro-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink2);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.mode-section { display: flex; flex-direction: column; }

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-card {
  padding: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.mode-card:hover   { border-color: var(--ink); }
.mode-card.selected { border-color: var(--ink); background: var(--ink); color: #fff; }

.mode-icon {
  font-size: 1.2rem;
  margin-bottom: 6px;
  opacity: 0.7;
}

.mode-name {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.mode-desc {
  font-size: 0.75rem;
  opacity: 0.6;
  line-height: 1.4;
}

.game-modes { display: flex; flex-direction: column; gap: 8px; }

.game-mode-btn {
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-mode-btn:hover    { border-color: var(--ink); }
.game-mode-btn.selected { border-color: var(--ink); background: var(--ink); color: #fff; }

.gm-name {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 120px;
}

.gm-desc { font-size: 0.8rem; opacity: 0.65; }

.scoring-explainer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.se-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.se-num { color: var(--muted); }
.se-pts { color: var(--ink); font-weight: 500; }

/* ── IMAGE FRAME ── */
.img-frame {
  width: 100%;
  background: #1a1a18;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-frame.large { min-height: 280px; }

.img-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  background: #1a1a18;
  z-index: 2;
}

.img-loading.locked { color: rgba(255,255,255,0.1); }

.slide-img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  display: none;
  position: relative;
  z-index: 1;
}

.slide-img.loaded { display: block; }

/* ── CAROUSEL ── */
.carousel-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carousel { position: relative; }

.carousel-slide { display: none; }
.carousel-slide.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slide-meta {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 6px 0 0;
  min-height: 20px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.cdot {
  width: 28px; height: 3px;
  border-radius: 2px;
  background: var(--faint);
  cursor: pointer;
  transition: background 0.2s;
}
.cdot.active   { background: var(--ink); }
.cdot.unlocked { background: var(--faint); cursor: pointer; }
.cdot.locked   { background: var(--border); cursor: default; }

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cnav-btn {
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
.cnav-btn:hover:not(:disabled) { background: var(--ink); color: #fff; border-color: var(--ink); }
.cnav-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.cnav-center { flex: 1; text-align: center; }

.reveal-score {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.reveal-score strong { color: var(--ink); }

/* ── QUESTION BLOCK ── */
.question-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.q-label {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.q-step {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
.q-step::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── OPTIONS ── */
.options { display: flex; flex-direction: column; gap: 7px; }

.option {
  padding: 13px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.12s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.option:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface);
  transform: translateX(2px);
}

.option:disabled { cursor: default; }

.option.correct {
  background: #e8f5ee;
  border-color: var(--green2);
  color: var(--green);
}

.option.wrong {
  background: #fdf0ee;
  border-color: #d9796e;
  color: #8c3a2e;
}

.option.reveal {
  background: #e8f5ee;
  border-color: #a8d4b8;
  color: var(--muted);
}

.opt-letter {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  min-width: 14px;
  flex-shrink: 0;
}
.option.correct .opt-letter { color: var(--green2); }
.option.wrong   .opt-letter { color: #d9796e; }

/* ── ROUND PROGRESS ── */
.round-progress { display: flex; justify-content: center; gap: 6px; }

.rp-dot {
  width: 24px; height: 3px;
  border-radius: 2px;
  background: var(--faint);
  transition: background 0.3s;
}
.rp-dot.done-good { background: var(--green2); }
.rp-dot.done-bad  { background: #d9796e; }
.rp-dot.current   { background: var(--ink); }

/* ── POINTS FLASH ── */
.points-flash {
  text-align: center;
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 500;
  animation: flash 0.35s ease;
}
.points-flash.good { color: var(--green); }
.points-flash.bad  { color: var(--red); }

@keyframes flash {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── RESULT ── */
.result-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: riseUp 0.3s ease;
}

.result-card.win  { background: #e8f5ee; border: 1.5px solid var(--green2); }
.result-card.pass { background: #fdf8ee; border: 1.5px solid #c8a840; }
.result-card.lose { background: #fdf0ee; border: 1.5px solid #d9796e; }

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

.result-headline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--ink);
}

.result-pts {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}

/* ── RESULT IMAGES ── */
.result-images {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.result-thumb {
  aspect-ratio: 1;
  background: #1a1a18;
  border-radius: var(--radius);
  overflow: hidden;
}

.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.result-thumb img.loaded { display: block; }

/* ── INSIGHT ── */
.insight-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.insight-label {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.insight-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink2);
}

/* ── THINKING ── */
.thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.dots span { animation: dp 1.2s infinite; color: var(--ink); }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dp { 0%,80%,100%{opacity:0.15} 40%{opacity:1} }

/* ── FINAL ── */
.final-header { text-align: center; padding: 12px 0; }

.final-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.final-score {
  font-family: var(--mono);
  font-size: 4rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}

.final-max {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 4px;
}

.final-rows { display: flex; flex-direction: column; gap: 6px; }

.final-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.fr-label {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink2);
  flex: 1;
}

.fr-movement {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 12px;
}

.fr-pts {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 500;
}

.verdict {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 4px 8px;
}

/* ── BUTTONS ── */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover  { background: var(--ink2); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

.share-row { display: flex; justify-content: center; }

.btn-share {
  padding: 11px 32px;
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-share:hover { background: var(--ink); color: #fff; }

/* ── RESPONSIVE ── */
@media (max-width: 420px) {
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .result-images { grid-template-columns: repeat(4, 1fr); }
  .logo-v, .logo-iq { font-size: 2rem; }
  .q-label { font-size: 0.95rem; }
  .option { font-size: 0.82rem; padding: 11px 14px; }
}
