.bookshelf-card{position:relative;isolation:isolate;overflow:hidden;padding:clamp(16px,3vw,30px);border:1px solid #444467;border-radius:22px;background:radial-gradient(ellipse at 85% 0,#282143 0,transparent 60%),linear-gradient(135deg,#101522,#090d18);color:#e8ecff;font-family:"Space Grotesk",system-ui,sans-serif}
.bookshelf-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.bookshelf-heading h2{margin:0;font-size:clamp(24px,4vw,32px);letter-spacing:.02em}
.bookshelf-eyebrow{color:#b0a4df;font:10px Michroma,system-ui,sans-serif;letter-spacing:.26em;margin:0 0 7px}
.bookshelf-tier{font-size:12px;border:1px solid #6b5a93;border-radius:30px;padding:8px 12px;color:#d4c5ff}
.bookshelf-count{font-size:16px;margin:15px 0 5px;font-weight:600;color:#ddd0ff}
.bookshelf-description{font-size:14px;line-height:1.6;color:#b0b9d5;max-width:60ch;margin:7px 0 20px}
.bookshelf-empty{margin:20px 0 8px;font-size:16px}
.bookshelf-overflow{font-size:13px;line-height:1.6;color:#c9c5e2;margin:16px 0 0}
.bookshelf-link{color:#cbb9ff;display:inline-block;padding:12px 0;line-height:1.5}
.bookshelf-actions{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:22px}
.bookshelf-note{display:block;color:#b1b7d0;font-size:12px;line-height:1.6}
.bookshelf-button{min-height:44px;padding:11px 17px;font:600 13px "Space Grotesk",system-ui,sans-serif;color:#e0d3ff;background:linear-gradient(135deg,#342756,#192647);border:1px solid #8e75bd;border-radius:12px;cursor:pointer;touch-action:manipulation}
.bookshelf-button:hover{border-color:#d9bdff;background:#3a2c60}
.bookshelf-button:disabled{cursor:default;opacity:.55}
.bookshelf-grand{border-color:#8572b3;background:radial-gradient(ellipse at 70% 0,#4e3c66 0,transparent 60%),linear-gradient(135deg,#171729,#0a0e1d)}
.bookshelf-grand:before{content:"";position:absolute;inset:-20%;z-index:-1;pointer-events:none;background:radial-gradient(circle at 15% 20%,#d0b6ff66 0 1px,transparent 2px),radial-gradient(circle at 70% 60%,#e3dbff66 0 1px,transparent 2px),radial-gradient(circle at 30% 90%,#d0b6ff66 0 1px,transparent 2px),linear-gradient(115deg,transparent 30%,#cfb9ff10 47%,transparent 60%);background-size:110px 150px,190px 130px,130px 210px,100% 100%;animation:bookshelf-dust 24s ease-in-out infinite alternate}
@keyframes bookshelf-dust{to{transform:translate(20px,-30px)}}
.bookshelf-dialog{max-width:min(540px,calc(100vw - 24px));width:540px;max-height:calc(100svh - 32px);padding:0;border:1px solid #79629e;border-radius:22px;color:#e8ecff;background:#111425;box-shadow:0 25px 100px #0009;box-sizing:border-box}
.bookshelf-dialog::backdrop{background:#020510cf;backdrop-filter:blur(6px)}
.bookshelf-sheet{padding:24px;font-family:"Space Grotesk",system-ui,sans-serif}
.bookshelf-sheet h2{font-size:23px;line-height:1.4;margin:0 0 12px;overflow-wrap:anywhere}
.bookshelf-options{display:grid;gap:10px}
.bookshelf-option{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 0;border-top:1px solid #42455c}
.bookshelf-option strong{display:block;font-size:15px;margin-bottom:4px}
.bookshelf-status{font-size:13px;line-height:1.5;color:#ded0ff;min-height:1.5em}
.bookshelf-close{width:100%;position:sticky;bottom:0}
.bookshelf-earned{color:#c9c1df;font-size:15px}
@media(max-width:420px){.bookshelf-sheet{padding:18px}
.bookshelf-actions>.bookshelf-button{width:100%}
.bookshelf-option .bookshelf-button{padding-left:12px;padding-right:12px;flex-shrink:0}}
@media(prefers-reduced-motion:reduce){.bookshelf-grand:before{animation:none}}
/* ---- HOME room, dictionaries, rules (AVATAR HOME seat 2026-10-21; PROTOCOL §10, ANY-APP §32) ---- */
.home-room{position:relative;overflow:hidden;margin-bottom:14px;padding:clamp(16px,3vw,26px);border:1px solid #444467;border-radius:22px;color:#e8ecff;font-family:"Space Grotesk",system-ui,sans-serif;background:linear-gradient(180deg,#1a1834 0,#121428 62%,#2a2238 62%,#1b1626 100%)}
.home-room:after{content:"";position:absolute;left:0;right:0;top:62%;height:2px;background:linear-gradient(90deg,transparent,#8d7bb766,transparent);pointer-events:none}
.home-room-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.home-room-title{margin:0;font-size:clamp(22px,4vw,28px)}
.home-rules-btn{min-height:44px;padding:10px 15px;font:600 13px "Space Grotesk",system-ui,sans-serif;color:#e0d3ff;background:#ffffff0d;border:1px solid #8e75bd;border-radius:999px;cursor:pointer;touch-action:manipulation}
.home-rules-btn:hover{background:#ffffff1a;border-color:#d9bdff}
.home-room-stage{position:relative;z-index:1;display:flex;align-items:flex-end;gap:clamp(12px,3vw,28px);margin-top:14px}
.home-room-avatar{flex:none;width:112px;height:112px;filter:drop-shadow(0 10px 12px #0009)}
.home-room-pieces{flex:1;display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px}
.home-piece{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:9px;align-items:center;min-height:52px;padding:8px 10px;text-align:left;color:#e8ecff;background:#0c1020cc;border:1px solid #6b5a93;border-radius:12px;cursor:pointer;font:600 13px "Space Grotesk",system-ui,sans-serif;touch-action:manipulation}
.home-piece-icon{grid-row:1/3;font-size:22px;line-height:1}
.home-piece-state{font-size:11px;font-weight:500;color:#9fe6b4}
.home-piece.is-soon{border-style:dashed;border-color:#5d587a;color:#aab0cb;background:#0c10208a}
.home-piece.is-soon .home-piece-icon{filter:grayscale(.85);opacity:.6}
.home-piece.is-soon .home-piece-state{color:#8d93b0}
.home-piece:hover{border-color:#d9bdff}
.home-piece:focus-visible,.home-rules-btn:focus-visible,.home-dict:focus-visible{outline:3px solid #c1f69e;outline-offset:3px}
.home-group{margin-top:18px}
.home-group-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.home-group-title{margin:0;color:#b0a4df;font:11px Michroma,system-ui,sans-serif;letter-spacing:.2em;text-transform:uppercase}
.home-group-count{font-size:13px;color:#ddd0ff;font-weight:600;white-space:nowrap}
.home-group-books .bookshelf-count{margin-top:8px}
.home-dicts{display:flex;align-items:flex-end;gap:6px;max-width:600px;margin-top:10px;padding:16px 12px 19px;border:1px solid #3a3551;border-radius:10px;background:linear-gradient(180deg,#060a12 0,#121726 calc(100% - 19px),#4c4661 calc(100% - 19px),#2b253b calc(100% - 12px),#060a12 100%);box-shadow:inset 0 5px 20px #0009}
.home-dict{--h:140px;position:relative;flex:var(--g,6) 1 0;min-width:0;height:var(--h);display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:10px 3px 9px;box-sizing:border-box;border-radius:4px 6px 3px 2px;color:#f6ead2;cursor:pointer;font:700 11px/1.2 "Space Grotesk",system-ui,sans-serif;text-shadow:0 1px 3px #000;transition:transform .18s;touch-action:manipulation;border:1px solid #ffffff30;box-shadow:3px 4px 9px #0008}
.home-dict-title{writing-mode:vertical-rl;max-height:calc(var(--h) - 40px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;position:relative;z-index:1}
.home-dict-mark{position:relative;z-index:1;font-size:12px;line-height:1}
.home-dict:hover{transform:translateY(-5px)}
.home-dict-pocket{--g:5;--h:104px}
.home-dict-cloth{--g:6;--h:124px}
.home-dict-leather{--g:7;--h:136px}
.home-dict-gilded{--g:7;--h:142px}
.home-dict-codex{--g:8;--h:150px}
.home-dict-thesaurus{--g:9;--h:158px}
.home-dict-lexicon{--g:10;--h:168px}
.home-dict.is-earned:before,.home-dict.is-earned:after{content:"";position:absolute;left:0;right:0;pointer-events:none}
/* Pocket: a little red paper dictionary with a cream label */
.home-dict-pocket.is-earned{background:linear-gradient(90deg,#0006,transparent 25%,#ffffff14 62%,#0005),#a8452f}
.home-dict-pocket.is-earned:before{top:14%;bottom:24%;left:3px;right:3px;background:#efe2c2e6;box-shadow:0 0 0 1px #0003;border-radius:2px}
.home-dict-pocket.is-earned .home-dict-title{color:#3a1d14;text-shadow:none}
/* Cloth-Bound: woven bronze cloth */
.home-dict-cloth.is-earned{background:repeating-linear-gradient(45deg,#ffffff0d 0 2px,transparent 2px 4px),repeating-linear-gradient(-45deg,#0000000f 0 2px,transparent 2px 4px),linear-gradient(90deg,#0006,transparent 25%,#ffffff12 62%,#0005),#86683f}
.home-dict-cloth.is-earned:before{top:9px;height:3px;background:#d9b780aa}
.home-dict-cloth.is-earned:after{bottom:9px;height:3px;background:#d9b780aa}
/* Leather Lexicon: brown leather, raised bands, silver letters */
.home-dict-leather.is-earned{color:#e6edf6;background:linear-gradient(90deg,#0007,transparent 22%,#ffffff12 60%,#0006),radial-gradient(circle at 30% 40%,#ffffff0a,transparent 60%),#5c3520}
.home-dict-leather.is-earned:before{top:16%;height:7px;background:linear-gradient(180deg,#ffffff26,#0006);border-radius:3px}
.home-dict-leather.is-earned:after{bottom:16%;height:7px;background:linear-gradient(180deg,#ffffff26,#0006);border-radius:3px}
/* Gilded Glossary: forest-green leather with gold top and tail */
.home-dict-gilded.is-earned{color:#f3d27a;background:linear-gradient(90deg,#0007,transparent 22%,#ffffff12 60%,#0006),#1e4b3b;border-top:6px solid #d8b24a;border-bottom:6px solid #d8b24a}
.home-dict-gilded.is-earned:before{top:22%;height:2px;background:#e9c96b}
.home-dict-gilded.is-earned:after{bottom:22%;height:2px;background:#e9c96b}
/* Illuminated Codex: burgundy, brass clasp, a jewel */
.home-dict-codex.is-earned{color:#ffe08a;background:linear-gradient(90deg,#0007,transparent 22%,#ffffff14 60%,#0006),#5d1631;border-color:#d8b24a99}
.home-dict-codex.is-earned:before{top:42%;left:50%;right:auto;width:12px;height:12px;margin-left:-6px;transform:rotate(45deg);background:radial-gradient(circle at 35% 35%,#9ff0ff,#2f8fd8 60%,#103a66);border:2px solid #e2bf5d;box-shadow:0 0 8px #6fd3ff88}
.home-dict-codex.is-earned:after{top:0;bottom:0;left:auto;right:-1px;width:5px;background:linear-gradient(180deg,#e2bf5d,#9b7a2a 50%,#e2bf5d)}
.home-dict-codex.is-earned .home-dict-title{max-height:calc(42% - 6px)}
/* Grand Thesaurus: tall navy with gold bands and a star */
.home-dict-thesaurus.is-earned{color:#ffe7a3;background:linear-gradient(90deg,#0007,transparent 22%,#ffffff14 60%,#0006),#18244f;border-color:#e2bf5d88}
.home-dict-thesaurus.is-earned:before{top:8px;height:10px;background:repeating-linear-gradient(180deg,#e2bf5d 0 2px,transparent 2px 4px)}
.home-dict-thesaurus.is-earned:after{bottom:8px;height:10px;background:repeating-linear-gradient(180deg,#e2bf5d 0 2px,transparent 2px 4px)}
/* The Great Lexicon: the legend — a book made of night sky */
.home-dict-lexicon.is-earned{color:#fff;background:radial-gradient(circle at 25% 20%,#fff 0 1px,transparent 2px),radial-gradient(circle at 70% 55%,#fff 0 1px,transparent 2px),radial-gradient(circle at 40% 80%,#e9dcff 0 1px,transparent 2px),linear-gradient(90deg,#0007,transparent 22%,#ffffff1a 60%,#0006),linear-gradient(180deg,#5a2ea6,#1b1650 55%,#0b1a3a);border-color:#d9c6ff;box-shadow:3px 4px 9px #0008,0 0 16px #a98bff66;animation:home-lexicon 3.2s ease-in-out infinite alternate}
.home-dict-lexicon.is-earned:before{top:6px;height:4px;background:linear-gradient(90deg,#c1f69e,#d9c6ff,#c1f69e)}
.home-dict-lexicon.is-earned:after{bottom:6px;height:4px;background:linear-gradient(90deg,#c1f69e,#d9c6ff,#c1f69e)}
@keyframes home-lexicon{to{box-shadow:3px 4px 9px #0008,0 0 26px #c1f69e66}}
/* Not earned yet: a faint outline that says how to earn it */
.home-dict.is-locked{background:#8996c705;border:1px dashed #8a85b966;color:#aab0cb;text-shadow:none;box-shadow:none;font-weight:600}
.home-dict.is-locked .home-dict-mark{font-size:10px;opacity:.75}
.home-next{margin-top:10px;max-width:600px}
.home-next-text{margin:0 0 6px;font-size:13px;line-height:1.5;color:#d6ccf4}
.home-bar{height:6px;border-radius:6px;background:#ffffff14;overflow:hidden}
.home-bar i{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,#9d86e8,#e7defe)}
.home-almost{margin-top:16px;max-width:600px}
.home-almost-row{display:grid;grid-template-columns:1fr auto;gap:2px 10px;align-items:center;margin-top:8px;font-size:13px}
.home-almost-row .home-bar{grid-column:1/-1}
.home-almost-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#e8ecff}
.home-almost-pages{color:#b1b7d0;font-size:12px}
.home-rule{padding:12px 0;border-top:1px solid #42455c}
.home-rule-title{margin:0 0 4px;font-size:15px}
.home-rule .bookshelf-description{margin:0}
.home-rule-list{margin:8px 0 0;padding-left:18px;font-size:14px;line-height:1.6;color:#dfe3f5}
.home-sheet-tier{display:inline-block;margin:0 0 6px;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700;border:1px solid currentColor}
.home-tier-bronze{color:#d99a62}.home-tier-silver{color:#cfd8e6}.home-tier-gold{color:#f2c65a}.home-tier-legend{color:#d9c6ff}
@media(max-width:520px){.home-room-stage{flex-direction:column;align-items:stretch}
.home-room-avatar{align-self:center;width:96px;height:96px}
.home-room{background:linear-gradient(180deg,#1a1834 0,#121428 34%,#2a2238 34%,#1b1626 100%)}
.home-room:after{top:34%}
.home-room-top{flex-direction:column;align-items:flex-start;gap:8px}
.home-room-pieces{grid-template-columns:repeat(3,1fr);gap:6px}
.home-piece{grid-template-columns:1fr;grid-template-rows:auto;justify-items:center;text-align:center;row-gap:2px;padding:8px 4px;min-height:72px;font-size:12px}
.home-piece-icon{grid-row:auto;font-size:20px}
.home-piece-state{font-size:10px}
.home-dicts{gap:4px;padding-left:8px;padding-right:8px}
.home-dict{font-size:10px}}
@media(prefers-reduced-motion:reduce){.home-dict-lexicon.is-earned{animation:none}
.home-dict{transition:none}
.home-dict:hover{transform:none}}
/* ---- Three bookshelves (Jesse 2026-10-22): green = read to me · blue = read aloud · gold = every question right.
   Ledge light names the shelf; existing wood choices select the neon frame finish. ---- */
.home-group-dicts{margin-top:22px}

.bookshelf-preview{position:fixed;z-index:2147483600;box-sizing:border-box;width:224px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:hidden;padding:14px;background:#191524;color:#f5eedc;border:1px solid #c8ad7c;border-radius:12px;box-shadow:0 12px 45px #000a;pointer-events:none;font:14px/1.4 system-ui,sans-serif}
.bookshelf-preview strong,.bookshelf-preview>span{display:block;overflow-wrap:anywhere}.bookshelf-preview>span{margin-top:5px;font-size:12px;color:#c8bfd5}
.bookshelf-cover{position:relative;width:160px;height:190px;max-width:100%;margin:0 auto 14px;display:grid;place-items:center;overflow:hidden;border:1px solid #ecd5a080;border-left:7px solid #0005;border-radius:3px 8px 8px 3px;background:linear-gradient(135deg,#ffffff18,#0004),var(--book-color,#423857);box-shadow:5px 5px 0 #e7dcc0,7px 7px 10px #0009}
.bookshelf-cover:before{content:'';position:absolute;inset:12px;border:1px solid #ead29b80;pointer-events:none;z-index:2}
.bookshelf-cover-title{padding:18px;text-align:center;font:600 17px/1.4 Georgia,serif;color:#f8eacd;overflow-wrap:anywhere}
.bookshelf-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.home-piece-icon{position:relative;display:block;width:26px;height:28px;box-sizing:border-box;border:2px solid #bfa273;border-bottom-width:5px;background:repeating-linear-gradient(to bottom,transparent 0 8px,#bfa273 8px 10px)}
.home-icon-green{color:#73c995}.home-icon-blue{color:#83baf4}.home-icon-gold{color:#e8c56c}
.home-piece-icon:after{content:'';position:absolute;inset:2px 3px;background:repeating-linear-gradient(to right,currentColor 0 3px,transparent 3px 5px);opacity:.6}
.home-piece.is-soon .home-piece-icon{border-radius:4px;background:none}.home-piece.is-soon .home-piece-icon:after{background:none;border:1px solid currentColor;border-radius:50%}
@media(max-width:420px){.home-group-head{flex-wrap:wrap}.home-group-title{line-height:1.7;letter-spacing:.1em}}
@media(max-height:450px){.bookshelf-preview .bookshelf-cover{display:none}}

/* FIX-2: code-drawn neon cabinet; all original wood/shop identifiers remain contracts. */
.bookshelf-card{--edge-a:#3ff3ff;--edge-b:#9b6bff;--panel:rgba(10,12,26,.82);--line:rgba(120,140,220,.22);--ink:#e8ecff;--dim:#9aa4c8;min-width:0;box-sizing:border-box;background:radial-gradient(ellipse at 80% 35%,#30205266,transparent 65%),#090d19}
.home-finish-1{--edge-a:#34e4ce;--edge-b:#75ff99}
.home-finish-2{--edge-a:#ff70d8;--edge-b:#ad83ff}
.home-finish-3{--edge-a:#ffd46a;--edge-b:#ffffff}
.bookshelf-grand:before{animation:none;background:none}
.home-case{margin:0;padding:0;border:0;background:none;min-width:0;position:relative;z-index:1}
.home-case-green,.home-case-tag-green{--tier:#3dffa0;--wash:#3dffa01f;color:#8dffc5}
.home-case-blue,.home-case-tag-blue{--tier:#46a8ff;--wash:#46a8ff24;color:#a7d7ff}
.home-case-gold,.home-case-tag-gold{--tier:#ffd46a;--wash:#ffd46a2a;color:#ffe3a0}
.bookshelf-cabinet{--post:28px;--tier:#3ff3ff;--wash:#3ff3ff18;position:relative;isolation:isolate;box-sizing:border-box;width:100%;max-width:960px;margin:0 auto;padding:112px var(--post) 28px;background:#0b0f1c;clip-path:polygon(22px 0,calc(100% - 22px) 0,100% 22px,100% calc(100% - 22px),calc(100% - 22px) 100%,22px 100%,0 calc(100% - 22px),0 22px);border:1px solid #69799b;box-shadow:inset 0 0 0 5px #161d30,inset 0 0 0 7px #33405b}
.bookshelf-cabinet:before{content:'';position:absolute;inset:100px 19px 20px;z-index:0;pointer-events:none;border:2px solid var(--edge-a);border-right-color:var(--edge-b);border-radius:10px;box-shadow:-3px 0 13px var(--edge-a),3px 0 13px var(--edge-b),inset 0 0 16px #3ff3ff42;background:radial-gradient(circle at 17% 24%,#e8ecff 0 .7px,transparent 1.5px),radial-gradient(circle at 70% 60%,#9edfff 0 .7px,transparent 1.5px),radial-gradient(circle at 40% 90%,#e7b5ff 0 .7px,transparent 1.5px),radial-gradient(ellipse at 70% 70%,#52276b55,transparent 55%),linear-gradient(150deg,#10172e,#0a1022);background-size:107px 143px,181px 173px,137px 211px,100% 100%,100% 100%}
.bookshelf-cabinet:after{content:'';position:absolute;inset:105px 24px 25px;pointer-events:none;z-index:0;background:radial-gradient(circle at 23% 22%,#fff 0 1px,transparent 2px),radial-gradient(circle at 81% 58%,#fff 0 1px,transparent 2px);background-size:173px 227px,229px 173px;opacity:.35}
.home-finish-3 .bookshelf-cabinet:after{animation:bookshelf-twinkle 7s ease-in-out infinite alternate}
@keyframes bookshelf-twinkle{to{opacity:.8}}
.bookshelf-crown{position:absolute;inset:6px 8px auto;height:92px;border-bottom:1px solid #445375;border-radius:14px 14px 0 0;background:linear-gradient(125deg,#202b40,#101725 50%,#232239);pointer-events:none}
.bookshelf-post-left,.bookshelf-post-right{position:absolute;top:102px;bottom:23px;width:var(--post);z-index:2;box-sizing:border-box;background:linear-gradient(90deg,#172237,#0b0f1c,#263249);pointer-events:none;display:grid;place-items:center}
.bookshelf-post-left{left:1px;border-right:2px solid var(--edge-a)}.bookshelf-post-right{right:1px;border-left:2px solid var(--edge-b)}
.bookshelf-rail-star{font-size:18px;color:var(--edge-a);background:#101727;line-height:2}.bookshelf-post-right .bookshelf-rail-star{color:var(--edge-b)}
.bookshelf-rail{position:absolute;left:28px;right:28px;bottom:12px;height:3px;background:linear-gradient(90deg,var(--edge-a),var(--edge-b));pointer-events:none}
.bookshelf-circuits{position:absolute;inset:0;width:100%;height:100%;color:var(--edge-a);opacity:.6;pointer-events:none;z-index:3}
.bookshelf-progress{position:absolute;left:var(--post);right:var(--post);top:22px;height:70px;display:flex;align-items:center;justify-content:center;gap:12px;z-index:4;color:var(--ink);font:600 12px/1.5 Michroma,"Space Grotesk",system-ui,sans-serif}
.bookshelf-ring{width:64px;height:64px;flex:none;filter:drop-shadow(0 0 5px #3ff3ff66)}
.bookshelf-ring-fill{stroke-linecap:butt}
.bookshelf-rank{border:1px solid #ffd46a88;border-radius:999px;padding:7px 12px;background:var(--panel);color:#ffe3a0;white-space:nowrap}
.bookshelf-cabinet .home-group-head{position:relative;z-index:2;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 8px;min-height:40px;margin:0;padding:5px 6px;box-sizing:border-box;border-top:3px solid var(--tier);border-bottom:1px solid #ffffff33;background:linear-gradient(var(--wash),#0b1023e6);box-shadow:0 -6px 21px var(--wash),inset 0 2px #ffffff66}
.bookshelf-cabinet .home-group-title{margin:0;padding:4px 12px;border:1px solid var(--tier);border-radius:999px;color:var(--ink);background:#0a0c1a;font:500 10px/1.5 Michroma,"Space Grotesk",system-ui,sans-serif;letter-spacing:.02em;text-transform:none;text-align:center}
.bookshelf-cabinet .home-group-count{font:600 11px/1.5 "Space Grotesk",system-ui,sans-serif;color:var(--ink);background:#0a0c1a;border:1px solid var(--line);border-radius:999px;padding:4px 8px}
.bookshelf-cabinet .bookshelf-rack{--gap:196px;--pitch:222px;display:flex;flex-wrap:wrap;align-items:flex-end;align-content:flex-start;gap:26px 4px;position:relative;margin:0;padding:14px 12px 0;border:0;border-radius:0;min-width:0;max-width:none;box-sizing:border-box;background-image:repeating-linear-gradient(to bottom,transparent 0 calc(var(--gap) - 32px),var(--wash) calc(var(--gap) - 1px),var(--tier) var(--gap) calc(var(--gap) + 3px),#ffffff44 calc(var(--gap) + 3px) calc(var(--gap) + 5px),var(--wash) calc(var(--gap) + 5px) calc(var(--gap) + 14px),#0b0f1c calc(var(--gap) + 14px) var(--pitch)),linear-gradient(0deg,var(--wash),transparent 80%);background-position:0 14px,0 0;box-shadow:inset 0 8px 16px #0006}
.bookshelf-spine{appearance:none;position:relative;display:flex;align-items:flex-end;justify-content:center;box-sizing:border-box;flex:0 0 auto;width:max(44px,var(--book-width));min-width:44px;min-height:44px;height:196px;padding:0;border:0;border-radius:0;background:transparent;color:#fff0cb;cursor:pointer;touch-action:manipulation;font:600 12px/1.3 Georgia,serif;box-shadow:none;filter:none;text-align:center}
.bookshelf-binding{position:relative;display:flex;align-items:center;justify-content:space-between;flex-direction:column;box-sizing:border-box;width:var(--book-width,40px);height:var(--book-height,175px);padding:24px 4px 16px;border:1px solid #e6c37b66;border-top:3px solid #d9bb76;border-bottom:3px solid #d9bb76;border-radius:4px 6px 2px 2px;background:linear-gradient(90deg,#0007,transparent 18%,#fff1 30%,transparent 48%,#0003 78%,#0007),var(--book-color);box-shadow:inset 2px 0 1px #fff2;transition:translate .16s;transform-origin:bottom center}
/* A 5-degree tilt consumes at most 17px horizontally; reserve 18px within its button. */
.bookshelf-spine.is-leaning .bookshelf-binding{width:calc(var(--book-width) - 18px);height:calc(var(--book-height) - 8px);transform:translate(-8px,-2px) rotate(var(--book-lean));padding-left:1px;padding-right:1px}
.bookshelf-binding:before,.bookshelf-binding:after{content:'';position:absolute;left:2px;right:2px;pointer-events:none;z-index:1}
.tooling-0 .bookshelf-binding:before,.tooling-0 .bookshelf-binding:after{height:5px;border-block:1px solid #d7b36c;top:9px}.tooling-0 .bookshelf-binding:after{top:auto;bottom:8px}
.tooling-1 .bookshelf-binding:before{top:10px;height:5px;border-radius:3px;background:linear-gradient(#d7b36c88,#ffffff22,#000a);box-shadow:0 42px 0 #090b154d,0 84px 0 #090b154d,0 121px 0 #090b154d}
.tooling-2 .bookshelf-spine-title{padding:6px 3px;max-height:calc(var(--book-height) - 64px);background:#100e1cbb;border:1px solid #cda65a}
.tooling-3 .bookshelf-binding:before{inset:9px 4px;border:3px double #d3ad63;border-radius:8px 8px 3px 3px}.tooling-3 .bookshelf-binding:after{inset:15px 7px;border-block:3px dotted #e4c681}
.home-case-gold .bookshelf-spine-star{font-size:15px}
.bookshelf-spine-title{position:relative;z-index:2;writing-mode:vertical-rl;box-sizing:border-box;max-height:calc(var(--book-height) - 50px);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 1px #100906}
.bookshelf-spine-star{font-size:11px;color:#ffe2a0;line-height:1}
.bookshelf-spine:hover .bookshelf-binding{translate:0 -4px}
.bookshelf-spine:focus-visible{outline:3px solid #d1ffb1;outline-offset:0;background:#ffffff14;border-radius:4px;z-index:4}
.bookshelf-tail{display:flex;flex-wrap:nowrap;align-items:flex-end;gap:4px;flex:1 0 auto;width:max-content;height:196px}
.bookshelf-slot{flex:none;height:140px;width:36px;margin:0 4px;border:2px dashed var(--tier);box-sizing:border-box;border-radius:4px 6px 2px 2px;background:linear-gradient(0deg,var(--wash),transparent);animation:bookshelf-slot-pulse 3.5s ease-in-out infinite alternate;pointer-events:none}
@keyframes bookshelf-slot-pulse{to{opacity:.45}}
.home-case.is-empty .bookshelf-rack{--gap:156px;--pitch:182px;min-height:170px}
.bookshelf-empty{font-size:13px;line-height:1.5;margin:8px 0 0;color:#ddd7e9}
.bookshelf-legend{max-width:960px;margin:20px auto 0;display:grid;gap:14px}
.bookshelf-legend-row{display:grid;grid-template-columns:10px auto 1fr;gap:4px 8px;align-items:baseline;font:12px/1.5 system-ui}
.bookshelf-swatch{height:9px;width:9px;border-radius:2px;background:currentColor}
.bookshelf-rule{color:#dfe3f5}.bookshelf-legend-row .bookshelf-count{grid-column:2/-1;margin:0;font:11px/1.5 system-ui;color:#bdc6e1}
.bookshelf-legend-row>.home-bar{grid-column:2/-1;height:7px;border-radius:999px;background:#101629;border:1px solid var(--line)}
.bookshelf-legend-row>.home-bar i{background:linear-gradient(90deg,var(--tier),#e8ecff)}
.bookshelf-legend-row>.bookshelf-empty,.bookshelf-legend-row>.bookshelf-link,.bookshelf-legend-row>.home-almost,.bookshelf-legend-row>.bookshelf-note{grid-column:2/-1;margin:0}
.bookshelf-ring-rule{font:12px/1.6 system-ui;color:#bdc6e1;margin:0}
.bookshelf-link{min-height:44px;box-sizing:border-box;color:#d5c7ff;overflow-wrap:anywhere}.bookshelf-wood-link{display:block;font-size:13px}
/* Ornaments live inside the last-book/slot tail, never as a wrapping rack item. */
.bookshelf-decor-space{container-type:inline-size;flex:1 0 0;min-width:0;width:0;margin-left:-4px;height:196px;overflow:hidden;pointer-events:none;align-self:flex-end}
.bookshelf-decor{display:none;width:68px;height:100%;margin-left:auto;align-items:flex-end;justify-content:space-around;padding:0 4px;box-sizing:border-box}
@container (min-width:72px){.bookshelf-decor{display:flex}}
.is-empty .bookshelf-tail{height:156px}
.bookshelf-ornament{position:relative;display:block;flex:none;box-sizing:border-box}
.decor-globe{width:60px;height:87px;border-bottom:5px solid #617b99;border-radius:5px;background:linear-gradient(90deg,transparent 44%,#517d9b 45% 54%,transparent 55%)}
.decor-globe:before{content:'';position:absolute;top:0;left:0;width:58px;height:58px;border:1px solid #80faff;border-radius:50%;background:repeating-linear-gradient(0deg,transparent 0 13px,#69dfee66 14px,transparent 15px),radial-gradient(ellipse at 30% 35%,#a4ffdc 0 8%,transparent 9%),radial-gradient(ellipse at 62% 65%,#49d5ba 0 14%,transparent 15%),radial-gradient(circle at 30% 25%,#3d99bf,#123c5e 65%,#0b1a3a)}
.decor-globe:after{content:'';position:absolute;inset:0 17px 25px;border:1px solid #8bf6ff88;border-radius:50%;transform:rotate(-18deg)}
.decor-lantern{height:82px;width:38px;border:3px solid #69809e;border-top-width:9px;border-bottom-width:7px;border-radius:35% 35% 10% 10%;background:radial-gradient(ellipse at 50% 65%,#eaffff 0 9%,#69efffaa 10% 22%,#4faaff33 35%,#111a32 65%)}
.decor-lantern:before{content:'';position:absolute;top:-22px;left:9px;width:12px;height:15px;border:2px solid #8db0cc;border-radius:50%}
.decor-tablet{height:90px;width:36px;border:3px solid #5aa4bf;border-radius:6px;background:repeating-linear-gradient(0deg,transparent 0 12px,#4df4ff33 13px 14px),linear-gradient(140deg,#65ebff66,#12324f 50%,#85f8ff66);transform:skewY(-5deg)}
.dictionary-stand{width:100%;max-width:620px;margin:12px 0 0;--post:24px;padding-top:44px}
.dictionary-stand:before{top:36px}.dictionary-stand:after{top:40px}.dictionary-stand .bookshelf-crown{height:30px}.dictionary-stand .bookshelf-post-left,.dictionary-stand .bookshelf-post-right{top:36px}
.dictionary-stand .home-dicts{--gap:168px;--pitch:194px;display:grid;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));grid-auto-rows:168px;gap:26px 6px}
.dictionary-stand .home-dict{min-width:44px;min-height:44px;width:100%;max-width:58px;margin:0;justify-self:center;filter:none;box-shadow:none;animation:none}
.dictionary-stand .home-dict.is-earned{padding:20px 3px 17px;border:1px solid #bda16d;border-top:3px solid #d9bb76;border-bottom:3px solid #d9bb76;background:linear-gradient(90deg,#0006,transparent 25%,#fff1 55%,#0005),var(--book-color);color:#fff0cb;text-shadow:0 1px 1px #160d08;box-shadow:none}
.dictionary-stand .home-dict.is-earned:before{inset:8px 2px auto;height:4px;background:none;border-block:1px solid #d9bb76;border-radius:0;transform:none;box-shadow:none;width:auto;margin:0}
.dictionary-stand .home-dict.is-earned:after{inset:auto 2px 8px;height:4px;background:none;border:0;border-block:1px solid #d9bb76;box-shadow:none;width:auto}
.dictionary-stand .home-dict-title{color:inherit;max-height:calc(var(--h) - 40px);text-shadow:inherit}
.dictionary-stand .home-dict.is-earned .home-dict-title{color:#fff0cb;max-height:calc(var(--h) - 56px);flex-shrink:1;text-shadow:0 1px 1px #160d08}
.dictionary-stand .home-dict.is-earned .home-dict-mark{flex-shrink:0}
.dictionary-stand .home-dict.is-locked{border:1px dashed #72e5f4;color:#d1f7ff;background:linear-gradient(0deg,#3ff3ff18,#101627);text-shadow:none}
.dictionary-stand .home-dict.is-locked .home-dict-mark{opacity:1}
@media(max-width:520px){.bookshelf-card{padding:16px 8px}.bookshelf-cabinet{--post:10px}.bookshelf-cabinet:before{left:8px;right:8px}.bookshelf-cabinet:after{left:12px;right:12px}.bookshelf-rail-star{font-size:10px}.bookshelf-circuits{opacity:.35}.bookshelf-cabinet .bookshelf-rack{padding-left:6px;padding-right:6px}.bookshelf-cabinet .home-group-title{font-size:9px;padding:4px 8px}.bookshelf-cabinet .home-group-count{font-size:10px}.bookshelf-legend-row{grid-template-columns:10px 1fr}.bookshelf-rule{grid-column:2}.bookshelf-cabinet .home-group-head{gap:4px}.bookshelf-progress{gap:6px;font-size:10px}.bookshelf-ring{width:48px;height:48px}.bookshelf-rank{padding:5px 7px}}
/* Compact decorative slot keeps five full-size hit targets plus the slot on a 375px plank. */
@media(max-width:520px){.story-cabinet .bookshelf-rack{column-gap:2px}.bookshelf-tail{gap:2px}.bookshelf-slot{width:22px;margin:0}.bookshelf-decor-space{margin-left:-2px}}
@media(max-width:340px){.bookshelf-progress{display:grid;grid-template-columns:48px auto;gap:0 6px}.bookshelf-ring{grid-row:1/3}.bookshelf-rank{padding:1px 6px;justify-self:start}}
@media(prefers-reduced-motion:reduce){.bookshelf-card *,.bookshelf-card *:before,.bookshelf-card *:after,.bookshelf-card:before,.bookshelf-card:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.bookshelf-slot,.home-finish-3 .bookshelf-cabinet:after{animation:none!important}.bookshelf-spine:hover .bookshelf-binding{translate:none}}
.bookshelf-button:focus-visible,.bookshelf-link:focus-visible{outline:3px solid #d1ffb1;outline-offset:3px}
/* Full selected titles stay in flow; growing text never shifts the tapped spine. */
.bookshelf-full-title{position:relative;z-index:2;box-sizing:border-box;min-width:0;margin:0;padding:10px 12px;color:#fff0cb;background:#101727;font:600 1rem/1.5 system-ui,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;text-align:start}
.bookshelf-full-title[hidden]{display:none}
.bookshelf-spine[data-title-current]:not(:focus-visible),.home-dict[data-title-current]:not(:focus-visible){outline:2px solid #fff0cb;outline-offset:0}
