/* FreeWPMType design: clean, light, five color themes. Our own code, our own brand. */
:root,
[data-theme="wine"] {
  --bg: #faf2f3;
  --surface: #ffffff;
  --surface-2: #f6e9ec;
  --brand: #722f37;
  --brand-dark: #571f27;
  --brand-light: #93434c;
  --ink: #4a1f26;
  --body: #5c3a40;
  --muted: #8a6a70;
  --faint: #7a4a52;
  --line: #e8d5d8;
  --amber: #e8a13a;
  --correct: #2e7d4f;
  --wrong: #cf3b2a;
  --wrong-bg: #fdecea;
  --shadow: 0 6px 24px rgba(90, 40, 48, 0.10);
  --shadow-sm: 0 2px 8px rgba(90, 40, 48, 0.12);
}

[data-theme="navy"] {
  --bg: #eef3fa;
  --surface: #ffffff;
  --surface-2: #e4ecf7;
  --brand: #1e3f73;
  --brand-dark: #14305c;
  --brand-light: #2f5b9a;
  --ink: #16294d;
  --body: #33475f;
  --muted: #5f7896;
  --faint: #42597a;
  --line: #d5e0ef;
  --amber: #e8a13a;
  --correct: #2e7d4f;
  --wrong: #cf3b2a;
  --wrong-bg: #fdecea;
  --shadow: 0 6px 24px rgba(20, 48, 92, 0.10);
  --shadow-sm: 0 2px 8px rgba(20, 48, 92, 0.12);
}

[data-theme="olive"] {
  --bg: #f3f5ea;
  --surface: #ffffff;
  --surface-2: #e9edda;
  --brand: #67742a;
  --brand-dark: #4e5a1e;
  --brand-light: #7f8f3a;
  --ink: #3c4419;
  --body: #4c5433;
  --muted: #75805c;
  --faint: #55603f;
  --line: #dde2c8;
  --amber: #e8a13a;
  --correct: #2e7d4f;
  --wrong: #cf3b2a;
  --wrong-bg: #fdecea;
  --shadow: 0 6px 24px rgba(78, 90, 30, 0.10);
  --shadow-sm: 0 2px 8px rgba(78, 90, 30, 0.12);
}

[data-theme="rust"] {
  --bg: #faf1ea;
  --surface: #ffffff;
  --surface-2: #f5e4d6;
  --brand: #b0512c;
  --brand-dark: #8c3e20;
  --brand-light: #c96f45;
  --ink: #5f2f18;
  --body: #6b4630;
  --muted: #97705a;
  --faint: #7d5138;
  --line: #eed6c2;
  --amber: #e8a13a;
  --correct: #2e7d4f;
  --wrong: #cf3b2a;
  --wrong-bg: #fdecea;
  --shadow: 0 6px 24px rgba(140, 62, 32, 0.10);
  --shadow-sm: 0 2px 8px rgba(140, 62, 32, 0.12);
}

