:root {
  --ground: #111112;
  --fg: #d6dbe3;
  --dim: #5c6470;
  --dimmer: #2f3641;
  --pink: #ff8fb1;
  --pink-deep: #c9587f;
  --green: #3ddc84;
  --amber: #ffb000;
  --cyan: #6cb6ff;
  --mono: "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 2rem 1rem 3rem;
}
#balloon {
  margin: 0;
  font: inherit;
  font-size: 15px;
  line-height: 1.2;
  color: var(--pink);
  white-space: pre;
  animation: float 6s ease-in-out infinite;
  will-change: transform;
}
#balloon .string { color: var(--dim); }
#balloon .hi { color: #ffd1e0; }
@keyframes float {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-9px); }
  100% { transform: translateY(0px); }
}
#tagline { text-align: center; }
#tagline .l1 { color: var(--fg); }
#tagline .l2 .word { color: var(--pink); font-weight: 700; }
#tagline .l2 .ipa { color: var(--dim); }
#tagline .l3 { color: var(--dim); margin-top: 0.35rem; }
#gate {
  max-width: 100%;   /* a wide hint line wraps instead of widening the page on phones */
  display: grid;
  grid-template-columns: max-content 1fr; /* the label keeps its width when a wide #msg spans both columns */
  align-items: baseline;
  column-gap: 0.6ch;
  margin-top: 0.4rem;
}
#gate label { color: var(--green); }
#gate .field { position: relative; display: inline-flex; align-items: baseline; }
#pass {
  width: 18ch;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--dimmer);
  outline: 0;
  padding: 0 0 0.1rem;
  color: var(--fg);
  font: inherit;
  letter-spacing: 0.15em;
  caret-color: var(--pink);
}
#pass:focus { border-bottom-color: var(--pink-deep); }
.cursor {
  position: absolute; left: 0; bottom: 0.35em;
  width: 0.6ch; height: 1.1em;
  background: var(--pink);
  animation: blink 1.1s steps(1) infinite;
  pointer-events: none;
}
body.focused .cursor { opacity: 0.35; }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
body.focused .cursor { animation: none; opacity: 0.25; }
#msg { grid-column: 1 / -1; min-width: 0; min-height: 1.5em; margin-top: 0.4rem; color: var(--dim); white-space: pre-wrap; overflow-wrap: anywhere; }
#msg.err { color: var(--amber); }
#msg.ok { color: var(--green); }
#msg.dim { color: var(--dim); }
#msg .hint { color: var(--dim); }
body.granted #balloon { animation: rise 0.9s ease-in forwards; }
@keyframes rise { to { transform: translateY(-120vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #balloon { animation: none; }
  .cursor { animation: none; }
  body.granted #balloon { animation: none; }
}
@media (max-width: 480px) {
  #balloon { font-size: 12px; }
  body { font-size: 15px; }
}
