/* Approved painted world-map interface. */
body{background:#fbf5e7 url('assets/ui-preview/manuscript-background.webp') center top/100% auto repeat-y}
.gamebar{background:#fcf7eac9;border-bottom-color:#cdb78d}
.game-shell{max-width:1600px;padding-inline:clamp(20px,4vw,68px)}
.course-picker{background:#fcf8eced;border-color:#d6c7a8}
.wm-key-counter{background:#fff9e8;border:1px solid #bea16a;box-shadow:0 2px 8px #82673812;gap:12px}
.wm-key-counter .wm-painted-key{width:66px;height:66px;stroke:none;stroke-width:0;flex-shrink:0}
.wm-player.wm-player-illustrated{padding:0;border:0;border-radius:0;background:none;display:flex;flex-direction:column;gap:10px}
.wm-portrait-stage{position:relative;isolation:isolate;width:100%;aspect-ratio:2/3;flex:1 1 auto;min-height:290px;max-height:450px}
.wm-portrait-forest{position:absolute;inset:0;z-index:0;background:url('assets/ui-preview/portrait-forest.webp') center 68%/cover;clip-path:polygon(5% 25%,5% 16%,12% 11%,22% 8%,32% 5%,42% 4%,50% 2%,58% 4%,68% 5%,78% 8%,88% 11%,95% 16%,95% 90%,5% 90%)}
.wm-portrait-frame{position:absolute;inset:0;width:100%;height:100%;z-index:3;pointer-events:none}
.wm-portrait-stage>.wm-portrait-frame{overflow:visible}
.wm-portrait-stage h2{position:absolute;top:9.7%;left:15%;right:15%;z-index:4;margin:0;font-size:clamp(16px,1.5vw,22px);text-align:center;line-height:1.4;color:#5c381d}
.wm-player-illustrated .wm-player-art{position:absolute;left:10%;right:10%;top:20%;bottom:24.5%;width:auto;height:auto;margin:0;z-index:2;filter:none}
.wm-player-illustrated .wm-player-art>img,.wm-player-illustrated .wm-player-art>svg{width:100%;height:100%;object-fit:contain;object-position:center bottom}
.wm-player-illustrated .wm-player-controls{padding:10px;background:#fff9ecee;border:1px solid #d8c9a9;border-radius:10px;grid-template-columns:44px minmax(0,1fr);gap:7px}
.wm-player-illustrated .wm-player-controls label{font-size:12px}
.wm-player-illustrated .wm-player-controls select{min-height:34px;padding:5px;font-size:13px}
.wm-player-illustrated .wm-player-ability{grid-column:1/-1;min-height:0;font-size:12px;line-height:1.5}
.wm-player-illustrated .wm-character-help,.wm-player-illustrated .wm-equip-note{display:none}
.wm-region-card{background:#fffcf2ed}.wm-collection{background:#f5eddeeb}
@media(max-width:650px){.wm-player.wm-player-illustrated{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:12px}.wm-portrait-stage{min-height:245px;max-height:none}.wm-player-illustrated .wm-player-controls{display:grid;grid-column:2;grid-template-columns:1fr}.wm-player-illustrated .wm-player-ability{grid-column:auto}.wm-portrait-stage h2{font-size:15px}.wm-portrait-caption{font-size:10px}.game-shell{padding-inline:12px}.wm-key-counter .wm-painted-key{width:52px;height:52px}}

/* Text stays inside the painted plaques and ordinary controls. */
.wm-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px}
.wm-heading>div{min-width:0}.wm-heading h1,.wm-heading p{max-width:100%;overflow-wrap:anywhere;word-break:keep-all}
.wm-key-counter{min-width:0}.wm-key-counter>div{min-width:0}.wm-key-counter small{white-space:normal;overflow-wrap:anywhere;line-height:1.5}.wm-key-counter strong{white-space:nowrap}
.wm-portrait-stage{container-type:inline-size}
.wm-portrait-stage h2{top:83%;height:12%;left:12%;right:12%;display:flex;align-items:center;justify-content:center;font-size:clamp(18px,9cqw,27px);font-weight:850;color:#4d321c;line-height:1.2;white-space:nowrap;margin:0;padding:0;min-width:0;box-sizing:border-box}
.wm-player-illustrated .wm-player-controls{grid-template-columns:minmax(0,1fr);gap:5px;padding:11px;min-width:0}
.wm-player-illustrated .wm-player-controls label{font-size:12px;line-height:1.5;padding:0;margin:0}
.wm-player-illustrated .wm-player-controls select{width:100%;max-width:100%;min-width:0;height:36px;min-height:36px;box-sizing:border-box;font-size:12px;padding:6px 24px 6px 7px;margin:0;color:#574730}
.wm-player-illustrated .wm-player-controls select+label{margin-top:6px}
.wm-player-illustrated .wm-player-ability{grid-column:1;line-height:1.6;font-size:12px;overflow-wrap:anywhere;word-break:keep-all;min-height:0;max-width:100%;margin:5px 0 0}
.course-tabs>button,.wm-key,.wm-region-copy{min-width:0}.course-tabs strong,.course-tabs span,.wm-key strong,.wm-key small{white-space:normal;overflow-wrap:anywhere;word-break:keep-all;line-height:1.5}
.wm-region-card{min-width:0;height:auto;align-items:center}.wm-region-top{gap:5px;flex-wrap:wrap}.wm-region-top strong{white-space:normal;word-break:keep-all;overflow-wrap:anywhere;line-height:1.5}.wm-region-status{flex-wrap:wrap;gap:4px;line-height:1.5}.wm-region-status span{overflow-wrap:anywhere;word-break:keep-all}
.wm-map-wrap,.wm-map{background:transparent;border:0;border-radius:0;box-shadow:none}
.wm-map>img{border-radius:0;mask-image:linear-gradient(to right,transparent,#000 3%,#000 97%,transparent),linear-gradient(to bottom,transparent,#000 3%,#000 97%,transparent);mask-composite:intersect;-webkit-mask-image:linear-gradient(to right,transparent,#000 3%,#000 97%,transparent),linear-gradient(to bottom,transparent,#000 3%,#000 97%,transparent);-webkit-mask-composite:source-in}
@media(max-width:760px){.wm-heading{grid-template-columns:minmax(0,1fr)}.wm-header-actions{justify-self:end;max-width:100%;width:auto}.wm-region-list{grid-template-columns:repeat(2,minmax(0,1fr))}.wm-region-mark.painted-emblem{width:42px;flex-basis:42px;height:42px}.wm-region-top{display:block}.wm-region-top b{display:block;margin-top:2px}.wm-region-status{display:block}.wm-region-status>span{display:block}.course-tabs button{padding:10px 7px}.course-tabs button strong{font-size:12px}.course-meta{overflow-wrap:anywhere}}
@media(max-width:560px){.wm-player.wm-player-illustrated{display:flex;flex-direction:column;align-items:stretch;max-width:100%;width:100%}.wm-portrait-stage{width:min(230px,100%);height:345px;min-height:345px;max-height:345px;flex:none;align-self:center}.wm-player-illustrated .wm-player-controls{display:grid;grid-template-columns:minmax(0,1fr);width:100%;max-width:100%;grid-column:auto}.wm-layout{grid-template-columns:minmax(0,1fr)}.wm-map-wrap{grid-column:1}.wm-player-illustrated .wm-player-controls select{font-size:14px;height:40px}.wm-heading h1{font-size:21px}.gamebar{align-items:flex-start}.gamebar small{margin-left:0;max-width:100%;white-space:normal}.wm-collection{padding:13px}.wm-collection>header{display:block}.wm-key-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.wm-key small{font-size:11px}.wm-region-card{padding:10px 7px;gap:6px}}
/* Dark ink remains readable on every light home surface. */
.gamebar,.gamebar small,.gamebar .chapter-label,.gamebar .brand{color:#54422f}
.gamebar .menu-button{color:#59452f;background:#fff9eb;border-color:#c5b18b}
.course-picker,.course-meta,.course-meta span{color:#62513c}
.course-tabs button{background:#fffaf0;color:#59452f;border-color:#d1bea0}
.course-tabs button[aria-pressed=true]{background:#e9dbb7;color:#49351f;border-color:#9d8050;box-shadow:inset 0 0 0 1px #ad9160}
.course-tabs button strong,.course-tabs button span{color:inherit}
.world-atlas{color:#584630}
.wm-heading h1,.wm-panel-title h2,.wm-collection h2,.wm-key-counter strong{color:#54412c}
.wm-heading p,.wm-eyebrow,.wm-key-counter small,.wm-key-counter strong span,.wm-map-caption,.wm-panel-title>span,.wm-pin-copy small,.wm-region-status,.wm-region-status>span:last-child,.wm-current,.wm-tree-note,.wm-key-note{color:#6b583f}
.wm-region-top strong,.wm-region-top b,.wm-current strong,.wm-current button{color:#59442c}
.wm-key,.wm-key.is-owned,.wm-key small,.wm-key>span,.wm-key.is-owned>span{color:#665239}
.wm-key:disabled{opacity:1}
.wm-player-illustrated .wm-player-controls label,.wm-player-illustrated .wm-player-ability,.wm-player-illustrated .wm-player-ability b{color:#59452f}
/* Let the card determine row height instead of overflowing a short desktop. */
@media(min-width:1024px) and (min-height:600px){.wm-layout{grid-template-rows:minmax(var(--atlas-height),auto) auto}.wm-player.wm-player-illustrated{align-self:start}.wm-portrait-stage{flex:none;height:375px;min-height:375px}}


/* All eight map portraits share the stone dais baseline at 75.5%. */
.wm-player-illustrated .wm-player-art>.wm-standing-portrait{display:block;overflow:hidden}
.wm-portrait-stage::after{content:"";position:absolute;left:28%;right:28%;top:74.4%;height:2.4%;z-index:1;pointer-events:none;background:radial-gradient(ellipse,#4a44305c 0%,#4a443025 44%,transparent 72%)}

/* Compact course controls beside the title; the map carries the story invitation. */
.gamebar{height:auto;min-height:64px;padding:8px clamp(12px,2vw,28px);gap:12px;flex-wrap:wrap;align-items:center}
.brand-modes{display:flex;align-items:center;gap:14px;flex-wrap:wrap;min-width:0}
.gamebar .brand{white-space:nowrap;line-height:1.3}
.gamebar #coursePicker{display:block;margin:0;padding:3px;border:1px solid #cbb78c;border-radius:12px;background:#eee3ca;flex:0 1 auto;min-width:0}
.gamebar #coursePicker .course-tabs{display:flex;gap:2px}
.gamebar #coursePicker button{min-height:38px;padding:7px 11px;border:1px solid transparent;border-radius:8px;background:transparent;color:#685034;font-size:.875rem;font-weight:750;line-height:1.4;white-space:nowrap;box-shadow:none;text-align:center}
.gamebar #coursePicker button[aria-pressed=true]{color:#423018;background:linear-gradient(#fff7d9,#e7c983);border-color:#b79452;box-shadow:0 2px 4px #75531e22,inset 0 1px #fffef2}
.gamebar #coursePicker button:hover:not(:disabled){background:#fff5d9;border-color:#b79452}
.gamebar nav{width:auto;flex-wrap:wrap;overflow:visible;align-items:center;margin-left:auto;gap:6px;order:0}
.gamebar .menu-button{min-height:40px;font-size:.875rem;padding:8px 12px;white-space:nowrap}
.gamebar .music-controls{margin-left:0}
.wm-header-actions{flex-wrap:wrap;justify-content:flex-end;max-width:100%}
.wm-synopsis{position:relative;isolation:isolate;display:grid;justify-items:center;gap:3px;min-width:226px;max-width:100%;padding:5px 8px;border:solid transparent;border-width:15px 23px;background:#fff4d8;border-image:url('assets/ending/caption-scroll.webp') 205 230 fill / 19px 25px / 0 stretch;color:#54351c;filter:drop-shadow(0 3px 4px #73512635);transition:transform .2s,filter .2s;overflow:hidden;line-height:1.5}
.wm-synopsis::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(115deg,transparent 25%,#fffbe990 48%,transparent 70%);transform:translateX(-130%);animation:chronicle-glimmer 7s ease-in-out infinite}
.wm-synopsis-kicker{font-size:.75rem;font-weight:650;color:#71613f}
.wm-synopsis strong{font-size:1.0625rem;font-weight:850;letter-spacing:.015em;color:#513217}
.wm-synopsis-invite{font-size:.75rem;font-weight:750;color:#516844}
.wm-synopsis:hover:not(:disabled),.wm-synopsis:focus-visible{transform:translateY(-2px);filter:drop-shadow(0 5px 8px #a1723f66)}
.wm-synopsis:focus-visible{outline:3px solid #688659;outline-offset:3px}
@keyframes chronicle-glimmer{0%,70%{transform:translateX(-130%)}94%,100%{transform:translateX(130%)}}
@media(max-width:1100px){.wm-heading{grid-template-columns:minmax(0,1fr)}.wm-header-actions{justify-self:stretch;justify-content:space-between}.wm-heading p{margin-bottom:0}}
@media(max-width:760px){.gamebar{gap:8px;padding:9px 12px}.brand-modes{flex:1 1 100%;gap:10px}.gamebar .brand{font-size:1.125rem}.gamebar #coursePicker button{padding:7px 9px;min-height:40px}.gamebar nav{margin-left:0;flex:1 1 auto}.gamebar .music-controls{margin-left:auto}.wm-header-actions{gap:10px}.wm-synopsis{min-width:210px;flex:1 1 210px}.wm-key-counter{flex:0 1 auto;margin-left:auto}.wm-synopsis strong{font-size:1.0625rem}}
@media(prefers-reduced-motion:reduce){.wm-synopsis{transition:none}.wm-synopsis::after{animation:none;display:none}.wm-synopsis:hover:not(:disabled),.wm-synopsis:focus-visible{transform:none}}
