/* V10: readable dialogue, equal story choices, compact activity cards. */
.overlay{background:rgba(20,31,35,.64);padding:24px 16px;align-items:center;}
.dialog{width:100%;max-width:580px;max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);display:flex;flex-direction:column;overflow:hidden;padding:0;border:2px solid #344c50;border-image:none;border-radius:6px;background:#fff7e7;color:#2c4144;box-shadow:4px 5px 0 #ba9760,0 20px 65px #12232666;image-rendering:auto;animation:dialogEnter .18s ease-out;}
@keyframes dialogEnter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.dialog-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px 16px;margin:0;border-bottom:1px solid #d6c5a6;background:#f1e5cb;}
.dialog-heading{min-width:0;}
.dialog-context{display:block;margin-bottom:5px;color:#52685e;font-size:10px;font-weight:700;letter-spacing:2px;line-height:1.3;}
.dialog h2{margin:0;color:#293f42;font-size:22px;line-height:1.4;font-weight:800;letter-spacing:.5px;}
.dialog h2:before{content:none;}
.dialog .round{flex-shrink:0;width:44px;height:44px;min-height:44px;padding:0;border:1px solid #aa987c;border-radius:3px;background:#fff7e7;color:#4e5c52;font-size:23px;box-shadow:0 2px 0 #c9b492;line-height:30px;}
#dialog-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:20px 22px 22px;scrollbar-width:thin;scrollbar-color:#aa9c80 #f5ead2;}
.dialog p{color:#4b5148;font-size:14px;line-height:1.85;margin:0 0 14px;}
.dialog .narration,.dialog .scene-cue{color:#62675b;font-size:14px;line-height:1.85;}
.dialog .lead{color:#344c50;font-size:16px;line-height:1.8;}
.dialog .hint{color:#6f6b58;font-size:11px;line-height:1.7;margin:12px 0 0;}
.dialog .scene-cue{padding-left:12px;border-left:2px solid #c5b18c;margin:0 0 24px;}
.dialog .speech-turn{position:relative;margin:22px 0 20px;padding:23px 20px 18px;background:#2c454b;border:1px solid #233a3e;border-radius:3px;box-shadow:3px 3px 0 #d7c29a;}
.dialog .speaker-name{position:absolute;left:16px;top:-12px;display:inline-block;min-width:42px;padding:3px 12px;background:#eac98d;color:#344342;border:1px solid #af8b52;border-radius:2px;text-align:center;font-size:12px;font-weight:800;line-height:1.5;letter-spacing:1px;}
.dialog .spoken-line{margin:0;color:#fff3da;font-size:19px;line-height:1.8;font-family:'Songti SC','Noto Serif SC',SimSun,serif;font-weight:600;}
.dialog .player-turn{margin:13px 0 22px;padding:10px 14px;background:#ede5d3;border:0;border-left:3px solid #91a58b;box-shadow:none;}
.dialog .player-turn .speaker-name{position:static;min-width:0;padding:0;margin-right:8px;border:0;background:transparent;color:#577357;font-size:12px;letter-spacing:0;}
.dialog .player-turn .spoken-line{display:inline;color:#58614f;font-family:inherit;font-size:13px;font-weight:400;}
.dialog button.choice{position:relative;width:100%;display:block;min-height:50px;margin:9px 0;padding:13px 38px 13px 15px;text-align:left;color:#30474a;border:1px solid #94a295;border-bottom-width:2px;border-radius:4px;background:#fffdf5;box-shadow:0 2px 0 #ddd2b9;font-size:14px;font-weight:600;line-height:1.65;transition:background .14s,border-color .14s,box-shadow .14s;}
.dialog button.choice:after{content:'›';position:absolute;right:15px;top:50%;transform:translateY(-50%);color:#6a826f;font-size:23px;font-weight:400;line-height:1;}
.dialog #dialog-body button:hover:not(:disabled){transform:none;}
.dialog button.choice:hover:not(:disabled){background:#e5eddf;border-color:#4b6c59;box-shadow:0 2px 0 #a5b397;}
.dialog button.choice:active:not(:disabled){background:#d2e0c9;box-shadow:inset 0 2px 0 #b4c8ac;}
.dialog button:focus-visible,.dialog input:focus-visible,.dialog textarea:focus-visible{outline:3px solid #ba673c;outline-offset:3px;}
.dialog button.choice.primary{background:#355e55!important;border:1px solid #294e46!important;border-bottom-width:3px!important;color:#fff9e8!important;box-shadow:0 2px 0 #d7c29a!important;}
.dialog button.choice.primary:hover:not(:disabled){background:#254c43!important;}
.dialog button.choice.primary:after{color:#f4d99e;}
.dialog .story-options{margin-top:26px;}
.dialog .choice-prompt{display:flex;gap:12px;align-items:center;color:#6a705e;font-size:11px;font-weight:600;letter-spacing:1px;margin:0 0 10px;}
.dialog .choice-prompt:after{content:'';height:1px;background:#d7ccb1;flex:1;}
.dialog button.story-choice{display:flex;align-items:center;gap:10px;padding:14px 36px 14px 52px;min-height:60px;font-size:15px;font-weight:500;}
.dialog button.story-choice:before{content:attr(data-number);position:absolute;left:12px;top:50%;transform:translateY(-50%);width:27px;height:27px;line-height:25px;text-align:center;background:#e8ebdc;color:#566d5b;border:1px solid #afba9e;border-radius:3px;font-family:Georgia,serif;font-size:13px;}
.dialog button.story-choice:hover:not(:disabled),.dialog button.story-choice:focus-visible{background:#355e55;color:#fff9e8;border-color:#294e46;}
.dialog button.story-choice:hover:not(:disabled):before,.dialog button.story-choice:focus-visible:before{background:#edce94;border-color:#edce94;color:#304c46;}
.dialog button.story-choice:hover:not(:disabled):after,.dialog button.story-choice:focus-visible:after{color:#f5d797;}
.dialog .choice-label{flex:1;min-width:0;}
.dialog .choice-badge{flex-shrink:0;padding:1px 6px;border:1px solid #aeb69e;border-radius:2px;color:#68735f;font-size:10px;line-height:1.6;font-weight:400;}
.dialog .story-choice:hover .choice-badge,.dialog .story-choice:focus-visible .choice-badge{color:#ecedd8;border-color:#8eac92;}
.dialog button.quiet-choice{border:0;border-top:1px solid #d5c8ad;border-radius:0;box-shadow:none;background:transparent;min-height:44px;margin:14px 0 0;padding:12px 30px 7px 0;color:#626c5d;font-size:12px;font-weight:500;}
.dialog button.quiet-choice:hover:not(:disabled){background:#f1ebd8;box-shadow:none;border-color:#9eac91;}
.dialog button.choice:disabled{opacity:1!important;background:#e9e7dd!important;color:#747666!important;border-color:#c6c7b9!important;box-shadow:none!important;cursor:not-allowed;}
.dialog button.choice:disabled:after{content:'—';color:#8b8d7d;font-size:17px;}
.dialog .reward,.dialog .memory-stamp{color:#45624e;background:#eaf0de;border:0;border-left:3px solid #8ca477;border-radius:2px;padding:10px 12px;font-size:12px;line-height:1.7;margin:16px 0;}
.dialog .notice{color:#884b30;background:#f7e8d6;padding:10px 12px;border-left:3px solid #b6764a;}
.dialog button.recipe-card{display:flex;align-items:center;gap:13px;min-height:88px;margin:10px 0;padding:13px 34px 13px 12px;}
.dialog .recipe-card .pixel-icon{flex:0 0 42px;width:42px;height:42px;filter:none;}
.recipe-copy{display:block;min-width:0;flex:1;}
.recipe-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:6px;}
.recipe-heading strong{font-size:16px;line-height:1.5;color:inherit;}
.recipe-cost{white-space:nowrap;color:#8a5c31;font-size:12px;font-weight:700;}
.recipe-stats{display:flex;flex-wrap:wrap;gap:5px 10px;color:#5c6c58;font-size:12px;font-weight:400;}
.recipe-stats span{white-space:nowrap;}
.recipe-stats span+span:before{content:'·';margin-right:10px;color:#a7af94;}
.recipe-best{display:block;font-size:10px;color:#7a775e;font-weight:400;margin-top:4px;}
.choice-reason{display:block;font-size:11px;color:#845c41;font-weight:400;margin-top:4px;line-height:1.6;}
.dialog[data-kind=kitchen] .speech-turn{margin-top:14px;margin-bottom:20px;padding:20px 16px 13px;}
.dialog[data-kind=kitchen] .spoken-line{font-size:16px;}
.dialog[data-kind=story] #dialog-body>.hint:last-child{margin-top:20px;padding-top:10px;border-top:1px solid #d8ceb6;text-align:right;font-size:11px;}
.dialog .decor-room-tabs .choice,.dialog .decor-tabs .choice{padding:9px 2px;min-height:42px;text-align:center;}
.dialog .decor-room-tabs .choice:after,.dialog .decor-tabs .choice:after,.dialog .ingredient-tray .choice:after{content:none;}
.dialog .ingredient-tray .choice{padding:14px 8px;text-align:center;font-size:16px;}
.dialog .cg-tile .choice{padding:8px 19px 8px 4px;min-height:44px;font-size:11px;text-align:center;}
.dialog .cg-tile .choice:after{right:7px;font-size:18px;}
.dialog .decor-store-grid .choice{padding:9px 20px 9px 4px;font-size:11px;}
.dialog .decor-store-grid .choice:after{right:7px;font-size:18px;}
@media(max-width:600px){
 .overlay{padding:12px;}
 .dialog{max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);border-radius:5px;}
 .dialog-head{padding:15px 16px 13px;gap:8px;}
 .dialog h2{font-size:19px;}.dialog-context{font-size:9px;margin-bottom:4px;}
 #dialog-body{padding:18px 16px;}
 .dialog p,.dialog .scene-cue{font-size:13px;}
 .dialog .speech-turn{padding:20px 15px 15px;}
 .dialog .spoken-line{font-size:18px;}
 .dialog .player-turn .spoken-line{font-size:12px;}
 .dialog button.story-choice{padding:12px 28px 12px 45px;font-size:14px;min-height:58px;gap:6px;}
 .dialog button.story-choice:before{left:10px;width:24px;height:24px;line-height:22px;font-size:12px;}
 .dialog button.choice:after{right:10px;}
 .dialog .choice-badge{font-size:9px;padding:1px 4px;}
 .dialog button.recipe-card{gap:8px;padding:12px 25px 12px 9px;min-height:82px;}
 .dialog .recipe-card .pixel-icon{flex-basis:33px;width:33px;height:33px;}
 .recipe-heading{gap:6px;}.recipe-heading strong{font-size:14px;}.recipe-cost{font-size:11px;}
 .recipe-stats{font-size:11px;gap:4px 6px;}.recipe-stats span+span:before{margin-right:6px;}
 .dialog[data-kind=kitchen] .spoken-line{font-size:15px;}
}
@media(max-height:650px){.dialog-head{padding-top:12px;padding-bottom:10px;}#dialog-body{padding-top:15px;padding-bottom:15px;}.dialog .speech-turn{margin-top:17px;margin-bottom:16px;}.dialog .story-options{margin-top:20px;}.dialog button.recipe-card{min-height:76px;margin:8px 0;}.dialog .hint{margin-top:8px;}}
@media(prefers-reduced-motion:reduce){.dialog{animation:none;}.dialog button.choice{transition:none;}}

.dialog[data-kind=share] .xhs-share-image{display:block;width:auto;max-width:100%;height:210px;object-fit:contain;margin:0 auto 10px;border-radius:8px}
.dialog[data-kind=share] textarea{box-sizing:border-box;width:100%;min-height:126px;resize:vertical;font-size:14px;line-height:1.6;padding:10px;user-select:text;-webkit-user-select:text;color:#244b48;background:#fffdf5;border:1px solid #b4b396;border-radius:8px}
.dialog[data-kind=share] label{display:block;font-size:13px;margin:8px 0}
