/* ─── GET CAUGHT READING! ─────────────────────────────────────────
   Builds on ../css/styles.css (tokens, top bar, buttons, fields, toasts).
   Playful but in the LISA family: ink, paper, LISA red, plus the two
   accent inks (green, mustard) used for book spines and badges. */

[hidden] { display: none !important; }
.topbar .brand { text-decoration: none; }
:root { --green: #2f7d4f; --mustard: #e0a526; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.rc-hero { position: relative; overflow: hidden; background: var(--ink); color: #fff; isolation: isolate; }
.rc-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .16; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 80% 40%, #000, transparent 70%); mask-image: radial-gradient(ellipse at 80% 40%, #000, transparent 70%); }
.rc-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); align-items: end; gap: clamp(24px, 4vw, 64px); padding-top: clamp(44px, 7vw, 96px); padding-bottom: clamp(44px, 6vw, 80px); }
.rc-hero .kick { color: rgba(255,255,255,.7); animation: fadeUp .8s var(--ease) both; }
.rc-title { margin: 0; font: 800 clamp(52px, 9vw, 136px)/.86 var(--f-display); letter-spacing: -.055em; animation: fadeUp 1s var(--ease) .05s both; }
.rc-title em { color: var(--red-soft); font-size: 1.06em; letter-spacing: -.03em; }
.rc-sub { margin: 20px 0 0; color: rgba(255,255,255,.6); animation: fadeUp 1s var(--ease) .15s both; }

