*{box-sizing:border-box}html,body{margin:0;min-width:320px;background:#2b1a22;color:#4a2e2a;font-family:Nunito,system-ui,sans-serif}body{padding:0}button{font:inherit;cursor:pointer;touch-action:manipulation;user-select:none}#game{position:relative;max-width:1280px;min-height:100dvh;margin:auto;padding:12px 8px 14px;background:#f3e6cc;overflow:hidden}.topbar{height:64px;display:flex;align-items:center;justify-content:space-between;max-width:780px;margin:auto}.topbar #logo{width:220px;height:58px;object-fit:contain}.icon-btn,.tool,.paper-btn{border:2px solid #6d4f8c;border-radius:12px;background:#8e6bb0;color:#fff8e9;box-shadow:0 3px #553d6e;min-height:48px;padding:8px 14px;font-weight:800}.icon-btn:active,.tool:active,.paper-btn:active{transform:translateY(2px);box-shadow:0 1px #553d6e}.icon-btn{width:50px;padding:0;font-size:24px}.hud{display:flex;gap:8px;align-items:center;max-width:780px;margin:0 auto 8px;background:#ead6b4;border:2px solid #b8945f;border-radius:14px;padding:6px}.stat{flex:1;min-width:0;height:48px;display:flex;align-items:center;justify-content:center;gap:5px;font-size:12px;color:#7a5a50}.stat img{width:30px;height:30px;object-fit:contain}.stat b{font-size:18px;color:#4a2e2a}.room-title{text-align:center;font-family:Georgia,serif;font-size:16px;font-weight:800;margin:5px auto 8px;color:#4a2e2a}#boardWrap{position:relative;max-width:780px;margin:auto;touch-action:none}#board{width:100%;aspect-ratio:390/592;position:relative;background:#412b32 url('assets/A-BG-ST1-PORTRAIT.png') center/cover;border:14px solid #c9ae82;border-radius:14px;box-shadow:0 5px 0 #8f5a2a;overflow:hidden}#board canvas{display:block;width:100%;height:100%;pointer-events:none}.board-cell{position:absolute;display:flex;align-items:center;justify-content:center;color:#4a2e2a;font-weight:900;font-size:clamp(18px,5vw,30px);font-family:Nunito,system-ui,sans-serif;pointer-events:none}.board-cell.flag::after{content:'⚑';color:#a8352b;font-size:28px}.board-cell.hex{background:rgba(168,53,43,.22)}.board-cell.hint{outline:4px solid #f2b53a;outline-offset:-4px;animation:pulse .8s ease-in-out infinite alternate}.board-cell.veiled{background:rgba(91,63,122,.25)}@keyframes pulse{to{box-shadow:0 0 20px #f2b53a}}#toast{height:34px;max-width:780px;margin:4px auto;text-align:center;font-size:14px;color:#7a5a50}#tools{max-width:780px;margin:0 auto;display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:5px 0}.tool{min-height:62px;background:#ead6b4;border-color:#b8945f;color:#4a2e2a;box-shadow:0 3px #8f5a2a;padding:5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.tool img{width:28px;height:28px;object-fit:contain}.tool[aria-pressed=true]{background:#e6d8f2;border-color:#8e6bb0}.overlay{position:absolute;inset:0;z-index:10;background:rgba(43,26,34,.78);display:flex;align-items:center;justify-content:center;padding:14px}.panel{width:min(560px,100%);max-height:90dvh;overflow:auto;background:#f3e6cc;border:14px solid #c9ae82;border-radius:16px;padding:20px;box-shadow:0 8px #553d6e;text-align:center}.panel h1,.panel h2{font-family:Georgia,serif;color:#4a2e2a;margin:4px 0 12px}.panel p{line-height:1.55;color:#7a5a50}.panel .hero{width:100%;max-height:180px;object-fit:cover;border-radius:10px;margin-bottom:10px}.panel .stack{display:grid;gap:10px}.panel .stack button{width:100%}.panel .row{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.panel .codex-card{text-align:left;border:2px solid #c9ae82;border-radius:10px;padding:10px;margin:7px 0}.panel .codex-card h3{margin:0 0 4px}.panel .codex-card small{color:#7a5a50}.hidden{display:none!important}@media(min-width:1000px){#game{padding:18px 40px}.topbar{max-width:none}.topbar #logo{width:280px}.hud{position:absolute;left:40px;top:110px;width:260px;display:flex;flex-direction:column;align-items:stretch}.stat{justify-content:flex-start;padding:0 8px}.room-title{margin-top:6px}#boardWrap{width:min(780px,calc(100vw - 430px));margin-left:330px;margin-right:160px}#board{aspect-ratio:1/1}.tools{position:absolute;right:40px;top:180px;width:120px;display:flex;flex-direction:column}.tool{min-height:74px}.room-title{margin-left:330px;margin-right:160px}}
@media(min-width:1000px){#board{width:min(537.2px,calc(100vw - 430px));height:608px;aspect-ratio:auto}#boardWrap{display:flex;justify-content:center}}
@media(max-width:420px){#game{padding:6px 6px 10px}.topbar{height:70px}.topbar #logo{width:190px}.hud{gap:2px;padding:4px}.stat{font-size:10px}.stat img{width:24px;height:24px}.stat b{font-size:16px}.tool{font-size:12px}.tool img{width:25px;height:25px}#boardWrap{width:402px;max-width:none;margin-left:-12px;margin-right:0}#board{width:402px;max-width:none;height:592px;aspect-ratio:auto;position:relative;left:0}}

#overlay[hidden]{display:none!important}
.boot-retry{position:absolute;z-index:30;left:50%;top:50%;transform:translate(-50%,-50%);min-width:160px}
.guide-skip{position:absolute;z-index:22;right:10px;top:90px;min-height:34px;padding:5px 10px;font-size:12px}


/* Runtime board geometry follows D-PLAY-01: 402×592 frame at x=-6 on phone. */
#board { user-select:none; -webkit-user-select:none; }
@media (max-width:420px) {
  #game { position: relative; }
  .topbar { position:absolute; inset:0 0 auto; height:70px; z-index:20; pointer-events:none; }
  .topbar #logo { display:none; }
  .topbar .icon-btn { position:absolute; top:6px; right:6px; pointer-events:auto; }
  #hud { position:absolute; top:28px; left:8px; right:8px; width:auto; height:56px; margin:0; z-index:19; }
  #roomTitle { position: absolute; top: 88px; left: 8px; width: 260px; margin: 0; text-align: left; z-index: 9; }
  #boardWrap { margin-top: 98px; }
  #toast { position: absolute; top: 78px; left: 154px; right: 8px; height: 24px; margin: 0; z-index: 21; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:right; font-size:12px; }
  #hexStatus { display:none !important; }
  #tools { margin-top: 8px; }
  #boardWrap { width:402px; max-width:none; margin-left:-6px; margin-right:0; z-index:1; }
  #board { width:402px; max-width:none; height:592px; aspect-ratio:auto; position:relative; left:-6px; }
}

.hex-status{flex:2;justify-content:flex-start;white-space:nowrap;overflow:hidden}.hex-status b{font-size:12px;overflow:hidden;text-overflow:ellipsis}

/* Species weights stay visible; their full explanation uses the existing codex copy. */
.hex-legend{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin:4px auto}
.hex-rule{display:flex;align-items:center;gap:4px;border:0;background:transparent;color:#4a2e2a;font-weight:800;min-height:44px;padding:4px}
.hex-rule img{width:28px;height:28px;object-fit:contain}
.overlay{z-index:40}
.guide-bubble{position:absolute;left:82px;top:480px;width:270px;min-height:120px;border:28px solid transparent;border-left-width:43px;border-right-width:43px;border-image:url('assets/A-UI-STRIP.png') 28 43 fill stretch;z-index:7;pointer-events:none}
.guide-bubble p{position:relative;margin:-8px -4px;font-size:14px;line-height:1.35}
.guide-bubble img{position:absolute;width:52px;height:78px;object-fit:contain;left:-72px;bottom:-12px}
.guide-bubble[hidden],#guideSkip[hidden]{display:none}
@media(max-width:420px){.guide-bubble{left:50px;top:698px;width:330px;min-height:106px}.guide-bubble p{font-size:13px}#guideSkip{top:6px;right:62px;max-width:120px;min-height:24px;font-size:10px;padding:2px 5px}#toast{z-index:9}#toast:empty{display:none}}
#board{border:0;border-radius:0;box-shadow:none}
#board canvas{margin:0!important}
.volume-control{position:absolute;display:flex;gap:5px;align-items:center;height:30px;font-size:12px;font-weight:700;z-index:5}
.volume-control input{min-width:0;height:100%;margin:0;flex:1;accent-color:#6d4f8c}
.volume-control output{min-width:34px;text-align:end;font-variant-numeric:tabular-nums}
#hintBtn.guide-hint-target{outline:3px solid #f2b53a;outline-offset:2px}
@media(max-width:420px){
  #tools{padding-top:0;margin-top:8px}
  #toast{top:800px}
  .guide-bubble{width:305px;min-height:120px;top:698px}
  #guideSkip{top:84px;right:8px;min-height:20px;max-width:95px;font-size:10px;padding:0 4px}
  #roomTitle{width:calc(100% - 110px);overflow:hidden;text-overflow:ellipsis}
}
@media(min-width:1000px){
  #game{height:100dvh;min-height:720px;padding:0}
  #boardWrap{position:absolute;left:calc(50% - 268.6px);top:56px;width:537.2px;height:608px;margin:0;display:block}
  #hud{left:calc(50% - 530px);top:150px;width:220px}
  #tools{position:absolute;left:calc(50% + 370px);right:auto;top:130px;width:120px;display:flex;flex-direction:column;margin:0}
  #roomTitle{position:absolute;left:calc(50% - 252.6px);top:18px;width:505.2px;margin:0;font-size:14px;text-align:left}
  #hexLegend{position:absolute;left:calc(50% - 530px);top:420px;width:220px}
  #toast{position:absolute;left:calc(50% - 252.6px);top:668px;width:505.2px;height:auto;white-space:normal}
}
@media(max-width:420px){
  #hexLegend{position:absolute;left:8px;right:65px;top:0;margin:0;justify-content:flex-start;font-size:11px;gap:14px}
  .hex-rule{min-height:26px;padding:0;gap:3px}
  .hex-rule img{width:20px;height:20px}
  #roomTitle{width:calc(100% - 16px);font-size:11px;white-space:nowrap}
  #toast{top:696px;left:8px;right:8px;height:auto;min-height:44px;white-space:normal;overflow:visible;text-align:center;background:#f3e6cc;pointer-events:none;z-index:8}
  #tools{position:absolute;left:0;right:0;top:704px;height:116px;margin:0;padding:20px 14px 0;align-items:start;gap:12px;z-index:10}
  #tools .tool{min-height:64px;font-size:11px;padding:4px 2px}
  #game{min-height:844px}
}
.glimmer-flight{position:fixed;width:24px;height:24px;z-index:30;pointer-events:none;will-change:transform,opacity}
.stat b{display:inline-block}
#toast.danger{color:#a8352b;font-weight:800}
#toast.purify-confirm{pointer-events:auto;z-index:25}
@media(max-width:420px){#toast.purify-confirm{top:592px;left:45px;right:20px;min-height:0;background:transparent}}

@font-face{font-family:Nunito;src:url('fonts/nunito-latin.woff2') format('woff2');font-weight:200 1000;font-display:swap}
@font-face{font-family:Fraunces;src:url('fonts/fraunces-latin.woff2') format('woff2');font-weight:100 900;font-display:swap}
.panel h1,.panel h2,.room-title{font-family:Fraunces,Georgia,serif}
/* Layout-backed logical stage: one scale controller for standalone and iframe. */
html,body{width:100%;height:100%;overflow:hidden}
#game[data-viewport]{position:absolute;left:50%;top:50%;margin:0;padding:0;max-width:none;min-height:0;transform-origin:center;direction:ltr}
.asset-surface{position:absolute;inset:0;pointer-events:none;z-index:-1;box-sizing:border-box}
[data-layout-id]{isolation:isolate}
#hud[data-layout-id],#tools[data-layout-id]{display:block;margin:0;padding:0;max-width:none;border:0;border-radius:0;background:none;box-shadow:none;right:auto}
#hud .stat[data-layout-id]{display:block;flex:none;margin:0;padding:0;border:0;background:none}
#hud .stat span{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
#hud .stat b{font-size:18px;line-height:26px;white-space:nowrap;color:#4a2e2a;text-align:left}
#hud .stat img{object-fit:contain}
#hexStatus{display:none!important}
#menuBtn[data-layout-id],#tools .tool[data-layout-id]{display:block;min-height:0;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;transform:none;color:#4a2e2a}
#menuBtn img,#tools .tool img{object-fit:contain;pointer-events:none}
#tools .tool span{position:absolute;top:100%;left:-12px;right:-12px;text-align:center;font-size:12px;line-height:20px;white-space:normal;pointer-events:none}
#tools .tool:disabled{cursor:default}
#menuBtn:focus-visible,#tools .tool:focus-visible{outline:3px solid #5b3f7a;outline-offset:2px}
#boardWrap[data-layout-id]{margin:0;max-width:none;display:block;right:auto}
#boardWrap #board{position:relative;left:0;top:0;aspect-ratio:auto;max-width:none;margin:0;background:none}
#roomTitle[data-layout-id]{margin:0;max-width:none;text-align:left;font-size:12px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#game[data-viewport=phone] #hexLegend{left:8px;right:8px;top:0;width:auto;height:26px;justify-content:flex-start;font-size:11px;gap:14px;margin:0}
#game[data-viewport=phone-compact] #hexLegend{left:8px;right:8px;top:52px;width:auto;height:24px;justify-content:flex-start;font-size:11px;gap:14px;margin:0}
#game[data-viewport=phone] .hex-rule{min-height:48px;min-width:48px;padding:4px;gap:4px;font-size:14px}
#game[data-viewport=phone] .hex-rule img{width:22px;height:22px}
#game[data-viewport=phone] #toast{top:696px;left:8px;right:8px;width:auto;height:auto;min-height:0;margin:0;white-space:normal;text-align:center;background:#f3e6cc;font-size:13px;z-index:12}
#game[data-viewport=phone-compact] #toast{top:52px;left:120px;right:8px;width:auto;height:24px;margin:0;white-space:nowrap;overflow:hidden;text-align:right;background:none;font-size:12px;z-index:12}
#game[data-viewport=phone] #toast.purify-confirm{top:592px;left:45px;right:20px;background:none;z-index:25}
#game[data-viewport=phone] .guide-bubble{left:50px;width:305px;min-height:120px}
#game[data-viewport=phone-compact] .guide-bubble{left:38px;width:310px;min-height:96px;top:560px}
#game[data-viewport=phone] .guide-bubble p{font-size:13px}
#game[data-viewport=phone] #guideSkip{top:84px;right:8px;min-height:20px;max-width:95px;font-size:10px;padding:0 4px}
#game[data-viewport=phone-compact] #guideSkip{top:78px;right:8px;min-height:20px;max-width:95px;font-size:10px;padding:0 4px}
#game[data-viewport=desktop] #hexLegend{position:absolute;left:110px;top:580px;width:220px;margin:0;font-size:14px}
#game[data-viewport=desktop] .guide-bubble{top:26px}
#game[data-viewport] .guide-bubble.guide-finish{width:280px;min-height:0;padding:8px 12px;border:2px solid #b8945f;border-radius:12px;background:#f3e6cc;color:#4a2e2a;z-index:13}
#game[data-viewport=phone] .guide-bubble.guide-finish{inset:598px 20px auto;width:auto}
#game[data-viewport=phone-compact] .guide-bubble.guide-finish{inset:518px 20px auto;width:auto}
.guide-finish img{display:none}
.guide-bubble.guide-finish p{margin:0;font-weight:800}
#guidePurify:not([hidden]){display:block;min-height:48px;margin-top:4px;pointer-events:auto}
#game[data-viewport=desktop] #toast{position:absolute;left:387.4px;top:668px;width:505.2px;height:auto;white-space:normal;text-align:center;margin:0}
#game[data-viewport=phone-compact] #tools{position:absolute;left:0;right:0;top:616px;height:78px;margin:0;padding:8px 10px 0;align-items:start;gap:10px;z-index:10}
#game[data-viewport=phone-compact] #tools .tool{min-height:60px;font-size:10px;padding:2px}
#game[data-viewport=phone-compact] #hexLegend .hex-rule{min-height:48px;min-width:48px;padding:4px;gap:4px;font-size:16px}
#game[data-viewport=phone-compact] #hexLegend .hex-rule img{width:24px;height:24px}
#game[data-viewport=phone-compact] #roomTitle{position:absolute;left:8px;top:4px;width:100px;margin:0;font-size:10px;white-space:nowrap;overflow:hidden}
#bootScreen{position:absolute;z-index:100;background:#f3e6cc url('assets/A-BG-ST1-PORTRAIT.png') center/cover;isolation:isolate}
#game[data-viewport=desktop] #bootScreen{background-image:url('assets/A-BG-ST1-DESKTOP.png')}
#bootScreen::before{content:'';position:absolute;inset:0;background:#f3e6cc80;z-index:-1}
#bootScreen[hidden]{display:none}
#bootText{margin:0;text-align:center;font-size:15px}
#bootLogo{object-fit:contain}
#retryBtn[data-layout-id]{transform:none;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;min-height:0;isolation:isolate}
#layoutInspector{position:absolute;left:2px;bottom:2px;z-index:90;max-width:100%}
#layoutInspector[hidden]{display:none}
#layoutInspector button{font-size:11px;min-height:24px}
#layoutOutput:not(:empty){position:absolute;bottom:28px;left:0;width:370px;height:220px;overflow:auto;background:#fff;color:#111;font-size:10px;user-select:text}
#roomBackground{object-fit:cover;pointer-events:none}
#game[data-viewport] #hexLegend .hex-rule,#game[data-viewport] #roomTitle,#game[data-viewport] #tools .tool span{color:#fff8e9;text-shadow:0 1px 2px #2b1a22,0 -1px 2px #2b1a22}
#purifyPrompt[hidden]{display:none}
#purifyPrompt{z-index:25!important}
#purifyText{margin:0;font-size:14px;white-space:nowrap;line-height:22px}
#purifyPrompt button{margin:0;padding:0;min-height:0;border:0;background:none;box-shadow:none;color:#4a2e2a;font-weight:800}
#purifyPrompt button span{font-size:14px;line-height:24px}
#game[data-viewport] #roomGoals{position:absolute;left:8px;right:8px;top:104px;z-index:12;display:flex;align-items:center;gap:4px;padding:1px 4px;border-radius:5px;background:#f3e6cc;color:#4a2e2a;font-size:11px;line-height:12px;min-height:28px;text-align:start}
#game[data-viewport=phone-compact] #roomGoals{top:56px}
#game[data-viewport=desktop] #roomGoals{left:84px;right:auto;top:598px;width:270px;min-height:0;flex-wrap:wrap;padding:8px 10px;font-size:14px;line-height:1.3}
#game[data-viewport] #roomGoals[hidden],#game:has(#overlay:not([hidden])) #roomGoals{display:none}
#goalProgress{display:flex;align-items:center;flex-wrap:wrap;column-gap:6px;flex:1;font-weight:800}
#goalProgress span{white-space:nowrap}
#goalHelp{padding:2px 4px;min-height:24px;background:none;border:0;color:inherit;text-decoration:underline;text-underline-offset:2px;font-weight:800;font-size:inherit}
#roomFinish{min-height:24px;padding:0 7px;white-space:nowrap;font-size:inherit;box-shadow:0 1px #553d6e}
#game[data-viewport=desktop] #roomFinish{min-height:42px}
#goalInstructions,#autoPurifyStatus{position:absolute;top:100%;inset-inline:0;margin:3px 0 0;padding:8px 10px;border:1px solid #b8945f;border-radius:6px;background:#f3e6cc;font-size:13px;line-height:1.4}
#autoPurifyStatus{color:#87382d;font-weight:800;pointer-events:none}
#goalInstructions:not([hidden])~#autoPurifyStatus{top:calc(100% + 64px)}
#game[data-viewport=desktop] :is(#goalInstructions,#autoPurifyStatus){top:auto;bottom:100%;margin:0 0 3px}
#game[data-viewport=desktop] #goalInstructions:not([hidden])~#autoPurifyStatus{top:auto;bottom:calc(100% + 70px)}
#game[data-viewport] #roomGoals:dir(rtl){direction:rtl}
.formal-screen [data-layout-id=btn-purify-mode-label]{font-size:15px}
#board,#board canvas{-webkit-touch-callout:none;touch-action:none}
#game:has(#bootScreen:not([hidden]))>#hud,#game:has(#bootScreen:not([hidden]))>#menuBtn,#game:has(#bootScreen:not([hidden]))>#tools{visibility:hidden}
.overlay[data-screen]{padding:0}
.overlay[data-screen]{background:rgba(43,26,34,.78)}
.overlay[data-screen] .panel{isolation:isolate}
#game[data-viewport=desktop] .overlay[data-screen]{background:rgba(28,16,22,.72)}
.overlay[data-screen=title]{background:none}
.panel.formal-screen{position:absolute;left:50%;top:50%;max-width:none;max-height:none;overflow:visible;border:0;border-radius:0;padding:0;margin:0;background:none;box-shadow:none;transform-origin:center;direction:ltr;text-align:center}
.formal-screen .screen-object{margin:0;padding:0;border:0;border-radius:0;min-width:0;min-height:0;background:none;box-shadow:none;object-fit:contain;color:#4a2e2a}
.formal-screen .screen-object[hidden]{display:none}
.formal-screen .screen-text{display:flex;align-items:center;justify-content:center;line-height:1.25;white-space:normal;overflow-wrap:anywhere;pointer-events:none}
.formal-screen .text-title{font-family:Fraunces,Georgia,serif;font-size:24px;font-weight:700}
.formal-screen .text-button{font-size:18px;font-weight:800}
.formal-screen .text-label{font-size:14px;font-weight:700}
.formal-screen .text-small{font-size:12px;line-height:1.3}
.formal-screen .text-hud-number{font-size:18px;font-weight:800}
.formal-screen [data-layout-id=tagline]{color:#fff8e9;text-shadow:0 1px 2px #2b1a22}
.formal-screen [data-layout-id=acc-pick]{color:#fff8e9;text-shadow:0 1px 2px #2b1a22}
.formal-screen[data-screen=map] [data-layout-id^=storey-name-]{font-size:11px;white-space:nowrap}
.formal-screen[data-screen=map] [data-layout-id^=storey-name-],.formal-screen[data-screen=map] [data-layout-id^=storey-stars-]{color:#fff8e9;font-weight:800;text-shadow:0 1px 2px #2b1a22,0 -1px 2px #2b1a22,0 0 4px #2b1a22}
#game[data-viewport]:has(#overlay[data-screen=map]:not([hidden])) #toast:not(:empty){left:50%;right:auto;top:10%;width:max-content;max-width:90%;height:auto;transform:translateX(-50%);padding:6px 12px;border-radius:6px;background:#f3e6cc;color:#4a2e2a;text-align:center;white-space:normal;z-index:41;pointer-events:none}
.formal-screen .text-body{font-size:16px;line-height:1.5;text-align:left}
.formal-screen [data-layout-id=letter-body]{align-items:flex-start;white-space:pre-line}
.formal-screen .screen-control{cursor:pointer}
.formal-screen .screen-control>img{pointer-events:none}
.formal-screen .screen-control:focus-visible{outline:3px solid #5b3f7a;outline-offset:3px}
.formal-screen .screen-control:disabled{cursor:default}
.formal-screen .screen-control[aria-pressed=true]{outline:3px solid #5b3f7a;outline-offset:-5px}
.hex-rule.codex-new::after{content:'•';color:#a8352b;font-size:22px;line-height:1;position:absolute;margin-left:4px;margin-top:-18px}
.hex-rule{position:relative}.hex-newdot{position:absolute;right:-2px;top:-2px;width:14px;height:14px;object-fit:contain}
.formal-screen [data-layout-id^=offer-][disabled]{opacity:.65}
.formal-screen [data-layout-id^=offer-][aria-pressed=true][disabled]{opacity:1}
#qaTools{position:absolute;left:4px;top:780px;z-index:35;display:flex;gap:4px}
#qaTools[hidden]{display:none}
#qaTools button{font-size:11px;min-height:26px;padding:3px 8px}
#game[data-viewport=desktop] #qaTools{top:auto;bottom:30px}
#game:has(#overlay[data-screen=title]:not([hidden]))>#hud,#game:has(#overlay[data-screen=title]:not([hidden]))>#menuBtn,#game:has(#overlay[data-screen=title]:not([hidden]))>#tools,#game:has(#overlay[data-screen=title]:not([hidden]))>#hexLegend{visibility:hidden}
#game:has(#overlay[data-screen=story]:not([hidden]))>#hud,#game:has(#overlay[data-screen=storey]:not([hidden]))>#hud,#game:has(#overlay[data-screen=story]:not([hidden]))>#tools,#game:has(#overlay[data-screen=storey]:not([hidden]))>#tools,#game:has(#overlay[data-screen=story]:not([hidden]))>#menuBtn,#game:has(#overlay[data-screen=storey]:not([hidden]))>#menuBtn,#game:has(#overlay[data-screen=story]:not([hidden]))>#roomTitle,#game:has(#overlay[data-screen=storey]:not([hidden]))>#roomTitle,#game:has(#overlay[data-screen=story]:not([hidden]))>#hexLegend,#game:has(#overlay[data-screen=storey]:not([hidden]))>#hexLegend{visibility:hidden}

@font-face {
  font-family: Nunito;
  src: url('fonts/nunito-cyrillic.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('fonts/noto-sans-arabic.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
html[lang=ar], html[lang=ar] body,
html[lang=ar] .formal-screen .text-title, html[lang=ar] #roomTitle {
  font-family: 'Noto Sans Arabic', Nunito, system-ui, sans-serif;
}
html[lang=ru] .formal-screen .text-title, html[lang=ru] #roomTitle {
  font-family: Nunito, system-ui, sans-serif;
}
#game[data-viewport], .panel.formal-screen { direction: inherit; }
#boardWrap, #board, #board canvas, #hud .stat b, .hex-rule span,
.formal-screen [data-layout-id=codex-page], .volume-control output { direction: ltr; }
#roomTitle[data-layout-id], #hud .stat b, .formal-screen .text-body { text-align: start; }
#game[data-viewport] #roomTitle { white-space: normal; overflow: visible; }
.formal-screen .screen-control.settings-toggle[aria-pressed=true]:not(:focus-visible) { outline: none; }
.formal-screen .screen-control.settings-toggle:focus-visible { outline-offset: 3px; }
.formal-screen [data-layout-id=set-lang] .control-label { display: block; padding-inline: 12px 27px; }
.formal-screen [data-layout-id^=set-label-], .formal-screen [data-layout-id=set-lang-label],
.formal-screen [data-layout-id=letter-body], .formal-screen [data-layout-id=codex-entry-body] { justify-content: start; }
:dir(rtl) #game[data-viewport=desktop] #hexLegend { left: auto; right: 110px; }
:dir(rtl) #game[data-viewport=phone-compact] #roomTitle { left: auto; right: 8px; }
:dir(rtl) #game[data-viewport=phone-compact] #toast { left: 8px; right: 120px; text-align: start; }
:dir(rtl) #game[data-viewport] .guide-bubble { left: auto; right: 82px; }
:dir(rtl) #game[data-viewport=phone] .guide-bubble { right: 50px; }
:dir(rtl) #game[data-viewport=phone-compact] .guide-bubble { right: 38px; }
:dir(rtl) .guide-bubble img { left: auto; right: -72px; }
:dir(rtl) #game[data-viewport] #guideSkip { right: auto; left: 8px; }
:dir(rtl) .formal-screen [data-layout-id=set-lang] > .asset-surface,
:dir(rtl) .formal-screen[data-screen=map] [data-layout-id=bg],
:dir(rtl) .formal-screen [data-texture=A-IC-BACK],
:dir(rtl) .formal-screen [data-layout-id=codex-page-prev-t],
:dir(rtl) .formal-screen [data-layout-id=codex-page-next-t] { transform: scaleX(-1); }
.formal-screen [data-layout-id=tagline] { flex-direction: column; }
:is(html[lang=zh], html[lang=tw]) .formal-screen [data-layout-id=tagline] { height: 38px !important; }
#tools .tool span { line-height: 16px; }
#game[data-viewport=desktop] #tools .tool span { top: calc(100% - 10px); }
.formal-screen [data-layout-id^=set-label-], .formal-screen [data-layout-id=set-lang-label] {
  font-size: 14px;
  line-height: 1.1;
}
.formal-screen :is([data-layout-id=btn-replay-guide-label], [data-layout-id=btn-restart-yes-label]) {
  font-size: 16px;
  line-height: 1.15;
}
.formal-screen :is([data-layout-id=codex-entry-title], [data-layout-id=letter-title]) {
  font-size: 19px;
  line-height: 1.1;
}
.formal-screen [data-layout-id=codex-entry-title] { font-size: 16px; }
.formal-screen [data-layout-id=collapse-title] { font-size: 20px; }
.formal-screen [data-layout-id^=codex-card-][data-layout-id$=-t] {
  font-size: 12px;
  line-height: 1.15;
}
.formal-screen[data-screen=map] [data-layout-id^=storey-name-] {
  white-space: nowrap;
  line-height: 1.1;
}
.formal-screen :is([data-layout-id=result-glimmer], [data-layout-id=collapse-body]) {
  font-size: 15px;
  line-height: 1.3;
}
.formal-screen [data-layout-id^=star-label-] {
  font-size: 11px;
  line-height: 1.15;
}
/* Letter art ships on a cream square; multiply melts that square into the parchment. */
.formal-screen [data-layout-id=letter-art] { mix-blend-mode: multiply; }
#panel:focus { outline: none; }
