/* Platform Kit base template. Colours, fonts and pictures are variables: a game overrides them in
   Assets/PlatformKit/Brand/brand.css (Tools ▸ Platform Kit appends it to TemplateData/brand.css). */
:root {
  --pk-bg-top: #e9f8ff;            /* page gradient when there is no promo picture */
  --pk-bg-bottom: #9fdcf3;
  --pk-ink: #0b1320;               /* outlines and hard shadows */
  --pk-text: #ffffff;              /* loader words (outlined with --pk-ink) */
  --pk-accent-top: #7dfbfd;        /* bar fill gradient */
  --pk-accent-bottom: #1ccfdf;
  --pk-track: #ffffff;             /* empty part of the bar */
  --pk-font: "Segoe UI Black", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --pk-promo: none;                /* url(brand/promo.webp): key art, any aspect */
  --pk-title: none;                /* url(brand/title.webp): logo with transparency; none = Product Name as text */
  --pk-promo-blur: 22px;           /* side fill around the key art on screens of another aspect */
  --pk-skew: -10deg;               /* slant of the bar */
}

html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #000; overscroll-behavior: none; }
/* Portal rules (Yandex 1.10.2, 1.6.1.8, 1.6.2.7): no page scroll or swipe-to-refresh, no selection, no long-tap callout. */
body { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; touch-action: none;
       -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#unity-container { position: fixed; inset: 0; }
#unity-canvas { width: 100%; height: 100%; display: block; background: #000; outline: none; }
#unity-warning { position: fixed; left: 50%; top: 5%; transform: translate(-50%); z-index: 20; background: #fff; padding: 10px;
                 display: none; font: 14px sans-serif; border: 2px solid var(--pk-ink); border-radius: 8px; }

/* ---------- Loader: key art + title + bar, sized by the short side so any aspect works ---------- */
#pk-loader {
  position: fixed; inset: 0; z-index: 10; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  box-sizing: border-box;
  padding: max(4vmin, env(safe-area-inset-top)) max(4vmin, env(safe-area-inset-right))
           max(6vmin, env(safe-area-inset-bottom)) max(4vmin, env(safe-area-inset-left));
  background: linear-gradient(var(--pk-bg-top), var(--pk-bg-bottom));
  font-family: var(--pk-font); color: var(--pk-text);
  transition: opacity .5s ease;
}
#pk-loader.pk-done { opacity: 0; pointer-events: none; }

/* Blurred copy fills the screen, the sharp art is never cropped (contain) and breathes slowly. */
.pk-bg, .pk-art, .pk-shade { position: absolute; pointer-events: none; display: none; }
.pk-has-promo .pk-bg, .pk-has-promo .pk-art, .pk-has-promo .pk-shade { display: block; }
.pk-bg { inset: -8%; background: var(--pk-promo) center / cover no-repeat; filter: blur(var(--pk-promo-blur)) saturate(1.15); }
.pk-art { inset: 0; background: var(--pk-promo) center / contain no-repeat; animation: pk-breathe 16s ease-in-out infinite alternate; }
.pk-shade { inset: 0; background: linear-gradient(rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, 0) 62%, rgba(11, 19, 32, .38)); }

.pk-title { position: relative; width: min(92vw, 1000px); display: flex; justify-content: center;
            animation: pk-pop .7s cubic-bezier(.2, 1.5, .4, 1) both, pk-float 3.6s ease-in-out .7s infinite; }
.pk-title-img { display: none; width: 100%; height: clamp(60px, 26vmin, 300px); background: var(--pk-title) center top / contain no-repeat;
                filter: drop-shadow(0 .6vmin 1.2vmin rgba(11, 19, 32, .35)); }
.pk-has-title .pk-title-img { display: block; }
.pk-has-title .pk-title-text { display: none; }
.pk-title-text { text-align: center; text-transform: uppercase; line-height: 1; letter-spacing: .02em;
                 font-size: clamp(28px, 9vmin, 96px); -webkit-text-stroke: .14em var(--pk-ink); paint-order: stroke fill;
                 text-shadow: .05em .07em 0 var(--pk-ink); }