.rc-goal { padding: 22px; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: 8px 8px 0 0 var(--red); animation: fadeUp 1s var(--ease) .25s both; }
.rc-goal-top { display: flex; justify-content: space-between; color: var(--muted); }
.rc-goal-top b { color: var(--red); font-weight: 700; }
.rc-goal-num { margin-top: 8px; font: 800 clamp(44px, 5vw, 64px)/1 var(--f-display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.rc-goal-num small { margin-left: 8px; font: 500 14px var(--f-body); letter-spacing: 0; color: var(--muted); }
.rc-goal-track { position: relative; height: 14px; margin-top: 16px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.rc-goal-track span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px;
  background: repeating-linear-gradient(90deg, var(--red) 0 10px, #c51f18 10px 12px);
  transition: width 1.4s var(--ease); }
.rc-goal-note { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }

/* row of book spines along the bottom of the hero */
.rc-hero-shelf { height: 22px; border-top: 3px solid var(--ink);
  background:
    repeating-linear-gradient(90deg,
      var(--red) 0 26px, var(--ink) 26px 29px, var(--mustard) 29px 47px, var(--ink) 47px 50px,
      #fff 50px 70px, var(--ink) 70px 73px, var(--green) 73px 95px, var(--ink) 95px 98px,
      var(--red-soft) 98px 112px, var(--ink) 112px 115px, var(--paper-2) 115px 141px, var(--ink) 141px 144px); }

/* ── Layout ───────────────────────────────────────────────────────── */
.rc-main { padding-bottom: clamp(48px, 6vw, 88px); }
.rc-step { animation: fadeUp .7s var(--ease) both; }

/* ── Readers (step 1) ─────────────────────────────────────────────── */
.rc-kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rc-kid {
  position: relative; display: grid; justify-items: start; gap: 2px; min-height: 230px; padding: 20px 20px 18px;
  border: 0; border-radius: 22px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(11,11,11,.07);
  transition: background-color .3s, color .3s, transform .5s var(--ease), box-shadow .3s;
}
.rc-kid:hover { background: var(--ink); color: #fff; transform: translateY(-4px); box-shadow: 6px 6px 0 0 var(--red); }
.rc-kid-ava { width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font: 800 20px var(--f-display); }
.rc-kid-go { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font-size: 14px; transition: transform .5s var(--ease), background-color .3s, color .3s; }
.rc-kid:hover .rc-kid-go { background: var(--red); color: #fff; transform: rotate(90deg); }
.rc-kid-name { font: 800 24px/1.05 var(--f-display); letter-spacing: -.035em; }
.rc-kid-meta { font-size: 13.5px; color: var(--muted); transition: color .3s; }
.rc-kid:hover .rc-kid-meta { color: rgba(255,255,255,.6); }
.rc-kid-count { margin-top: 10px; font: 500 11px var(--f-mono); letter-spacing: .07em; text-transform: uppercase; }
.rc-kid-count b { font: 800 18px var(--f-display); letter-spacing: -.02em; }
.rc-kid-spines { align-self: end; display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 46px; margin-top: 14px; padding-top: 4px; border-bottom: 4px solid currentColor; }
.rc-kid-spines i { display: block; width: 12px; border-radius: 3px 3px 0 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.rc-kid-spines:empty::before { content: "Your shelf is waiting…"; align-self: center; font: italic 400 17px var(--f-serif); color: var(--muted); }

.rc-empty { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 1px rgba(11,11,11,.07); color: var(--muted); }
.rc-empty i { font-size: 28px; color: var(--red); }

/* ── Log a book (step 2) ──────────────────────────────────────────── */
.rc-log-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(16px, 2.5vw, 28px); align-items: start; padding-top: clamp(32px, 4vw, 56px); }

.rc-form { padding: clamp(22px, 3vw, 34px); border-radius: 26px; background: #fff; border: 1.5px solid var(--ink); box-shadow: 10px 10px 0 var(--red); }
.rc-back { margin-bottom: 18px; }
.rc-form-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.rc-reader-ava { width: 58px; height: 58px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font: 800 20px var(--f-display); }
.rc-form-head .mono { color: var(--muted); }
.rc-form-head h2 { margin: 2px 0 0; font: 800 clamp(28px, 3vw, 40px)/.95 var(--f-display); letter-spacing: -.045em; }

.rc-form .field textarea, .rc-form .field input[type="number"], .rc-form .field input[type="date"] {
  width: 100%; min-height: 50px; padding: 13px 18px; border: 0; border-radius: 14px; outline: 0;
  background: var(--paper); color: var(--ink); font: 15px var(--f-body); transition: box-shadow .25s, background-color .25s;
}
.rc-form .field textarea { resize: vertical; line-height: 1.5; }
.rc-form .field textarea:focus, .rc-form .field input[type="number"]:focus, .rc-form .field input[type="date"]:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink), 3px 3px 0 0 var(--red); }
.opt { margin-left: 6px; text-transform: none; letter-spacing: 0; font-family: var(--f-serif); font-style: italic; font-size: 13px; color: rgba(11,11,11,.4); }
.field-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.rc-form .field input { min-width: 0; max-width: 100%; }
.rc-form, .rc-shelf-card { min-width: 0; }

/* book search (autocomplete) */
.rc-ac { position: relative; }
.rc-ac-box { position: relative; }
.rc-ac-ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--red); font-size: 14px; pointer-events: none; }
.rc-ac-box input { padding-left: 46px !important; padding-right: 46px !important; }
.rc-ac-spin { position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2px solid rgba(11,11,11,.15); border-top-color: var(--red); animation: spin .8s linear infinite; }
.rc-suggest {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  border-radius: 18px; background: #fff; box-shadow: 0 0 0 1.5px var(--ink), 6px 6px 0 0 var(--red);
  max-height: min(380px, 60vh); overflow-y: auto; animation: pop .25s var(--ease) both;
}
.rc-suggest li { display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; align-items: center; gap: 12px; padding: 7px 10px 7px 7px; border-radius: 12px; cursor: pointer; transition: background-color .15s; }
.rc-suggest li:hover, .rc-suggest li.on { background: var(--paper); }
.rc-sg-cover { position: relative; width: 40px; height: 56px; border-radius: 5px; overflow: hidden; display: grid; place-items: center; background: var(--paper-2); color: rgba(11,11,11,.3); box-shadow: 2px 2px 0 rgba(11,11,11,.12); }
.rc-sg-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.rc-sg-cover img:not([src]) { display: none; }
.rc-li-cover img:not([src]), .rc-faceout:not([src]) { visibility: hidden; }
.rc-sg-t { min-width: 0; }
.rc-sg-t b { display: block; font: 700 14.5px/1.25 var(--f-display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-sg-t small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-sg-go { color: rgba(11,11,11,.25); font-size: 11px; transform: rotate(90deg); }
.rc-suggest li.on .rc-sg-go, .rc-suggest li:hover .rc-sg-go { color: var(--red); }

.rc-picked { display: grid; grid-template-columns: 54px minmax(0, 1fr) 34px; align-items: center; gap: 14px; margin-top: 10px; padding: 10px; border-radius: 16px; background: var(--ink); color: #fff; animation: fadeUp .45s var(--ease) both; }
.rc-picked-cover { position: relative; width: 54px; height: 78px; border-radius: 5px; overflow: hidden; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 20px; transform: rotate(-4deg); box-shadow: 4px 4px 0 rgba(255,255,255,.18); }
.rc-picked-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.rc-picked-cover img:not([src]), .rc-picked-cover img[hidden] { display: none; }
.rc-picked-t { min-width: 0; padding-left: 4px; }
.rc-picked-t .mono { color: var(--red-soft); font-size: 10px; }
.rc-picked-t b { display: block; margin-top: 2px; font: 700 16px/1.2 var(--f-display); letter-spacing: -.015em; }
.rc-picked-t small { display: block; margin-top: 2px; font-size: 12.5px; color: rgba(255,255,255,.6); }
.rc-picked-x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; transition: background-color .2s, transform .4s var(--ease); }
.rc-picked-x:hover { background: var(--red); transform: rotate(90deg); }

.rc-choice { margin: 4px 0 16px; padding: 0; border: 0; }
.rc-choice legend { margin-bottom: 8px; padding: 0; color: var(--muted); }

.rc-rating { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rc-rating button {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border: 0; border-radius: 16px;
  background: var(--paper); color: var(--ink); cursor: pointer;
  transition: background-color .25s, color .25s, transform .4s var(--ease), box-shadow .25s;
}
.rc-rating button span { font-size: 28px; line-height: 1; filter: grayscale(.6); transition: transform .45s var(--ease), filter .3s; }
.rc-rating button small { font: 500 9.5px var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.rc-rating button:hover span { filter: none; transform: scale(1.18) rotate(-6deg); }
.rc-rating button[aria-checked="true"] { background: var(--ink); box-shadow: 4px 4px 0 0 var(--red); transform: translateY(-3px); }
.rc-rating button[aria-checked="true"] span { filter: none; transform: scale(1.25); }
.rc-rating button[aria-checked="true"] small { color: #fff; }

.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-chips button {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; border-radius: 99px;
  background: var(--paper); color: var(--ink); font: 600 13.5px var(--f-display); cursor: pointer;
  transition: background-color .25s, color .25s, box-shadow .25s;
}
.rc-chips button i { color: var(--red); font-size: 13px; transition: color .25s; }
.rc-chips button:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.rc-chips button[aria-checked="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.rc-chips button[aria-checked="true"] i { color: var(--red-soft); }

.rc-submit { margin-top: 8px; height: 56px; background: var(--red); font-size: 16px; }
.rc-submit:hover { background: var(--ink); }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.is-busy > * { visibility: hidden; }
.btn.line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.line:hover { box-shadow: inset 0 0 0 1.5px var(--ink), 4px 4px 0 0 var(--red); }
.btn.red { background: var(--red); }
.btn.red:hover { background: var(--ink); }

/* ── Bookshelf ────────────────────────────────────────────────────── */
.rc-shelf-card { position: sticky; top: 88px; padding: clamp(20px, 2.6vw, 30px); border-radius: 26px; background: #fff; box-shadow: inset 0 0 0 1px rgba(11,11,11,.07); }
.rc-shelf-card .col-title b { font: 800 18px var(--f-display); color: var(--ink); }

.rc-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.rc-badge { display: grid; justify-items: center; gap: 2px; width: 52px; padding: 8px 0 6px; border-radius: 14px; background: var(--paper); opacity: .55; transition: transform .4s var(--ease), opacity .3s; }
.rc-badge span { font-size: 22px; line-height: 1; filter: grayscale(1); }
.rc-badge small { font-size: 9.5px; color: var(--muted); }
.rc-badge.on { opacity: 1; background: var(--ink); }
.rc-badge.on span { filter: none; }
.rc-badge.on small { color: #fff; }
.rc-badge.on:hover { transform: translateY(-3px) rotate(-6deg); }

.rc-shelf {
  display: flex; align-items: flex-end; gap: 3px; min-height: 170px; height: 170px; padding: 10px 12px 0;
  border-radius: 14px 14px 0 0; overflow-x: auto; overflow-y: hidden;
  background: linear-gradient(180deg, var(--paper) 0%, #ebe5da 100%);
  border-bottom: 10px solid var(--ink); box-shadow: 0 6px 0 -2px var(--red);
}
.rc-shelf:empty { display: none; }
.rc-spine {
  flex: 0 0 var(--w, 30px); height: var(--h, 80%); display: flex; align-items: center; justify-content: center;
  border-radius: 4px 4px 1px 1px; background: var(--c); overflow: hidden; cursor: default;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), inset 3px 0 0 rgba(255,255,255,.12), inset -3px 0 0 rgba(0,0,0,.12);
  transform-origin: bottom center; transition: transform .35s var(--ease);
}
.rc-spine:hover { transform: translateY(-8px) rotate(-2deg); }
.rc-spine span { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 92%; padding: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 10.5px var(--f-display); letter-spacing: .01em; }
.rc-spine.is-new { animation: spineIn .9s var(--ease) both; }
@keyframes spineIn { 0% { transform: translateY(-140%) rotate(-14deg); opacity: 0; } 60% { transform: translateY(6%) rotate(3deg); opacity: 1; } 100% { transform: none; } }

.rc-shelf-empty { display: grid; justify-items: center; gap: 8px; padding: 30px 16px; margin: 0; border-radius: 16px; background: var(--paper); text-align: center; color: var(--muted); font-size: 14.5px; }
.rc-shelf-empty span { font-size: 38px; }

.rc-list { list-style: none; margin: 18px 0 0; padding: 0; }
.rc-list li { display: grid; grid-template-columns: 38px minmax(0, 1fr) 34px; gap: 14px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rc-list li:last-child { border-bottom: 0; }
.rc-li-cover { position: relative; width: 38px; height: 54px; }
.rc-li-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; box-shadow: 2px 2px 0 rgba(11,11,11,.15); }
.rc-li-cover span { position: absolute; right: -8px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 14px; box-shadow: 0 0 0 1px var(--line); }

.rc-faceout { flex: 0 0 auto; height: 88%; margin-left: 10px; border-radius: 4px; transform: rotate(3deg); transform-origin: bottom left; box-shadow: -3px 3px 0 rgba(11,11,11,.18); }
.rc-faceout.is-new { animation: spineIn .9s var(--ease) both; }

.rc-li-emoji { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); font-size: 20px; }
.rc-li-text b { display: block; font: 700 15.5px/1.25 var(--f-display); letter-spacing: -.015em; }
.rc-li-text small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.rc-li-text q { display: block; margin-top: 6px; font: italic 400 16px/1.3 var(--f-serif); color: var(--ink); }
.rc-li-del { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: rgba(11,11,11,.35); cursor: pointer; transition: background-color .2s, color .2s; }
.rc-li-del:hover { background: var(--red); color: #fff; }

/* ── Family tips ──────────────────────────────────────────────────── */
.rc-help { margin-top: clamp(44px, 6vw, 80px); }
.rc-tips { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.rc-tips li { display: grid; gap: 14px; align-content: start; padding: 18px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px rgba(11,11,11,.07); font-size: 14px; line-height: 1.45; }
.rc-tips i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); color: var(--red); font-size: 15px; }

/* ── Dialog + confetti ────────────────────────────────────────────── */
.rc-modal-back { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 16px; background: rgba(11,11,11,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeUp .25s ease both; }
.rc-modal { width: min(420px, 100%); padding: 28px; border-radius: 26px; background: #fff; text-align: center; box-shadow: 12px 12px 0 0 var(--red); animation: rcPop .55s var(--ease) both; }
@keyframes rcPop { from { opacity: 0; transform: scale(.85) rotate(-2deg); } }
.rc-modal-ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 24px; }
.rc-modal-ic span { font-size: 40px; animation: rcWiggle 1.2s var(--ease) .2s both; }
@keyframes rcWiggle { 0% { transform: scale(.4) rotate(-20deg); } 50% { transform: scale(1.2) rotate(10deg); } 100% { transform: none; } }
.rc-modal.danger .rc-modal-ic { background: var(--red); }
.rc-modal h3 { margin: 0; font: 800 26px/1.05 var(--f-display); letter-spacing: -.04em; }
.rc-modal p { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.rc-modal-row { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.rc-modal .btn { height: 46px; }

.rc-confetti { position: fixed; inset: 0; z-index: 1050; width: 100vw; height: 100vh; pointer-events: none; display: none; }
.rc-confetti.on { display: block; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .rc-log-grid { grid-template-columns: minmax(0, 1fr); }
  .rc-shelf-card { position: static; }
  .rc-tips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .rc-hero-in { grid-template-columns: 1fr; }
  .rc-goal { box-shadow: 6px 6px 0 0 var(--red); }
}
@media (max-width: 520px) {
  .rc-rating { gap: 4px; }
  .rc-rating button { padding: 8px 2px 6px; border-radius: 12px; }
  .rc-rating button span { font-size: 24px; }
  .rc-rating button small { font-size: 8px; }
  .rc-form { box-shadow: 6px 6px 0 var(--red); }
  .rc-badges { gap: 6px; }
  .rc-badge { width: calc((100% - 30px) / 6); }
  .rc-badge span { font-size: 19px; }
  .rc-tips { grid-template-columns: 1fr; }
  .rc-tips li { grid-template-columns: 40px 1fr; align-items: center; }
  .rc-chips button { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .rc-spine.is-new, .rc-modal, .rc-modal-ic span { animation: none; }
}
