:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#23304d;background:#eef2fb;font-synthesis:none;overflow-wrap:anywhere;--paper:#fffdf7;--ink:#263d35;--blue:#235447;--soft:#edf0e6;--line:#d5d9ca;--terminal:#111f1c;--world:#c5dcc9;--reading-size:16px}*{box-sizing:border-box}body{margin:0;background:#e9ece3}button,input,select{font:inherit}button,a,input,select,summary{-webkit-tap-highlight-color:transparent}button{min-height:44px;border:0;border-radius:12px;padding:10px 14px;font-weight:650;background:var(--soft);color:var(--blue);cursor:pointer}button:disabled{cursor:default;opacity:.55}button:hover:not(:disabled){filter:brightness(.96)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #9a6af0;outline-offset:3px}a{color:var(--blue)}h1,h2,h3,p{margin:0}h1{font-size:25px;line-height:1.15;letter-spacing:-.5px}h2{font-size:20px}h3{font-size:16px}p{line-height:1.6}ul{margin:0;padding-left:22px}small{font-size:12px}.app{width:100%;max-width:560px;min-height:100dvh;margin:0 auto;padding:18px 16px 20px}.brand{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px}.brand a{display:flex;align-items:center;gap:10px;color:var(--ink);font-weight:780;text-decoration:none;font-size:18px}.brand a small{display:block;font-weight:450;color:#56675c;margin-top:2px}.brand-mark{display:grid;place-items:center;width:40px;height:40px;border-radius:13px;background:#375dd4;color:white;font-family:Georgia,serif;font-size:25px}.quiet{background:transparent;color:#56675c;font-size:12px;padding:8px;min-height:44px}.card{background:var(--paper);border:1px solid var(--line);border-radius:21px;padding:20px;margin-bottom:14px;box-shadow:0 8px 24px #00000008}.eyebrow{display:block;font-size:11px;font-weight:800;letter-spacing:1px;text-transform:uppercase;color:#56675c;margin-bottom:7px}.muted{color:#56675c;font-size:14px}.stack{display:grid;gap:15px}.inline{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.primary{background:var(--blue);color:white}.danger-button{background:#ffe8ec;color:#aa3b52}.notice{padding:12px 15px;background:#fff0d5;border:1px solid #e7d2a4;border-radius:13px;font-size:14px;line-height:1.5;margin-bottom:15px}.notice.error{background:#ffecef;border-color:#e9b9c2;color:#96394c}.notice:empty{display:none}.loading{text-align:center;padding:35px 0;color:#56675c}.field{display:grid;gap:7px;font-size:14px;font-weight:650}.field input,.field select{width:100%;height:48px;border:1px solid #cbd5e9;border-radius:11px;padding:10px 12px;background:#fff;color:var(--ink)}.field input:invalid:not(:placeholder-shown){border-color:#cf7188}.tabs{display:flex;gap:7px;margin:14px 0}.tabs button{flex:1}.tabs button[aria-pressed=true]{background:var(--blue);color:white}.form-footer{font-size:13px;color:#56675c;line-height:1.5}.room-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.place-label{font-size:12px;color:#56675c;margin-top:7px}.ambient{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}.pill{font-size:12px;border-radius:20px;background:#eff3fa;color:#51627d;padding:5px 10px}.reading{border-radius:19px;background:var(--terminal);color:var(--world);padding:21px 19px;margin:14px 0;position:relative;box-shadow:inset 0 0 0 1px #9bc5a724,0 9px 25px #0a1d1612;font-family:ui-monospace,"Cascadia Code","DejaVu Sans Mono",monospace;font-size:var(--reading-size);line-height:1.75;overflow-wrap:anywhere}.reading h2{font-family:inherit;font-size:13px;letter-spacing:.8px;color:#e1f8c0;font-weight:600;margin-bottom:17px;padding-bottom:13px;border-bottom:1px solid #91ad9433}.event{margin:0 0 20px;white-space:pre-wrap;text-shadow:0 0 6px #b9e2bc10}.event:last-child{margin-bottom:0}.event-kind{display:block;font-size:10px;font-weight:600;letter-spacing:.6px;color:#94a49a;line-height:1.4;margin-bottom:6px}.event-action{color:#92d9e5}.event-location{color:#d7f6a5}.event-npc,.event-dialogue{color:#d8daf5}.event-discovery,.event-reward{color:#f0d291}.event-danger,.event-error{color:#f0afb7}.event-combat,.event-damage{color:#efbb94}.event-info{color:#a4bba9}.reading-footer{font-size:12px;color:#9eafa3;border-top:1px solid #91ad942b;padding-top:13px;margin-top:17px}.reading-footer span{display:inline-block;width:6px;height:12px;background:#a8cf9b;vertical-align:middle;margin-left:5px;animation:pulse 1.8s steps(2) infinite}@keyframes pulse{50%{opacity:.15}}.choices{display:grid;gap:9px}.choices>button{text-align:left;display:flex;justify-content:space-between;gap:10px;align-items:center;white-space:normal;line-height:1.4}.action-reason{font-size:11px;display:block;font-weight:450}.section-label{font-size:12px;font-weight:750;color:#64708a;margin:18px 0 9px}.more{margin-top:11px}.more summary,.history summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:650;color:var(--blue);font-size:14px}.more[open] summary,.history[open] summary{margin-bottom:10px}.exits{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.exits button{text-align:left;font-size:13px}.npc{padding:14px 0;border-top:1px solid var(--line)}.npc p{font-size:14px;color:#56675c;margin-top:4px}.topics{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.topics button{font-size:12px}.history{background:#fff;border:1px solid var(--line);border-radius:18px;padding:6px 15px;margin:14px 0}.history .reading{margin:4px 0 10px;max-height:65dvh;overflow:auto;padding:17px 13px;font-size:14px}.history .event{padding-bottom:14px;border-bottom:1px solid #91ad941e}.tile{padding:15px 0;border-bottom:1px solid var(--line)}.tile:last-child{border:0}.tile p{font-size:14px;color:#56675c;margin-top:5px}.tile button{margin-top:10px;font-size:13px}.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}.stat{background:#f2f5fc;border-radius:13px;padding:11px}.stat small{display:block;color:#56675c}.stat strong{font-size:19px;display:block;margin-top:3px}.place-list button{width:100%;text-align:left;margin-top:8px;display:flex;justify-content:space-between;gap:9px}.place-list button[aria-pressed=true]{background:#dbe7fb}.selection{margin-top:15px;border-radius:13px;background:#f2f5fc;padding:14px}.preferences label{display:flex;align-items:center;gap:10px;min-height:46px;font-size:14px}.preferences input{width:20px;height:20px;accent-color:var(--blue)}#navigation{position:sticky;bottom:8px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;background:#fffefbee;backdrop-filter:blur(12px);border:1px solid var(--line);border-radius:18px;padding:6px;margin-top:20px;box-shadow:0 7px 20px #283b5521;z-index:2}#navigation button{padding:8px 2px;border-radius:12px;font-size:11px;color:#56675c;background:transparent;line-height:1.4}#navigation button[aria-current=page]{background:#e7edff;color:var(--blue)}#navigation button>span{display:block;font-size:11px;margin:0}#navigation button>span>span{display:block;font-size:17px;margin-bottom:3px}.app-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:#7c879e;margin-top:16px}.high-contrast{--world:#e2f3e6;--terminal:#071710}.large-reading{--reading-size:18px}.reduced-motion .reading-footer span{animation:none}@media(prefers-reduced-motion:reduce){.reading-footer span{animation:none}*{scroll-behavior:auto!important}}@media(max-width:350px){.app{padding:12px 10px 18px}.card{padding:17px 14px}.reading{padding:18px 14px}.brand a{font-size:16px}.brand a small{font-size:11px}.brand-mark{width:35px;height:35px}.exits{grid-template-columns:1fr}.stats{gap:7px}.brand{gap:5px}}[hidden]{display:none!important}

.command-entry{margin-top:18px;padding-top:17px;border-top:1px solid var(--line)}

.local-messages{padding-left:1.3rem;max-height:18rem;overflow:auto;overflow-wrap:anywhere}.local-messages li{margin:.6rem 0}.local-people h2{font-size:1.05rem}

