/* Vision Therapy Free — vtf.css */
:root {
  --vtf-blue:    #2563EB;
  --vtf-blue-dk: #1d4ed8;
  --vtf-green:   #16a34a;
  --vtf-red:     #dc2626;
  --vtf-amber:   #d97706;
  --vtf-bg:      #f8fafc;
  --vtf-surface: #ffffff;
  --vtf-border:  #e2e8f0;
  --vtf-gray-4:  #f1f5f9;
  --vtf-gray-5:  #64748b;
  --vtf-gray-6:  #475569;
  --vtf-gray-9:  #0f172a;
  --vtf-radius:  14px;
  --vtf-shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --vtf-font:    'DM Sans', system-ui, sans-serif;
  --vtf-serif:   'DM Serif Display', Georgia, serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
#vtf-app *, #vtf-app *::before, #vtf-app *::after { box-sizing: border-box; }
#vtf-app { font-family: var(--vtf-font); color: var(--vtf-gray-9); line-height: 1.6; }

/* ── Views ─────────────────────────────────────────────────── */
.vtf-view { display: none; }
.vtf-view.active { display: block; }

/* ── Disclaimer Modal ──────────────────────────────────────── */
.vtf-modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15,23,42,.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.vtf-modal-box {
  background: #fff; border-radius: 20px;
  padding: 40px 36px; max-width: 540px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
  animation: vtf-pop .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes vtf-pop { from { transform: scale(.9); opacity:0; } to { transform: scale(1); opacity:1; } }
.vtf-modal-icon { font-size: 44px; margin-bottom: 12px; }
.vtf-modal-title { font-family: var(--vtf-serif); font-size: 26px; margin: 0 0 16px; color: var(--vtf-gray-9); }
.vtf-modal-body {
  font-size: 15px; line-height: 1.7; color: var(--vtf-gray-6);
  text-align: left; margin-bottom: 28px;
}
.vtf-btn-primary {
  display: inline-block; background: var(--vtf-blue); color: #fff;
  border: none; border-radius: 10px; padding: 14px 28px;
  font-family: var(--vtf-font); font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.vtf-btn-primary:hover { background: var(--vtf-blue-dk); }
.vtf-btn-full { width: 100%; }

/* ── Hero ──────────────────────────────────────────────────── */
.vtf-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563EB 100%);
  padding: 56px 24px 48px;
}
.vtf-hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.vtf-hero-title {
  font-family: var(--vtf-serif); font-size: clamp(32px,5vw,52px);
  color: #fff; margin: 0 0 14px; line-height: 1.15;
}
.vtf-hero-sub { color: rgba(255,255,255,.85); font-size: 18px; margin: 0 0 24px; }
.vtf-hero-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.vtf-badge {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 99px; padding: 6px 16px; font-size: 14px; font-weight: 500;
}

/* ── Ad slots ──────────────────────────────────────────────── */
.vtf-ad-slot { text-align: center; padding: 16px 0; min-height: 10px; }

/* ── Grid wrap ─────────────────────────────────────────────── */
.vtf-grid-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 20px 48px; }

/* ── Section header + filters ──────────────────────────────── */
.vtf-section-hd { margin-bottom: 24px; }
.vtf-section-hd h2 { font-family: var(--vtf-serif); font-size: 28px; margin: 0 0 16px; }
.vtf-filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.vtf-filter {
  background: var(--vtf-gray-4); border: 1.5px solid var(--vtf-border);
  color: var(--vtf-gray-5); border-radius: 99px; padding: 6px 16px;
  font-size: 14px; font-weight: 500; font-family: var(--vtf-font);
  cursor: pointer; transition: all .15s;
}
.vtf-filter:hover, .vtf-filter.active {
  background: var(--vtf-blue); border-color: var(--vtf-blue);
  color: #fff;
}

/* ── Exercise grid ─────────────────────────────────────────── */
.vtf-ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-bottom: 32px;
}
.vtf-ex-card {
  background: var(--vtf-surface); border: 1.5px solid var(--vtf-border);
  border-radius: var(--vtf-radius); padding: 24px;
  box-shadow: var(--vtf-shadow); display: flex; flex-direction: column;
  gap: 8px; transition: transform .18s, box-shadow .18s;
}
.vtf-ex-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(37,99,235,.15); }
.vtf-ex-card[style*="display:none"] { display: none !important; }

