/* Shared colors and site controls */
:root { color-scheme: dark; --night:#081720; --ink:#e9e2d1; --faded:#b5bfb7; --gold:#d3ad69; --gold-light:#f0d69b; --card:#13252d; --stroke:rgba(218,206,168,.22); --font-display:Georgia,'Times New Roman',serif; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; font-family:system-ui,-apple-system,'Segoe UI',sans-serif; background:var(--night); color:var(--ink); }
button,input { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:wait; opacity:.6; }
.hidden { display:none!important; }
.eyebrow { font-size:.71rem; font-weight:750; letter-spacing:.23em; color:var(--gold); text-transform:uppercase; }
.muted { color:#d7e1e2; }

/* Build 011: one undistorted 16:9 login stage, centered over a blurred
   visual extension of the SAME image. Margins are decorative, not clickable.
   The artwork is never squeezed to match an unusual viewport ratio. */
.auth-layout {
  position:relative;
  isolation:isolate;
  width:100%;
  min-height:100vh;
  min-height:100dvh;
  height:100vh;
  height:100dvh;
  display:grid;
  place-items:center;
  overflow:hidden;
  background-color:#061019;
}
.auth-ambient {
  position:absolute;
  inset:-9%;
  z-index:-1;
  pointer-events:none;
  background-image:url('/assets/art/login/castle_frost_login_background.webp');
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  filter:blur(54px) brightness(.65) saturate(1.16);
  transform:scale(1.10);
}
.auth-stage {
  position:relative;
  isolation:isolate;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(360px,31%);
  grid-template-rows:minmax(0,1fr);
  width:min(100vw, calc(100dvh * 16 / 9));
  aspect-ratio:16/9;
  max-width:100%;
  min-height:0;
  overflow:hidden;
  background-color:#061019;
  background-image:url('/assets/art/login/castle_frost_login_background.webp');
  background-size:cover;
  background-repeat:no-repeat;
  background-position:center center;
  box-shadow:0 0 55px rgba(1,8,14,.72);
}
.auth-art { min-height:0; pointer-events:none; }
/* Weather begins at 20% of the stage, covering its rightmost four-fifths.
   The frosted glass shelf, at z-index 1, blurs everything behind it. */
.login-weather {
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:20%;
  z-index:0;
  width:80%;
  height:100%;
  display:block;
  opacity:.96;
  pointer-events:none;
  user-select:none;
  -webkit-mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.56) 10%,rgba(0,0,0,.90) 20%,#000 30%);
  mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.56) 10%,rgba(0,0,0,.90) 20%,#000 30%);
}
.auth-box {
  position:relative;
  z-index:1;
  align-self:stretch;
  justify-self:stretch;
  min-width:0;
  min-height:0;
  width:100%;
  max-width:none;
  padding:4.5vh clamp(1.7rem,3.1vw,3.4rem) 2.2rem;
  display:flex;
  flex-direction:column;
  justify-content:center;
  background:linear-gradient(180deg,rgba(8,23,35,.60),rgba(8,23,35,.68));
  -webkit-backdrop-filter:blur(12px) saturate(1.15);
  backdrop-filter:blur(12px) saturate(1.15);
  border-left:1px solid rgba(217,206,183,.27);
  box-shadow:-20px 0 40px rgba(0,0,0,.16);
}
/* The sign-in drawer: centered countdown, then a two-line welcome. */
.departure-countdown {display:flex;flex-direction:column;align-items:center;gap:.35rem;margin:0 0 clamp(28px,4.8vh,44px);text-align:center}
.auth-box .crest {font-size:clamp(3.3rem,5.3vw,5.25rem);color:#c8e9ff;line-height:1;margin:0 0 .25rem;text-shadow:0 0 23px #a5e3ff80}
.departure-timer {display:block;color:#f1d59b;font:normal clamp(2.6rem,3.45vw,3.7rem)/1.14 var(--font-display);letter-spacing:.035em;font-variant-numeric:tabular-nums;white-space:nowrap;text-shadow:0 3px 14px #07121add}
.departure-caption {margin:0;color:#c6d6dc;font-size:clamp(.84rem,1.12vw,.97rem);letter-spacing:.035em}
.auth-box h2 span {display:block;white-space:nowrap}

.auth-box h2 { font:normal clamp(2.15rem,2.75vw,2.85rem)/1.14 var(--font-display); margin:0 0 19px; color:#f2eee5; text-shadow:0 2px 10px #07121acc; }
.auth-box p.muted { line-height:1.65; margin-bottom:25px; color:#eef4f5; text-shadow:0 1px 7px #06121a; }
.auth-box form { display:flex; flex-direction:column; gap:10px; }
.auth-box label { color:#e5e9e5; font-size:.86rem; font-weight:650; }
.auth-box input { padding:13px 15px; border:1px solid #49616c; border-radius:7px; background:#102630; color:white; outline:none; margin-bottom:9px; }
.auth-box input:focus { border-color:#deb96c; box-shadow:0 0 0 3px #aa8d5333; }
.gold-button { padding:13px 20px; border:1px solid #edcc84; border-radius:7px; background:linear-gradient(#e0c287,#aa8249); color:#1c1c1a; font-weight:800; letter-spacing:.025em; transition:filter .2s; }
.gold-button:hover { filter:brightness(1.12); }
.error { color:#ffbaba; min-height:1.15em; margin:0 0 3px; font-size:.9rem; }
.text-button { border:0; background:none; color:#dcc58f; text-decoration:underline; text-underline-offset:4px; padding:18px 0; }
.prototype-note { font-size:.73rem; color:#c3cbd0; margin-top:3.2rem; text-shadow:0 1px 6px #06121a; }

/* Build 006: login artwork and glass drawer above; scene system below. */
.signin-link{display:block;width:100%;text-align:center;text-decoration:none;cursor:pointer}
.signin-link:focus-visible{outline:3px solid #f7df9f;outline-offset:3px}
.signin-error{margin-top:16px;line-height:1.5}

/* A single 16:9 coordinate space is used by the scene artwork AND its clickable assets.
   Unused viewport area is a blurred copy of that same scene palette; no UI lives there.
   When final artwork arrives, replace --scene-backdrop in the appropriate scene rule. */
.keep-layout{
  --scene-backdrop: radial-gradient(ellipse at 51% 32%,#64808b 0%,transparent 36%),
    radial-gradient(ellipse at 47% 76%,#527f7b 0%,transparent 49%),
    linear-gradient(155deg,#132e43 5%,#335365 38%,#203d40 63%,#14292d 100%);
  position:relative;isolation:isolate;display:grid;place-items:center;
  width:100%;height:100vh;height:100dvh;min-height:0;overflow:hidden;
  background:#081721;
}
.keep-layout[data-scene="cartographer"]{--scene-backdrop:radial-gradient(ellipse at 55% 65%,#8b7354 0%,transparent 52%),linear-gradient(165deg,#142d39,#354a4b 38%,#483527 100%)}
.keep-layout[data-scene="artisans"]{--scene-backdrop:radial-gradient(circle at 67% 39%,#607f78,transparent 47%),linear-gradient(150deg,#233c48,#6a7064 55%,#3e423d 100%)}
.keep-layout[data-scene="tower"]{--scene-backdrop:radial-gradient(circle at 64% 31%,#687197,transparent 45%),linear-gradient(155deg,#171f40,#38465c 57%,#1d303e 100%)}
.keep-layout[data-scene="forge"]{--scene-backdrop:radial-gradient(circle at 66% 59%,#aa663a 0%,transparent 49%),linear-gradient(155deg,#192936,#544036 61%,#2a262a 100%)}
.keep-layout[data-scene="portal"]{--scene-backdrop:radial-gradient(circle at 58% 41%,#5a9baf,transparent 43%),linear-gradient(145deg,#142d43,#365d67 48%,#162f3e 100%)}
.keep-layout[data-scene="market"]{--scene-backdrop:radial-gradient(circle at 58% 58%,#9c7861,transparent 53%),linear-gradient(154deg,#2d4146,#655342 62%,#283338 100%)}
.keep-layout[data-scene="tavern"]{--scene-backdrop:radial-gradient(circle at 60% 56%,#ad7440,transparent 55%),linear-gradient(153deg,#27383a,#654435 67%,#2c292b 100%)}
.keep-layout[data-scene="hall"]{--scene-backdrop:radial-gradient(circle at 58% 43%,#728b92,transparent 48%),linear-gradient(145deg,#1d3749,#3e5363 65%,#25303b 100%)}
.keep-layout[data-scene="registry"]{--scene-backdrop:radial-gradient(circle at 62% 51%,#999172,transparent 47%),linear-gradient(145deg,#223643,#4c5d5a 66%,#283b3e 100%)}
.keep-layout[data-scene="church"]{--scene-backdrop:radial-gradient(circle at 54% 31%,#9b9fa5,transparent 43%),linear-gradient(154deg,#243c51,#5d6466 63%,#303f47 100%)}
.keep-layout[data-scene="mine"]{--scene-backdrop:radial-gradient(circle at 65% 53%,#87735d,transparent 49%),linear-gradient(157deg,#253440,#544942 69%,#202529 100%)}
.keep-layout[data-scene="training"]{--scene-backdrop:radial-gradient(circle at 60% 47%,#77745c,transparent 49%),linear-gradient(147deg,#213747,#59605a 64%,#353d3d 100%)}
.keep-layout[data-scene="map"]{--scene-backdrop:repeating-linear-gradient(2deg,#423323,#423323 23px,#5c4830 31px,#302a24 43px)}
.keep-ambient{position:absolute;inset:-18%;pointer-events:none;z-index:-1;
  background-image:var(--scene-backdrop);background-size:cover;background-position:center;
  filter:blur(62px) saturate(1.25) brightness(.76);transform:scale(1.13)}
.stage-shell{position:relative;z-index:1;width:min(100vw,calc(100dvh * 16 / 9));aspect-ratio:16/9}
.stage-viewport{position:relative;width:100%;height:100%;
  overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;
  background:#162a36;box-shadow:0 0 0 1px #b5beab38,0 0 80px #0009;
  scrollbar-color:#ab9268 #12222d;scrollbar-width:thin}
.fit-floating{position:absolute;z-index:75;right:8px;top:8px;background:#112b37;color:#ffe7b1;border:2px solid #dfc181;border-radius:7px;padding:8px 14px;font-size:13px;box-shadow:0 3px 14px #000a}
.fit-floating:hover{background:#33515c}.fit-floating:focus-visible{outline:3px solid #fff1ad;outline-offset:2px}
.stage-viewport:focus{outline:none}.stage-viewport:focus-visible{outline:2px solid #e8cf94;outline-offset:-2px}
.stage-canvas{position:relative;isolation:isolate;width:100%;aspect-ratio:16/9;
  container-type:inline-size;overflow:hidden;color:#f1ecdd}
.scene-art{position:absolute;inset:0;z-index:-1;background-image:var(--scene-backdrop);background-size:cover;background-position:center;overflow:hidden}
.scene-art:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#05121d64 0%,transparent 30%,#08131745 78%,#020c14a6 100%);pointer-events:none}
.starfield{position:absolute;inset:0;opacity:.36;background-image:radial-gradient(1px 1px at 15% 24%,#ffffffd9 95%,transparent),radial-gradient(2px 2px at 41% 17%,#e7f7ffdf 95%,transparent),radial-gradient(1px 1px at 70% 14%,#fff 95%,transparent),radial-gradient(1px 1px at 81% 28%,#eef3ff 95%,transparent);background-size:245px 163px}
.distant-ridge,.hill-line,.keep-wall,.cobblestones{position:absolute;pointer-events:none}
.distant-ridge{left:-2%;top:34%;width:104%;height:39%;background:linear-gradient(#9cb1ae77,#233d46b0);clip-path:polygon(0 70%,10% 51%,18% 66%,28% 14%,33% 44%,42% 28%,52% 66%,64% 13%,72% 39%,81% 17%,92% 59%,100% 34%,100% 100%,0 100%)}
.hill-line{left:0;bottom:7%;width:100%;height:41%;background:linear-gradient(#324e4cc4,#1a2f39da);clip-path:polygon(0 48%,15% 59%,26% 39%,44% 60%,55% 38%,77% 68%,92% 37%,100% 50%,100% 100%,0 100%)}
.keep-wall{left:22%;top:35%;width:56%;height:40%;background:linear-gradient(#79929a68,#354850a8);clip-path:polygon(0 44%,6% 44%,6% 15%,12% 15%,12% 35%,28% 35%,30% 20%,39% 20%,42% 0,48% 0,50% 21%,61% 21%,66% 41%,79% 41%,79% 15%,86% 15%,86% 42%,100% 42%,100% 100%,0 100%);opacity:.52}
.cobblestones{inset:auto 0 0;height:34%;background:repeating-linear-gradient(91deg,#cdd7bb11 0 2px,transparent 2px 60px),repeating-linear-gradient(0deg,#dce4d30d 0 2px,transparent 2px 28px),linear-gradient(#71857811,#13232bbb)}
.keep-layout:not([data-scene="overview"]) .distant-ridge,.keep-layout:not([data-scene="overview"]) .hill-line,.keep-layout:not([data-scene="overview"]) .keep-wall{display:none}
.keep-layout:not([data-scene="overview"]) .cobblestones{height:52%;opacity:.8}

/* HUD and top-of-stage controls remain within the playable image at every size. */
.stage-header{position:absolute;z-index:20;inset:0 0 auto;height:15%;pointer-events:none}
.stage-header button{pointer-events:auto}
.champion-hud{position:absolute;left:2%;top:9%;width:24%;min-height:72%;display:flex;align-items:center;gap:3%;padding:1% 1.3%;background:#071b29d8;border:1px solid #b6bfc759;border-radius:8px;box-shadow:0 5px 24px #0006;overflow:hidden}
.champion-emblem{flex:0 0 18%;font-size:clamp(12px,2.9cqw,42px);color:#d5bd89;text-align:center}
.champion-info{min-width:0;display:flex;flex-direction:column;gap:3px}.champion-info strong{font:normal clamp(10px,1.3cqw,20px)/1.2 Georgia,serif;color:#f6eddd;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.micro-label{font-size:clamp(7px,.72cqw,11px);color:#dac28f;letter-spacing:.11em;font-weight:750}
.hud-subtitle{color:#b4c6c8;font-size:clamp(7px,.74cqw,12px);line-height:1.15}
.stage-wordmark{position:absolute;top:20%;left:28%;width:45%;text-align:center;text-shadow:0 3px 18px #000b}
.stage-wordmark>span{color:#edd6aa;font-size:clamp(7px,.8cqw,13px);letter-spacing:.18em;font-weight:650;white-space:nowrap}
.stage-wordmark h1{font:normal clamp(18px,3.15cqw,58px)/1.02 Georgia,serif;margin:.1em 0;color:#fff4db;white-space:nowrap}
.player-hud{position:absolute;top:19%;right:2%;width:22%;display:flex;align-items:center;justify-content:flex-end;gap:3%;white-space:nowrap;font-size:clamp(9px,1cqw,16px)}
.player-hud span{overflow:hidden;min-width:0;text-overflow:ellipsis;text-shadow:0 2px 6px #000}
.player-hud button,.room-back,.object-close,.table-close{color:#f7edda;background:#112b37e8;border:1px solid #c6b3848a;border-radius:6px;padding:6px 10px;font-size:clamp(10px,.88cqw,15px)}
.player-hud button:hover,.room-back:hover,.object-close:hover,.table-close:hover{background:#2f4950;border-color:#f5d28b}
button:focus-visible{outline:3px solid #f6d586;outline-offset:2px;z-index:40}

.overview-layer,.room-layer{position:absolute;inset:0;z-index:5}
.scene-kicker{position:absolute;top:15%;left:32%;width:40%;margin:0;font-size:clamp(8px,.96cqw,15px);font-weight:750;letter-spacing:.17em;color:#f1dcab;text-align:center;text-shadow:0 3px 8px #03121a}
.kicker-faint{font-weight:400;letter-spacing:.03em;color:#cedad6}
.building-layer,.object-layer{position:absolute;inset:0;pointer-events:none}
.building-site{pointer-events:auto;position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;padding:1.1% .5%;text-align:center;
  border:1.5px solid #d6c6a18f;color:#e8edef;background:linear-gradient(155deg,#365361f2,#172e39f5 80%);
  box-shadow:0 9px 0 #07151d66,0 13px 20px #0006,inset 0 0 35px #c6c6c010;border-radius:4px;
  transition:transform .16s,border-color .16s,filter .16s;transform-origin:center bottom;overflow:visible}
.building-roof{position:absolute;bottom:calc(100% - 1px);left:-1.5%;width:103%;height:21%;background:linear-gradient(155deg,#788897,#2e444f);clip-path:polygon(0 100%,25% 4%,75% 4%,100% 100%);filter:drop-shadow(0 1px 2px #000);pointer-events:none}
.building-site:hover,.building-site:focus-visible{transform:translateY(-3px);filter:brightness(1.2);border-color:#ffe0a0;z-index:12}
.building-site:disabled{opacity:.62;filter:saturate(.28);cursor:not-allowed}
.building-glyph{font-size:clamp(12px,2.1cqw,35px);color:#e8d49d;line-height:.9;text-shadow:0 2px 9px #080e1c}
.building-name{font:normal 700 clamp(9px,1.12cqw,19px)/1.15 Georgia,serif;max-width:100%;text-shadow:0 2px 8px #001b25;overflow-wrap:anywhere}
.building-hint{font-size:clamp(7px,.65cqw,11px);letter-spacing:.12em;color:#b9cfcd}
.building-church{background:linear-gradient(160deg,#6b7285e8,#283748f2 85%)}
.building-portal{background:linear-gradient(150deg,#315871ee,#122b43f9 85%);border-color:#b8dbe5b6}
.building-forge{background:linear-gradient(150deg,#745446ee,#3b2c32f9 85%)}
.building-mine{background:linear-gradient(150deg,#655a57ed,#302e33f9 85%)}
.building-training{background:linear-gradient(150deg,#67715fed,#354039f9 85%)}

.room-layer{z-index:6}
.room-navigation{position:absolute;top:15%;left:2%;right:2%;height:7%;display:flex;justify-content:space-between;align-items:center}
.room-back{background:#071d2ddc}.room-category{font-size:clamp(8px,.85cqw,15px);letter-spacing:.15em;color:#d8ddcf;text-shadow:0 2px 6px #081d24}
.room-title{position:absolute;top:22%;left:3.5%;width:30%;text-shadow:0 2px 8px #071821}.room-title .eyebrow{font-size:clamp(7px,.75cqw,13px)}
.room-title h2{font:normal clamp(19px,2.6cqw,45px)/1.05 Georgia,serif;margin:4% 0 3%;color:#fff0d0}
.room-title p{font-size:clamp(10px,1.04cqw,17px);color:#d7ded8;margin:0}
.scene-object{pointer-events:auto;position:absolute;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4%;padding:.6%;text-align:center;
  background:linear-gradient(#344d53e7,#122730e8);border:2px solid #b7c1b4aa;border-radius:8px;color:#f4f0db;
  box-shadow:0 8px 18px #0007,inset 0 2px 17px #9cbaa216;transition:transform .16s,border-color .16s,filter .16s;overflow:hidden}
.scene-object:hover,.scene-object:focus-visible{transform:translateY(-4px);border-color:#ffe4a0;filter:brightness(1.19);z-index:17}
.scene-object-npc{background:linear-gradient(#5c5b7add,#26334adf);border-color:#bacbdfa6}
.scene-object-staff-slot{background:linear-gradient(#464b50e8,#273438ef);border-style:dashed}
.object-glyph{font-size:clamp(15px,2.65cqw,42px);line-height:1;color:#f1d69a}
.scene-object strong{font:700 clamp(10px,1.2cqw,21px)/1.17 Georgia,serif;overflow-wrap:anywhere}
.object-caption{font-size:clamp(8px,.76cqw,13px);color:#c7d8d1;line-height:1.2}
.object-info{position:absolute;z-index:18;left:2.6%;top:52%;width:34%;max-height:41%;padding:2.2% 2.4%;background:linear-gradient(145deg,#081d29f5,#1c3843f5);border:1px solid #cfbb90;border-radius:9px;box-shadow:0 17px 43px #000b;overflow:auto}
.object-status{font-size:clamp(9px,.86cqw,14px);letter-spacing:.08em;color:#f0d18f;text-transform:uppercase;font-weight:750}
.object-info h3{font:normal clamp(17px,2.1cqw,36px)/1.1 Georgia,serif;margin:4% 0 3%}
.object-info p{font-size:clamp(10px,1.06cqw,18px);line-height:1.38;color:#d3e0dd;margin:0 0 5%}
.object-close{position:absolute;right:3%;top:5%;padding:1px 8px;font-size:clamp(16px,1.6cqw,25px)}
.object-info .gold-button{font-size:clamp(10px,1cqw,16px);padding:8px 12px}
.room-prototype{position:absolute;left:3%;bottom:2%;width:70%;margin:0;color:#d0d6d3;font-size:clamp(9px,.87cqw,15px);opacity:.87;text-shadow:0 2px 6px #000}

/* Navigation is part of the stage, not the blurred decorative margins. */
.stage-footer{position:absolute;top:14%;right:2%;z-index:25;display:flex;align-items:center;gap:12px}
.stage-footer>span{font-size:clamp(8px,.76cqw,13px);color:#d5c7ac;text-shadow:0 2px 4px #000;white-space:nowrap}
.stage-actions{display:flex;gap:5px}
.stage-actions button{white-space:nowrap;padding:5px 8px;background:#091c2acf}

/* Physical cartographer's world map remains inside the same stage. */
.table-view{position:absolute;z-index:65;inset:0;background:#301f13;display:flex;flex-direction:column}
.table-toolbar{padding:1.5% 3%;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:10%;border-bottom:2px solid #74502b;background:#332219;color:#e8d2a5;letter-spacing:.12em;font:clamp(11px,1.25cqw,20px) Georgia,serif}
.table-close{background:#f1dbab!important;color:#372c1c!important;letter-spacing:normal}
.wood-table{flex:1;min-height:0;overflow:auto;padding:2%;background:repeating-linear-gradient(2deg,#52351d,#52351d 17px,#583b22 20px,#3a291b 23px,#52351d 39px);display:flex;align-items:center;justify-content:center}
.parchment{position:relative;width:96%;height:95%;padding:2%;border:clamp(5px,.75cqw,13px) solid #9e7549;background:radial-gradient(circle at 50% 46%,#eee2bb,#d7be86 85%);color:#5c442b;box-shadow:0 15px 25px #20170b8c,inset 0 0 60px #86633d55;display:flex;flex-direction:column;justify-content:space-between}
.parchment:before{content:"";pointer-events:none;position:absolute;inset:10px;border:2px solid #8e754a88}
.parchment-top{display:flex;justify-content:space-between;font:bold clamp(8px,.85cqw,14px) Georgia,serif;letter-spacing:.12em;gap:12px}
.map-drawing{width:100%;min-height:0;display:block;flex:1}
.map-watermark{text-align:center;font:italic clamp(12px,1.8cqw,28px) Georgia,serif}
.map-notice{text-align:center;font-size:clamp(9px,1cqw,16px);margin:1% 0 0}

@media(max-width:900px){
  .auth-layout{display:block;height:auto;min-height:100dvh;overflow:hidden}
  .auth-stage{width:100%;max-width:100%;aspect-ratio:auto;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;background-image:none;box-shadow:none}
  .auth-art{aspect-ratio:16/9;min-height:0;background-image:url('/assets/art/login/castle_frost_login_background.webp');background-size:cover;background-position:center;background-repeat:no-repeat}
  .login-weather{top:0;bottom:auto;height:auto;aspect-ratio:64/45}
  .auth-box{padding:34px 22px 28px;background:linear-gradient(180deg,rgba(8,23,32,.79),rgba(8,23,32,.88));border-left:0;border-top:1px solid rgba(209,191,145,.26)}
  .champion-hud{width:26%}.stage-wordmark{left:28%;width:43%}.stage-wordmark h1{font-size:clamp(13px,3.3cqw,28px)}
  .player-hud{width:26%}.room-prototype{max-width:70%}
  .kicker-faint{display:none}.stage-footer>span{display:none}
}
@media(max-width:580px){
  .auth-box{width:100%;padding:28px 18px 22px}
  .champion-hud{left:1%;width:25%;padding:1%}.champion-emblem{display:none}.hud-subtitle{display:none}
  .stage-wordmark{left:26%;width:46%}.stage-wordmark>span{font-size:6px;letter-spacing:.03em}
  .player-hud{right:1%;width:27%}.player-hud span{display:none}.player-hud button{padding:3px 5px}
  .scene-kicker{display:none}
  .building-hint{display:none}
  .room-category{display:none}

  .object-info{width:44%;left:1.5%;top:57%;max-height:38%}.room-prototype{display:none}
  .stage-footer{top:13%;right:1%}
  .parchment-top{font-size:7px}.map-watermark{font-size:12px}.map-notice{font-size:8px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}

/* Build 006: the complete 16:9 scene still transforms as one image-backed surface.
   The exterior blur is a visual extension only, never an interaction target. */
.stage-viewport{overflow:hidden;touch-action:none;cursor:default;user-select:none}
.stage-viewport.is-zoomed{cursor:grab}
.stage-viewport.is-zoomed:active{cursor:grabbing}
.stage-canvas{transform-origin:center center;will-change:transform}
.stage-canvas button,.stage-canvas select,.stage-canvas input{cursor:pointer}
.scene-art,.keep-ambient{background-image:var(--scene-image, var(--scene-backdrop))}
.scene-asset{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none}
.building-site.with-art,.scene-object.with-art{background:none;border:0;box-shadow:none;padding:0;overflow:visible}
.building-site.with-art .building-roof,.building-site.with-art .building-glyph,.scene-object.with-art .object-glyph{display:none}
.building-site.with-art .scene-asset,.scene-object.with-art .scene-asset{z-index:1;filter:drop-shadow(0 8px 16px rgba(0,0,0,.18))}
.building-site.with-art .building-name{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);z-index:2;background:#061826c9;padding:4px 9px;border-radius:6px;border:1px solid rgba(214,198,161,.55);white-space:nowrap;box-shadow:0 4px 12px rgba(0,0,0,.32)}
.building-site.with-art .building-hint{position:absolute;left:50%;bottom:4%;transform:translateX(-50%);z-index:2;background:#071621b6;padding:2px 7px;border-radius:999px;border:1px solid rgba(185,207,205,.32);white-space:nowrap}
.scene-object.with-art strong{position:relative;z-index:2;background:#061826a1;padding:2px 4px;border-radius:4px}
.building-site.with-art:hover .scene-asset,.building-site.with-art:focus-visible .scene-asset{filter:brightness(1.08) drop-shadow(0 12px 22px rgba(0,0,0,.28));}
.building-church.with-art{z-index:10}
.building-church.with-art:hover,.building-church.with-art:focus-visible{transform:translateY(-3px)}
.plot-layer{position:absolute;inset:0;z-index:1;pointer-events:none}
.building-layer{z-index:2}
.plot-site{pointer-events:auto;position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2%;padding:.5%;
  border:1px dashed #d1c887b5;border-radius:46% 50% 23% 25%;color:#f2e3b8;
  background:linear-gradient(165deg,#5b7c5dd9,#203d32e8);box-shadow:inset 0 1px 8px #c4dca32b,0 4px 9px #0008;
  text-align:center;line-height:1.15;transition:filter .15s;overflow:hidden}
.plot-site:hover,.plot-site:focus-visible{filter:brightness(1.28);border-color:#f5e1a3;z-index:10}
.plot-site strong{font:700 clamp(8px,.9cqw,15px)/1.1 Georgia,serif;overflow-wrap:anywhere}
.plot-site span:last-child{font-size:clamp(6px,.6cqw,10px);letter-spacing:.07em}
.plot-glyph{font-size:clamp(12px,1.55cqw,27px)}
.plot-locked{filter:grayscale(.8);opacity:.72;background:linear-gradient(165deg,#4e685ed9,#263331e8)}
.plot-info{position:absolute;z-index:40;left:2.5%;top:42%;width:34%;max-height:54%;padding:1.8% 2.4%;overflow-y:auto;
  border:1px solid #d1bf91;border-radius:9px;background:linear-gradient(150deg,#091e29f5,#1f3d39fb);box-shadow:0 16px 34px #000a}
.plot-info h3{font:normal clamp(17px,2cqw,34px) Georgia,serif;margin:4% 0 2%}
.plot-info p{font-size:clamp(10px,1cqw,16px);margin:4% 0;color:#d9e2dd;line-height:1.35}
.plot-edit label{display:block;margin:3% 0;font-size:clamp(9px,.9cqw,14px)}
.plot-edit select{width:100%;padding:6px;background:#0f3036;color:#fff3db;border:1px solid #b1b9ad;border-radius:5px;font-size:clamp(11px,1cqw,16px)}
.plot-actions{display:flex;align-items:center;gap:5px;margin-top:3%}
.plot-actions button{padding:6px 8px;font-size:clamp(10px,.9cqw,16px);border-radius:5px}
.plot-actions #clear-plot{border:1px solid #92a69f;background:#183439;color:#f2e5ca}
.plot-info .plot-preview-notice{font-style:italic;color:#d9cead;font-size:clamp(8px,.76cqw,12px)}

/* Full-stage preparation/roster pane: in-world UI, never in outside margins. */
.prep-view{position:absolute;z-index:70;inset:2%;padding:1.8% 2.4%;overflow:auto;
  display:flex;flex-direction:column;gap:1.6%;border:2px solid #ad9974;border-radius:10px;
  background:linear-gradient(153deg,#071720f9,#132c34fc 57%,#26332df8);box-shadow:0 18px 60px #000c;
  scrollbar-color:#8e9f9e #10262e;user-select:text;touch-action:pan-y}
.prep-header{display:flex;align-items:start;justify-content:space-between;gap:10px;border-bottom:1px solid #c3b18a66;padding-bottom:1%}
.prep-header h2{margin:2% 0 0;font:normal clamp(20px,2.6cqw,42px) Georgia,serif;color:#f0e0b9}
.prep-close,.prep-roster button,.prep-current button{border:1px solid #baa980;border-radius:6px;background:#203b45;color:#f1e7d0;padding:6px 10px;font-size:clamp(10px,.88cqw,15px)}
.prep-close:hover,.prep-roster button:hover,.prep-current button:hover{background:#3b5962}
.prep-roster{display:flex;align-items:center;flex-wrap:wrap;gap:1.3%;font-size:clamp(10px,.99cqw,16px)}
.prep-roster label{font-weight:750;color:#eed6a5}
.prep-roster select{max-width:42%;padding:5px 9px;border-radius:5px;border:1px solid #b4c3bf;background:#102c37;color:#f4eee0;font-size:clamp(11px,1cqw,16px)}
.prep-roster button:disabled{opacity:.4;cursor:not-allowed}
.prep-level{color:#bcd4cf}
.prep-current{display:flex;flex-wrap:wrap;align-items:center;gap:1.5%;padding:1.1% 1.8%;border-radius:6px;border:1px solid #6c8a8e;background:#0b2632b5;font-size:clamp(10px,1cqw,16px)}
.prep-countdown{color:#f4da99;font-variant-numeric:tabular-nums}
.prep-bonuses{display:flex;flex-wrap:wrap;gap:5px;font-size:clamp(9px,.88cqw,15px)}
.prep-earned{padding:4px 8px;border:1px solid #789b8c;background:#193e35;border-radius:99px;color:#d8f6e5}
.prep-muted{color:#b2c0c3;font-style:italic}
.prep-message{min-height:1em;margin:0;color:#e5d39c;font-size:clamp(10px,.92cqw,15px)}
.prep-message.prep-error{color:#ffacac}
.prep-empty{padding:2%;background:#30414b;color:#f5e5bd;border:1px solid #9d8e6b;border-radius:5px}
.prep-activities{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.3%;align-content:start;flex:0 0 auto}
.prep-card{padding:3.2%;border:1px solid #8498969a;background:#172b32e9;border-radius:8px;min-width:0}
.prep-card.prep-highlight{border-color:#f3d895;box-shadow:0 0 0 1px #f3d89576}
.prep-card h3{margin:0 0 2%;font:normal clamp(15px,1.5cqw,24px) Georgia,serif;color:#edd8a5}
.prep-card p{margin:0 0 4%;font-size:clamp(9px,.85cqw,14px);line-height:1.3;color:#c3d4d1;min-height:2.5em}
.prep-tiers{display:flex;gap:3%;flex-wrap:wrap}
.prep-tier{flex:1 1 30%;min-width:0;white-space:normal;border:1px solid #bca271;border-radius:5px;background:#294856;color:#f8e6c1;padding:5px 3px;font-size:clamp(9px,.79cqw,14px)}
.prep-tier:hover:not(:disabled){background:#466675}
.prep-tier:disabled{opacity:.45;cursor:not-allowed}
.prep-footnote{margin:0;padding-top:1%;color:#c1bcae;font-size:clamp(9px,.84cqw,14px);line-height:1.35}

@media(max-width:700px){
  .plot-site span:last-child{display:none}
  .plot-info{width:51%;top:35%;max-height:63%}
  .prep-view{inset:1%;padding:2%;gap:2%}
  .prep-header h2{font-size:clamp(13px,3cqw,21px)}
  .prep-header .eyebrow,.prep-level,.prep-footnote{display:none}
  .prep-roster select{max-width:51%}
  .prep-activities{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  .prep-card{padding:3%}
  .prep-card p{min-height:0}
}
@media(max-width:450px){
  .prep-activities{grid-template-columns:1fr}
  .prep-card{padding:2%}
  .prep-card p{display:none}
  .prep-card h3{margin-bottom:4px}
  .prep-tiers{gap:4px}
  .prep-tier{padding:4px 3px}
}

/* Build 008: keep the live departure clock legible without covering the castle artwork. */
@media(max-width:900px){
  .departure-countdown{margin-bottom:24px}
  .auth-box .crest{font-size:3.9rem}
  .departure-timer{font-size:clamp(2.7rem,6vw,3.4rem)}
  .auth-box h2{font-size:clamp(2rem,5vw,2.7rem)}
}
@media(max-width:580px){
  .auth-box{padding:25px 18px 22px}
  .auth-box .crest{font-size:3.4rem}
  .departure-countdown{margin-bottom:22px;gap:.18rem}
  .departure-timer{font-size:2.9rem}
  .auth-box h2{font-size:clamp(1.9rem,8vw,2.4rem);margin-bottom:14px}
  .auth-box p.muted{margin-bottom:21px}
  .prototype-note{margin-top:2.2rem}
}
@media(max-height:650px) and (min-width:901px){
  .auth-box{padding-top:20px;padding-bottom:20px}
  .departure-countdown{margin-bottom:20px}
  .auth-box .crest{font-size:3.35rem}
  .departure-timer{font-size:2.6rem}
  .prototype-note{margin-top:1.6rem}
}

/* Compact the shelf on unusually short desktop windows without distorting art. */
@media(max-height:520px) and (min-width:901px){
  .auth-box{padding:12px 24px;overflow-y:auto}
  .departure-countdown{margin-bottom:11px;gap:1px}
  .auth-box .crest{font-size:2.35rem;margin:0}
  .departure-timer{font-size:2.0rem}
  .departure-caption{font-size:.75rem}
  .auth-box h2{font-size:1.85rem;margin-bottom:9px}
  .auth-box p.muted{font-size:.87rem;line-height:1.35;margin-bottom:12px}
  .auth-box .gold-button{padding:10px 14px}
  .signin-error{margin-top:7px}
  .prototype-note{margin-top:13px;font-size:.65rem}
}

/* Build 013 — approved Chillwing Keep background image (Church site left open).
   The same 16:9 picture fills the interactive stage AND its decorative blurred
   margins through the existing --scene-image mechanism. Room backdrops are
   intentionally unchanged. */
.keep-layout[data-scene="overview"] {
  --scene-image:url('/assets/art/scenes/chillwing_keep_courtyard.webp?v=027');
}
/* The old provisional skyline, fake courtyard and dark overlay were only
   placeholders. Keep them for room scenes, never paint over the approved art. */
.keep-layout[data-scene="overview"] .scene-art::after,
.keep-layout[data-scene="overview"] .starfield,
.keep-layout[data-scene="overview"] .distant-ridge,
.keep-layout[data-scene="overview"] .hill-line,
.keep-layout[data-scene="overview"] .keep-wall,
.keep-layout[data-scene="overview"] .cobblestones { display:none; }

/* Keep temporary overview nameplates smaller until actual transparent art
   replaces them. .with-art assets retain their full perspective footprints. */
.keep-layout[data-scene="overview"] .building-site:not(.with-art) {
  transform:scale(.76);
  transform-origin:center center;
}
.keep-layout[data-scene="overview"] .building-site:not(.with-art):hover,
.keep-layout[data-scene="overview"] .building-site:not(.with-art):focus-visible {
  transform:translateY(-3px) scale(.76);
}
.keep-layout[data-scene="overview"] .plot-site:not(.with-art) {
  transform:scale(.78);
  transform-origin:center center;
}


/* Build 014 — the Church now uses a real transparent building asset centered
   along the back wall, while nearby top-row placeholders are nudged clear. */


/* Build 015 — overview cleanup and user-approved Church placement.
   All values are percentages of the complete 16:9 Keep stage, NOT the viewport.
   Edit the four values below to fine-tune the illustrated Church later.
   The -14% top is intentional: it seats the building against the rear wall.
   These declarations override the provisional in-bounds placement from keep.go,
   and move the actual clickable element together with its artwork. */
.keep-layout[data-scene="overview"] .building-church.with-art {
  left:37.6% !important;
  top:-14% !important;
  width:22% !important;
  height:39% !important;
}
/* The overview now speaks through its art; keep room-screen headings intact. */
.keep-layout[data-scene="overview"] .stage-wordmark,
.keep-layout[data-scene="overview"] .scene-kicker { display:none; }
/* Illustrated buildings are their own click target; hide text for every asset. */
.keep-layout[data-scene="overview"] .building-site.with-art .building-name,
.keep-layout[data-scene="overview"] .building-site.with-art .building-hint { display:none; }
/* No lifting or positional motion on hover/focus; brighten only.
   Placeholder cards retain their existing .76 scale in both states. */
.keep-layout[data-scene="overview"] .building-site:hover,
.keep-layout[data-scene="overview"] .building-site:focus-visible {
  transform:none;
  filter:brightness(1.16);
}
.keep-layout[data-scene="overview"] .building-site:not(.with-art):hover,
.keep-layout[data-scene="overview"] .building-site:not(.with-art):focus-visible {
  transform:scale(.76);
}
.keep-layout[data-scene="overview"] .building-site.with-art:hover .scene-asset,
.keep-layout[data-scene="overview"] .building-site.with-art:focus-visible .scene-asset {
  filter:brightness(1.12) drop-shadow(0 8px 16px rgba(0,0,0,.18));
}


/* Build 016 — Chillwing Station's three independent layers.
   Whole building stays clickable; the existing art-first rule hides its labels.
   The mask was derived from the ACTUAL transparent arch region of the approved
   Station illustration, not a rectangle approximating its interior.
   Future AI-generated campaigns can override --portal-scene-image on the Keep
   stage or on this building with another vetted local /assets/art/ URL. */
.keep-layout[data-scene="overview"] .building-portal.with-art {
  left:59% !important;

  top:6% !important;

  width:25% !important;

  height:27% !important;
  isolation:isolate;
  z-index:9;
}
/* Build 022 — destination IMAGE gently breathes and turns from left to right
   within the stationary portal mask; the stone arch itself never moves.
   Rotate only the inner image. No background-size or positional animation. */
.keep-layout[data-scene="overview"] .building-portal.with-art::before { content:none; }
.keep-layout[data-scene="overview"] .building-portal.with-art .portal-window {
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  -webkit-mask-image:url('/assets/art/portals/chillwing_station_opening_mask.png');
  mask-image:url('/assets/art/portals/chillwing_station_opening_mask.png');
  -webkit-mask-size:100% 100%;
  mask-size:100% 100%;
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
}
.keep-layout[data-scene="overview"] .building-portal.with-art .portal-window::before {
  content:"";
  position:absolute;
  inset:0;
  display:block;
  background-image:var(--portal-scene-image, url('/assets/art/portals/chillwing_frostbound_cabin_blue.webp'));
  background-size:auto 48%;
  background-repeat:no-repeat;
  background-position:calc(50% - 4px) center;
  transform-origin:50% 50%;
  animation:chillwing-portal-breathe 5s linear infinite;
}
.keep-layout[data-scene="overview"] .building-portal.with-art .scene-asset {
  z-index:1;
}
@keyframes chillwing-portal-breathe {
  0%, 100% { transform:scale(1) rotate(-1.25deg); filter:brightness(1) saturate(1.02); }
  50%      { transform:scale(1.07) rotate(1.25deg); filter:brightness(1.08) saturate(1.10); }
}
@supports not ((mask-image:url('/assets/art/portals/chillwing_station_opening_mask.png')) or (-webkit-mask-image:url('/assets/art/portals/chillwing_station_opening_mask.png'))) {
  .keep-layout[data-scene="overview"] .building-portal.with-art .portal-window { display:none; }
}
@media(prefers-reduced-motion:reduce) {
  .keep-layout[data-scene="overview"] .building-portal.with-art .portal-window::before { animation:none; }
}

/* Build 017 — approved left-side Alchemy Tower, with FrostCandy-pink
   experiment and the user's original white Yeti. Percentages refer to the
   entire 16:9 Keep stage. Edit these four values for later fine-tuning.
   The old Alchemy Tower placeholder is automatically replaced by its art. */
.keep-layout[data-scene="overview"] .building-tower.with-art {
  left:0% !important;

  top:12% !important;
  width:20% !important;
  height:38% !important;
  z-index:8;
}
/* Illustrated buildings already have no visible labels and only brighten
   on hover. Do not add transform effects to this asset. */


/* Build 018 — lock in user-approved Station and Alchemy Tower placement
   updates, swap the portal to a gentle brightness pulse only, and integrate
   the first-pass illustrated Blacksmith's Forge and Market Hall. */
.keep-layout[data-scene="overview"] .building-forge.with-art {
  left:77% !important;

  top:26% !important;

  width:21% !important;

  height:25% !important;
  z-index:8;
}
.keep-layout[data-scene="overview"] .building-market.with-art {
  left:30% !important;

  top:37% !important;

  width:16% !important;

  height:30% !important;
  z-index:7;
}

/* Build 019 — artwork-first Artisan Courtyard and modest Cartographer's hut.
   These provisional rectangles use stage-relative percentages. Final placement
   will be decided after the remaining buildings have artwork. */
.keep-layout[data-scene="overview"] .building-artisans.with-art {
  left:20% !important;

  top:19% !important;

  width:24% !important;

  height:21% !important;
  z-index:6;
}
.keep-layout[data-scene="overview"] .building-cartographer.with-art {
  left:85% !important;

  top:50% !important;

  width:16% !important;

  height:15% !important;
  z-index:7;
}


/* Build 021 — approved new building artwork. Values fine-tuned in Build 022.
   The position rules below are user-approved stage percentages; avoid
   overriding them through keep.go until the layout is formally redesigned.
   Previous work had these as deliberately provisional
   16:9 stage-relative placements; fine-tune sizes/positions in a later art pass.
   The legacy Registry card is suppressed by app.js and its two stations now live
   inside the illustrated Champion Hall. Hover remains brightness-only. */
.keep-layout[data-scene="overview"] .building-tavern.with-art {
  left:9% !important;

  top:61% !important;

  width:17% !important;
  height:26% !important;
  z-index:7;
}
.keep-layout[data-scene="overview"] .building-hall.with-art {
  left:21% !important;

  top:-1% !important;
  width:22% !important;
  height:23% !important;

  z-index:3;
}
.keep-layout[data-scene="overview"] .building-mine.with-art {
  left:66% !important;

  top:61% !important;

  width:15% !important;

  height:15% !important;
  z-index:8;
}
.keep-layout[data-scene="overview"] .building-training.with-art {
  left:51% !important;

  top:42% !important;

  width:22% !important;

  height:20% !important;
  z-index:7;
}


/* Build 022: Cozy Grounds positions are user-selected in the same stage
   coordinate space as the illustrated buildings. CSS overrides their server
   fallback placement while retaining each plot's identity and click handler.
   Plot cards are above buildings to keep East Lawn clickable where its
   requested area overlaps the Forge artwork. */
.keep-layout[data-scene="overview"] .plot-layer { z-index:3; }
.keep-layout[data-scene="overview"] .plot-site[data-plot="garden-terrace"] {
  left:45% !important;
  top:79% !important;
}
.keep-layout[data-scene="overview"] .plot-site[data-plot="east-lawn"] {
  left:71% !important;
  top:40% !important;
}
.keep-layout[data-scene="overview"] .plot-site[data-plot="courtyard-nook"] {
  left:19% !important;
  top:42% !important;
}


/* Build 023: subtle independent Keep effects. No backdrop-filter or full-scene
   canvas redraw. These paint only on the 16:9 stage and intercept no input. */
.keep-ground-lighting {position:absolute;inset:0;z-index:4;pointer-events:none;overflow:hidden}
.keep-layout:not([data-scene="overview"]) .keep-ground-lighting,
.keep-layout:not(.fx-fire-on) .fx-flame-light,
.keep-layout:not(.fx-ice-on) .fx-ice-puddle,
.keep-layout:not(.fx-star-on) .fx-frost-star {display:none}
.fx-flame-light {position:absolute;width:8%;height:11%;border-radius:50%;background:radial-gradient(ellipse,rgba(255,199,100,.26),rgba(255,133,37,.10) 42%,transparent 72%);opacity:.4;animation:keep-flame-flicker 5.3s ease-in-out infinite alternate}
.fx-flame-light-a {left:11%;top:17%;animation-delay:-1.1s}
.fx-flame-light-b {left:42%;top:16%;animation-delay:-3.5s}
.fx-flame-light-c {left:84%;top:29%;animation-delay:-2.2s}
.fx-flame-light-d {left:21%;top:58%;animation-delay:-4.1s}
@keyframes keep-flame-flicker {0%,100%{opacity:.24}30%{opacity:.53}56%{opacity:.29}78%{opacity:.48}}
.fx-ice-puddle {position:absolute;overflow:hidden;pointer-events:none;border-radius:50%;-webkit-mask-image:radial-gradient(ellipse,#000 25%,transparent 72%);mask-image:radial-gradient(ellipse,#000 25%,transparent 72%)}
.fx-ice-puddle-a {left:5.1%;top:55%;width:14%;height:10%;transform:rotate(-7deg)}
.fx-ice-puddle-b {left:54%;top:78%;width:18%;height:11%;transform:rotate(-11deg)}
.fx-ice-puddle::before {content:"";position:absolute;inset:-5% auto -5% 0;width:42%;background:linear-gradient(100deg,transparent,rgba(191,239,255,.23) 50%,transparent);transform:translateX(-110%) skewX(-20deg);animation:keep-ice-gleam 12s ease-in-out infinite}
.fx-ice-puddle-b::before {animation-delay:-4.7s;animation-duration:14s}
@keyframes keep-ice-gleam {0%,8%{transform:translateX(-115%) skewX(-20deg);opacity:0}25%{opacity:.85}50%{transform:translateX(280%) skewX(-20deg);opacity:.7}70%,100%{transform:translateX(280%) skewX(-20deg);opacity:0}}
.fx-frost-star {position:absolute;left:42%;top:34%;width:16%;height:23%;background:radial-gradient(ellipse,rgba(176,226,255,.39),rgba(89,179,248,.12) 38%,transparent 72%);opacity:.07;animation:keep-frost-star-pulse 11s ease-in-out infinite}
@keyframes keep-frost-star-pulse {0%,67%,100%{opacity:.07}80%{opacity:.36}90%{opacity:.11}}

.keep-bottom-mist {position:absolute;left:0;right:0;bottom:0;height:25%;z-index:14;pointer-events:none;overflow:hidden;isolation:isolate;background:linear-gradient(to top,rgba(184,215,230,.20),rgba(195,225,239,.08) 38%,transparent 93%)}
.keep-layout:not([data-scene="overview"]) .keep-bottom-mist,.keep-layout:not(.fx-mist-on) .keep-bottom-mist{display:none}
.keep-bottom-mist::before,.keep-bottom-mist::after {content:"";position:absolute;inset:-12% -4% -12%;pointer-events:none;background:url('/assets/art/effects/keep_low_mist.webp') repeat-x center bottom;background-size:auto 100%;-webkit-mask-image:linear-gradient(to bottom,transparent 0%,rgba(0,0,0,.38) 29%,#000 100%);mask-image:linear-gradient(to bottom,transparent 0%,rgba(0,0,0,.38) 29%,#000 100%);will-change:transform,opacity}
.keep-bottom-mist::before {opacity:.68;animation:keep-mist-rise 18s ease-in-out infinite alternate}
.keep-bottom-mist::after {opacity:.30;transform:scaleX(-1);animation:keep-mist-secondary 26s ease-in-out infinite alternate}
@keyframes keep-mist-rise {from{transform:translate3d(-1%,9%,0) scale(1.02);opacity:.45}to{transform:translate3d(1%,-7%,0) scale(1.03);opacity:.72}}
@keyframes keep-mist-secondary {from{transform:translate3d(2%,8%,0) scaleX(-1);opacity:.26}to{transform:translate3d(-2%,-6%,0) scaleX(-1);opacity:.39}}

/* Account/champion crest HUD on top of fog; keep the room/map UI clear. */
.account-banner {position:absolute;z-index:43;left:1.8%;bottom:1.6%;width:35.5%;min-width:0;color:#f3eddc}
.keep-layout:not([data-scene="overview"]) .account-banner {display:none}
.account-banner-trigger {display:flex;align-items:center;gap:2.5%;width:100%;min-width:0;padding:1.3% 2%;border:1px solid rgba(233,207,143,.66);border-radius:10px;background:linear-gradient(155deg,rgba(5,22,34,.95),rgba(12,36,52,.87));color:#f4ecda;text-align:left;box-shadow:0 8px 23px rgba(0,9,16,.5),inset 0 1px 0 rgba(217,239,244,.12);cursor:pointer;transition:border-color .18s,background .18s}
.account-banner-trigger:hover,.account-banner-trigger.is-open {border-color:#ffdda0;background:linear-gradient(155deg,rgba(10,31,48,.97),rgba(18,48,64,.94))}
.account-banner-trigger:focus-visible {outline:2px solid #f5db9c;outline-offset:2px}
.account-portrait-frame {display:block;flex:0 0 23%;aspect-ratio:100/116;min-width:0;background:url('/assets/art/ui/champion_portrait_frame.svg') center/contain no-repeat;filter:drop-shadow(0 0 6px rgba(143,221,249,.17))}
.account-banner-content {display:flex;flex:1;min-width:0;flex-direction:column;gap:clamp(1px,.28cqw,4px)}
.account-name-line {display:flex;align-items:center;gap:clamp(3px,.45cqw,8px);min-width:0}
.account-name-line strong {flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 clamp(10px,1.3cqw,20px)/1.15 Georgia,serif;color:#ffe6b1;text-shadow:0 2px 7px #000a}
.account-level-badge {flex:none;display:inline-flex;align-items:center;border:1px solid rgba(186,224,239,.68);border-radius:999px;background:linear-gradient(160deg,rgba(86,118,140,.58),rgba(17,43,61,.84));color:#d9eef7;font:bold clamp(7px,.74cqw,12px)/1 system-ui,sans-serif;padding:clamp(1px,.22cqw,4px) clamp(3px,.34cqw,6px);font-variant-numeric:tabular-nums;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(238,249,255,.26),0 0 7px rgba(107,181,214,.12)}
.account-champion-line {display:flex;align-items:center;min-width:0;gap:clamp(2px,.45cqw,7px);font-size:clamp(8px,.84cqw,13px);color:#cfdfdf;white-space:nowrap}
.account-champion-caption {font-weight:800;font-size:clamp(7px,.65cqw,11px);color:#b5cfdb;letter-spacing:.05em}
.account-champion-line #champion-name {overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
.account-champion-level {font-size:clamp(7px,.68cqw,11px);color:#d2b87c}
.account-progress-line {display:flex;align-items:center;gap:clamp(3px,.45cqw,8px);min-width:0}
.account-progress-track {display:block;flex:1;min-width:0;height:clamp(4px,.64cqw,10px);overflow:hidden;border:1px solid #6e9dad85;border-radius:999px;background:linear-gradient(#0d2635,#183f51);box-shadow:inset 0 2px 4px #001a29}
.account-progress-fill {display:block;width:0%;height:100%;background:linear-gradient(90deg,#66b8d9,#a4f2ff);border-radius:inherit;box-shadow:0 0 7px #a9e9ff;transition:width .3s ease}
.account-progress-text {min-width:clamp(22px,2.7cqw,41px);text-align:right;font:bold clamp(8px,.77cqw,13px)/1 system-ui,sans-serif;color:#afd4e0;font-variant-numeric:tabular-nums}
.account-banner-chevron {color:#d8c597;font-size:clamp(11px,1.1cqw,18px);align-self:center}
.account-settings-menu {position:absolute;left:0;bottom:calc(100% + 8px);min-width:48%;padding:clamp(7px,.9cqw,14px);background:linear-gradient(155deg,#0c283a,#071825);border:1px solid #c7b88c;border-radius:8px;box-shadow:0 10px 22px #000b;display:flex;flex-direction:column;gap:clamp(4px,.6cqw,10px)}
.account-settings-label {font-size:clamp(8px,.75cqw,12px);letter-spacing:.12em;font-weight:700;color:#c5d8d9;white-space:nowrap}
.account-signout {width:100%;border:1px solid #e7cf92;border-radius:5px;background:#284556;color:#fbe6bb;padding:clamp(5px,.65cqw,10px) clamp(9px,1cqw,15px);font-size:clamp(10px,.9cqw,14px);font-weight:700;white-space:nowrap;cursor:pointer}
.account-signout:hover {background:#42647a}
@media(max-width:650px){.account-banner{width:43%;left:1.4%;bottom:1.5%}.account-banner-trigger{border-radius:5px;padding:2% 3%}.account-portrait-frame{flex-basis:22%}.account-name-line strong{font-size:clamp(8px,2.4cqw,12px)}.account-champion-caption{display:none}.account-settings-menu{bottom:calc(100% + 3px)}}
@media(prefers-reduced-motion:reduce){
 .fx-flame-light,.fx-ice-puddle::before,.fx-frost-star,.keep-bottom-mist::before,.keep-bottom-mist::after {animation:none!important;will-change:auto}
}

/* Build 025 — approved Castle Frost Keep progression and quiet, frosty UI. */
/* The account banner is intentionally *fully* transparent, including hover. */
.keep-layout[data-scene="overview"] .account-banner{width:35.5%;left:1.8%;bottom:1.6%}
.account-banner-trigger,
.account-banner-trigger:hover,
.account-banner-trigger.is-open {
  background:transparent;
  box-shadow:none;
  border:0;
  padding:.5% 1%;
  gap:1.8%;
  border-radius:6px;
}
.account-banner-trigger:hover {filter:brightness(1.07)}
.account-banner-content {gap:clamp(2px,.33cqw,6px)}
.account-portrait-frame {flex-basis:23%}
.account-name-line,.account-champion-line{gap:clamp(4px,.52cqw,9px)}
.account-name-line strong{font-size:clamp(11px,1.43cqw,23px);color:#ffe5b6}
.account-level-badge,.account-champion-level {
  box-shadow:none;
  flex:0 0 clamp(24px,2.25cqw,36px);
  width:clamp(24px,2.25cqw,36px);
  min-width:0;
  display:inline-block;
  padding:0;
  border:0;
  border-radius:0;
  background:none;
  font-variant-numeric:tabular-nums;
  text-align:center;
  color:#d9eff8;
}
.account-level-badge{font:bold clamp(13px,1.12cqw,19px)/1 Georgia,serif}
.account-champion-level{font:bold clamp(9px,.82cqw,14px)/1 system-ui,sans-serif;color:#d4e6f0}
.account-champion-line{font-size:clamp(8px,.84cqw,14px)}
.account-champion-caption{font-size:clamp(7px,.66cqw,11px)}
.account-champion-line #champion-name{flex:0 1 auto;max-width:55%}
.active-buffs{display:inline-flex;align-items:center;gap:clamp(2px,.3cqw,5px);white-space:nowrap;flex:0 0 auto;min-width:0}
.buff-icon{display:inline-block;font-size:clamp(10px,1.18cqw,18px);line-height:1;cursor:help;border-radius:3px}
.buff-icon:focus-visible{outline:2px solid #a9eaff;outline-offset:2px}
.account-progress-track{height:clamp(3px,.42cqw,7px)}
.account-progress-text{min-width:clamp(22px,2.7cqw,40px)}
.account-banner-chevron{font-size:clamp(8px,.85cqw,12px);color:#b4d8e4}
.account-settings-menu{
  background:linear-gradient(145deg,#113c59,#0a253e 95%);
  border-color:#78b9db;
  box-shadow:0 10px 22px #000a;
  min-width:47%;
}
.account-settings-label{color:#d6f0ff}
.account-settings-menu .account-signout{
  background:#1a5073;border:1px solid #77b8dc;color:#e7f6ff;
}
.account-settings-menu .account-signout:hover{background:#326c93}
.edit-mode-reminder{
  position:absolute;z-index:2;bottom:calc(100% + 3px);left:25%;
  font:bold clamp(9px,.75cqw,13px)/1 system-ui,sans-serif;
  padding:5px 8px;border:1px solid #9fe0ff;border-radius:5px;
  background:#0a4568e8;color:#e2f6ff;box-shadow:0 3px 13px #08213270;
}
.edit-mode-reminder:hover{background:#21688d}
.buff-inspector{
  position:absolute;bottom:calc(100% + 7px);left:25%;max-width:75%;
  z-index:3;padding:8px 11px;border:1px solid #8cd4f0;
  border-radius:5px;background:#0c314af3;color:#e6f7ff;
  font-size:clamp(9px,.8cqw,13px);box-shadow:0 6px 16px #0008;
}

/* Locked buildings retain architectural detail under a centered level number. */
.building-site.building-locked:disabled{opacity:1;filter:none;cursor:default}
.building-site.building-locked.with-art .scene-asset{filter:grayscale(.73) saturate(.45) brightness(.8) drop-shadow(0 7px 15px #05142144)}
.keep-layout[data-scene="overview"] .building-site.building-locked:hover,
.keep-layout[data-scene="overview"] .building-site.building-locked:focus-visible{filter:none;transform:none}
.keep-layout[data-scene="overview"] .building-site.building-locked.with-art:hover .scene-asset{filter:grayscale(.73) saturate(.45) brightness(.8) drop-shadow(0 7px 15px #05142144)}
.building-unlock-number{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  z-index:15;pointer-events:none;
  font:bold clamp(20px,3.5cqw,57px)/1 Georgia,serif;
  color:#d9e0e6;text-shadow:0 2px 8px #07121ce8,0 0 18px #061622b5;
  opacity:.81;font-variant-numeric:tabular-nums;
}
/* The Ascendant art is a new, provisional perimeter position for user testing. */
.keep-layout[data-scene="overview"] .building-ascendant.with-art{
  left:1% !important;top:0% !important;width:17% !important;height:29% !important;z-index:4;
}
/* User-requested precise Champion's Hearth correction. */
.keep-layout[data-scene="overview"] .building-tavern.with-art{
  left:9% !important;top:61% !important;width:17% !important;
}
/* Minor non-destructive warm-tone restraint. No approved artwork is modified. */
.keep-layout[data-scene="overview"] .building-market.with-art:not(.building-locked) .scene-asset,
.keep-layout[data-scene="overview"] .building-forge.with-art:not(.building-locked) .scene-asset{filter:saturate(.91) drop-shadow(0 8px 16px rgba(0,0,0,.18))}

/* Cozy Grounds: actual cut-out artwork ONLY; never render nameplates, green
   spots, or visible elements before the account-level unlock. */
.keep-layout[data-scene="overview"] .plot-site.with-art{
  width:12% !important;height:17% !important;
  background:none;border:0;box-shadow:none;padding:0;border-radius:0;
  overflow:visible;filter:none;
}
.keep-layout[data-scene="overview"] .plot-site.with-art .scene-asset{
  position:absolute;inset:0;width:100%;height:100%;object-fit:contain;
  filter:drop-shadow(0 7px 10px #05233170);
}
.keep-layout[data-scene="overview"] .plot-site.with-art:hover .scene-asset,
.keep-layout[data-scene="overview"] .plot-site.with-art:focus-visible .scene-asset{
  filter:brightness(1.1) drop-shadow(0 8px 12px #07192390);
}
.plot-info{background:linear-gradient(145deg,#0b2f4beF,#0b1f34f5);border:1px solid #8ebdd5}
.plot-edit label{color:#d4ecf8}
.plot-edit select{background:#103850;border-color:#80c3dd;color:#f0faff}
.plot-info .plot-preview-notice{color:#bcd8e8}
.hall-active-buffs{margin-top:9px;display:flex;flex-wrap:wrap;gap:6px;color:#d9f2ff;font-size:clamp(9px,.9cqw,14px)}
.buff-float-icon{position:absolute;z-index:55;pointer-events:none;line-height:1;font-size:clamp(18px,2.2cqw,36px);filter:drop-shadow(0 2px 8px #041924);animation:buff-float 1.25s ease-out forwards}
@keyframes buff-float{from{opacity:0;transform:translate(-50%,5px) scale(.75)}20%{opacity:1}to{opacity:0;transform:translate(-50%,-47px) scale(1.12)}}

/* Build 025: considerably more readable but low, soft mist. All decorative
   layers are click-through and composed without expensive live backdrop blur. */
.keep-bottom-mist{height:28%;background:linear-gradient(to top,rgba(185,220,237,.29),rgba(193,228,247,.11) 42%,transparent 96%)}
.keep-bottom-mist::before{animation:keep-mist-rise 18s ease-in-out infinite alternate;opacity:.83}
.keep-bottom-mist::after{animation:keep-mist-secondary 25s ease-in-out infinite alternate;opacity:.45}
.fx-flame-light{background:radial-gradient(ellipse,rgba(255,203,123,.29),rgba(255,145,50,.105) 43%,transparent 72%);opacity:.57}
.fx-ice-puddle::before{width:32%;background:linear-gradient(100deg,transparent,rgba(189,243,255,.45) 50%,transparent)}
.fx-frost-star{background:radial-gradient(ellipse,rgba(166,227,255,.48),rgba(86,170,238,.16) 40%,transparent 74%);animation:keep-frost-star-pulse 10s ease-in-out infinite;opacity:.08}
@keyframes keep-frost-star-pulse{0%,72%,100%{opacity:.08}82%{opacity:.48}93%{opacity:.11}}
/* 26 lightweight DOM snowflakes: no full-frame canvas repaint. */
.keep-snowfall{position:absolute;inset:0;overflow:hidden;z-index:13;pointer-events:none}
.keep-layout:not([data-scene="overview"]) .keep-snowfall{display:none}
.keep-snowflake{position:absolute;top:-8%;display:block;width:var(--snow-size);height:var(--snow-size);border-radius:50%;background:#f2faffb8;box-shadow:0 0 3px #ebf8ff70;animation:keep-snow-fall var(--snow-duration) linear var(--snow-delay) infinite}
@keyframes keep-snow-fall{from{transform:translate3d(0,-10px,0);opacity:0}10%{opacity:.78}90%{opacity:.65}to{transform:translate3d(var(--snow-drift),1050px,0);opacity:0}}
/* Desktop-only subtle Ambilight outside the actual 16:9 scene. */
@media(min-width:901px){
 .keep-layout[data-scene="overview"] .stage-shell{isolation:isolate}
 .keep-layout[data-scene="overview"] .stage-shell::before{
  content:"";position:absolute;z-index:-1;pointer-events:none;inset:0;
  background:none;box-shadow:0 0 9px 4px #75bfe35e,
     -8px 0 17px 4px #3a93c66e,8px 0 16px 4px #c8aa6e44;
  opacity:.72;
 }
}
@media(max-width:650px){
 .account-banner{width:43%}
 .account-champion-caption{display:inline}
 .active-buffs{gap:1px}
 .buff-icon{font-size:clamp(7px,1.6cqw,12px)}
 .account-name-line strong{font-size:clamp(8px,2.4cqw,12px)}
 .building-unlock-number{font-size:clamp(12px,3.6cqw,25px)}
}
@media(prefers-reduced-motion:reduce){
 .keep-snowflake,.buff-float-icon{display:none!important;animation:none!important}
 .fx-frost-star{animation:none!important;opacity:.08}
}


/* Build 026 — user-selected layout and atmosphere revisions. */
/* Authoritative stage percentages. Keep the other approved placements unchanged. */
.keep-layout[data-scene="overview"] .building-ascendant.with-art{
  left:50% !important;top:50% !important;
}
.keep-layout[data-scene="overview"] .building-training.with-art{
  left:54% !important;top:34% !important;width:22% !important;height:18% !important;
}
.keep-layout[data-scene="overview"] .building-artisans.with-art{
  left:19% !important;top:23% !important;height:16% !important;
}
/* A restrained icy backing behind the readable text, not a giant green banner. */
.account-banner-trigger,.account-banner-trigger:hover,.account-banner-trigger.is-open{
  background:transparent;border:0;box-shadow:none;filter:none;
}
.account-banner-content{
  padding:1.25% 1.6%;border-radius:8px;
  background:linear-gradient(120deg,rgba(9,31,53,.65),rgba(14,55,79,.43) 72%,rgba(28,77,100,.19));
  border:1px solid rgba(159,219,244,.23);
  box-shadow:0 3px 12px rgba(0,11,24,.18),inset 0 1px 0 rgba(204,243,255,.1);
}
.account-banner-trigger:hover .account-banner-content,.account-banner-trigger.is-open .account-banner-content{
  background:linear-gradient(120deg,rgba(12,41,66,.76),rgba(18,58,82,.54) 75%,rgba(28,77,100,.26));
  border-color:rgba(168,226,247,.34);
}
/* The image itself is the approved frost-blue crest. Static, no animation. */
.account-portrait-frame{
  position:relative;display:block;flex:0 0 34.5%;aspect-ratio:1/1;
  background:url('/assets/art/ui/cf_snowflake_portrait.webp') center/contain no-repeat;
  filter:drop-shadow(0 1px 5px rgba(68,164,222,.27));
}
.champion-face{
  position:absolute;left:25%;top:24.5%;width:50%;height:51%;border-radius:50%;
  object-fit:cover;object-position:center;pointer-events:none;
}
/* Visible only during Edit Mode: to the RIGHT of the account/champion info. */
.edit-mode-reminder{
  left:calc(100% + 10px);bottom:10%;top:auto;transform:none;
  padding:clamp(5px,.6cqw,9px) clamp(7px,.9cqw,13px);
  white-space:nowrap;background:rgba(10,63,96,.90);border-color:#89d1ed;
}
/* Locked Cozy Grounds are visible with their Level 1 decoration; no click/claim. */
.keep-layout[data-scene="overview"] .plot-site.plot-locked.with-art{
  opacity:1;filter:none;cursor:default;
}
.keep-layout[data-scene="overview"] .plot-site.plot-locked.with-art .scene-asset,
.keep-layout[data-scene="overview"] .plot-site.plot-locked.with-art:hover .scene-asset{
  filter:grayscale(.76) saturate(.39) brightness(.77) drop-shadow(0 7px 9px rgba(5,20,34,.28));
}
/* Override the old generic plot-site last-span caption size. */
.keep-layout[data-scene="overview"] .plot-site.with-art .plot-unlock-number{
  font:bold clamp(16px,2.25cqw,36px)/1 Georgia,serif;
}
.plot-site.plot-locked:disabled{pointer-events:none}
.plot-unlock-number{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  color:#e0e7ed;opacity:.91;pointer-events:none;z-index:16;
  font:bold clamp(14px,2.35cqw,40px)/1 Georgia,serif;
  text-shadow:0 2px 7px #041629f0,0 0 12px #05141ec9;
}
/* 78 stage-only snowflakes; generated once per signed-in stage. */
.keep-snowflake{background:rgba(244,252,255,.70)}
/* 5 sec / 1.5, rather than the previous 5 sec portal breathing cycle. */
.keep-layout[data-scene="overview"] .building-portal.with-art .portal-window::before{
  animation-duration:3.333s;
}
/* Modest floating CF snowflake, over the existing floor star, never blocking clicks. */
.cf-centerpiece{
  position:absolute;z-index:7;pointer-events:none;
  width:3.3333%;height:6%;left:48.33335%;top:29.5%;
  display:flex;align-items:center;justify-content:center;
}
.keep-layout:not([data-scene="overview"]) .cf-centerpiece{display:none}
.cf-centerpiece-glow{position:absolute;width:110%;height:125%;left:-5%;top:-6%;border-radius:50%;
  background:radial-gradient(ellipse,rgba(115,219,255,.34),rgba(60,152,238,.11) 41%,transparent 73%);
  animation:cf-light-pulse 9s ease-in-out infinite;
}
.cf-centerpiece-crest{position:relative;z-index:1;width:100%;height:100%;object-fit:contain;
  filter:drop-shadow(0 0 8px rgba(76,193,252,.5));
  animation:cf-hover 6.4s ease-in-out infinite,cf-crest-glow 9s ease-in-out infinite;
}
.cf-centerpiece-particles{position:absolute;inset:-20%;overflow:visible;pointer-events:none}
.cf-particle{position:absolute;display:block;left:var(--px);top:var(--py);
  width:var(--p-size);height:var(--p-size);border-radius:50%;
  background:#e5faff;box-shadow:0 0 5px #98e8ff,0 0 9px #409bdf;
  animation:cf-frost-drift var(--dur) ease-in-out var(--delay) infinite;
}
@keyframes cf-hover{0%,100%{transform:translateY(3px)}50%{transform:translateY(-7px)}}
@keyframes cf-light-pulse{0%,70%,100%{opacity:.28;transform:scale(.93)}82%{opacity:.68;transform:scale(1.09)}}
@keyframes cf-crest-glow{0%,65%,100%{filter:drop-shadow(0 0 6px rgba(87,176,244,.35))}83%{filter:drop-shadow(0 0 15px rgba(140,235,255,.92))}}
@keyframes cf-frost-drift{0%{opacity:0;transform:translate3d(-2px,-8px,0) scale(.6)}28%{opacity:.85}75%{opacity:.55}100%{opacity:0;transform:translate3d(8px,23px,0) scale(1.03)}}
@media(max-width:650px){
  /* Keep the full name readable after the 1.5x portrait enlargement on narrow screens. */
  .keep-layout[data-scene="overview"] .account-banner{width:50%}
  .account-portrait-frame{flex:0 0 24%}
  .edit-mode-reminder{left:calc(100% + 4px);bottom:6%;padding:3px 5px;font-size:clamp(7px,1.3cqw,11px)}
  .account-banner-content{padding:.75% 1.1%}
  .plot-unlock-number{font-size:clamp(13px,2.8cqw,22px)}
  .cf-centerpiece{width:3.1667%;height:6%;left:48.66665%;top:29.5%}
}
@media(prefers-reduced-motion:reduce){
  .cf-centerpiece-crest,.cf-centerpiece-glow,.cf-particle{animation:none!important;filter:none!important}
  .cf-particle{display:none!important}
}

/* Build 027: a one-third-size floating emblem, and the approved 1.5x static portrait.
   Keep the emblem's center point anchored above the original courtyard floor star.
   The CSS above is authoritative; no other building positions or effects change. */

/* Build 028 — lower the portrait and account info clear of Champion's Hearth.
   On desktop the snowy artwork reaches the bottom edge; leave mobile safe. */
@media (min-width:651px) {
  .keep-layout[data-scene="overview"] .account-banner { bottom:-2%; }
}
/* Empty HUD space no longer blocks the tavern hit area; clicking either visible
   portrait or account text still opens Settings. */
.account-banner,.account-banner-trigger{pointer-events:none}
.account-portrait-frame,.account-banner-content,.account-banner-chevron,
.account-settings-menu,.edit-mode-reminder,.buff-inspector{pointer-events:auto}


/* Build 029 — approved visual polish. No changes to login, building art or data. */
/* The portal now looks through the same stationary opening mask onto the
   user-approved, fully icy blue forest cabin. Keep the 3.333s breathing cycle. */
/* Portal destination URL is selected above, leaving future scene overrides intact. */

/* Edge-to-edge frosted banner; deepest behind the crest and account name, fading
   toward the right. It stays click-through except for the portrait and text. */
.keep-layout[data-scene="overview"] .account-banner {left:0;}
.account-banner-trigger,
.account-banner-trigger:hover,
.account-banner-trigger.is-open {
  background:linear-gradient(99deg,
    rgba(5,23,42,.76) 0%,rgba(8,33,56,.68) 25%,
    rgba(14,48,75,.47) 58%,rgba(31,84,107,.18) 82%,
    rgba(31,84,107,0) 100%);
  border:0;border-radius:0 9px 9px 0;box-shadow:none;filter:none;
}
.account-banner-content,
.account-banner-trigger:hover .account-banner-content,
.account-banner-trigger.is-open .account-banner-content {
  background:transparent;border-color:transparent;box-shadow:none;
}

/* Shift 0.625% of the stage to the left (10px at 1600px), and tip the crest
   toward the viewer to make the CF letters easier to read. Never rotate in Z. */
.cf-centerpiece {left:calc(48.33335% - .625cqw);}
.cf-centerpiece-crest {
  transform-origin:50% 72%;
  animation:cf-hover-upright 6.4s ease-in-out infinite,cf-crest-glow 9s ease-in-out infinite;
}
@keyframes cf-hover-upright {
  0%,100%{transform:perspective(240px) rotateX(-17deg) scaleY(1.09) translateY(3px)}
  50%{transform:perspective(240px) rotateX(-17deg) scaleY(1.09) translateY(-7px)}
}

/* Additional lightweight falling snow moving in opposite crosswinds. */
.keep-snowflake--wind-east,.keep-snowflake--wind-west{
  background:rgba(238,250,255,.76);box-shadow:0 0 3px rgba(235,249,255,.42);
}
.keep-snowflake--wind-east{animation-name:keep-snow-fall-east}
.keep-snowflake--wind-west{animation-name:keep-snow-fall-west}
@keyframes keep-snow-fall-east{
  0%{transform:translate3d(-9cqw,-14px,0);opacity:0}
  12%{opacity:.75}85%{opacity:.61}
  100%{transform:translate3d(24cqw,1050px,0);opacity:0}
}
@keyframes keep-snow-fall-west{
  0%{transform:translate3d(9cqw,-14px,0);opacity:0}
  12%{opacity:.72}85%{opacity:.6}
  100%{transform:translate3d(-24cqw,1050px,0);opacity:0}
}
@media(max-width:650px){
  .keep-layout[data-scene="overview"] .account-banner{left:0;}
  .cf-centerpiece{left:calc(48.66665% - .625cqw);}
}
@media(prefers-reduced-motion:reduce){
  .cf-centerpiece-crest{animation:none!important;transform:none!important}
}


/* Build 030 — user-approved Champion Hall placement and less intrusive CF crest.
   Keep the text in its established column while reducing the VISIBLE static
   portrait snowflake to 75% of its previous linear size. With flex-basis
   unchanged, the account and champion names do not unexpectedly shift. */
.keep-layout[data-scene="overview"] .account-portrait-frame {
  aspect-ratio:auto;
  height:9.185625cqw; /* 75% of the prior 12.2475cqw badge square */
  background-size:auto 100%;
}
/* Keep future supplied champion portraits centered inside the smaller crest. */
.keep-layout[data-scene="overview"] .account-portrait-frame .champion-face {
  left:30.5%; width:39%; top:24.5%; height:51%;
}
/* The emblem's BOTTOM leans toward the viewer and TOP leans back: rotateX
   positive in CSS perspective; preserve its size, exact stage alignment,
   6.4-second hover and 9-second illumination cycle. */
.cf-centerpiece-crest {
  transform-origin:50% 50%;
  animation:cf-hover-readable 6.4s ease-in-out infinite,cf-crest-glow 9s ease-in-out infinite;
}
@keyframes cf-hover-readable {
  0%,100%{transform:perspective(240px) rotateX(14deg) scaleY(1.09) translateY(3px)}
  50%{transform:perspective(240px) rotateX(14deg) scaleY(1.09) translateY(-7px)}
}
@media(max-width:650px){
  /* The prior mobile badge occupied 12cqw, now 9cqw. */
  .keep-layout[data-scene="overview"] .account-portrait-frame{height:9cqw}
}
@media(prefers-reduced-motion:reduce){
  /* No hovering/pulsing, but retain the intended legible face orientation. */
  .cf-centerpiece-crest{animation:none!important;transform:perspective(240px) rotateX(14deg) scaleY(1.09)!important}
}


/* Build 031 — larger readable center crest and tighter left-edge account banner. */
@media (min-width:651px) {
  /* Keep the banner background no taller than the portrait crest, and extend the
     right-side fade slightly for breathing room. */
  .keep-layout[data-scene="overview"] .account-banner { width:calc(35.5% + 60px); left:0; }
  .account-banner-trigger,
  .account-banner-trigger:hover,
  .account-banner-trigger.is-open {
    min-height:9.185625cqw;
    height:9.185625cqw;
    padding:0 0 0 0;
    align-items:center;
  }
  .account-banner-content,
  .account-banner-trigger:hover .account-banner-content,
  .account-banner-trigger.is-open .account-banner-content {
    align-self:stretch;
    justify-content:center;
    padding:0.55% 1.25% 0.45% 0.65%;
  }
  /* Hook Edit Mode to the banner's top-right corner. */
  .edit-mode-reminder{
    left:auto; right:0; bottom:auto; top:0;
    transform:translateY(-100%);
    border-radius:6px 6px 0 0;
  }
}
/* Increase the floating center crest by 25% while preserving its visual center. */
.cf-centerpiece{
  width:4.166625%;
  height:7.5%;
  left:calc(47.9166875% - .625cqw);
  top:28.75%;
}
@media(max-width:650px){
  .cf-centerpiece{
    width:3.958375%;
    height:7.5%;
    left:calc(48.2708125% - .625cqw);
    top:28.75%;
  }
  .edit-mode-reminder{left:auto;right:0;bottom:auto;top:0;transform:translateY(-100%);}
}
@media(prefers-reduced-motion:reduce){
  .cf-centerpiece{width:4.166625%;height:7.5%;left:calc(47.9166875% - .625cqw);top:28.75%;}
}


/* Build 032 — banner backdrop follows the visible icy CF portrait instead of
   the oversized, originally reserved portrait slot. This is visual-only;
   keep the account text, menu hit targets, and horizontal spacing untouched. */
.keep-layout[data-scene="overview"] .account-banner-trigger,
.keep-layout[data-scene="overview"] .account-banner-trigger:hover,
.keep-layout[data-scene="overview"] .account-banner-trigger.is-open {
  position:relative;
  isolation:isolate;
  background:none;
}
/* The icy fade begins near the top crystal tip and ends just below its base.
   The wrapper remains the same height so account names/XP do not jump. */
.keep-layout[data-scene="overview"] .account-banner-trigger::before {
  content:"";
  position:absolute;
  z-index:0;
  left:0;right:0;
  top:1cqw;bottom:1cqw;
  pointer-events:none;
  border-radius:0 9px 9px 0;
  background:linear-gradient(99deg,
    rgba(5,23,42,.76) 0%,rgba(8,33,56,.68) 25%,
    rgba(14,48,75,.47) 58%,rgba(31,84,107,.18) 82%,
    rgba(31,84,107,0) 100%);
}
/* Keep visible content above the fade. No changes to the clickable regions. */
.keep-layout[data-scene="overview"] .account-portrait-frame,
.keep-layout[data-scene="overview"] .account-banner-content,
.keep-layout[data-scene="overview"] .account-banner-chevron {
  position:relative;
  z-index:1;
}
/* A 15% smaller crest, raised very slightly WITHIN its existing flex slot;
   its underlying box stays full-width to keep both text rows aligned. */
.keep-layout[data-scene="overview"] .account-portrait-frame {
  height:7.8cqw;
  background-size:auto 100%;
  background-position:center calc(50% - .3cqw);
}
.keep-layout[data-scene="overview"] .account-portrait-frame .champion-face {
  left:33.5%;width:33%;
  top:calc(24.5% - .3cqw);height:51%;
}
/* Keep the Edit Mode tab attached to the VISIBLE backing's top-right edge. */
@media(min-width:651px){
  .keep-layout[data-scene="overview"] .edit-mode-reminder {
    top:1cqw;
  }
}
@media(max-width:650px){
  .keep-layout[data-scene="overview"] .account-banner-trigger::before {
    top:1.7cqw;bottom:.75cqw;
  }
  .keep-layout[data-scene="overview"] .account-portrait-frame {
    height:8cqw;
    background-position:center calc(50% - .22cqw);
  }
  .keep-layout[data-scene="overview"] .account-portrait-frame .champion-face{
    left:33.5%;width:33%;top:calc(24.5% - .22cqw);height:51%;
  }
  .keep-layout[data-scene="overview"] .edit-mode-reminder {top:1.7cqw;}
}


/* Build 034 — crisp, flat-faced, high-resolution CF snowflake centerpiece.
   Enlarge by 15% about its existing center above the original floor star;
   retain the previously approved X-axis tilt, float, pulse and particles. */
.cf-centerpiece {
  width:4.79161875%; /* 4.166625% × 1.15 */
  height:8.625%;     /* 7.5% × 1.15 */
  left:calc(47.604190625% - .625cqw);
  top:28.1875%;
}
/* The new art has a clean transparent edge; remove layered drop shadows that
   previously gave the crest a chunky/dark appearance. The independent ambient
   blue glow below remains the only glow effect. */
.cf-centerpiece-crest {
  filter:none;
  animation:cf-hover-readable 6.4s ease-in-out infinite;
}
.cf-centerpiece-glow {
  background:radial-gradient(ellipse,
    rgba(115,219,255,.26),rgba(60,152,238,.075) 41%,transparent 73%);
}
@media (max-width:650px) {
  .cf-centerpiece {
    width:4.55213125%;
    height:8.625%;
    left:calc(47.973934375% - .625cqw);
    top:28.1875%;
  }
}
@media (prefers-reduced-motion:reduce) {
  .cf-centerpiece-crest {
    animation:none!important;
    filter:none!important;
    transform:perspective(240px) rotateX(14deg) scaleY(1.09)!important;
  }
}


/* Staged cinematic: video lives in an overlay OUTSIDE the zoomed canvas. */
.quest-cinematic{position:absolute;inset:0;z-index:100;isolation:isolate;overflow:hidden;
  background:#020b16;color:#eef8ff;container-type:inline-size;user-select:text}
.quest-cinematic-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  object-position:center;pointer-events:none;background:#071527}
/* The intro and ambient destination occupy independent layers: overlap the
   muted loop UNDER the intro, then dissolve the intro into it without black. */
#quest-intro-video{z-index:2;opacity:1;transition:opacity 1.3s ease}
#quest-loop-video{z-index:1;opacity:0;transition:opacity 1.3s ease;
  background:#071527 url('/assets/art/cinematics/chillwing_request_loop_poster.jpg') center/cover no-repeat}
.quest-cinematic.is-crossfading #quest-intro-video{opacity:0}
.quest-cinematic.is-crossfading #quest-loop-video{opacity:1}
.quest-cinematic.is-briefing #quest-loop-video{opacity:1;transition:none}
.quest-cinematic-toolbar{position:absolute;right:2%;top:3%;z-index:5;display:flex;align-items:center;
  justify-content:flex-end;gap:clamp(4px,.75cqw,12px)}
.quest-cinematic-control{color:#def5ff;background:rgba(8,28,48,.83);border:1px solid #80c8e5;
  border-radius:5px;padding:clamp(4px,.55cqw,10px) clamp(6px,.85cqw,14px);
  font-size:clamp(9px,1.05cqw,16px);cursor:pointer;backdrop-filter:none}
.quest-cinematic-control:hover,.quest-cinematic-control:focus-visible{background:#175073;outline-color:#d7f3ff}
.quest-preflight{position:absolute;z-index:4;right:4.2%;top:15%;width:43%;max-height:74%;
  overflow:auto;box-sizing:border-box;padding:clamp(12px,2cqw,32px);
  border:1px solid rgba(151,221,255,.63);border-radius:clamp(6px,1.1cqw,14px);
  background:linear-gradient(135deg,rgba(8,27,51,.91),rgba(12,48,78,.87));
  box-shadow:0 0 20px rgba(17,112,173,.2),0 12px 36px rgba(0,10,22,.53)}
.quest-preflight-eyebrow{display:block;color:#b4e6ff;letter-spacing:.12em;
  font:bold clamp(7px,.87cqw,13px)/1.2 system-ui,sans-serif}
.quest-preflight h2{margin:clamp(5px,1.2cqw,18px) 0 .45em;
  color:#fff4d3;font:normal clamp(15px,2.45cqw,36px)/1.12 Georgia,serif}
.quest-preflight-intro{font:clamp(10px,1.18cqw,18px)/1.45 Georgia,serif;color:#d9eefe}
.quest-preflight-details{margin:clamp(8px,1.4cqw,20px) 0;display:grid;gap:clamp(5px,.8cqw,12px)}
.quest-preflight-details p{margin:0;display:grid;gap:3px}
.quest-preflight-details strong{color:#9cdefb;font:700 clamp(9px,1.02cqw,15px)/1.3 system-ui,sans-serif}
.quest-preflight-details span{font:clamp(9px,1cqw,16px)/1.35 system-ui,sans-serif}
.quest-preflight-status{color:#b4d3e7;font-size:clamp(9px,.94cqw,14px)}
.quest-preflight-actions{display:flex;gap:clamp(5px,.7cqw,12px);flex-wrap:wrap;margin-top:1em}
.quest-preflight-actions button{border:1px solid #98d9f1;border-radius:5px;padding:clamp(6px,.7cqw,12px) clamp(8px,1.1cqw,16px);
  font-weight:700;font-size:clamp(9px,1cqw,16px);cursor:pointer}
.quest-join-button{background:#246f91;color:#f5ffff}
.quest-join-button:disabled{opacity:.48;cursor:not-allowed}
.quest-return-button{background:#0c2b46;color:#e2f4ff}
.quest-return-button:hover{background:#1c5273}
.quest-cinematic-message{position:absolute;z-index:5;bottom:5%;left:5%;max-width:90%;
  padding:.75em 1em;background:rgba(4,18,36,.9);border:1px solid #76b9d9;color:#eaf8ff}
@media(max-width:650px){
  .quest-preflight{right:3%;top:15%;width:54%;max-height:75%;padding:2cqw}
  .quest-cinematic-toolbar{top:2%;right:2%}
  .quest-preflight h2{font-size:clamp(12px,2.6cqw,18px)}
}
@media(prefers-reduced-motion:reduce){
  #quest-intro-video,#quest-loop-video{transition:none}
  .quest-cinematic-video{display:none}
  .quest-cinematic{background:#051c30 url('/assets/art/cinematics/chillwing_request_loop_poster.jpg') center/cover no-repeat}
}


/* Build 035 mobile briefing: keep both actions visible even in the 16:9
   compact Keep viewport; allow only the objective details to scroll. */
@media(max-width:650px){
  .quest-preflight{
    left:3%;right:3%;top:4%;bottom:3%;width:auto;max-height:none;
    overflow:hidden;display:flex;flex-direction:column;gap:2px;
    padding:clamp(5px,1.2cqw,9px);
  }
  .quest-preflight h2{font-size:clamp(12px,3.2cqw,16px);margin:1px 0}
  .quest-preflight-intro{margin:1px 0;font-size:clamp(9px,2.5cqw,11px)}
  .quest-preflight-details{flex:1 1 auto;min-height:0;overflow-y:auto;margin:2px 0;gap:2px}
  .quest-preflight-details p{gap:1px}
  .quest-preflight-details strong,.quest-preflight-details span{font-size:clamp(8px,2.1cqw,11px)}
  .quest-preflight-status{flex-shrink:0;margin:1px 0;font-size:clamp(7px,1.9cqw,9px)}
  .quest-preflight-actions{flex-shrink:0;margin-top:2px;gap:4px}
  .quest-preflight-actions button{padding:4px 6px;font-size:clamp(8px,2cqw,10px)}
}


/* Build 036 — optional heavier crosswind snow gust, about 8 seconds of each
   52-second cycle. Independent of the 150 light snowflakes already falling. */
.keep-snow-gust{position:absolute;inset:0;z-index:14;overflow:hidden;
  pointer-events:none;opacity:0;animation:keep-gust-appearance 52s linear infinite}
.keep-layout:not([data-scene="overview"]) .keep-snow-gust{display:none}
.keep-gust-flake{position:absolute;top:-10%;display:block;pointer-events:none;
  width:var(--gust-size);height:var(--gust-size);border-radius:50%;
  background:rgba(245,253,255,.9);box-shadow:0 0 4px rgba(228,250,255,.8);
  animation:keep-gust-sweep var(--gust-duration) linear var(--gust-delay) infinite}
@keyframes keep-gust-appearance{
  0%,15%,34%,100%{opacity:0}
  18%,29%{opacity:.88}
}
@keyframes keep-gust-sweep{
  0%{opacity:0;transform:translate3d(0,-12px,0)}
  13%{opacity:.95}82%{opacity:.75}
  100%{opacity:0;transform:translate3d(var(--gust-shift),65cqw,0)}
}
@media(prefers-reduced-motion:reduce){
  .keep-snow-gust,.keep-gust-flake{display:none!important;animation:none!important}
}


/* Build 039: account audio is controlled from Settings, not each cinematic. */
.account-audio-control{
  display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(3px,.35cqw,6px);
  padding:clamp(5px,.55cqw,9px) clamp(6px,.65cqw,10px);
  border:1px solid rgba(131,198,233,.4);border-radius:6px;
  background:rgba(9,39,62,.45);color:#e2f5ff;
}
.account-audio-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;
  font:600 clamp(9px,.84cqw,13px)/1.2 system-ui,sans-serif}
.account-audio-heading label{cursor:pointer}
.account-audio-heading output{font-variant-numeric:tabular-nums;font-weight:500}
.account-audio-control input[type="range"]{
  width:100%;margin:0;min-width:0;height:clamp(14px,1.3cqw,21px);
  cursor:pointer;accent-color:#84ceeb;
}
.account-audio-control.is-muted{
  background:rgba(250,219,130,.75);border-color:#fff0a8;color:#142d42;
}
.account-audio-control.is-muted input[type="range"]{accent-color:#b87516}
/* Keep both sliders accessible on the small 16:9 stage. */
@media(max-width:650px){
  .account-settings-menu{max-height:42cqw;overflow-y:auto;overscroll-behavior:contain;
    min-width:calc(60% + 10px);}
  .account-audio-control{padding:3px 5px;gap:2px}
  .account-audio-heading{font-size:clamp(8px,2.2cqw,11px)}
  .account-audio-control input[type="range"]{height:18px}
}
/* The burning Lost Wood sends a few faint orange/red cinders in the gust.
   These inherit the existing occasional 52-second wind pulse, and never
   intercept gameplay clicks or render under reduced-motion settings. */
.keep-gust-cinder{
  position:absolute;top:-10%;display:block;pointer-events:none;
  width:var(--gust-size);height:var(--gust-size);border-radius:50%;
  background:radial-gradient(circle at 32% 30%,#fff2bd 0%,#ffc270 28%,#e95c36 65%,#a62827 100%);
  box-shadow:0 0 5px 1px rgba(255,123,52,.6),0 0 9px rgba(201,55,32,.25);
  animation:keep-gust-sweep var(--gust-duration) linear var(--gust-delay) infinite;
}
@media(prefers-reduced-motion:reduce){
  .keep-gust-cinder{display:none!important;animation:none!important}
}


/* Build 040 — rare cinematic Lost Wood gust over the courtyard. The existing
   52-second snow/cinder gust stays unchanged for three out of every four cycles;
   the fourth uses homepage-style six-spoke flakes and glowing embers on canvas. */
.keep-rare-gust {
  position:absolute;inset:0;width:100%;height:100%;z-index:15;
  pointer-events:none;display:block;
}
.keep-rare-gust[data-active="false"]{visibility:hidden}
.keep-snow-gust.is-rare-overridden{opacity:0!important}
.keep-layout:not([data-scene="overview"]) .keep-rare-gust{display:none}
@media(prefers-reduced-motion:reduce){
  .keep-rare-gust{display:none!important}
  .keep-snow-gust.is-rare-overridden{opacity:0!important}
}
