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

:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --accent: #111111;
  --good: #059669;
  --bad: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Code Pro", "JetBrains Mono", "SFMono-Regular", monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 24px;
  gap: 16px;
}

.page {
  width: min(900px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 40px 0 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tab.primary {
  padding: 10px 18px;
}

.tab.compact {
  padding: 8px 12px;
  font-size: 13px;
}

.section-bar {
  display: inline-flex;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  align-self: center;
  margin-bottom: 8px;
}

.section-bar .tab {
  border-radius: 10px;
}

.mode-tabs {
  display: inline-flex;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.tab {
  border: none;
  background: transparent;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: background 120ms ease, color 120ms ease;
}

.tab.active {
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
}

.modebar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chip-row {
  display: inline-flex;
  gap: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.chip:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.chip.active {
  color: var(--text);
  font-weight: 600;
  border-color: #111;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  display: inline-block;
}

.title {
  font-size: 20px;
}

.font-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.label {
  color: var(--muted);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.pill:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.pill:active {
  transform: translateY(0);
  box-shadow: none;
}

.hint {
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 12px;
}

.canvas {
  padding: 28px 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  min-height: 180px;
  box-shadow: var(--shadow);
}

.prompt {
  margin: 0;
  font-size: 26px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
}

.char {
  position: relative;
  transition: color 80ms ease;
}

.char.correct {
  color: var(--muted);
}

.char.wrong {
  color: var(--bad);
}

.char.current::after {
  content: "";
  position: absolute;
  left: -1px;
  bottom: -2px;
  width: 2px;
  height: 1.3em;
  background: var(--text);
  animation: pulse 900ms infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.input-label {
  font-size: 14px;
  color: var(--muted);
}

.input {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.help {
  color: var(--muted);
  font-size: 13px;
}

.about {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.about h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.about p {
  margin: 0 0 10px;
  font-size: 16px;
}

.hidden {
  display: none;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
}

.stat-value.muted {
  font-weight: 500;
  color: var(--muted);
}

.pill.secondary {
  justify-self: end;
  background: #f8fafc;
}

.about-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.about-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.about-content h2 {
  margin-bottom: 20px;
}

.about-content p {
  margin: 12px 0;
}

.links {
  display: flex;
  gap: 16px;
}

.social-link {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.social-link:hover {
  border-color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.social-link:active {
  transform: translateY(0);
  box-shadow: none;
}

@media (max-width: 640px) {
  .page {
    gap: 22px;
    padding: 30px 0 60px;
  }

  .prompt {
    font-size: 18px;
  }
}