.reading-tools{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}.reading-tools button{background:#243c34;color:#e2f3e6;min-height:44px;font:600 13px system-ui,sans-serif;border:1px solid #60786b}.reading-tools button[aria-pressed=true]{background:#e2f3e6;color:#11251b}.room-context .section-label{margin-top:14px}.event{letter-spacing:.01em;text-shadow:none}.reading-footer span{animation:none}

.terminal-feed{max-height:55dvh;min-height:180px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#60786b transparent;padding-right:6px;overflow-anchor:none}.terminal-feed .event-location{border-top:1px solid #91ad9433;padding-top:16px;margin-top:14px;font-weight:650}.terminal-feed .event-location:first-child{border-top:0;margin-top:0;padding-top:0}.screen-reader-text{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.terminal-feed:focus-visible{outline:2px solid #c5dcc9;outline-offset:4px}.reading-footer span{animation:pulse 2.5s steps(2) infinite}.reduced-motion .reading-footer span{animation:none}@media(prefers-reduced-motion:reduce){.reading-footer span{animation:none}}

/* Stable semantic families from the prompt; labels retain meaning without color. */
.reading{--world:#b3d6b7;--place:#b5ed7a;--action:#80d8f0;--discovery:#f2ca75;--danger:#f59da4;--combat:#ffb37b;--secondary:#9caf9f;--voice:#d6c4ed;color:var(--world)}
.reading .event-world{color:var(--world)}
.reading .event-location{color:var(--place)}
.reading .event-action{color:var(--action)}
.reading .event-trace,.reading .event-discovery,.reading .event-reward{color:var(--discovery)}
.reading .event-danger,.reading .event-error{color:var(--danger)}
.reading .event-combat,.reading .event-damage{color:var(--combat)}
.reading .event-info,.reading .event-memory{color:var(--secondary)}
.reading .event-npc,.reading .event-dialogue,.reading .event-chat{color:var(--voice)}
.reading .event-kind{color:inherit;font-size:11px;font-weight:750;letter-spacing:.5px;margin-bottom:5px}
.reading .event-action,.reading .event-trace,.reading .event-discovery,.reading .event-reward,.reading .event-danger,.reading .event-error,.reading .event-combat,.reading .event-damage,.reading .event-npc,.reading .event-dialogue,.reading .event-chat{border-left:2px solid currentColor;padding-left:12px}
.high-contrast .reading{--world:#d6ebd8;--secondary:#b9c9bb}

/* Local orientation only: no invented global coordinates or terrain. */
.map-location{font-size:18px;font-weight:750;line-height:1.3}.map-compass{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:auto auto auto;gap:7px;margin-top:8px}.map-direction{min-width:0;min-height:84px;border-radius:12px;padding:9px 6px;text-align:center;display:flex;align-items:center;justify-content:center;flex-direction:column;line-height:1.35;font-size:12px;overflow-wrap:anywhere}.map-direction small{display:block;font-size:11px;font-weight:700;margin-bottom:5px}.map-direction strong{display:block;font-size:12px}.map-norte{grid-column:2;grid-row:1}.map-oeste{grid-column:1;grid-row:2}.map-este{grid-column:3;grid-row:2}.map-sur{grid-column:2;grid-row:3}.map-you{grid-column:2;grid-row:2;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;min-width:0;padding:10px 5px;background:var(--blue);color:white;border-radius:13px;text-align:center;font-size:12px;line-height:1.35}.map-you small{font-size:10px}.map-closed{background:#f2f4f8;color:#596780;border:1px dashed #c9d3e3;font-weight:450}.map-local-links{display:grid;gap:8px}.map-note{padding:11px 13px;border-radius:12px;background:#fff3dd;color:#6e5220;font-size:13px;line-height:1.5}.map-arrived{padding:11px 13px;border-radius:12px;background:#e9f4ec;color:#285f3d;font-size:14px}.map-itinerary{margin:0;padding-left:25px;display:grid;gap:13px}.map-itinerary li{padding-left:4px;line-height:1.4;font-size:14px}.map-itinerary small{display:block;color:#56675c;font-size:11px;margin-bottom:3px}.map-itinerary span{display:block}.map-connections{font-size:14px;line-height:1.6}.map-connections li{margin:6px 0}@media(max-width:350px){.map-compass{gap:5px}.map-direction{min-height:76px;font-size:11px;padding:8px 4px}.map-direction strong{font-size:11px}.map-you{padding:8px 4px;font-size:11px}}

.map-planner .field,.map-planner select{min-width:0;max-width:100%}

.room-top>div{min-width:0;flex:1}.map-shortcut{flex-shrink:0;min-height:44px;font-size:12px;padding:9px 10px}

/* Stable touch controls: closed directions retain their places. */
.app{padding-bottom:var(--nav-h,190px)}.room-context{padding:12px 14px;gap:6px}.room-context .eyebrow{display:none}.room-context h1{font-size:19px;line-height:1.25}.room-context .place-label{margin-top:3px;font-size:11px}.room-context .ambient{margin-top:0}.room-context .muted{font-size:12px}.brand{margin-bottom:9px}.reading{margin-top:9px;padding:14px}.reading h2{margin-bottom:10px;padding-bottom:8px}.reading-tools{gap:6px;margin-bottom:8px}.reading-tools button{width:44px;min-width:44px;padding:6px;font-size:18px}.terminal-feed{max-height:49dvh}
#navigation{position:fixed;bottom:max(8px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:calc(100% - 20px);max-width:528px;margin:0;display:block;padding:6px;background:#fff;border-radius:16px;backdrop-filter:none}
#navigation.with-travel{display:grid;grid-template-columns:136px minmax(0,1fr);align-items:center;gap:8px}.navigation-icons{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr));gap:2px}#navigation button{min-width:44px;min-height:44px;padding:5px}#navigation button>span{font-size:23px;line-height:1.2}.travel-pad{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);gap:2px}#navigation .travel-pad button{background:var(--soft);color:var(--blue)}#navigation .travel-pad button:disabled{background:#f0f2f5;color:#778194;opacity:.5}.travel-norte{grid-column:2;grid-row:1}.travel-oeste{grid-column:1;grid-row:2}.travel-este{grid-column:3;grid-row:2}.travel-sur{grid-column:2;grid-row:3}.travel-center{grid-column:2;grid-row:2;display:grid;place-items:center;color:#56675c;font-size:24px}
@media(max-width:380px){.app{padding-top:8px}.brand a small{display:none}.brand-mark{width:30px;height:30px}.brand a{font-size:15px}.room-context h1{font-size:18px}.reading{padding:12px}.reading-footer{font-size:11px}.event{margin-bottom:15px}}

.discovered-scroll{max-height:330px;overflow:auto;border:1px solid var(--line);border-radius:14px;background:#f2f5fa;overscroll-behavior:contain}.discovered-map{position:relative;min-width:100%;min-height:110px}.discovered-path{position:absolute;height:3px;background:#879eac;transform-origin:0 50%;pointer-events:none}.discovered-place{position:absolute;transform:translate(-50%,-50%);width:116px;min-height:60px;padding:7px 5px;border:1px solid #c4cfdd;border-radius:11px;background:#fff;color:#384a60;font-size:11px;line-height:1.3;z-index:1;white-space:normal}.discovered-place small{display:block;font-size:9px;color:#56675c;margin-bottom:3px}.discovered-place.discovered-current{background:#375dd4;color:#fff;border-color:#375dd4}.discovered-current small{color:#fff}.discovered-place[aria-pressed=true]{outline:3px solid #b18b4e;outline-offset:2px}

.terminal-feed{min-height:120px;max-height:max(120px,calc(100dvh - 440px))}

/* The place stays visible; secondary details open only when requested. */
.small-reading{--reading-size:14px}.room-context{padding:6px 10px;margin-bottom:6px}.room-context .room-top{align-items:center;gap:4px}.room-details{position:relative;flex-shrink:0}.room-details summary{display:grid;place-items:center;width:44px;height:44px;cursor:pointer;list-style:none;color:var(--blue);font-size:20px}.room-details summary::-webkit-details-marker{display:none}.room-metadata{position:absolute;right:0;top:46px;width:min(280px,75vw);padding:12px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 6px 20px #23304d22;z-index:3;display:grid;gap:6px}.room-metadata .ambient{gap:5px}.reading-tools{gap:0;margin-bottom:2px}.reading-tools button{padding:0;border:0;background:transparent}.reading-tools button>span{display:grid;place-items:center;width:30px;height:30px;margin:auto;font-size:14px;border:1px solid #60786b;border-radius:8px;background:#243c34;color:#e2f3e6}.reading-tools button[aria-pressed=true]{background:transparent}.reading-tools button[aria-pressed=true]>span{background:#e2f3e6;color:#11251b}
@media(max-width:600px){.reading-adventure .brand{display:none}.reading-adventure .app{padding-top:6px}.reading-adventure .reading>h2{display:none}.reading-adventure .reading{margin-top:6px;padding-top:6px}.reading-adventure .terminal-feed{max-height:max(140px,calc(100dvh - 300px))}.reading-adventure .room-context h1{font-size:16px}.reading-adventure .room-context .map-shortcut{padding:6px;font-size:18px;width:44px}.reading-adventure .reading-footer{display:none}}

.action-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.action-grid>button{min-width:0;min-height:44px;padding:8px 5px;font-size:12px;line-height:1.3;justify-content:center;text-align:center}.action-grid .action-reason{font-size:10px}

.map-heading{display:flex;align-items:center;gap:12px;padding:5px 3px 9px}.map-heading h1{font-size:21px}.map-heading .muted{font-size:12px}.discovered-panel{padding:8px;gap:7px}.map-tools{display:flex;align-items:center;gap:4px}.map-tools>span{margin-right:auto;font-size:12px;padding-left:5px}.map-tools button{padding:5px;min-width:44px;font-size:20px}.discovered-plane{position:relative;overflow:hidden;min-width:1px;min-height:1px}.discovered-map{position:absolute;left:0;top:0;min-width:0}.discovered-panel .discovered-scroll{max-height:max(220px,calc(100dvh - 230px));min-height:220px}.discovered-panel>.muted{font-size:11px;padding:0 3px}.playing-map .app{padding-bottom:var(--nav-h)}.playing-map #navigation .navigation-icons{grid-template-columns:repeat(4,minmax(44px,1fr))}
@media(max-width:600px){.playing-map .brand{display:none}.playing-map .app{padding-top:6px}.playing-map .map-heading{padding-top:0}.playing-map .discovered-panel .discovered-scroll{max-height:max(220px,calc(100dvh - 205px))}}
@media(min-width:360px){.playing-map #navigation .navigation-icons{grid-template-columns:repeat(7,minmax(44px,1fr))}.playing-map .app{padding-bottom:var(--nav-h)}}

/* Bounded reader: new paragraphs scroll inside instead of growing the card. */
.terminal-feed{height:clamp(160px,38dvh,300px);min-height:0;max-height:none}
@media(max-width:600px){.reading-adventure .room-context{padding:0 8px;margin-bottom:4px;border-radius:12px}.reading-adventure .room-context h1{font-size:14px}.reading-adventure .room-context .map-shortcut{background:transparent}.reading-adventure .reading{margin-top:4px}.reading-adventure .terminal-feed{height:clamp(130px,24dvh,180px);min-height:0;max-height:none}.reading-adventure .reading-tools{margin-bottom:0}}

/* User-requested proportions: 20% smaller reading type and compact place bar. */
.reading{font-size:calc(var(--reading-size)*.8)}
@media(max-width:600px){.reading-adventure .room-context .room-top{min-height:27px;gap:2px}.reading-adventure .room-context h1{font-size:12px}.reading-adventure .room-details summary,.reading-adventure .room-context .map-shortcut{height:27px;min-height:27px;width:34px;padding:0;font-size:16px}.reading-adventure .room-metadata{top:29px}.reading-adventure .room-context{margin-bottom:2px}.reading-adventure .reading{margin-top:2px}}

.bestiary-art{display:block;width:100%;height:auto;max-height:280px;object-fit:contain;margin:10px 0;border-radius:12px;background:#f8f5ed}

.map-forks{display:block;margin-top:4px;color:#795215;font-size:11px;line-height:1.2;font-weight:750}.discovered-current .map-forks{color:#ffe3a0}.discovered-place{min-height:66px}

.bestiary-entry-heading{display:flex;align-items:center;gap:10px}.bestiary-art-button{padding:0;width:56px;height:56px;flex-shrink:0;overflow:hidden;border-radius:10px}.bestiary-thumbnail{display:block;width:56px;height:56px;object-fit:cover}.bestiary-dialog{width:min(760px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;border:1px solid var(--line);border-radius:16px;padding:12px;color:var(--ink);background:var(--paper)}.bestiary-dialog::backdrop{background:#071710bb}.bestiary-dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.bestiary-dialog .bestiary-art{max-height:calc(100dvh - 110px);margin-bottom:0}

.map-route-direction{position:absolute;transform:translate(-50%,-50%);font-size:9px;font-weight:800;line-height:14px;min-width:14px;text-align:center;color:#415668;background:#f2f5fa;pointer-events:none}.discovered-path{height:2px}

.character-heading{display:flex;align-items:center;gap:12px}.species-art-button{padding:0;width:72px;height:96px;flex-shrink:0;overflow:hidden;border-radius:12px}.species-thumbnail{width:72px;height:96px;object-fit:cover;display:block}.character-heading .eyebrow{font-size:10px}

.species-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}.species-gallery-button{padding:6px;font-size:12px}.species-gallery-button .species-thumbnail{margin:auto auto 5px;border-radius:8px;width:100%;height:96px;object-fit:contain}

.discovered-frontier{position:absolute;border-top:2px dashed #9d7c42;transform-origin:0 50%;pointer-events:none}.action-grid .action-reason{font-size:10px;line-height:1.2}.action-grid button{padding:8px 5px}

.tile .pill{display:inline-block;white-space:nowrap;margin:3px 4px 3px 0}
.visual-3d{background:var(--card,#fff);border-radius:16px;padding:12px;margin:8px 0}.visual-3d summary{cursor:pointer;font-weight:600}.world-3d,.figure-3d{position:relative;overflow:hidden;min-width:0;margin-top:8px;border-radius:12px}.world-3d{height:clamp(260px,48dvh,460px)}.figure-3d{height:260px}.world-3d canvas,.figure-3d canvas{display:block;max-width:100%;touch-action:none}.visual-3d[open].visual-ready:has(.world-3d)+.discovered-panel{display:none}.visual-3d:has(.world-3d[aria-busy="false"]){padding:8px}
.bestiary-dialog:has(.visual-3d[open].visual-ready) .bestiary-art{display:none}
.visual-failed .world-3d,.visual-failed .figure-3d{height:auto}
.visual-legend{font-size:12px;line-height:1.4;margin:8px 0 0;color:var(--muted)}.visual-failed .visual-legend{display:none}

@media(max-width:600px){.combat-active .terminal-feed{height:clamp(120px,23dvh,180px)}.combat-active .room-context .selection{padding:7px 9px;margin-top:4px}.combat-active .room-context .selection p{font-size:12px;line-height:1.4}.combat-active .room-context .selection h3{font-size:14px}.combat-active .combat-status{font-weight:650}}

.figure-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;background:#233747;font-size:14px;pointer-events:none}.figure-loading-error{inset:auto 8px 52px;padding:8px;border-radius:8px;font-size:12px}

.discovered-panel .discovered-scroll{height:clamp(280px,52dvh,480px)}.discovered-place{font-size:13px}.discovered-place small{font-size:10px}

.figure-backdrop{position:absolute;inset:-8px;background-size:cover;background-position:center;filter:blur(4px) saturate(.65);opacity:.38;pointer-events:none}.figure-loading{z-index:3}.bestiary-dialog .figure-3d{height:clamp(340px,55dvh,540px)}@media(max-width:600px){.bestiary-dialog .figure-3d{height:260px}}

/* Adventure surfaces: quiet stone, evergreen controls, restrained brass. */
:root{color:var(--ink);background:#e9ece3;--muted:#56675c;--brass:#89713f;--focus:#795c26}
body{background:radial-gradient(ellipse at 50% 0,#f6f4e8 0,transparent 65%),#e9ece3}
button{border:1px solid #c9d2bd;border-radius:9px;box-shadow:inset 0 1px 0 #ffffffb3,0 2px 3px #233c3010;transition:background-color 130ms,border-color 130ms,box-shadow 130ms}
button:hover:not(:disabled){filter:none;background:#e0e8d7;border-color:#899b7e;box-shadow:inset 0 1px 0 #fff9,0 3px 7px #233c301a}
button:disabled{opacity:1;background:#e8e9e2;color:#657060;border-color:#d4d9ce;box-shadow:none}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline-color:var(--focus)}
.primary,.tabs button[aria-pressed=true]{background:#235447;color:#fffdf7;border-color:#173f34;box-shadow:inset 0 1px 0 #ffffff26,0 3px 7px #193e3220}
.primary:hover:not(:disabled),.tabs button[aria-pressed=true]:hover{background:#183f34;border-color:#102e26}
.card{border-radius:15px;box-shadow:0 3px 12px #243e3010,inset 0 1px 0 #fff}
h1,h2,h3{color:var(--ink)}
.brand-mark{background:#235447;border:1px solid #6d8059;border-radius:10px;box-shadow:inset 0 0 0 3px #ffffff15;color:#faf2d3}
.brand a small,.muted,.quiet,.eyebrow,.section-label,.form-footer,.tile p,.npc p,.stat small,.place-label,.app-footer{color:var(--muted)}
.eyebrow{text-transform:none;letter-spacing:.15px;font-size:12px}
.stat,.selection,.pill{background:#eef0e6;color:#405443;border:1px solid #dce1d2;border-radius:9px}
.field input,.field select{border-color:#bdc9b7;background:#fffef9;border-radius:9px}
.field input:focus,.field select:focus{border-color:#58775d}
.history,.room-metadata,.visual-3d{background:var(--paper)}
.reading{border-radius:13px;box-shadow:inset 0 0 0 1px #91ad9455,0 3px 10px #142c2520}
.reading h2{color:#e1f8c0}.reading-tools button{box-shadow:none;border:0}.reading-tools button:hover:not(:disabled){background:transparent;box-shadow:none}
.reading-tools button>span{border-color:#68816a;border-radius:6px;background:#233c32}
.reading-tools button:hover:not(:disabled)>span{background:#355342;border-color:#a0b88d}
.control-icon{display:block;width:21px;height:21px;margin:auto}
.reading-tools .control-icon{width:17px;height:17px}
.room-context .control-icon{width:19px;height:19px}
#navigation{background:#fcfbf4;border-color:#b9c4ac;border-radius:14px;box-shadow:0 -3px 18px #203d3014,inset 0 1px 0 #fff;backdrop-filter:none}
#navigation button{color:#526650;border:1px solid transparent;border-radius:9px;box-shadow:none}
#navigation button:hover:not(:disabled){background:#edf0e5;border-color:#c5cfb8}
#navigation button[aria-current=page]{background:#235447;color:#fff8db;border-color:#235447;box-shadow:inset 0 -2px 0 #bc9e61}
#navigation .travel-pad button{background:#edf0e5;color:#235447;border-color:#ccd5be}
#navigation .travel-pad button:disabled{opacity:1;background:#f0f0e9;color:#929b8b;border-color:transparent}
.travel-center{color:#687d5b}.action-grid button{border-radius:8px;background:#f0f2e8;color:#284f3c;border-color:#cad4bf}
.action-grid button:hover:not(:disabled){background:#e2ead8;border-color:#8aa17c}
.action-grid button:disabled{background:#eceee5;color:#63705c;border-color:#d8ddcf}
.discovered-scroll{background:#edf0e7;border-color:#cad3bf}.discovered-place{background:#fffdf7;color:#344936;border-color:#bfcab3;box-shadow:0 2px 4px #29402d12}
.discovered-current{background:#235447!important;color:#fffdf7!important;border-color:#b89a59!important}
.danger-button{background:#f8e9df;color:#8a3528;border-color:#ddbcaa}
.danger-button:hover:not(:disabled){background:#f0d6c6;border-color:#b97e64}
@media(prefers-reduced-motion:reduce){button{transition:none}}

/* Tactile controls: inset rim, grounded edge, clear pressed state. */
.action-grid button{position:relative;border:1px solid #adbca1;background:linear-gradient(#fafbf4,#e5ebda);box-shadow:inset 0 1px 0 #fff,inset 0 -2px 0 #c6d1b8,0 2px 0 #aebba3,0 4px 7px #0000000d;font-weight:700;letter-spacing:.1px;min-height:48px}
.action-grid button:hover:not(:disabled){background:linear-gradient(#f4f8eb,#dbe7ce);border-color:#718c60;box-shadow:inset 0 1px 0 #fff,inset 0 -2px 0 #bdcdae,0 2px 0 #8a9d7c,0 4px 7px #00000012}
.action-grid button:active:not(:disabled){background:#d5e0c9;box-shadow:inset 0 2px 4px #30462526;translate:0 2px}
.action-grid button:disabled{background:#eceee5;border-color:#d8ddcf;box-shadow:none}
.primary{background:linear-gradient(#326b58,#204f40);border-color:#1b4335;box-shadow:inset 0 1px 0 #ffffff45,inset 0 -2px 0 #13372c,0 2px 0 #143a2d,0 4px 8px #00000016}
.primary:hover:not(:disabled){background:linear-gradient(#3c795f,#235741)}
.primary:active:not(:disabled){background:#204a3c;box-shadow:inset 0 2px 5px #00000030;translate:0 2px}
#navigation .travel-pad button{background:linear-gradient(#f9faf2,#e4ead9);border-color:#b3c2a5;box-shadow:inset 0 1px 0 #fff,0 2px 0 #c3ceb7}
#navigation .travel-pad button:active:not(:disabled){background:#d6e2c9;box-shadow:inset 0 2px 3px #30462520;translate:0 1px}
#navigation .travel-pad button:disabled{background:#f0f0e9;box-shadow:none;border-color:transparent}
#navigation button[aria-current=page]{background:linear-gradient(#326951,#204e3c);border-color:#254631;box-shadow:inset 0 1px 0 #ffffff30,inset 0 -2px 0 #b89b5a,0 2px 4px #00000014}
.reading-tools button>span{box-shadow:inset 0 1px 0 #ffffff16,inset 0 -1px 0 #10281c}
.reading-tools button:active:not(:disabled)>span{background:#142d22;box-shadow:inset 0 2px 3px #00000030}
@media(prefers-reduced-motion:reduce){button:active{translate:none!important}}
#navigation button[aria-current=page]:hover:not(:disabled){background:linear-gradient(#326951,#204e3c);color:#fff8db;border-color:#254631}

/* Collections and character details share the same adventure framing. */
.character-heading{padding:4px 0 15px;border-bottom:1px solid var(--line);align-items:center}
.species-art-button,.species-gallery-button,.bestiary-art-button{border:1px solid #9da986;box-shadow:0 2px 0 #c1c9b1,inset 0 0 0 2px #fff8;overflow:hidden}
.species-gallery{gap:10px}.species-gallery-button{background:#edf0e4;padding:5px;border-radius:10px;color:#304d36}.species-gallery-button:hover:not(:disabled){background:#e0e9d3}
.species-gallery-button .species-thumbnail{border-radius:6px}.species-gallery-button>span{display:grid;gap:5px;font-weight:650}
.stat{position:relative;border-color:#d2dac5;box-shadow:inset 0 1px 0 #fff8}.stat-vitality,.stat-experience{background:#e8edde;border-color:#bbc9a6}
.stat-meter{display:block;height:6px;background:#cbd4bc;border-radius:3px;overflow:hidden;margin-top:9px;box-shadow:inset 0 1px 2px #00000015}
.stat-meter-fill{display:block;height:100%;background:#367552;border-radius:3px}.stat-experience .stat-meter-fill{background:#947038}
.inventory-item,.creature-entry{padding:14px;border:1px solid #d5dcc9!important;border-radius:11px;background:#f7f8ef;box-shadow:inset 0 1px 0 #fff}
.item-heading{display:flex;align-items:center;gap:12px}.item-heading h3{flex:1;min-width:0}.item-emblem{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;background:#e5ead9;border:1px solid #becbb0;border-radius:8px;color:#466744}.item-emblem .control-icon{width:24px;height:24px}
.item-equipped{border-color:#9db088!important;background:#eef2e4}.inventory-item .pill{background:#fffdf6;font-size:11px}.inventory-item button{margin-right:6px}
.creature-entry{border-color:#c2b38f!important}.bestiary-entry-heading{align-items:center;gap:12px}.bestiary-art-button{width:68px;height:68px;border-radius:9px}.bestiary-thumbnail{width:68px;height:68px}.creature-entry h3{font-size:17px}.creature-entry p{font-size:13px;line-height:1.65}.creature-entry p+p{padding-top:8px;border-top:1px solid #dce1d3}
.bestiary-behavior{margin-top:9px;padding-top:8px;border-top:1px solid #dce1d3}.bestiary-behavior-title{font-size:13px;font-weight:700;letter-spacing:.2px;margin:0 0 5px;color:var(--ink)}.bestiary-behavior-list{margin:0;padding-left:18px}.bestiary-behavior-list li{font-size:13px;line-height:1.55;margin:3px 0;color:var(--ink)}.bestiary-behavior-empty{font-size:13px;line-height:1.55;margin:0}
.bestiary-dialog{border-color:#a9b895;box-shadow:0 20px 60px #00000040}.bestiary-dialog-heading{padding:2px 2px 10px;border-bottom:1px solid var(--line)}
.bestiary-dialog .visual-3d{padding:8px 0}.bestiary-dialog .bestiary-art{background:#edf0e4;border:1px solid #d3dbc6}
@media(max-width:350px){.inventory-item,.creature-entry{padding:11px}.bestiary-art-button,.bestiary-thumbnail{width:58px;height:58px}.creature-entry h3{font-size:15px}.item-heading{gap:9px}.bestiary-behavior-list{padding-left:15px}}

.action-content{display:grid;grid-template-columns:22px minmax(0,1fr);align-items:center;gap:7px;text-align:left}.action-content .action-reason{grid-column:2}.action-symbol{display:grid;place-items:center;color:inherit}.action-symbol .control-icon{width:19px;height:19px}.action-label{min-width:0}
.action-grid .action-content{display:flex;flex-direction:column;gap:4px;text-align:center;width:100%}.action-grid .action-symbol .control-icon{width:17px;height:17px}.action-grid .action-content .action-reason{width:100%}.action-grid button{padding:7px 5px;min-height:59px}.game-action.combat-choice{border-color:#bda17b;background:#f5ecdb;color:#634a2b}
.combat-meter{height:5px;background:#dacaba;border-radius:4px;overflow:hidden;margin:7px 0}.combat-meter-fill{display:block;height:100%;background:#ac563d;border-radius:4px}.combat-active .room-context .selection{background:#f7eee0;border-color:#d8bd96}.combat-active .room-context .selection h3{color:#714b2b}
/* Anime adventure: clean outlines, cel-like surfaces and warm highlights. */
:root{--paper:#fffdf8;--ink:#263e50;--blue:#236784;--soft:#e5f1f3;--line:#c5d8d9;--muted:#526978;--focus:#88561e;background:#e7f0ef}
body{background:linear-gradient(135deg,#eef6ed,#e8f1f6)}
.card{border-color:#b9cdd1;box-shadow:0 3px 0 #cbdcda,0 7px 18px #2447560b;border-radius:16px}
.brand-mark{background:#287a91;color:#fff5ce;border-color:#1b576b;box-shadow:inset 0 0 0 3px #ffffff30,0 2px 0 #b7cfd2}
.action-grid button{background:linear-gradient(#f8fdff,#deeff5);color:#254e65;border-color:#96b7c9;box-shadow:inset 0 1px 0 #fff,inset 0 -2px 0 #b5d5e1,0 2px 0 #91adbd,0 4px 7px #0000000c}
.action-grid button:hover:not(:disabled){background:linear-gradient(#fff9e8,#f9eac4);color:#634822;border-color:#ba9758;box-shadow:inset 0 1px 0 #fff,inset 0 -2px 0 #e0c98d,0 2px 0 #baa16c}
.action-grid button:active:not(:disabled){background:#c9e4ef;box-shadow:inset 0 2px 3px #264e6520}
.action-grid button:disabled{background:#e9eef0;color:#596f7b;border-color:#cbd7dd;box-shadow:none}
.primary{background:linear-gradient(#3d92af,#286983);border-color:#24566e;box-shadow:inset 0 1px 0 #ffffff55,inset 0 -2px 0 #21556c,0 2px 0 #17475f,0 4px 8px #00000012}
.primary:hover:not(:disabled){background:linear-gradient(#4b9fba,#2a748d)}
#navigation{background:#fffdf8;border-color:#a5bdca;box-shadow:0 -3px 18px #24475610,inset 0 1px 0 #fff}
#navigation button{color:#466675}#navigation button[aria-current=page],#navigation button[aria-current=page]:hover:not(:disabled){background:linear-gradient(#398ea5,#246a82);color:#fff8d6;border-color:#28607a;box-shadow:inset 0 1px 0 #ffffff40,inset 0 -2px 0 #e8bd68,0 2px 3px #00000014}
#navigation .travel-pad button{background:linear-gradient(#f4fbff,#dceef5);color:#285b77;border-color:#aac6d5;box-shadow:inset 0 1px 0 #fff,0 2px 0 #b4cad4}
#navigation .travel-pad button:hover:not(:disabled){background:#d0e8f2}
.stat,.selection,.pill{background:#eef4f4;color:#3b5b6a;border-color:#cfdddd}.stat-vitality{background:#e9f4e7;border-color:#b9d4af}.stat-experience{background:#fff3d9;border-color:#dbc491}.stat-experience .stat-meter{background:#e8d8b5}
.inventory-item{background:#f4f8fa;border-color:#bfd4df!important}.item-equipped{background:#edf6e9;border-color:#a7c89b!important}.item-emblem{background:#e0edf4;border-color:#aac7d8;color:#386b84}
.creature-entry{background:#fffbef;border-color:#dbc996!important}.bestiary-art-button,.species-art-button,.species-gallery-button{border-color:#a6becb;box-shadow:0 2px 0 #c2d6dc,inset 0 0 0 2px #fff8}
.species-gallery-button{background:#edf5f8;color:#325a73}.species-gallery-button:hover:not(:disabled){background:#deeff6}
.discovered-current{background:#286e86!important;border-color:#ddb969!important}.field input,.field select{border-color:#aec8d3}.reading{box-shadow:inset 0 0 0 1px #749f9655,0 3px 0 #a9c4bf}
.action-content:not(:has(.action-symbol)){grid-template-columns:minmax(0,1fr)}
.inventory-item>button{display:block;width:fit-content;max-width:100%;margin-top:10px;margin-right:0;text-align:left}
.inventory-item>button .action-content{min-width:0}.inventory-item>button .action-label{overflow-wrap:normal}

.room-title{flex:1;min-width:0}.place-art-preview{display:grid;place-items:center;flex-shrink:0;width:46px;min-width:46px;height:34px;min-height:34px;padding:2px;border:1px solid #98b8c7;border-radius:7px;overflow:hidden;background:#e4f0f4;box-shadow:0 1px 2px #00000015}.place-art-preview img{display:block;width:100%;height:100%;object-fit:cover;border-radius:4px}.place-art-preview:hover:not(:disabled){border-color:#b59148;background:#fff2d3}.place-art-preview .control-icon{width:20px;height:20px}
@media(max-width:600px){.reading-adventure .place-art-preview{width:35px;min-width:35px;height:25px;min-height:25px;padding:1px}.reading-adventure .place-art-preview img{border-radius:4px}.reading-adventure .room-title h1{line-height:1.2}}
.action-content:not(:has(.action-symbol)) .action-reason{grid-column:1}
.bestiary-dialog-heading h2{min-width:0;overflow-wrap:anywhere}.bestiary-dialog-heading>button{flex-shrink:0;white-space:nowrap}
.bestiary-dialog:has(img[src*="/art/places/"]) .bestiary-art{aspect-ratio:3/2;object-fit:contain}
@media(max-width:600px){.reading-adventure .place-art-preview{width:44px;min-width:44px}.reading-adventure .place-art-preview img{width:33px}}

/* Compact combat health: two hairlines, readable without opening character stats. */
.combat-vitals{display:grid;gap:3px;margin:5px 0 6px}
.combat-vital-row{display:grid;grid-template-columns:72px minmax(0,1fr);gap:7px;align-items:center}
.combat-vital-row small{font-size:9px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#714b2b}
.combat-vital-track{display:block;height:3px;background:#714b2b26;border-radius:3px;overflow:hidden}
.combat-vital-fill{display:block;height:100%;border-radius:3px;background:var(--health-color)}
.health-good{--health-color:#23856e}.health-low{--health-color:#b87a12}.health-critical{--health-color:#cb4052}

/* Keep canonical power names intact in the compact combat grid. */
.action-grid .capability-choice .action-label{overflow-wrap:normal;word-break:normal;letter-spacing:-.1px}
@media(max-width:400px){.action-grid .capability-choice .action-label{font-size:11px}}
@media(max-width:350px){.action-grid .capability-choice .action-label{font-size:10px}}

/* Optional written commands stay tucked away behind a keyboard control. */
.command-disclosure>summary{list-style:none;display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;cursor:pointer;border:1px solid var(--line);border-radius:10px;color:var(--blue);font-size:23px;background:var(--card,#fff)}
.command-disclosure>summary::-webkit-details-marker{display:none}
.command-disclosure[open]>summary{background:#e7edff}
.selling-section{display:grid;gap:.65rem;padding:1rem;border:1px solid var(--line,#d8dfd7);border-radius:16px;background:var(--panel,#fff);margin-bottom:1rem;min-width:0}
.selling-section h2,.selling-section p{margin:0}.selling-section>button{width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere}.selling-section .muted{font-size:.9rem}
.encounter-portrait{float:right;display:grid;place-items:center;width:44px;height:44px;padding:2px;margin:0 0 2px 5px}.encounter-portrait img{width:36px;height:32px;object-fit:cover;border-radius:6px}

/* Director controls share one button shape; disclosure arrows reveal submenus. */
.directing-world #main button,.directing-world #main .more>summary{width:100%;min-height:44px;padding:10px 14px;border-radius:9px;font:650 14px/1.4 system-ui,sans-serif;text-align:center;white-space:normal;overflow-wrap:anywhere}
.directing-world #main .more>summary{position:relative;display:flex;justify-content:center;align-items:center;padding-right:36px;padding-left:36px;list-style:none;border:1px solid #c9d2bd;background:var(--soft);color:var(--blue);box-shadow:inset 0 1px 0 #ffffffb3,0 2px 3px #233c3010;transition:background-color 130ms,border-color 130ms,box-shadow 130ms}
.directing-world #main .more>summary::-webkit-details-marker{display:none}
.directing-world #main .more>summary::after{content:'';position:absolute;right:16px;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}
.directing-world #main .more[open]>summary::after{transform:rotate(225deg)}
.directing-world #main .more>summary:hover{background:#e0e8d7;border-color:#899b7e;box-shadow:inset 0 1px 0 #fff9,0 3px 7px #233c301a}
.directing-world #main .more>summary:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.directing-world #main .master-pagination{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;margin-top:14px}
.directing-world #main .master-pagination>span{font-size:12px;text-align:center}
/* Imágenes personales en el panel del director. */
.master-current-portrait{display:flex;align-items:center;gap:14px;color:var(--muted);font-size:13px}
.directing-world #main .master-current-portrait-button{padding:4px;flex:none;width:90px;min-width:90px;height:112px;overflow:hidden}
.master-current-portrait-button img{display:block;width:100%;height:100%;object-fit:contain;border-radius:8px}
.master-portrait-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin:12px 0}
.master-portrait-choice{position:relative;display:flex;flex-direction:column;align-items:center;gap:7px;padding:10px;border:2px solid #b9cdd1;border-radius:12px;background:var(--soft);cursor:pointer;font-size:12px;text-align:center;color:var(--ink);overflow-wrap:anywhere}
.master-portrait-choice img{width:100%;height:138px;object-fit:contain;border-radius:8px}
.master-portrait-choice input{position:absolute;top:8px;left:8px;width:18px;height:18px;padding:0;accent-color:var(--blue)}
.master-portrait-choice:has(input:checked){border-color:var(--blue);background:#e5f0f8}
.master-portrait-choice:has(input:focus-visible){outline:3px solid var(--focus);outline-offset:3px}
.master-portrait-choice small{color:var(--blue);font-weight:700}
.master-current-portrait>span{min-width:0;flex:1;white-space:normal;overflow-wrap:anywhere}

/* Director hierarchy: main menus frame indented, quieter submenus. */
.directing-world #main .card>.more>summary{background:#286983;color:#fffdf8;border-color:#24566e;font-weight:750;box-shadow:inset 0 1px 0 #ffffff35,0 2px 3px #233c3010}
.directing-world #main .card>.more>summary:hover{background:#235c74;border-color:#1d4e63}
.directing-world #main .master-management[open]{padding:12px;border:1px solid #b9cdd1;border-radius:11px;background:#f0f6f7}
.directing-world #main .master-management .more{margin-left:10px;margin-top:10px}
.directing-world #main .master-management .more>summary{justify-content:flex-start;text-align:left;padding-left:14px;background:#fffdf8;color:var(--blue);border-color:#c5d8d9;font-size:13px;font-weight:600;box-shadow:none}
.directing-world #main .master-management .more>summary:hover{background:#e5f1f3;border-color:#96b7c9}
.directing-world #main .master-management .more[open]>summary{background:#e5f1f3;border-color:#96b7c9}
.directing-world #main .master-management>.more[open]{padding-bottom:12px;border-bottom:1px solid #d5e2e5}
.directing-world #main .master-management>button{margin-top:12px}

/* El emblema del juego comparte identidad con el acceso de inicio. */
.brand-mark{display:block;flex:0 0 40px;object-fit:contain;background:#173d49;border-radius:11px}
/* Rooms are the only junctions; road crossings have an explicit SVG gap. */
.discovered-roads{position:absolute;inset:0;overflow:visible;pointer-events:none}.discovered-road{fill:none;stroke:#829587;stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}.discovered-road-selected{stroke:#09657b;stroke-width:4.5}.discovered-place{height:76px;min-height:76px;max-height:76px;overflow:hidden;display:flex;align-items:center;justify-content:center}.discovered-place>span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.discovered-place small{line-height:1.2}.discovered-frontier{z-index:0}

/* ===== Tema de juego (maqueta del usuario, 2026-10-09): noche azul, filetes dorados y pergamino. =====
   Capa final: sustituye la apariencia anterior sin tocar la estructura ni las clases que usan las pruebas. */
:root{--night:#0f1d2b;--night-2:#15283a;--night-3:#1d3850;--gold:#c9a24a;--gold-2:#ecd394;--gold-dark:#8a6a26;--parchment:#f4ead3;--parchment-2:#e9dcbb;--parchment-3:#fbf5e6;--ink:#2c2217;--ink-soft:#6a5741;
 --red:#b8433a;--green:#5d9a46;--blue:#3b7fae;--purple:#8a5fb0;--teal:#2f9488;--serif:"Palatino Linotype","Book Antiqua",Palatino,"P052","URW Palladio L",Georgia,"Noto Serif",serif;--reading-size:18px;--nav-h:calc(150px + env(safe-area-inset-bottom));color-scheme:light}
html body{background:radial-gradient(ellipse at 50% -10%,#2a4a68 0,transparent 60%),linear-gradient(180deg,#132536 0,#0b1622 100%) fixed;color:var(--ink);font-family:var(--serif)}
body .app{padding:10px 10px var(--nav-h)}
/* Cabecera: placa de madera noche con filete dorado */
body .brand{background:linear-gradient(180deg,var(--night-3),var(--night));border:1px solid var(--gold-dark);border-radius:12px;padding:6px 12px;margin-bottom:10px;box-shadow:inset 0 0 0 1px #ffffff10,0 4px 14px #0007}
body .brand a{color:var(--gold-2);font-family:var(--serif);font-weight:700;letter-spacing:.5px;text-decoration:none}
body .brand a small{color:#b9c6d2;font-style:italic}
/* Paneles de pergamino con doble filete */
body .card{background:linear-gradient(180deg,var(--parchment-3),var(--parchment) 40%,var(--parchment-2));color:var(--ink);border:1px solid var(--gold-dark);border-radius:10px;box-shadow:inset 0 0 0 3px var(--parchment-3),inset 0 0 0 4px #c9a24a66,0 6px 18px #0008;padding:16px 14px}
body h1,body h2,body h3{font-family:var(--serif);color:var(--ink);letter-spacing:.2px}
body .eyebrow,body .muted,body .place-label,body .stat small{color:var(--ink-soft)}
body .panel-title{font-size:1.15rem;margin:0 0 10px;padding-bottom:6px;border-bottom:1px solid #8a6a2655;display:flex;align-items:center;gap:8px}
body .panel-title::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,#8a6a2666,transparent)}
/* Botones: secundario de pergamino, primario noche con oro */
body button{font-family:var(--serif);border-radius:9px;border:1px solid var(--gold-dark);background:linear-gradient(180deg,#fbf3df,#eadbb5);color:var(--ink);box-shadow:inset 0 1px 0 #fff8,0 2px 0 #8a6a2688;font-weight:600}
body button:hover:not(:disabled){background:linear-gradient(180deg,#fff8e8,#f0e2bd);border-color:var(--gold)}
body button:active:not(:disabled){transform:translateY(1px);box-shadow:inset 0 1px 0 #fff8,0 1px 0 #8a6a2688}
body button:disabled{opacity:.55;filter:grayscale(.3)}
body .primary,body .primary:hover:not(:disabled){background:linear-gradient(180deg,var(--night-3),var(--night));color:var(--gold-2);border:2px solid var(--gold);box-shadow:inset 0 0 0 1px #000a,0 3px 0 #000a;font-weight:700;letter-spacing:.3px}
body .field input,body .field select{background:#fffaf0;border:1px solid var(--gold-dark);border-radius:8px;color:var(--ink);font-family:var(--serif)}
/* Escena: ilustración grande del lugar con su nombre */
body .room-context{padding:0;overflow:hidden;background:var(--night);border:2px solid var(--gold-dark);box-shadow:inset 0 0 0 1px #000,0 8px 22px #000a}
.scene-hero{position:relative;margin:0;min-height:96px;background:linear-gradient(180deg,var(--night-3),var(--night))}
.scene-hero .scene-art{display:block;width:100%;padding:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none}
.scene-hero .scene-art img{display:block;width:100%;aspect-ratio:3/2;object-fit:cover}
.scene-hero::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,#0b1622e6 0,#0b162200 38%,#0b162200 70%,#0b1622cc 100%)}
.scene-title{position:absolute;top:10px;left:14px;right:120px;z-index:1;color:#fff}
body .scene-title h1{color:#fff;font-size:1.65rem;line-height:1.1;margin:0;text-shadow:0 2px 6px #000}
.scene-title p{margin:2px 0 0;color:var(--gold-2);font-style:italic;text-shadow:0 1px 4px #000}
.scene-hero-plain .scene-title{position:static;padding:14px 14px 6px}
.time-chip{position:absolute;top:10px;right:10px;z-index:1;display:flex;align-items:center;gap:6px;max-width:46%;padding:5px 10px;border-radius:8px;background:#0f1d2bcc;border:1px solid var(--gold);color:#f2ead6;font-size:12px;line-height:1.2}
.time-chip svg{width:18px;height:18px;color:var(--gold-2);flex-shrink:0}
body .room-context .room-top{padding:4px 10px 0;gap:6px;align-items:center}
body .room-context .room-top .room-title,body .room-context .place-art-preview{display:none}
body .room-context .room-top{justify-content:flex-end}
body .room-context .map-shortcut,body .room-context .room-details summary{background:var(--night-2);color:var(--gold-2);border:1px solid var(--gold-dark)}
body .room-context .room-metadata{background:var(--parchment);color:var(--ink);border-radius:8px}
/* Barra de estado */
.hud{display:grid;grid-template-columns:1fr 1fr auto auto;gap:8px;align-items:center;padding:8px 10px 10px;cursor:pointer}
.hud-bar{display:flex;align-items:center;gap:6px;min-width:0;color:#f2ead6;font-size:12px}
.hud-bar svg{width:18px;height:18px;flex-shrink:0}
.hud-life svg{color:#e0574a;fill:#e0574a55}.hud-energy svg{color:#7ccf6a}
.hud-track{flex:1;height:9px;border-radius:5px;background:#0006;border:1px solid #c9a24a88;overflow:hidden;min-width:28px}
.hud-fill{display:block;height:100%;border-radius:4px;transition:width .4s}
.hud-life .hud-fill{background:linear-gradient(90deg,#8e2a22,#e0574a)}
.hud-energy .hud-fill{background:linear-gradient(90deg,#3d7a2e,#8ad36f)}
.hud-value{font-variant-numeric:tabular-nums;white-space:nowrap}
.hud-chip{display:flex;align-items:center;gap:4px;padding:3px 8px;border-radius:7px;background:#0f1d2b;border:1px solid var(--gold-dark);color:var(--gold-2);font-size:13px;font-weight:700;white-space:nowrap}
.hud-chip svg{width:16px;height:16px}
/* Relato en pergamino, con letra de libro */
body .reading{background:linear-gradient(180deg,#fbf4e2,#f1e4c6);color:var(--ink);font-family:var(--serif);font-size:var(--reading-size);line-height:1.6;border:1px solid var(--gold-dark);border-radius:10px;box-shadow:inset 0 0 0 3px #fbf4e2,inset 0 0 0 4px #c9a24a55,0 6px 18px #0008;padding:16px 16px 12px;max-height:none;
 --world:var(--ink);--place:#3b2a14;--action:#2f5f86;--discovery:#8a5a10;--danger:#a3322a;--combat:#b04a1c;--secondary:#6a5741;--voice:#6a3f8c}
body .reading h2{font-family:var(--serif);color:var(--gold-dark);font-size:.95rem;text-transform:uppercase;letter-spacing:1.5px}
body .terminal-feed{max-height:48dvh;scrollbar-color:#c9a24a transparent}
body .reading .event-kind{font-family:var(--serif);font-variant:small-caps;letter-spacing:.8px;font-size:12px;opacity:.85}
body .reading .event-world .event-kind,body .reading .event-look .event-kind{display:none}
body .reading .event-location{color:var(--place);font-weight:700;font-size:1.05em;border-top:1px solid #8a6a2644}
body .reading .event-info{font-size:.9em;font-style:italic}
body .reading .event-with-portrait{display:flex;align-items:center;gap:10px}
body .reading .resident-art-peek{flex:0 0 52px;width:52px;height:52px}
body .reading .event-copy{min-width:0}
body .reading .event-discovery,body .reading .event-reward{background:#f6e3a855;border-radius:6px;padding:4px 8px 4px 10px}
body .reading .event-danger,body .reading .event-combat,body .reading .event-damage{background:#f3c9b955;border-radius:6px;padding:4px 8px 4px 10px}
body .reading-footer{color:var(--ink-soft);font-style:italic}
body .reading-tools button{background:linear-gradient(180deg,var(--night-3),var(--night));color:var(--gold-2);border:1px solid var(--gold-dark);min-height:38px;min-width:38px;padding:4px 9px;box-shadow:0 2px 0 #000a}
body .reading-tools button[aria-pressed=true]{background:var(--gold);color:var(--night)}
/* Salidas: filas con flecha dorada y destino */
.exit-list{display:grid;gap:6px}
body .exit-row{display:grid;grid-template-columns:34px 64px minmax(0,1fr);align-items:center;gap:8px;text-align:left;padding:8px 10px;min-height:48px;min-width:0;overflow:hidden;background:linear-gradient(180deg,#fbf3df,#efe2c2)}
body .exit-row strong{font-size:1rem;white-space:nowrap}
.exit-name{color:var(--ink-soft);font-size:.95rem;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.exit-arrow{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--night);border:1px solid var(--gold);color:var(--gold-2)}
.exit-arrow svg{width:18px;height:18px}
/* Acciones rápidas: losetas noche con icono dorado y color por tipo */
body .quick-actions .action-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
body .action-grid button,body .action-grid button:hover:not(:disabled){min-height:92px;padding:10px 6px;background:radial-gradient(circle at 50% 30%,var(--night-3),var(--night) 75%);color:#f2ead6;border:2px solid var(--gold-dark);border-radius:10px;box-shadow:inset 0 0 0 1px #000,0 3px 0 #000a;--tone:var(--gold-2)}
body .action-grid button:hover:not(:disabled){border-color:var(--gold)}
body .action-grid .action-content{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
body .action-grid .action-symbol{color:var(--tone)}
body .action-grid .action-symbol svg{width:30px;height:30px;stroke-width:1.5}
body .action-grid .action-label{font-size:.88rem;line-height:1.2;color:#f6efdc;font-weight:600}
body .action-grid .action-reason{color:#c9d3dc;font-size:.72rem}
body button[data-tone=fight]{--tone:#ff8a7a}body .action-grid button[data-tone=fight]{border-color:#8f2f25;background:radial-gradient(circle at 50% 30%,#4a1f1c,#1a0f12 75%)}
body button[data-tone=trade]{--tone:#f2c55c}
body button[data-tone=talk]{--tone:#d0aaf2}
body button[data-tone=care]{--tone:#7fe0cf}
body button[data-tone=explore]{--tone:#9fd0f2}
/* Combate */
body .room-context .selection{margin:8px 10px 12px;background:linear-gradient(180deg,#3a1715,#1d0d0f);color:#f6e2dc;border:1px solid #b8433a;border-radius:9px}
body .room-context .selection h3,body .room-context .selection .muted{color:#f6e2dc}
body .combat-meter{accent-color:#e0574a}
/* Barra inferior: cinco pestañas noche y oro */
html body #navigation{position:fixed;left:50%;transform:translateX(-50%);bottom:max(6px,env(safe-area-inset-bottom));width:calc(100% - 16px);max-width:560px;padding:4px;background:linear-gradient(180deg,var(--night-3),var(--night));border:1px solid var(--gold-dark);border-radius:14px;box-shadow:inset 0 0 0 1px #000,0 -4px 18px #0009;z-index:5}
body #navigation .game-tabs{display:grid;grid-template-columns:repeat(5,1fr);gap:2px}
body #navigation .game-tabs button{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:58px;padding:6px 2px;background:none;border:1px solid transparent;box-shadow:none;color:#b9c6d2;border-radius:10px}
body #navigation .game-tabs button svg{width:26px;height:26px}
body #navigation .game-tabs .tab-label{font-size:11px;font-weight:600}
body #navigation .game-tabs button[aria-current=page]{color:var(--gold-2);background:radial-gradient(circle at 50% 35%,#c9a24a40,#c9a24a08 70%);border-color:var(--gold-dark)}
body #navigation .game-tabs button[aria-current=page] svg{filter:drop-shadow(0 0 5px #ecd39488)}
/* Menú «Más» */
.more-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-top:10px}
body .more-tile{display:flex;flex-direction:column;align-items:center;gap:4px;padding:16px 10px;min-height:120px;background:radial-gradient(circle at 50% 30%,var(--night-3),var(--night) 75%);color:#f2ead6;border:2px solid var(--gold-dark)}
.more-tile .more-icon{color:var(--gold-2)}.more-tile svg{width:34px;height:34px}
.more-tile small{color:#c9d3dc;font-size:.8rem}
/* Ficha, mochila y etiquetas */
body .stat{background:linear-gradient(180deg,#fbf3df,#efe2c2);border:1px solid var(--gold-dark);border-radius:8px;color:var(--ink)}
body .stat-meter{background:#0003;border:1px solid var(--gold-dark)}
body .stat-meter-fill{background:linear-gradient(90deg,#b07a1a,var(--gold-2))}
body .pill{background:var(--night);color:var(--gold-2);border:1px solid var(--gold-dark);border-radius:6px}
body .tile,body .inventory-item,body .creature-entry,body .npc{background:linear-gradient(180deg,#fbf3df,#efe2c2);border:1px solid var(--gold-dark);border-radius:9px;color:var(--ink)}
body .item-equipped{box-shadow:inset 0 0 0 2px var(--gold)}
body .notice{background:var(--parchment-3);color:var(--ink);border:1px solid var(--gold-dark);border-left:5px solid var(--gold);border-radius:8px}
body .notice.error{border-left-color:var(--red)}
body .history summary,body .more summary{color:var(--night-3);font-weight:700}
body .app-footer{color:#b9c6d2;font-style:italic}
body .app-footer .quiet{background:var(--night-2);color:var(--gold-2);border-color:var(--gold-dark)}
@media(max-width:420px){.hud{grid-template-columns:1fr 1fr;}.hud-chip{justify-content:center}body .scene-title h1{font-size:1.35rem}}
@media(prefers-reduced-motion:reduce){.hud-fill{transition:none}}
/* Ajustes tras la primera revisión visual */
html{background:#0b1622}
body .room-context .scene-title h1{font-size:1.65rem;line-height:1.1;color:#fff}
body .reading .reading-tools{position:static;display:flex;justify-content:flex-end;gap:6px;margin:0 0 10px;padding:0;background:none;z-index:auto}
body .action-grid .action-symbol .control-icon,body .quick-actions .action-symbol svg{width:30px;height:30px}
body .exit-row:not(:has(.exit-name:not(:empty))){grid-template-columns:34px 1fr}
body .exit-row:not(:has(.exit-name:not(:empty))) .exit-name{display:none}
body .more summary,body .history summary{font-family:var(--serif)}
body details.history{background:linear-gradient(180deg,var(--parchment-3),var(--parchment));border:1px solid var(--gold-dark);border-radius:10px;padding:10px 14px;color:var(--ink)}
body details.history .reading{box-shadow:none;border:0;background:none;padding:6px 0}
body .command-disclosure summary{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:9px;background:linear-gradient(180deg,var(--night-3),var(--night));color:var(--gold-2);border:1px solid var(--gold-dark);list-style:none;cursor:pointer}
body .command-disclosure summary::-webkit-details-marker{display:none}
body .local-people,body section.local-people{color:var(--ink)}
body .app-footer{color:#9fb0c0}
@media(max-width:420px){body .room-context .scene-title h1{font-size:1.35rem}}
.scene-title{right:46%}
body #navigation .game-tabs button[aria-label="Más"] svg{stroke-width:3.2}
:root{background:#0b1622}
main:focus,main:focus-visible{outline:none}
.attribute-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:6px 0 12px}
.attribute{display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:6px;padding:7px 10px;border:1px solid var(--gold-dark);border-radius:8px;background:linear-gradient(180deg,#fbf3df,#efe2c2)}
.attribute-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--night);color:var(--gold-2);border:1px solid var(--gold)}
.attribute-icon svg{width:17px;height:17px}
.attribute small{color:var(--ink-soft);font-size:.85rem}
.attribute strong{font-size:1.15rem}
/* Mapa y pestañas con el tema */
html body #navigation .game-tabs,html.playing-map body #navigation .game-tabs{grid-template-columns:repeat(5,minmax(0,1fr))}
body #navigation .game-tabs .tab-label{white-space:nowrap;font-size:10.5px;letter-spacing:-.1px}
body .map-heading h1{color:var(--gold-2);text-shadow:0 2px 6px #000}
body .map-heading .muted{color:#c9d3dc;font-style:italic}
body .visual-3d{background:linear-gradient(180deg,var(--parchment-3),var(--parchment));border:1px solid var(--gold-dark);border-radius:10px;padding:8px 12px;color:var(--ink)}
body .discovered-scroll{background:radial-gradient(circle at 30% 20%,#fbf5e6,#efe2c2 70%),#efe2c2;border:1px solid var(--gold-dark);border-radius:9px;box-shadow:inset 0 0 18px #8a6a2633}
/* Combate con el tema */
html body .room-context .selection,html.combat-active body .room-context .selection{margin:8px 10px 12px;padding:10px 12px;background:linear-gradient(180deg,#3a1715,#1d0d0f);color:#f6e2dc;border:1px solid #b8433a;border-radius:9px;box-shadow:inset 0 0 0 1px #000}
html body .room-context .selection h3,html.combat-active body .room-context .selection h3{color:#ffd7cf;font-size:15px;display:flex;align-items:center;gap:8px;justify-content:space-between}
html body .room-context .selection .muted,html.combat-active body .room-context .selection p{color:#e9c7bf}
.combat-vital-row{display:grid;grid-template-columns:90px 1fr;gap:8px;align-items:center;margin:5px 0}
.combat-vital-row small{color:#f6e2dc;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.combat-vital-track{height:10px;border-radius:5px;background:#0008;border:1px solid #c9a24a88;overflow:hidden}
.combat-vital-row:first-child .combat-vital-fill{background:linear-gradient(90deg,#3d7a2e,#8ad36f)}
.combat-vital-row:last-child .combat-vital-fill{background:linear-gradient(90deg,#8e2a22,#e0574a)}
.combat-vital-track.health-critical .combat-vital-fill{background:linear-gradient(90deg,#6a1a14,#ff6a50)}
.combat-vital-fill{display:block;height:100%;transition:width .4s}
/* Mochila con el tema */
body .selling-section{background:linear-gradient(180deg,var(--parchment-3),var(--parchment));border:1px solid var(--gold-dark);border-radius:9px;box-shadow:inset 0 0 0 2px var(--parchment-3);color:var(--ink)}
html body .tile .pill,html body .inventory-item .pill{background:var(--night);color:var(--gold-2);border:1px solid var(--gold-dark)}
body .item-emblem{display:grid;place-items:center;background:var(--night);color:var(--gold-2);border:1px solid var(--gold);border-radius:8px}
/* Cabecera sin ilustración: la letra manda; la imagen sólo al pasar o pulsar el icono */
body .room-context .scene-hero,body .room-context .scene-hero-plain{min-height:0;background:linear-gradient(180deg,var(--night-3),var(--night));display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 12px 4px}
body .room-context .scene-hero::after{display:none}
body .room-context .scene-hero-plain .scene-title{position:static;padding:0;right:auto}
body .room-context .scene-hero .time-chip{position:static;flex-shrink:0;max-width:52%}
body .room-context .room-top{padding:2px 12px 0;justify-content:flex-end}
.art-icon{position:relative}
body .room-context .art-icon,body .selection .art-icon{display:inline-grid;place-items:center;width:42px;height:42px;min-height:0;padding:0;background:var(--night-2);color:var(--gold-2);border:1px solid var(--gold-dark)}
.art-peek{display:none;position:absolute;top:calc(100% + 6px);right:0;width:min(280px,80vw);aspect-ratio:3/2;object-fit:cover;border:2px solid var(--gold);border-radius:8px;box-shadow:0 10px 26px #000c;z-index:20;pointer-events:none}
@media(hover:hover){.art-icon:hover .art-peek{display:block}}
.art-icon:focus-visible .art-peek{display:block}
body .selection .combat-opponent-art{display:block;width:min(100%,360px);height:auto;min-height:0;padding:0;margin:8px 0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#f8f5ed}
.combat-opponent-portrait{display:block;width:100%;aspect-ratio:3/2;object-fit:cover}
body .selection h3 .art-icon{order:2}
/* Tienda por secciones */
.shop-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.shop-tabs{display:flex;gap:6px;overflow-x:auto;padding:4px 0 10px;scrollbar-width:thin}
body .shop-tabs button{display:flex;align-items:center;gap:6px;white-space:nowrap;padding:7px 11px;min-height:40px}
body .shop-tabs button svg{width:18px;height:18px}
body .shop-tabs button[aria-pressed=true]{background:linear-gradient(180deg,var(--night-3),var(--night));color:var(--gold-2);border:2px solid var(--gold)}
.shop-list{display:grid;gap:8px;margin-bottom:12px}
.shop-group{margin:10px 0 2px;font-size:1rem;color:var(--gold-dark);text-transform:uppercase;letter-spacing:1px}
body .shop-list .game-action{display:block;text-align:left;padding:10px 12px;min-height:52px}
body .shop-list .action-content{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;align-items:center}
body .shop-list .action-symbol{grid-row:span 2;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--night);color:var(--gold-2);border:1px solid var(--gold)}
body .shop-list .action-label{font-weight:700}
body .shop-list .action-reason{grid-column:2;color:var(--ink-soft);font-size:.85rem}
body .shop-back{margin-top:8px;display:inline-flex;align-items:center;gap:6px}
body .shop-back svg{width:16px;height:16px}
.shop-grid .more-tile small{color:#c9d3dc}
/* La conversación siempre en terminal (telnet): pantalla oscura, letra de máquina, marco dorado del tema */
html body .reading{background:radial-gradient(ellipse at 50% 0,#13263a 0,#08111b 75%);color:#d5e1ea;font-family:ui-monospace,"Cascadia Mono","DejaVu Sans Mono","Liberation Mono",Menlo,Consolas,monospace;font-size:calc(var(--reading-size) - 2px);line-height:1.65;border:1px solid var(--gold-dark);box-shadow:inset 0 0 0 1px #000,inset 0 0 40px #0009,0 6px 18px #0008;
 --world:#d5e1ea;--place:#ecd394;--action:#8fd0ff;--discovery:#f2ca75;--danger:#ff8f86;--combat:#ffb37b;--secondary:#9fb3c4;--voice:#d6b8f2}
html body .reading h2{color:var(--gold);font-family:ui-monospace,"DejaVu Sans Mono",monospace;font-size:.8rem;letter-spacing:2px}
html body .reading h2::before{content:"> "}
html body .reading .event-kind{font-family:ui-monospace,"DejaVu Sans Mono",monospace;font-variant:normal;text-transform:uppercase;font-size:10.5px;letter-spacing:1px;opacity:.8}
html body .reading .event-location{color:var(--place);border-top:1px dashed #c9a24a55}
html body .reading .event-discovery,html body .reading .event-reward{background:#f2ca7514}
html body .reading .event-danger,html body .reading .event-combat,html body .reading .event-damage{background:#ff8f8612}
html body .reading .event-info{font-style:normal}
html body .reading-footer{color:#8fa3b5;font-style:normal}
html body .reading-footer::after{content:" ▌";color:var(--gold-2);animation:vt-cursor 1.1s steps(1) infinite}
@keyframes vt-cursor{50%{opacity:0}}
@media(prefers-reduced-motion:reduce){html body .reading-footer::after{animation:none}}
html body .terminal-feed{scrollbar-color:#c9a24a #08111b}
body details.history .reading{background:none;box-shadow:none}
/* En combate, el menú es compacto: la lectura manda */
html.combat-active body .quick-actions .action-grid{grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:5px}
html.combat-active body .quick-actions .action-grid button{min-height:54px;padding:5px 4px;border-width:1px}
html.combat-active body .quick-actions .action-symbol svg,html.combat-active body .quick-actions .action-symbol .control-icon{width:18px;height:18px}
html.combat-active body .quick-actions .action-label{font-size:.74rem}
html.combat-active body .quick-actions .action-reason{display:none}
html.combat-active body .quick-actions .panel-title{font-size:.95rem;margin-bottom:6px}
html.combat-active body .quick-actions{padding:10px}
html.combat-active body .room-context .selection{padding:7px 10px}
html.combat-active body .quick-actions .action-grid button{height:auto;overflow:visible}
html.combat-active body .quick-actions .action-label{display:block;line-height:1.15;overflow-wrap:anywhere}
/* Cabecera compacta: una franja para lugar y herramientas, una línea para el estado, combate mínimo */
html body .room-context{border-width:1px}
html body .room-context .scene-hero,html body .room-context .scene-hero-plain{display:flex;align-items:center;gap:6px;padding:6px 8px 4px}
html body .room-context .scene-title{flex:1;min-width:0;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
html body .room-context .scene-title h1{font-size:1.05rem;line-height:1.15;margin:0;text-shadow:none}
html body .room-context .scene-title p{font-size:.72rem;margin:0}
.scene-tools{display:flex;align-items:center;gap:4px;flex-shrink:0}
html body .room-context .scene-tools .time-chip{position:static;padding:0;width:30px;height:30px;justify-content:center;border-radius:7px;max-width:none}
html body .room-context .scene-tools .time-chip span:not([aria-hidden]){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
html body .room-context .scene-tools .time-chip svg{width:16px;height:16px}
html body .room-context .scene-tools .art-icon,html body .room-context .scene-tools .map-shortcut,html body .room-context .scene-tools .room-details summary{width:30px;height:30px;min-height:0;min-width:0;padding:0;display:inline-grid;place-items:center;font-size:13px;border-radius:7px}
html body .room-context .scene-tools .control-icon,html body .room-context .scene-tools svg{width:16px;height:16px}
html body .room-context .scene-tools .room-details{position:relative}
html body .room-context .scene-tools .room-metadata{position:absolute;right:0;top:36px;z-index:15;width:220px;padding:8px 10px;box-shadow:0 8px 20px #000a}
html body .hud{grid-template-columns:1fr 1fr auto auto;gap:6px;padding:2px 8px 6px}
html body .hud-bar{font-size:10.5px;gap:4px}
html body .hud-bar svg{width:13px;height:13px}
html body .hud-track{height:6px}
html body .hud-chip{padding:1px 6px;font-size:11px;gap:3px}
html body .hud-chip svg{width:12px;height:12px}
@media(max-width:420px){html body .hud{grid-template-columns:1fr 1fr auto auto}}
html body .room-context .selection,html.combat-active body .room-context .selection{margin:0 8px 6px;padding:5px 8px}
html body .room-context .selection h3,html.combat-active body .room-context .selection h3{font-size:12.5px;margin:0 0 3px;line-height:1.2}
html body .room-context .selection .art-icon{width:26px;height:26px}
html body .room-context .selection .art-icon svg{width:14px;height:14px}
html body .combat-vital-row{grid-template-columns:62px 1fr;margin:2px 0;gap:6px}
html body .combat-vital-row small{font-size:10px}
html body .combat-vital-track{height:5px}
html body .room-context .selection p,html.combat-active body .room-context .selection p{font-size:10.5px;margin:2px 0 0;line-height:1.3}
html body .reading .reading-tools{gap:4px;margin:0 0 4px}
html body .reading .reading-tools button{min-height:28px;min-width:28px;width:28px;height:28px;padding:0;border-radius:6px}
html body .reading .reading-tools svg,html body .reading .reading-tools .control-icon{width:14px;height:14px}
html body .reading{padding:8px 12px 10px}
/* Combate mínimo: ambos combatientes en una línea fina, sin texto de ayuda */
html body .combat-vitals{display:grid;grid-template-columns:1fr 1fr;gap:6px}
html body .combat-vital-row{grid-template-columns:auto 1fr;margin:0;gap:4px}
html body .combat-vital-row small{font-size:9.5px;max-width:64px}
html body .combat-vital-track{height:4px}
html body .room-context .selection p:last-of-type:not(:first-of-type){display:none}
html body .room-context .selection h3,html.combat-active body .room-context .selection h3{font-size:11.5px;margin:0 0 2px}
html body .room-context .selection .art-icon{width:22px;height:22px}
/* Barra inferior: cruceta a la izquierda, pestañas a la derecha; dock compacto y legible */
html body #navigation.with-travel{display:grid;grid-template-columns:140px 1fr;gap:6px;align-items:center;padding:4px 6px}
html body #navigation.with-travel .travel-pad{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,38px);gap:3px;justify-items:center;align-items:center;margin:0;padding:0;background:none;border:0}
html body #navigation.with-travel .travel-pad .travel-norte{grid-area:1/2}
html body #navigation.with-travel .travel-pad .travel-oeste{grid-area:2/1}
html body #navigation.with-travel .travel-pad .travel-center{grid-area:2/2}
html body #navigation.with-travel .travel-pad .travel-este{grid-area:2/3}
html body #navigation.with-travel .travel-pad .travel-sur{grid-area:3/2}
html body #navigation .travel-pad button{width:44px;height:38px;min-height:0;min-width:0;padding:0;display:grid;place-items:center;background:radial-gradient(circle at 50% 35%,var(--night-3),var(--night) 80%);color:var(--gold-2);border:1px solid var(--gold-dark);border-radius:8px;box-shadow:inset 0 0 0 1px #000,0 2px 0 #000a}
html body #navigation .travel-pad button:disabled{opacity:.3}
html body #navigation .travel-pad button:hover:not(:disabled){border-color:var(--gold)}
html body #navigation .travel-pad svg{width:20px;height:20px}
html body #navigation .travel-pad .travel-center:not(button){color:var(--gold-dark);font-size:16px}
html.reading-adventure body .app{padding-bottom:var(--nav-h)}
html body #navigation .game-tabs{grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
html body #navigation .game-tabs button{height:46px;min-height:0;padding:3px 1px;gap:2px}
html body #navigation .game-tabs button svg{width:18px;height:18px}
html body #navigation .game-tabs .tab-label{font-size:11px;line-height:1.1;letter-spacing:-.3px}
html body #navigation.with-travel .game-tabs{grid-template-columns:repeat(3,1fr);grid-auto-rows:38px;gap:3px}
html body #navigation.with-travel .game-tabs button{height:38px;min-height:0;padding:2px;gap:1px}
html body #navigation.with-travel .game-tabs button svg{width:16px;height:16px}
html body #navigation.with-travel .game-tabs .tab-label{font-size:11px;line-height:1;letter-spacing:-.2px}
/* ===== Paleta anime alegre (2026-10-09): menos vintage, más color ===== */
:root{--night:#2b3fb8;--night-2:#3a52d6;--night-3:#5a74f0;--gold:#ffc83d;--gold-2:#ffe07a;--gold-dark:#f0a020;--parchment:#f6f9ff;--parchment-2:#e6eeff;--parchment-3:#ffffff;--ink:#1d2550;--ink-soft:#56638f;
 --serif:"Nunito","Varela Round","M PLUS Rounded 1c","Trebuchet MS","Segoe UI",system-ui,sans-serif;background:#2a2f8f}
html body{background:linear-gradient(180deg,#4f8dff 0,#6a5cf0 45%,#3a2a9a 100%) fixed;font-family:var(--serif)}
html body .card{background:linear-gradient(180deg,#ffffff,#f3f7ff);border:2px solid #9fb6ff;box-shadow:0 6px 0 #2b3fb833,0 10px 24px #1a1f6b55;border-radius:16px}
html body button{background:linear-gradient(180deg,#ffffff,#e8efff);border:2px solid #9fb6ff;color:var(--ink);border-radius:12px;box-shadow:0 3px 0 #7f97ee}
html body button:hover:not(:disabled){background:linear-gradient(180deg,#ffffff,#f0f5ff);border-color:var(--night-3)}
html body .primary,html body .primary:hover:not(:disabled){background:linear-gradient(180deg,#ffd75e,#ffb020);color:#3a2300;border:2px solid #e08a00;box-shadow:0 3px 0 #b86d00}
html body .brand{background:linear-gradient(90deg,#3a52d6,#7a5cf0);border:2px solid #ffe07a;border-radius:16px}
html body .brand a,html body .brand a small{color:#fff}
html body .room-context{background:linear-gradient(135deg,#3a52d6,#6a4ff0);border:2px solid #ffe07a;border-radius:16px}
html body .room-context .scene-hero,html body .room-context .scene-hero-plain{background:none}
html body .room-context .scene-title p{color:#ffe07a}
html body .room-context .scene-tools .time-chip,html body .room-context .scene-tools .art-icon,html body .room-context .scene-tools .map-shortcut,html body .room-context .scene-tools .room-details summary{background:#ffffff26;border:1px solid #ffffff80;color:#fff}
html body .hud-bar{color:#fff}
html body .hud-track{background:#1d255066;border-color:#ffffff66}
html body .hud-life .hud-fill{background:linear-gradient(90deg,#ff4f7b,#ff8fa3)}
html body .hud-energy .hud-fill{background:linear-gradient(90deg,#2fd27a,#9ff07a)}
html body .hud-chip{background:#ffffff26;border:1px solid #ffe07a;color:#fff}
html body .reading{background:linear-gradient(180deg,#151b45,#0e1233);border:2px solid #7f97ee;border-radius:16px;color:#eef1ff;
 --world:#eef1ff;--place:#7fe6ff;--action:#9fd0ff;--discovery:#ffe07a;--danger:#ff7fa0;--combat:#ffab6b;--secondary:#aab4e0;--voice:#d8b4ff}
html body .reading h2{color:#7fe6ff}
html body .reading .event-location{border-top-color:#7fe6ff55}
html body .reading-footer::after{color:#7fe6ff}
html body .reading .reading-tools button{background:#2b3fb8;color:#fff;border:1px solid #7f97ee}
html body .quick-actions .action-grid button,html body .action-grid button,html body .action-grid button:hover:not(:disabled){background:linear-gradient(160deg,#5a74f0,#3a2fb0);border:2px solid #9fb6ff;box-shadow:0 4px 0 #23208a;color:#fff}
html body .action-grid .action-label{color:#fff}
html body .action-grid .action-reason{color:#dfe6ff}
html body .action-grid button[data-tone=fight]{background:linear-gradient(160deg,#ff6b6b,#c22a5a);border-color:#ffb3c1;box-shadow:0 4px 0 #8a1640}
html body .action-grid button[data-tone=trade]{background:linear-gradient(160deg,#ffc83d,#f08a00);border-color:#ffe9a8;box-shadow:0 4px 0 #a85a00}
html body .action-grid button[data-tone=talk]{background:linear-gradient(160deg,#b78cff,#7a3fd8);border-color:#e2ccff;box-shadow:0 4px 0 #4f2399}
html body .action-grid button[data-tone=care]{background:linear-gradient(160deg,#3fe0c0,#14a08a);border-color:#b8fff0;box-shadow:0 4px 0 #0b6a5c}
html body .action-grid button[data-tone=explore]{background:linear-gradient(160deg,#5ac8ff,#2a7fe0);border-color:#c7ecff;box-shadow:0 4px 0 #17509a}
html body .action-grid .action-symbol{color:#fff}
html body .panel-title{color:var(--night)}html body .panel-title::after{background:linear-gradient(90deg,#9fb6ff,transparent)}
html body .stat,html body .attribute,html body .tile,html body .inventory-item,html body .creature-entry,html body .npc,html body .exit-row,html body details.history,html body .selling-section,html body .visual-3d{background:linear-gradient(180deg,#ffffff,#eef3ff);border:2px solid #c3d2ff;border-radius:12px;color:var(--ink)}
html body .attribute-icon,html body .item-emblem,html body .exit-arrow,html body .shop-list .action-symbol{background:linear-gradient(160deg,#5a74f0,#3a2fb0);color:#fff;border:1px solid #9fb6ff}
html body .pill,html body .tile .pill,html body .inventory-item .pill{background:#e6eeff;color:var(--night);border:1px solid #9fb6ff}
html body .stat-meter-fill{background:linear-gradient(90deg,#ffb020,#ffe07a)}
html body .more-tile,html body .shop-grid .more-tile{background:linear-gradient(160deg,#5a74f0,#3a2fb0);border:2px solid #9fb6ff;color:#fff}
html body .more-tile small,html body .shop-grid .more-tile small{color:#dfe6ff}
html body .shop-tabs button[aria-pressed=true]{background:linear-gradient(180deg,#ffd75e,#ffb020);color:#3a2300;border-color:#e08a00}
html body .shop-group{color:var(--night-2)}
html body .room-context .selection,html.combat-active body .room-context .selection{background:linear-gradient(135deg,#ff6b8b,#b0236a);border:1px solid #ffc2d1}
html body .combat-vital-row:first-child .combat-vital-fill{background:linear-gradient(90deg,#2fd27a,#9ff07a)}
html body .combat-vital-row:last-child .combat-vital-fill{background:linear-gradient(90deg,#ffd75e,#ff8a3d)}
html body #navigation{background:linear-gradient(180deg,#3a52d6,#2b3fb8);border:2px solid #ffe07a;border-radius:18px;box-shadow:0 -4px 18px #1a1f6b88}
html body #navigation .game-tabs button{color:#dfe6ff}
html body #navigation .game-tabs button[aria-current=page]{color:#3a2300;background:linear-gradient(180deg,#ffe07a,#ffb020);border-color:#fff}
html body #navigation .game-tabs button[aria-current=page] svg{filter:none}
html body #navigation .travel-pad button{background:linear-gradient(160deg,#5ac8ff,#2a7fe0);color:#fff;border:2px solid #c7ecff;box-shadow:0 3px 0 #17509a}
html body #navigation .travel-pad .travel-local{background:linear-gradient(160deg,#ffd75e,#f08a00);border-color:#ffe9a8;box-shadow:0 3px 0 #a85a00}
html body .map-heading h1{color:#fff}
html body .discovered-scroll{background:radial-gradient(circle at 30% 20%,#ffffff,#e6eeff 70%);border:2px solid #9fb6ff}
html body .app-footer{color:#e6ecff}
html body .notice{background:#fff;border-left-color:#ffb020}
/* Fondo claro como la versión original, con la iconografía y los colores alegres */
:root{background:#e8f1ff}
html body{background:linear-gradient(180deg,#eaf3ff 0,#f3ecff 55%,#fff4e6 100%) fixed}
html body .map-heading h1{color:var(--night)}
html body .map-heading .muted,html body .app-footer{color:#56638f}
/* Menos morado: azul cielo como base */
:root{--night:#1f6fd0;--night-2:#2f86e8;--night-3:#4aa8ff}
html body{background:linear-gradient(180deg,#e6f4ff 0,#effaff 55%,#fff6e6 100%) fixed}
html body .brand,html body .room-context{background:linear-gradient(135deg,#2f9bff,#1f6fd0)}
html body .quick-actions .action-grid button,html body .action-grid button,html body .action-grid button:hover:not(:disabled){background:linear-gradient(160deg,#4aa8ff,#2563d8);box-shadow:0 4px 0 #17489a}
html body .more-tile,html body .shop-grid .more-tile,html body .attribute-icon,html body .item-emblem,html body .exit-arrow,html body .shop-list .action-symbol{background:linear-gradient(160deg,#4aa8ff,#2563d8)}
html body #navigation{background:linear-gradient(180deg,#2f86e8,#1f6fd0)}
html body .card{border-color:#a8d0ff;box-shadow:0 6px 0 #1f6fd022,0 10px 24px #1f6fd033}
html body button{border-color:#a8d0ff;box-shadow:0 3px 0 #7fb2ee}
html body .reading{background:linear-gradient(180deg,#0f2142,#0a1630);border-color:#7fb2ee}
html body .reading .reading-tools button{background:#1f6fd0;border-color:#7fb2ee}
html body .panel-title::after{background:linear-gradient(90deg,#a8d0ff,transparent)}
html body .stat,html body .attribute,html body .tile,html body .inventory-item,html body .creature-entry,html body .npc,html body .exit-row,html body details.history,html body .selling-section,html body .visual-3d{background:linear-gradient(180deg,#ffffff,#eef7ff);border-color:#c3e0ff}
html body .pill,html body .tile .pill,html body .inventory-item .pill{background:#e6f3ff;border-color:#a8d0ff}
/* Acciones siempre pequeñas: la lectura manda */
html body .quick-actions .action-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
html body .quick-actions .action-grid button,html body .quick-actions .action-grid button:hover:not(:disabled){min-height:52px;height:auto;min-width:0;overflow:hidden;padding:5px 3px;border-width:1px;border-radius:10px;box-shadow:0 2px 0 #17489a}
html body .quick-actions .action-grid .action-content{gap:2px;min-width:0}
html body .quick-actions .action-grid .action-symbol svg,html body .quick-actions .action-grid .action-symbol .control-icon{width:17px;height:17px}
html body .quick-actions .action-grid .action-label{font-size:.72rem;line-height:1.12;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word;min-width:0}
html body .quick-actions .action-grid .action-reason{display:none}
html body .quick-actions{padding:8px 8px 6px}
html body .quick-actions .panel-title{font-size:.9rem;margin-bottom:5px;padding-bottom:3px}
@media(min-width:520px){html body .quick-actions .action-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
/* A⁻ / A⁺: más específico que el :root del tema, para que los botones de lectura vuelvan a mandar */
html.small-reading{--reading-size:14px}
html.large-reading{--reading-size:22px}
/* Mapa ilustrado con niebla: el dibujo sólo aparece alrededor de lo descubierto */
.discovered-map.with-world-art{overflow:hidden;background:radial-gradient(circle at 50% 40%,#f4f8ff,#dfe9f7 70%,#cfdcef)}
.discovered-map .world-art-cumbres{background-image:linear-gradient(180deg,#5b2a22,#a4482c 55%,#c9793f)}.discovered-map .world-art{position:absolute;z-index:0;background-size:100% 100%;background-repeat:no-repeat;pointer-events:none;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}
.discovered-map.with-world-art .discovered-roads{position:relative;z-index:1}
.discovered-map.with-world-art .discovered-place,.discovered-map.with-world-art .discovered-frontier{z-index:2}
html.playing-map body #navigation .game-tabs{grid-template-columns:repeat(7,minmax(0,1fr))}
html body .bestiary-now{background:linear-gradient(160deg,#ff6b6b,#c22a5a);color:#fff;border-color:#ffb3c1;margin-right:6px}
html body .selling-fold .selling-section h2{display:none}
html body .selling-fold{margin-top:12px}
html body .species-choice-list{display:grid;gap:8px;margin-top:6px}
html body .species-choice-card{display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:10px;padding:8px 10px;border:2px solid #c3d2ff;border-radius:12px;background:linear-gradient(180deg,#ffffff,#eef7ff);cursor:pointer;transition:border-color 130ms,background 130ms}
html body .species-choice-card:hover{background:linear-gradient(180deg,#ffffff,#e2eeff);border-color:var(--night-2,#2f86e8)}
html body .species-choice-card:has(input:checked){border:2px solid var(--night,#1f6fd0);background:#e0eeff;box-shadow:0 0 0 2px #7fb2ee55}
html body .species-choice-card input[type=radio]{width:18px;height:18px;margin:0;accent-color:var(--night,#1f6fd0);cursor:pointer}
html body .species-choice-card .species-thumbnail{width:50px;height:66px;object-fit:cover;border-radius:8px;flex-shrink:0;border:1px solid #a8d0ff;background:#f0f5fa}
html body .species-choice-card .species-info{display:flex;flex-direction:column;gap:3px;min-width:0}
html body .species-choice-card .species-info strong{font-size:14px;color:var(--ink,#1d2550)}
html body .species-choice-card .species-desc{font-size:12px;line-height:1.35;color:var(--ink-soft,#56638f)}
html body .command-entry{margin-top:12px;padding-top:12px;border-top:1px solid #c3d2ff}
html body .bestiary-behavior{border-top-color:#c3d2ff}

/* Class decisions follow the reading; longer help never shrinks the chronicle. */
html.combat-active body .quick-actions .action-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
html.combat-active body .quick-actions .action-grid button{min-height:44px;min-width:44px;padding:9px; text-align:left}
html.combat-active body .quick-actions .action-grid .action-label{font-size:.9rem;line-height:1.3}
html.combat-active body .quick-actions .action-grid .action-description,
html.combat-active body .quick-actions .action-grid .action-reason{display:block;font-size:.8rem;line-height:1.4;color:#fff}
html.combat-active body .quick-actions .capability-choice:disabled{opacity:1;background:#34445b;color:#fff;border-style:dashed;box-shadow:none}
html.combat-active body .quick-actions{padding:8px;margin:8px 0}
html.combat-active body .quick-actions .combat-vitals{margin:0 0 6px}
html.combat-active body .quick-actions .panel-title{margin:0 0 5px;text-align:center}
html.combat-active body .quick-actions .action-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
html.combat-active body .quick-actions .action-grid button{min-height:48px;padding:5px 4px;text-align:center;justify-content:center}
html.combat-active body .quick-actions .action-grid .action-content{gap:3px}
html.combat-active body .quick-actions .action-grid .action-label{font-size:.76rem;line-height:1.12}
html.combat-active body .quick-actions .action-grid .action-description,html.combat-active body .quick-actions .action-grid .action-reason{display:none}
html.combat-active body .quick-actions .combat-vital-row{grid-template-columns:74px 1fr;gap:6px;margin:3px 0}
html.combat-active body .quick-actions .combat-vital-track{height:8px}
.class-actions{margin:12px 0;display:grid;gap:12px}
.class-actions p{font-size:.95rem}
html body .reading .event[aria-label^="Velo"]{border-left:4px solid #8fd0ff;background:#8fd0ff18}
html body .reading .event[aria-label^="Apertura"]{border-left:4px solid #ffe07a;background:#ffe07a18}
html body .reading .event[aria-label^="Traba"]{border-left:4px solid #ffb37b;background:#ffb37b18}
html body .reading .event[aria-label^="Curación"]{border-left:4px solid #82e8af;background:#82e8af18}

/* Character sheet and persistent return path: readable at 390px. */
html body .submenu-context{position:sticky;top:0;z-index:2;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 0;background:var(--paper,#fff);border-bottom:1px solid var(--line);margin-bottom:14px}
html body .submenu-context button{min-height:44px;font-size:14px}
html body .submenu-context>span{font-size:14px;overflow-wrap:anywhere}
html body .character-progress{padding:14px 0;border-bottom:1px solid var(--line)}
html body .character-progress h2{margin:0 0 10px}
html body .character-progress label{display:block;font-size:16px;line-height:1.5}
html body .character-progress progress{display:block;width:100%;height:18px;margin:8px 0;accent-color:var(--blue)}
html body .character-progress .muted,html body .character-capabilities .muted{font-size:15px;line-height:1.5}
html body .attribute-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
html body .attribute{min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px}
html body .attribute small{font-size:15px;color:var(--night,#152b4a)}
html body .attribute strong{font-size:21px;margin-left:auto}
html body .attribute .attribute-description{flex-basis:100%;font-size:15px;line-height:1.5;margin:0;color:var(--night,#152b4a);overflow-wrap:anywhere}
html body .class-action-list{padding-left:22px;display:grid;gap:12px}
html body .class-action-list p{margin:4px 0}
html body #navigation:not(.with-travel) .game-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}
html body #navigation:not(.with-travel) .game-tabs button{min-height:48px;height:auto;padding:6px 2px}
html body #navigation:not(.with-travel) .game-tabs .tab-label{font-size:12px;letter-spacing:normal}
html body button:focus-visible,html body summary:focus-visible,html body #main:focus-visible{outline:3px solid var(--blue,#235fba);outline-offset:3px}

/* Unspent attribute points; actions and costs come from the server. */
html body .pa-notice{padding:12px;border:2px solid var(--blue);border-radius:12px;font-size:16px;line-height:1.5;background:#eef7ff;color:var(--night,#152b4a)}
html body .attribute .attribute-upgrade{min-width:44px;min-height:44px;padding:6px;font-size:24px;flex-shrink:0}
html body #navigation .game-tabs button{position:relative}
html body #navigation .pa-badge{position:absolute;top:0;right:5px;color:#ffe07a;font-size:20px;line-height:1}
html body #navigation button[aria-current=page] .pa-badge{color:#3a2300}
@media(max-width:440px){html body .attribute-grid{grid-template-columns:minmax(0,1fr)}}

/* Ficha del Númen (Piloto) */
html body .numen-roster-section{margin:16px 0}
html body .numen-card{background:linear-gradient(180deg,#ffffff,#f3f7fc);border:2px solid #b6cced;border-radius:12px;padding:12px;margin:8px 0;color:var(--ink)}
html body .numen-card.numen-active{border-color:#5a74f0;box-shadow:0 0 0 1px #5a74f0,0 3px 10px rgba(90,116,240,0.15)}
html body .numen-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
html body .numen-emblem{display:grid;place-items:center;width:38px;height:38px;min-width:38px;background:linear-gradient(160deg,#5a74f0,#3a2fb0);color:#fff;border-radius:10px;border:1px solid #9fb6ff}
html body .numen-emblem svg,html body .numen-emblem .control-icon{width:20px;height:20px}
html body .numen-title-group{flex:1 1 180px;min-width:0}
html body .numen-title-group h3{margin:0;font-size:1.1rem;line-height:1.2;color:var(--ink)}
html body .numen-title-group p{margin:2px 0 0;font-size:0.85rem}
html body .numen-pill-active{background:#235447!important;color:#fff!important;border-color:#173f34!important;font-weight:600}
html body .numen-details{display:grid;gap:6px;margin:10px 0 6px;font-size:0.9rem}
html body .numen-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
html body .numen-stars{color:#d4a017;font-size:1.05rem;letter-spacing:2px}
html body .numen-care-status .pill{margin:0 2px}
html body .numen-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;padding-top:8px;border-top:1px dashed #b6cced}
html body .numen-actions-title{width:100%;margin:0 0 4px;font-size:0.85rem;color:var(--muted);font-weight:600}
html body .numen-care-hint{margin:8px 0 0;font-size:0.82rem;font-style:italic}
html body .numen-shelter-heading{margin:16px 0 6px;font-size:1rem;color:var(--night-2)}
html body .hud-numen{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;font-size:0.78rem;line-height:1.1;cursor:pointer}
html body .hud-numen svg{width:14px;height:14px}
html body .numen-status-line{margin:4px 0 8px;font-weight:600;color:var(--ink)}
html body .numen-last-reaction{margin:4px 0 0;font-style:italic;font-size:0.88rem}
html body .pill.care-good{background:#dcfce7;color:#14532d;border-color:#86efac}
html body .pill.care-hungry{background:#fef3c7;color:#78350f;border-color:#fcd34d}
html body .pill.care-need{background:#e0e7ff;color:#1e3a8a;border-color:#a5b4fc}
html body .numen-companion-view{gap:12px}
html body .numen-art-frame{position:relative;display:grid;place-items:center;min-height:220px;padding:18px;border-radius:18px;border:2px solid #9fb6ff;background:radial-gradient(circle at 50% 35%,#ffffff,#dcebff 75%);overflow:hidden;box-shadow:inset 0 0 18px rgba(47,134,232,0.12)}
html body .numen-art-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;z-index:1}
html body .numen-art-frame.has-art .numen-art-fallback{display:none}
html body .numen-silhouette{font-size:4.2rem;line-height:1;filter:drop-shadow(0 6px 10px rgba(31,111,208,0.22))}
html body .numen-art-img{max-width:100%;max-height:260px;width:auto;height:auto;object-fit:contain;border-radius:14px;z-index:1}
html body .numen-response-badge{position:absolute;top:10px;right:12px;z-index:2;padding:4px 10px;border-radius:999px;background:#fff4cc;border:2px solid #f0a020;color:#3a2300;font-weight:700;font-size:0.85rem;box-shadow:0 3px 8px rgba(0,0,0,0.15)}
html body .numen-reaction-box{margin:0;padding:12px 14px;border-left:4px solid var(--night-2,#2f86e8);background:#eef6ff;border-radius:10px;font-style:italic;color:var(--ink)}
html body .numen-feeling-panel p{margin:4px 0}
html body .numen-roster-item{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:10px 12px}
html body .numen-roster-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
html body .numen-home-safe-note{font-size:0.86rem;color:#3b6e3f;margin:6px 0 0;font-style:italic}
@keyframes numen-breathe-happy{
 0%,100%{transform:translateY(0) scale(1)}
 50%{transform:translateY(-6px) scale(1.03)}
}
@keyframes numen-look-hungry{
 0%,100%{transform:translateY(1px) rotate(0deg) scale(0.99)}
 40%{transform:translateY(0) rotate(-2deg) scale(1.01)}
 75%{transform:translateY(1px) rotate(2deg) scale(1)}
}
@keyframes numen-breathe-low{
 0%,100%{transform:translateY(5px) rotate(-3deg) scale(0.96);opacity:0.92}
 50%{transform:translateY(8px) rotate(-4deg) scale(0.94);opacity:0.86}
}
@keyframes numen-react-jump{
 0%,100%{transform:translateY(0) scale(1)}
 35%{transform:translateY(-16px) scale(1.08)}
 65%{transform:translateY(-4px) scale(1.02)}
}
@keyframes numen-react-heart{
 0%,100%{transform:scale(1)}
 30%{transform:scale(1.09) rotate(3deg)}
 60%{transform:scale(1.05) rotate(-3deg)}
}
@keyframes numen-react-purr{
 0%,100%{transform:translateX(0)}
 25%{transform:translateX(-3px) translateY(-2px)}
 50%{transform:translateX(3px) translateY(-2px)}
 75%{transform:translateX(-2px)}
}
html body .numen-art-frame.numen-mood-contento .numen-silhouette,
html body .numen-art-frame.numen-mood-contento .numen-art-img{animation:numen-breathe-happy 2.6s ease-in-out infinite}
html body .numen-art-frame.numen-mood-hambre .numen-silhouette,
html body .numen-art-frame.numen-mood-hambre .numen-art-img{animation:numen-look-hungry 4.2s ease-in-out infinite}
html body .numen-art-frame.numen-mood-decaido .numen-silhouette,
html body .numen-art-frame.numen-mood-decaido .numen-art-img{animation:numen-breathe-low 5.5s ease-in-out infinite}
html body .numen-art-frame.numen-anim-jump .numen-silhouette,
html body .numen-art-frame.numen-anim-jump .numen-art-img{animation:numen-react-jump 0.65s ease-out 2}
html body .numen-art-frame.numen-anim-heart .numen-silhouette,
html body .numen-art-frame.numen-anim-heart .numen-art-img{animation:numen-react-heart 0.7s ease-in-out 2}
html body .numen-art-frame.numen-anim-purr .numen-silhouette,
html body .numen-art-frame.numen-anim-purr .numen-art-img{animation:numen-react-purr 0.55s ease-in-out 3}
@media(prefers-reduced-motion:reduce){
 html body .numen-art-frame .numen-silhouette,
 html body .numen-art-frame .numen-art-img{animation:none!important;transition:none!important}
}
html.reduced-motion body .numen-art-frame .numen-silhouette,
html.reduced-motion body .numen-art-frame .numen-art-img{animation:none!important;transition:none!important}
@media(max-width:390px){
 html body .numen-card{padding:10px 8px}
 html body .numen-heading{gap:6px}
 html body .numen-emblem{width:32px;height:32px;min-width:32px}
 html body .numen-title-group h3{font-size:1rem}
 html body .numen-title-group p{font-size:0.8rem}
 html body .numen-details{font-size:0.85rem;gap:5px}
 html body .numen-actions button{min-height:44px}
 html body .numen-care-buttons{grid-template-columns:minmax(0,1fr)}
}

/* --- TAMAGOTCHI CLÁSICO --- */
html body .tamagotchi-container {
 display: flex;
 flex-direction: column;
 align-items: center;
 width: 100%;
 max-width: 440px;
 margin: 0 auto;
 padding-bottom: var(--nav-h, 190px);
 box-sizing: border-box;
}

html body .tamagotchi-egg {
 position: relative;
 width: 100%;
 max-width: 320px;
 margin: 0 auto 16px;
 padding: 26px 18px 22px;
 border-radius: 50% 50% 46% 46% / 58% 58% 44% 44%;
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #ffd6cc 24%, #f28b7d 68%, #d9534f 100%);
 box-shadow:
  inset 0 4px 12px rgba(255, 255, 255, 0.85),
  inset 0 -8px 16px rgba(0, 0, 0, 0.35),
  0 12px 28px rgba(0, 0, 0, 0.22);
 display: flex;
 flex-direction: column;
 align-items: center;
 border: 3px solid rgba(0, 0, 0, 0.15);
 box-sizing: border-box;
 user-select: none;
}

/* Color according to Númen model */
html body .tamagotchi-egg.numen-egg-a { /* Perro / canino */
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #ffd4be 25%, #fa8060 68%, #d95032 100%);
}
html body .tamagotchi-egg.numen-egg-b { /* Gato / felino */
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #d4f7eb 25%, #4ecdc4 68%, #2ea098 100%);
}
html body .tamagotchi-egg.numen-egg-c { /* Lagarto */
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #eaf8d0 25%, #9fd848 68%, #6ba820 100%);
}
html body .tamagotchi-egg.numen-egg-d { /* Nutria */
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #d8f1fc 25%, #5dade2 68%, #2e86c1 100%);
}
html body .tamagotchi-egg.numen-egg-e { /* Zorro */
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #ffe3c4 25%, #f39c12 68%, #d35400 100%);
}
html body .tamagotchi-egg.numen-egg-f { /* Búho */
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #eedeff 25%, #af7ac5 68%, #884ea0 100%);
}
html body .tamagotchi-egg.numen-egg-g { /* Cabra */
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #fef5d1 25%, #f1c40f 68%, #d4ac0d 100%);
}
html body .tamagotchi-egg.numen-egg-h { /* Tortuga */
 background: radial-gradient(circle at 35% 25%, #ffffff 0%, #daf7dc 25%, #52be80 68%, #1e8449 100%);
}

/* Subtle decorative glossy highlight reflection */
html body .tamagotchi-egg::before {
 content: "";
 position: absolute;
 top: 12px;
 left: 28px;
 width: 56px;
 height: 22px;
 border-radius: 50%;
 background: rgba(255, 255, 255, 0.55);
 transform: rotate(-32deg);
 pointer-events: none;
}

/* Decorative printed dots */
html body .tamagotchi-decor-dots {
 display: flex;
 gap: 6px;
 margin-top: 10px;
 opacity: 0.55;
}
html body .tamagotchi-decor-dots span {
 width: 4px;
 height: 4px;
 border-radius: 50%;
 background: #333;
 box-shadow: inset 0 1px 1px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.4);
}

html body .tamagotchi-brand {
 font-size: 10px;
 font-weight: 800;
 letter-spacing: 2.5px;
 color: rgba(30, 30, 30, 0.75);
 text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
 margin-bottom: 6px;
 text-transform: uppercase;
}

/* Sunken beveled frame around screen */
html body .tamagotchi-bezel {
 width: 100%;
 max-width: 240px;
 background: linear-gradient(180deg, #32363a 0%, #1e2023 100%);
 border-radius: 18px;
 padding: 8px 10px 10px;
 box-shadow:
  inset 2px 2px 6px rgba(0, 0, 0, 0.8),
  inset -2px -2px 4px rgba(255, 255, 255, 0.2),
  0 4px 8px rgba(0, 0, 0, 0.3);
 border: 3px solid #18191c;
 box-sizing: border-box;
}

/* LCD screen */
html body .tamagotchi-screen {
 position: relative;
 background: #9ea77a;
 border-radius: 10px;
 box-shadow:
  inset 3px 3px 8px rgba(0, 0, 0, 0.55),
  inset -1px -1px 3px rgba(255, 255, 255, 0.3);
 border: 2px solid #778157;
 overflow: hidden;
 display: flex;
 flex-direction: column;
 align-items: center;
 padding: 6px 6px 8px;
 box-sizing: border-box;
 transition: background 0.4s ease, border-color 0.4s ease;
}

html body .tamagotchi-screen::after {
 content: "";
 position: absolute;
 inset: 0;
 background: repeating-linear-gradient(
  0deg,
  rgba(0, 0, 0, 0.035) 0px,
  rgba(0, 0, 0, 0.035) 1px,
  transparent 1px,
  transparent 2px
 );
 pointer-events: none;
}

html body .tamagotchi-screen.is-night {
 background: #25332a;
 border-color: #1a261f;
 box-shadow:
  inset 3px 3px 10px rgba(0, 0, 0, 0.85),
  inset -1px -1px 2px rgba(255, 255, 255, 0.08);
}

/* Top menu inside LCD */
html body .tamagotchi-menu {
 display: flex;
 justify-content: space-between;
 width: 100%;
 margin-bottom: 4px;
 padding: 0 2px;
 gap: 3px;
 z-index: 2;
}

html body .tamagotchi-menu-btn {
 flex: 1;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 background: transparent;
 border: 1px solid transparent;
 border-radius: 4px;
 padding: 3px 0 2px;
 cursor: pointer;
 font-size: 13px;
 line-height: 1;
 color: #242b18;
 min-height: 34px;
 transition: background 0.1s, color 0.1s;
 touch-action: manipulation;
}

html body .tamagotchi-screen.is-night .tamagotchi-menu-btn {
 color: #5c7463;
}

html body .tamagotchi-menu-btn.is-selected {
 background: #242b18;
 color: #9ea77a;
 border-color: #242b18;
}

html body .tamagotchi-screen.is-night .tamagotchi-menu-btn.is-selected {
 background: #465c4c;
 color: #1a261f;
 border-color: #465c4c;
}

html body .tamagotchi-menu-label {
 font-size: 8px;
 font-weight: 800;
 text-transform: uppercase;
 letter-spacing: -0.3px;
 margin-top: 1px;
}

/* LCD Canvas */
html body .tamagotchi-canvas {
 width: 100%;
 aspect-ratio: 4 / 3;
 max-width: 216px;
 height: auto;
 image-rendering: pixelated;
 image-rendering: -moz-crisp-edges;
 image-rendering: crisp-edges;
 background: transparent;
 display: block;
 z-index: 1;
 cursor: pointer;
}

/* Physical A, B, C Buttons */
html body .tamagotchi-buttons-row {
 display: flex;
 justify-content: center;
 align-items: center;
 gap: 20px;
 margin-top: 16px;
 width: 100%;
}

html body .tamagotchi-btn {
 width: 44px;
 height: 44px;
 min-width: 44px;
 min-height: 44px;
 border-radius: 50%;
 border: 1px solid rgba(0, 0, 0, 0.25);
 background: radial-gradient(circle at 35% 30%, #ffffff 0%, #e2e2e2 65%, #b4b4b4 100%);
 box-shadow:
  0 4px 6px rgba(0, 0, 0, 0.35),
  inset 0 1px 2px rgba(255, 255, 255, 0.95),
  inset 0 -2px 3px rgba(0, 0, 0, 0.25);
 cursor: pointer;
 font-weight: 800;
 font-size: 15px;
 color: #2d3748;
 display: flex;
 align-items: center;
 justify-content: center;
 touch-action: manipulation;
 user-select: none;
 transition: transform 0.08s ease, box-shadow 0.08s ease;
}

html body .tamagotchi-btn:hover {
 background: radial-gradient(circle at 35% 30%, #ffffff 0%, #ebebeb 65%, #bfbfbf 100%);
}

html body .tamagotchi-btn:active {
 transform: translateY(3px);
 box-shadow:
  0 1px 2px rgba(0, 0, 0, 0.4),
  inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

html body .tamagotchi-btn-b {
 margin-top: 10px;
}

html body .tamagotchi-btn-b:active {
 transform: translateY(13px);
}

html body .tamagotchi-btn-hint {
 font-size: 0.72rem;
 color: rgba(255, 255, 255, 0.9);
 text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
 margin-top: 8px;
 font-weight: 700;
 letter-spacing: 0.3px;
 text-align: center;
}

html body .numen-tamagotchi-details {
 width: 100%;
 max-width: 440px;
 margin: 0 auto 12px;
 box-sizing: border-box;
}

html body .sr-only {
 position: absolute !important;
 width: 1px !important;
 height: 1px !important;
 padding: 0 !important;
 margin: -1px !important;
 overflow: hidden !important;
 clip: rect(0, 0, 0, 0) !important;
 white-space: nowrap !important;
 border: 0 !important;
}
html body .vaisork-dm-sheet{padding:12px;border:2px solid #c3d2ff;border-radius:14px;background:linear-gradient(180deg,#ffffff,#f4f8ff);color:var(--ink)}
html body .vaisork-dm-header{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
html body .vaisork-dm-portrait{width:110px;height:138px;object-fit:cover;border-radius:12px;border:2px solid #9fb6ff;flex-shrink:0}
html body .vaisork-dm-title{font-weight:700;font-size:1.05rem;color:var(--night,#1f6fd0)}
html body .vaisork-dm-prose,html body .vaisork-dm-list li{font-size:1.05rem;line-height:1.68;color:var(--ink)}
html body .vaisork-dm-list{display:grid;gap:10px;padding-left:20px}

/* Clases en creación: sin imágenes, dos columnas (radio + texto) */
html body .class-choice-card{grid-template-columns:auto 1fr}

/* Sección de otros personajes: botón crear otro */
html body .other-characters-section button{margin-top:4px}

/* Aviso de cuidados para Númen activo con hambre o decaído (sin barras ni números) */
html body .numen-care-notice{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;margin:4px 0 8px;background:linear-gradient(135deg,#fffbf0,#ffecc7);border:2px solid #ffb020;box-shadow:0 4px 12px rgba(255,176,32,0.18)}
html body .numen-care-notice.mood-down{background:linear-gradient(135deg,#f8f2ff,#ecdfff);border-color:#a87ffb;box-shadow:0 4px 12px rgba(168,127,251,0.18)}
html body .numen-notice-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#ffb020;color:#fff;flex-shrink:0}
html body .numen-care-notice.mood-down .numen-notice-icon{background:#8c52ff}
html body .numen-notice-content{flex:1;min-width:0}
html body .numen-notice-title{display:block;font-size:14px;font-weight:700;color:#442800;margin-bottom:2px}
html body .numen-care-notice.mood-down .numen-notice-title{color:#311b5c}
html body .numen-notice-msg{font-size:12.5px;line-height:1.35;color:#6b4712;margin:0}
html body .numen-care-notice.mood-down .numen-notice-msg{color:#503b75}
html body .numen-notice-btn{flex-shrink:0;white-space:nowrap;padding:7px 12px;font-size:12.5px}

/* Cuenta regresiva visible de 4 segundos en combate */
html body .combat-round-countdown{margin:8px 0 4px;padding:8px 10px;border-radius:10px;background:#26183a;border:1px solid #ff88a3;color:#fff}
html body .combat-round-bar{width:100%;height:7px;border-radius:4px;background:#3b2456;overflow:hidden;margin-bottom:5px}
html body .combat-round-fill{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,#ffb020,#ff6b8b);transition:width 0.1s linear}
html body .combat-round-label{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:#ffe8ee;margin:0}
html body .combat-round-label svg{width:16px;height:16px;color:#ff9eb5}

/* Móvil estrecho (390x844 y menores): crónica con altura máxima y scroll propio, salidas con elipsis sin deformar cuadrícula */
@media(max-width:600px){
 html body .reading{padding:10px 12px 8px}
 html body .terminal-feed{max-height:clamp(120px,25dvh,185px);overflow-y:auto}
 html body .reading .reading-tools{margin-bottom:4px}
 html body .reading h2{margin:0 0 4px;font-size:.85rem}
 html body .reading-footer{margin-top:4px;font-size:11px}
 html body .exit-row{grid-template-columns:30px 52px minmax(0,1fr);gap:6px;padding:6px 8px;min-height:42px}
 html body .exit-row strong{font-size:.9rem}
 html body .exit-name{font-size:.85rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 html body .numen-care-notice{flex-wrap:wrap;gap:8px;padding:10px 12px}
 html body .numen-notice-btn{width:100%;text-align:center;justify-content:center}
 html body .buzon-form textarea{width:100%;min-height:88px;padding:10px 12px;border:1px solid #aebca1;border-radius:10px;font:inherit;resize:vertical}
}

/* Grouped menus must fit narrow screens, including long catalog and room names. */
.master-management .stack,.master-management .field,.inventory-group,.inventory-stack{min-width:0;max-width:100%}
.master-management select,.master-management input{width:100%;min-width:0;max-width:100%}
.master-management button,.inventory-group button,.shop-tabs button{white-space:normal;overflow-wrap:anywhere;min-height:44px}
.master-management summary,.inventory-group summary,.inventory-stack summary{min-height:44px;overflow-wrap:anywhere}
.inventory-group .item-heading,.inventory-stack .item-heading{min-width:0}
.inventory-group .item-heading h3,.inventory-stack .item-heading h3{min-width:0;overflow-wrap:anywhere}

body .app{padding-top:max(10px,env(safe-area-inset-top))}
body .field input,body .field select{font-size:16px}
.mobile-hud{display:none}
@media(max-width:600px){
 html.reading-adventure body .app,html.playing-map body .app{padding-top:max(6px,env(safe-area-inset-top))}
 html body .reading-adventure .room-context .room-top{min-height:44px}
 html body .reading-adventure .room-details summary,html body .reading-adventure .room-context .map-shortcut{width:44px;min-width:44px;height:44px;min-height:44px;padding:0;font-size:16px}
 html body .mobile-hud{position:fixed;left:50%;bottom:calc(72px + env(safe-area-inset-bottom));transform:translateX(-50%);display:grid;grid-template-columns:1fr 1fr;gap:8px;width:calc(100% - 20px);max-width:560px;padding:5px 9px;background:linear-gradient(180deg,var(--night-3),var(--night));border:1px solid var(--gold-dark);border-radius:10px;box-shadow:0 2px 8px #0008;z-index:6;pointer-events:none}
 html body .mobile-hud .hud{display:contents}
 html body .mobile-hud .hud-bar{min-width:0;font-size:11px}
 html body .mobile-hud .hud-track{min-width:24px}
}
/* Goals notebook: touch-sized, readable on narrow screens. */
.goal-card{padding:12px;border:1px solid #c8b36b;border-radius:12px;background:#fff9e8}
.goal-card h3{margin-top:7px}
.achievement-entry{display:flex;align-items:center;gap:12px;padding:11px 8px;border-bottom:1px solid #c8b36b66}
.achievement-entry:last-child{border-bottom:0}
.achievement-medal{display:grid;place-items:center;flex:0 0 42px;height:42px;border:2px solid #a9a9a9;border-radius:50%;color:#777;background:#f0eee8;font-size:22px}
.achievement-entry.is-unlocked .achievement-medal{border-color:#da9b17;color:#9b6400;background:#fff0bd}
.achievement-copy{min-width:0;flex:1}
.achievement-copy h3{font-size:15px}
.achievement-copy p{font-size:13px;margin:2px 0 5px}
.achievement-copy small{display:block;text-align:right;font-size:11px;color:#6a5741}
.achievement-progress{height:8px;overflow:hidden;border-radius:99px;background:#e2ddce}
.achievement-progress span{display:block;height:100%;border-radius:inherit;background:#9b7a2d}
@media(min-width:600px){.goal-card{padding:15px}.achievement-entry{padding:13px 10px}}

/* Especializaciones: identidad, rangos y ecos con lectura compacta en móvil. */
.character-name{min-width:0}
.character-name>div:first-child{min-width:0}
.character-title{display:inline-flex;align-items:center;margin:4px 0 0;padding:4px 9px;border:1px solid #c89b43;border-radius:999px;background:#fff4d8;color:#624817;font-size:13px;font-weight:700}
.specialization-panel{display:grid;gap:8px;padding:14px 0;border-bottom:1px solid var(--line)}
.specialization-panel h2,.specialization-panel h3{margin:0}
.specialization-current{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:16px}
.rank-list,.rank-checklist{display:grid;gap:6px;margin:0;padding:0;list-style:none}
.rank-list li,.rank-check{display:flex;align-items:flex-start;gap:8px;padding:7px 9px;border-radius:8px;background:#f6f1e5}
.rank-checkmark{flex:0 0 20px;text-align:center;font-weight:800;color:#777}
.rank-earned .rank-checkmark{color:#267341}
.specialization-panel progress{width:100%;height:14px;accent-color:#9b7a2d}
.bestiary-creature-title{display:grid;gap:5px;min-width:0}
.bestiary-creature-title h3{margin:0;min-width:0}
.echo-badge{display:inline-flex;width:max-content;max-width:100%;flex-wrap:wrap;align-items:center;gap:5px;border:1px solid #b68b36;background:#fff3ce;color:#624817;font-size:12px}
.echo-badge>span[aria-hidden]{letter-spacing:1px;color:#a36f00}
.echo-power{font-weight:600}
.action-description{line-height:1.35}
@media(max-width:600px){
 html body .specialization-panel{gap:7px;padding:12px 0}
 html body .character-title{font-size:12px}
 html body .echo-badge{font-size:11px}
 html body .quick-actions .action-grid .specialization-action{min-height:64px}
}

.felicitaciones{margin:0 0 10px;padding:8px 12px;border:1px solid #d9c78e;border-left:4px solid #b68a32;border-radius:12px;background:#fffdf2;color:#3e412f;font-size:12px;line-height:1.35;overflow-wrap:anywhere}.felicitaciones h2{font-size:13px;margin:0 0 3px}.felicitaciones ul{padding-left:16px}.felicitaciones li{margin:2px 0}
