/* Star-river interface preview. All rules are scoped to this scene or its own dialog. */
.room-world[data-scene="river"] {background:#080e22;}
.room-world[data-scene="river"] .room-stage {aspect-ratio:1672/941;background:#080e22;}
.room-river {background:#080e22 url('../ip/galaxy/guestbook-river-v5.png') center/100% 100% no-repeat;image-rendering:pixelated;}
.river-host {--river-host-ground-y:99.25%;--river-host-bottom-offset:10px;position:absolute;left:69.5%;top:calc(var(--river-host-ground-y) - var(--river-host-bottom-offset));width:11%;transform:translate(-50%,-100%);z-index:121;min-width:44px;border:0;padding:0;background:none;cursor:pointer;filter:brightness(.85);}
.river-host img {display:block;width:100%;height:auto;aspect-ratio:320/362;transform:scaleX(-1);pointer-events:none;image-rendering:pixelated;background-image:url('../ip/galaxy/river-host-selected-v1.png');background-repeat:no-repeat;background-size:452.5% 300%;}
.river-host .river-host-body {position:relative;clip-path:inset(0 0 17% 0);}
/* Back-facing frames expose a higher knee beside the hoodie; leave talk frames unchanged. */
.river-host:is([data-frame="0"],[data-frame="1"],[data-frame="2"],[data-frame="3"]) .river-host-body {clip-path:polygon(0 0,100% 0,100% 77.4%,69% 77.4%,69% 79%,63% 79%,60% 82%,56% 83%,0 83%);}
/* These two turned poses sit deeper against the wall; ease them toward the river. */
.river-host:is([data-frame="7"],[data-frame="11"]) .river-host-body {left:-4%;}
.river-host:focus-visible {outline:2px dashed #e3c992;outline-offset:4px;}
.room-world[data-scene="river"] .room-dialogue {z-index:125;border-image:none;}
.room-world[data-scene="river"] .room-dialogue::before {content:'';position:absolute;inset:-38px -38px -48px;border:solid transparent;border-width:38px 38px 48px;border-image:url('../ip/room/dialogue-bubble-v2.png') 300 220 260 330 fill / 38px 38px 48px / 0 stretch;transform:scaleX(-1);pointer-events:none;}
.room-world[data-scene="river"] .room-dialogue>span,.room-world[data-scene="river"] .room-dialogue>p,.room-world[data-scene="river"] .room-dialogue>div {position:relative;}
.room-river::before {content:'';position:absolute;inset:0;background:url('../ip/galaxy/guestbook-post-cleanup-v1.png') center/100% 100% no-repeat;clip-path:polygon(29.6651% 79.4899%,33.3732% 79.4899%,33.3732% 88.8417%,29.6651% 88.8417%);pointer-events:none;image-rendering:pixelated;}
.room-river .river-return,.room-river .river-routes button {background:#0b10236b;border:0;color:#c7bca7;padding:8px;font-size:12px;text-shadow:1px 2px #050816;}
.room-river .river-return {z-index:8;}
.room-river .river-routes {gap:14px;}
.guestbook-heading {position:absolute;left:52%;top:8%;transform:translateX(-50%);text-align:center;pointer-events:none;}
.guestbook-heading h2 {margin:0 0 10px;color:#e7d5ac;font-size:clamp(22px,2.3vw,34px);font-weight:400;letter-spacing:.22em;text-shadow:2px 2px #080c21;}
.guestbook-heading p {margin:0;color:#a9a7b9;font-size:11px;letter-spacing:.12em;}
.guestbook-controls {position:absolute;inset:0;z-index:120;pointer-events:none;}
.guestbook-controls .guestbook-sign {position:absolute;border:0;padding:0;background:none;pointer-events:auto;cursor:pointer;image-rendering:pixelated;filter:brightness(.86);}
.guestbook-sign img,.guestbook-sign-original {display:block;width:100%;height:auto;image-rendering:pixelated;pointer-events:none;transform-origin:50% 0;transition:transform .4s ease;}
.guestbook-sign-original {aspect-ratio:62/88;background:url('../ip/galaxy/guestbook-river-v5.png') 30.8074534% 87.6905041%/2696.7741935% 1069.3181818% no-repeat;clip-path:polygon(32% 0,60% 0,60% 4%,68% 4%,68% 8%,74% 8%,74% 15%,86% 15%,96% 21%,96% 90%,89% 97%,79% 100%,8% 100%,0 94%,0 20%,10% 16%,24% 16%,24% 6%,32% 6%);}
.guestbook-controls .guestbook-sign--archive {left:29.6651%;top:79.4899%;width:3.7081%;}
.guestbook-controls .guestbook-sign--write {left:25%;top:78.2%;width:3.6%;}
.guestbook-controls .guestbook-sign--refresh {left:18%;top:84.5%;width:3.6%;}
.guestbook-controls .guestbook-sign:hover,.guestbook-controls .guestbook-sign:focus-visible {filter:brightness(1.15);}
.guestbook-controls .guestbook-sign:hover img,.guestbook-controls .guestbook-sign:focus-visible img,.guestbook-controls .guestbook-sign:hover .guestbook-sign-original,.guestbook-controls .guestbook-sign:focus-visible .guestbook-sign-original {transform:rotate(-2deg);}
.guestbook-sign::after {content:attr(data-label);position:absolute;top:calc(100% + 4px);left:50%;transform:translateX(-50%);opacity:0;transition:opacity .25s;color:#f0d9a6;font-size:11px;white-space:nowrap;pointer-events:none;text-shadow:1px 1px #151222,0 1px 4px #080d1e;}
.guestbook-sign:hover::after,.guestbook-sign:focus-visible::after {opacity:1;}
.guestbook-controls .guestbook-sign:focus-visible {outline:1px dashed #ead09b;outline-offset:3px;}
.guestbook-controls .guestbook-sign:disabled {cursor:wait;filter:brightness(.7);}
.guestbook-preview-note {position:absolute;left:52%;bottom:2%;transform:translateX(-50%);color:#a8a5b3;font-size:10px;white-space:nowrap;z-index:7;margin:0;text-shadow:1px 1px #080c1a;}
.guestbook-status {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.guestbook-boat {position:absolute;left:0;top:0;width:112px;height:74.667px;margin:0;border:0;padding:0;background:none;cursor:pointer;transform-origin:0 0;will-change:transform;isolation:isolate;outline:none;}
/* Route translation, water bob and atlas view have independent transforms. The
   50%/66% registration is the common hull waterline for every atlas view. */
.guestbook-boat::before {content:'';position:absolute;left:50%;top:50%;width:max(100%,calc(44px / var(--boat-scale,1)));height:max(100%,calc(44px / var(--boat-scale,1)));transform:translate(-50%,-50%);}
.guestbook-boat-motion {position:absolute;inset:0;transform-origin:50% 66%;animation:guestbook-boat-bob var(--bob-duration,3s) ease-in-out var(--bob-delay,0s) infinite;pointer-events:none;}
.guestbook-boat-sprite {position:absolute;inset:0;background:url('../ip/galaxy/guestbook-boat-sheet-v2.png') 11.4155% 21.2329%/232.7273% 232.7273% no-repeat;image-rendering:pixelated;filter:brightness(var(--boat-brightness,.8)) saturate(.76);pointer-events:none;}
.guestbook-turn-ready .guestbook-boat-sprite {background-image:none;}
.guestbook-direction-frame {display:none;position:absolute;inset:0;background:url('../ip/galaxy/guestbook-boat-directions-v1.png') var(--turn-x) var(--turn-y)/320% 320% no-repeat;image-rendering:pixelated;opacity:1;transition:none;mix-blend-mode:normal;pointer-events:none;}
.guestbook-turn-ready .guestbook-direction-frame,.guestbook-fold-boat .guestbook-direction-frame {display:block;}
.guestbook-ripple {position:absolute;left:20%;right:20%;top:65%;height:12%;border:0;opacity:0;clip-path:polygon(15% 0,85% 0,85% 20%,100% 20%,100% 80%,85% 80%,85% 100%,15% 100%,15% 80%,0 80%,0 20%,15% 20%);box-shadow:inset 0 1px #9398b880,inset 0 -1px #9398b880;pointer-events:none;}
.guestbook-boat.has-ripple .guestbook-ripple {animation:guestbook-water-ring 1.4s ease-out;}
.guestbook-boat:hover .guestbook-boat-sprite,.guestbook-boat:focus-visible .guestbook-boat-sprite {filter:brightness(calc(var(--boat-brightness,.8) + .09)) saturate(.8);}
.guestbook-boat:focus-visible .guestbook-ripple {opacity:.65;}
.guestbook-boat[data-state="waiting"] {visibility:hidden;pointer-events:none;}
.guestbook-boat.is-selected {z-index:200!important;}
.guestbook-boat.is-selected .guestbook-boat-motion {animation-play-state:paused;}
.room-river:not(.guestbook-is-active) .guestbook-boat-motion,.guestbook-page-hidden .guestbook-boat-motion {animation-play-state:paused;}

@keyframes guestbook-boat-bob {
  0%,50%,100% {transform:translateY(0) rotate(-.4deg);}
  25% {transform:translateY(calc(-1 * var(--bob-amplitude,2px))) rotate(.65deg);}
  75% {transform:translateY(calc(var(--bob-amplitude,2px) * .5)) rotate(-.7deg);}
}
@keyframes guestbook-water-ring {0% {transform:scale(.65);opacity:.7;}100% {transform:scale(1.8,1.4);opacity:0;}}
.guestbook-dialog {box-sizing:border-box;width:min(650px,calc(100vw - 30px));max-width:calc(100vw - 30px);max-height:86svh;padding:38px 42px 34px;border:0;color:#574331;background:transparent url('../ip/galaxy/guestbook-letter-view-v2.svg') center/100% 100% no-repeat;font-family:'Zpix','Microsoft YaHei',sans-serif;filter:drop-shadow(4px 6px 0 #090b1c80);overflow:hidden;}
.guestbook-dialog[open] {display:flex;flex-direction:column;}
.guestbook-dialog>header,.guestbook-dialog>h2 {flex-shrink:0;}
.guestbook-dialog [data-guestbook-body] {min-width:0;min-height:0;overflow-y:auto;overflow-x:hidden;padding:2px 4px 4px 0;scrollbar-width:thin;scrollbar-color:#a68a64 #ead8b7;}
.guestbook-dialog[data-mode="read"],.guestbook-dialog[data-mode="preview"] {min-height:min(470px,86svh);}
.guestbook-dialog * {box-sizing:border-box;}
.guestbook-dialog::backdrop {background:#040919bd;}
.guestbook-dialog>header {display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:10px;color:#8b7255;}
.guestbook-dialog>header button {border:0;background:none;font:inherit;font-size:21px;color:#72583e;cursor:pointer;padding:4px 8px;}
.guestbook-dialog h2 {font-size:24px;font-weight:400;line-height:1.5;margin:18px 0 22px;color:#634a34;overflow-wrap:anywhere;}
.guestbook-dialog button,.guestbook-dialog input,.guestbook-dialog textarea,.guestbook-dialog select {font:inherit;}
.guestbook-dialog button {cursor:pointer;background:#ead6b3;border:1px solid #b29a75;padding:9px 13px;color:#725239;font-size:12px;}
.guestbook-dialog button:disabled {opacity:.45;cursor:default;}
.guestbook-dialog button:hover:not(:disabled) {border-color:#71543c;}
.guestbook-dialog button:focus-visible,.guestbook-dialog input:focus-visible,.guestbook-dialog textarea:focus-visible,.guestbook-dialog select:focus-visible {outline:2px solid #806088;outline-offset:3px;}
.guestbook-dialog .guestbook-primary {background:#66526c;color:#fff0cd;border-color:#66526c;}
.guestbook-dialog-actions {display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:24px;}
.guestbook-letter-meta {font-size:11px;color:#957956;margin:0 0 20px;}
.guestbook-letter-content {font-size:15px;line-height:2.05;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;min-height:130px;color:#604c38;}
.guestbook-letter-source,.guestbook-small-note {font-size:10px;line-height:1.8;color:#967d5d;margin:22px 0 0;}
.guestbook-form {display:grid;grid-template-columns:1fr 1fr;gap:18px;}
.guestbook-field {display:flex;flex-direction:column;gap:8px;min-width:0;font-size:11px;color:#87694b;}
.guestbook-field--content,.guestbook-form-help,.guestbook-form-error,.guestbook-form .guestbook-dialog-actions {grid-column:1/-1;}
.guestbook-field input,.guestbook-field textarea,.guestbook-archive-tools input,.guestbook-archive-tools select {border:1px solid #b9a684;background:#fff6de66;color:#584536;padding:10px 12px;font-size:13px;min-width:0;max-width:100%;border-radius:0;}
.guestbook-field textarea {resize:vertical;min-height:170px;max-height:38svh;line-height:1.9;}
.guestbook-field input::placeholder,.guestbook-field textarea::placeholder,.guestbook-archive-tools input::placeholder {color:#a18b6e;}
.guestbook-form-help {display:flex;justify-content:space-between;gap:16px;align-items:center;color:#937c5f;font-size:10px;line-height:1.7;}
.guestbook-form-help span:last-child {white-space:nowrap;}
.guestbook-form-error {color:#9b493e;margin:0;font-size:12px;}
.guestbook-form-error:empty {display:none;}
.guestbook-form .guestbook-dialog-actions {margin-top:0;}
.guestbook-form-help .is-over {color:#a33535;}
.guestbook-archive-tools {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;}
.guestbook-archive-filters {grid-column:1/-1;display:flex;gap:8px;}
.guestbook-archive-filters [aria-pressed="true"] {background:#66526c;color:#fff0cd;border-color:#66526c;}
.guestbook-archive-tools input,.guestbook-archive-tools select,.guestbook-archive-tools button {font-size:11px;}
.guestbook-archive-summary {font-size:11px;color:#947b5c;margin:18px 0 4px;}
.guestbook-archive-item {width:100%;display:grid;grid-template-columns:25px minmax(0,1fr) 35px;gap:14px;align-items:center;text-align:left;background:none!important;border:0!important;border-bottom:1px solid #b89b7155!important;padding:16px 0!important;}
.guestbook-archive-symbol {font-size:19px;color:#b18b4e;}
.guestbook-archive-item strong {display:block;font-size:14px;font-weight:400;color:#624a34;overflow-wrap:anywhere;}
.guestbook-archive-item small {display:block;font-size:9px;color:#9d8364;margin-top:7px;line-height:1.6;}
.guestbook-excerpt {display:block;font-size:11px;color:#8f785c;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-top:8px;}
.guestbook-read-marker {font-size:10px;color:#998575;}
.guestbook-pagination {display:flex;align-items:center;justify-content:center;gap:22px;margin-top:20px;font-size:11px;color:#957956;}
.guestbook-pagination button {font-size:11px;padding:7px 10px;}
.guestbook-empty {font-size:13px;line-height:1.9;text-align:center;padding:30px 10px;color:#8e7556;}
.guestbook-fold {height:220px;position:relative;}
.guestbook-fold-sheet {position:absolute;left:25%;right:25%;top:15%;bottom:15%;background:url('../ip/galaxy/guestbook-letter-v1.png') center/contain no-repeat;image-rendering:pixelated;animation:guestbook-paper-fold 1.2s ease-in-out both;}
.guestbook-fold-boat {position:absolute;width:180px;height:120px;left:calc(50% - 90px);top:40px;background:url('../ip/galaxy/guestbook-boat-sheet-v2.png') 11.4155% 21.2329%/232.7273% 232.7273%;image-rendering:pixelated;animation:guestbook-paper-launch 1.2s ease-in-out both;}
.guestbook-sending-copy {text-align:center;font-size:12px;line-height:1.8;color:#967957;}
@keyframes guestbook-paper-fold {0%,15% {transform:scale(1) rotate(0);opacity:1;}50% {transform:scale(.7,.2) rotate(-8deg);opacity:.8;}65%,100% {transform:scale(.3,0) rotate(-8deg);opacity:0;}}
@keyframes guestbook-paper-launch {0%,42% {transform:translateY(-8px) scale(.45);opacity:0;}68% {transform:translateY(5px) scale(1);opacity:1;}100% {transform:translate(40px,20px) scale(.85);opacity:0;}}
@media(min-width:761px) and (max-width:1100px) {
  .guestbook-boat {width:100px;height:66.667px;}
}
@media(max-width:760px) {
  .room-world[data-scene="river"] {background:#080e22;}
  .room-world[data-scene="river"] .room-stage {min-width:760px;}
  .room-river .river-return {position:fixed;left:8px;top:10px;font-size:10px;background:#080e22d9;padding:8px;}
  .room-river .river-routes {position:fixed;right:8px;top:10px;gap:3px;}
  .room-river .river-routes button {font-size:10px;background:#080e22d9;padding:8px;}
  .guestbook-boat {width:96px;height:64px;}
  .guestbook-heading {top:13%;}
  .guestbook-heading h2 {font-size:24px;}
  .guestbook-controls {position:fixed;inset:auto 18px 34px auto;display:flex;align-items:flex-end;gap:22px;width:auto;height:104px;pointer-events:none;}
  .guestbook-controls .guestbook-sign {position:relative;inset:auto;flex:none;width:40px;height:auto;filter:brightness(.88);}
  .guestbook-sign::after {opacity:1;font-size:10px;top:calc(100% + 5px);}
  .guestbook-preview-note {position:fixed;left:50%;bottom:9px;font-size:9px;}
  .guestbook-dialog {padding:28px 24px 30px;max-height:89svh;}
  .guestbook-dialog h2 {font-size:21px;margin:15px 0 20px;}
  .guestbook-form {gap:14px;}
  .guestbook-form-help {align-items:flex-start;}
  .guestbook-archive-tools {grid-template-columns:1fr auto;}
  .guestbook-archive-tools input {grid-column:1/-1;}
  .guestbook-dialog-actions {gap:8px;}
  .guestbook-dialog-actions button {font-size:11px;padding:8px 10px;}
  .guestbook-letter-content {font-size:14px;}
}
@media(prefers-reduced-motion:reduce) {
  .guestbook-boat-motion,.guestbook-ripple,.guestbook-fold-sheet,.guestbook-fold-boat {animation:none;}
  .guestbook-fold-sheet {display:none;}
  .guestbook-sign img,.guestbook-sign-original,.guestbook-sign::after {transition:none;}
  .guestbook-controls .guestbook-sign:hover img,.guestbook-controls .guestbook-sign:focus-visible img,.guestbook-controls .guestbook-sign:hover .guestbook-sign-original,.guestbook-controls .guestbook-sign:focus-visible .guestbook-sign-original {transform:none;}

}