.vtf-ex-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.vtf-ex-emoji { font-size: 32px; }
.vtf-ex-cat-pill {
  background: #eff6ff; color: var(--vtf-blue);
  border: 1px solid #bfdbfe; border-radius: 99px;
  padding: 3px 10px; font-size: 12px; font-weight: 600;
}
.vtf-ex-title { font-family: var(--vtf-serif); font-size: 20px; margin: 4px 0 2px; }
.vtf-ex-benefit { font-size: 14px; color: var(--vtf-gray-5); margin: 0; flex: 1; }
.vtf-ex-meta { display: flex; gap: 12px; font-size: 13px; color: var(--vtf-gray-5); }
.vtf-start-ex-btn {
  margin-top: 8px; background: var(--vtf-blue); color: #fff;
  border: none; border-radius: 9px; padding: 11px 18px;
  font-size: 15px; font-weight: 600; font-family: var(--vtf-font);
  cursor: pointer; transition: background .15s; text-align: center;
}
.vtf-start-ex-btn:hover { background: var(--vtf-blue-dk); }

/* ── CTA Banner ────────────────────────────────────────────── */
.vtf-cta-banner {
  background: linear-gradient(135deg,#eff6ff,#dbeafe);
  border: 1.5px solid #bfdbfe; border-radius: var(--vtf-radius);
  padding: 24px; margin: 28px 0;
}
.vtf-cta-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.vtf-cta-icon { font-size: 36px; flex-shrink: 0; }
.vtf-cta-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.vtf-cta-text strong { font-size: 16px; color: var(--vtf-gray-9); }
.vtf-cta-text span { font-size: 14px; color: var(--vtf-gray-5); }
.vtf-cta-btn {
  background: var(--vtf-blue); color: #fff; text-decoration: none;
  border-radius: 9px; padding: 12px 20px; font-size: 15px; font-weight: 600;
  white-space: nowrap; transition: background .15s; flex-shrink: 0;
}
.vtf-cta-btn:hover { background: var(--vtf-blue-dk); }

/* ── Disclaimer note ────────────────────────────────────────── */
.vtf-disclaimer-note {
  background: #fefce8; border: 1px solid #fde68a; border-radius: 10px;
  padding: 16px 20px; margin-top: 12px;
}
.vtf-disclaimer-note p { font-size: 14px; color: #78350f; margin: 0; line-height: 1.65; }

/* ── Brief / Level select view ─────────────────────────────── */
.vtf-brief-bg {
  min-height: 100vh; background: var(--vtf-bg);
  padding: 0 0 60px;
}
.vtf-brief-inner { max-width: 680px; margin: 0 auto; padding: 32px 20px; }
.vtf-brief-back {
  background: none; border: none; font-family: var(--vtf-font);
  color: var(--vtf-blue); font-size: 15px; cursor: pointer;
  padding: 0; margin-bottom: 28px; display: flex; align-items: center; gap: 6px;
}
.vtf-brief-card {
  background: #fff; border: 1.5px solid var(--vtf-border);
  border-radius: 20px; padding: 36px; box-shadow: var(--vtf-shadow);
}
.vtf-brief-emoji { font-size: 52px; margin-bottom: 10px; }
.vtf-brief-card h1 { font-family: var(--vtf-serif); font-size: 34px; margin: 0 0 6px; }
.vtf-brief-tag { color: var(--vtf-gray-5); font-size: 14px; font-weight: 500; margin-bottom: 18px; }
.vtf-brief-why {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px;
  padding: 16px; font-size: 14px; color: #0c4a6e; line-height: 1.7; margin-bottom: 24px;
}
.vtf-brief-section { font-weight: 700; font-size: 13px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--vtf-gray-5); margin-bottom: 10px; }
.vtf-brief-levels { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.vtf-brief-level {
  display: flex; align-items: flex-start; gap: 14px;
  border: 2px solid var(--vtf-border); border-radius: 12px; padding: 14px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.vtf-brief-level:hover { border-color: var(--vtf-blue); background: #eff6ff; }
.vtf-brief-level.selected { border-color: var(--vtf-blue); background: #eff6ff; }
.vtf-brief-lv-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--vtf-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.vtf-brief-lv-text { font-size: 14px; line-height: 1.5; }
.vtf-brief-instructions {
  background: var(--vtf-gray-4); border-radius: 10px; padding: 16px 20px;
  font-size: 14px; line-height: 1.75; margin-bottom: 24px; color: var(--vtf-gray-6);
}
.vtf-brief-instructions ol { margin: 0; padding-left: 20px; }
.vtf-brief-instructions li { margin-bottom: 6px; }
.vtf-brief-begin {
  width: 100%; padding: 16px; background: var(--vtf-blue); color: #fff;
  border: none; border-radius: 12px; font-family: var(--vtf-font);
  font-size: 17px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.vtf-brief-begin:hover { background: var(--vtf-blue-dk); }

/* ── Exercise player ────────────────────────────────────────── */
.vtf-ex-screen {
  min-height: 100vh;
  background: #0d1117;
  display: flex; flex-direction: column;
}
.vtf-ex-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.vtf-ex-bar-left { display: flex; align-items: center; gap: 14px; }
.vtf-ex-back {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: #fff; border-radius: 8px; padding: 7px 14px;
  font-family: var(--vtf-font); font-size: 14px; cursor: pointer;
}
.vtf-ex-name { color: rgba(255,255,255,.7); font-size: 15px; font-weight: 500; }
.vtf-ex-chips { display: flex; gap: 10px; }
.vtf-ex-chip {
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.7);
  border-radius: 99px; padding: 5px 14px; font-size: 14px; font-weight: 500;
}
.vtf-ex-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.vtf-ex-footer {
  padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; justify-content: center;
}
.vtf-ex-done {
  background: var(--vtf-green); color: #fff;
  border: none; border-radius: 10px; padding: 13px 36px;
  font-family: var(--vtf-font); font-size: 16px; font-weight: 600; cursor: pointer;
}
.vtf-ex-tip {
  color: rgba(255,255,255,.55); font-size: 14px; text-align: center;
  margin: 0 0 16px;
}

/* Pursuit */
.vtf-pursuit-wrap { width: 100%; max-width: 640px; }
#pursuitTrack {
  width: 100%; height: 60px; position: relative; background: rgba(255,255,255,.04);
  border-radius: 10px; margin: 12px 0;
}
#pursuitDot {
  width: 20px; height: 20px; border-radius: 50%; background: #ef4444;
  position: absolute; top: 50%; transform: translateY(-50%);
  box-shadow: 0 0 12px #ef4444;
}
.vtf-speed-row { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.5); font-size: 14px; margin-top: 10px; }
.vtf-speed-row input[type=range] { flex: 1; accent-color: var(--vtf-blue); }

/* Saccades */
.vtf-sacc-wrap { width: 100%; max-width: 640px; }
#sacc-area {
  width: 100%; height: 340px; position: relative;
  background: rgba(255,255,255,.03); border-radius: 12px;
}
#sacc-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  background: #16a34a; color: #fff; border: none; border-radius: 50%;
  width: 72px; height: 72px; font-size: 13px; font-weight: 700;
  font-family: var(--vtf-font); cursor: pointer;
  box-shadow: 0 0 20px rgba(22,163,74,.5);
}
.vtf-rt-label { color: rgba(255,255,255,.4); font-size: 13px; margin-top: 8px; text-align: center; }

