/* Whose book this is, and what to tell a grown-up about it.
 *
 * Two screens that are not for the same person, and they should not look
 * the same. The name card is loud and round and asks one question in
 * letters a seven-year-old can read across a room. The report is quiet,
 * close-set and typographic — it is the only part of this site addressed
 * to an adult, and dressing it up in comic lettering would make it look
 * like a reward chart rather than something to be read and acted on.
 */

/* --- who is reading ------------------------------------------------------ */

.who-ask {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(11, 11, 14, .72);
}
.who-card {
  width: min(100%, 420px);
  padding: 24px 22px 18px;
  text-align: center;
  background: var(--sc-paper, #fdf6e3);
  border: 5px solid var(--sc-ink, #0b0b0e);
  border-radius: 22px;
  box-shadow: 0 12px 0 rgba(0,0,0,.4);
}
.who-card h2 {
  margin: 0 0 16px;
  font-family: var(--font-display, sans-serif);
  font-size: clamp(28px, 8vw, 38px); letter-spacing: 1px;
  color: var(--sc-ink, #0b0b0e);
}
.who-field {
  display: block; width: 100%; min-height: 62px; margin: 0 0 14px;
  padding: 8px 16px;
  border: 4px solid var(--sc-ink, #0b0b0e); border-radius: 16px;
  background: #fff; color: var(--sc-ink, #0b0b0e);
  font-family: var(--font-display, sans-serif);
  font-size: 30px; letter-spacing: 1px; text-align: center;
}
.who-field:focus-visible { outline: 4px solid var(--sc-yellow, #ffd21f); outline-offset: 3px; }
.who-go { display: block; width: 100%; }
.who-note {
  margin: 14px 0 0;
  font-family: var(--font-ui, sans-serif); font-weight: 700;
  font-size: 13px; line-height: 1.45; color: #6b7382;
}
.who-skip {
  margin: 10px 0 0; padding: 10px 14px;
  min-height: 44px;
  border: 0; background: none; cursor: pointer;
  font-family: var(--font-ui, sans-serif); font-weight: 800;
  font-size: 14px; letter-spacing: .5px; text-decoration: underline;
  color: #6b7382;
}

/* his name at the top of his own shelf */
.shelf-hello {
  display: block;
  width: min(100% - 28px, var(--page-max, 820px));
  margin: 2px auto 12px; min-height: 52px; padding: 8px 18px;
  border: 4px solid var(--sc-ink, #0b0b0e); border-radius: 16px;
  background: var(--sc-yellow, #ffd21f); color: var(--sc-ink, #0b0b0e);
  font-family: var(--font-display, sans-serif);
  font-size: clamp(22px, 6vw, 30px); letter-spacing: 1px;
  cursor: pointer; box-shadow: 0 5px 0 var(--sc-ink, #0b0b0e);
}
.shelf-hello:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sc-ink, #0b0b0e); }
.shelf-hello:focus-visible { outline: 4px solid var(--sc-orange, #ef6c00); outline-offset: 3px; }

/* and on the cover of the book itself */
.cover-hello {
  margin: 0 0 6px;
  font-family: var(--font-display, sans-serif);
  font-size: clamp(20px, 5.5vw, 28px); letter-spacing: 1px;
  color: var(--sc-orange, #ef6c00);
}

/* --- the report ---------------------------------------------------------- */

/* The way in, on the last page of a book. Small and plain on purpose: it
   is not a prize, and a child who taps it should be able to tell at a
   glance that it was not meant for them. */
.end-grown {
  display: block; width: fit-content; margin: 18px auto 0;
  min-height: 44px; padding: 12px 18px;
  border-radius: 12px;
  font-family: var(--font-ui, sans-serif); font-weight: 800;
  font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #5a6270; text-decoration: none;
}
.end-grown:hover, .end-grown:focus-visible { text-decoration: underline; }

.report {
  width: min(100% - 28px, 620px);
  margin: 6px auto 0;
  padding: 22px 22px 24px;
  background: #fff;
  border: 3px solid #d7dce4; border-radius: 16px;
  box-shadow: 0 6px 0 rgba(0,0,0,.10);
}
.report-who {
  margin: 0 0 18px; padding-bottom: 14px;
  border-bottom: 2px solid #edf0f4;
  font-family: var(--font-ui, sans-serif); font-weight: 800;
  font-size: 15px; letter-spacing: .4px; color: #39414f;
}

.report-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 6px; }
.report-tile {
  flex: 1 1 120px;
  padding: 12px 14px;
  background: #f6f8fb; border: 2px solid #e4e9f0; border-radius: 12px;
}
.report-tile strong {
  display: block;
  font-family: var(--font-display, sans-serif);
  font-size: 34px; line-height: 1; letter-spacing: 1px; color: #16324f;
}
.report-tile span {
  display: block; margin-top: 3px;
  font-family: var(--font-ui, sans-serif); font-weight: 700;
  font-size: 12px; letter-spacing: .3px; color: #6b7382;
}

.report-head {
  margin: 22px 0 6px;
  font-family: var(--font-ui, sans-serif); font-weight: 800;
  font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase;
  color: #8a94a3;
}
.report-line {
  margin: 0;
  font-family: var(--font-ui, sans-serif); font-weight: 700;
  font-size: 17px; color: #22303f;
}
.report-note {
  margin: 0 0 8px;
  font-family: var(--font-ui, sans-serif);
  font-size: 14px; line-height: 1.45; color: #6b7382;
}
.report-small {
  margin: 0 0 10px;
  font-family: var(--font-ui, sans-serif);
  font-size: 13px; line-height: 1.55; color: #6b7382;
}

.report-words { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.report-word {
  min-height: 44px; padding: 8px 14px;
  border: 2px solid #d7dce4; border-radius: 999px;
  background: #fff; color: #22303f; cursor: pointer;
  font-family: var(--font-ui, sans-serif); font-weight: 700;
  font-size: 15px; letter-spacing: .2px;
}
.report-word:active { transform: translateY(2px); }
.report-word:focus-visible { outline: 3px solid var(--sc-orange, #ef6c00); outline-offset: 2px; }
.report-words.is-owned .report-word {
  border-color: #2e8b57; background: #f0fbf3; color: #1f6b41;
}

.report-back {
  display: block; width: fit-content; margin: 24px auto 0;
  text-decoration: none; text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .shelf-hello:active, .report-word:active { transform: none; }
}

/* --- rank, and the card ---------------------------------------------------
 *
 * The chip is the only place a rank appears outside the card itself, and
 * it goes at the top of his own list of words because that is the screen
 * he opens to feel good about the list. */

.rank-chip {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: min(100% - 28px, var(--page-max, 820px));
  margin: 2px auto 10px; min-height: 56px; padding: 10px 20px;
  border: 4px solid var(--sc-ink, #0b0b0e); border-radius: 999px;
  background: #d32f2f; color: #fff; text-decoration: none;
  box-shadow: 0 5px 0 var(--sc-ink, #0b0b0e);
}
.rank-chip:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sc-ink, #0b0b0e); }
.rank-chip span {
  font-family: var(--font-display, sans-serif);
  font-size: clamp(22px, 5.5vw, 30px); letter-spacing: 2px;
}
.rank-chip b {
  font-family: var(--font-ui, sans-serif); font-weight: 800;
  font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  opacity: .9;
}

.card-screen { width: min(100% - 28px, 520px); margin: 4px auto 0; text-align: center; }
.card-canvas {
  display: block; width: 100%; height: auto;
  border-radius: 14px;
  box-shadow: 0 10px 0 rgba(0,0,0,.28);
}
.card-row {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 16px 0 0;
}
.card-row .big-btn { flex: 1 1 220px; }
.card-alt {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.card-say {
  margin: 14px 0 0;
  font-family: var(--font-balloon, sans-serif); font-size: 17px; line-height: 1.4;
  color: var(--ui-fg, #14181f);
}
.card-note {
  margin: 8px 0 0;
  font-family: var(--font-ui, sans-serif); font-size: 13px; line-height: 1.5;
  color: #6b7382;
}

/* LOCKED IN, on the shelf of words */
.vault li.is-locked { background: #fffbea; border-color: #d4a017; }
.vault li.is-locked .vault-tag { border-color: #d4a017; background: #d4a017; color: #241c00; }
.vault-tally b {
  font-family: var(--font-display, sans-serif); font-size: 30px;
  letter-spacing: 1px; color: #d4a017; vertical-align: -2px; margin-right: 4px;
}

@media (prefers-reduced-motion: reduce) { .rank-chip:active { transform: none; } }

/* --- the reading log, and getting it onto paper -------------------------- */

.report-log { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; }
.report-day {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: #2e8b57; color: #fff;
  font-family: var(--font-ui, sans-serif); font-weight: 800; font-size: 13px;
}
.report-words.is-locked .report-word {
  border-color: #d4a017; background: #fffbea; color: #6b5200;
}
.report-sign {
  margin: 26px 0 0; padding-top: 26px;
  border-top: 2px solid #edf0f4;
  font-family: var(--font-ui, sans-serif); font-weight: 700;
  font-size: 13px; color: #8a94a3;
}
.report-sign::after {
  content: ''; display: block; margin-top: 22px;
  border-bottom: 1px solid #b9c1cc;
}
.report-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.report-acts .big-btn { flex: 0 1 auto; margin: 0; }

/* On paper the sheet IS the page: no app around it, no buttons, nothing
   in colour that costs ink for no reason. A school reading log has to
   come out of a home printer looking like a form, not like a screenshot. */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .kid-top, .kid-bar, #dots, .word-card, .report-acts, .who-ask,
  .end-grown, .rank-chip { display: none !important; }
  .report {
    width: auto; margin: 0; padding: 0;
    border: 0; box-shadow: none; border-radius: 0;
  }
  .report-tile { border: 1px solid #999; background: #fff; }
  .report-tile strong { color: #000; }
  .report-day { background: #fff; color: #000; border: 1px solid #666; }
  .report-word { border-color: #999 !important; background: #fff !important; color: #000 !important; }
  .report-who { font-size: 13pt; }
  .report-sign::after { border-bottom: 1px solid #000; }
}

/* TODAY: the strip that changes overnight */
.today-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: min(100% - 28px, var(--page-max, 820px));
  margin: 0 auto 12px; min-height: 56px; padding: 10px 20px;
  border: 4px solid var(--sc-ink, #0b0b0e); border-radius: 16px;
  background: var(--sc-orange, #ef6c00); color: #fff; text-decoration: none;
  box-shadow: 0 5px 0 var(--sc-ink, #0b0b0e);
}
.today-strip:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sc-ink, #0b0b0e); }
.today-strip b {
  font-family: var(--font-display, sans-serif);
  font-size: clamp(19px, 4.8vw, 26px); letter-spacing: 1px;
}
.today-streak {
  flex: 0 0 auto;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(0,0,0,.28);
  font-family: var(--font-ui, sans-serif); font-weight: 800; font-size: 14px;
}
@media (prefers-reduced-motion: reduce) { .today-strip:active { transform: none; } }
