/* Tidy-up pass (Nov 29): the same Wren, with less on each screen. Loaded last so it only overrides; delete the <link> in index.html to undo it all. */

/* Lighter background: the same doodles as a webp, under half the size. */
.sun::after { background-image: url(img/doodles.webp); }

/* Bottom bar: icon beside its label, so it is about 50px tall instead of 81. */
.dock { padding: 6px 14px calc(6px + env(safe-area-inset-bottom)); }
.dock a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 0; font-size: 14px; border-radius: 14px; }
.dock a span { display: inline; font-size: 18px; line-height: 1; }
body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
.reading { padding-bottom: 0; }
.shbar { bottom: calc(58px + env(safe-area-inset-bottom)); }

/* Home: Wren sits beside her greeting, so the cards and the question box fit on one phone screen. */
.hero { display: grid; grid-template-columns: 64px 1fr; column-gap: 12px; align-items: center; text-align: left; padding: 0 2px 4px; }
.hero .mface.big { width: 64px; height: 64px; margin: 0; grid-row: span 2; border-width: 3px; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.hero h1 { font-size: 24px; align-self: end; }
.hero p { font-size: 14px; margin: 2px 0 0; align-self: start; }
.doors { gap: 10px; padding: 12px 0 14px; }
.door { padding: 10px 12px; border-radius: 18px; box-shadow: 0 4px 0 #e3b62c; }
.door .ic { width: 44px; height: 44px; font-size: 23px; border-radius: 14px; }
.door b { font-size: 18px; }
.door small { font-size: 13px; margin-top: 0; }
.ask { padding: 10px; border-radius: 20px; }
.qchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.qchips::-webkit-scrollbar { display: none; }
.qchips .qc { flex: none; white-space: nowrap; }
#home .qchips { flex-wrap: wrap; overflow: visible; gap: 6px; } /* Home has only three questions: wrap them, never clip */
#home .qchips .qc { padding: 6px 11px; }

/* Make, first screen: the two choices come first, then scanning, then anything waiting to be finished. */
.fin.what { display: flex; flex-direction: column; }
.fin.what > * { order: 5; }
.fin.what .hostline { order: 0; margin-bottom: 14px; }
.fin.what .whats { order: 1; }
.fin.what .scanc { order: 2; margin: 14px 0 0; padding: 8px 12px; border-radius: 18px; box-shadow: 0 4px 0 #e3b62c, 0 0 0 2px var(--line) inset; }
.fin.what .scanc .sic { width: 40px; height: 40px; font-size: 22px; border-radius: 12px; }
.fin.what .scanc b { font-size: 17px; }
.fin.what .scanc small { display: none; }
.fin.what .resume { order: 3; margin: 14px 0 0; }
.fin.what .prompt.new { display: none; }
.fin.what .resume .prompt { margin-bottom: 6px; }
.fin.what .resume .rcard { flex: 0 0 auto; max-width: 78%; }
.fin.what .resume .rgo { padding: 6px 34px 6px 6px; gap: 8px; border-radius: 14px; box-shadow: 0 4px 0 #e3b62c, 0 0 0 2px var(--line) inset; }
.fin.what .resume .rpic { flex: 0 0 34px; height: 40px; border-radius: 6px; }
.fin.what .resume .rtx b { font-size: 14px; -webkit-line-clamp: 1; }
.fin.what .resume .rtx small { display: none; }
.fin.what .resume .rdel { top: 50%; right: 6px; width: 22px; height: 22px; margin-top: -11px; font-size: 14px; }
.fin.what .wcard:not(.scanc) { padding: 12px 10px; gap: 8px; }
.what .tlink { order: 6; margin: 16px auto 0; padding: 4px 8px; font: 500 13px Fredoka, sans-serif; opacity: .6; background: none; box-shadow: none; text-decoration: underline; }
#notesBox:not(:has(li)) { display: none; }

@media (max-width: 899px) {
  /* Before the first page exists there is nothing to show in the book, so on a phone it stays out of the way. */
  .mode-build.early .stage { display: none; }
  .mode-build.early .sheet { margin-top: 10px; }
  /* Questions: Wren stays beside her words, and what she decided is one row to swipe, not a stack. */
  .l-spotlight .hostline { flex-direction: row; text-align: left; }
  .l-spotlight .avatar { flex-basis: 64px; width: 64px; height: 64px; border-radius: 22px; }
  .decided { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .decided::-webkit-scrollbar { display: none; }
  .decided .dk, .decided .dec { flex: none; }
  .decided .dec { max-width: 78%; }
  .decided .decfix { flex: none; width: 100%; }
}

/* Shelf: books start right under the name chips; on a wide screen the shelf uses the room (six across, set in drawShelf). */
.skids { margin-top: 4px; }
@media (min-width: 900px) {
  .shelfv { max-width: 1100px; }
  .srow { grid-template-columns: repeat(6, 1fr); gap: 22px; }
}

/* The favourite version of a stack (its default): a star on its thumbnail in the versions row. */
.vth .fav { position: absolute; left: -4px; top: -6px; color: #f5a623; font-size: 15px; line-height: 1; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }

/* Compact shelf (Nov 30): covers only, four across on a phone, a thin wooden ledge, smaller chips; the Bookshelf pill goes on a phone (the bottom bar says Shelf). */
@media (max-width: 899px) {
  .mode-shelf .bar { display: none; }
  .mode-shelf .shelfv { padding: calc(10px + env(safe-area-inset-top)) 12px 16px; }
}
.skids { gap: 6px; margin: 0 0 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.skids::-webkit-scrollbar { display: none; }
.skids button { flex: none; padding: 5px 12px; font-size: 13px; box-shadow: 0 2px 0 #e3b62c; }
.srow { grid-template-columns: repeat(var(--n, 3), 1fr); gap: 10px; padding: 8px 4px 0; margin-bottom: 16px; }
.srow::after { left: -2px; right: -2px; bottom: -7px; height: 7px; border-radius: 2px; background: linear-gradient(#d9a066, #b97a3e); box-shadow: 0 2px 0 #8f5a2a, 0 8px 10px -6px rgba(80,40,0,.45); }
.sk { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.sk .sc { border-radius: 3px 6px 6px 3px; box-shadow: inset 4px 0 0 rgba(0,0,0,.12), 0 6px 8px -5px rgba(80,40,0,.55); }
.sk:nth-child(3n+1) .sc, .sk:nth-child(3n+2) .sc { transform: none; }
.sk.loose .sc { transform: rotate(var(--r, 0deg)); }
.sk.loose .sc::before { top: -5px; height: 10px; }
.sk.on .sc, .sk.loose.on .sc { transform: translateY(-5px) rotate(0); box-shadow: 0 0 0 3px var(--coral), 0 10px 14px -6px rgba(80,40,0,.55); }
.sk.hid { opacity: .45; }
.sk.add b { font-size: 26px; } .sk.add small { font-size: 11px; }
/* A stack fans out: two more covers peek out behind, tilted. */
.sk.stack .sc { box-shadow: inset 4px 0 0 rgba(0,0,0,.12), 0 6px 8px -5px rgba(80,40,0,.55); }
.sk.stack::before, .sk.stack::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 3px 6px 6px 3px; background: #fff; box-shadow: 0 0 0 1px #e7dcc4, 0 3px 6px -3px rgba(80,40,0,.4); transform-origin: 50% 100%; }
.sk.stack::before { transform: rotate(-6deg) translateX(-3px); }
.sk.stack::after { transform: rotate(5deg) translateX(3px); background: #fbf5e8; }
.sk .vn { top: -7px; right: -5px; min-width: 20px; height: 20px; border-radius: 10px; font-size: 11px; line-height: 20px; }
.sk .nw { position: absolute; bottom: 22%; left: -4px; z-index: 3; padding: 1px 6px 1px 5px; border-radius: 2px 6px 6px 2px; background: #2fbf71; color: #fff; font: 800 8.5px/13px Nunito, sans-serif; font-style: normal; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 1px 0 #1d8a4f; }
.sk .fv { position: absolute; left: 3px; bottom: 3px; z-index: 3; font-style: normal; font-size: 13px; line-height: 1; color: #f5a623; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.shid { display: block; margin: 0 auto 8px; border: 0; background: none; font: 700 12px Nunito, sans-serif; color: var(--ink); opacity: .6; text-decoration: underline; cursor: pointer; }
/* Recently made: one slim row of small covers. */
.srecent { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.srecent > b { flex: none; width: 52px; font: 800 11px/1.15 Nunito, sans-serif; color: var(--ink); opacity: .75; }
.rstrip { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.rstrip::-webkit-scrollbar { display: none; }
.rth { position: relative; flex: none; width: 36px; border: 0; padding: 0; background: none; cursor: pointer; }
.rth .sc { display: block; aspect-ratio: 3/4; border-radius: 2px 4px 4px 2px; overflow: hidden; background: #fff; box-shadow: 0 2px 4px -1px rgba(80,40,0,.45); }
.rth .sc svg { display: block; width: 100%; height: 100%; }
.rth i { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); padding: 0 3px; border-radius: 4px; background: #2fbf71; color: #fff; font: 800 7.5px/11px Nunito, sans-serif; font-style: normal; text-transform: uppercase; }
/* Long-press menu and its Undo toast. */
.lpbg { position: fixed; inset: 0; z-index: 60; background: rgba(29,35,64,.12); }
.lpm { position: fixed; z-index: 61; min-width: 190px; max-width: 240px; background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 12px 30px -6px rgba(0,0,0,.35), 0 0 0 1.5px #f0e2bd; animation: pickIn .18s cubic-bezier(.2,.8,.2,1); }
.lpm p { margin: 4px 10px 6px; font: 700 13px/1.2 Fredoka, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lpm button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 10px; font: 800 14px Nunito, sans-serif; color: var(--ink); cursor: pointer; }
.lpm button:hover, .lpm button:active { background: #f8f1e0; }
.shtoast { position: fixed; z-index: 62; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--ink); color: #fff; font: 700 13px Nunito, sans-serif; box-shadow: 0 8px 20px -6px rgba(0,0,0,.4); max-width: calc(100% - 32px); }
.shtoast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shtoast button { flex: none; border: 0; border-radius: 10px; padding: 6px 10px; background: var(--sun); color: var(--ink); font: 800 13px Nunito, sans-serif; cursor: pointer; }
@media (min-width: 900px) { .srow { gap: 20px; } }

/* Home fills the phone: Wren and the cards sit in the middle of the free space, the tickets link rests just above the dock. */
.mode-home #home { display: flex; flex-direction: column; min-height: calc(100svh - 120px - env(safe-area-inset-bottom)); box-sizing: border-box; }
.mode-home #home > .hero { margin-top: auto; }
.mode-home #home > .tlink.home { margin-top: auto; margin-bottom: 0; padding-top: 18px; }