.pk-panel { position: relative; width: min(84vw, 640px); }
.pk-status { display: flex; justify-content: space-between; align-items: baseline; margin: 0 1.2vmin 1.4vmin;
             font-size: clamp(15px, 3.6vmin, 30px); text-transform: uppercase; letter-spacing: .03em;
             -webkit-text-stroke: .22em var(--pk-ink); paint-order: stroke fill; text-shadow: .06em .09em 0 var(--pk-ink); }
.pk-dots::after { content: ""; display: inline-block; width: 1.4em; text-align: left; animation: pk-dots 1.2s steps(1) infinite; }

.pk-bar { position: relative; height: clamp(18px, 4.4vmin, 36px); background: var(--pk-track); overflow: hidden;
          border: clamp(2px, .55vmin, 4px) solid var(--pk-ink); border-radius: clamp(6px, 1.4vmin, 12px);
          box-shadow: clamp(3px, .8vmin, 6px) clamp(3px, .8vmin, 6px) 0 var(--pk-ink); transform: skewX(var(--pk-skew)); }
.pk-fill { height: 100%; width: 0; transition: width .3s ease-out;
           background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .32) 0 12px, rgba(255, 255, 255, 0) 12px 24px),
                       linear-gradient(var(--pk-accent-top), var(--pk-accent-bottom));
           background-size: 34px 34px, 100% 100%;
           box-shadow: inset 0 .5vmin 0 rgba(255, 255, 255, .55), inset 0 -.4vmin 0 rgba(11, 19, 32, .18);
           animation: pk-stripes .9s linear infinite; }
/* A highlight sweeps along the bar. */
.pk-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; left: -40%;
                 background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .65), rgba(255, 255, 255, 0));
                 animation: pk-shine 2.2s ease-in-out infinite; }
.pk-starting .pk-fill { animation-duration: .45s; }
.pk-starting .pk-bar { animation: pk-pulse 1s ease-in-out infinite; }

/* Load error: a card instead of alert(). */
.pk-error { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; background: rgba(11, 19, 32, .45); }
.pk-failed .pk-error { display: flex; }
.pk-failed .pk-panel { visibility: hidden; }
.pk-error-card { width: min(86vw, 520px); box-sizing: border-box; padding: clamp(16px, 4vmin, 32px); text-align: center; color: var(--pk-ink);
                 background: #fff; border: 4px solid var(--pk-ink); border-radius: 14px; box-shadow: 6px 6px 0 var(--pk-ink); }
.pk-error-title { font-size: clamp(18px, 4vmin, 30px); text-transform: uppercase; }
.pk-error-text { margin: 1em 0 1.4em; font: 600 clamp(12px, 2.4vmin, 16px) / 1.4 system-ui, sans-serif; word-break: break-word;
                 max-height: 30vh; overflow: auto; opacity: .75; }
.pk-button { font: inherit; font-size: clamp(16px, 3.4vmin, 24px); text-transform: uppercase; color: var(--pk-ink); cursor: pointer;
             padding: .5em 1.6em; border: 3px solid var(--pk-ink); border-radius: 10px; box-shadow: 4px 4px 0 var(--pk-ink);
             background: linear-gradient(var(--pk-accent-top), var(--pk-accent-bottom)); }
.pk-button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--pk-ink); }

@keyframes pk-breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes pk-pop { from { opacity: 0; transform: scale(.7) translateY(-6vmin); } to { opacity: 1; transform: none; } }
@keyframes pk-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2vmin); } }
@keyframes pk-stripes { from { background-position: 0 0, 0 0; } to { background-position: 34px 0, 0 0; } }
@keyframes pk-shine { 0% { left: -40%; } 60%, 100% { left: 120%; } }
@keyframes pk-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
@keyframes pk-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* Very flat screens (phone in landscape): a smaller title, the bar closer to the edge. */
@media (max-height: 420px) {
  .pk-title-img { height: clamp(48px, 22vh, 120px); }
  #pk-loader { padding-bottom: max(4vh, env(safe-area-inset-bottom)); }
}
/* Portrait: the key art is a band across the middle — the title sits right above it, the bar right below. */
@media (max-aspect-ratio: 4/5) {
  .pk-has-promo#pk-loader { justify-content: center; gap: calc(56vw + 6vh); }
}
@media (prefers-reduced-motion: reduce) {
  .pk-art, .pk-title, .pk-fill, .pk-bar, .pk-bar::after { animation: none !important; }
}
