/* The full-body portrait occupies the center stage; CGs replace it entirely. */
body.avg-open:not(.avg-task) .topbar{visibility:hidden}
body.avg-open #gm-button{display:none}
body.avg-open:not(.avg-task) .island-background{background-image:linear-gradient(#fffaf008,#fffaf010),var(--gal-scene-background);background-position:center;background-size:cover;filter:none}
.avg-layer:not(.is-aside):not(.is-tutorial) .avg-portrait{left:50%;right:auto;transform:translateX(-50%);width:min(64vw,620px);height:min(83dvh,850px);bottom:118px;animation:none}
.avg-portrait>img.portrait-change{animation:gal-portrait-in .25s ease,breathe 4s .25s ease-in-out infinite}
.avg-portrait>img{transition:filter .35s,scale .35s;transform-origin:50% 95%}
.avg-layer[data-acting="close"]:not(.is-tutorial):not(.is-aside) .avg-portrait>img{scale:1.025}
.avg-layer[data-acting="quiet"] .avg-portrait>img{filter:saturate(.87) brightness(.97)}
.avg-layer[data-acting="bright"] .avg-portrait>img{filter:brightness(1.025) saturate(1.04)}
.avg-layer[data-acting="hesitate"] .avg-portrait>img{scale:.985}
@keyframes gal-portrait-in{from{opacity:.2;filter:brightness(1.15)}to{opacity:1;filter:none}}
#avg-cg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 42%;pointer-events:none}
.avg-layer.has-cg .avg-portrait{display:none}
.avg-layer.has-cg .avg-shade{background:linear-gradient(0deg,#14233466,transparent 48%)}
.avg-layer.has-cg .avg-chapter{opacity:.94}
.avg-chapter .avg-bond{display:block;width:max-content;margin:12px 0 0 auto;letter-spacing:.3px;font-size:13px;padding:7px 13px}
.avg-layer:not(.is-aside) .avg-panel{background:linear-gradient(120deg,#fffef5f5,#fffdf0ed);border:1px solid #fffbed;box-shadow:0 0 0 4px #e6efcf9c,0 10px 48px #35514b30;backdrop-filter:blur(16px)}
.avg-choices{display:grid;gap:8px;margin:4px 0 16px;pointer-events:auto}
.avg-choices button{position:relative;display:flex;align-items:center;gap:15px;text-align:left;min-height:43px;border:1px solid #c6d8bd;border-radius:10px;background:linear-gradient(100deg,#f4faec,#fffaf0);padding:9px 16px;font-size:16px;line-height:1.5;color:#35564a;box-shadow:0 3px 0 #dce6c755}
.avg-choices button small{font-size:12px;letter-spacing:2px;color:#859f81;border-right:1px solid #dce6cf;padding-right:14px}
.avg-choices button:hover,.avg-choices button:focus-visible{background:#e6f3d7;border-color:#8fb78c;transform:translateX(3px)}
.has-choice .avg-text-area{min-height:50px;max-height:100px}
.has-choice #avg-next{visibility:hidden}
.has-choice .avg-continue{display:none}
.bond-hud{display:flex;align-items:center;gap:9px;min-width:145px;border:1px solid #e0d6b8;border-radius:12px;padding:7px 11px;background:#fffbeece;box-shadow:0 3px 0 #e0ddc33b;text-align:left}
.bond-hud>span:first-child{font-size:25px;color:#d59687}
.bond-hud small{display:block;font-size:12px;color:#8b9074;letter-spacing:.5px}
.bond-hud strong{display:block;font-size:13px;line-height:1.3;color:#526952;font-weight:600;margin:2px 0}
.bond-hud i{display:block;height:3px;width:100%;background:#e6e7d2;border-radius:8px;overflow:hidden}
.bond-hud b{display:block;height:100%;background:linear-gradient(90deg,#dfb6a0,#e89ca6);transition:width .6s}
.choice-result{width:min(440px,calc(100vw - 40px));border:1px solid #efe0b4;border-radius:26px;background:radial-gradient(ellipse at top,#fff3ca,#fffdf2 70%);padding:28px 30px;color:#5d6650;text-align:center;box-shadow:0 20px 100px #263d4b50;max-height:90dvh;overflow:auto}
.choice-result::backdrop,.memory-gallery::backdrop{background:#213c486b;backdrop-filter:blur(7px)}
.choice-result-star{font-size:48px;color:#d5b365;text-shadow:0 0 22px #f8d087;line-height:1.2}
.choice-result>small{font-size:12px;letter-spacing:5px;color:#9c916f}
.choice-result h2{font-size:39px;letter-spacing:8px;margin:14px 0;color:#a88245}
.choice-result[data-rank="成功"] h2{color:#6c997c}
.choice-result[data-rank="一般"] h2{color:#8d9294}
#choice-result-label{font-size:15px;line-height:1.8}
.choice-result-awards{display:flex;justify-content:center;gap:12px;margin:23px 0}
#choice-result-note{font-size:13px;line-height:1.8;color:#8f967b}
.choice-result button{border:1px solid #aec69c;background:#dfeccc;border-radius:20px;padding:11px 25px;margin-top:10px}
.memory-gallery{width:min(1040px,calc(100vw - 28px));max-height:90dvh;padding:25px;border:1px solid #e1dec1;border-radius:24px;background:#fbfcf1;color:#52674f;box-shadow:0 15px 70px #19353450}
.memory-gallery header{display:flex;align-items:center;justify-content:space-between;gap:20px}
.memory-gallery header small{font-size:12px;letter-spacing:3px;color:#9d9b7d}
.memory-gallery h2{font-size:24px;letter-spacing:3px;margin:8px 0}
.memory-gallery header button{border:1px solid #d7ddc5;background:#fffaf0;width:37px;height:37px;border-radius:50%;font-size:24px}
.memory-bond-status{display:flex;align-items:center;margin:12px 0 22px;min-height:88px}
.bond-indicator{display:inline-flex;align-items:center;gap:16px;vertical-align:middle}
.bond-heart{position:relative;flex:none;width:86px;height:83px;filter:drop-shadow(0 4px 5px #9d655f1c)}
.bond-heart>svg{display:block;width:100%;height:100%;overflow:visible}
.bond-heart-fill{transition:transform .6s cubic-bezier(.22,.68,.25,1)}
.bond-heart-level{font:bold 32px Georgia,'Times New Roman',serif;fill:#633848;stroke:#fff7ec;stroke-width:2.5px;paint-order:stroke fill;stroke-linejoin:round}
.bond-heart-gain{position:absolute;right:-8px;top:0;font:bold 18px Georgia,serif;color:#a54862;text-shadow:0 1px #fff8ee;animation:heart-gain-in .5s ease-out both}
.bond-yield{display:flex;align-items:center;gap:7px;padding:9px 13px 9px 9px;border:1px solid #e4d6ac;border-radius:18px;background:linear-gradient(135deg,#fff9e6,#f5ecd0);color:#73592e}
.bond-yield>svg{display:block;width:37px;height:37px;flex:none}
.bond-yield-value{font:700 21px Georgia,'Times New Roman',serif;white-space:nowrap;letter-spacing:.5px}
.bond-indicator.is-leveling .bond-heart>svg{animation:heart-level-up .6s ease-out both}
.choice-result-awards{align-items:center;gap:22px}
#choice-result-bond{display:flex;align-items:center}
#choice-result-bond .bond-indicator{gap:10px}
#choice-result-bond .bond-heart{width:92px;height:89px}
#choice-result-bond .bond-yield{padding:7px 9px;gap:3px}
#choice-result-bond .bond-yield>svg{width:29px;height:29px}
#choice-result-bond .bond-yield-value{font-size:17px}
@keyframes heart-gain-in{from{opacity:0;transform:translateY(10px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes heart-level-up{0%{transform:scale(1)}40%{transform:scale(1.15);filter:drop-shadow(0 0 8px #edba8f)}100%{transform:scale(1)}}
@media(max-width:480px){.memory-bond-status{margin:8px 0 16px}.choice-result-awards{gap:12px}#choice-result-bond .bond-indicator{gap:6px}#choice-result-bond .bond-heart{width:78px;height:75px}#choice-result-bond .bond-yield{padding:6px}#choice-result-bond .bond-yield>svg{width:25px;height:25px}#choice-result-bond .bond-yield-value{font-size:16px}}
@media(prefers-reduced-motion:reduce){.bond-heart-fill{transition:none}.bond-heart-gain,.bond-indicator.is-leveling .bond-heart>svg{animation:none}}
.memory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}
.memory-card{padding:0;border:1px solid #e2ddc4;border-radius:14px;overflow:hidden;background:#fffdf4;text-align:left;color:#65775f}
.memory-card img,.memory-lock{width:100%;aspect-ratio:16/9;object-fit:cover;display:block}
.memory-card>span{display:block;padding:11px 13px;font-size:13px}
.memory-card.is-locked{opacity:.68}
.memory-lock{display:grid;place-items:center;font-size:40px;background:linear-gradient(140deg,#e9eddd,#f6f0dc);color:#b9c3a5}
#memory-preview-image{width:100%;height:auto;border-radius:14px}
#memory-back{border:1px solid #d2ddbd;background:#eef4e4;border-radius:16px;padding:8px 14px;margin-top:12px}
.bond-toast{position:fixed;top:95px;left:50%;transform:translateX(-50%);z-index:110;padding:12px 23px;border:1px solid #f1d4c2;border-radius:25px;background:#fff5eaf5;color:#a47169;box-shadow:0 6px 30px #655d3520;font-size:14px;pointer-events:none}
@media(max-width:1000px){.header-right{gap:10px}.bond-hud{min-width:125px}.avg-tools{gap:6px}.avg-tools button{padding:8px 10px}.avg-chapter>strong{font-size:21px}}
@media(max-width:700px){
  .topbar{padding-inline:12px}.brand{font-size:17px;gap:6px}.brand small{font-size:11px;letter-spacing:.5px}.header-right{gap:7px}.bond-hud{min-width:0;padding:5px 7px;gap:5px}.bond-hud>span:first-child{font-size:19px}.bond-hud small{display:none}.bond-hud strong{font-size:12px;max-width:92px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .avg-layer:not(.is-aside):not(.is-tutorial) .avg-portrait{width:90vw;height:70dvh;bottom:170px;max-width:410px}
  .avg-tools{left:10px;right:10px;top:12px;justify-content:flex-end;gap:5px;flex-wrap:wrap}.avg-tools button{font-size:12px;padding:6px 9px}
  .avg-chapter{top:60px;right:16px}.avg-chapter>span{font-size:11px;letter-spacing:1px;padding:6px 10px}.avg-chapter>strong{font-size:17px;letter-spacing:1px;margin-top:6px}.avg-chapter .avg-bond{font-size:12px;margin-top:7px;padding:4px 9px}
  .avg-layer:not(.is-aside):not(.is-tutorial) .avg-panel{bottom:18px;max-height:52dvh;overflow:visible;padding:25px 19px 12px}
  .avg-choices{gap:7px;margin:3px 0 8px}.avg-choices button{font-size:14px;min-height:39px;padding:8px 10px;gap:9px}.avg-choices button small{padding-right:8px;font-size:12px}
  .has-choice .avg-text-area{min-height:30px;max-height:55px}.has-choice .avg-text-area>p{font-size:14px}.has-choice .avg-panel-bottom{margin-top:8px;padding-top:8px}.has-choice .avg-panel-bottom>span{font-size:12px}
  .avg-layer.has-choice:not(.is-aside):not(.is-tutorial) .avg-portrait{bottom:265px;height:60dvh}
  .memory-gallery{padding:18px;max-height:94dvh}.memory-gallery h2{font-size:19px}.memory-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.memory-card>span{font-size:12px;padding:9px}.memory-rule{font-size:12px}.bond-toast{font-size:13px;top:80px;white-space:nowrap}
  #avg-cg{object-position:50% 35%}
}
@media(max-width:360px){.brand-symbol{display:none}.avg-tools{gap:4px}.avg-tools button{padding:6px 7px;font-size:12px}.avg-choices button{font-size:13px}.avg-layer.has-choice:not(.is-aside):not(.is-tutorial) .avg-panel{padding-inline:14px}}
@media(max-height:600px) and (min-width:701px){.avg-chapter{top:75px}.avg-layer:not(.is-aside):not(.is-tutorial) .avg-portrait{height:86dvh;bottom:75px}.avg-layer:not(.is-aside) .avg-panel{bottom:12px;min-height:0;padding-top:23px}.has-choice .avg-choices{grid-template-columns:repeat(3,1fr)}.has-choice .avg-text-area{min-height:32px}.avg-text-area{min-height:45px}}
@media(prefers-reduced-motion:reduce){.avg-portrait>img.portrait-change{animation:none}.bond-hud b{transition:none}}
@media(prefers-reduced-motion:reduce){.avg-portrait>img{transition:none}}

.avg-panel-bottom:has(#avg-skip-intro:not([hidden])) #avg-mode-label{display:none}
.avg-panel-bottom>#avg-skip-intro{margin-right:auto;background:#fffdf280;border:1px solid #bdcbb3;color:#6c8977;box-shadow:none;font-weight:400}

/* Story skip: one extra action in the AVG toolbar. */
.avg-tools #avg-skip{border-color:#d9b76d;color:#8a6a2f;font-weight:700}
.avg-tools #avg-skip:disabled{opacity:.45}

/* The enlarged header type cannot fit the subtitle beside five controls on the
   narrowest phones; keep the name only so the topbar stays on one line. */
@media(max-width:420px){.brand small{display:none}}


