/* ============================================================
   Olareviews — Typing Test (all classes start with .tt-)
   Uses the site's design tokens from styles.css.
   ============================================================ */
.tt-wrap { max-width: 1180px; margin: 0 auto; padding: 10px 24px 70px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.tt-card { background: linear-gradient(135deg, var(--surface), var(--surface-2)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.tt-card h2 { font-family: "Sora", sans-serif; font-size: 1.35rem; margin-bottom: 6px; }
.tt-dim { color: var(--text-dim); font-size: 0.92rem; }
.tt-hidden { display: none !important; }

/* ---- Guest sign-up ---- */
.tt-join { max-width: 520px; }
.tt-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 18px 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.tt-tab { border: 0; background: transparent; color: var(--text-dim); font: inherit; font-weight: 600; font-size: 0.9rem; padding: 8px 16px; border-radius: 9px; cursor: pointer; }
.tt-tab[aria-selected="true"] { background: linear-gradient(135deg, var(--accent), #9d7bff); color: #fff; }
.tt-field { display: grid; gap: 10px; }
.tt-input { width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; outline: none; transition: border-color .2s var(--ease); }
.tt-input:focus { border-color: var(--accent); }
.tt-note { min-height: 1.3em; font-size: 0.86rem; margin-top: 8px; color: #ff6b6b; }
.tt-privacy { margin-top: 10px; font-size: 0.8rem; color: var(--text-dim); }

/* ---- Player bar + live stats ---- */
.tt-player { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tt-player__who { font-weight: 600; }
.tt-player__who b { color: var(--accent); font-weight: 700; }
.tt-link { background: none; border: 0; color: var(--text-dim); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; padding: 0; }
.tt-link:hover { color: var(--text); }
.tt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.tt-stat { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 12px 10px; text-align: center; }
.tt-stat__val { font-family: "Sora", sans-serif; font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tt-stat__lbl { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.tt-bar { height: 6px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; margin-bottom: 18px; }
.tt-bar__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .15s linear; }

/* ---- The passage ---- */
.tt-board { position: relative; border-radius: 16px; border: 1px solid var(--border); background: var(--bg); padding: 22px 22px 22px 24px; cursor: text; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.tt-board.is-focused { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.tt-text { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.28rem; line-height: 2.05; color: var(--text-dim); max-height: calc(2.05em * 5); overflow: hidden; word-break: normal; user-select: none; -webkit-user-select: none; }
.tt-word { display: inline-block; white-space: pre; }
.tt-ch { position: relative; border-radius: 3px; transition: color .06s linear, background-color .06s linear; }
.tt-ch.is-ok { color: var(--text); }
.tt-ch.is-bad { color: #ff6b6b; background: rgba(255, 107, 107, 0.16); text-decoration: underline wavy rgba(255,107,107,.7); text-underline-offset: 5px; }
.tt-ch.is-bad.is-space { background: rgba(255, 107, 107, 0.35); }
.tt-ch.is-cur::before { content: ""; position: absolute; left: -1px; top: 12%; bottom: 12%; width: 2px; border-radius: 2px; background: var(--accent); animation: tt-blink 1s steps(1) infinite; }
.tt-board.is-typing .tt-ch.is-cur::before { animation: none; }
.tt-ch.is-hit { animation: tt-hit .18s var(--ease); }
@keyframes tt-blink { 50% { opacity: 0; } }
@keyframes tt-hit { 0% { background: color-mix(in srgb, var(--accent) 35%, transparent); } 100% { background: transparent; } }
.tt-overlay { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(3px); font-weight: 600; color: var(--text); }
.tt-capture { position: absolute; opacity: 0; width: 1px; height: 1px; left: 0; top: 0; border: 0; padding: 0; pointer-events: none; }
.tt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.tt-hint { margin-left: auto; font-size: 0.8rem; color: var(--text-dim); }
.tt-hint kbd { font-family: inherit; font-size: .75rem; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); }
.tt-error { margin-top: 12px; color: #ff6b6b; font-size: .9rem; min-height: 1.2em; }

/* ---- Leaderboard ---- */
.tt-lb { position: sticky; top: 96px; }
.tt-lb__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tt-live { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--good); font-weight: 600; }
.tt-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: tt-pulse 1.6s ease-in-out infinite; }
@keyframes tt-pulse { 50% { opacity: .3; } }
.tt-table-wrap { overflow-x: auto; }
.tt-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tt-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); font-weight: 600; padding: 0 8px 10px; border-bottom: 1px solid var(--border); }
.tt-table td { padding: 11px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.tt-table tr:last-child td { border-bottom: 0; }
.tt-table td.tt-num, .tt-table th.tt-num { text-align: right; }
.tt-table .tt-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tt-rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); font-weight: 700; font-size: .85rem; }
.tt-r1 .tt-rank { background: linear-gradient(135deg, #ffd65c, #f5a623); color: #3a2600; border-color: transparent; }
.tt-r2 .tt-rank { background: linear-gradient(135deg, #e6e9ef, #aab2c0); color: #1d2230; border-color: transparent; }
.tt-r3 .tt-rank { background: linear-gradient(135deg, #f0b58a, #c47a45); color: #2e1603; border-color: transparent; }
.tt-wpm { font-family: "Sora", sans-serif; font-weight: 700; }
.tt-you td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tt-you .tt-name::after { content: " (you)"; color: var(--accent); font-weight: 600; font-size: .8em; }
.tt-flash td { animation: tt-flash 1.6s var(--ease); }
@keyframes tt-flash { 0% { background: color-mix(in srgb, var(--good) 40%, transparent); } 100% { background: transparent; } }
.tt-empty { text-align: center; color: var(--text-dim); padding: 24px 8px !important; }
.tt-myrank { margin-top: 12px; font-size: .85rem; color: var(--text-dim); }

/* ---- Result modal ---- */
.tt-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 12, 0.72); backdrop-filter: blur(4px); }
.tt-modal__box { width: min(460px, 100%); text-align: center; padding: 34px 28px 28px; border-radius: 22px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); animation: tt-pop .45s var(--ease); }
@keyframes tt-pop { from { transform: scale(.85) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.tt-modal__icon { font-size: 3rem; line-height: 1; margin-bottom: 10px; }
.tt-modal__title { font-family: "Sora", sans-serif; font-size: 1.5rem; margin-bottom: 6px; }
.tt-modal__big { font-family: "Sora", sans-serif; font-size: 3.4rem; font-weight: 800; line-height: 1; margin: 14px 0 4px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tt-modal__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.tt-modal__grid div { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px; }
.tt-modal__grid b { display: block; font-family: "Sora", sans-serif; font-size: 1.15rem; }
.tt-modal__grid span { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.tt-modal__msg { color: var(--text-dim); margin-bottom: 20px; }
.tt-modal__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* Champion version */
.tt-champ .tt-modal__box { border-color: #f5c84c; box-shadow: 0 0 0 1px #f5c84c, 0 0 60px -10px rgba(245, 200, 76, .55), 0 30px 80px -20px rgba(0,0,0,.8); }
.tt-champ .tt-modal__icon { font-size: 4rem; animation: tt-crown 1.2s var(--ease) infinite alternate; }
.tt-champ .tt-modal__big { background: linear-gradient(135deg, #ffe08a, #f5a623); -webkit-background-clip: text; background-clip: text; }
@keyframes tt-crown { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-6px) rotate(6deg); } }
.tt-confetti { position: fixed; inset: 0; z-index: 201; pointer-events: none; }

@media (max-width: 980px) {
  .tt-wrap { grid-template-columns: minmax(0, 1fr); }
  .tt-lb { position: static; }
}
@media (max-width: 560px) {
  .tt-card { padding: 20px 16px; }
  .tt-stats { grid-template-columns: repeat(2, 1fr); }
  .tt-text { font-size: 1.08rem; }
  .tt-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tt-ch.is-hit, .tt-champ .tt-modal__icon, .tt-modal__box { animation: none; }
}

/* ---- Test-type switcher (Passage / 1 minute / 2 minutes) ---- */
.tt-modes { max-width: 1180px; margin: 0 auto 18px; padding: 0 24px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tt-mode { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.tt-mode:hover { border-color: var(--accent); transform: translateY(-2px); }
.tt-mode small { color: var(--text-dim); font-weight: 500; font-size: .78rem; }
.tt-mode.is-active { background: linear-gradient(135deg, var(--accent), #9d7bff); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -10px var(--accent-glow); }
.tt-mode.is-active small { color: rgba(255,255,255,.8); }
/* Last 10 seconds of a timed test */
.tt-stat--hurry { border-color: #ff6b6b; }
.tt-stat--hurry .tt-stat__val { color: #ff6b6b; animation: tt-pulse .8s ease-in-out infinite; }
@media (max-width: 560px) { .tt-mode { padding: 9px 14px; font-size: .88rem; } .tt-mode small { display: none; } }

/* ============================================================
   Content sections below the test (SEO + help)
   ============================================================ */
.tt-info { max-width: 1180px; margin: 0 auto; padding: 30px 24px 10px; display: grid; gap: 70px; }
.tt-sec { scroll-margin-top: 100px; }
.tt-sec__head { max-width: 760px; margin-bottom: 26px; }
.tt-sec__eyebrow { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.tt-sec h2 { font-family: "Sora", sans-serif; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; margin-bottom: 12px; }
.tt-sec__lead { color: var(--text-dim); font-size: 1.02rem; line-height: 1.7; }
.tt-sec p { line-height: 1.75; }
.tt-sec a:not(.btn) { color: var(--accent); text-underline-offset: 3px; }

/* numbered steps */
.tt-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.tt-steps li { counter-increment: step; position: relative; padding: 52px 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.tt-steps li::before { content: counter(step); position: absolute; top: 18px; left: 20px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--accent), #9d7bff); }
.tt-steps h3, .tt-cards h3 { font-family: "Sora", sans-serif; font-size: 1.02rem; margin-bottom: 6px; }
.tt-steps p, .tt-cards p { color: var(--text-dim); font-size: .92rem; line-height: 1.6; }

/* cards (tips) */
.tt-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tt-cards article { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color .2s var(--ease), transform .2s var(--ease); }
.tt-cards article:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-3px); }
.tt-cards__ico { font-size: 1.6rem; display: block; margin-bottom: 10px; }

/* two-column text + formula */
.tt-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: start; }
.tt-split > div > p + p { margin-top: 12px; }
.tt-formula { padding: 24px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
.tt-formula__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: .94rem; }
.tt-formula__row:last-child { border-bottom: 0; }
.tt-formula__row span { color: var(--text-dim); }
.tt-formula__row b { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-weight: 500; text-align: right; }
.tt-formula__ex { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: .88rem; line-height: 1.55; }

/* benchmark table */
.tt-bench { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.tt-bench table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .93rem; }
.tt-bench th { text-align: left; padding: 14px 18px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); background: var(--bg); border-bottom: 1px solid var(--border); }
.tt-bench td { padding: 14px 18px; border-bottom: 1px solid var(--border); line-height: 1.5; }
.tt-bench tr:last-child td { border-bottom: 0; }
.tt-bench td:first-child { font-family: "Sora", sans-serif; font-weight: 700; white-space: nowrap; }
.tt-level { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--bg); border: 1px solid var(--border); }
.tt-level--1 { color: #9aa4b2; } .tt-level--2 { color: #6fb6ff; } .tt-level--3 { color: #35d07f; } .tt-level--4 { color: #ffd65c; } .tt-level--5 { color: #ff9f5a; } .tt-level--6 { color: #ff6b9a; }
.tt-footnote { margin-top: 10px; font-size: .82rem; color: var(--text-dim); }

/* test comparison */
.tt-compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tt-compare article { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.tt-compare article.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 40px -22px var(--accent-glow); }
.tt-compare h3 { font-family: "Sora", sans-serif; font-size: 1.1rem; }
.tt-compare ul { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: .9rem; line-height: 1.6; display: grid; gap: 4px; flex: 1; }
.tt-compare .btn { justify-content: center; margin-top: 6px; }
.tt-tag { align-self: flex-start; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }

/* rules list */
.tt-rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; list-style: none; margin: 0; padding: 0; }
.tt-rules li { display: flex; gap: 12px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: .93rem; line-height: 1.55; }
.tt-rules li::before { content: "✓"; flex: 0 0 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); font-weight: 800; font-size: .8rem; }

/* FAQ (no JavaScript) */
.tt-faq { display: grid; gap: 10px; max-width: 860px; }
.tt-faq details { border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: border-color .2s var(--ease); }
.tt-faq details[open] { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.tt-faq summary { list-style: none; cursor: pointer; padding: 18px 54px 18px 20px; font-weight: 600; position: relative; }
.tt-faq summary::-webkit-details-marker { display: none; }
.tt-faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); color: var(--accent); font-weight: 700; transition: transform .2s var(--ease); }
.tt-faq details[open] summary::after { content: "–"; }
.tt-faq details > div { padding: 0 20px 18px; color: var(--text-dim); line-height: 1.7; font-size: .95rem; }

/* closing call to action */
.tt-cta { text-align: center; padding: 44px 24px; border-radius: 24px; background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%), var(--surface); border: 1px solid var(--border); }
.tt-cta h2 { font-family: "Sora", sans-serif; font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 8px; }
.tt-cta p { color: var(--text-dim); margin-bottom: 20px; }

@media (max-width: 980px) {
  .tt-steps { grid-template-columns: repeat(2, 1fr); }
  .tt-cards, .tt-compare { grid-template-columns: 1fr 1fr; }
  .tt-split { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .tt-info { gap: 52px; padding: 20px 16px 0; }
  .tt-steps, .tt-cards, .tt-compare, .tt-rules { grid-template-columns: 1fr; }
}

/* "Start typing now" buttons land just below the sticky menu */
#tt-start { scroll-margin-top: 90px; }
