/*
  Тёмный экран, один шрифт, много пустого места.
  Единственное, что здесь движется, — курсор в поле ввода.
*/

:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --text: #cfcfcf;
  --dim: #7a7a7a;
  --faint: #4a4a4a;
  --line: #363636;
  --font: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "SF Mono", Menlo,
          "DejaVu Sans Mono", "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
}

main {
  width: 100%;
  max-width: 34rem;
  text-align: center;
}

p { margin: 0 0 1em; text-wrap: balance; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 0.25em;
}
a:hover { text-decoration-color: currentColor; }

a:focus-visible,
button:focus-visible {
  outline: 1px dotted var(--dim);
  outline-offset: 4px;
}

::selection { background: var(--text); color: var(--bg); }

.quiet { color: var(--dim); }

/* Одна строка в центре: шифровка, код, числа */
.line {
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}


/* Уровень */

.riddle { margin-bottom: 3rem; }
.riddle > :last-child { margin-bottom: 0; }

figure { margin: 0; }
figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
figcaption { margin-top: 0.75rem; font-size: 0.85rem; color: var(--dim); }

#answer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
}

#answer input {
  width: 16rem;
  max-width: 100%;
  padding: 0.3rem 0.1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  caret-color: var(--text);
  outline: none;
}
#answer input:focus { border-bottom-color: #5a5a5a; }
#answer input:disabled { opacity: 0.4; }

button {
  padding: 0.3rem 0.1rem;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
}
button:hover { color: var(--text); }

#reply {
  min-height: 1.65em;
  margin: 1.5rem 0 0;
  color: var(--dim);
}

#hints {
  font-size: 0.85rem;
  color: var(--dim);
}
.hint { margin: 0.75rem 0 0; }
.hint:empty { display: none; }
.hint button { font-size: inherit; color: var(--dim); }
.hint button:hover { color: var(--text); }

.back { margin: 2.5rem 0 0; font-size: 0.85rem; }
.back a { color: var(--faint); text-decoration: none; }
.back a:hover { color: var(--dim); }

#corner {
  position: fixed;
  right: 1rem;
  bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--faint);
  text-decoration: none;
}
a#corner:hover { color: var(--dim); }

/* С какого-то уровня без клавиатуры не обойтись */
#keyboard { display: none; color: var(--dim); }
@media (hover: none) and (pointer: coarse) {
  [data-keyboard] main { display: none; }
  [data-keyboard] #keyboard { display: block; }
}


/* Интерлюдии и финал */

.shard {
  margin: 2.5rem 0;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
}
.next { margin-top: 3rem; }
#time:empty { display: none; }


/* Путь */

#path {
  display: inline-block;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
#path li { margin: 0.4rem 0; }
#path .n {
  display: inline-block;
  min-width: 2.5em;
  margin-right: 1em;
  color: var(--faint);
  text-align: right;
}
