:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #707070;
  --faint: #c8c8c8;
  --line: #e6e6e6;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}
header { margin-bottom: 40px; }
.brand {
  font-size: 17px;
  letter-spacing: 0.02em;
  margin: 0 0 40px;
}
h1 {
  font-weight: 400;
  font-size: clamp(40px, 9vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.rules { color: var(--muted); margin: 0; max-width: 34em; }
.day { color: var(--muted); font-size: 16px; margin: 0 0 12px; }

/* The list */
ol.todo { list-style: none; padding: 0; margin: 0 0 32px; border-top: 1px solid var(--ink); }
ol.todo li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--ink);
  margin-top: 5px;
  position: relative;
}
li.hidden .box { border-color: var(--faint); }
li.hidden .text { color: var(--faint); }
.tick .box::after {
  content: "";
  position: absolute;
  left: 4px; top: 0px;
  width: 6px; height: 11px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
li.new .text { animation: appear 500ms ease-out; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* Guess input */
.guess-row { display: flex; gap: 10px; }
input[type="text"], input[type="email"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 12px 14px;
  -webkit-appearance: none;
}
input::placeholder { color: var(--muted); }
button {
  font: inherit;
  font-size: 18px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 12px 20px;
  cursor: pointer;
}
button.plain { background: var(--bg); color: var(--ink); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.msg { min-height: 1.6em; margin: 10px 0 0; color: var(--muted); font-size: 16px; }

ul.tries { list-style: none; padding: 0; margin: 20px 0 0; }
ul.tries li { font-size: 17px; padding: 4px 0; }
ul.tries .hint { color: var(--muted); font-style: italic; }

/* Result */
.result { margin-top: 8px; }
.result h2 { font-weight: 400; font-size: 32px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.01em; }
.result p { margin: 0 0 20px; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.next { color: var(--muted); font-size: 16px; }

/* Invite */
html, body { height: 100%; }
.invite-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.invite-page.show { animation: appear 700ms ease-out; }
.invite-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px 0; }
.invite-page h2 { font-weight: 400; font-size: clamp(32px, 7vw, 44px); line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 10px; }
.invite-page .sub { margin: 0 0 32px; font-style: italic; font-size: 21px; }
.score { color: var(--muted); font-size: 16px; margin: 0 0 20px; }
@media (prefers-reduced-motion: reduce) { .invite-page.show { animation: none; } }
footer { margin-top: 64px; color: var(--muted); font-size: 15px; }

[hidden] { display: none !important; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
@media (prefers-reduced-motion: reduce) { li.new .text { animation: none; } }
@media (max-width: 420px) {
  main { padding-top: 36px; }
  .guess-row { flex-direction: column; }
  button { width: 100%; }
  .actions button { width: auto; }
}