/* Near-far */
.vtf-nf-wrap { text-align: center; }
.vtf-nf-inst {
  font-size: 56px; font-weight: 900; letter-spacing: -1px;
  margin-bottom: 20px;
  background: linear-gradient(135deg,#38bdf8,#818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
#nf-dot {
  width: 24px; height: 24px; border-radius: 50%; background: #38bdf8;
  margin: 0 auto 20px; box-shadow: 0 0 16px #38bdf8; transition: background .3s;
}
#nf-dot.far { background: rgba(255,255,255,.15); box-shadow: none; }
.vtf-btn-ghost {
  background: rgba(255,255,255,.08); color: #fff;
  border: 1.5px solid rgba(255,255,255,.2); border-radius: 9px;
  padding: 11px 24px; font-family: var(--vtf-font); font-size: 15px;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.vtf-btn-ghost:hover { background: rgba(255,255,255,.15); }
.vtf-nf-wrap p { margin-top: 16px; }
.vtf-nf-count { color: rgba(255,255,255,.35); font-size: 13px; margin-top: 10px; }

/* Jump vergence */
.vtf-jump-wrap { text-align: center; max-width: 540px; width: 100%; }
.vtf-jump-targets { display: flex; gap: 24px; justify-content: center; margin-bottom: 24px; }
.vtf-jump-target-box {
  flex: 1; max-width: 200px; background: rgba(255,255,255,.04);
  border: 2px solid rgba(255,255,255,.1); border-radius: 14px;
  padding: 24px; text-align: center; transition: all .2s;
}
.vtf-jump-target-box.active { border-color: #38bdf8; background: rgba(56,189,248,.08); }
.vtf-jump-near-dot { font-size: 36px; margin-bottom: 8px; }
.vtf-jump-far-dot { font-size: 20px; margin-bottom: 8px; }
.vtf-jump-tgt-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.5); }
.vtf-jump-prompt { color: rgba(255,255,255,.7); font-size: 16px; margin-bottom: 16px; }
.vtf-jump-count-lbl { color: rgba(255,255,255,.35); font-size: 13px; margin-top: 12px; }

/* Vergence facility */
.vtf-vf-wrap { width: 100%; max-width: 640px; text-align: center; }
.vtf-canvas { width: 100%; border-radius: 10px; background: rgba(255,255,255,.03); cursor: pointer; }
.vtf-vf-fb { color: rgba(255,255,255,.5); font-size: 14px; margin-top: 10px; }

/* Divergence */
.vtf-div-wrap { width: 100%; max-width: 640px; text-align: center; }
.vtf-div-fb { color: rgba(255,255,255,.5); font-size: 14px; margin-top: 10px; }
.vtf-div-controls { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 12px; }
.vtf-btn-sm {
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.15); border-radius: 7px;
  padding: 7px 14px; font-family: var(--vtf-font); font-size: 13px;
  cursor: pointer; transition: background .15s;
}
.vtf-btn-sm:hover { background: rgba(255,255,255,.15); }

