#town-hut-objective{position:absolute;top:112px;left:14px;max-width:min(380px,55vw);box-sizing:border-box;padding:19px 23px 20px;color:#503320;background:none;border:0;box-shadow:none;font-family:"Velmora Pixel",Bahnschrift,sans-serif;font-size:14px;line-height:1.35;pointer-events:none}
#town-hut-objective canvas{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;z-index:0}
#town-hut-objective .objective-title,#town-hut-objective .objective-text{position:relative;z-index:1;display:block;font-weight:400;text-shadow:none}
#town-hut-objective .objective-title{font-size:15px;color:#743f2c;margin-bottom:5px}
#town-hut-objective .objective-title[hidden]{display:none}
#town-hut-objective .objective-text[hidden]{display:none}
#town-explorer #town-hut-objective{font-size:17px;line-height:1.4;max-width:min(410px,55vw)}
#town-explorer #town-hut-objective .objective-title{font-size:18px}
#town-explorer #town-hut-objective .objective-guide{position:relative;z-index:1;pointer-events:auto;font-size:15px;padding:5px 12px;margin-top:9px;min-height:34px}
#town-explorer #town-hut-objective .objective-guide[hidden]{display:none}
#town-quest-update{position:absolute;z-index:12;top:26px;left:50%;transform:translateX(-30%);width:min(550px,48vw);box-sizing:border-box;padding:18px 42px 18px 22px;background:#f5dfa4;color:#3c2b20;border:5px solid #825028;box-shadow:inset 0 0 0 2px #c29242,0 4px 0 #30241ccb;font-family:"Velmora Pixel",Bahnschrift,sans-serif;pointer-events:none}
#town-quest-update[hidden]{display:none}
#town-quest-update strong{display:block;color:#6e4021;font-size:20px;margin-bottom:6px}
#town-explorer #town-quest-update p{font-size:18px;line-height:1.5;margin:0;text-wrap:pretty}
#town-explorer #town-quest-update button{position:absolute;right:9px;top:9px;pointer-events:auto;font-size:20px;padding:0;width:28px;height:28px}
@media(max-width:700px){#town-quest-update{top:140px;left:12px;transform:none;width:calc(100% - 24px);padding:14px 38px 14px 17px}#town-explorer #town-quest-update p{font-size:16px}#town-explorer:has(#town-quest-update:not([hidden])) #town-hut-objective{visibility:hidden}#town-explorer #town-hut-objective{font-size:15px;max-width:75vw}}
#town-hut-objective .objective-fold{display:block;position:absolute;right:12px;top:12px;z-index:2;width:23px;height:23px;padding:0;line-height:20px;pointer-events:auto}
#town-explorer #town-hut-objective .objective-title,#town-explorer #town-hut-objective .objective-text{padding-right:22px}
#town-cat-chooser{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:#15231dde;padding:20px;box-sizing:border-box;overflow:auto}
#town-cat-chooser[hidden],#town-hut-objective[hidden]{display:none}
#town-cat-chooser section{width:min(830px,100%);max-height:100%;overflow:auto;box-sizing:border-box;background:#f0d7aa;color:#493126;border:8px solid #a96c36;border-width:12px 8px 8px;border-image:var(--px-plaque-normal) 6 4 4 fill/12px 8px 8px stretch;box-shadow:0 0 0 3px #3d2924,0 12px 45px #0008;padding:22px;text-align:center}
#town-explorer #town-cat-chooser h2{font-size:25px;line-height:1.25;color:#533522;margin-bottom:10px}
#town-explorer #town-cat-chooser p{font-size:17px;line-height:1.4;margin:8px 0 15px}
.cat-breeds{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0;max-height:48vh;overflow:auto;padding:4px;scrollbar-color:#93683d #e7c590;overscroll-behavior:contain}
#town-explorer .cat-breeds button{display:flex;flex-direction:column;white-space:normal;text-align:center;gap:5px;padding:8px 5px;background:#e7c590;border:3px solid #a67646;border-image:none;min-width:0}
#town-explorer .cat-breeds button[aria-pressed="true"]{background:#f9e3b5;border-color:#426d51;box-shadow:inset 0 0 0 2px #759261}
.cat-breeds canvas{width:100%;max-width:240px;height:auto;image-rendering:pixelated}
.cat-breeds strong{font-size:17px;line-height:1.2}.cat-breeds small{font-size:13px;line-height:1.25;min-height:33px}
#town-explorer #town-cat-chooser button:disabled{opacity:.5;cursor:default}
@media(max-width:650px){#town-cat-chooser{padding:9px}.cat-breeds{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}#town-cat-chooser section{padding:12px}.cat-breeds canvas{max-height:85px;object-fit:contain}#town-hut-objective{top:135px;font-size:14px;max-width:65vw}}
#town-quest-choice{position:absolute;inset:0;z-index:21;display:flex;align-items:center;justify-content:center;padding:20px;background:#15231dcc;box-sizing:border-box}
#town-quest-choice[hidden]{display:none}
#town-quest-choice section{width:min(620px,100%);padding:24px;background:#f0d7aa;color:#493126;border:8px solid #a96c36;border-image:var(--px-plaque-normal) 6 4 4 fill/12px 8px 8px stretch;box-shadow:0 12px 40px #0008}
#town-explorer #town-quest-choice h2{font-size:24px;line-height:1.3;margin-bottom:16px}
#town-explorer #town-quest-choice p{font-size:18px;line-height:1.45;margin-bottom:22px}
#town-explorer #town-quest-choice button{display:block;width:100%;margin:10px 0;white-space:normal;line-height:1.3;padding:10px}
/* Merchant stock has a proper counter catalogue. Conversation stays in its frame. */
#town-quest-choice.shop-choice{background:#17291dcc;padding:24px}
#town-quest-choice.shop-choice section{width:min(920px,100%);max-height:calc(100% - 12px);overflow:auto;box-sizing:border-box;overscroll-behavior:contain;scrollbar-color:#8a7043 #efe1b9;background:#f1e3bd;border:8px solid #87603a;box-shadow:0 0 0 3px #302e25,0 12px 40px #0008;padding:20px 24px}
#town-quest-choice.shop-choice header{display:flex;align-items:center;justify-content:space-between;gap:14px;border-bottom:2px solid #a58a53;padding-bottom:12px;margin-bottom:14px}
#town-explorer #town-quest-choice.shop-choice h2{margin:0;color:#344f3c;font-size:27px}
#town-quest-choice .shop-balance{background:#e0cd96;border:2px solid #af9156;padding:7px 11px;font-size:17px;white-space:nowrap}
#town-explorer #town-quest-choice.shop-choice p{font-size:17px;margin:0 0 16px}
#town-quest-choice .shop-stock{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#town-explorer #town-quest-choice .shop-product{display:flex;flex-direction:column;align-items:stretch;gap:5px;text-align:left;min-width:0;margin:0;padding:12px;background:#fcf0cb;border:2px solid #a99263;border-image:none;box-shadow:0 3px 0 #ad9564}
#town-explorer #town-quest-choice .shop-product:hover,#town-explorer #town-quest-choice .shop-product:focus-visible{background:#fff8dd;border-color:#486044;outline:2px solid #486044;outline-offset:1px}
#town-quest-choice .shop-product strong{font-size:18px;color:#354d36}
#town-quest-choice .shop-product-note{font-size:15px;line-height:1.45;color:#654c36}
#town-quest-choice .shop-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:18px;padding-top:12px;border-top:2px solid #c2ab78}
#town-explorer #town-quest-choice .shop-actions button{margin:0;font-size:16px;min-height:44px}
@media(max-width:650px){#town-quest-choice.shop-choice{padding:10px}#town-quest-choice.shop-choice section{padding:14px}#town-quest-choice.shop-choice header{align-items:flex-start;flex-direction:column;gap:8px}#town-quest-choice .shop-stock,#town-quest-choice .shop-actions{grid-template-columns:1fr}#town-explorer #town-quest-choice.shop-choice h2{font-size:23px}}
/* Naming the stray: a free text box and a boy/girl choice. */
#town-name-cat{position:absolute;inset:0;z-index:22;display:flex;align-items:center;justify-content:center;padding:20px;background:#15231dcc;box-sizing:border-box}
#town-name-cat[hidden]{display:none}
#town-name-cat section{width:min(560px,100%);padding:24px;background:#f0d7aa;color:#493126;border:8px solid #a96c36;border-image:var(--px-plaque-normal) 6 4 4 fill/12px 8px 8px stretch;box-shadow:0 12px 40px #0008;box-sizing:border-box}
#town-explorer #town-name-cat h2{font-size:24px;line-height:1.3;margin-bottom:14px}
#town-explorer #town-name-cat p{font-size:18px;line-height:1.45;margin-bottom:18px}
#town-explorer #town-name-cat p.note{margin:16px 0 0;font-size:15px;opacity:.72}
#town-explorer #town-name-cat label{display:block;font-size:15px;letter-spacing:.06em;text-transform:uppercase;opacity:.75;margin-bottom:6px}
#town-explorer #town-name-cat input{display:block;width:100%;box-sizing:border-box;margin-bottom:20px;padding:10px 12px;font:inherit;font-size:20px;color:#493126;background:#fbecd0;border:4px solid #a96c36;border-radius:0;outline-offset:2px}
#town-explorer #town-name-cat input::placeholder{color:#493126;opacity:.4}
#town-explorer #town-name-cat input:focus-visible{outline:3px solid #6d4a2c}
#town-explorer #town-name-cat .cat-gender{display:flex;gap:10px;margin-bottom:22px}
#town-explorer #town-name-cat .cat-gender button{flex:1;margin:0;padding:10px;white-space:normal;line-height:1.3}
#town-explorer #town-name-cat .cat-gender button[aria-pressed="true"]{box-shadow:inset 0 0 0 4px #6d4a2c}
#town-explorer #town-name-cat button[type="submit"]{display:block;width:100%;margin:0;padding:10px;white-space:normal;line-height:1.3}
#town-explorer #town-name-cat button[disabled]{opacity:.5;cursor:not-allowed}

#town-quest-choice section{max-height:90%;overflow-y:auto;box-sizing:border-box}
.quest-journey{margin:8px 0!important;padding:8px 12px!important}.quest-journey p{margin:3px 0!important}

#town-quest-choice .quest-entry{display:block;text-align:center;font-size:18px}
#town-quest-choice .quest-entry input{display:block;box-sizing:border-box;width:190px;max-width:100%;margin:12px auto 18px;padding:10px;border:3px solid #82542e;background:#fff1d0;color:#493126;font:inherit;font-size:30px;letter-spacing:8px;text-align:center}
#town-quest-choice .quest-entry input:focus{outline:3px solid #627c64;outline-offset:3px}

/* Dialogue decisions use the existing portrait-and-parchment art, with no dimmer. */
#town-explorer #town-quest-choice.dialogue-choice{background:transparent;padding:0;align-items:flex-end;pointer-events:none}
#town-explorer #town-quest-choice.dialogue-choice .dialogue-choice-frame{position:relative;width:min(1120px,96vw);margin:0 0 18px;padding:0;border:0;border-image:none;box-shadow:none;background:transparent;overflow:visible;max-height:none;pointer-events:auto;filter:drop-shadow(0 5px 6px #0006)}
.dialogue-choice-frame>canvas{display:block;width:100%;height:auto;image-rendering:pixelated}
.dialogue-choice-name{position:absolute;left:3.52%;top:80.4%;width:13.31%;height:8.9%;box-sizing:border-box;padding:0 4px;display:flex;align-items:center;justify-content:center;color:#39271d;font-family:'Velmora Pixel',sans-serif;font-weight:600;line-height:1;white-space:nowrap;overflow:hidden}
.dialogue-choice-content{position:absolute;left:21.8%;right:5%;top:17%;bottom:23.5%;overflow-y:auto;overscroll-behavior:contain;padding:2px 10px 3px 2px;scrollbar-width:thin;scrollbar-color:#a16c32 #edca77}
#town-explorer #town-quest-choice.dialogue-choice p{font-size:clamp(14px,1.5vw,20px);line-height:1.25;margin:0 0 8px}
#town-explorer #town-quest-choice.dialogue-choice button{position:relative;display:block;box-sizing:border-box;width:100%;min-height:30px;margin:2px 0;padding:4px 10px 4px 23px;border:0;border-image:none;background:transparent;box-shadow:none;color:#452817;font-size:clamp(14px,1.45vw,19px);line-height:1.15;text-align:left;white-space:normal;translate:none}
#town-explorer #town-quest-choice.dialogue-choice button::before{content:'›';position:absolute;left:5px;color:#855122}
#town-explorer #town-quest-choice.dialogue-choice button:is(:hover,:focus-visible){background:#84532316;outline:1px solid #9a682a;outline-offset:-1px}
#town-explorer #town-quest-choice.dialogue-choice .quest-entry{text-align:left;font-size:17px}
#town-explorer #town-quest-choice.dialogue-choice .quest-entry input{margin:6px 0;padding:4px;font-size:23px;width:150px}
.dialogue-choice-preview{display:block;width:160px;max-width:100%;height:auto;image-rendering:pixelated}
.dialogue-choice-keepsake{position:absolute;left:3.36%;top:15.45%;width:13.31%;height:56.83%;display:grid;place-items:center;overflow:hidden}
.dialogue-choice-keepsake canvas{width:100%!important;max-width:100%!important;height:auto!important;margin:0!important;image-rendering:pixelated}
.dialogue-choice-scroll{position:absolute;right:6%;bottom:17%;font:14px/1 'Velmora Pixel',sans-serif;color:#80552e;pointer-events:none}
#town-explorer:has(.dialogue-choice:not([hidden])) #town-story-dialogue{visibility:hidden}
#town-explorer:has(.dialogue-choice:not([hidden])) :is(#town-controls,#town-backpack,#town-save,#town-door){visibility:hidden;pointer-events:none}
@media(max-height:480px){#town-explorer #town-quest-choice.dialogue-choice .dialogue-choice-frame{width:min(820px,92vw);margin-bottom:8px}}
@media(max-width:700px){
 .dialogue-choice-frame>canvas{height:240px}
 .dialogue-choice-name{left:26px;top:20px;width:calc(100% - 52px);height:23px;justify-content:flex-start;padding:0}
 .dialogue-choice-content{left:26px;right:24px;top:51px;bottom:51px}
 #town-explorer #town-quest-choice.dialogue-choice p{font-size:16px}
 #town-explorer #town-quest-choice.dialogue-choice button{font-size:16px;min-height:36px}
 .dialogue-choice-content .dialogue-choice-keepsake{position:static;width:140px;height:90px;margin:4px auto}
 .dialogue-choice-scroll{bottom:31px;right:26px;font-size:12px}
}

@media(min-width:701px){
 .dialogue-choice-frame[data-narration="true"] .dialogue-choice-name{left:5%;top:14%;width:88%;height:8%;justify-content:flex-start}
 .dialogue-choice-frame[data-narration="true"] .dialogue-choice-content{left:5%;top:26%;right:5%}
}