[data-theme="pink"] {
  --bg: #fdf0f5;
  --surface: #ffffff;
  --surface-2: #fae4ee;
  --brand: #c2437a;
  --brand-dark: #9c2f5c;
  --brand-light: #dd6b97;
  --ink: #5c1f3a;
  --body: #6e3a50;
  --muted: #a06e85;
  --faint: #7d4258;
  --line: #f0d3e0;
  --amber: #e8a13a;
  --correct: #2e7d4f;
  --wrong: #cf3b2a;
  --wrong-bg: #fdecea;
  --shadow: 0 6px 24px rgba(156, 47, 92, 0.10);
  --shadow-sm: 0 2px 8px rgba(156, 47, 92, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3 {
  color: var(--brand);
  font-style: italic;
  font-weight: 800;
  line-height: 1.25;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

/* Header: solid teal bar */
.site-header {
  background: var(--brand-dark);
  padding: 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 12px;
}
.logo {
  color: #fff;
  font-style: italic;
  font-weight: 800;
  font-size: 24px;
  text-decoration: none;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.logo small {
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 8px;
}
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a.nav-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav a.nav-link:hover { background: rgba(255, 255, 255, 0.14); }

/* Buttons */
.btn {
  display: inline-block;
  font-family: inherit;
  background: #fff;
  color: var(--brand);
  border: 0;
  border-radius: 999px;
  padding: 11px 26px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-solid, .btn.active {
  background: var(--brand);
  color: #fff;
}
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* Header buttons: white outline pills on the brand bar */
.site-header .btn {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  box-shadow: none;
  padding: 8px 20px;
  font-size: 12.5px;
}
.site-header .btn:hover { background: rgba(255, 255, 255, 0.14); transform: none; }

/* Theme swatches: five color themes */
.swatches {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
}
.swatch {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  cursor: pointer; padding: 0;
  transition: transform 0.15s;
}
.swatch:hover { transform: scale(1.2); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px #fff; transform: scale(1.15); }
.swatch[data-theme="wine"] { background: #722f37; }
.swatch[data-theme="navy"] { background: #1e3f73; }
.swatch[data-theme="olive"] { background: #67742a; }
.swatch[data-theme="rust"] { background: #b0512c; }
.swatch[data-theme="pink"] { background: #c2437a; }

/* Ad slots */
.ad-slot {
  border: 1.5px dashed var(--faint);
  border-radius: 10px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  padding: 14px;
  margin: 26px auto;
  background: rgba(255, 255, 255, 0.5);
}
.ad-banner { max-width: 970px; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-rect { min-height: 250px; max-width: 300px; display: flex; align-items: center; justify-content: center; }
.ad-results { max-width: 728px; min-height: 90px; display: flex; align-items: center; justify-content: center; }

/* Hero */
.hero { text-align: center; padding: 46px 0 8px; }
.hero h1 { font-size: 42px; margin: 0 0 10px; }
.hero p.lead { color: var(--body); font-size: 20px; max-width: 660px; margin: 0 auto; }

/* White panels */
.panel {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px 36px;
  margin: 26px 0;
}
.caps-label {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 18px;
}

/* Typing widget */
.vt-widget { position: relative; }
.vt-topbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 6px;
}
.vt-modes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.vt-modes .btn { padding: 9px 20px; font-size: 13px; }
.vt-best { color: var(--muted); font-size: 16px; }
.vt-best strong { color: var(--brand); font-weight: 700; }

.vt-ref {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  margin: 20px 0 12px;
  min-height: 20px;
}
.vt-text {
  position: relative;
  font-size: 27px;
  line-height: 1.8;
  color: var(--faint);
  min-height: 200px;
  cursor: text;
  user-select: none;
  outline: none;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 22px 24px;
}
.vt-text span { position: relative; }
.vt-text span.ok { color: var(--correct); }
.vt-text span.bad { color: var(--wrong); background: var(--wrong-bg); border-radius: 3px; }
.vt-caret {
  position: absolute;
  width: 3px;
  background: var(--brand);
  border-radius: 2px;
  transition: left 0.09s ease-out, top 0.09s ease-out, height 0.15s;
  pointer-events: none;
}
.vt-focus-hint { text-align: center; color: var(--faint); font-size: 16px; margin-top: 14px; }
.vt-live {
  display: flex; justify-content: center; gap: 48px;
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.vt-live .lv { text-align: center; }
.vt-live .lv .n { font-size: 30px; font-weight: 800; font-style: italic; color: var(--brand); }
.vt-live .lv .l { font-size: 12px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.vt-actions { text-align: center; margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; }
.vt-actions .btn { background: var(--brand); color: #fff; }
.vt-input { position: absolute; opacity: 0; pointer-events: none; top: 0; left: 0; width: 10px; height: 10px; }

/* Results */
.vt-results { margin-top: 10px; }
.vt-blur-wrap { position: relative; text-align: center; padding: 30px 10px; }
.vt-score-blurred { filter: blur(14px); user-select: none; pointer-events: none; }
.vt-score-blurred .big-wpm { font-size: 84px; font-weight: 800; font-style: italic; color: var(--brand); line-height: 1; }
.vt-blur-sub { letter-spacing: 3px; color: var(--muted); font-size: 13px; margin-top: 8px; font-weight: 700; }
.vt-reveal-veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.vt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 8px 0 26px; }
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 10px;
  text-align: center;
}
.stat-num { font-size: 34px; font-weight: 800; font-style: italic; color: var(--brand); }
.stat-label { font-size: 11px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-top: 6px; font-weight: 700; }
.vt-tricky { text-align: center; color: var(--muted); font-size: 17px; margin-bottom: 26px; }
.vt-tricky strong { color: var(--wrong); font-size: 22px; letter-spacing: 6px; }

/* Certificate */
.vt-cert {
  border: 3px double var(--brand);
  border-radius: 12px;
  padding: 44px 40px;
  text-align: center;
  background: var(--surface);
  margin: 10px auto 24px;
  max-width: 640px;
}
.vt-cert .cert-kicker { font-size: 12px; letter-spacing: 5px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.vt-cert .cert-title { font-size: 32px; color: var(--brand); font-style: italic; font-weight: 800; margin: 8px 0 4px; }
.vt-cert .cert-wpm { font-size: 64px; font-weight: 800; font-style: italic; color: var(--ink); margin: 10px 0 2px; }
.vt-cert .cert-sub { color: var(--muted); font-size: 18px; }
.vt-cert .cert-verse { font-style: italic; color: var(--ink); font-size: 19px; margin: 16px 0 4px; }
.vt-cert .cert-ref { font-size: 13px; letter-spacing: 3px; color: var(--brand); text-transform: uppercase; font-weight: 700; }
.vt-cert .cert-date { color: var(--muted); font-size: 17px; margin-top: 14px; }
.cert-seal {
  width: 84px; height: 84px; border-radius: 50%;
  border: 2px solid var(--brand);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; font-style: italic;
  margin: 20px auto 0;
}

/* Sections */
.section { padding: 30px 0; }
.section h2 { font-size: 30px; text-align: center; margin: 0 0 8px; }
.section .sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 26px; }

.faq { max-width: 780px; margin: 0 auto; }
.faq details {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 18px 22px;
  margin-bottom: 12px;
}
.faq summary { font-size: 17px; font-weight: 700; color: var(--brand); cursor: pointer; }
.faq p { color: var(--body); margin: 10px 0 4px; font-size: 17px; }

.bible-note { max-width: 780px; margin: 0 auto; text-align: center; }
.bible-note h2 { font-size: 30px; margin: 0 0 10px; }
.bible-note p { color: var(--body); }

/* Progress: streaks and badges */
.streak-bar {
  display: flex; justify-content: center; gap: 26px; flex-wrap: wrap;
  margin: 6px 0 0; color: var(--muted); font-size: 18px;
}
.streak-bar strong { color: var(--brand); }
.badge-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.badge {
  width: 112px; padding: 14px 8px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface-2); opacity: 0.45;
}
.badge.earned { opacity: 1; border-color: var(--brand); background: var(--surface); }
.badge .b-icon { font-size: 26px; }
.badge .b-name { font-size: 12px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.badge .b-desc { font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 4px; }

/* Quick start duration cards */
.qcards { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.qcard {
  background: var(--surface);
  border: 1.5px solid var(--brand);
  border-radius: 999px;
  padding: 12px 26px;
  text-decoration: none;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.2s;
  min-width: 130px;
}
.qcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.qcard .q-name { display: block; font-weight: 800; font-style: italic; color: var(--brand); font-size: 17px; }
.qcard .q-sub { display: block; font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 700; margin-top: 2px; }

/* Legacy test-links (kept working wherever still used) */
.test-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.test-links a { text-decoration: none; }

.intro-copy { max-width: 720px; margin: 0 auto; color: var(--body); text-align: center; }

footer {
  border-top: 1px solid var(--line);
  margin-top: 44px; padding: 28px 0;
  text-align: center; color: var(--muted); font-size: 16px;
  background: rgba(255, 255, 255, 0.55);
}
footer a { color: var(--brand); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }
footer .f-brand { font-style: italic; font-weight: 800; font-size: 20px; color: var(--brand); }

/* Custom test page */
.custom-box { max-width: 780px; margin: 0 auto; }
.custom-box label, .caps {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 3px;
  color: var(--muted); text-transform: uppercase; margin: 16px 0 8px;
}
textarea#custom-text {
  width: 100%; min-height: 180px; background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 12px;
  color: var(--ink); font-family: inherit; font-size: 18px;
  padding: 16px; resize: vertical;
}
textarea#custom-text:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.share-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
input#share-link {
  flex: 1; min-width: 220px; background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 999px;
  color: var(--muted); padding: 10px 18px; font-size: 15px;
}

/* Print: certificate only */
@media print {
  body.print-cert * { visibility: hidden; }
  body.print-cert .vt-cert, body.print-cert .vt-cert * { visibility: visible; }
  body.print-cert .vt-cert {
    position: absolute; left: 0; right: 0; top: 20px; margin: 0 auto;
    box-shadow: none;
  }
}

/* Mobile */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .hero { padding: 34px 0 4px; }
  .hero h1 { font-size: 30px; }
  .panel { padding: 24px 18px; border-radius: 14px; }
  .vt-text { font-size: 22px; padding: 16px; min-height: 190px; }
  .vt-stats { grid-template-columns: repeat(2, 1fr); }
  .vt-live { gap: 26px; }
  .vt-cert { padding: 30px 20px; }
  .vt-cert .cert-wpm { font-size: 48px; }
  .nav a.nav-link.hide-mobile { display: none; }
  .site-header .btn { padding: 7px 14px; }
  .logo { font-size: 20px; }
  .logo small { display: none; }
}
