/*
 * COSENTINO MEDIO — modern narrative-adventure splash.
 * The visual language follows the illustrated locations and character art:
 * contemporary editorial typography, warm paper accents, graphic-novel
 * portrait treatment and a deliberately quiet progress indicator.
 * This sheet is loaded AFTER styles.css; it affects only #cmLoadScreen.
 */
#cmLoadScreen {
  --cm-paper: #f3eee5;
  --cm-muted: #c9c9c4;
  --cm-stroke: rgba(255,255,255,.12);
  --cm-accent: var(--cm-load-primary,#edbd76);
  background-color: #111715;
  background-image:
    radial-gradient(ellipse 72% 96% at 22% 96%,rgba(174,118,81,.2),transparent 72%),
    radial-gradient(ellipse 60% 75% at 98% 0%,rgba(71,94,92,.2),transparent 80%),
    linear-gradient(115deg,#161b1a 10%,#0c1111 93%);
  color:var(--cm-load-text,var(--cm-paper));
  font-family:"DM Sans",Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  font-synthesis:none;
  letter-spacing:0;
}
#cmLoadScreen::before{
  inset:0;
  z-index:0;
  opacity:1;
  background:
    repeating-linear-gradient(0deg,transparent 0 77px,rgba(242,228,202,.025) 78px,transparent 79px),
    repeating-linear-gradient(90deg,transparent 0 77px,rgba(242,228,202,.025) 78px,transparent 79px);
  animation:none;
  pointer-events:none;
}
#cmLoadScreen::after{
  z-index:0;
  background:
    linear-gradient(90deg,rgba(8,13,13,calc(var(--cm-load-overlay,.58)*.37)) 0%,
      rgba(8,13,13,calc(var(--cm-load-overlay,.58)*.55)) 45%,
      rgba(8,13,13,var(--cm-load-overlay,.58)) 100%);
}
#cmLoadScreen .cm-load-skyline{display:none!important}
#cmLoadScreen .cm-load-content {
  display:grid;
  position:relative;
  z-index:1;
  width:min(1320px,92vw);
  height:min(680px,82dvh);
  max-height:calc(100dvh - 40px);
  grid-template-columns:minmax(0,1.04fr) minmax(0,.96fr);
  grid-template-rows:auto auto auto auto minmax(8px,1fr) auto auto auto auto;
  grid-template-areas:
    "visual eyebrow"
    "visual logo"
    "visual heading"
    "visual desc"
    "visual blank"
    "visual status"
    "visual progress"
    "visual footer"
    "visual retry";
  column-gap:clamp(24px,5.5vw,94px);
  row-gap:0;
  padding:0;
  align-items:start;
  justify-items:stretch;
  text-align:left;
}
#cmLoadScreen .cm-load-content::before {
  content:"";
  position:absolute;
  right:0;top:0;
  width:clamp(22px,4vw,55px);
  height:2px;
  background:var(--cm-accent);
  opacity:.9;
}
#cmLoadScreen .cm-load-brand-image,
#cmLoadScreen .cm-load-emblem{
  grid-area:visual;
  justify-self:stretch;
  align-self:stretch;
}
#cmLoadScreen .cm-load-brand-image {
  display:block;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  object-fit:cover;
  object-position:var(--cm-load-image-position,center center);
  transform:scale(var(--cm-load-image-scale,1));
  background:transparent;
  box-shadow:none;
  filter:saturate(.83) contrast(1.06);
  -webkit-mask-image:linear-gradient(90deg,#000 0%,#000 76%,transparent 100%);
  mask-image:linear-gradient(90deg,#000 0%,#000 76%,transparent 100%);
  transition:opacity .25s ease;
}
#cmLoadScreen.cm-load-image-clean .cm-load-brand-image {
  object-fit:contain;
  filter:drop-shadow(0 20px 40px rgba(0,0,0,.33));
  -webkit-mask-image:none;
  mask-image:none;
}
#cmLoadScreen .cm-load-emblem {
  width:100%;
  height:100%;
  min-height:240px;
  margin:0;
  border:0;
  border-radius:0;
  background:
    radial-gradient(circle at 44% 50%,rgba(235,200,147,.07),transparent 62%),
    url("/assets/pilerio/pilerio-static.webp") center 47% / min(70%,380px) auto no-repeat;
  box-shadow:none;
  animation:none;
}
#cmLoadScreen .cm-load-emblem::before,
#cmLoadScreen .cm-load-emblem::after,
#cmLoadScreen .cm-load-emblem .cm-load-dot,
#cmLoadScreen .cm-load-emblem .cm-load-core{display:none}
#cmLoadScreen .cm-load-eyebrow{
  grid-area:eyebrow;
  width:min(100%,550px);
  margin:clamp(18px,4vh,42px) 0 clamp(18px,3vh,30px);
  text-align:left;
  justify-self:stretch;
  color:var(--cm-muted)!important;
  font-family:"DM Sans",system-ui,sans-serif;
  font-size:clamp(10px,.85vw,12px);
  font-weight:700;
  line-height:1.5;
  letter-spacing:.105em;
  text-transform:uppercase;
  text-shadow:none;
  opacity:.9;
  text-wrap:balance;
}
#cmLoadScreen .cm-load-eyebrow::before{
  content:"";
  display:inline-block;
  height:7px;width:7px;
  background:var(--cm-accent);
  border-radius:50%;
  margin-right:12px;
  vertical-align:1px;
  box-shadow:0 0 0 4px rgba(255,255,255,.04);
}
#cmLoadScreen .cm-load-logo {
  grid-area:logo;
  max-width:660px;
  margin:0;
  justify-self:start;
  color:var(--cm-load-text,var(--cm-paper))!important;
  font-family:"Outfit","DM Sans",system-ui,sans-serif;
  font-size:clamp(39px,5.1vw,78px);
  font-weight:750;
  letter-spacing:-.068em;
  line-height:.98;
  text-transform:none;
  text-wrap:balance;
  overflow-wrap:break-word;
  filter:none;
  text-shadow:none;
}
#cmLoadScreen .cm-load-heading{
  grid-area:heading;
  margin:clamp(24px,4vh,45px) 0 0;
  max-width:560px;
  color:var(--cm-load-text,var(--cm-paper))!important;
  font-family:"Outfit",system-ui,sans-serif;
  font-size:clamp(18px,2vw,28px);
  font-weight:500;
  letter-spacing:-.03em;
  line-height:1.25;
  text-transform:none;
  text-wrap:balance;
  text-shadow:none;
}
#cmLoadScreen .cm-load-description{
  grid-area:desc;
  justify-self:start;
  max-width:48ch;
  margin:clamp(6px,1.1vh,12px) 0 0;
  color:var(--cm-load-text,var(--cm-paper))!important;
  opacity:.67;
  font-family:"DM Sans",system-ui,sans-serif;
  font-size:clamp(12px,1.14vw,16px);
  line-height:1.6;
  font-weight:400;
  text-align:left;
  text-wrap:pretty;
}
#cmLoadScreen .cm-load-activity{
  grid-area:status;
  align-self:end;
  justify-self:start;
  max-width:100%;
  margin:0 0 10px;
  font-family:"DM Sans",system-ui,sans-serif;
  font-size:clamp(10px,.9vw,12px);
  font-weight:500;
  line-height:1.4;
  color:var(--cm-load-text,var(--cm-paper))!important;
  opacity:.65;
  text-align:left;
}
#cmLoadScreen .cm-load-track{
  grid-area:progress;
  justify-self:stretch;
  align-self:center;
  width:100%;
  max-width:360px;
  height:3px;
  margin:0;
  border:0;
  border-radius:999px;
  box-shadow:none;
  background:rgba(241,238,232,.18);
}
#cmLoadScreen .cm-load-bar{
  border-radius:999px;
  background:var(--cm-accent);
  box-shadow:none;
}
#cmLoadScreen .cm-load-bar::after{animation:none}
#cmLoadScreen .cm-load-bottom{
  grid-area:footer;
  justify-self:stretch;
  align-self:start;
  display:flex;
  align-items:center;
  max-width:360px;
  width:100%;
  margin:10px 0 0;
  color:var(--cm-load-text,var(--cm-paper));
  opacity:.58;
  font-size:10px;
  font-weight:550;
  letter-spacing:.05em;
  text-transform:none;
}
#cmLoadScreen .cm-load-bottom strong{
  color:var(--cm-load-text,var(--cm-paper))!important;
  font-family:"DM Sans",system-ui,sans-serif;
  font-size:11px;
  font-weight:650;
  letter-spacing:0;
}
#cmLoadScreen .cm-load-retry{
  grid-area:retry;
  justify-self:start;
  margin:18px 0 0;
  background:var(--cm-accent);
  border:0;
  border-radius:10px;
  padding:10px 19px;
  color:#101714;
  box-shadow:none;
  font-family:"DM Sans",system-ui,sans-serif;
  font-size:13px;
  font-weight:800;
}
#cmLoadScreen.cm-custom-background::before{opacity:.15}
#cmLoadScreen.cm-custom-background::after{
  background:linear-gradient(90deg,
    rgba(6,11,11,calc(var(--cm-load-overlay,.58)*.5)) 0%,
    rgba(6,11,11,calc(var(--cm-load-overlay,.58)*.65)) 46%,
    rgba(6,11,11,var(--cm-load-overlay,.58)) 100%);
}
/* The alternative centered layout is for actual brand marks (not posters).
 * It preserves the game identity without turning the loading text into a headline. */
