html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #fff;
  overscroll-behavior: none;
}
body {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
[hidden] { display: none !important; }

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

/* Digit and the caption under him (hint, button or thinking phrase). */
#digit {
  height: min(58vh, 460px);
  aspect-ratio: 2 / 3;
  max-width: 92vw;
}
.caption {
  height: 9.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.hint {
  margin: 1rem 0 0;
  font-size: 1.2rem;
  color: #ffd78a;
  animation: breathe 2.4s ease-in-out infinite;
  transition: opacity 0.4s;
}
.hint.gone { opacity: 0; animation: none; }
@keyframes breathe { 50% { opacity: 0.35; } }

.ask {
  font-family: inherit;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #5856d6;
  border: 0;
  border-radius: 999px;
  padding: 0.55em 1.1em;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.4s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ask.show { opacity: 1; transform: none; }
.ask:active { filter: brightness(1.15); }

.phrase {
  margin: 0.4rem 0 0;
  max-width: 22rem;
  padding: 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

/* The answer: an old green-screen terminal. */
.console {
  align-items: stretch;
  justify-content: flex-start;
  padding: 18vh 1.6rem 0;
}
.console pre {
  margin: 0;
  font: 500 1.35rem/1.45 ui-monospace, Menlo, Consolas, monospace;
  color: #33ff66;
  text-shadow: 0 0 6px rgba(51, 255, 102, 0.8);
  white-space: pre-wrap;
}
.console::after { /* CRT scanlines */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px);
}
#cursor.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

#clock {
  width: 72px;
  height: 72px;
  margin: 2.5rem auto 0;
  opacity: 0;
  transition: opacity 0.4s;
  filter: drop-shadow(0 0 6px rgba(51, 255, 102, 0.6));
}
#clock.show { opacity: 1; }
#clock circle { fill: none; stroke-width: 5; }
#clock .track { stroke: rgba(51, 255, 102, 0.25); }
#clock .ring { stroke: #33ff66; stroke-linecap: round; }
#clock text {
  fill: #33ff66;
  font: 600 26px ui-monospace, Menlo, Consolas, monospace;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* P = NP. Just the words. */
.panic p {
  margin: 0;
  font: 700 3rem/1.15 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
}

.noscript { text-align: center; margin-top: 40vh; color: #ffd78a; }

/* Debug panel (only when DEBUG is true in app.js). */
.debug {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
  margin: 0;
  padding: 8px 10px;
  font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace;
  color: #b8ffcc;
  background: rgba(0, 20, 0, 0.85);
  border: 1px solid #33ff66;
  border-radius: 8px;
  white-space: pre-wrap;
  -webkit-user-select: text;
  user-select: text;
  pointer-events: auto;
}
