:root{--bg:#0e0b0a;--panel:#191512;--panel2:#211a15;--gold:#cead72;--goldbright:#efce8b;--edge:#54412c;--paper:#ddcba9;--muted:#948b7f;--blood:#a53a27;--line:#342b23}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% -20%,#332315 0%,#110d0a 48%,#070605 100%);color:#d8cfbb;font-family:Georgia,serif;min-height:100vh;overflow-x:hidden}button{font:inherit;cursor:pointer}button:disabled{opacity:.37;cursor:not-allowed}.grain{position:fixed;inset:0;z-index:40;pointer-events:none;opacity:.13;background-image:url('data:image/svg+xml,%3Csvg viewBox="0 0 180 180" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency=".85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)" opacity=".4"/%3E%3C/svg%3E')}#app{max-width:1800px;padding:13px 18px 15px;margin:auto}.topbar{height:74px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #655038;margin-bottom:13px}.brand{display:flex;align-items:center;gap:11px}.sigil{color:#f5d49d;font-size:42px;text-shadow:0 0 24px #be662f;border:1px solid #755a32;border-radius:50%;width:53px;height:53px;text-align:center;line-height:49px}.brand small,.chapter-head span,.kicker{font:600 9px 'Cinzel',Georgia,serif;letter-spacing:3px;color:var(--gold);display:block}.brand h1{font:700 23px 'Cinzel',Georgia,serif;color:#f3deb3;margin:2px 0;letter-spacing:1.9px;text-shadow:0 2px #000}.chapter-head{text-align:center}.chapter-head strong{font:600 16px 'Cinzel',Georgia,serif;color:#dfd0aa}.toptools{display:flex;gap:7px}.iconbtn{background:#221b16;color:#c7ae84;border:1px solid #5c482e;width:38px;height:38px;font-size:20px;border-radius:4px}.iconbtn:hover{color:#fff;border-color:#cc9e64}.layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:14px}.worldpanel{min-width:0}.worldframe{border:2px solid #746045;outline:3px solid #18110b;position:relative;aspect-ratio:16/9;background:#0c0908;overflow:hidden;box-shadow:0 0 36px #000}#glview{display:block;width:100%;height:100%;object-fit:fill;image-rendering:auto}.screenfx{position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,transparent 36%,#0009 100%),repeating-linear-gradient(180deg,transparent 0,transparent 3px,#08060616 4px);mix-blend-mode:multiply}.reticle{position:absolute;top:50%;left:50%;width:24px;height:24px;transform:translate(-50%,-50%);opacity:.68;filter:drop-shadow(0 1px 2px black)}.reticle i{position:absolute;background:#e5d8b3;top:11px;left:2px;width:20px;height:1px}.reticle i+ i{transform:rotate(90deg)}.worldtop{position:absolute;top:15px;left:15px;right:15px;display:flex;justify-content:space-between;gap:10px}.lozenge{background:#0b0809b8;border:1px solid #8b704b7f;padding:7px 12px;color:#e6d2ab;font:700 10px 'Cinzel',Georgia,serif;letter-spacing:1.2px;text-shadow:1px 2px 2px black}.lozenge b{color:white}.floorbadge{position:absolute;bottom:13px;right:15px;background:#0d0a09bf;color:#ccb99a;padding:5px 10px;font:600 10px 'Cinzel',Georgia,serif;letter-spacing:1px}.floorbadge b{color:#f5cc73}.enemylabel{position:absolute;top:57%;left:50%;transform:translateX(-50%);font:700 13px 'Cinzel',serif;color:#e8d5a8;text-shadow:0 2px 4px #000;pointer-events:none}.toast{position:absolute;bottom:17%;left:50%;transform:translateX(-50%);color:#f3dfb9;background:linear-gradient(90deg,#080707d0,#3a2114ec,#080707d0);text-align:center;font:600 13px 'Cinzel',serif;padding:12px 25px;opacity:0;transition:opacity .25s;min-width:300px;pointer-events:none}.toast.show{opacity:1}.worldbottom{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:68px;margin-top:3px;background:linear-gradient(90deg,#302418,#18130f);border:1px solid #5c4933;padding:10px 16px}.objective{display:flex;gap:13px;align-items:center;font:15px 'IM Fell English',Georgia,serif}.objective small,.section h3,.currenthero small,.stats span,.quest-progress{display:block;font:600 9px 'Cinzel',Georgia,serif;letter-spacing:1.7px;color:var(--gold)}.objective .diamond{color:#ddab5f;font-size:23px}.objective small{margin-bottom:5px}.quest-progress{color:#ab9878;text-align:right}.sidebar{display:flex;flex-direction:column;gap:10px;min-width:0}.section{background:linear-gradient(145deg,#241a14,#17130f 64%);border:1px solid #604b32;position:relative;padding:12px 14px}.section h3{margin:0 0 10px;padding-bottom:10px;border-bottom:1px solid #59452b;color:#e2c18d}.section h3 span{color:#81644b;margin-right:8px}.mapsection canvas{width:100%;height:auto;display:block;background:#100f0d;border:1px solid #544634}.maplegend{display:flex;justify-content:space-between;margin-top:9px;font:10px Georgia;color:#a9a093}.ldot{display:inline-block;width:7px;height:7px;border-radius:100%;margin-right:4px}.ldot.gold{background:#f7cc5e}.ldot.red{background:#c04b3e}.ldot.blue{background:#6496aa}.currenthero{display:flex;gap:13px}.currenthero img{width:85px;height:98px;object-fit:cover;border:2px solid #8a6747;box-shadow:inset 0 0 15px black}.currenthero>div{flex:1;min-width:0}.currenthero small{margin:5px 0 3px}.currenthero h2{font:700 18px 'Cinzel',Georgia,serif;color:#f4dcae;margin:3px 0 12px}.statrow{display:flex;justify-content:space-between;gap:4px;font:10px Georgia;color:#c7b6a0}.statrow strong{color:#e9c88a}.hpbar{background:#120d0a;border:1px solid #5c3a29;height:8px;margin-top:8px}.hpbar i{display:block;height:100%;background:linear-gradient(90deg,#652719,#cb4e2d,#de9263);width:100%}.stats{display:grid;grid-template-columns:repeat(3,1fr);margin-top:13px;border-top:1px solid #3c3025;padding-top:9px;gap:8px}.stats div{text-align:center}.stats b{display:block;margin-top:6px;color:#ead4a5;font:600 14px 'Cinzel',serif}.journal{flex:1;min-height:150px}.log{max-height:135px;overflow:auto;padding:2px 5px 0 0;color:#bdb09b;font:12px/1.45 Georgia,serif;scrollbar-color:#5b422a transparent}.log p{border-bottom:1px solid #30281f;padding:0 0 7px;margin:0 0 7px}.log p:first-child{color:#e2c68f}.partybar{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-top:12px}.party{display:flex;align-items:center;min-width:0;padding:6px 9px;background:linear-gradient(90deg,#272018,#191511);border:1px solid #564531;gap:9px;position:relative;filter:brightness(.8);transition:.25s}.party.active{border-color:#d5a85d;background:linear-gradient(90deg,#3e2e1b,#19130f);filter:brightness(1);box-shadow:inset 0 0 0 1px #977346,0 0 12px #a2662938}.party img{height:54px;width:52px;object-fit:cover;object-position:top;border:1px solid #5f4831}.party small{font:8px 'Cinzel',serif;letter-spacing:1.5px;color:#b89b6c}.party strong{display:block;font:600 13px 'Cinzel',serif;color:#f1d8b1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.party em{display:block;font:11px Georgia;color:#bfaa8c;margin-top:4px}.party.done:after{content:'✓';position:absolute;right:9px;top:8px;color:#8ba978;font-size:17px}.controls{margin-top:12px;padding:11px 12px;border:1px solid #544029;background:#1e1712;display:flex;gap:18px;align-items:center;justify-content:space-between}.actionprimary{display:flex;gap:7px;flex:1;min-width:0}.action{border:1px solid #58452f;background:linear-gradient(180deg,#2d241a,#17120e);color:#d4b687;padding:7px 12px;min-width:0;display:flex;align-items:center;gap:9px;text-align:left;min-height:56px;font:700 10px 'Cinzel',Georgia,serif;white-space:nowrap;transition:.15s}.action:hover:not(:disabled){border-color:#e0ae6d;filter:brightness(1.2)}.action small{display:block;font:8px Georgia;color:#8d8274;margin-top:4px;letter-spacing:.5px}.action .glyph{font-size:25px;color:#e8c68f}.action.mainbtn,.mainbtn{background:linear-gradient(180deg,#9d5e29,#603815);border:1px solid #dea45f;color:#fbe4b3}.action.mainbtn small{color:#e9cc9d}.action.end{margin-left:auto;border-color:#796a47}.move-help{display:flex;align-items:center;gap:12px;color:#8e816e;font:9px/1.7 'Cinzel',serif;letter-spacing:.3px}.controlpad{display:grid;grid-template-columns:repeat(3,28px);grid-template-rows:repeat(2,23px);gap:3px}.controlpad button{border:1px solid #604a32;background:#30261c;color:#dfba85;font-size:17px;line-height:15px}.controlpad button:hover{background:#79502d}.overlay{z-index:60;position:fixed;inset:0;background:#090606f5;align-items:center;justify-content:center;padding:22px;display:none;backdrop-filter:blur(10px)}.overlay.show{display:flex}.dialog{box-shadow:0 20px 70px #000;border:2px solid #ac8353;background:#221812;max-width:880px;width:100%;position:relative}.introdialog{display:grid;grid-template-columns:1.08fr .92fr;min-height:460px}.introart{min-height:460px;--scene-art:url('../assets/intro_1.jpg?v=0.43');background:#1d1715 center / cover;position:relative;border-right:1px solid #795b3e}.introart:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent 30%,#140f0cea),linear-gradient(0deg,#0c0909c4,transparent 60%)}.introbody{padding:42px 32px 30px;display:flex;flex-direction:column;justify-content:center;background:radial-gradient(ellipse at center,#3a2a1e,#201713 75%)}.kicker{font-size:10px;letter-spacing:2px}.introbody h2{font:700 31px/1.15 'Cinzel',serif;color:#f9e2ad;text-shadow:0 3px 7px #000;margin:17px 0 19px}.introbody p{font:18px/1.55 'IM Fell English',Georgia,serif;color:#e2d0b1;margin:0}.intro-note{border-top:1px solid #775b3e;margin-top:22px;padding-top:17px;font:12px/1.6 Georgia;color:#b4a08a}.dialogbuttons{margin-top:25px}.mainbtn{padding:12px 18px;font:700 11px 'Cinzel',Georgia,serif;letter-spacing:1.2px;border-radius:2px}.mainbtn:hover{filter:brightness(1.2)}.mainbtn span{margin-left:11px}.helptext{font:15px/1.7 Georgia,serif;color:#decaac}.helptext kbd{background:#0b0907;border:1px solid #a07b47;padding:3px 6px;color:#efdcbd}@media(max-width:1250px){.layout{grid-template-columns:minmax(0,1fr) 275px}.move-help>span{display:none}.action{padding:7px 8px}.action .glyph{font-size:19px}.brand h1{font-size:18px}.section{padding:10px}}@media(max-width:900px){.layout{grid-template-columns:1fr}.sidebar{display:grid;grid-template-columns:repeat(2,1fr)}.journal{grid-column:span 2}.partybar{grid-template-columns:repeat(2,1fr)}.controls{flex-direction:column}.actionprimary{width:100%;flex-wrap:wrap}.action{flex:1}.move-help>span{display:block}.chapter-head{display:none}}@media(max-width:560px){#app{padding:8px}.topbar{height:62px}.brand h1{font-size:14px}.brand small{font-size:7px}.sigil{font-size:29px;width:43px;height:43px;line-height:40px}.sidebar{grid-template-columns:1fr}.journal{grid-column:span 1}.partybar{grid-template-columns:repeat(2,1fr)}.party img{width:35px;height:42px}.party strong{font-size:10px}.party em{font-size:9px}.introdialog{grid-template-columns:1fr;max-height:95vh;overflow:auto}.introart{min-height:170px;border-right:0}.introbody{padding:20px}.introbody h2{font-size:23px}.introbody p{font-size:16px}.controlpad{grid-template-columns:repeat(3,40px);grid-template-rows:repeat(2,35px)}.action{min-width:30%;font-size:9px}.action small{font-size:7px}.worldbottom{font-size:12px}.quest-progress{display:none}}

/* VERSION 0.2 / compact responsive game cockpit – no document scroll on desktop */
@media(min-width:901px){
 html,body{height:100%;overflow:hidden}
 #app{height:100dvh;max-width:1900px;display:grid;grid-template-rows:55px minmax(0,1fr) 62px 66px;gap:7px;padding:6px 10px 9px;overflow:hidden}
 .topbar{height:55px;min-height:0;margin:0}
 .brand .sigil{height:43px;width:43px;line-height:40px;font-size:29px}
 .brand h1{font-size:20px;margin:0;line-height:1.05}
 .layout{min-height:0;grid-template-columns:minmax(0,1fr) minmax(260px,300px);gap:9px}
 .worldpanel{display:flex;flex-direction:column;min-height:0;overflow:hidden}
 .worldframe{aspect-ratio:auto;min-height:0;flex:1}
 .worldbottom{flex:0 0 49px;min-height:0;padding:5px 12px;margin-top:5px}
 .objective{font-size:13px}.objective small{margin-bottom:2px}.quest-progress{font-size:8px;max-width:35%}
 .sidebar{display:grid;grid-template-rows:minmax(0,1fr) auto minmax(74px,.47fr);gap:7px;min-height:0;overflow:hidden}
 .section{min-height:0;padding:9px 11px;overflow:hidden}.section h3{font-size:9px;padding-bottom:6px;margin-bottom:7px}
 .mapsection{display:flex;flex-direction:column;overflow:hidden}
 .mapsection canvas{min-height:0;flex:1;max-height:100%;width:100%;height:100%;object-fit:contain}
 .maplegend{flex:0 0 auto;margin-top:3px}.turnsection .currenthero img{width:65px;height:73px}
 .currenthero{gap:8px}.currenthero h2{font-size:15px;margin:2px 0 7px}.stats{margin-top:6px;padding-top:5px}.stats b{margin-top:2px}
 .journal{min-height:0;display:flex;flex-direction:column}.log{flex:1;min-height:0;max-height:none;overflow:auto;font-size:11px}
 .log p{padding-bottom:4px;margin-bottom:4px}
 .partybar{margin:0;gap:7px;min-height:0}.party{padding:4px 7px;min-width:0}.party img{width:45px;height:52px}.party small{font-size:8px}.party strong{font-size:12px}.party em{font-size:10px;margin-top:3px}
 .controls{margin:0;padding:5px 7px;gap:9px;min-height:0;overflow:hidden}
 .actionprimary{gap:4px}.action{min-height:49px;padding:4px 7px;gap:5px;font-size:9px}.action .glyph{font-size:20px}.action small{font-size:8px}
 .move-help{gap:6px}.controlpad{grid-template-columns:repeat(3,22px);grid-template-rows:repeat(2,21px);gap:2px}
 .move-help>span{display:none}
}
@media(min-width:901px) and (max-height:690px){
 #app{grid-template-rows:43px minmax(0,1fr) 49px 52px;gap:4px}
 .topbar{height:43px}.party img{width:31px;height:38px}.party em{font-size:9px}.controls .action{min-height:41px}.currenthero img{height:53px;width:52px}
}
.dicestage{position:absolute;left:50%;top:44%;transform:translate(-50%,-50%) scale(.7);z-index:6;opacity:0;pointer-events:none;transition:opacity .17s,transform .25s;perspective:650px;text-align:center;filter:drop-shadow(0 17px 16px #000c)}
.dicestage.visible{opacity:1;transform:translate(-50%,-50%) scale(1)}
.dice-cubes{display:flex;gap:43px;justify-content:center;align-items:center;min-height:135px}
.die{position:relative;width:72px;height:72px;transform-style:preserve-3d}
.die-face{width:72px;height:72px;position:absolute;inset:0;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);padding:10px;gap:3px;background:linear-gradient(132deg,#f7e5b5,#bda47b);border:2px solid #e7cfa1;border-radius:10px;box-shadow:inset -5px -6px 11px #50372085,inset 3px 3px 7px #fff5d79c,0 1px 9px #0009;backface-visibility:visible}
.die-face i{border-radius:50%;display:block}.die-face i.pip{background:#3d2216;box-shadow:inset 1px 2px 3px #120a08,0 1px 0 #fff6;transform:scale(.85)}
.face1{transform:translateZ(36px)}.face2{transform:rotateY(180deg) translateZ(36px)}.face3{transform:rotateY(90deg) translateZ(36px)}.face4{transform:rotateY(-90deg) translateZ(36px)}.face5{transform:rotateX(90deg) translateZ(36px)}.face6{transform:rotateX(-90deg) translateZ(36px)}
.dicetext{font:700 10px Georgia,serif;letter-spacing:3px;color:#f6da9c;background:#120a08d8;border:1px solid #977446a8;white-space:nowrap;padding:7px 12px;margin-top:12px}
.dicestage:not(.settled) .dicetext{font-size:0}.dicestage:not(.settled) .dicetext:before{content:'DIE WÜRFEL ROLLEN …';font-size:10px}
.partysetup{border:1px solid #715438;background:#180f0cd9;padding:11px;margin-top:14px;margin-bottom:5px}
.partysetup[hidden]{display:none}.partysetup>strong{font:700 11px Georgia,serif;letter-spacing:1.2px;color:#f0d399}
.herochoices{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin:9px 0}
.hero-choice{position:relative;cursor:pointer;background:#2b211b;border:2px solid #57432c;min-width:0;opacity:.48;transition:opacity .15s,border .15s}
.hero-choice:has(input:checked){opacity:1;border-color:#e5b65f;box-shadow:0 0 8px #aa632755}
.herochoices img{width:100%;height:65px;object-fit:cover;object-position:top;display:block}
.hero-choice input{position:absolute;top:2px;right:2px;accent-color:#d5a666;width:17px;height:17px}
.herochoices span{display:block;font:700 9px Georgia,serif;color:#e9ca96;letter-spacing:.3px;text-align:center;padding:4px 0}
.partysetup small{display:block;font:10px/1.35 Georgia,serif;color:#bca98a}
@media(max-height:740px){.introdialog{max-height:95vh;overflow:auto}.introart{min-height:0}.introbody{padding:18px 23px}.introbody h2{font-size:24px;margin:10px 0}.introbody p{font-size:14px;line-height:1.35}.intro-note{margin-top:10px;padding-top:8px}.dialogbuttons{margin-top:12px}}
#glview{cursor:crosshair}

/* Version 0.3: atmospheric grade for textured dungeon, preserving entire cockpit. */
.worldframe{box-shadow:inset 0 0 24px #0009,0 0 26px #000d;border-color:#8c6740}
.screenfx{background:radial-gradient(ellipse at center,transparent 52%,#0008 100%),repeating-linear-gradient(180deg,transparent 0,transparent 5px,#0d0b0810 6px);mix-blend-mode:multiply}
.grain{opacity:.06}
#glview{filter:contrast(1.10) saturate(1.13)}
.worldframe:after{content:'';position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 38px #08090c70}

/* Cinematic, three-column 16:9-inspired cockpit on desktop:
   portraits on the left, continuous 3D viewport center, parchment map on the right. */
@media (min-width:1250px) and (min-height:740px) {
 #app {
  max-width:1900px;
  height:100dvh;
  grid-template-columns:184px minmax(0,1fr) 286px;
  grid-template-rows:51px minmax(0,1fr) 73px;
  gap:8px;
  padding:7px 10px 9px;
 }
 .topbar {grid-column:1 / 4;grid-row:1;height:50px}
 .layout {display:contents}
 .worldpanel {grid-column:2;grid-row:2;min-width:0;min-height:0}
 .sidebar {grid-column:3;grid-row:2;grid-template-rows:minmax(0,1fr) auto minmax(82px,.58fr);gap:9px}
 .partybar {grid-column:1;grid-row:2;margin:0;display:flex;flex-direction:column;align-items:stretch;gap:8px;overflow:hidden;
    border:1px solid #564735;background:linear-gradient(120deg,#14100e,#2b1c13 50%,#120e0e);padding:8px 5px;}
 .party{flex:none;min-height:110px;align-items:flex-start;display:flex;flex-direction:column;padding:5px;gap:5px;
    box-shadow:inset 0 0 0 1px #0b0908,0 3px 9px #0009;border:1px solid #70553b;}
 .party img {width:67px;height:76px;object-fit:cover;object-position:top;float:left;margin-right:7px;}
 .party>div{position:absolute;left:82px;right:3px;top:9px;min-width:0;}
 .party small{font-size:8px;letter-spacing:.2px;line-height:1.15}
 .party strong{font-size:12px;white-space:normal;line-height:1.3;margin:2px 0 5px;}
 .party em{font-size:10px;line-height:1.3;word-break:normal;margin-top:5px;}
 .party.active {box-shadow:inset 0 0 0 1px #eb9a45,0 0 18px #b9704077,0 0 4px #e6a651;}
 .party:after{pointer-events:none}
 .controls {grid-column:1 / 4;grid-row:3;min-height:0;margin:0;padding:6px 8px;border:2px ridge #70533a;
   background:radial-gradient(ellipse at 45% 0,#51321f,#1d1510 60%,#0d0b0b)}
 .actionprimary{gap:7px}
 .action{min-height:56px;justify-content:center;flex-direction:column;gap:3px;padding:4px 9px;
   background:linear-gradient(160deg,#3c2b1c,#1b130e 48%,#100c0c);box-shadow:inset 0 0 0 1px #100b08,inset 0 2px 5px #8d6a3933;}
 .action .glyph{font-size:23px;line-height:1.0;text-shadow:0 0 13px #dca05280;}
 .action>span:last-child{text-align:center;font-size:9px;letter-spacing:.5px}
 .action small{font-size:7px;margin-top:2px;color:#a9927b}
 .action.mainbtn{background:linear-gradient(160deg,#975326,#4b2614 55%,#29190f)}
 .action.end {background:linear-gradient(160deg,#5a2c17,#301813 60%,#1a100e);border-color:#9d633f}
 .worldframe{border:2px solid #825d36}
 .mapsection {background:linear-gradient(145deg,#282016,#15110e 65%)}
 .mapsection canvas{border:3px ridge #916b45; background:#17120e}
 .section {border:2px ridge #68492e;box-shadow:inset 0 0 0 1px #16100c,0 3px 12px #0008}
 .worldbottom{border:2px ridge #715238;background:linear-gradient(100deg,#352312,#160f0d 67%)}
}
@media(min-width:1250px) and (min-height:740px) and (max-height:880px){
 .party{min-height:96px}.party img{height:64px;width:61px}.party>div{left:76px}.party em{margin-top:2px}
}
@media(min-width:1250px) and (min-height:740px){
 .controls>.actionprimary{display:flex;align-items:stretch;justify-content:stretch;flex:1;gap:7px}
 .controls .action{flex:1;min-width:84px;margin-left:0}
 .controls .action.mainbtn{flex:1.35}
 .controls .action.end{flex:1.2}
 .controls .move-help{flex:0 0 74px}
}

/* Version 0.4: spectator camera and visible, non-interactive monster phase. */
.monster-phase-banner{position:absolute;z-index:8;left:50%;top:17%;transform:translate(-50%,-50%);pointer-events:none;display:none;min-width:min(440px,80%);max-width:85%;text-align:center;background:linear-gradient(90deg,#090807df,#1b1816ef,#090807df);border:1px solid #bb7d4a;padding:11px 18px;color:#ffe0a0;font:700 12px/1.4 Georgia,serif;letter-spacing:1.2px;text-shadow:1px 2px 4px #000;box-shadow:0 4px 28px #000b}
.monster-phase-banner.show{display:block}.monster-phase-banner span{display:block;font-size:10px;letter-spacing:1.5px;color:#d8cbb4;margin-top:2px}
.worldframe.monster-turn{border-color:#ba583b}.worldframe.monster-turn .reticle{opacity:.22}
@media (prefers-reduced-motion: reduce) {.monster-phase-banner{transition:none}}

/* v0.5 — HeroQuest-inspired combat dice over the still-visible 3D world. */
.combat-stage{position:absolute;z-index:17;left:50%;top:49%;width:min(550px,88%);transform:translate(-50%,-46%) scale(.95);opacity:0;visibility:hidden;pointer-events:none;
 background:linear-gradient(145deg,#20130feb,#0d0a0cf4);border:2px ridge #cf9858;box-shadow:0 26px 75px #000e,inset 0 0 28px #6e3e2833;
 padding:15px 20px 13px;text-align:center;transition:opacity .17s,transform .19s,visibility .19s}
.combat-stage.visible{opacity:1;visibility:visible;transform:translate(-50%,-50%) scale(1)}
.combat-title{font:bold 17px Georgia,serif;color:#f7da9a;text-shadow:0 2px 12px #000;letter-spacing:1px}
.combat-detail{font:700 10px Georgia,serif;letter-spacing:1.3px;color:#e8bc73;margin:6px 0 13px}
.combat-row{padding:9px 5px;border-top:1px solid #71533966;min-height:72px}
.combat-row strong{display:block;color:#dcb783;letter-spacing:1.5px;font:700 10px Georgia,serif;margin-bottom:8px}
.combat-faces{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;min-height:46px}
.combat-die{width:43px;height:43px;display:grid;place-items:center;position:relative;border-radius:7px;border:2px solid #f7e3b4;
 background:linear-gradient(145deg,#fff5d7 0%,#d6be8f 50%,#a67e54 100%);
 box-shadow:inset 2px 2px 6px #fff9, inset -4px -6px 8px #533a2777,0 5px 9px #000b;color:#381d11;transform-origin:center center}
.combat-die span{font-size:32px;line-height:1;text-shadow:0 1px 0 #fff7}
.combat-die.white span{color:#fdfdf0;text-shadow:0 1px 2px #251d19,0 0 2px #25201c}
.combat-die.black span{color:#1d1918;text-shadow:0 1px 1px #fff8}
.combat-die.rolling{animation:combat-rattle .75s cubic-bezier(.27,.7,.27,.99) both}
@keyframes combat-rattle{0%{transform:translateY(-28px) rotate(0deg) rotateX(10deg) scale(.7);opacity:.75}
25%{transform:translateY(-11px) rotate(150deg) rotateX(170deg) scale(1.08)}
55%{transform:translateY(-23px) rotate(290deg) rotateY(200deg) scale(.9)}
85%{transform:translateY(3px) rotate(355deg) rotateX(360deg) scale(1.05)}
100%{transform:translateY(0) rotate(360deg) rotateX(360deg) scale(1);opacity:1}}
.combat-result{font:700 14px Georgia,serif;min-height:18px;margin-top:10px;color:#ffdc94;text-shadow:0 2px 5px #000}
@media(max-height:650px){.combat-stage{padding:7px 15px}.combat-row{min-height:48px;padding:4px}.combat-die{width:30px;height:30px}.combat-die span{font-size:22px}}
/* v0.6 – stable 2.5D illustrated FPS weapon, vintage display, maps, card reveals */
#glview{image-rendering:pixelated;touch-action:none;user-select:none}
.reticle,.worldtop,.floorbadge{pointer-events:none}
.worldframe{user-select:none}
.screenfx{background:radial-gradient(ellipse at center,transparent 58%,#0006 100%)}
#weaponOverlay{position:absolute;z-index:4;top:0;bottom:0;left:50%;width:76%;max-width:100%;transform:translateX(-50%);pointer-events:none;user-select:none}
#weaponOverlay img{position:absolute;width:auto;object-fit:contain;max-width:49%;bottom:-17%;pointer-events:none;transform-origin:50% 100%}
#weaponOverlay img[hidden]{display:none}
#weaponOverlay .gear-left{left:-8%;height:36%;bottom:-12%;object-position:left bottom}
#weaponOverlay.shield-raised .gear-left{left:15%;height:66%;bottom:-14%}
#weaponOverlay .gear-right{right:6%;height:66%;object-position:right bottom}
#weaponOverlay[data-role="1"] .gear-right{height:62%}
#weaponOverlay[data-role="2"] .gear-right{height:67%}
#weaponOverlay[data-role="3"] .gear-right{height:71%;right:8%}
#weaponOverlay .gear-effect{max-width:74%;left:50%;height:55%;bottom:-13%;object-position:center bottom;transform:translateX(-50%)}
.worldframe:has(.combat-stage.visible) #weaponOverlay{opacity:.48}

.custom-modal{position:fixed;inset:0;z-index:75;display:none;align-items:center;justify-content:center;padding:14px}.custom-modal.show{display:flex}
.modal-scrim{position:absolute;inset:0;background:#020203d9;backdrop-filter:blur(5px)}
.modal-dialog{position:relative;z-index:1;color:#f1d8ae;background:linear-gradient(150deg,#271c16,#0b0908);border:1px solid #b38455;box-shadow:0 24px 75px #000b,inset 0 0 0 3px #170f0b;max-width:min(700px,96vw);max-height:95vh;overflow:auto;width:100%;padding:20px 24px}
.modal-dialog.modal-wide{max-width:min(1100px,96vw)}
.modal-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border-bottom:1px solid #745238;padding-bottom:10px;margin-bottom:12px}
.modal-heading small{font:700 11px Georgia,serif;color:#b99b66;letter-spacing:2px}
.modal-heading h2{margin:4px 0 0;color:#eed29c;font:700 clamp(20px,2.6vw,29px) Georgia,serif}
.modal-x{background:#3d2518;border:1px solid #9e7246;color:#f8daa5;font-size:28px;width:38px;height:38px}
.map-modal-cols{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(260px,.8fr);gap:20px;min-width:0}
.full-map-wrap{background:#0e0b09;border:1px solid #8a6342;padding:10px;min-width:0}
.full-map-wrap canvas{max-width:100%;height:auto;image-rendering:pixelated;display:block}
.full-map-wrap p{margin:7px 5px 0;color:#bda585;font-size:11px}
.mission-details{overflow:auto;max-height:70vh;line-height:1.5;font-size:14px;color:#e0caa8}
.mission-details img{width:100%;max-height:165px;object-fit:cover;border:1px solid #745335}
.mission-details h3{margin:13px 0 4px;color:#ffda8e;letter-spacing:.7px}.mission-details p{margin:0 0 7px}
.search-menu{max-width:670px;margin:auto}.search-menu>p{color:#bba890;font-size:14px}
.search-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin:22px 0 8px}
.search-options button,.paper-button,.paper-note button{background:linear-gradient(#805023,#3b2111);color:#f3dcaf;border:2px ridge #bd8043;min-height:58px;padding:10px;font:700 13px Georgia,serif;cursor:pointer}
.search-options button:hover,.paper-button:hover{filter:brightness(1.2)}
.card-modal{text-align:center}.flip-card{width:min(300px,66vw);height:420px;perspective:1300px;margin:18px auto;cursor:pointer}
.flip-inner{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .85s cubic-bezier(.17,.7,.2,1)}.flip-card.turned .flip-inner{transform:rotateY(180deg)}
.flip-back,.flip-front{position:absolute;inset:0;backface-visibility:hidden;border-radius:12px;border:7px ridge #a7793c;box-shadow:0 12px 35px #000c,inset 0 0 15px #221008aa}
.flip-back{background:radial-gradient(#755022,#2c1a12 55%,#140c08);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px}
.flip-back span{font-size:105px;color:#e7bf72;text-shadow:0 0 30px #e59843}.flip-back strong{font:700 14px Georgia,serif;letter-spacing:3px}.flip-back em{font-size:65px;color:#cfaa6f}
.flip-front{transform:rotateY(180deg);background:linear-gradient(140deg,#f4dc9f,#c2a476 65%,#8e704b);color:#352115;padding:15px 18px;text-align:center;display:flex;flex-direction:column;align-items:center}
.flip-front h3{font:bold 24px Georgia,serif;margin:5px 0 10px;line-height:1.12}
.card-art{flex:1;min-height:0;overflow:hidden;align-self:stretch;display:grid;place-items:center;background:radial-gradient(#dfc394,#a47b4d);border:2px solid #7c5839;color:#3c271a;font-size:100px;text-shadow:0 2px #fff5}
.flip-front p{font-size:16px;line-height:1.4;margin:12px 0}.flip-front small{font:700 12px Georgia,serif}
.paper-button{min-height:42px;min-width:165px}
.paper-note{padding:25px;font:16px/1.5 Georgia,serif}.paper-note h2{color:#e7c682}.paper-note code{font-size:13px;color:#f0c97d}
.combat-faces{gap:16px;min-height:78px;padding:4px 2px 10px;perspective:650px}
.combat-die3d{position:relative;width:56px;height:56px;perspective:600px;filter:drop-shadow(0 8px 6px #000a)}
.combat-cube{position:absolute;inset:0;transform-style:preserve-3d;transition:none}
.combat-face{position:absolute;inset:0;border-radius:9px;background:linear-gradient(125deg,#fff9df,#e4c993 65%,#af8c5a);border:2px solid #ffe9ba;display:grid;place-items:center;box-shadow:inset 3px 3px 6px #fffe,inset -5px -5px 8px #725235aa;backface-visibility:hidden;color:#2f1a14}
.combat-face span{font-size:36px;text-shadow:1px 2px 2px #fff5}.combat-face.white span{color:#fefefe;text-shadow:0 1px 3px #2f201a,0 0 2px #241611}.combat-face.black span{color:#17110c}
.combat-face.face1{transform:translateZ(28px)}.combat-face.face2{transform:rotateY(180deg) translateZ(28px)}.combat-face.face3{transform:rotateY(90deg) translateZ(28px)}.combat-face.face4{transform:rotateY(-90deg) translateZ(28px)}.combat-face.face5{transform:rotateX(90deg) translateZ(28px)}.combat-face.face6{transform:rotateX(-90deg) translateZ(28px)}
.combat-row{min-height:115px}.combat-stage{width:min(650px,94%)}
/* Multiplayer lobby + chat share a single room lifecycle. */
.online-lobby{max-width:640px;margin:0 auto}.online-lobby p{color:#c9b495;line-height:1.5}
.online-lobby label{display:flex;flex-direction:column;gap:5px;margin:10px 0;font:700 13px Georgia,serif}
.online-lobby input,.online-lobby select,.chat-entry input{background:#100d0c;border:1px solid #977348;color:#f5ddb6;padding:11px;font:14px Georgia,serif;width:100%;min-width:0}
.online-lobby select{cursor:pointer}.online-lobby button,.lobby-player button{background:linear-gradient(#805023,#3b2111);color:#f9deb0;border:1px solid #bc834a;padding:10px 16px;font:700 12px Georgia,serif;cursor:pointer;margin:4px 2px}
.online-lobby button:disabled{opacity:.4;cursor:not-allowed}.lobby-players{background:#100c0a;border:1px solid #725130;padding:10px;margin:12px 0}
.lobby-player{display:flex;align-items:center;gap:12px;padding:7px;border-bottom:1px solid #5c412a}.lobby-player img{width:44px;height:50px;object-fit:cover}.lobby-player span{display:block;color:#ab9779;font-size:12px}.online-link{display:flex;gap:8px;align-items:center}.online-link input{flex:1;font-size:12px}.online-notice{font-size:12px;color:#d29b69}
.room-label{background:linear-gradient(#34251a,#18110e);font-size:11px;border:1px solid #8b6844;padding:7px 10px;color:#ecc98f;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.journal .chat-tabs{display:flex;gap:6px;margin:-5px 0 4px}.chat-tabs button{font:700 10px Georgia,serif;letter-spacing:1px;flex:1;padding:7px 5px;background:#1d1512;color:#b09b80;border:1px solid #4e3b2b}
.chat-tabs button.active{color:#f5d499;border-color:#c09458;background:#50301d}
.chat-content{flex:1;min-height:0;display:flex;flex-direction:column;gap:6px}
#chatPanel[hidden],#log[hidden],.chat-tabs[hidden]{display:none!important}
.chat-messages{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#88623e #17110e;scrollbar-width:thin;padding:6px 8px;background:#140f0c;border:1px solid var(--edge);font:13px/1.4 Georgia,serif}
.chat-line{margin:0 0 7px;overflow-wrap:anywhere}.chat-line b{color:#eac98c;margin-right:.55em}.chat-line time{color:#776f66;font-size:10px;margin-left:5px}.chat-entry{display:flex;flex:0 0 auto;gap:5px}.chat-entry input{padding:7px;font-size:12px}.chat-entry button{background:#8b502c;border:1px solid #bc8550;color:#fff1d7;padding:7px 11px}
@media(max-width:740px){.map-modal-cols{grid-template-columns:1fr}.search-options{grid-template-columns:1fr}.flip-card{height:350px}.modal-dialog{padding:12px}.combat-die3d{width:45px;height:45px}}
.card-art img{width:100%;height:100%;object-fit:contain;image-rendering:auto}
.combat-face svg{display:block;width:43px;height:43px;filter:drop-shadow(1px 1px 1px #523e24aa)}

.flip-back{padding:12px;gap:6px}
.flip-back img{display:block;min-height:0;max-width:100%;max-height:87%;object-fit:contain}
.flip-back strong{font:700 20px Georgia,serif;color:#f2d393}
.card-art{background:#e8dfcf}

.introart.is-portrait{background-size:contain;background-repeat:no-repeat;background-position:center center;background-color:#1c1512}
.introart.is-portrait .artshade{display:none}
.quest-picker{display:grid;gap:6px;margin-bottom:11px;font:700 10px Georgia,serif;color:#e5c594}
.quest-picker select{max-width:100%;width:100%;color:#edd3aa;background:#231811;border:1px solid #8d663c;padding:8px 7px;font-size:13px}
.mission-details details{border:1px solid #825b3c;padding:8px 10px;margin-bottom:10px;color:#e5c594}
.mission-details details img{width:100%;height:auto;max-height:none;object-fit:contain;margin-top:7px}

/* Room camera and hit feedback */
.worldframe.monster-turn .reticle{display:none}
.worldframe.monster-turn .monster-phase-banner{top:10%;padding:5px 12px;min-width:0;font-size:11px}
.worldframe.monster-turn .monster-phase-banner span{font-size:8px}
.worldframe.monster-turn .combat-stage{top:auto;bottom:9px;width:min(425px,70%);padding:6px 10px;transform:translate(-50%,0);background:#1b130ee8}
.worldframe.monster-turn .combat-stage .combat-title{font-size:11px}
.worldframe.monster-turn .combat-stage .combat-detail{margin:3px 0}
.worldframe.monster-turn .combat-row{display:inline-grid;width:48%;min-height:0;padding:4px}
.worldframe.monster-turn .combat-row strong{margin-bottom:4px;font-size:8px}
.worldframe.monster-turn .combat-faces{min-height:28px;gap:4px;--combat-size:23px}
.worldframe.monster-turn .combat-die3d{scale:.69;margin:-4px}
.worldframe.monster-turn .combat-result{margin-top:4px;font-size:12px;min-height:12px}
#hitVignette,#hitNumbers{position:absolute;inset:0;pointer-events:none}
#hitVignette{z-index:5;opacity:0;background:radial-gradient(ellipse at center,transparent 37%,#8e0c0c99 72%,#b9211bee 100%)}
#hitNumbers{z-index:19}
.hit-number{position:absolute;transform:translate(-50%,-50%);white-space:nowrap;color:#ffd3b9;font:bold clamp(15px,2.05vw,30px) Georgia,serif;text-shadow:0 2px #45120a,0 0 8px #000,0 0 16px #000;-webkit-text-stroke:.45px #49170a}
.hero-condition{margin-top:2px;color:#ff9a7d;font:bold 9px/1.1 Georgia,serif;letter-spacing:.08em}
.hpbar.critical i{background:#e15836}
.party.wounded em,.party.critical em,.party.fallen em{color:#f59981}
.party.critical{border-color:#ad5240}
.party.fallen img{filter:grayscale(.78)}
.party-wound{display:none}
.party.wounded .party-wound,.party.critical .party-wound,.party.fallen .party-wound{display:block;width:7px;height:7px;border-radius:50%;background:#c45641;position:absolute;right:7px;bottom:7px}
.party.critical .party-wound{background:#f97d5c;box-shadow:0 0 8px #ed4a29}

/* Spell selection */
.spellbook{width:min(680px,88vw);color:#ecd7b3}
.spellbook-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:14px}
.spell-list{display:grid;gap:5px;align-content:start}
.spellbook [data-element="earth"]{--spell:#c69a5e;--spell-bg:#543623}
.spellbook [data-element="fire"]{--spell:#ff9a66;--spell-bg:#582621}
.spellbook [data-element="water"]{--spell:#8fced7;--spell-bg:#183e48}
.spellbook [data-element="air"]{--spell:#cccaed;--spell-bg:#39384f}
.spell-list button{display:flex;align-items:center;gap:8px;text-align:left;border:1px solid #63523d;color:#efdcc0;background:#211810;padding:6px 9px;border-radius:2px}
.spell-list button[aria-pressed=true]{border-color:var(--spell);background:var(--spell-bg)}
.spell-list button i{font-style:normal;font-size:20px;color:var(--spell);width:25px;text-align:center}
.spell-list button small{display:block;color:var(--spell);font-size:9px;margin-top:1px}
.spell-detail{border:1px solid var(--spell);padding:14px;background:radial-gradient(ellipse at top,var(--spell-bg),#1b1511 76%)}
.spell-emblem{width:57px;height:57px;display:grid;place-items:center;margin:0 0 9px;border:1px solid var(--spell);color:var(--spell);font-size:31px}
.spell-detail small,.spell-detail label{color:var(--spell);letter-spacing:.1em;font-size:11px}
.spell-detail h3{margin:4px 0 10px;color:#f7e4bd;font-size:20px}
.spell-detail p{font-size:14px;line-height:1.4;min-height:3em}
.spell-detail select{width:100%;margin:5px 0 10px;background:#231a13;color:#f2d9af;border:1px solid #987a50;padding:7px}
.spell-detail button{width:100%}
@media(max-width:570px){.spellbook-layout{grid-template-columns:1fr}.spell-list{grid-template-columns:repeat(2,minmax(0,1fr))}.spell-list button{font-size:12px}}

/* The view model is behind every HUD label, toast and result. */
.worldframe .worldtop,.worldframe .floorbadge,.worldframe .enemylabel{z-index:20}
.worldframe .toast{z-index:24;max-width:calc(100% - 20px);text-align:center}
.worldframe .reticle{z-index:10}
.worldframe .enemylabel{background:#19110cd9;color:#ffe3b2;padding:2px 7px;text-shadow:0 1px 1px #000}
.worldframe .enemylabel:empty{display:none}
#btnMap{display:none}
.quest-picker select{font-size:14px}

@media (max-width:900px), (pointer:coarse) and (max-height:600px){
 html,body{height:auto;overflow:auto}
 #app{display:grid;height:auto;overflow:visible;gap:7px;
  padding:5px max(6px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto}
 .topbar{grid-column:1;grid-row:1;height:auto;min-height:44px;gap:5px;margin:0;flex-wrap:wrap;padding:3px 0}
 .brand h1{font-size:16px;white-space:nowrap}.brand .sigil,.brand small,.chapter-head{display:none}
 .toptools{display:flex;flex:1;flex-wrap:wrap;min-width:0;justify-content:flex-end;gap:4px}
 .toptools .iconbtn,.toptools .room-label{min-width:44px;height:44px;padding:3px}
 #btnMap{display:inline-block}
 .toptools .room-label{background:linear-gradient(#34251a,#18110e);font-size:11px;max-width:98px}
 .layout{display:contents}
 .worldpanel{display:flex;flex-direction:column;grid-row:2;min-width:0;min-height:0;overflow:visible}
 .worldframe{flex:auto;aspect-ratio:auto;height:clamp(220px,41dvh,390px);min-height:0;outline:none}
 .worldbottom{min-height:32px;margin-top:4px;padding:4px 7px;font-size:11px}
 .worldbottom .diamond,.worldbottom .objective small{display:none}
 .worldbottom .objective{font-size:11px;line-height:1.22}
 .controls{grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center;
  margin:0;padding:5px;overflow:visible}
 .controls>.actionprimary{width:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 .controls .action{margin:0;display:grid;grid-template-columns:auto minmax(0,1fr);min-width:0;min-height:44px;
  padding:3px 4px;line-height:1.03;font-size:10px;gap:3px;text-align:left;touch-action:manipulation}
 .controls .action span{white-space:normal;overflow-wrap:anywhere}
 .controls .action .glyph{font-size:14px}.controls .action small{display:none}
 .controls .action.end{grid-column:span 2}
 .move-help{width:auto;margin:0}.move-help>span{display:none}
 .controlpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,46px);gap:3px}
 .controlpad button{min-height:44px;touch-action:manipulation;font-size:23px}
 .partybar{grid-row:4;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
 .partybar .party{padding:3px 5px}.partybar .party img{width:27px;height:33px}
 .sidebar{grid-row:5;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 .sidebar .journal{grid-column:1/-1}.maplegend{font-size:8px;gap:3px}
 .worldframe .toast{bottom:18%;font-size:12px}
 .worldtop{gap:4px}.lozenge{font-size:9px;padding:3px 5px}
 .introart{display:none}.introdialog{display:block;min-height:0;max-width:min(520px,100%);max-height:calc(100dvh - 16px);overflow:auto}
 .introbody{padding:15px}.introbody p{font-size:14px}.introbody h2{font-size:22px}
 .overlay{padding:8px}.overlay button,.quest-picker select,.modal-dialog select,.modal-dialog button{min-height:44px}
 .modal-dialog{max-height:calc(100dvh - 28px)}
 .quest-picker select,.modal-dialog select,.online-lobby input{font-size:16px}
 .online-lobby .online-link{flex-wrap:wrap}.online-lobby .online-link input{min-width:0}
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:550px){
 #app{grid-template-columns:minmax(0,1fr) minmax(182px,27vw)}
 .topbar{grid-column:1/-1}
 .worldpanel{grid-column:1;grid-row:2}
 .worldframe{height:max(170px,calc(100dvh - 106px))}
 .controls{grid-column:2;grid-row:2;grid-template-columns:minmax(0,1fr);align-content:start}
 .move-help{justify-content:center}
 .partybar{grid-column:1/-1;grid-row:3;grid-template-columns:repeat(4,minmax(0,1fr))}
 .sidebar{grid-column:1/-1;grid-row:4}
}

.spectator-banner[hidden],.introbody [hidden]{display:none}
.spectating .reticle{display:none}
.spectator-banner{position:absolute;z-index:20;top:10%;left:50%;transform:translateX(-50%);padding:7px 11px;max-width:calc(100% - 24px);text-align:center;white-space:nowrap;background:#20150eea;border:1px solid #98734e;font:700 11px/1.25 Georgia,serif;letter-spacing:.10em;color:#ffe5b5;pointer-events:none}
.map-heroes{display:flex;gap:5px 10px;flex-wrap:wrap;margin:7px 2px}
.map-heroes span{display:flex;align-items:center;gap:5px;color:#f3dcb6;font-size:12px}
.map-heroes b{display:grid;place-items:center;width:19px;height:19px;border-radius:50%;font:700 12px system-ui;color:#1b140e}
.map-heroes small{color:#c8a778}
.mission-briefing .introart{background-size:contain;background-repeat:no-repeat;background-color:#100c0a}
.mission-briefing .introart::after{opacity:.26}
.equipment-menu{max-width:500px;margin:0 auto}
.shield-offer{display:grid;grid-template-columns:82px minmax(0,1fr);gap:14px;align-items:center;padding:12px;border:1px solid #745438;background:#1b130f}
.shield-offer img{width:82px;max-height:90px;object-fit:contain}
.shield-offer h3{margin:0}
.shield-offer button:disabled{opacity:.45}
@media(max-width:900px),(pointer:coarse) and (max-height:600px){
 .mission-briefing .introart{display:block;min-height:0;height:min(28dvh,225px);border:none;border-bottom:1px solid #795b3e}
  .spectator-banner{top:17%;font-size:9px;letter-spacing:.06em}
}
.dialogbuttons{display:flex;flex-wrap:wrap;gap:8px}
#btnOnlineStart{border:1px solid #9e7954;background:#2b1e15;color:#f4d6a5;padding:10px 14px;font:700 11px Georgia,serif;letter-spacing:.06em;cursor:pointer}
#btnOnlineStart[hidden]{display:none}

.maplegend .map-open-icon{display:inline-block;width:11px;height:7px;vertical-align:middle;margin-right:3px;border-left:4px solid #c2ff91;border-right:4px solid #c2ff91}

/* Chat keeps its own space in the desktop cockpit and opens from the toolbar. */
.room-label[hidden],#weaponOverlay[hidden]{display:none!important}
.room-label:hover{border-color:var(--gold);background:#412b1b}
.room-label.is-offline{color:#f0b17d}
.online-journal h3{display:none}
.online-journal .chat-tabs{margin:0 0 7px}
.chat-empty{color:#bda887;margin:2px 0}
#chatDialog{height:min(440px,62dvh);min-height:155px}
#chatDialog .chat-entry input{font-size:16px}
#chatDialog .chat-entry button{min-width:48px}
.chat-entry button:hover{background:#a06438}
.dialog-error{color:#ffb599;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.dialog-error:empty,.invite-feedback:empty{display:none}
.online-lobby .invite-feedback{margin:6px 0 0;font-size:13px;color:#ddc397}
.online-lobby button.is-copied{border-color:#8f9a5b;background:linear-gradient(#454a29,#292d1b);color:#e7e8bf}
.modal-dialog{color-scheme:dark;scrollbar-color:#88623e #17110e}
.modal-dialog:focus{outline:none}
.modal-dialog :is(button,input,select,summary,[tabindex]):focus-visible,.room-label:focus-visible,.chat-content :focus-visible{outline:2px solid var(--goldbright);outline-offset:2px}
.modal-heading .modal-x{flex:0 0 38px;padding:0;margin:0;font:24px/1 Georgia,serif}
.modal-x:hover{background:#563820}
.modal-dialog .dialog-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-top:18px}
.dialog-actions button{background:linear-gradient(#3a2c20,#1d1511);border:1px solid #906941;color:#f5d8ab;padding:10px 13px;font:bold 12px Georgia,serif}
.modal-dialog .danger-button{background:linear-gradient(#673424,#351a15);border-color:#af7751;color:#ffdbb4}
.modal-dialog .danger-button:hover,.dialog-actions button:hover{filter:brightness(1.24)}
@media(min-width:901px){
 .sidebar.with-chat{grid-template-rows:minmax(65px,1fr) auto minmax(170px,.8fr)}
}
@media(min-width:901px) and (max-height:620px){
 .sidebar.with-chat{overflow-y:auto;grid-template-rows:minmax(78px,1fr) auto 158px}
}
@media(max-width:900px),(pointer:coarse) and (max-height:600px){
 .sidebar.with-chat{grid-template-rows:auto}
 #chatPanel{height:190px}
 #chatDialog .chat-entry button{min-height:44px}
}
@media(max-width:540px){
 .online-lobby .online-link input{flex-basis:100%;font-size:16px}
}

/* Shared controls for desktop and touch. */
:root{--control:#211916;--control-edge:#73563b;--control-hot:#efc184}
.topbar .brand img{display:block;object-fit:contain;mix-blend-mode:screen}
.topbar .brand img{width:146px;height:49px;object-position:center 40%}
.topbar .brand h1{margin:0}
.toptools{align-items:center;flex-wrap:nowrap}
#btnMap{display:grid}
.iconbtn,.controlpad button,.action,.room-label{color:#ead7b9;border:1px solid var(--control-edge);background:linear-gradient(155deg,#33261d,var(--control) 64%);border-radius:7px}
.iconbtn,.controlpad button{display:grid;place-items:center;padding:0}
.iconbtn{width:43px;height:43px}
.iconbtn svg,.controlpad svg,.room-label svg{display:block;width:20px;height:20px}
.action svg{display:block;width:20px;height:20px}
.iconbtn:focus-visible,.action:focus-visible,.controlpad button:focus-visible{outline:2px solid #ffd394;outline-offset:2px}
.iconbtn:hover,.controlpad button:hover,.action:hover{border-color:var(--control-hot);color:#fff0ce}
.action b{font-weight:inherit}
.action.end{color:#ffddb1;border-color:#ab7e52;background:linear-gradient(145deg,#4d3222,#261911)}
.action:disabled{opacity:.48}
.action .glyph{display:grid;place-items:center}
#weaponOverlay{inset:0;width:100%;height:100%;max-width:none;transform:none}
html[data-resolution=sharp] #glview{image-rendering:auto}
#closeIntro,.floating-close{position:absolute;top:12px;right:12px;z-index:4}
#reopenIntro{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:55}
#reopenIntro[hidden],.custom-modal button[hidden]{display:none}
.introbody{padding-right:56px}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.settings-grid section{min-width:0;background:#1c1511;border:1px solid #6b4b34;padding:12px}
.settings-grid h3,.shop-list h3{font-size:16px;color:#edcda0;margin:0 0 8px}
.settings-grid .settings-wide{grid-column:1/-1}
.settings-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:8px}
.settings-wide .settings-buttons{grid-template-columns:repeat(3,minmax(0,1fr))}
.settings-buttons button{min-width:0;margin:0;white-space:normal;overflow-wrap:normal}
.settings-buttons button,.shop-list button,.inventory-list button{
 background:#3b281d;border:1px solid #a17852;color:#ffe1b1;border-radius:5px;
 min-height:42px;padding:8px 12px;font:700 13px Georgia,serif;
}
.settings-grid select{width:100%;padding:10px;color:#ffe1b1;background:#120f0e;border:1px solid #8e6544;margin:6px 0}
.setting-check,.online-lobby label.setting-check{display:flex;flex-direction:row;align-items:center;gap:8px;min-height:42px}
.setting-check input,.online-lobby .setting-check input{width:18px;height:18px;accent-color:#dbac72}
#backupStatus:empty{display:none}
#backupStatus{margin:9px 0 0}
.shop-list article,.inventory-list>div{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#1c1511;border:1px solid #6b4b34;margin-bottom:7px;padding:10px}
.shop-list p{margin:3px 0;color:#dccbb3}.shop-list small,.inventory-list small{color:#bca78b}
.shop-list button{flex:0 0 auto}
.party{border-top:2px solid var(--player-color,#c2a774)}
.network .party.active{outline:1px solid var(--player-color)}
#town-prompt{display:none;position:absolute;z-index:20;left:50%;bottom:14%;transform:translateX(-50%);padding:9px 13px;background:#1d140ee8;border:1px solid #b48557;color:#fff0cf;white-space:nowrap;font:700 13px Georgia,serif}
.in-town #town-prompt:not(:empty){display:block}
.in-town #btnRoll,.in-town #btnAttack,.in-town #btnSearch,.in-town #btnRanged,.in-town #btnMagic,.in-town.network #btnEnd{display:none}
.in-town .maplegend,.in-town .floorbadge,.in-town .reticle{display:none}
.in-town .screenfx{opacity:.45}
@media(max-width:900px),(pointer:coarse) and (max-height:600px){
 .topbar{display:flex;flex-wrap:nowrap;justify-content:space-between;min-height:48px;gap:6px}
 .topbar .brand{flex:0 1 auto;min-width:0}
 .topbar .brand img{width:clamp(90px,28vw,137px);height:48px}
 .toptools{flex:0 0 auto;gap:4px}
 .toptools .iconbtn,.toptools .room-label{width:44px;min-width:44px;height:44px;max-width:none;padding:0;place-items:center}
 .toptools #onlineRoomBadge{display:none}
 .worldframe{height:clamp(238px,43dvh,390px)}
 .worldbottom{padding:6px 9px}
 .controls{grid-template-columns:minmax(0,1fr) 142px;gap:8px;padding:7px;align-items:start}
 .controls>.actionprimary{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 .controls .action{min-height:52px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;text-align:center;font:700 11px/1.1 Georgia,serif;letter-spacing:0}
 .controls .action span{overflow-wrap:normal;word-break:normal;white-space:nowrap}
 .controls .action.end{grid-column:1/-1;min-height:45px;flex-direction:row}
 .controlpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,52px);gap:4px}
 .move-help{align-self:center}
 .move-help>span{display:none}
 .floorbadge{display:none}
 .section{padding:9px}
 .introbody{padding-right:53px}
}
@media(max-width:420px){
 .topbar .brand img{width:clamp(90px,29vw,120px)}
 .controls{grid-template-columns:minmax(0,1fr) 134px;gap:5px}
 .controlpad{grid-template-columns:repeat(3,42px);gap:4px}
 .settings-grid{grid-template-columns:1fr}
 .settings-grid section{padding:10px}
 .shop-list article{gap:8px}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:550px){
 .worldframe{height:max(170px,calc(100dvh - 108px))}
 .controls{grid-template-columns:minmax(0,1fr)}
 .controls>.actionprimary{grid-template-columns:repeat(3,minmax(0,1fr))}
 .controls .action{min-height:44px}
 .move-help{justify-self:center}
}
.topbar .brand img{object-fit:cover;aspect-ratio:2.9}
@media(min-width:365px) and (max-width:900px){
 .controls>.actionprimary{grid-template-columns:repeat(3,minmax(0,1fr))}
 .controls .action{font-size:clamp(10px,2.7vw,12px)}
}
@media(max-width:365px){
 .topbar .brand img{width:clamp(82px,27vw,100px)}
}

.inventory-hero{display:flex;align-items:center;gap:12px;margin:6px 0 14px}
.inventory-hero img{width:45px;height:45px;object-fit:cover;border:1px solid #a57f53}
.inventory-hero strong,.inventory-hero span{display:block}
.inventory-hero span,.inventory-empty{color:#c5b093;font-size:.88rem}
.inventory-tabs{display:grid;grid-template-columns:1.35fr .65fr 1.2fr;gap:6px;margin-bottom:12px}
.inventory-tabs button,.inventory-tile{color:#e6cda8;background:#211713;border:1px solid #6d4f38;border-radius:5px;min-height:44px;padding:7px}
.inventory-tabs button[aria-pressed=true]{color:#fff0d0;background:#59402a;border-color:#c9955b}
.inventory-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.inventory-tile{display:flex;text-align:left;align-items:center;gap:9px;min-height:71px}
.inventory-tile:hover{border-color:#ddad73}
.inventory-tile img,.inventory-symbol{width:46px;height:50px;object-fit:cover;flex:0 0 auto}
.inventory-symbol{display:grid;place-items:center;color:#d7a362;background:#30231a;border:1px solid #654730}
.inventory-symbol svg{width:25px;height:25px}
.inventory-tile strong,.inventory-tile small{display:block}
.inventory-tile small{margin-top:4px;color:#c8ac8b}
.inventory-card-detail{display:flex;align-items:center;gap:18px;padding:15px;background:linear-gradient(145deg,#302019,#1b1410);border:1px solid #926a47}
.inventory-card-detail img{width:clamp(78px,26vw,155px);max-height:180px;object-fit:contain}
.inventory-card-detail p{margin:0 0 9px;line-height:1.55}
.inventory-card-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px}
.inventory-card-actions select{max-width:100%;background:#211713;border:1px solid #6d4f38;color:#ffe3bb;padding:7px}
.brawl-meters{display:grid;grid-template-columns:1fr 1fr;gap:8px}
@media(max-width:405px){.inventory-tabs button{font-size:12px}.inventory-cards{grid-template-columns:1fr}}
.in-town .worldtop>.lozenge:first-child{visibility:hidden}
.inventory-tabs button:focus-visible,.inventory-tile:focus-visible{outline:2px solid #ffd394;outline-offset:2px}
@media(max-width:440px){.inventory-card-actions .paper-button{min-width:0}}
.card-detail-symbol{display:grid;place-items:center;flex:0 0 70px;height:80px;border:1px solid #9b744c;background:#231910;color:#d4aa72}
.card-detail-symbol svg{width:34px;height:34px}
.magic-card-detail .card-detail-symbol{border-color:#8b7398;background:#2e203b;color:#e6caf6}

.topbar .brand img{
 width:clamp(155px,21vw,248px);height:51px;object-fit:contain;object-position:center;
 aspect-ratio:auto;mix-blend-mode:normal;
}
@media(max-width:900px),(pointer:coarse) and (max-height:600px){
 .topbar .brand img{width:clamp(90px,32vw,180px);height:44px}
}

/* Keep the actions in view while the briefing and selection share one scroll area. */
.overlay{background:#090605a8;backdrop-filter:blur(3px);padding:clamp(8px,2vh,20px)}
.introdialog{
 display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;
 max-width:min(1000px,calc(100vw - 32px));min-height:0;max-height:calc(100dvh - 32px);
 overflow:hidden;color-scheme:dark;
}
.introart{min-height:0;height:auto}
.introbody{padding:16px 22px;min-height:0;overflow:auto;justify-content:flex-start;scrollbar-width:thin}
.introbody h2{font-size:clamp(21px,3vw,29px);margin:8px 0}
.introbody p{font-size:15px;line-height:1.33}
#intro-story{min-height:0;max-height:20dvh;overflow:auto;scrollbar-width:thin}
.introbody:has(.intro-objective:not([hidden]))>.kicker,
.introbody:has(.intro-objective:not([hidden]))>h2{padding-inline-end:44px;overflow-wrap:anywhere}
.introbody:has(.intro-objective:not([hidden]))>#intro-story{max-height:none;overflow:visible;flex:none}
.intro-objective{
 display:grid;grid-template-columns:max-content minmax(0,1fr);gap:3px 10px;
 margin:4px 0 12px;padding:8px 0;border-block:1px solid #654e37;color:#ffe3b2;
 font-size:clamp(13px,1.2vw,15px);line-height:1.3;
}
.intro-objective dt{font-weight:bold;color:#d4ab72}
.intro-objective dd{margin:0}
.intro-note{margin-top:9px;padding-top:7px;font-size:12px;line-height:1.3}
.partysetup{margin:9px 0 0;padding:8px}
.partysetup .quest-picker{gap:4px;margin-bottom:6px}
.quest-picker select{padding:5px 7px;min-height:36px}
.herochoices{gap:5px;margin:5px 0}
.herochoices img{height:clamp(39px,8dvh,67px)}
.dialogbuttons{margin:0;padding:9px 22px 14px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;background:#211713}
.dialogbuttons [hidden]{display:none}
.dialogbuttons button{min-height:36px;padding:6px 8px;font-size:12px;letter-spacing:0}
.dialogbuttons #btnContinue{grid-column:1/-1}
.introart{grid-row:1/3}
.modal-scrim{background:#05040481;backdrop-filter:blur(2px)}
.modal-dialog{overscroll-behavior:contain;scrollbar-width:thin}
.modal-dialog .modal-heading{position:sticky;top:-1px;z-index:2;background:#211710}
.modal-dialog.town-shop{max-width:min(720px,calc(100vw - 26px));padding:13px 15px}
.town-shop .modal-heading{margin-bottom:8px}
.town-shop .shop-list article{margin-bottom:5px;padding:6px 9px}
.town-shop .shop-list h3{margin:0 0 2px;font-size:14px}
.town-shop .shop-list p{font-size:13px;line-height:1.2;margin:0}
.town-shop .shop-list button{min-height:40px}
.town-map .full-map-wrap canvas{width:100%;max-height:65dvh;object-fit:contain}
.town-departure{position:fixed;inset:0;z-index:90;display:grid;place-items:center;background:#0a0807ed;padding:12px}
.town-departure[hidden]{display:none}
.town-departure figure{position:relative;margin:0;line-height:0;border:1px solid #ae8555;box-shadow:0 12px 52px #000b;background:#120d0a}
.town-departure img{display:block;width:min(1100px,calc(100vw - 26px));max-height:calc(100dvh - 26px);object-fit:contain}
.town-departure figcaption{position:absolute;inset:auto 0 0;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:15px;background:linear-gradient(0deg,#100a08f5,#100a0812);color:#fff1d0}
.town-departure h2{font-size:clamp(17px,3vw,28px);line-height:1.15;margin:0}
@media(max-width:700px){
 .introdialog{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr) auto;max-width:min(480px,calc(100vw - 16px));max-height:calc(100dvh - 16px)}
 .introart{display:block;grid-row:auto;height:clamp(52px,15dvh,125px);background-size:cover;background-position:center 38%;border:0}
 .introbody{padding:9px 13px 4px}
 .introbody:has(.partysetup:not([hidden]))>#intro-story{order:1;margin-top:12px}
 .dialogbuttons{padding:7px 12px 10px}
 .dialogbuttons button{min-height:44px}
}
@media(max-height:680px){
 .introbody{padding-top:9px;padding-bottom:6px}
 .introbody h2{font-size:21px;margin:4px 0}
 .introbody p{font-size:14px}
 .dialogbuttons button{min-height:38px}
}
@media(max-height:460px) and (max-width:700px){.introart{display:none}}
body:has(.overlay.show,.custom-modal.show,.town-departure:not([hidden])){overflow:hidden}
.introbody>*:not(#intro-story){flex-shrink:0}
#intro-story{flex:0 1 auto}
#btnOnlineStart:nth-last-child(2){grid-column:1/-1}
html:has(.overlay.show,.custom-modal.show,.town-departure:not([hidden])){overflow:hidden}

@media(max-width:700px){
 .settings-grid{grid-template-columns:minmax(0,1fr);gap:8px}
 .settings-grid section{padding:10px}
 .settings-wide .settings-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}
 .settings-buttons button{min-height:44px;padding-inline:7px}
 .modal-dialog .dialog-actions,.modal-dialog .inventory-card-actions{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:6px
 }
 .modal-dialog .dialog-actions>button,.modal-dialog .inventory-card-actions>button{
  min-width:0;min-height:44px;margin:0;white-space:normal
 }
 .modal-dialog .dialog-actions>button:only-child,.modal-dialog .inventory-card-actions>button:only-child{grid-column:1/-1}
 .introart{height:clamp(52px,12dvh,105px)}
 .dialogbuttons{grid-auto-rows:1fr}
}
@media(max-width:700px) and (orientation:portrait){
 .topbar{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;padding:3px 0 5px}
 .topbar .brand,.topbar .brand h1{width:100%}
 .topbar .brand img{width:min(96%,500px);height:auto;margin:0 auto}
 .toptools{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:5px}
 .toptools .iconbtn,.toptools .room-label{width:100%;min-width:0;max-width:none}
 .controls{--button-gap:5px;--button-row:47px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--button-gap);align-items:start}
 .controls>.actionprimary,.controlpad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:var(--button-row);grid-template-rows:none;gap:var(--button-gap)}
 .controls .action,.controlpad button{min-width:0;min-height:0;height:100%;padding:2px;margin:0}
 .controls .action{font-size:clamp(10px,2.65vw,13px)}
 .controls .action.end{min-height:0}
 .move-help{display:block;align-self:start;justify-self:stretch;width:100%;margin:0}
 .in-town .controls>.actionprimary{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:355px) and (orientation:portrait){
 .controls{grid-template-columns:minmax(0,1fr)}
 .in-town .controls{grid-template-columns:repeat(2,minmax(0,1fr))}
}

.shop-cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr))}
.shop-card{width:min(325px,100%);margin:0 auto;padding:9px 13px 13px;text-align:center;color:#302016;border:3px double #4f3826;border-radius:7px;background:#ede3d0;box-shadow:0 8px 24px #090604aa}
.shop-card h3{margin:2px 0 7px;font-size:clamp(19px,3.5vw,25px);line-height:1.15}
.shop-card .card-art{height:clamp(70px,24dvh,216px);grid-template-rows:minmax(0,1fr);background:#ede3d0;border:1px solid #816c55}
.shop-card p{margin:8px 0;font-size:14px;line-height:1.3}
.shop-card small{display:block;margin-bottom:6px}
.lodging-shares{padding:0;margin:7px 0;list-style:none;font-size:13px;line-height:1.5}
.tavern-directions{font-size:14px;color:#d2b79a}

.modal-dialog.gamble-dialog{max-width:min(690px,calc(100vw - 28px))}
.gamble-dialog p{line-height:1.35}
.gamble-balance{margin:0 0 12px;color:#f1d4a1}
.gamble-status{margin:10px 0;color:#ffe6b4;font-weight:700}
.gamble-status:empty{display:none}
.gamble-score{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.gamble-side{padding:8px 9px;background:#15100c;border:1px solid #6b4c34}
.gamble-side-heading{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px;align-items:center}
.gamble-side-heading h3{font-size:16px;margin:0}
.gamble-side-heading b{color:#e7c48c;font-size:13px}
.gamble-rival{display:grid;grid-template-columns:54px minmax(0,1fr);column-gap:3px;align-items:center;border-color:#715484}
.gamble-rival .gamble-side-heading{grid-column:1/-1}
.gamble-rival .resident-portrait{width:54px;height:64px}
.gamble-rival .die-face{background:linear-gradient(132deg,#c6a0e7,#7e4ca6);border-color:#d9b2f1;box-shadow:inset -5px -6px 11px #341d4885,inset 3px 3px 7px #f8e3ff9c,0 1px 9px #0009}
.gamble-rival .die-face i.pip{background:#271238;box-shadow:inset 1px 2px 3px #15091e,0 1px 0 #fff6}
.gamble-dice{display:flex;justify-content:center;gap:5px;margin:8px 0 0;perspective:650px}
.gamble-die-slot{display:flex;flex-direction:column;align-items:center;justify-content:center;width:82px;min-height:79px;padding:3px 0;box-sizing:border-box;background:transparent;border:1px solid transparent}
button.gamble-die-slot{gap:4px;border-color:#89623e;color:#e0bd8a;cursor:pointer}
.gamble-die-slot .die{flex:none;scale:.70;margin:-7px -10px}
.gamble-rival .gamble-die-slot{min-width:0}
.gamble-rival .gamble-die-slot .die{scale:.63}
.gamble-die-slot span{font:700 12px Georgia,serif}
button.gamble-die-slot[aria-pressed=true]{background:#513620;color:#fff1d4;border-color:#f0c587}
button.gamble-die-slot[aria-pressed=true] span::before{content:'✓ '}
button.gamble-die-slot:focus-visible,.gamble-rules summary:focus-visible{outline:2px solid #efbd79;outline-offset:2px}
.gamble-rules{border-block:1px solid #65462e;margin:12px 0;padding:8px 0;color:#e8d2ad}
.gamble-rules summary{cursor:pointer;width:max-content;font-weight:700}
.gamble-rules ol{padding-left:23px;line-height:1.4}
.gamble-rules li{margin:4px 0}
.gamble-rules p{margin-bottom:0}
@media(max-width:600px){
 .gamble-score{grid-template-columns:1fr;gap:6px}
 .gamble-die-slot{width:67px;min-height:60px}
 .gamble-die-slot .die{scale:.59;margin:-12px -11px}
 .gamble-rival .gamble-die-slot .die{scale:.59}
}
.reconnect-room{display:inline-block;text-decoration:none;margin-bottom:10px}

/* Dialog branding, counters and hero sheets. */
.dialogbuttons:has(#btnTownStart[hidden]) #btnIntroSettings{grid-column:1/-1}
.count-bubble{display:inline-grid;place-items:center;min-width:1.5em;height:1.5em;padding:0 .28em;border-radius:999px;background:#dfb67d;color:#20140e;font:700 12px/1 system-ui,sans-serif}
.count-bubble[hidden]{display:none}
#openOnlineChat{position:relative;overflow:visible}
#openOnlineChat .count-bubble{position:absolute;top:-5px;right:-5px;box-shadow:0 0 0 2px #1c130e;pointer-events:none}
.inventory-tabs button{display:flex;align-items:center;justify-content:center;gap:5px;line-height:1.14}
.shop-owned{color:#dfbd87;display:block;margin-top:3px}
.hero-portrait-button{padding:0;background:none;border:0;display:block;flex:none;line-height:0}
.hero-portrait-button:hover img,.hero-portrait-button:focus-visible img{border-color:#eac38a;filter:brightness(1.18)}
.hero-portrait-button:focus-visible{outline:2px solid #ffd394;outline-offset:2px}
#introHeroCard{position:absolute;z-index:2;inset:0;width:100%}
#introHeroCard[hidden]{display:none}
.herochoices .hero-portrait-button{width:100%}
.hero-choice input{z-index:1;margin:0}
.hero-sheet{
 --hero-accent:#d4a66c;
 width:min(720px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;overflow:auto;
 color:#f4dfbc;background:#1e1713;border:1px solid var(--hero-accent);box-shadow:0 16px 60px #000e;
}
.hero-sheet[data-role="1"]{--hero-accent:#d9986d}
.hero-sheet[data-role="2"]{--hero-accent:#acc68b}
.hero-sheet[data-role="3"]{--hero-accent:#b0c5e6}
.hero-sheet::backdrop{background:#0b0805d2;backdrop-filter:blur(3px)}
.hero-sheet .modal-x{position:absolute;right:10px;top:10px;z-index:1;border-radius:0}
.hero-sheet-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);min-height:370px}
.hero-sheet-art{position:relative;isolation:isolate;background:#261c16;min-width:0}
.hero-sheet-art img{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:cover;object-position:center 32%;z-index:-2}
.hero-sheet-art::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,#1a100c00 35%,#160e0b53 60%,#120c0a 100%)}
.hero-sheet-identity{position:absolute;inset:auto 16px 17px;border-bottom:1px solid var(--hero-accent);padding:0 4px 10px}
.hero-sheet-identity small{font-size:.72rem;font-weight:bold;letter-spacing:.20em;color:var(--hero-accent)}
.hero-sheet h2{margin:2px 0 0;font-size:clamp(32px,6vw,58px);line-height:.98;color:#fff0d6;text-shadow:0 3px 8px #100906}
.hero-sheet-player{margin:7px 0 0;color:#e8d4bb}
.hero-sheet-body{min-width:0;padding:23px 17px 16px;border:1px solid #ffffff13;background:radial-gradient(ellipse at 0 0,#352820,#1f1712 75%)}
.hero-sheet-body h3{margin:0;padding-right:42px;font-size:.82rem;letter-spacing:.15em;text-transform:uppercase;color:var(--hero-accent)}
.hero-sheet dl{margin:11px 0 14px;display:grid;grid-template-columns:1fr 1fr;gap:6px}
.hero-sheet dl div{min-width:0;padding:7px 9px 6px;border:1px solid #705236;background:#100a073d}
.hero-sheet dt{font-size:.83rem;color:#d8bea2}
.hero-sheet dd{margin:2px 0 0;font-size:clamp(17px,3vw,24px);line-height:1;font-weight:bold;font-variant-numeric:tabular-nums}
.hero-sheet-loadout{border-top:1px solid #705236;padding-top:9px}
.hero-sheet-loadout p,.hero-sheet-status{margin:4px 0 0;line-height:1.3}
.hero-sheet-status{color:var(--hero-accent);font-size:.88rem}
@media(max-width:520px){
 .hero-sheet-layout{grid-template-columns:1fr;min-height:0}
 .hero-sheet-art{height:clamp(135px,34dvh,250px)}
 .hero-sheet-art img{object-position:center 31%}
 .hero-sheet-identity{inset:auto 13px 9px;padding-bottom:7px}
 .hero-sheet-body{padding:10px 13px}
 .hero-sheet dl{margin:7px 0 9px}
 .hero-sheet dl div{padding:5px 8px}
}
@media(max-height:480px) and (orientation:landscape){.hero-sheet-layout{min-height:0}}
@media(max-width:460px){.inventory-tabs button{gap:3px;padding-inline:4px}}
.hero-choice label{cursor:pointer}
.dialogbuttons{grid-auto-rows:1fr}
.introdialog:has(.introart.is-portrait) #btnIntroSettings{grid-column:1/-1;border-width:1px}

/* Longer campaign texts stay within the existing briefing and tour dialogs. */
#intro-story,.mission-details p{white-space:pre-line}
.town-story-link:empty{display:none}
.town-story-link{margin-bottom:9px}
.town-story-link .paper-button{min-height:40px}
.town-story-dialog{max-width:min(700px,calc(100vw - 24px))}
.town-accounts{display:grid;gap:7px}
.town-accounts details{background:#201711;border:1px solid #65482f}
.town-accounts summary{padding:11px 12px;color:#efcd96;cursor:pointer;font-weight:bold}
.town-accounts details[open] summary{border-bottom:1px solid #65482f}
.town-accounts details>div{padding:0 13px}
.town-accounts p{max-width:64ch;font-size:clamp(15px,2vw,17px);line-height:1.55;color:#e2d0b5}

.lobby-brand img{display:block;width:min(320px,62vw);height:auto}
.controlpad [data-key]{touch-action:none;user-select:none;-webkit-touch-callout:none}
.inventory-action-hint{color:#d7bd98;margin:8px 0 0}

.modal-dialog.brawl-dialog{max-width:min(620px,calc(100vw - 24px))}
.brawl-round{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 8px;color:#efcc9d}
.brawl-round strong{font-size:.75rem;letter-spacing:.15em}
.brawl-scoreboard{min-width:0;background:#281b15;border:1px solid #79593b;padding:7px 9px}
.brawl-scoreboard span{display:flex;gap:5px;justify-content:space-between;align-items:center}
.brawl-scoreboard span strong{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.brawl-scoreboard span b{white-space:nowrap}
.brawl-scoreboard meter{width:100%;height:8px;display:block;margin:4px 0 5px;accent-color:#ce864e}
.brawl-role{display:inline-block;padding:3px 6px;border:1px solid;font:700 .65rem/1.1 system-ui,sans-serif;letter-spacing:.08em}
.brawl-role.is-attacker{color:#ffdb94;border-color:#a36631;background:#542b17}
.brawl-role.is-defender{color:#c9e7eb;border-color:#537d80;background:#20383a}
.brawl-ring{height:clamp(140px,37dvh,242px);position:relative;overflow:hidden;isolation:isolate;display:flex;justify-content:center;align-items:end;gap:0;padding:0 4% 5px;margin-top:8px;background:#302017;border:1px solid #8b653e}
.brawl-ring::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at 50% 57%,#c4863f36,#21150cd6),url('../assets/town/schenke-faustkampf.jpg?v=0.43') center 66%/cover;z-index:-1;filter:var(--art-pixel-filter,none)}
.brawl-fighter{width:40%;height:99%;position:relative;transform-origin:bottom center;display:flex;align-items:end;justify-content:center}
.brawl-fighter img{display:block;width:100%;height:100%;object-position:center bottom;object-fit:contain;--art-shadow:drop-shadow(0 5px 5px #160a04)}
.brawl-rival img{transform:scaleX(-1)}
.brawl-fighter .brawl-punch{position:absolute;inset:0;visibility:hidden}
.brawl-fighter.is-punching img{visibility:hidden}
.brawl-fighter.is-punching .brawl-punch{visibility:visible}
.brawl-impact{position:absolute;top:13%;left:0;right:0;text-align:center;opacity:0;color:#ffe4aa;font-weight:bold;letter-spacing:.12em;text-shadow:0 2px 4px #120805,0 0 12px #542b17;font-size:clamp(17px,4vw,25px);pointer-events:none}
.brawl-status{min-height:1.4em;margin:9px 0;color:#edd3a9}
.brawl-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.brawl-actions button{padding:8px 6px}
.brawl-actions button:only-child{grid-column:1/-1}
.brawl-actions button small{display:block;margin-top:4px;font-weight:normal;color:#ead0a7}

.resident-conversation{display:grid;grid-template-columns:minmax(125px,.72fr) minmax(0,1.28fr);gap:14px;align-items:start}
.resident-portrait{isolation:isolate;overflow:hidden;position:relative;aspect-ratio:1;background:#271c16;border:1px solid #926745}
.resident-conversation>.resident-portrait{position:sticky;top:58px}
.resident-portrait>img{display:block;width:100%;height:100%;object-fit:cover}
.resident-heading{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:center}
.resident-heading .resident-portrait{width:clamp(42px,12vw,62px)}
@media(max-width:560px){.resident-conversation{grid-template-columns:1fr;gap:9px}.resident-conversation>.resident-portrait{position:relative;top:auto;width:min(40vw,135px);margin-inline:auto}}
.shop-card{color:#ead5ad;border:1px solid #936841;border-radius:0;background:radial-gradient(ellipse at top,#30231a,#19110d);box-shadow:inset 0 0 0 3px #a876482a,0 8px 24px #090604aa}
.shop-card .card-art{background:#221710;border-color:#694b38}
.shop-card .card-art img{border:0;mix-blend-mode:normal}
/* Use the same screen-space grid for rendered art and the WebGL scene.
   Interface text, icons, logos and reference maps are outside this effect. */
.art-filters{position:absolute;pointer-events:none}
html[data-resolution=classic]{--art-pixel-filter:url(#art-pixels-classic)}
html[data-resolution=retro]{--art-pixel-filter:url(#art-pixels-retro)}
.intro-art-image{position:absolute;inset:0;background-image:var(--scene-art);background-size:inherit;background-repeat:inherit;background-position:inherit;pointer-events:none}
:is(.intro-art-image,.hero-portrait-button img,.hero-sheet-art img,.card-art img,.inventory-card-detail>img,.inventory-tile img,.town-departure img,.resident-portrait>img,.mission-details>img,.shield-offer img,.brawl-fighter img,#weaponOverlay img){
 filter:var(--art-pixel-filter,opacity(1)) var(--art-shadow,opacity(1));
}
.hero-portrait-button:is(:hover,:focus-visible) img{filter:var(--art-pixel-filter,opacity(1)) brightness(1.18)}
.party.fallen img{filter:var(--art-pixel-filter,opacity(1)) grayscale(.78)}
#weaponOverlay img{--art-shadow:drop-shadow(0 3px 5px #0008)}
.inventory-card-detail>img{aspect-ratio:1;border:1px solid #805e3d}
.inventory-tile img{border:1px solid #78583e}

.brawl-advantage{color:#d3b58a;margin:0 0 8px;font-size:.9rem}
.brawl-fighter.fallen-fighter{transform-origin:center 75%;transform:rotate(-90deg)}
.brawl-rival.fallen-fighter{transform:rotate(90deg)}
@media(prefers-reduced-motion:no-preference){.brawl-fighter.fallen-fighter{animation:brawl-collapse .36s ease-in both}}
@keyframes brawl-collapse{from{transform:translateY(0) rotate(0)}}
.objective .diamond svg,.stats b svg{width:1em;height:1em;display:inline-block;vertical-align:-.11em}
.stats b svg{margin-left:.28em;color:#d6af78}
.spell-list i svg{display:block;width:1.25em;height:1.25em}
.spell-emblem svg{width:31px;height:31px}

.quest-notice[hidden], #questStoryHistory[hidden] { display: none; }
.quest-notice {
 position: fixed;
 z-index: 95;
 bottom: clamp(68px, 10vh, 100px);
 right: clamp(10px, 2vw, 28px);
 width: min(400px, calc(100vw - 20px));
 max-height: 50vh;
 overflow: auto;
 padding: 12px 49px 12px 14px;
 background: linear-gradient(145deg, #30231a, #17110e 75%);
 color: var(--paper);
 border: 1px solid #a67847;
 box-shadow: 0 8px 28px #000b;
}
.quest-notice.story-notice { border-color: #d6aa63; }
.quest-notice small, .quest-notice strong { display: block; }
.quest-notice small { font: 700 .7rem Cinzel, Georgia, serif; letter-spacing: .08em; color: var(--gold); }
.quest-notice strong { margin-top: .3em; font-size: 1.05rem; color: #ffe4b9; }
.quest-notice p, .story-entry p { margin: .5em 0 0; line-height: 1.35; }
.quest-notice .modal-x { position: absolute; top: 7px; right: 7px; width: 32px; min-width: 32px; height: 32px; }
.quest-notice .card-art { float: left; width: 44px; margin: 7px 8px 0 0; }
.quest-notice .card-art img { display: block; width: 100%; max-height: 58px; object-fit: contain; }
#questStoryHistory {
 margin-left: .6em;
 padding: 3px 6px;
 color: var(--goldbright);
 background: #19130d;
 border: 1px solid var(--edge);
 font: 600 12px Georgia, serif;
 letter-spacing: normal;
}
.story-entry { margin: 0 0 12px; padding: 9px 12px; border-left: 2px solid var(--gold); background: #120e0b66; }
.story-entry h3 { margin: 0 0 5px; color: var(--goldbright); font-size: 1rem; }
@media (max-width: 720px) {
 .quest-notice { bottom: max(68px, calc(env(safe-area-inset-bottom) + 62px)); }
}

/* Northlands uses the existing paper controls and central resolution setting. */
#northCompanion{padding:9px 14px;border:1px solid #a98b58;background:#241d15;color:#e7d3aa;font-family:inherit;font-weight:700;font-size:11px;cursor:pointer}
#northCompanion[hidden]{display:none}.north-ally-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}.north-ally-targets{display:grid;gap:8px;margin:12px 0}.north-companion p{line-height:1.5}

/* Companion information occupies its own row on narrow controls. */
#northCompanion{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.25;gap:4px;justify-content:center;flex-wrap:wrap}
#northCompanion .companion-name,#northCompanion .companion-health{min-width:0;max-width:100%;font:inherit;white-space:normal}
#northCompanion .companion-health{opacity:.85}
@media(max-width:700px){.actionprimary>#northCompanion:not([hidden]){grid-column:1/-1;display:flex;padding:6px;font-size:12px;min-height:44px;align-items:center;column-gap:10px}}
#saveWarning{position:fixed;inset:auto 10px 10px;z-index:99999;padding:12px;background:#692b19;color:#fff4dc;border:1px solid #e5b769;font:14px/1.4 Georgia,serif}
.campaign-ending{width:min(1020px,calc(100vw - 24px));background:linear-gradient(150deg,#302217,#0e1115);color:#f0dfbc;border-color:#ac8750}
.campaign-finale{margin:16px 0 22px;border:1px solid #836337;background:#15130f;box-shadow:0 10px 35px #0008;overflow:hidden}
.campaign-finale>img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:contain;image-rendering:pixelated;filter:var(--art-pixel-filter,opacity(1))}
.campaign-finale figcaption{padding:clamp(16px,3vw,30px);border-top:1px solid #896c3d}
.campaign-finale small{letter-spacing:.13em;text-transform:uppercase;color:#bda476}
.campaign-finale h3{font-size:clamp(23px,4vw,35px);margin:10px 0 15px;color:#f5d28b}
.campaign-finale p,.campaign-ending .story-entry p{line-height:1.65;font-size:clamp(16px,2vw,19px);white-space:pre-line}
.campaign-ending .dialog-actions{display:flex;flex-wrap:wrap;gap:10px}
.campaign-ending .dialog-actions button{min-width:0;white-space:normal;flex:1 1 180px}
@media(max-width:700px){.campaign-ending{padding:14px}.campaign-finale{margin-top:12px}.campaign-ending .modal-heading h2{font-size:23px}}

/* Mission exit uses the same mint arrow as the maps. */
.maplegend{flex-wrap:wrap;gap:.3rem .75rem}.map-exit-key{color:#a9d8ca}
