/* Midnight magic: joy belongs to actions, not an endlessly animating background. */
:root{--midnight:#10172f;--starlight:#ffdf76;--starpink:#ff9fc8;--starlilac:#c7a7ff}
.magic-burst{position:fixed;width:0;height:0;z-index:80;pointer-events:none}
.magic-burst i{font-style:normal;position:absolute;top:0;left:0;font-size:19px;color:var(--starlight);text-shadow:0 0 9px #ffc752;animation:magic-pop .72s ease-out forwards}
.magic-burst i:nth-child(3n+2){color:var(--starpink)}
.magic-burst i:nth-child(3n){color:var(--starlilac)}
@keyframes magic-pop{0%{opacity:0;transform:translate(0,0) scale(.2)}20%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.4)}}
.magic-shooting-star{position:fixed;pointer-events:none;z-index:80;width:66px;height:3px;border-radius:50%;background:linear-gradient(90deg,transparent,#fff2cc,var(--starlight));filter:drop-shadow(0 0 6px #ffd062);transform:rotate(-30deg);animation:magic-shoot .7s ease-out both}
.magic-shooting-star:after{content:'✦';position:absolute;right:-6px;top:-10px;color:var(--starlight);font-size:20px}
@keyframes magic-shoot{0%{opacity:0;translate:-70px 45px}22%{opacity:1}100%{opacity:0;translate:185px -105px}}
/* The main room stays calm while interactions carry the sparkle. */
body{background:#10152c}
.night-sky{background:radial-gradient(ellipse at 20% -15%,#423065 0,transparent 49%),radial-gradient(ellipse at 93% 64%,#283665 0,transparent 42%),#10152c}
.night-sky i{color:#ffdd81;opacity:.7;text-shadow:0 0 17px #ffbe7388}
.night-sky i:nth-child(2n){color:#e7b6ff}
.hero{border-bottom-color:#635479}
.brand-row h1{color:#fff0d5;text-shadow:0 3px 28px #ffc9591c}
.brand-row h1 em{color:var(--starlilac)}
.title-star{color:var(--starlight);text-shadow:0 0 15px #ffd26c99}
.moon{color:var(--starlight);text-shadow:0 0 52px #ffc9689c}
.overline,.section-kicker{color:var(--starpink)}
.stats strong{color:var(--starlight)}
.primary-action,.enrich-button{background:var(--starlight);color:#2b2140}
.enrich-card{border-color:#594d7d;background:linear-gradient(115deg,#302a4e,#222941)}
.tabs button.active{color:var(--starlight);border-bottom-color:var(--starlight)}
.feed-tools>button{border-color:#68608d;background:#2f2b49}
#btn-stack{background:var(--starlight);border-color:var(--starlight);color:#281e3c}
.reading-room{margin-top:31px}
.section-heading h2{color:#fff0d9}
.tweet-card{background:#fff2e4;border:1px solid #fff8f0;border-radius:20px 19px 22px 18px;box-shadow:0 10px 27px #090a233c}
.tweet-card:nth-child(4n+2){background:#eee6ff}
.tweet-card:nth-child(4n+3){background:#fae2ed}
.tweet-card:nth-child(4n+4){background:#fff1cd}
.tweet-text{font-family:var(--font-display);font-size:18px;line-height:1.48;color:#2f2940}
.avatar-star{color:#794e89;background:#ffe4ed}
.mini-action.accent{color:#9b365f}
.tweet-card.was-read{opacity:.72}
.sync-panel{border-color:#5a507d;background:linear-gradient(110deg,#332947,#262744)}
/* Reader-first home module */
#home-discovery[hidden],#capsule[hidden]{display:none}
.home-discovery{padding-top:26px}
.home-kicker{font-size:10px;font-weight:700;color:var(--starpink);letter-spacing:.18em;text-transform:uppercase}
.home-title{font:normal clamp(27px,5vw,36px) var(--font-display);letter-spacing:-.02em;color:#ffe9cb;margin:6px 0 16px}
.home-resume{position:relative;isolation:isolate;overflow:hidden;border-radius:23px;border:0;background:#34304d;padding:23px 24px}
.home-resume h3{font:normal 29px var(--font-display);color:#fff1df;margin:9px 0 4px}
.home-resume p{font-size:12px;color:#d0bfdc;margin:5px 0 14px}
.home-progress{height:5px;border-radius:8px;background:#b6a5c04d;overflow:hidden;margin:17px 0}
.home-progress span{display:block;height:100%;background:linear-gradient(90deg,var(--starpink),var(--starlight));border-radius:8px}
.home-resume button{position:relative;border:0;border-radius:13px;background:var(--starlight);color:#2d233d;font-size:13px;font-weight:700;min-height:44px;padding:10px 17px}
.home-journeys{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin-top:12px}
.home-journeys button{border-radius:18px;border:1px solid #725f8e;padding:17px;min-height:110px;color:#f9eafb;background:linear-gradient(140deg,#413151,#28263f);text-align:left;display:flex;flex-direction:column;gap:4px}
.home-journeys button:last-child{background:linear-gradient(140deg,#39335f,#293a55)}
.home-journeys .journey-icon{font-size:28px;line-height:1;color:var(--starlight);text-shadow:0 0 16px #f7c95766;margin-bottom:9px}
.home-journeys strong{font-size:14px}
.home-journeys small{font-size:11px;color:#c8bbd5}
.home-journeys button:last-child .journey-icon{color:var(--starpink)}
/* An accessible author list sits below the visual constellation. */
.constellation-wrap{padding:19px 19px 12px;border:1px solid #675a86;border-radius:22px;background:radial-gradient(circle at 50% 5%,#403567,#1b2440 76%);overflow:hidden;margin-bottom:17px}
.constellation-head{display:flex;align-items:center;justify-content:space-between;gap:9px}
.constellation-head strong{font:normal 23px var(--font-display);color:#ffe7bb}
.constellation-head small{color:#c8badd;font-size:10px}
.constellation-sky{position:relative;height:243px;margin:14px 0 0}
.constellation-sky svg{width:100%;height:100%;position:absolute;inset:0;overflow:visible;pointer-events:none}
.constellation-sky line{stroke:#f6ca8477;stroke-width:.4;stroke-dasharray:1.4 2.4}
.constellation-node{position:absolute;translate:-50% -50%;width:47px;height:47px;border:0;border-radius:50%;background:transparent;color:var(--starlight);display:grid;place-items:center;text-shadow:0 0 10px #f6c858bc}
.constellation-node:nth-of-type(3n+2){color:var(--starpink)}
.constellation-node:nth-of-type(4n+3){color:var(--starlilac)}
.constellation-node .star-glyph{line-height:1;transition:transform .18s}
.constellation-node:hover .star-glyph,.constellation-node:focus-visible .star-glyph{transform:scale(1.28)}
.constellation-node .star-label{position:absolute;top:36px;left:50%;transform:translateX(-50%);width:max-content;max-width:140px;padding:4px 7px;border:1px solid #736084;background:#292745;border-radius:7px;color:#ffe9d1;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:0;pointer-events:none}
.constellation-node:hover .star-label,.constellation-node:focus-visible .star-label,.constellation-node.selected .star-label{opacity:1}
.author-tile{background:#2b2d4c;border-color:#60547d}
.author-tile:nth-child(5n + 1){background:#413352}.author-tile:nth-child(5n + 3){background:#453551}
.tile-star{color:var(--starlight)}
.author-tile.selected{outline-color:var(--starlight)}
/* Time capsule uses real publication years, never invented like dates. */
.capsule-intro{background:linear-gradient(120deg,#403258,#292a48);border:1px solid #82698d;border-radius:21px;padding:22px 24px;margin:22px 0 13px}
.capsule-intro h2{font:normal 33px var(--font-display);color:#ffebce;margin:6px 0}
.capsule-intro p{font-size:12px;color:#c8b9d7;max-width:570px;margin:7px 0}
.capsule-years{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0 6px}
.capsule-years button{border-radius:50px;background:#302c4c;color:#d9c9ee;border:1px solid #64577d;font-size:12px;min-width:65px;padding:9px 13px}
.capsule-years button.active{background:var(--starlight);color:#30243c;border-color:var(--starlight);font-weight:700}
.capsule-note{font-size:11px;color:#aeb0c5;margin:8px 0 4px}
@media(max-width:620px){
.home-discovery{padding-top:16px}.home-resume{padding:20px}.home-resume h3{font-size:25px}.home-journeys button{min-height:116px;padding:14px}
.constellation-sky{height:225px}
.tweet-text{font-size:19px}
}
@media(prefers-reduced-motion:reduce){
.magic-burst,.magic-shooting-star{display:none}
.constellation-node .star-glyph{transition:none}
}

/* Keep low-frequency maintenance tools one intentional tap away. */
.setup-drawer{margin:16px 0 8px;border:1px solid #62577f;border-radius:16px;background:#26243e;overflow:hidden}
.setup-drawer>summary{list-style:none;cursor:pointer;color:#d5bfdc;padding:14px 17px;font-size:12px;display:flex;justify-content:space-between;gap:15px;align-items:center}
.setup-drawer>summary::-webkit-details-marker{display:none}
.setup-drawer>summary>span{color:var(--starlight)}
.setup-drawer[open]{padding:0 13px 13px}
.setup-drawer[open]>summary{padding:14px 4px;border-bottom:1px solid #554869}
.setup-drawer .sync-panel{margin:13px 0 6px}
.setup-drawer .enrich-card{margin:12px 0 0}
.setup-drawer:focus-within{border-color:#ad8cbb}
@media(max-width:620px){.setup-drawer[open]{padding:0 9px 9px}}


#file-toolbar[hidden],#random-discovery[hidden]{display:none}
.setup-drawer .toolbar-line{margin:13px 4px 0;padding-top:13px;border-top:1px solid #5b4e6f}
/* A compact random reveal stage, separate from the stack reader. */
.reading-room.random-reading-hidden{display:none}
.random-stage{width:min(100%,710px);margin:18px auto 0;display:grid;gap:12px;scroll-margin-top:16px}
.random-intro{position:relative;text-align:center;padding:14px 16px 5px;margin:0;border-radius:22px;background:radial-gradient(ellipse at 50% 58%,#443455a6 0,transparent 61%)}
.random-topline{display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left}
.random-count{font-size:12px;color:#bcb0cf;white-space:nowrap}
.random-intro h2{font:500 clamp(30px,4.2vw,43px)/1.15 var(--font-display);margin:8px 0 2px;color:#ffeed8}
.random-intro h2 span{color:var(--starlight)}
.random-intro p{color:#c8b9d5;font-size:14px;margin:3px 0 0}
.wish-button{display:grid;place-items:center;position:relative;width:98px;height:98px;margin:8px auto 0;border:1px solid #ffdb7e77;border-radius:50%;background:transparent;color:var(--starlight);box-shadow:none;isolation:isolate}
.wish-button span{font-size:66px;line-height:1;text-shadow:none}
.wish-button:focus-visible{outline:2px solid var(--starlight);outline-offset:4px}
.random-year-roulette{height:17px;font:600 11px/17px var(--font-ui);letter-spacing:.16em;color:#ffde83;opacity:0}
#random-discovery.is-casting .wish-button{animation:random-cast .45s ease-out;box-shadow:0 0 46px #fbd27470}
#random-discovery.is-casting .random-year-roulette{opacity:1}
.random-card-shell{display:grid;gap:10px}
.random-found-label{font:700 11px/1.5 var(--font-ui);letter-spacing:.13em;color:#f2d38f;text-align:center}
.random-reveal{min-width:0;scroll-margin-top:16px}
.random-reveal .tweet-card{max-width:660px;margin-inline:auto}
.random-reveal .tweet-text{font-size:clamp(19px,2.5vw,25px);line-height:1.5}
.random-reveal.is-leaving{opacity:0;transform:translateY(6px) scale(.99);filter:blur(3px);transition:opacity .15s ease-out,transform .15s ease-out,filter .15s ease-out}
.random-reveal.is-arriving{animation:random-arrive .48s cubic-bezier(.2,.75,.3,1) both}
.random-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.random-next,.random-stack-cta{display:inline-flex;align-items:center;justify-content:center;min-height:46px;border-radius:14px;padding:10px 20px;font:700 14px var(--font-ui)}
.random-next{background:var(--starlight);color:#281e3c;box-shadow:0 5px 24px #ecc96626}
.random-stack-cta{background:#312a49;color:#e8d8f3;border:1px solid #665577}
.random-next:focus-visible,.random-stack-cta:focus-visible{outline:2px solid #fbe08c;outline-offset:3px}
@keyframes random-cast{30%{transform:scale(.93)}65%{transform:scale(1.045)}}
@keyframes random-arrive{0%{opacity:0;transform:translateY(12px) scale(.988);filter:blur(5px)}65%{filter:blur(0)}100%{opacity:1;transform:none;filter:none}}
@media(prefers-reduced-motion:reduce){.wish-button span,.random-reveal.is-arriving,#random-discovery.is-casting .wish-button{animation:none}.random-reveal.is-leaving{transition:none}}
#enrich-tools[hidden]{display:none}
