@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --grey: #6b6b6b;
  --grey-2: #a3a3a3;
  --rule: #e5e5e5;
  --paper: #fff;
  --accent: #ff4f00;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding:
    max(env(safe-area-inset-top), 12px)
    max(env(safe-area-inset-right), var(--gutter))
    max(env(safe-area-inset-bottom), 16px)
    max(env(safe-area-inset-left), var(--gutter));
  display: flex;
  flex-direction: column;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}

/* Header ------------------------------------------------------------- */
.top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--ink);
}
.brand {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(52px, auto));
}
.stat {
  padding: 0 10px 0 12px;
  border-left: 1px solid var(--rule);
}
.stat:last-child { padding-right: 0; }
.stat dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}
.stat dd {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.stat dd.hot { color: var(--accent); }

/* Tense chips -------------------------------------------------------- */
.tenses {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.chips {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--grey);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.chip[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* Prompt card -------------------------------------------------------- */
.card {
  padding: 16px 0 8px;
  flex: 1;
}
.row-label { display: flex; justify-content: space-between; }
.box { color: var(--grey-2); }
.prompt {
  margin: 10px 0 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.prompt .sep { color: var(--grey-2); font-weight: 400; margin: 0 0.3em; }
#p-tense { font-weight: 400; }
.gloss {
  margin: 4px 0 16px;
  color: var(--grey);
  font-size: 15px;
}

.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--ink);
  border-radius: 2px;
}
.answer {
  min-width: 0;
  height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 19px; /* >= 16px: no iOS zoom on focus */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.answer::placeholder { color: var(--grey-2); }
.go {
  min-width: 84px;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.entry:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.card.is-right .entry { border-color: var(--ink); }
.card.is-wrong .entry { border-color: var(--accent); }
.card.is-wrong .entry:focus-within { outline-color: var(--accent); }
.card.is-wrong .go { background: var(--accent); border-left-color: var(--accent); }

.accents {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  margin-top: 8px;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.accent-key {
  height: 44px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper);
  font-size: 18px;
  user-select: none;
  -webkit-user-select: none;
}
.accent-key:active { background: var(--ink); color: var(--paper); }

/* Result ------------------------------------------------------------- */
.result {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
}
.verdict {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.verdict.wrong { color: var(--accent); }
.solution {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hint {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--grey);
}
.table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
}
.table caption { text-align: left; padding-bottom: 6px; }
.table tr { border-top: 1px solid var(--rule); }
.table tr:last-child { border-bottom: 1px solid var(--rule); }
.table th, .table td { padding: 7px 0; text-align: left; vertical-align: baseline; }
.table th {
  width: 84px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--grey);
}
.table td { font-size: 16px; }
.table tr.current td { font-weight: 600; }
.table tr.current th { color: var(--ink); }

/* Footer ------------------------------------------------------------- */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  margin-top: 16px;
  border-top: 1px solid var(--rule);
}
.link {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--grey);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 720px) {
  .wrap { padding-top: 48px; }
  .brand { font-size: 34px; }
  .stat dd { font-size: 34px; }
  .prompt { font-size: 32px; }
  .stat { padding-left: 16px; }
}

@media (max-width: 360px) {
  .brand { font-size: 22px; }
  .stat dd { font-size: 22px; }
  .stat { padding-left: 8px; }
  .stats { grid-template-columns: repeat(3, minmax(44px, auto)); }
}
