:root {
  --bg: #14161a;
  --fg: #f2f4f7;
  --muted: #98a2b3;
  --accent: #4c9aff;
  --surface: #1e222a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, sans-serif;
  padding: env(safe-area-inset-top) 1rem env(safe-area-inset-bottom);
}

.screen {
  max-width: 30rem;
  margin: 0 auto;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.screen[hidden] { display: none; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack[hidden] { display: none; }

.placeholder {
  margin: 2rem 0;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border-radius: 0.75rem;
  font-size: 1.25rem;
}

h1, h2 { margin: 0; font-size: 1.5rem; }

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
}

select, button, output, input {
  font: inherit;
  color: inherit;
}

select {
  background: transparent;
  border: 0;
  text-align: end;
  min-width: 8rem;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stepper button {
  min-width: 2.4rem;
  height: 2.6rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--accent);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stepper button:active {
  background: rgba(76, 154, 255, 0.18);
}

.stepper output {
  min-width: 3.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
}

button {
  background: var(--surface);
  border: 0;
  border-radius: 0.75rem;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #06111f;
  font-weight: 600;
  font-size: 1.125rem;
}

.row { display: flex; gap: 0.75rem; }
.row button { flex: 1; }

.note { color: var(--muted); margin: 0; text-align: center; }
.note[hidden] { display: none; }

.word {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 34dvh;
  font-size: clamp(2.5rem, 14vw, 6rem);
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.countdown {
  text-align: center;
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 0.75rem;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}

#bar-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
}

.recap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recap li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  padding: 0.55rem 0.85rem;
  border-radius: 0.6rem;
  font-size: 1.15rem;
}

.recap .n {
  flex: none;
  min-width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.4rem;
  background: var(--accent);
  color: #06111f;
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