#cmLoadScreen.cm-load-layout-centered .cm-load-content{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:min(620px,88vw);
  height:auto;
  min-height:min(600px,75dvh);
  gap:0;
  text-align:center;
}
#cmLoadScreen.cm-load-layout-centered .cm-load-content::before{
  right:50%;transform:translateX(50%);
}
#cmLoadScreen.cm-load-layout-centered .cm-load-brand-image{
  width:min(390px,70vw);
  height:min(31dvh,290px);
  margin:12px 0 18px;
  object-fit:contain;
  -webkit-mask-image:none;
  mask-image:none;
}
#cmLoadScreen.cm-load-layout-centered .cm-load-emblem{
  width:min(390px,70vw);
  min-height:0;
  height:min(29dvh,290px);
  margin:12px 0 18px;
}
#cmLoadScreen.cm-load-layout-centered :is(.cm-load-eyebrow,.cm-load-logo,
  .cm-load-heading,.cm-load-description,.cm-load-activity){text-align:center;justify-self:center}
#cmLoadScreen.cm-load-layout-centered .cm-load-eyebrow{margin:14px 0 22px}
#cmLoadScreen.cm-load-layout-centered .cm-load-logo{font-size:clamp(35px,4vw,58px)}
#cmLoadScreen.cm-load-layout-centered .cm-load-heading{margin:23px 0 0}
#cmLoadScreen.cm-load-layout-centered .cm-load-activity{margin:30px 0 10px}
#cmLoadScreen.cm-load-layout-centered .cm-load-track,
#cmLoadScreen.cm-load-layout-centered .cm-load-bottom{width:min(100%,360px);max-width:360px}
#cmLoadScreen.cm-load-layout-centered .cm-load-retry{align-self:center}
/* Handheld play is landscape-first: retain two columns and keep character
 * visible on small-height Android screens. */
