/* THE BINDER IS A SHELF.
 *
 * It was two facing leaves you flipped, nine cards to a page, one page per
 * sound, and it was EMPTY for anyone who had not earned a card yet. Jade,
 * 2026-09-21: the binder is the shelf of a child's decks, each deck a spine
 * showing how many of its cards are in, tap to open that deck. A brand new
 * child sees every deck greyed, never an empty book.
 *
 * Same palette as deck.css: cream page, white slots, the road ahead faded to
 * the paper. The shelf planks are the only brown.
 */
:root {
  --desk: #f6ecd9; --board: #8a6a3f; --leaf: #fffdf9; --edge: #e6dac4;
  --ink: #2b2620; --soft: #6d6158; --word: #6f8f83; --faint: #cabfa9; --gold: #e0a32a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--desk); color: var(--ink);
  font-family: Geist, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
}
.who { font-size: 14px; font-weight: 700; color: #5d5344; text-align: center; min-width: 0;
       white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back {
  flex: none; font-size: 12.5px; color: #5d5344; text-decoration: none;
  border: 1px solid rgba(0,0,0,.12); border-radius: 999px;
  padding: 7px 13px; background: rgba(255,253,249,.7); font-weight: 600;
}

.themebtn {
  flex: none; border: 2px solid var(--ink); border-radius: 6px; background: transparent;
  color: var(--ink); font-weight: 800; font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; padding: 7px 12px;
}
.themebtn:active { background: var(--ink); color: #fff; }
/* a spine wearing the child's face: the face is the cover */
.spine .im.faced { aspect-ratio: auto; background: none; }
.spine .im.faced .face { pointer-events: none; }
.spine.road .im.faced .face { filter: grayscale(1) brightness(1.12) contrast(.85); opacity: .38; }
.spine.road .im.faced .face img { filter: none; opacity: 1; }

/* MARK: by age or grade */
.ages { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 14px; max-width: 1180px; margin: 0 auto; }
.age {
  border: 1px solid var(--edge); border-radius: 999px; padding: 7px 13px;
  background: var(--leaf); color: var(--soft); font-weight: 700; font-size: 12.5px;
}
.age.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.age small { font-weight: 600; opacity: .7; margin-left: 5px; }

/* MARK: the shelves */

.shelves { max-width: 1180px; margin: 0 auto; padding: 0 16px 24px; }
.shelf { margin-bottom: 22px; }
.shelf h2 {
  margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--soft);
  letter-spacing: .04em; text-transform: uppercase;
}
.shelf h2 span { font-weight: 600; color: var(--faint); text-transform: none; letter-spacing: 0; margin-left: 8px; }
.row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px;
  padding: 0 8px 12px; border-bottom: 10px solid var(--board); border-radius: 0 0 4px 4px;
}

/* a spine: the box standing on the shelf, its cover on the front */
.spine {
  min-width: 0;   /* a grid item's min-width is auto, and the cover's aspect box pushed the row past the phone */
  background: var(--leaf); border: 1px solid var(--edge); border-radius: 10px 10px 4px 4px;
  padding: 6px 6px 8px; display: flex; flex-direction: column; text-align: left;
  color: var(--ink); text-decoration: none;
  box-shadow: 0 3px 6px -3px rgba(70,52,24,.45);
}
.spine .im { aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #fbf7ef; }
.spine .im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spine b {
  display: block; margin-top: 6px; font-size: 12.5px; font-weight: 800; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spine .of { font-size: 11px; color: var(--soft); margin-top: 2px; }
.spine .bar { height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(0,0,0,.08); overflow: hidden; }
.spine .bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 2px; }
.spine.road { box-shadow: none; }
.spine.road .im img { filter: grayscale(1) brightness(1.16) contrast(.82); opacity: .28; }
.spine.road b { color: var(--faint); }
.spine.road .of { color: var(--faint); }
.spine.due .of::after { content: ' · card due'; color: var(--gold); font-weight: 700; }

/* MARK: the line under it all */

.status {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px 24px; font-size: 13px; color: #5d5344; flex-wrap: wrap; text-align: center;
}

/* MARK: media queries, last in the file, always */
@media (max-width: 520px) {
  .shelves { padding: 0 12px 24px; }
  .row { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 4px 10px; border-bottom-width: 8px; }
  .spine b { font-size: 11.5px; }
}