/* DEM */
.vtf-dem-wrap { width: 100%; max-width: 600px; text-align: center; }
#dem-grid {
  display: grid; grid-template-columns: repeat(8,1fr);
  gap: 6px; margin: 12px 0;
}
.dem-cell {
  background: rgba(255,255,255,.06); border-radius: 6px;
  color: rgba(255,255,255,.8); font-size: 15px; font-weight: 600;
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .1s;
}
.dem-cell:hover { background: rgba(255,255,255,.12); }
.dem-cell.done { background: rgba(22,163,74,.3); color: #4ade80; }
.dem-cell.error { background: rgba(239,68,68,.3); }
.vtf-dem-stats { color: rgba(255,255,255,.4); font-size: 13px; margin-top: 10px; }
.vtf-dem-complete { color: #4ade80; font-size: 15px; margin-top: 12px; }

/* Reading saccades */
#rs-grid { display: grid; grid-template-columns: repeat(10,1fr); gap: 6px; margin: 12px 0; }

/* Zig-zag */
.vtf-zz-wrap { width: 100%; max-width: 640px; }
#zz-cv { width: 100%; background: rgba(255,255,255,.03); border-radius: 10px; }

/* Fixation */
.vtf-fix-wrap { width: 100%; max-width: 640px; text-align: center; }
#fix-cv { width: 100%; background: rgba(255,255,255,.03); border-radius: 10px; }

/* Contrast sensitivity */
.vtf-contrast-wrap { width: 100%; max-width: 640px; text-align: center; }
#cs-cv { width: 100%; border-radius: 10px; }
.vtf-contrast-btns { display: flex; gap: 14px; justify-content: center; margin-top: 14px; }
.vtf-contrast-info { color: rgba(255,255,255,.35); font-size: 13px; margin-top: 12px; }

/* Marsden */
.vtf-marsden-wrap { width: 100%; max-width: 640px; text-align: center; }
.vtf-marsden-canvas { width: 100%; background: rgba(255,255,255,.03); border-radius: 10px; }

/* ── Complete screen ────────────────────────────────────────── */
.vtf-complete-screen {
  min-height: 100vh; background: #0d1117;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.vtf-complete-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 40px; max-width: 480px; width: 100%;
  text-align: center;
}
.vtf-complete-emoji { font-size: 56px; margin-bottom: 12px; }
.vtf-complete-h1 { font-family: var(--vtf-serif); color: #fff; font-size: 32px; margin: 0 0 6px; }
.vtf-complete-ex { color: rgba(255,255,255,.5); font-size: 15px; margin-bottom: 24px; }
.vtf-complete-stats { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.vtf-cs { background: rgba(255,255,255,.06); border-radius: 12px; padding: 14px 20px; min-width: 90px; }
.vtf-cs-val { font-size: 26px; font-weight: 800; color: #fff; }
.vtf-cs-lbl { font-size: 12px; color: rgba(255,255,255,.4); margin-top: 3px; }
.vtf-complete-msg {
  font-size: 14px; color: rgba(255,255,255,.5); line-height: 1.7;
  margin: 16px 0 24px; text-align: left;
  background: rgba(255,255,255,.04); border-radius: 10px; padding: 14px;
}
.vtf-complete-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.vtf-complete-actions .vtf-btn-ghost { font-size: 15px; }

/* Ad slot placeholder styling — prevents CLS */
.vtf-ad-slot { min-height: 10px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .vtf-modal-box { padding: 28px 22px; }
  .vtf-brief-card { padding: 24px; }
  .vtf-hero { padding: 36px 16px 32px; }
  .vtf-ex-grid { grid-template-columns: 1fr; }
  .vtf-jump-targets { flex-direction: column; align-items: center; }
  .vtf-cta-inner { flex-direction: column; }
}