@media(max-height:520px) and (min-width:640px) {
  #cmLoadScreen{padding:12px max(18px,env(safe-area-inset-right))}
  #cmLoadScreen .cm-load-content{
    width:min(970px,92vw);
    height:min(88dvh,410px);
    max-height:calc(100dvh - 22px);
    grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
    column-gap:clamp(12px,3.6vw,40px);
  }
  #cmLoadScreen .cm-load-eyebrow{font-size:9px;margin:5px 0 14px;line-height:1.2}
  #cmLoadScreen .cm-load-logo{font-size:clamp(29px,4vw,43px)}
  #cmLoadScreen .cm-load-heading{font-size:clamp(13px,2.3vw,19px);margin:12px 0 0}
  #cmLoadScreen .cm-load-description{font-size:11px;line-height:1.3;margin:4px 0 0}
  #cmLoadScreen .cm-load-activity{font-size:10px;margin:0 0 7px}
  #cmLoadScreen .cm-load-bottom{margin:7px 0 0;font-size:9px}
}
/* Portrait is used by the admin preview and on initial phone launch before rotation. */
@media(max-width:639px) and (orientation:portrait){
  #cmLoadScreen{padding:clamp(16px,4vw,26px)}
  #cmLoadScreen .cm-load-content{
    display:flex;flex-direction:column;
    width:min(440px,90vw);
    height:calc(100dvh - 40px);
    max-height:720px;
    align-items:center;
    justify-content:center;
    gap:0;
    text-align:center;
  }
  #cmLoadScreen .cm-load-content::before{top:8px;right:50%;transform:translateX(50%)}
  #cmLoadScreen .cm-load-emblem,
  #cmLoadScreen .cm-load-brand-image{
    align-self:center;
    width:min(72vw,310px);
    height:min(37dvh,285px);
    min-height:0;
    margin:10px auto;
    object-fit:cover;
    -webkit-mask-image:linear-gradient(180deg,#000 0 74%,transparent 100%);
    mask-image:linear-gradient(180deg,#000 0 74%,transparent 100%);
  }
  #cmLoadScreen.cm-load-image-clean .cm-load-brand-image{-webkit-mask-image:none;mask-image:none;object-fit:contain}
  #cmLoadScreen .cm-load-eyebrow{margin:10px 0 17px;text-align:center;font-size:10px;line-height:1.3}
  #cmLoadScreen .cm-load-logo{font-size:clamp(34px,8.8vw,52px);text-align:center}
  #cmLoadScreen .cm-load-heading{font-size:clamp(18px,4.5vw,24px);margin:18px 0 0;text-align:center}
  #cmLoadScreen .cm-load-description{font-size:clamp(11px,3vw,14px);text-align:center;line-height:1.4;margin:5px 0 0}
  #cmLoadScreen .cm-load-activity{font-size:10px;align-self:stretch;text-align:center;margin:24px 0 10px}
  #cmLoadScreen .cm-load-track,
  #cmLoadScreen .cm-load-bottom{align-self:center;width:min(100%,320px)}
  #cmLoadScreen .cm-load-retry{align-self:center}
}
@media(prefers-reduced-motion:reduce) {
  #cmLoadScreen .cm-load-brand-image{transition:none}
}
