/* review.css — spellinglist.sg "check what we read" screen
   Direction: a marked-up worksheet. Ruled baselines echo the printed answer
   lines on the real sheet; uncertain entries get a proofreader's squiggle,
   which every parent already reads as "look here" from word processors. */

.sr {
  --ink:      #16233d;
  --ink-soft: #5b6b86;
  --paper:    #fbfaf6;
  --card:     #ffffff;
  --rule:     #cfd8e6;
  --accent:   #1d4ed8;
  --flag:     #c2410c;
  --block:    #b91c1c;
  --ok:       #15803d;

  --pad: 16px;
  --radius: 14px;

  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

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

/* ---------- header ---------- */

.sr-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--pad);
  background: rgba(251, 250, 246, .95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.sr-thumb {
  width: 46px; height: 46px; flex: none;
  border-radius: 8px; object-fit: cover;
  border: 2px solid var(--card);
  box-shadow: 0 1px 6px rgba(22,35,61,.22);
  cursor: zoom-in;
}
.sr-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.sr-head p  { margin: 2px 0 0; font-size: .78rem; color: var(--ink-soft); }

/* ---------- warning strip ---------- */

.sr-strip {
  margin: 0; padding: 11px var(--pad);
  font-size: .84rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.sr-strip[data-tone="block"] { background: #fef2f2; color: var(--block); }
.sr-strip[data-tone="check"] { background: #fff7ed; color: var(--flag); }
.sr-strip[data-tone="ok"]    { background: #f0fdf4; color: var(--ok); }
.sr-strip[hidden] { display: none; }

/* ---------- sections ---------- */

.sr-body { padding: var(--pad); padding-bottom: 108px; }

.sr-eyebrow {
  font-size: .68rem; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-soft);
  margin: 22px 0 8px;
}
.sr-eyebrow:first-child { margin-top: 4px; }

.sr-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px;
}

/* ---------- fields ---------- */

.sr-field { margin-bottom: 12px; }
.sr-field:last-child { margin-bottom: 0; }
.sr-field > label {
  display: block; font-size: .74rem; font-weight: 700;
  color: var(--ink-soft); margin-bottom: 5px;
}
.sr-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sr input[type="text"],
.sr input[type="date"],
.sr select {
  width: 100%; font: inherit; font-size: .95rem;
  padding: 10px 11px; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 9px;
  appearance: none;
}
.sr select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6b86' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 11px;
  padding-right: 32px;
}
.sr input:focus, .sr select:focus, .sr button:focus-visible {
  outline: 3px solid rgba(29,78,216,.28);
  outline-offset: 1px;
  border-color: var(--accent);
}
.sr [data-flagged="true"] { border-color: var(--flag); background: #fffbf7; }
.sr [data-flagged="block"] { border-color: var(--block); background: #fffafa; }

.sr-note { font-size: .7rem; color: var(--ink-soft); margin: 5px 0 0; line-height: 1.45; }
.sr select:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }

.sr-hint { font-size: .72rem; color: var(--flag); margin: 4px 0 0; font-weight: 600; }

/* ---------- week card ---------- */

.sr-week {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.sr-week-head { padding: 14px; border-bottom: 1px dashed var(--rule); }
.sr-week-tag {
  display: inline-block; font-size: .66rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: #eef2ff;
  padding: 3px 9px; border-radius: 99px; margin-bottom: 9px;
}
.sr-raw {
  font-size: .72rem; color: var(--ink-soft); margin: 5px 0 0;
}
.sr-raw b { color: var(--ink); font-weight: 600; }

/* ---------- word rows: the signature ---------- */

.sr-words { list-style: none; margin: 0; padding: 4px 14px 0; }

.sr-word {
  display: grid;
  grid-template-columns: 26px 1fr 30px;
  align-items: start;
  gap: 8px;
  padding: 9px 0 7px;
  border-bottom: 1.5px solid var(--rule); /* the printed answer line */
}
.sr-word:last-of-type { border-bottom: 1.5px solid var(--rule); }

.sr-num {
  font-variant-numeric: tabular-nums;
  font-size: .82rem; font-weight: 700;
  color: var(--ink-soft); padding-top: 9px; text-align: right;
}

.sr-word input.sr-text {
  border: none; background: transparent; padding: 4px 2px;
  font-size: 1.06rem; font-weight: 600; border-radius: 4px;
}
.sr-word input.sr-reading {
  border: none; background: transparent; padding: 2px;
  font-family: 'Noto Serif SC', Georgia, serif; /* echoes the printed pinyin */
  font-size: .84rem; color: var(--ink-soft); border-radius: 4px;
}
.sr-word input:focus { background: #eef2ff; outline-offset: 0; }

/* the squiggle — uncertainty, in a vocabulary parents already know */
.sr-word input[data-flagged="true"] {
  text-decoration: underline wavy var(--flag);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

.sr-del {
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-soft); font-size: 1.15rem; line-height: 1;
  padding: 8px 4px; border-radius: 6px;
}
.sr-del:hover { color: var(--block); background: #fef2f2; }

/* ---------- buttons ---------- */

.sr-add {
  display: block; width: 100%;
  margin: 10px 0 14px;
  padding: 11px; font: inherit; font-size: .84rem; font-weight: 700;
  color: var(--accent); background: transparent;
  border: 1.5px dashed var(--rule); border-radius: 10px;
  cursor: pointer;
}
.sr-add:hover { border-color: var(--accent); background: #f5f7ff; }
.sr-add--week { border-style: solid; margin-bottom: 4px; }

.sr-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -3px 16px rgba(22,35,61,.07);
}
.sr-btn {
  font: inherit; font-weight: 700; font-size: .95rem;
  padding: 14px 18px; border-radius: 11px; cursor: pointer;
  border: 1.5px solid var(--rule); background: var(--card); color: var(--ink);
}
.sr-btn--go {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.sr-btn--go:disabled {
  background: #cbd5e1; border-color: #cbd5e1; color: #f8fafc; cursor: not-allowed;
}

/* ---------- photo lightbox ---------- */

.sr-zoom {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(11,17,29,.94);
  display: flex; align-items: center; justify-content: center;
  padding: 14px; cursor: zoom-out;
}
.sr-zoom[hidden] { display: none; }
.sr-zoom img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- entrance: the sheet reads itself, line by line ---------- */

@keyframes sr-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.sr-word { animation: sr-in .28s ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }

@media (prefers-reduced-motion: reduce) {
  .sr-word { animation: none; }
  .sr-head { backdrop-filter: none; }
}

@media (min-width: 620px) {
  .sr-body { max-width: 620px; margin: 0 auto; }
  .sr-foot { max-width: 620px; margin: 0 auto; border-radius: 14px 14px 0 0; }
}
