/* Original modern play surface; detailed native planner stays available. */
:root{--blue:#005dab;--green:#16855f;--orange:#f47920;--coral:#f47920}
:root{--cream:#f4f5f6}
.game-footer{background:#f4f5f6}.panel{background:#fff}.panel-eyebrow{color:var(--blue)}
.tiny-pip.orange{--shirt:#f47920}.tiny-pip.white{--shirt:#e9ecef}
body{padding:0;background:#032d61;font-family:'Trebuchet MS',system-ui,sans-serif}
.game-shell{width:100%;max-width:none;margin:0;min-height:100vh;min-height:100dvh;border:0;border-radius:0;box-shadow:none;background:#fffdf7}
.masthead{background:var(--blue);color:white;border-bottom:5px solid var(--coral)}
.masthead .brand{color:white;font-size:31px}.masthead .brand-small{color:#d6efff;font-size:8px}
.masthead .toolbar button{background:#ffffff17;border:1px solid #ffffff55;color:#fff;border-radius:12px}
.adventure-play .workspace,.adventure-play #world,.adventure-play #intro,.adventure-play .world-location,.adventure-play .mission-strip,.adventure-play .action-strip,.adventure-play .touch-controls{display:none!important}
.adventure-play .playfield{height:0;min-height:0;aspect-ratio:auto;border:0;overflow:visible;background:none;container-type:normal}
.adventure-play .playfield:has(.panel:not([hidden])){display:block;position:fixed;inset:0;height:auto;z-index:100;background:none}
.adventure-play .modal-backdrop{position:fixed;inset:0;background:#092d4fcc;backdrop-filter:blur(5px)}
.adventure-play .panel{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(760px,95vw);max-height:90svh;border:2px solid #d6e4e8;border-radius:18px;z-index:102}
.adventure-play .panel-scroll{max-height:calc(90svh - 14px);padding:25px}.adventure-play #toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:120;max-width:min(80vw,650px);border-radius:12px}
#adventure{background:#dce8ed}#adventure[hidden]{display:none}
.adventure-scene{position:relative;isolation:isolate;background:#dce8ed;overflow:hidden}
#adventure-canvas{display:block;width:100%;height:min(65vw,720px);min-height:450px;object-fit:cover;outline-offset:-5px;touch-action:manipulation;image-rendering:auto}

.adventure-context{position:absolute;left:20px;right:20px;bottom:16px;display:flex;flex-direction:column;align-items:center;gap:9px;z-index:3;pointer-events:none}
#adventure-prompt{background:#0a3452eb;color:white;max-width:95%;border-radius:12px;padding:10px 18px;font-size:14px;font-weight:700;line-height:1.4;box-shadow:0 4px 14px #11385220;text-align:center}
#adventure-incident{background:#fff7e9;color:#123954;border:1px solid #ecb180;border-radius:10px;max-width:95%;padding:5px 10px;font-size:calc(12px * var(--text-scale,1));font-weight:700;line-height:1.3;text-align:center;overflow-wrap:anywhere}
#adventure-incident:empty{position:absolute;width:1px;height:1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%)}
@media(max-width:700px){.game-shell:not(.text-large) #adventure-incident:not(:empty){align-self:flex-end;max-width:calc(100% - 164px)}}
.adventure-context>div{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;pointer-events:auto}
.adventure-context button,.adventure-menu button{background:#fffdfa;color:#124164;border:1px solid #b9ccd6;border-radius:11px;font:700 12px 'Trebuchet MS',sans-serif;padding:9px 14px;box-shadow:0 3px 0 #b7cbd4;min-height:48px;transition:transform .1s}
.adventure-context #adventure-action{background:var(--orange);border-color:#c65a0b;color:#132e48;box-shadow:0 3px 0 #b44f08}
.adventure-context #adventure-action:focus-visible{outline-color:#132e48}
#quick-finish-action{pointer-events:auto;flex:0 0 auto;min-width:48px;min-height:48px;max-width:100%;padding:7px 13px;border:2px solid #fffdfa;border-radius:12px;background:#005dab;color:#fff;font:700 13px/1.2 system-ui;box-shadow:0 3px 0 #003e70;cursor:pointer}
#quick-finish-action[hidden]{display:none}
#quick-finish-action:focus-visible{outline:2px solid white;outline-offset:2px}
.game-shell.text-large #quick-finish-action{font-size:calc(13px * var(--text-scale,1))}
.adventure-context button:active,.adventure-menu button:active{transform:translateY(2px);box-shadow:none}
.adventure-menu{display:flex;flex-wrap:wrap;justify-content:center;gap:9px;padding:14px;background:#f8fcfc;border-top:1px solid #c3d7df}
.adventure-menu button:last-child{background:var(--blue);color:white;border-color:#005dab}
.adventure-walk{display:none;position:absolute;left:16px;bottom:150px;grid-template-columns:48px 48px 48px;gap:4px;z-index:4}
.adventure-walk button{background:#fffffff0;border:1px solid #98bbd0;border-radius:12px;color:var(--blue);font-size:20px;min-height:48px;min-width:48px;touch-action:none}
.adventure-walk button:first-child{grid-column:2}.adventure-walk button:nth-child(2){grid-column:1;grid-row:2}.adventure-walk button:nth-child(3){grid-column:2;grid-row:2}.adventure-walk button:last-child{grid-column:3;grid-row:2}
.adventure-dock{position:absolute;left:20px;right:20px;bottom:132px;z-index:5;max-height:340px;overflow:auto;padding:18px 20px;border:2px solid #bad4e1;border-top:5px solid var(--coral);border-radius:17px;background:#fffffff5;box-shadow:0 18px 45px #0c354b30;backdrop-filter:blur(8px);color:#163e56}
.adventure-dock[hidden]{display:none}.adventure-dock>strong{font-size:17px;display:block;padding-right:45px;letter-spacing:.5px}.adventure-dock strong small{font-size:11px;color:#56788a;display:block;letter-spacing:0;padding-top:3px}
.adventure-live #toast{display:none!important}
.adventure-dock .dock-close{position:absolute;right:9px;top:9px;width:48px;height:48px;border:1px solid #c9dfe9;border-radius:12px;background:#e9f3f7;font-size:23px;color:var(--blue)}
.dock-cards,.dock-tabs,.dock-purchases,.dock-payload{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}.adventure-dock button:not(.dock-close){border:1px solid #bfd5df;border-radius:10px;background:#edf5f8;min-height:48px;padding:9px 13px;font:700 12px 'Trebuchet MS',sans-serif;color:#164562}.adventure-dock button small{display:block;font-weight:400;font-size:10px;padding-top:3px}.adventure-dock button[aria-pressed=true]{background:var(--blue);color:#fff}.adventure-dock button:disabled{opacity:.45}.adventure-dock p{font:12px/1.5 system-ui;margin:9px 0}.dock-issues{max-height:150px;overflow:auto}.dock-issues p{border-bottom:1px solid #d9e5eb;padding-bottom:7px}
.intro h1{font-family:'Trebuchet MS',system-ui,sans-serif;letter-spacing:-3px}.intro .eyebrow{color:var(--blue)}.intro-copy .primary{background:var(--orange);border-radius:14px;font-family:inherit}.intro-links button{border-radius:10px}.playfield canvas{image-rendering:auto}
@media(pointer:coarse){.adventure-walk{display:grid}}
@media(max-width:700px){.game-shell{border-radius:0}.masthead{padding:12px 14px;height:75px}.masthead .brand{font-size:25px}.masthead .brand-mark{width:30px}.masthead .brand-small{font-size:6px}.masthead .toolbar{gap:5px}.masthead .toolbar button{padding:6px}.masthead .sound-button #sound-label{display:none}.adventure-scene{height:690px}#adventure-canvas{height:690px;min-height:0;width:100%;object-fit:cover}.adventure-context{left:8px;right:8px;bottom:12px;gap:8px}.adventure-context button{font-size:10px;padding:8px;flex:1 1 27%;min-width:80px}.adventure-context #adventure-prompt{font-size:12px;padding:10px 12px;max-width:100%}.adventure-walk{display:grid;bottom:215px;left:12px}.adventure-dock{left:8px;right:8px;bottom:208px;max-height:335px;padding:13px 12px}.adventure-dock>strong{font-size:14px}.adventure-dock button:not(.dock-close){font-size:11px;flex:1 1 40%}.adventure-menu{gap:7px;padding:10px}.adventure-menu button{font-size:11px;flex:1 1 27%;padding:8px}.dock-cards{gap:6px}.game-footer{font-family:system-ui}.adventure-play .panel-scroll{padding:18px}}
@media(max-width:350px){.adventure-scene,#adventure-canvas{height:660px}.adventure-context button{font-size:9px}.adventure-dock{max-height:300px}.adventure-menu button{flex-basis:40%}.masthead .brand-small{font-size:5px}}
@media(prefers-reduced-motion:reduce){.adventure-context button,.adventure-menu button{transition:none}}

#title-3d{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}#title-3d[hidden]{display:none}.adventure-scene{background:#d8dadd}.adventure-menu{background:#f4f5f6}.intro{background:linear-gradient(90deg,#ffffffed 0%,#ffffffd9 36%,#ffffff00 70%)}
.game-shell.text-large .adventure-scene{display:flex;flex-direction:column;height:auto;overflow:visible}

.game-shell.text-large #adventure-canvas{height:500px;min-height:0}
.game-shell.text-large .adventure-context{position:static;padding:12px;background:#e4e8eb;pointer-events:auto}
.game-shell.text-large #adventure-prompt{font-size:calc(14px * var(--text-scale));max-width:100%;overflow-wrap:anywhere}
.game-shell.text-large .adventure-context>div{width:100%}
.game-shell.text-large .adventure-context button{flex:1 1 180px;max-width:100%;white-space:normal}
.game-shell.text-large .adventure-menu button{flex:1 1 220px;white-space:normal;overflow-wrap:anywhere}
.game-shell.text-large .adventure-dock{position:relative;inset:auto;max-height:500px;margin:10px;overflow-wrap:anywhere}
.game-shell.text-large .adventure-dock p{font-size:calc(12px * var(--text-scale))}
.game-shell.text-large .adventure-walk{top:350px;bottom:auto}
.native-spot-hints{padding:10px 14px;background:#e9f1f8;border-top:1px solid #b9cede;color:#153c58}
.native-spot-hints p{font:14px/1.5 system-ui;margin:0 0 8px}.native-spot-hints button{background:white;border:1px solid #95b5cc;border-radius:8px;min-height:48px;margin:3px;padding:8px 12px;color:#005dab}

/* Official first-party logo, bundled under the approved brand-asset exception. */
.game-shell .official-brand-logo{width:64px;height:64px;object-fit:contain;flex:none;border-radius:4px}.game-shell .game-brand-title{font-size:22px;letter-spacing:-.6px}.game-shell .brand-small{font-size:10px;letter-spacing:.6px}@media(max-width:700px){.game-shell .official-brand-logo{width:50px;height:50px}.game-shell .game-brand-title{font-size:16px}.game-shell .game-brand-title .brand-small{font-size:8px;max-width:100px;white-space:normal}}

.game-shell #avatars{gap:7px;flex-wrap:wrap}.game-shell #avatars .avatar{width:auto;min-width:64px;height:48px;border-radius:12px;padding:6px 10px;font-size:14px;color:#17446a;background:#e8f0f7}.game-shell #avatars .avatar.selected{border-color:#f47920;box-shadow:0 0 0 2px #fff,inset 0 -3px #005dab33}.game-shell #avatars .avatar[data-skin="1"]{background:#dceaf6}.game-shell #avatars .avatar[data-skin="2"]{background:#e5edf0}
/* The second actor keeps a separate native action group; narrow screens take turns. */
.audio-mix{border:1px solid #c4d5e3;border-radius:14px;padding:14px 18px;margin:14px 0;background:#f4f8fb}.audio-mix legend{font-weight:800;color:#005dab;padding:0 8px}.audio-mix>label{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 14px;margin:8px 0}.audio-mix input[type=range]{grid-column:1/-1;width:100%;min-height:48px;accent-color:#005dab}.audio-mix output{font-variant-numeric:tabular-nums;color:#24516b}.audio-mix>label.audio-mono{display:flex;min-height:48px}.audio-mix .audio-mono input{min-width:22px;min-height:22px}
.adventure-peer-controls{padding:12px 14px;background:#e8eff5;border-top:2px solid #005dab;color:#154b70;display:grid;gap:9px}.adventure-peer-controls[hidden]{display:none}.adventure-peer-controls>div{display:flex;gap:8px;flex-wrap:wrap}.adventure-peer-controls [hidden]{display:none}.adventure-peer-controls button{min-height:48px;border:1px solid #8aaec8;border-radius:10px;background:#fff;color:#005dab;padding:9px 12px;font:700 13px/1.35 system-ui}.adventure-peer-controls button[aria-pressed=true]{background:#005dab;color:#fff}.adventure-peer-controls strong{font:700 14px/1.45 system-ui}
.adventure-menu [data-play="grip-direction"][aria-pressed="true"],.adventure-peer-controls [data-peer-play="grip-direction"][aria-pressed="true"]{background:#005dab;color:#fff;border-color:#f47920}
.world-speech-layer{position:absolute;pointer-events:none;z-index:5;overflow:hidden;contain:layout style}
.world-speech{--balloon-paper:#fff9ec;--balloon-edge:#36536a;position:absolute;left:0;top:0;width:max-content;color:#253d52;font:600 14px/1.4 system-ui,sans-serif;box-sizing:border-box;will-change:transform}
.world-speech[hidden]{display:none}
.world-speech-body{display:flex;flex-direction:column;gap:5px;padding:9px 13px 10px;background:var(--balloon-paper);border:2px solid var(--balloon-edge);border-radius:18px;box-shadow:0 3px 0 #36536a44,0 7px 16px #19384a29;box-sizing:border-box}
.world-speech-tail{position:absolute;left:calc(var(--speech-tail,50%) - 10px);bottom:-10px;width:20px;height:12px;background:var(--balloon-edge);clip-path:polygon(0 0,100% 0,37% 100%);pointer-events:none}
.world-speech-tail::after{content:"";position:absolute;inset:0 2px 3px;background:var(--balloon-paper);clip-path:inherit}
.world-speech[data-tail="top"] .world-speech-tail{top:-10px;bottom:auto;transform:rotate(180deg)}
.world-speech.thought .world-speech-tail{width:8px;height:8px;bottom:-9px;border-radius:50%;clip-path:none}
.world-speech.thought .world-speech-tail::after{inset:1px;border-radius:50%}
.world-speech[data-admission="outside"] .world-speech-name::before{content:"\2298  Keep outside";color:#823b15}
.world-speech[data-admission="ask"] .world-speech-name::before{content:"?  Ask first";color:#005dab}
.world-speech[data-admission="admit"] .world-speech-name::before{content:"\2713  Clear";color:#25604e}
.world-speech[data-admission]:not([data-admission=""]) .world-speech-name::before{display:inline-block;margin-right:.45em;font-weight:700}
.world-speech-name{align-self:flex-start;color:#004780;background:#e2edf5;border-radius:8px;padding:2px 7px;font-size:.83em;font-weight:800}
.world-speech-words{max-width:260px;overflow-wrap:anywhere}
.world-speech.thought .world-speech-body{border-radius:24px;border-style:dashed}
.world-speech-caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.adventure-menu[hidden]{display:none!important}
#adventure{position:relative}
.adventure-menu{position:absolute;z-index:8;right:14px;bottom:106px;max-width:620px;max-height:60svh;overflow:auto;border:1px solid #a9bec9;border-radius:18px;box-shadow:0 12px 38px #17394a38}
.adventure-more-toggle{min-width:64px}
@media(max-width:700px){
 
 
 
 .adventure-play .game-footer{display:none}
 
 
 .adventure-context{bottom:10px;gap:6px}
 .adventure-context>div{flex-wrap:nowrap;width:100%;gap:5px}
 .adventure-context button{font-size:11px;min-width:48px;min-height:48px;flex:1;padding:6px 4px;white-space:normal}
 .adventure-context #adventure-action{flex:1.7}
 .adventure-context #adventure-prompt{max-width:100%;font-size:12px;padding:8px 11px}
 .adventure-walk{bottom:112px;left:10px;gap:3px}
 .adventure-walk button{width:48px;height:48px;min-width:48px;min-height:48px}
 .adventure-menu{left:8px;right:8px;bottom:106px;max-height:55svh;padding:10px;gap:8px}
 .adventure-menu button{flex:1 1 42%;font-size:12px;min-height:48px}
 .adventure-dock{bottom:106px;max-height:55svh;z-index:9}
 .world-speech{font-size:13px}
 .world-speech-body{padding:8px 10px 9px}
}
.arrival-playing .adventure-context button:not(#adventure-action),.arrival-playing .adventure-walk{display:none!important}
.arrival-playing #adventure-action{min-width:150px;flex:0 1 190px}
.unit-guide{position:absolute;z-index:3;top:86px;right:14px;display:flex;align-items:center;gap:8px;max-width:190px;min-height:52px;padding:8px 12px;background:#fffdf4ee;color:#005dab;border:1px solid #ccd9db;border-radius:15px;font:700 12px/1.35 system-ui;box-shadow:0 3px 10px #17394a18}
.unit-guide-arrow{font-size:30px;line-height:1;display:block;transform-origin:center}
.arrival-playing .unit-guide{display:none}
@media(max-width:700px){
 .unit-guide{top:auto;bottom:186px;right:9px;width:117px;max-width:117px;font-size:10px;padding:7px;gap:5px;box-sizing:border-box}
 .unit-guide-arrow{font-size:25px}
}

.sign-reading-face{position:absolute;box-sizing:border-box;width:max-content;pointer-events:none;background:#005dab;color:white;border:2px solid white;border-top:3px solid #ff932f;border-radius:3px;padding:3px 8px 5px;text-align:center;font-family:system-ui,sans-serif;line-height:1.15;box-shadow:0 2px 3px #19364733}
.sign-reading-face[hidden]{display:none}
.sign-reading-face strong,.sign-reading-face span{display:block}
.sign-reading-face strong{font-size:18px;font-weight:750}
.sign-reading-face span{margin-top:2px;font-size:12px;font-weight:600}



#daily-brief h3,#daily-brief p{margin:.35em 0}

.adventure-dock .shop-quantity{display:flex;align-items:center;justify-content:center;gap:12px;margin:8px 0;font-weight:700}
.adventure-dock .shop-quantity button{min-inline-size:48px;min-block-size:48px}
.adventure-dock [data-play="shop-tab"][aria-pressed="true"]{border-color:#0755a2;box-shadow:inset 0 -3px #0755a2}

.world-speech-layer:has(.with-replies:not([hidden])){z-index:9}
.world-speech.with-replies,.world-speech.chat-farewell{width:336px}
.with-replies .world-speech-body{pointer-events:auto;overflow:auto;overscroll-behavior:contain;scroll-padding:8px}
.with-replies .world-speech-words,.chat-farewell .world-speech-words{max-width:none}
.small-talk-menu{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-top:3px}
.small-talk-menu[hidden],.small-talk-menu button[hidden]{display:none}
.small-talk-menu button{min-inline-size:48px;min-block-size:48px;padding:5px 8px;border:1px solid #7695aa;border-radius:10px;background:#f1f7f9;color:#133c55;text-align:left;font:700 13px/1.25 system-ui;cursor:pointer;overflow-wrap:anywhere}
.small-talk-menu button:focus-visible{outline:3px solid #005dab;outline-offset:-3px}
.small-talk-menu button:hover{background:#dfedf7}
.small-talk-menu button[data-play="chat-end"]{grid-column:1/-1;border-color:#b27a49;background:#fff0db;color:#633e23;text-align:center}
.small-talk-menu button[data-play="chat-end"]:hover{background:#ffe3ba}
.small-talk-menu button[data-play="chat-accept"]{background:#dcefe6;color:#154b38}
.game-shell.text-large .world-speech{font-size:calc(14px * var(--text-scale,1))}
.game-shell.text-large .small-talk-menu{grid-template-columns:1fr}
.game-shell.text-large .small-talk-menu button{font-size:calc(13px * var(--text-scale,1))}

.chat-question{position:absolute;top:0;left:0;pointer-events:auto;width:48px;height:48px;box-sizing:border-box;padding:0;background:#fffdf6;color:#005dab;border:2px solid #005dab;border-radius:50%;box-shadow:0 2px 5px #19384a38;font:bold 24px/1 system-ui;cursor:pointer}
.chat-question::after{content:'';position:absolute;bottom:-4px;left:calc(var(--chat-tail,50%) - 6px);width:8px;height:8px;background:inherit;border-right:2px solid #005dab;border-bottom:2px solid #005dab;transform:rotate(45deg);pointer-events:none}
.chat-question:hover{background:#e7f4ff}
.chat-question:focus-visible{outline:3px solid #ef7928;outline-offset:2px}

/* Keep the live scene usable when enlarged controls need their own rows. */
.game-shell.adventure-play.text-large{overflow:visible}
.game-shell.adventure-play.text-large .adventure-scene{
 display:grid;grid-template-areas:"world" "route" "actions" "dock";
 grid-template-columns:minmax(0,1fr);height:auto
}
.game-shell.adventure-play.text-large #adventure-canvas{
 grid-area:world;height:clamp(250px,45dvh,500px);min-height:0
}
.game-shell.adventure-play.text-large .adventure-walk{
 grid-area:world;position:relative;inset:auto;align-self:end;justify-self:start;margin:8px
}
.game-shell.adventure-play.text-large .unit-guide{
 grid-area:route;position:static;width:auto;max-width:none;margin:8px 12px 0;
 font-size:calc(11px * var(--text-scale,1));overflow-wrap:anywhere
}
.game-shell.adventure-play.text-large .adventure-context{grid-area:actions}
.game-shell.adventure-play.text-large .adventure-context>div{flex-wrap:wrap}
.game-shell.adventure-play.text-large .adventure-context button{
 flex:1 1 8rem;min-width:48px;font-size:calc(12px * var(--text-scale,1));overflow-wrap:anywhere
}
.game-shell.adventure-play.text-large #adventure-action{flex:1 0 100%}
.game-shell.adventure-play.text-large .adventure-dock{grid-area:dock}
.game-shell.adventure-play.text-large .adventure-menu{
 position:relative;inset:auto;margin:8px;max-width:none
}

@media(max-width:700px){
 .game-shell.adventure-play.text-large .adventure-scene{grid-template-areas:"world" "actions" "route" "dock"}
 .game-shell.adventure-play.text-large #adventure-canvas{height:clamp(250px,32dvh,360px)}
 .game-shell.adventure-play.text-large .unit-guide{margin:0 8px 6px;padding:4px 8px;min-height:48px;line-height:1.25}
 .game-shell.adventure-play.text-large .adventure-context{padding:6px 8px 10px}
 .game-shell.adventure-play.text-large #adventure-prompt{order:1;font-size:calc(12px * var(--text-scale));line-height:1.25;padding:6px 9px}
 .game-shell.adventure-play.text-large #adventure-incident{order:2}
 .game-shell.adventure-play.text-large .adventure-context>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
 .game-shell.adventure-play.text-large .adventure-context button{padding:5px;line-height:1.15}
 .game-shell.adventure-play.text-large #adventure-action{grid-column:span 2}
 .game-shell.adventure-play.text-large .arrival-playing #adventure-action{grid-column:1/-1}
 .game-shell.adventure-play.text-large .world-speech:not(.with-replies,.chat-farewell){line-height:1.3}
 .game-shell.adventure-play.text-large .world-speech:not(.with-replies,.chat-farewell) .world-speech-body{
  padding-block:5px;gap:3px
 }
 .game-shell.adventure-play.text-large .adventure-menu,
 .game-shell.adventure-play.text-large .adventure-dock{
  position:fixed;inset:auto 8px 8px;margin:0;max-height:65svh
 }
}

/* Fill the frame and let the blue header take only the space its controls need. */
.game-shell:is(.adventure-play,.studio-active) {
  display:flex;
  flex-direction:column;
}
.game-shell:is(.adventure-play,.studio-active) > :is(.masthead,.game-footer) { flex:none }
.game-shell.adventure-play > .playfield { flex:none }
.game-shell.adventure-play #adventure { flex:1; display:flex; flex-direction:column }
.game-shell.adventure-play:not(.text-large) .adventure-scene { flex:1; min-height:280px }
.game-shell.adventure-play:not(.text-large) #adventure-canvas {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  min-height:0;
}
.game-shell.adventure-play .game-footer {
  min-height:36px;
  padding:4px clamp(12px,2vw,28px) max(4px,env(safe-area-inset-bottom));
}

.game-shell .masthead:has(#chapter-bar:not([hidden])) {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  height:auto;
  gap:8px clamp(12px,2.2vw,32px);
  padding:max(6px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left));
  border-bottom-width:3px;
}
.masthead .brand { min-width:0; gap:10px }
.masthead .official-brand-logo { width:52px; height:52px }
.masthead .toolbar { grid-column:3; justify-self:end }
.masthead .toolbar button { min-width:48px; min-height:48px }
.masthead :is(.toolbar button,.delivery-toggle,.daily-brief-link,.brand):focus-visible {
  outline:2px solid white;
  outline-offset:2px;
}
.masthead .chapter-bar:not([hidden]) {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px clamp(12px,2vw,28px);
  min-width:0;
  border-inline-start:1px solid #ffffff55;
  padding-inline-start:clamp(12px,2vw,28px);
}
.masthead .chapter-heading { min-width:0; overflow-wrap:anywhere }
.masthead .chapter-heading h1 {
  margin:2px 0 0;
  color:inherit;
  font-size:1.25rem;
  line-height:1.15;
}
.masthead .chapter-tag {
  display:block;
  color:#e0f1ff;
  font:700 .6875rem/1.3 system-ui,sans-serif;
  letter-spacing:.06em;
}
.masthead .chapter-stats { display:flex; flex:none; align-items:center; gap:clamp(8px,1.4vw,20px) }
.masthead :is(.delivery-toggle,#score) {
  color:inherit;
  font:700 1.125rem/1.1 system-ui,sans-serif;
  font-variant-numeric:tabular-nums;
}
.masthead .delivery-toggle { border:1px solid #ffffff65; border-radius:10px; padding:4px 9px }
.masthead .delivery-toggle:hover { background:#ffffff25 }
.masthead .chapter-stats small {
  display:block;
  margin-top:3px;
  color:#e0f1ff;
  font:600 .6875rem/1.2 system-ui,sans-serif;
}
.masthead .fob-badge {
  padding:5px 7px;
  border-radius:6px;
  color:#fff7e3;
  background:#003e73;
  font:700 .75rem/1.25 system-ui,sans-serif;
  white-space:nowrap;
}
.masthead .fob-badge.owned { color:#e1fff0; background:#116048 }
.masthead .daily-brief-link {
  padding:0;
  background:transparent;
  color:inherit;
  font:inherit;
  text-align:left;
  text-decoration:underline;
  text-underline-offset:.16em;
}

@media (min-width:761px) {
  .masthead .chapter-heading { flex:1 0 7rem; overflow-wrap:break-word }
  .masthead .chapter-stats { flex:0 1 auto; min-width:0; flex-wrap:wrap; justify-content:flex-end }
}
@media(min-width:761px) and (max-width:960px) {
  .game-shell .masthead:has(#chapter-bar:not([hidden])) { column-gap:12px }
  .masthead .game-brand-title { font-size:1rem }
  .masthead .official-brand-logo { width:44px; height:44px }
  .masthead .sound-button #sound-label { display:none }
  .masthead .chapter-bar:not([hidden]) { gap:10px; padding-inline-start:10px }
  .masthead .chapter-heading h1 { font-size:1rem }
  .masthead .chapter-stats { gap:8px }
  .masthead :is(.chapter-stats small,.fob-badge,.chapter-tag) { font-size:.625rem }
}
@media(max-width:760px) {
  .game-shell .masthead:has(#chapter-bar:not([hidden])) { grid-template-columns:minmax(0,1fr) auto; row-gap:4px }
  .masthead .brand { gap:7px }
  .masthead .official-brand-logo { width:44px; height:44px }
  .masthead .toolbar { grid-column:2; grid-row:1 }
  .masthead .chapter-bar:not([hidden]) { grid-column:1/-1; padding:0; border:0; gap:6px }
  .masthead .chapter-heading h1 { font-size:1rem }
  .masthead .chapter-tag { font-size:.625rem }
  .masthead .chapter-stats { gap:7px; max-width:65% }
  .masthead :is(.delivery-toggle,#score) { font-size:.9375rem }
  .masthead .delivery-toggle { padding-inline:5px }
  .masthead .chapter-stats small,.masthead .fob-badge { font-size:.625rem }
  .masthead .fob-badge { white-space:normal }
}
@media(max-width:760px),(max-height:460px) {
  .game-shell .masthead:has(#chapter-bar:not([hidden])) .brand-small { display:none }
}
@media(max-width:375px) {
  .masthead .chapter-stats { gap:4px; max-width:68% }
  .masthead .chapter-heading h1 { font-size:.9375rem }
  .masthead .fob-badge { padding-inline:5px }
}
@media(max-height:460px) and (pointer:coarse) {
  .game-shell.adventure-play:not(.text-large) .adventure-scene { min-height:240px }
  .game-shell.adventure-play .game-footer { display:none }
  .adventure-context { left:164px; right:8px; bottom:8px }
  .adventure-walk { left:8px; bottom:8px }
  .unit-guide { top:8px; right:8px; bottom:auto }
}
.game-shell.text-large .masthead { --header-meta-size:calc(.6875rem * var(--text-scale,1)) }
.game-shell.text-large .masthead :is(.chapter-stats small,.fob-badge,.chapter-tag) { font-size:var(--header-meta-size) }
.game-shell.text-large .masthead :is(.delivery-toggle,#score) { font-size:calc(1rem * var(--text-scale,1)) }
.game-shell.text-large .masthead .chapter-stats { flex:0 1 auto; flex-wrap:wrap }
@media(max-width:760px) {
  .game-shell.text-large .masthead { --header-meta-size:calc(.5625rem * var(--text-scale,1)) }
  .game-shell.text-large .masthead .chapter-bar:not([hidden]) {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:4px;
  }
  .game-shell.text-large .masthead .chapter-heading { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 7px }
  .game-shell.text-large .masthead .chapter-heading h1 { font-size:calc(.8125rem * var(--text-scale,1)); margin:0 }
  .game-shell.text-large .masthead .chapter-stats {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    max-width:none;
  }
  .game-shell.text-large .masthead .chapter-stats small { margin:0 }
  .game-shell.text-large .masthead .fob-badge { padding:4px }
}

.masthead .masthead-extras {
  display:none;
}
.masthead .masthead-extras:has(> :not([hidden])) {
  display:flex;
  flex:1 0 100%;
  flex-wrap:wrap;
  align-items:center;
  gap:4px 12px;
  grid-column:1/-1;
  min-width:0;
  padding-block-start:4px;
  border-block-start:1px solid #ffffff55;
  font:600 calc(.75rem * var(--text-scale,1))/1.35 system-ui,sans-serif;
}
.game-shell .masthead:has(.masthead-extras > :not([hidden])):has(#chapter-bar[hidden]) {
  flex-wrap:wrap;
  height:auto;
}
.masthead .masthead-extras > .info-box:not([hidden]) {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px 8px;
  min-width:0;
  padding:0;
  margin:0;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  overflow-wrap:anywhere;
}
.masthead .masthead-extras button {
  min-height:44px;
  max-width:100%;
  padding:4px 10px;
  border:1px solid #ffffff65;
  border-radius:10px;
  background:#ffffff17;
  color:inherit;
  font:inherit;
  white-space:normal;
}
.masthead .masthead-extras button:hover {
  background:#ffffff25;
}
.masthead .masthead-extras button:focus-visible {
  outline:2px solid white;
  outline-offset:2px;
}

.adventure-readout:not([hidden]) {
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px 12px;
  min-width:0;
  padding-block:3px 1px;
  border-top:1px solid #ffffff40;
}
#adventure-progress {
  min-width:0;
  color:#e9f5ff;
  font:600 var(--readout-size,.75rem)/1.35 system-ui,sans-serif;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
.game-shell.text-large #adventure-progress {
  --readout-size:calc(.625rem * var(--text-scale,1));
}
@media (min-width:1280px), (min-width:800px) and (max-height:460px) {
  .game-shell:not(.text-large) .masthead:has(#adventure-readout:not([hidden])) {
    grid-template-columns:auto minmax(23rem,1.3fr) minmax(0,1fr) auto;
  }
  .game-shell:not(.text-large) .masthead:has(.adventure-readout:not([hidden])) .toolbar { grid-column:4; grid-row:1 }
  .game-shell:not(.text-large) .masthead .adventure-readout:not([hidden]) {
    grid-column:3;
    grid-row:1;
    border:0;
    border-inline-start:1px solid #ffffff55;
    padding:0 0 0 clamp(12px,2vw,24px);
  }
}
@media (min-width:800px) and (max-width:1279px) and (max-height:460px) {
  .game-shell:not(.text-large) .masthead:has(#adventure-readout:not([hidden])) {
    grid-template-columns:auto minmax(0,1fr) minmax(9rem,10.25rem) auto;
    padding-block:max(3px,env(safe-area-inset-top)) 3px;
  }
  .masthead:has(#adventure-readout:not([hidden])) .chapter-heading { flex:1 0 6rem }
  .masthead:has(#adventure-readout:not([hidden])) .chapter-stats {
    display:grid;
    flex:0 1 14rem;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    min-width:0;
  }
  .masthead:has(#adventure-readout:not([hidden])) .chapter-stats > * { overflow-wrap:anywhere }
  .masthead:has(#adventure-readout:not([hidden])) .delivery-toggle { padding-inline:4px }
  .masthead:has(#adventure-readout:not([hidden])) .fob-badge { white-space:normal }
  .game-shell:not(.text-large) .masthead .adventure-readout:not([hidden]) { padding-inline-start:10px }
}

.walk-render-layer {
  position:absolute;
  pointer-events:none;
  object-fit:cover;
}
.walk-render-layer[hidden] { display:block; visibility:hidden }
#adventure-canvas:focus-visible + .walk-render-layer {
  outline:3px solid #ef7928;
  outline-offset:-5px;
}
