/* AC187–AC189: fixed shell, contained chapter list and advancing reward window. */
#online.chapter-stars-view #content{display:flex;flex-direction:column;min-height:0}
.chapter-stars-panel{flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;margin:0;padding:12px}
.chapter-stars-panel.is-detail{flex:1;min-height:0}
.chapter-stars-panel.is-detail .star-screen-body{flex:1;min-height:0}
.star-screen-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.star-screen-head>b{margin-left:auto}
#modal .chapter-stars-help p{font-size:15px}
#online .star-screen-head h1{font:27px/1.1 Lucky;margin:0}
.star-screen-head>b{display:flex;align-items:center;gap:5px;color:#845220;font:24px/1 Lucky;white-space:nowrap}
.star-screen-head>b .chapter-star-art{width:30px;height:30px}
.star-screen-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:12px}
.chapter-stars-panel.is-long-total .star-screen-body{gap:8px}
.chapter-stars-panel.is-long-total h1{text-wrap:balance}
#online .star-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
#online .star-tabs>.secondary{min-width:0;padding-inline:6px}
.star-chapter-head{display:grid;grid-template-columns:1fr auto;gap:4px;align-items:center;padding:10px;border:2px solid #ad8959;border-radius:14px;background:#f0cf99}
#online .star-chapter-head h2{margin:0;font-size:25px;line-height:1.1}
.star-chapter-head p{grid-column:1/-1;margin:0;font-size:14px;font-weight:700}
.chapter-star-marks{display:flex;gap:3px}
.chapter-star-marks i{font:30px/1 Lucky;font-style:normal;color:#8b8491;-webkit-text-stroke:1.5px #493c43;paint-order:stroke fill}.chapter-star-marks i.earned{color:#ffc64d}
.chapter-star-art{display:block;width:28px;height:28px;object-fit:contain;flex:none}
.chapter-star-art:not(.earned){filter:grayscale(1) brightness(.7);opacity:.65}
.star-chapter-list{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;padding:4px}
.star-list-space{position:relative}
#online .star-chapter-row{position:absolute;left:0;right:0;display:flex;align-items:center;justify-content:space-between;gap:8px;height:80px;min-height:80px;margin:0;padding:10px;border:2px solid #ad8959;border-radius:14px;background:#f0cf99;box-shadow:0 3px #98764f;color:#243b49;text-align:left}
.star-row-text{display:flex;flex-direction:column;gap:4px;min-width:0}
.star-row-text>b{font:22px/1.1 Lucky}.star-row-text>span{font:700 14px/1.2 system-ui}
.star-chapter-row .chapter-star-art{width:24px;height:24px}
#online #story-overlay .hub-route-arrows .chapter-stars-entry{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:88px;min-width:88px;height:44px;min-height:44px;padding:4px 8px;border:0;background:none;box-shadow:none;isolation:isolate}
#online #story-overlay .hub-route-arrows .chapter-stars-entry:is(:active,.is-pressed){transform:translate(-50%,-50%);scale:1}
#online #story-overlay .hub-route-arrows .chapter-stars-entry:is(:active,.is-pressed):before,#online #story-overlay .hub-route-arrows .chapter-stars-entry:is(:active,.is-pressed) .chapter-star-marks{scale:.94}
#online #story-overlay .hub-route-arrows .chapter-stars-entry:before{content:'';position:absolute;inset:4px 0;border:2px solid var(--ink-plum-2);border-radius:999px;background:linear-gradient(var(--gold-50),#d9b576);box-shadow:inset 0 2px #fff9dd,0 3px #19151fa0;z-index:-1}
.chapter-stars-entry .chapter-star-art{width:22px;height:22px}
.star-objectives{display:flex;flex-direction:column;gap:10px;list-style:none;margin:0;padding:0}
.star-objectives li{display:grid;grid-template-columns:28px 1fr 20px;gap:8px;align-items:center;min-height:62px;padding:8px;border:2px solid #ba9c75;border-radius:var(--vs-radius);background:#e9d2ac;color:#615562;font:800 16px/1.3 system-ui}
.star-objectives li.earned{color:#306c3a;background:#e7d5a5}
@media(max-height:850px){.chapter-stars-panel.is-long-total .star-objectives li{min-height:44px;padding-block:5px}}
.star-objectives b{font-size:24px}
.star-start-row{display:flex;gap:10px;flex:none;margin-top:auto}
#online .star-start-row>button{flex:1;margin:0}.star-start-row .button-cost{display:inline-flex;align-items:center;gap:4.5px;margin-left:12px}.star-start-row .button-cost img{width:24px;height:24px}
#online .star-start-row .primary{min-height:56px;padding:9px 10px;font-size:25px;line-height:1.1}
#online .star-start-row button .button-cost{column-gap:3.5px!important}
#online .chapter-launch button .button-cost{column-gap:4.2px!important}
.star-energy-note{text-align:center}
.star-track{display:flex;flex:1;flex-direction:column;min-height:0;gap:12px}.star-track>p{margin:0;text-align:center;font-size:14px}
.star-track-rows{flex:1;display:flex;flex-direction:column;gap:14px;padding:0;margin:0;list-style:none}
.star-track-row{flex:none;display:grid;grid-template-columns:52px minmax(0,1fr) 88px;gap:8px;align-items:center;min-height:68px;padding:8px;border:2px solid #aa895c;border-radius:14px;background:#edcf9c;box-shadow:0 3px #98764f}
.star-track-at{display:flex;align-items:center;gap:3px;font:21px/1 Lucky;color:#835b27}.star-track-at .chapter-star-art{width:23px;height:23px}.star-track-loot{display:flex;flex-wrap:wrap;gap:5px}.star-reward-item{display:inline-flex;align-items:center;gap:3px;font:17px/1 Lucky}.star-reward-item img{width:25px;height:25px;object-fit:contain}
#online .star-track-row .secondary{box-sizing:border-box;margin:0;width:88px;min-width:88px;max-width:88px;height:44px;min-height:44px;font-size:16px;padding:4px 12px}
.star-track-state{min-width:0;text-align:center;font-size:13px;font-weight:800;overflow-wrap:normal;word-break:normal;hyphens:manual}
.chapter-launch{display:flex;gap:10px;align-items:center}.chapter-launch>button:first-child{flex:1}.chapter-launch>button:last-child:not(:first-child){min-width:100px;font-size:21px}
#modal .star-auto-confirm>.primary{width:100%;min-height:var(--tier-full-h);margin:0;font-size:var(--tier-full-fs)}
#modal .star-auto-confirm .confirm-actions{display:flex;gap:14px;margin-top:14px}
#modal .star-auto-confirm .confirm-actions>button{flex:1;min-height:56px;margin:0}
#modal .star-auto-confirm .confirm-actions>.secondary{display:flex;flex-direction:row;align-items:center;justify-content:center}
#modal .star-auto-confirm .confirm-actions>.back-arrow{flex:none;display:grid;place-items:center;width:54px;height:56px;padding:3px;border:2px solid var(--ink-plum-2);border-radius:15px;background:linear-gradient(145deg,#aaa2b8,#857d99 70%,#79718b);box-shadow:inset 0 2px 0 #d9d0e1,inset 2px 0 0 #bcb2c9,inset -2px -3px 0 #6c637d,0 3px 0 var(--panel-night)}
#modal .star-auto-confirm .back-arrow svg{width:43px;height:32px;overflow:visible}
#modal .star-auto-confirm .button-cost{display:inline-flex;align-items:center;column-gap:3.5px!important;margin-left:12px}
#modal .star-auto-confirm .button-cost img{width:24px;height:24px;object-fit:contain}
@media(max-height:800px){.chapter-stars-panel{gap:8px;padding:10px}.star-screen-body{gap:8px}.star-objectives{gap:8px}.star-objectives li{min-height:47px;padding:6px;font-size:15px}.star-track-rows{gap:10px}.star-track-row{min-height:68px;padding:8px}.star-chapter-head{padding:6px}}

/* AC351: row faces sit inside a concentric well. Bottom padding includes the
   standard 3px hard drop, leaving the same visible 8px inset on every side. */
.star-chapter-list,.star-track-rows{padding:8px 8px 11px;border-radius:16px;background:#5a4030;box-shadow:inset 0 2px var(--vs-ink)}
.star-track-rows{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;gap:11px}
#online :is(.star-track-row,.star-chapter-row){border:var(--vs-outline) solid var(--vs-ink);border-radius:8px;box-shadow:0 3px 0 var(--vs-ink)}

/* AC520: safe-top belongs to the shell once; clear the HUD's hanging profile rim.
   Only the bounded/virtual chapter list scrolls. Goals and Start stay fixed. */
#online.chapter-stars-view #content{padding-top:18px;overflow:hidden}
#online .star-chapter-row.is-current{border-color:#c99029;background:linear-gradient(var(--gold-100),#f0cb77);box-shadow:inset 0 0 0 2px var(--shine-100),0 3px var(--vs-ink)}

/* b132 star row (ui-components.ts uiStarRow): equal slots in one straight row on the Story star pill plate
   (.chapter-stars-entry); earned = the chapter star art, unearned = an inset socket in the star's shape. */
.star-row{--sr:30px;position:relative;display:inline-flex;align-items:center;justify-content:center;gap:calc(var(--sr) * .14 + 4px);padding:calc(var(--sr) * .14) calc(var(--sr) * .4);isolation:isolate;vertical-align:middle}
.star-row.is-sm{--sr:20px}.star-row.is-lg{--sr:36px}
/* b148 AC707/AC708: stars 6–10 repaint the five sockets in the collection high-tier pink (#ff4f7a). */
.star-slot.is-high .star-row-star{filter:drop-shadow(0 2px 0 #1b172a80) hue-rotate(-52deg) saturate(1.35) brightness(1.04)}
.star-row::before{content:'';position:absolute;z-index:-1;left:0;right:0;top:calc(var(--sr) * .12);bottom:calc(var(--sr) * .02);border:2px solid var(--ink-plum-2);border-radius:999px;background:linear-gradient(var(--gold-50),#d9b576);box-shadow:inset 0 2px #fff9dd,inset 0 -3px #b98f55,0 3px #19151fa0}

.star-slot{position:relative;flex:none;width:var(--sr);height:var(--sr)}
.star-socket,.star-socket>i{position:absolute;inset:0;display:block}
.star-socket>i{-webkit-mask:url(/art/drone-icons-v1/perk.png) center/86% no-repeat;mask:url(/art/drone-icons-v1/perk.png) center/86% no-repeat}
.star-socket-rim{background:var(--card-face);translate:0 1.5px}
.star-socket-hole{background:radial-gradient(circle at 50% 70%,#6a5552 0,#3b2c31 55%,#20171d 100%)}
.star-slot .star-row-star{position:absolute;inset:-7%;width:114%;height:114%;filter:drop-shadow(0 2px 0 #1b172a80)}
.star-row.is-animated .star-socket{animation:star-socket-in .24s ease-out both}
.star-row.is-animated .star-row-star{animation:star-row-slam .42s cubic-bezier(.3,.7,.4,1) calc(.3s + var(--k) * .16s) both}
.star-row.is-animated .star-slot:not(.is-earned) .star-socket{animation:star-socket-in .24s ease-out both,star-socket-tick .22s ease-out calc(.3s + var(--k) * .16s + .1s)}
@keyframes star-socket-in{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
@keyframes star-row-slam{0%{opacity:0;transform:scale(1.6) rotate(-18deg)}45%{opacity:1;transform:scale(.9) rotate(0)}75%{transform:scale(1.06)}100%{opacity:1;transform:none}}
@keyframes star-socket-tick{0%,100%{transform:none}40%{transform:translateY(2px) scale(.96)}}
@media(prefers-reduced-motion:reduce){.star-row.is-animated *{animation:none!important}}

/* Visual polish (layout lane): the reward window's rows share the well's height (up to 92px each) instead of
   leaving its lower third empty; the row content stays centred and the window size rules (AC169) are unchanged. */
.star-track-rows>.star-track-row{flex:1 0 auto;max-height:92px}

/* Visual polish r2 (meta lane). #134: a locked milestone is dimmed (art and rewards desaturated) and shows a padlock
   with the stars still needed in the button slot; a claimable one gets a static warm-gold inner glow (no rays); a
   claimed one a green check. #135: rewards never wrap; three of them shrink to one row. */
.star-track-row.is-locked>:is(.star-track-at,.star-track-loot){opacity:.55;filter:grayscale(.75)}
#online .star-track-row.is-ready{border-color:#c99029;box-shadow:inset 0 0 0 2px #ffe7a0,inset 0 0 14px 2px #ffc64a99,0 3px 0 var(--vs-ink)}
#online .star-track-row .star-track-progress{color:#ffe9b8}
.star-track-progress{display:flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;height:30px;padding:0 6px;border-radius:999px;background:#5a4030;color:#ffe9b8;box-shadow:inset 0 2px #2c1e16}
.star-track-progress>.ui-icon{width:17px;height:17px}
.star-track-progress>b{font:800 14px/1 system-ui,sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap}
.star-track-row.is-claimed .star-track-state{display:flex;align-items:center;justify-content:center;gap:3px;color:#306c3a}
.star-track-row.is-claimed .star-track-state>.ui-icon{width:16px;height:16px;--ui-icon-fill:#4c9a52}
.star-track-loot{flex-wrap:nowrap;min-width:0}
.star-track-loot:has(>:nth-child(3)){gap:3px}
.star-track-loot:has(>:nth-child(3))>.star-reward-item{gap:2px;font-size:15px}
.star-track-loot:has(>:nth-child(3))>.star-reward-item img{width:21px;height:21px}
/* #161: next-reward preview between the goals and Start (a tappable row in the reward-track look). */
#online .star-next-reward{display:grid;gap:6px;width:100%;min-height:44px;margin:0;padding:8px 10px 10px;border:var(--vs-outline) solid var(--vs-ink);border-radius:12px;background:#edcf9c;box-shadow:0 3px 0 var(--vs-ink);color:#835b27;text-align:left;font:inherit;-webkit-text-stroke:0;text-shadow:none}
#online .star-next-reward::before,#online .star-next-reward::after{content:none}
#online .star-next-reward.is-ready{border-color:#c99029;box-shadow:inset 0 0 0 2px #ffe7a0,inset 0 0 14px 2px #ffc64a99,0 3px 0 var(--vs-ink)}
.star-next-reward>small{font:800 12px/1 system-ui,sans-serif;letter-spacing:1px;text-transform:uppercase;color:#7a5a30}
.star-next-body{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px}
.star-next-reward .star-track-at{gap:7px;font-size:19px}
/* AC53: an icon + amount inside a tappable row keeps the 7-10px icon gap. */
.star-next-reward .star-reward-item{gap:7px}
.star-next-go{width:22px;height:22px}
/* #161: short screens (Compact, browser chrome) keep the goals + Start fit without the preview (no nested scroll). */
@media(max-height:760px){#online .star-next-reward{display:none}}
/* AC805 (build 184): the one-time Fast Travel chapter replay card over the travel panel (event-lock-popover frame):
   the compass with the chapter's gold pill, a short title, one line and Got it. */
.travel-lesson-popover .travel-lesson{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.travel-lesson-popover .travel-lesson-art{position:relative;width:86px;height:86px;margin-bottom:6px}
.travel-lesson-popover .travel-lesson-art>img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 3px 0 #2b223040)}
.travel-lesson-popover .travel-lesson-chapter{position:absolute;left:50%;bottom:-8px;transform:translateX(-50%);padding:2px 10px;border:2px solid var(--vs-ink,#2b2230);border-radius:999px;background:linear-gradient(#ffe39a,#f2b84b);color:#3b2a14;font:800 13px/1.2 system-ui;white-space:nowrap}
.travel-lesson-popover .travel-lesson h1{margin:0;color:#2e4051;font:26px/1.05 Lucky}
.travel-lesson-popover .travel-lesson p{margin:0;max-width:290px;color:#55483c;font:600 14px/1.4 system-ui}
.travel-lesson-popover>button{width:100%;margin:16px 0 0}
