/* The Tool Bakery - Typing Practice (Educational Light, High Contrast) */

:root{
  --bg:#f7f9fc;
  --card:#ffffff;
  --ink:#0b1220;         /* very dark text */
  --muted:#475569;       /* slate-600 */
  --line:#e2e8f0;        /* slate-200 */
  --accent:#111827;      /* dark buttons */
  --accent-ink:#ffffff;
  --ok:#059669;          /* green-600 */
  --err:#dc2626;         /* red-600 */
  --focus:#2563eb;       /* blue-600 */
  --hint:#64748b;        /* slate-500 */
  --cur:#fde68a;         /* amber-200 */
}

.ttb-typing-container{
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
  color: var(--ink);
  background-color: #f1f1f1;
  padding: 20px;
  border-radius: 15px;
}

.ttb-title{
  font-size: 28px; line-height: 1.2; font-weight: 800; margin: 6px 0 18px 0;
}

.ttb-card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 2px 6px rgba(2,6,23,.03);
}

.ttb-label{ display:block; font-weight:600; margin-bottom:6px; }
.ttb-input{
  width: 100%; border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:14px; background:#fff; color:var(--ink);
}
.ttb-input:focus{ outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.ttb-row{ display:flex; gap:16px; flex-wrap:wrap; align-items:flex-end; }
.ttb-row > div{ flex:1 1 260px; }

.ttb-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.ttb-btn{
  background:#fff; color:var(--accent);
  border:1px solid var(--accent);
  border-radius:10px; padding:10px 14px; font-weight:700; font-size:14px; cursor:pointer;
}
.ttb-btn:hover{ background:var(--accent); color:#fff; }
.ttb-btn-dark{ background:var(--accent); color:var(--accent-ink); }
.ttb-btn-dark:hover{ background:#000; }
.ttb-btn-ghost{ background:transparent; color:var(--ink); border-color:var(--muted); }
.ttb-btn-small{ padding:6px 10px; font-size:12px; }

.ttb-stats{
  display:grid; grid-template-columns: repeat(4, minmax(140px,1fr)); gap:10px; margin-top:12px;
}
@media (max-width:680px){ .ttb-stats{ grid-template-columns: repeat(2, 1fr);} }

.ttb-stat{
  border:1px solid var(--line); border-radius:10px; padding:10px; background:#fff;
}
.ttb-stat-label{ font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.ttb-stat-value{ font-size:22px; font-weight:800; margin-top:2px; }

.ttb-typing-area{ position:relative; }
.ttb-paragraph{
  border:2px solid var(--line);
  border-radius:14px;
  background:#fff;
  padding:18px 20px;
  min-height: 220px;
  line-height: 1.7;
  font-size: 20px;  /* large typing text */
  letter-spacing: .2px;
  color: var(--ink);
}
.ttb-paragraph .ok{ color: var(--ok); }
.ttb-paragraph .err{ color: var(--err); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ttb-paragraph .cur{ background: var(--cur); border-radius: 4px; }
.ttb-paragraph .rest{ color: var(--ink); opacity: .85; }

.ttb-hidden-input{
  position: absolute; left:-9999px; width:1px; height:1px; opacity:0;
}

.ttb-help-row{
  display:flex; justify-content:space-between; align-items:center; margin-top:10px;
}
.ttb-help{ font-size:13px; color:var(--hint); }

.ttb-countdown{
  position:absolute; inset:0; display:none; align-items:center; justify-content:center;
  background: rgba(255,255,255,.88); border-radius:14px; border: 1px solid var(--line);
}
.ttb-count-bubble{
  width: 140px; height:140px; border-radius: 100%;
  display:flex; align-items:center; justify-content:center;
  background:#fff; color:var(--ink); border: 4px solid var(--accent);
  font-size: 64px; font-weight: 900; animation: pop .8s ease both;
}
@keyframes pop{
  0%{ transform: scale(.7); opacity: .2; }
  60%{ transform: scale(1.1); opacity: 1; }
  100%{ transform: scale(1); }
}

.ttb-subtitle{ font-size:20px; font-weight:700; margin: 0 0 10px; }
.ttb-results-grid{ display:grid; grid-template-columns: repeat(4, minmax(140px,1fr)); gap:10px; }
@media (max-width:680px){ .ttb-results-grid{ grid-template-columns: repeat(2, 1fr);} }
.ttb-result{ border:1px solid var(--line); border-radius:10px; padding:10px; background:#fff; }
.ttb-result-label{ font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.ttb-result-value{ font-size:22px; font-weight:800; margin-top:2px; }

.ttb-history-head{ display:flex; align-items:center; justify-content:space-between; }
.ttb-history-chart-wrap{
  border:1px solid var(--line); border-radius:12px; background:#fff; padding:8px; overflow:auto;
}
#ttb-history-chart{ width:100%; height:auto; min-width: 480px; }
.ttb-history-list{ margin-top:10px; font-size:14px; color:var(--muted); }
.ttb-history-list .row{ display:flex; gap:12px; }
.ttb-history-list .row > div{ width:120px; }

.ttb-sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
