/* <stage-view>'s rules (components/stage-view.js): the page links this file, so its first paint has them; the component adds it
   to any other root it's drawn in (light-styles.js). */
stage-view { display:block; }
/* Preset backdrops behind the model; plain dark gray is the default. Each is split at the
   floor: a background colour above (--bg1 at the top to --bg2 at the horizon) and a floor
   colour below (--fg1 at the horizon to --fg2 at the bottom). floor.tick keeps --horizon on
   the character's feet and --blend at half the floor's height, so the seam sits under the
   floor shadow. Effects composite over --bg2 (see clearToBackdrop). */
/* Registered as colours, so a new scene's gradient blends from the old one's. */
@property --bg1 { syntax:'<color>'; inherits:true; initial-value:#1e2830; }
@property --bg2 { syntax:'<color>'; inherits:true; initial-value:#182027; }
@property --fg1 { syntax:'<color>'; inherits:true; initial-value:#11181d; }
@property --fg2 { syntax:'<color>'; inherits:true; initial-value:#0b1014; }
/* And the horizon, so it can ease to where a swapped-in model puts it (see endSwap). */
@property --horizon { syntax:'<length-percentage>'; inherits:true; initial-value:64%; }
@property --blend { syntax:'<length>'; inherits:true; initial-value:14px; }
stage-view { --horizon:64%; --blend:14px; transition:--bg1 .45s cubic-bezier(.2, .7, .3, 1), --bg2 .45s cubic-bezier(.2, .7, .3, 1), --fg1 .45s cubic-bezier(.2, .7, .3, 1), --fg2 .45s cubic-bezier(.2, .7, .3, 1);
  --bg1:#1e2830; --bg2:#182027; --fg1:#11181d; --fg2:#0b1014;
  background:linear-gradient(to bottom, var(--bg1) 0%, var(--bg2) calc(var(--horizon) - var(--blend)), var(--fg1) calc(var(--horizon) + var(--blend)), var(--fg2) 100%); }
#model { width:100%; height:100%; }
#model canvas { width:100% !important; height:100% !important; }
#status { position:absolute; left:12px; bottom:62px; color:var(--muted); font-size:var(--fs-sm); }
/* Layering inside the view (its own stacking context): background 1, character canvas 2 (the
   mount and pets are models in it). */
stage-view { isolation:isolate; }
/* The floor: a soft disc on the ground under the character (and pets), under everything
   else (z-index 0). Placed each frame from the model's feet, so it turns and zooms with it. */
#floor { position:absolute; left:0; top:0; z-index:0; pointer-events:none; opacity:0; border-radius:50%;
  background:radial-gradient(closest-side, rgba(0,0,0,.45) 0%, rgba(0,0,0,.28) 22%, rgba(255,255,255,.07) 58%, rgba(255,255,255,.04) 80%, rgba(255,255,255,0) 100%); }
#floor.ready { opacity:1; transition:opacity .4s ease; }
/* A scene's ground: a square of tiled game texture mapped onto the ground plane each frame
   (see scene.tick), fading out with distance. Under the shadow disc. */
#ground { position:absolute; left:0; top:0; width:1024px; height:1024px; z-index:0; pointer-events:none; transform-origin:0 0;
  opacity:0; background-repeat:repeat; backface-visibility:hidden;
  -webkit-mask-image:radial-gradient(circle closest-side, #000 45%, transparent 100%); mask-image:radial-gradient(circle closest-side, #000 45%, transparent 100%); }
#ground.ready { opacity:1; transition:opacity .4s ease; }
/* The skyline: a silhouette on the horizon (mountains, trees…) in two layers, a hazy far one and
   a nearer one, standing where the ground fades out behind the character (--sky-y, see
   scene.tick) and turning with the camera, on the horizon line where the sky meets the ground's
   colour. Behind the ground. */
#skyline { --sky-h:min(270px, calc(var(--sky-y, 300px) * .85)); position:absolute; left:0; right:0; top:calc(var(--sky-y, 50%) - var(--sky-h)); height:var(--sky-h); /* never taller than the space above the horizon (a short window scales it down rather than cutting it off) */ z-index:0; pointer-events:none; opacity:0; transition:opacity .4s ease; }
#skyline.ready { opacity:1; }
#skyline::before { content:''; position:absolute; left:0; right:0; bottom:var(--ceiling-foot, 100%); height:200vh; background:var(--ceiling, none); } /* a hall's ceiling, where a backdrop has one (its backdrop.json ceiling, set by applySkyline): the viewer above the skyline in that colour; --ceiling-foot (ceilingDown) brings it down to the far layer's top */
#skyline > div { position:absolute; left:0; right:0; bottom:0; background-repeat:repeat-x; background-position-y:bottom; }
#skyline .back, #skyline .backlights { height:66%; background-size:auto 100%; } /* a third layer behind the far one, where a skyline has one (Ironforge's distant city) */
#skyline .far { height:72%; background-size:auto 100%; }
#skyline .midroofs, #skyline .mid, #skyline .midlights { height:66%; background-size:auto 100%; } /* a layer between the landmark and the near one, where a skyline has one (the Riverglades' woods): in front of the landmark, so sharp as it is; .midlights: its windows, .midroofs: its roofs seen through it (Stormwind's rooftops) */
#skyline.lava .near, #skyline.lava .lights, #skyline.lava .back, #skyline.lava .backlights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.15) 12%, rgba(0,0,0,.35) 24%, rgba(0,0,0,.6) 38%, rgba(0,0,0,.85) 52%, #000 65%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.15) 12%, rgba(0,0,0,.35) 24%, rgba(0,0,0,.6) 38%, rgba(0,0,0,.85) 52%, #000 65%); } /* Ironforge's pillars, rising into the dark (their tops fade, smoothly) */
#skyline.lava.forge .near, #skyline.lava.forge .lights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.15) 10%, rgba(0,0,0,.4) 20%, rgba(0,0,0,.7) 30%, rgba(0,0,0,.92) 38%, #000 45%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.15) 10%, rgba(0,0,0,.4) 20%, rgba(0,0,0,.7) 30%, rgba(0,0,0,.92) 38%, #000 45%); } /* the forge-lit wall behind starts at 46% of the skyline's height: a near layer still fading there lets the glow through the pillars' lower halves */
#skyline.lava.forge .mid, #skyline.lava.forge .midlights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.3) 6%, rgba(0,0,0,.7) 12%, rgba(0,0,0,.93) 16%, #000 18%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.3) 6%, rgba(0,0,0,.7) 12%, rgba(0,0,0,.93) 16%, #000 18%); } /* the mid layer, two thirds of the skyline's height, meets the forge-lit wall 18% down from its top: solid from there, so no pillar shows the glow through it, fading only above */
#skyline.lava .far { height:66%; } /* the lava at the distant city's depth: its size, turning with it (scene.tick) */
#skyline.lava.sludge .far { height:40%; } /* Undercity's sludge falls, shorter */
#skyline.lava .far { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.25) 35%, rgba(0,0,0,.7) 65%, #000 90%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.25) 35%, rgba(0,0,0,.7) 65%, #000 90%); } /* forge lava, fading in slowly from the dark above */
#skyline.misty .far { -webkit-mask-image:linear-gradient(to top, rgba(0,0,0,.35) 0%, #000 75%); mask-image:linear-gradient(to top, rgba(0,0,0,.35) 0%, #000 75%); } /* the sky's colour shows through toward its foot */
#skyline .near, #skyline .lights, #skyline .landmark, #skyline .landmarklights { height:100%; background-size:auto 100%; } /* .lights: lit windows over the near layer (Ironforge); .landmark: what only this backdrop has, between the far and near layers, and its own lights */
/* Out of focus with distance: the far layer (and the one behind it) soft, the near one sharp. */
#skyline .far, #skyline .back, #skyline .backlights { filter:blur(2px); clip-path:inset(-20px -20px 0 -20px); } /* the blur kept from spreading below the horizon, where it showed as a pale line over the ground */
#skyline .landmark, #skyline .landmarklights { filter:blur(1px); clip-path:inset(-20px -20px 0 -20px); }
#skyline.sharp .far, #skyline.sharp .landmark, #skyline.sharp .landmarklights { filter:none; } /* hard-edged, where a backdrop sets sharp (skylineLayers) */
#skyline.low .near, #skyline.low .lights { height:var(--low, 62%); } /* a lower near layer (SKYLINE_LOW: its height, set by applySkyline) */
#skyline.vault .near, #skyline.vault .lights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 20%, rgba(0,0,0,.8) 34%, #000 44%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 20%, rgba(0,0,0,.8) 34%, #000 44%); } /* indoors: Undercity's wall, or a cave's roof, fading up into the dark */
#skyline.vault.walled .near, #skyline.vault.walled .lights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.3) 8%, rgba(0,0,0,.7) 16%, rgba(0,0,0,.93) 23%, #000 28%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.3) 8%, rgba(0,0,0,.7) 16%, rgba(0,0,0,.93) 23%, #000 28%); } /* the far layer stands from 28% of the skyline's height down: a near layer still fading there lets its lighter wall or cave show through the piers, posts and roofs, so it is solid from there and fades only above */
/* A landmark's foot fades into the haze over its lowest seventh: hazed lighter than the land, it would otherwise show a pale band wherever
   the near layer dips, cut on a slant by the ground's edge. Indoors and by lava it also fades up into the dark, as the near layer does. */
#skyline .landmark, #skyline .landmarklights { -webkit-mask-image:linear-gradient(to top, transparent var(--lm-foot, 0%), #000 calc(var(--lm-foot, 0%) + 14%)); mask-image:linear-gradient(to top, transparent var(--lm-foot, 0%), #000 calc(var(--lm-foot, 0%) + 14%)); } /* --lm-foot: a raised landmark's foot, so the fade rises with it */
#skyline.lava .landmark, #skyline.lava .landmarklights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.15) 12%, rgba(0,0,0,.35) 24%, rgba(0,0,0,.6) 38%, rgba(0,0,0,.85) 52%, #000 65%, #000 86%, transparent 100%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.15) 12%, rgba(0,0,0,.35) 24%, rgba(0,0,0,.6) 38%, rgba(0,0,0,.85) 52%, #000 65%, #000 86%, transparent 100%); }
#skyline.lava.forge .landmark, #skyline.lava.forge .landmarklights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.15) 10%, rgba(0,0,0,.4) 20%, rgba(0,0,0,.7) 30%, rgba(0,0,0,.92) 38%, #000 45%, #000 86%, transparent 100%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.15) 10%, rgba(0,0,0,.4) 20%, rgba(0,0,0,.7) 30%, rgba(0,0,0,.92) 38%, #000 45%, #000 86%, transparent 100%); }
#skyline.vault .landmark, #skyline.vault .landmarklights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 20%, rgba(0,0,0,.8) 34%, #000 44%, #000 86%, transparent 100%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 20%, rgba(0,0,0,.8) 34%, #000 44%, #000 86%, transparent 100%); }
#skyline.vault.walled .landmark, #skyline.vault.walled .landmarklights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.3) 8%, rgba(0,0,0,.7) 16%, rgba(0,0,0,.93) 23%, #000 28%, #000 86%, transparent 100%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.3) 8%, rgba(0,0,0,.7) 16%, rgba(0,0,0,.93) 23%, #000 28%, #000 86%, transparent 100%); }
#skyline.vault.walled.footed .landmark, #skyline.vault.walled.footed .landmarklights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.3) 8%, rgba(0,0,0,.7) 16%, rgba(0,0,0,.93) 23%, #000 28%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.3) 8%, rgba(0,0,0,.7) 16%, rgba(0,0,0,.93) 23%, #000 28%); } /* solid to its foot, where a backdrop sets solidFoot (skylineLayers): the near layer's edge covers where it meets the floor */
#skyline.lava.sludge .far { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.25) 35%, rgba(0,0,0,.7) 58%, #000 66%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.25) 35%, rgba(0,0,0,.7) 58%, #000 66%); } /* Undercity's canal line, 71% down its far layer: solid there, so the depths behind never show through the sludge as dark smudges */
#skyline.vault.sludge .landmark, #skyline.vault.sludge .landmarklights { -webkit-mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 20%, rgba(0,0,0,.8) 34%, #000 44%, #000 86.5%, transparent 89%); mask-image:linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 20%, rgba(0,0,0,.8) 34%, #000 44%, #000 86.5%, transparent 89%); } /* the War Quarter's tower fades out behind the far bank (its foot is hidden there anyway), so it never dims the canal line below the bank */
stage-view.settle { transition:--bg1 .45s cubic-bezier(.2, .7, .3, 1), --bg2 .45s cubic-bezier(.2, .7, .3, 1), --fg1 .45s cubic-bezier(.2, .7, .3, 1), --fg2 .45s cubic-bezier(.2, .7, .3, 1), --horizon .4s ease, --blend .4s ease; }
#model { position:relative; z-index:2; height:100% !important; }
/* Models fade in once loaded and settled; hiding is instant (the transition is on the visible state only). */
#model { opacity:0; } #model.ready { opacity:1; transition:opacity .4s ease; }
#model { transition:opacity .25s ease; } /* fading out as a new model replaces it (see rebuild) */
/* What floats over the view, each in its place: the Chronicle's corner button and the doll's cards, the stance bar,
   the mouse's help, the welcome, start and tip cards, the New character dialog; on a phone the Look's switcher and
   Edit at the top, the dimming behind the side panel. (Shown and hidden by the page's states.) */
/* The Chronicle's prompt to send the file to Purist, under Exit Chronicle. */
#contribute, #doctorHelp { position:absolute; left:16px; top:calc(var(--top-float) + var(--h-float) + 8px); pointer-events:auto; width:min(400px, calc(100% - 32px)); max-width:none; } /* (doll-card) */
/* How the Doctor works, under its switch while it's on (journal.setDoctoring). */
#doctorHelp { left:auto; right:16px; } /* (under the Doctor's button, top right) */
/* The Chronicle button, in the model's top left corner (Exit Chronicle takes the corner while it's open). Under the item drawer. */
#chronCorner { position:absolute; top:var(--top-float); left:16px; z-index:4; } /* level with the Lookit switcher beside it */
/* The mouse controls, in the viewer's bottom-left corner. */
#mouseHelp { position:absolute; left:16px; bottom:16px; z-index:4; }
#viewer.bare :is(#chronCorner, #modelBar) { visibility:hidden; } /* Hide UI (and the paper doll, and the mouse's help but its buttons) */
@media (max-width: 760px), (hover: none) { #mouseHelp { display:none; } }
#welcome { position:absolute; top:calc(var(--top-float) + var(--h-float) + 12px); left:16px; z-index:6; width:320px; } /* (purist-card) */
#start { position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); z-index:7; width:440px; padding:22px 22px 18px; border-radius:var(--r-xl); } /* (purist-card) */
/* New character (purist-dialog, modeless): over the viewer's left, the model live beside it. */
#newCharModal { position:absolute; inset:0; z-index:40; pointer-events:none; }
#tip { position:absolute; top:calc(var(--top-float) + var(--h-float) + 12px); left:16px; z-index:6; width:300px; } /* (purist-card) */
/* In Chronicle its column is on the right, so the tip slides over to that side of the viewer,
with the views' own easing. */
#tip { transition:left .36s cubic-bezier(.3, .7, .2, 1); }
@media (max-width: 720px), (max-height: 520px) {
  #mlook { position:absolute; left:12px; right:12px; top:12px; z-index:4; display:flex; align-items:center; gap:8px; pointer-events:none; } #mlook > * { pointer-events:auto; } /* the Look's switcher and Edit Look, over the model (see placeLook) */
  #mside { flex:none; display:inline-flex; } /* (the floating buttons' style, in Lookit's violet) */
  #mlook .outfitsw { position:static; flex:0 1 220px; min-width:0; padding:0; }
  #mscrim { position:absolute; inset:0; z-index:8; background:#0007; opacity:0; pointer-events:none; transition:opacity .28s ease; }
  #modelBar { display:none; } /* the weapon stance is left to bigger screens; Edit has the corner */
  #doll #contribute, #doll #doctorHelp { top:calc(12px + 2 * var(--h-float) + 16px); left:12px; width:calc(100% - 24px); } /* (under Exit and Share) */
}
