:root {
  --bg: #0b0b0d;
  --card: #15161a;
  --card-hi: #1d1f24;
  --ink: #f6f4ef;
  --soft: rgba(246, 244, 239, 0.52);
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff8a5c;
  --right: #58d6a0;
  --wrong: #ff5d6c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 16px;
}

.fill {
  position: relative;
  width: min(372px, 100%);
  padding: 18px 18px 16px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px var(--line),
    0 34px 70px -34px color-mix(in srgb, var(--accent) 40%, transparent);
}
.fill__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fill__topic { font-size: 12.5px; font-weight: 540; color: var(--soft); }
.fill__dashes { display: flex; gap: 4px; }
.fill__dashes i { display: block; width: 16px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); overflow: hidden; position: relative; }
.fill__dashes i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform: scaleX(var(--f, 0)); transform-origin: 0 50%; }
.fill__dashes i.is-full::after { transform: scaleX(1); }

/* the sentence: big, with two gaps that are as wide as a short word until a word arrives */
.sent { min-height: 84px; margin: 16px 0 6px; font-size: clamp(22px, 6.6vw, 27px); line-height: 42px; font-weight: 520; font-stretch: 104%; letter-spacing: -0.012em; }
.word { display: inline-block; margin-right: 0.26em; }
.gap { position: relative; display: inline-block; vertical-align: top; height: 42px; margin-right: 0.26em; white-space: nowrap; }
.gap__in { display: inline-block; opacity: 0; font-weight: 520; }
.gap__line { position: absolute; left: 0; right: 0; bottom: 5px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); transition: background-color 0.3s ease; }
.gap.is-next .gap__line { background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.gap.is-right .gap__in { color: var(--right); }
.gap.is-right .gap__line { background: color-mix(in srgb, var(--right) 55%, transparent); }
.gap.is-wrong .gap__in { color: var(--wrong); }
.gap.is-wrong .gap__line { background: var(--wrong); }

.tr { height: 38px; overflow: hidden; margin-bottom: 14px; font-size: 13.5px; line-height: 19px; font-weight: 460; color: var(--soft); }
.tr span { display: block; }

.bank { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.chip { position: relative; height: 40px; padding: 0 15px; border: 0; border-radius: 13px; background: linear-gradient(180deg, #2b2d33, #212329); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 6px 14px -8px rgba(0, 0, 0, 0.9); color: var(--ink); font: inherit; font-size: 15.5px; font-weight: 560; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.chip span { display: block; transition: opacity 0.25s ease; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* a word that left the bank leaves its seat behind */
.chip.is-out { background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); cursor: default; }
.chip.is-out span { opacity: 0; }

.fly { position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none; white-space: nowrap; font-size: 15.5px; line-height: 40px; font-weight: 560; font-stretch: 104%; color: var(--ink); transform-origin: 0 50%; will-change: transform; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #14151a;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (hover: hover) {
  .chip:not(.is-out):hover { background: linear-gradient(180deg, #34363d, #27292f); }
}
@media (max-width: 360px) {
  .fill { padding: 15px 14px 14px; }
  .sent { line-height: 38px; min-height: 76px; margin-top: 12px; }
  .gap { height: 38px; }
  .chip { height: 38px; padding: 0 13px; }
  .fly { line-height: 38px; }
}
@media (min-width: 700px) and (min-height: 500px) {
  .fill { zoom: 1.3; }
}
@media (min-width: 1100px) and (min-height: 760px) {
  .fill { zoom: 1.7; }
}
