@import url('fuentes/fuentes.css');

:root{color-scheme:dark;font-family:"DM Sans",system-ui,sans-serif;color:#fff4f4;background:#141221;--muted:#beb0c7;--accent:#ff9caa;--line:#3b3049}
*{box-sizing:border-box}
body{margin:0}
button,input{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid #ffd396;outline-offset:3px}
[hidden]{display:none!important}
header{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px clamp(16px,4vw,56px);border-bottom:1px solid var(--line)}
.brand{display:inline-flex;align-items:center;gap:10px;color:inherit;text-decoration:none;font-family:"Barlow Condensed","Arial Narrow",sans-serif;font-weight:800;font-size:26px;letter-spacing:.07em;line-height:.86}
.brand small{display:block;font:700 9px/1.5 "DM Sans",sans-serif;letter-spacing:.23em;color:#edafbe;margin-top:4px}
.sun-logo{display:block;width:31px;height:31px;border-radius:50%;background:repeating-linear-gradient(to bottom,transparent 0 5px,#141221 5px 7px),linear-gradient(#ffd099,#ff729d);transform:rotate(-12deg)}
.demo{color:var(--muted);font-size:12px;text-align:right}
main{display:grid;grid-template-columns:minmax(0,1fr) minmax(285px,325px);gap:20px;max-width:1660px;margin:auto;padding:24px clamp(14px,3.5vw,52px)}
.scene{height:min(76vh,810px);min-height:520px;overflow:hidden;position:relative;border:1px solid #51415b;border-radius:20px;isolation:isolate;background:#61536f;scroll-margin-top:12px}
#world{position:absolute;inset:0;background:linear-gradient(145deg,#915779,#4a5270);touch-action:none;cursor:grab}
#world:active{cursor:grabbing}
canvas{width:100%;height:100%;display:block}
.scene-title,.scene-footer,.pin{pointer-events:none}
.scene-title{position:absolute;top:0;left:0;right:0;padding:26px 28px 35px;background:linear-gradient(180deg,#191126cf,transparent)}
h1{font:800 clamp(40px,5vw,75px)/.94 "Barlow Condensed","Arial Narrow",sans-serif;text-transform:uppercase;margin:6px 0 0;text-shadow:0 3px 18px #2112269c}
.map-panel{min-width:0}
.map-credit{margin:8px 3px 0;color:var(--muted);font-size:11px;line-height:1.4}
.map-credit a{color:inherit}
.map-destinations{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;margin-top:8px}
.map-destinations[hidden]{display:none}
.map-destinations button{min-height:36px;padding:0 12px;border:1px solid #e4b5d078;border-radius:8px;background:#241a32e8;color:#fff4f4;font-size:12px;font-weight:700}
.map-destinations button:hover{background:#503854}
.map-destinations button[aria-pressed=true]{background:#674459;border-color:#ffb7c1}
.map-tools{position:absolute;right:15px;bottom:52px;display:grid;gap:5px}
.map-tools button{width:43px;height:43px;border:1px solid #c8a2bb70;background:#1a142be8;color:white;border-radius:10px;font-size:22px}
.map-tools button:hover,.roster button:hover,#follow:hover{background:#47354f}
.scene-footer{display:flex;justify-content:space-between;gap:10px;position:absolute;inset:auto 0 0;padding:19px 16px 12px;background:linear-gradient(transparent,#181325ed);font-size:12px}
.scene-footer i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#fdb7a7;margin-right:5px}
.map-tip{color:#e3d0e2}
aside{align-self:start;padding:21px 18px;background:#211a2e;border:1px solid var(--line);border-radius:18px}
h2{font-size:21px;letter-spacing:-.04em;margin:0 0 16px}
.search-box{display:flex;gap:6px}
.search-box input{width:100%;min-width:0;border:1px solid #584661;background:#181323;border-radius:9px;padding:10px;color:white}
.search-box button{border:0;border-radius:9px;background:#ffadba;color:#30182b;font-weight:800;padding:0 12px}
.search-box button:hover{background:#ffc1c9}
#status{margin:12px 0 0;color:#ffc8d2;font-size:13px}
.roster{display:grid;gap:7px;margin-top:16px}
.roster button{display:grid;grid-template-columns:28px 1fr auto;align-items:center;gap:9px;text-align:left;min-width:0;min-height:43px;padding:6px 9px;border:1px solid var(--line);background:#2b2137;border-radius:9px;color:white}
.roster button[aria-pressed=true]{border-color:var(--accent);background:#45304a}
.swatch{display:grid;place-items:center;width:27px;height:27px;color:#24172b;background:var(--swatch);border-radius:7px;font-weight:800;font-size:12px}
.roster strong{font-size:13px;overflow-wrap:anywhere}
.roster small{color:var(--muted);font-size:11px}
.character{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
.character p{margin:0;font-size:13px}
#character-name{font-weight:700}
#character-place{color:var(--muted);font-size:11px;margin-top:4px}
#follow{font-size:11px;min-height:38px;padding:6px 8px;border-radius:7px;border:1px solid #684b70;background:#352640;color:white}
.pin{position:absolute;top:0;left:0;background:#27182e;color:#fff5f6;border:1px solid #ffb1c0;border-radius:7px;padding:5px 9px;font-weight:700;font-size:12px;white-space:nowrap;box-shadow:0 4px 17px #24152b93}
.pin::after{content:"";width:7px;height:7px;background:#27182e;border:solid #ffb1c0;border-width:0 1px 1px 0;position:absolute;left:calc(50% - 4px);bottom:-5px;transform:rotate(45deg)}
.render-error{position:absolute;inset:auto 15px 85px;padding:13px;border-radius:8px;background:#2c1932;color:white}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:820px){main{grid-template-columns:1fr;padding:12px;gap:12px}.scene{height:52svh;min-height:310px;max-height:540px;border-radius:14px}.scene-title{padding:15px 14px 30px}aside{padding:15px;border-radius:14px}header{min-height:56px}.roster{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.roster button{grid-template-columns:1fr;justify-items:center;text-align:center;gap:3px;padding:6px 2px}.roster small{display:none}.scene-footer{padding-left:12px}.map-tools{right:9px;bottom:42px}}
@media(max-width:820px){
  .scene{height:55svh;min-height:330px}
  .scene-title{padding-top:11px}
  .map-destinations{grid-template-columns:repeat(3,minmax(0,1fr))}
  .map-destinations button{min-height:36px;padding:0 4px;font-size:11px}
  .scene-title h1{font-size:clamp(32px,8vw,43px)}
  .search-box input{font-size:16px}
  .roster strong{font-size:clamp(10px,2.8vw,13px)}
}
#search{position:relative}
.suggestions{position:absolute;z-index:5;left:0;right:0;top:calc(100% + 4px);margin:0;padding:4px;list-style:none;background:#1c1628;border:1px solid #584661;border-radius:10px;box-shadow:0 10px 28px #0d081599;max-height:280px;overflow-y:auto}
.suggestions li{display:grid;grid-template-columns:24px 1fr auto;align-items:center;gap:8px;padding:7px 8px;border-radius:7px;cursor:pointer;font-size:13px}
.suggestions li[aria-selected=true],.suggestions li[role=option]:hover{background:#3b2c47}
.suggestions li small{color:var(--muted);font-size:11px}
.suggestions .swatch{width:24px;height:24px;font-size:11px}
.suggestions li.hint{display:block;cursor:default;color:#ffc8d2;line-height:1.4}
.markers{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.meter{position:absolute;left:10px;top:10px;margin:0;padding:6px 8px;border-radius:7px;background:#120d1bd9;color:#d6f5d0;font:600 11px/1.45 ui-monospace,Consolas,monospace;pointer-events:none;z-index:3}

/* Phone: the search sits above the map so both fit on the first screen. */
@media(max-width:820px){
  main{grid-template-columns:minmax(0,1fr)}
  aside{order:-1;min-width:0;padding:12px 12px 10px}
  aside h2{font-size:17px;margin:0 0 8px}
  .scene-title{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
  .roster{display:flex;overflow-x:auto;gap:6px;margin:10px -12px 0;padding:0 12px 2px;scrollbar-width:none}
  .roster::-webkit-scrollbar{display:none}
  .roster button{flex:0 0 auto;grid-template-columns:22px auto;justify-items:start;text-align:left;gap:6px;min-height:38px;padding:5px 10px 5px 6px}
  .roster .swatch{width:22px;height:22px;font-size:11px}
  .roster strong{font-size:12px}
  .character{margin-top:10px;padding-top:10px}
  #status{margin-top:8px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
