/* The lid, its small world, and the two friends remain the focus. */
.cap-bubble{position:absolute;left:50%;bottom:112px;transform:translate(-50%,8px);z-index:6;width:max-content;max-width:min(470px,calc(100% - 36px));display:flex;align-items:center;gap:13px;padding:13px 18px 13px 12px;border:1px solid #e6ca9b55;border-radius:18px;background:#242234ee;box-shadow:0 12px 45px #08091444;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s,transform .25s;backdrop-filter:blur(10px)}
.cap-bubble.show{opacity:1;visibility:visible;transform:translate(-50%,0)}.cap-bubble>img{width:49px;height:49px;flex:none;filter:drop-shadow(0 0 9px #b5edd522)}.cap-bubble-lines{display:flex;flex-direction:column;gap:5px}.cap-bubble p{margin:0;font-size:12px;line-height:1.75;color:#eee5d4}.cap-bubble b{font-size:10px;color:#d5ba94;margin-right:8px;font-weight:500}.cap-bubble p[data-speaker="light"] b{color:#a9dfcc}.cap-bubble:after{content:"";position:absolute;bottom:-7px;left:44px;width:12px;height:12px;transform:rotate(45deg);border-right:1px solid #e6ca9b55;border-bottom:1px solid #e6ca9b55;background:#242234}
.cap-status{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin-top:4px;color:#e1c7a0;font-size:8px;min-height:12px}.cap-status i{display:inline-block;width:3px;height:3px;border-radius:50%;background:#bfe9d6;box-shadow:0 0 6px #bfe9d666}.cap-status[data-phase="closed"]{color:#a8b9b2}.cap-status[data-phase="returning"] i{background:#e7bb8a}
.journal-cap-link{display:flex;align-items:center;gap:13px;width:100%;text-align:left;border:1px solid #e0c39d40;border-radius:13px;background:linear-gradient(100deg,#9c84be15,#a6d7bd08);color:#eee0c9;padding:11px 14px;margin:0 0 11px;cursor:pointer;font-family:inherit}.journal-cap-link img{width:48px;height:48px}.journal-cap-link>span{display:flex;flex-direction:column;gap:5px}.journal-cap-link strong{font-size:13px;font-weight:500}.journal-cap-link small{font-size:10px;color:#b7b6bd}.journal-cap-link>i{font-style:normal;margin-left:auto;color:#e2c395}.journal-cap-link:hover{border-color:#e6c49388;background:#b5a0ce18}
.cap-book-dialog{width:min(850px,calc(100vw - 32px));padding:30px;max-height:calc(100dvh - 32px);color:#eadfcd;background:#242131}.cap-book-dialog h2{font-size:28px;line-height:1.4;margin:9px 0 17px}.cap-book-stats{display:flex;align-items:center;gap:25px;border-bottom:1px solid #c7b8cd20;padding-bottom:18px;margin-bottom:21px}.cap-book-stats b{font-size:20px;color:#e4c99e;font-weight:500;letter-spacing:.5px}.cap-book-stats>span{display:flex;gap:7px;align-items:baseline;font-size:10px;color:#afa8ba}.cap-book-feature{display:grid;grid-template-columns:275px minmax(0,1fr);column-gap:25px;border:1px solid #cbb7d32c;border-radius:19px;background:radial-gradient(ellipse at 22% 25%,#678b7c15,transparent 62%),#1b1b2a66;overflow:hidden}.cap-book-window{display:flex;align-items:center;justify-content:center;min-height:270px;position:relative;isolation:isolate}.cap-book-window:before{content:"";position:absolute;width:215px;height:215px;border:1px dashed #dec3a028;border-radius:50%;z-index:-1;transform:translate(4px,0)}.cap-book-window canvas{display:block;width:275px;height:228px;max-width:100%;filter:drop-shadow(0 10px 10px #08081133)}.cap-book-window.unopened{flex-direction:column;gap:10px}.cap-book-window.unopened img{width:175px;height:175px;filter:saturate(.6);opacity:.75}.cap-book-window.unopened>span{font-size:10px;color:#b9b1c3}.cap-book-copy{padding:30px 22px 22px 0;display:flex;flex-direction:column;justify-content:center}.cap-book-copy>small{font-size:10px;color:var(--cap-accent);letter-spacing:1px}.cap-book-copy h3{font-size:24px;line-height:1.4;color:#f0debc;margin:8px 0;font-weight:550}.cap-book-copy>p{font-size:11px;line-height:1.85;color:#b9b3c1;margin:0 0 12px}.cap-book-lines{border-left:2px solid #c2d8b54a;padding-left:12px;margin-bottom:15px}.cap-book-lines p{margin:4px 0;font-size:11px;line-height:1.8;color:#d7cfdd}.cap-book-lines b{font-size:9px;color:#d5b88c;margin-right:8px;font-weight:400}.cap-book-actions{display:flex;align-items:center;gap:15px;flex-wrap:wrap}.cap-book-actions .dream-secondary{font-size:11px;min-height:36px;padding:7px 12px}.cap-book-actions .dream-text-link{font-size:10px}.cap-thoughts{grid-column:1/-1;border-top:1px solid #cbb7d320;padding:17px 22px 20px;background:#17182338}.cap-thoughts-title{display:flex;justify-content:space-between;font-size:10px;color:#c6bea7;margin-bottom:12px}.cap-thoughts-title b{font-weight:400;color:#d4c2a6}.cap-thoughts-title span{color:#aaa0b5}.cap-thought{display:flex;align-items:flex-start;gap:10px;padding:8px 0;color:#827d91}.cap-thought>i{width:17px;flex:none;font-style:normal;font-size:14px;color:#736c85}.cap-thought small{font-size:9px;color:#9690a2}.cap-thought p{font-size:11px;line-height:1.8;margin:4px 0 0}.cap-thought.found{color:#d8d1c6}.cap-thought.found>i{color:#edc991}.cap-thought.found small{color:#d6b68a}.cap-book-section-title{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:26px 0 13px}.cap-book-section-title h3{font-size:13px;font-weight:500;color:#dfcfb6}.cap-book-section-title>span{font-size:9px;color:#a39bb2}.cap-book-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.cap-book-card{display:flex;align-items:center;gap:8px;text-align:left;border:1px solid #c1adc024;background:#ffffff02;border-radius:12px;padding:9px;font-family:inherit;color:#cfc4d3;cursor:pointer;transition:background .2s,border-color .2s;min-width:0}.cap-book-card img{width:49px;height:49px;filter:grayscale(.8);opacity:.4;flex:none}.cap-book-card>span{min-width:0;display:flex;flex-direction:column;gap:4px}.cap-book-card small{font-size:8px;color:#9b90a6}.cap-book-card b{font-size:10px;font-weight:500;line-height:1.5;color:#bbb1c4}.cap-book-card em{font-size:8px;font-style:normal;color:#8f879d}.cap-book-card.discovered img{filter:none;opacity:1}.cap-book-card.discovered b{color:#eed7b3}.cap-book-card.discovered em{color:#a9cbb8}.cap-book-card:hover,.cap-book-card.selected{border-color:#d9ba8066;background:#bda7860a}.cap-book-card:focus-visible{outline:2px solid #e6c28c;outline-offset:2px}
.dream-play .stage-story-button svg{color:#dfc89d}.stage-action.soul-action:focus-visible{outline:2px solid #f4d59f;outline-offset:3px}
@media(max-width:640px){.cap-bubble{bottom:184px;max-width:calc(100% - 30px);padding:10px 12px 10px 8px;gap:8px;border-radius:13px}.cap-bubble>img{width:38px;height:38px}.cap-bubble p{font-size:10px;line-height:1.7}.cap-bubble b{font-size:8px;margin-right:5px}.cap-bubble-lines{gap:4px}.cap-status{font-size:7px;margin-top:3px;gap:4px}.cap-status i{width:2px;height:2px}.cap-book-dialog{padding:22px 16px;width:calc(100vw - 20px);max-height:calc(100dvh - 24px)}.cap-book-dialog h2{font-size:22px;max-width:290px;margin:9px 0 14px}.cap-book-stats{gap:15px;padding-bottom:13px;margin-bottom:15px}.cap-book-stats b{font-size:17px}.cap-book-stats>span{font-size:8px;gap:5px}.cap-book-feature{grid-template-columns:1fr;gap:0;border-radius:15px}.cap-book-window{min-height:218px}.cap-book-window canvas{width:250px;height:207px}.cap-book-window:before{width:185px;height:185px}.cap-book-window.unopened img{width:153px;height:153px}.cap-book-window.unopened{min-height:218px;gap:5px}.cap-book-window.unopened>span{font-size:9px}.cap-book-copy{padding:0 17px 19px}.cap-book-copy>small{font-size:9px}.cap-book-copy h3{font-size:21px}.cap-book-copy>p{font-size:10px}.cap-book-lines p{font-size:10px}.cap-book-lines b{font-size:8px}.cap-thoughts{padding:15px 17px}.cap-thought p{font-size:10px}.cap-book-card{padding:8px 5px;gap:5px;align-items:flex-start}.cap-book-card img{width:38px;height:38px}.cap-book-card small{font-size:7px}.cap-book-card b{font-size:9px}.cap-book-card em{font-size:7px}.cap-book-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.cap-book-section-title{gap:5px}.cap-book-section-title h3{font-size:12px}.cap-book-section-title>span{font-size:7px}.journal-cap-link{gap:9px;padding:10px 12px}.journal-cap-link img{width:41px;height:41px}.journal-cap-link strong{font-size:12px}.journal-cap-link small{font-size:9px}}
@media(prefers-reduced-motion:reduce){.cap-bubble,.cap-book-card{transition:none}.cap-bubble{backdrop-filter:none;transform:translate(-50%,0)}}.reduced-motion .cap-bubble,.reduced-motion .cap-book-card{transition:none}.reduced-motion .cap-bubble{transform:translate(-50%,0)}

/* Mobile dialogue follows the full instruction block in the same flow. The
   duplicate cap-state sentence describes the existing toggle for screen readers. */
@media(max-width:640px){
  #dream-stage .stage-reading .stage-form .cap-status{display:block;position:absolute;width:1px;height:1px;min-height:0;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
  #dream-stage .stage-reading #stage-objective,
  #dream-stage .stage-reading #stage-near-hint{display:block;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
  #dream-stage .stage-reading .cap-bubble{position:static;inset:auto;transform:none;justify-self:start;width:fit-content;min-width:0;max-width:100%;margin:0;padding:6px 10px;gap:7px;border-radius:10px;background:#20333fed}
  #dream-stage .cap-bubble>img{width:28px;height:28px}
  #dream-stage .cap-bubble-lines{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-width:0}
  #dream-stage .cap-bubble p{display:inline;font-size:11px;line-height:1.5}
  #dream-stage .cap-bubble p+p:before{content:"　"}
  #dream-stage .cap-bubble:after{display:none}
}
