html {
  -ms-touch-action: none;
}

body, canvas, div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  /* display: none; <- Crashes Chrome on hover */
  -webkit-appearance: none;
  margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;

  cursor: default;
  color: #888;
  background-color: #333;

  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;

  display: flex;
  flex-direction: column;
  
  /* fix bug: https://github.com/cocos-creator/2d-tasks/issues/791 */
  /* overflow cannot be applied in Cocos2dGameContainer, 
  otherwise child elements will be hidden when Cocos2dGameContainer rotated 90 deg */
  overflow: hidden;
}

#swipeup {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent url(./swipe.f31aa.png) no-repeat center;
  background-size: 100%;
}

#Cocos2dGameContainer {
  position: absolute;
  margin: 0;
  left: 0px;
  top: 0px;

  display: -webkit-box;
  -webkit-box-orient: horizontal;
  -webkit-box-align: center;
  -webkit-box-pack: center;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

a:link, a:visited {
  color: #666;
}

a:active, a:hover {
  color: #666;
}

p.header {
  font-size: small;
}

p.footer {
  font-size: x-small;
}

#splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #154E89;
  background-size: 45%;
}

#noportrait {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #FFFFFF url(./noland.fd02d.png) no-repeat center;
  background-size: 100%;
}

.progress-bar {
    position: absolute;
    left: 27.5%;
    top: 80%;
    height: 3px;
    padding: 2px;
    width: 45%;
    border-radius: 7px;
    box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;           
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width .4s ease-in-out;
    background-color: #3dc5de;
}

.stripes span {
    background-size: 30px 30px;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%,
                        transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%,
                        transparent 75%, transparent);            
    
    animation: animate-stripes 1s linear infinite;             
}

@keyframes animate-stripes {
    0% {background-position: 0 0;} 100% {background-position: 60px 0;}
}

/* HTML startup stays above Canvas until Portrait actually launches. */
#splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
}
#splash .loading-content { position: absolute; padding: 0; background: linear-gradient(135deg, #154E89, #071C38); font-family: 'Nunito Sans', Arial, sans-serif; }
#splash .loading-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#splash .loading-brand { position: absolute; left: 0; top: 64.1%; width: 100%; margin: 0; font-size: 3.14286em; font-weight: 800; line-height: 1.2; }
#splash p { font-size: 1em; line-height: 1.25; margin: 0; }
#splash .loading-kicker { position: absolute; left: 0; top: 18.1%; width: 100%; color: #FFD17A; font-size: .85714em; font-weight: 800; }
#splash #loading-status { position: absolute; top: 85.2%; left: 10%; width: 80%; color: #E0EEFC; }
#splash .loading-tagline { position: absolute; top: 71.1%; left: 0; width: 100%; font-size: 1.14286em; font-weight: 600; color: #E0EEFC; }
#splash .progress-bar { left: 17.91%; top: 82.84%; box-sizing: border-box; width: 64.18%; height: .572%; padding: 0; border: 0; border-radius: 3px; background: #315B86; box-shadow: none; }
#splash .progress-bar span { background: #FFD17A; border-radius: 3px; box-shadow: none; transition: none; }
#splash.loading-initializing .progress-bar, #splash.loading-failed .progress-bar { display: none; }
#splash.loading-initializing #loading-status, #splash.loading-failed #loading-status { visibility: visible; }
#splash.loading-failed #loading-status { top: 76%; }
#splash #loading-error { position: absolute; top: 80%; left: 8%; width: 84%; color: #ffc3b8; font-size: .85em; }
#splash button { position: absolute; top: 89%; left: 20%; width: 60%; min-height: 44px; padding: 0.6em; border: 0; border-radius: 16px; background: #FFD17A; color: #102A43; font: inherit; font-weight: 700; cursor: pointer; }
#splash button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
#splash [hidden] { display: none; }
@keyframes playdown-bob { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-16px); } 80% { transform: translateY(4px); } }
@keyframes playdown-chat { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
#splash .loading-friend { animation: playdown-bob 1.8s linear infinite; }
#splash .friend-cat { animation-delay: .3s; }
#splash .friend-bear { animation-delay: .6s; }
#splash .chat-dot { animation: playdown-chat 1.2s linear infinite; }
#splash .chat-dot:nth-child(2) { animation-delay: .2s; }
#splash .chat-dot:nth-child(3) { animation-delay: .4s; }
#splash.loading-failed .loading-friend, #splash.loading-failed .chat-dot { animation: none; }
@media (prefers-reduced-motion: reduce) { #splash .loading-friend, #splash .chat-dot { animation: none; } }
#loading-safe-area { position: fixed; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
#portrait-required { position: fixed; inset: 0; z-index: 11000; display: none; align-items: center; justify-content: center; padding: 24px; background: #000; color: #fff; font: 18px Arial, sans-serif; }


/* Coordinates below follow the 402 by 874 source frame. */
@font-face { font-family: 'Playdown Splash'; src: url('splash-text.4d3e6.woff') format('woff'); font-weight: 100 900; font-display: swap; }
#splash .loading-content { background: #154E89 url('splash-backdrop.57565.svg') center / 100% 100% no-repeat; font-family: 'Playdown Splash', Arial, sans-serif; }
#splash .loading-brand { inset:0; width:100%; height:100%; pointer-events:none; }
#splash .loading-kicker { top:17.51%; line-height:1.5; }
#splash .loading-tagline { top:70.48%; line-height:1.5; }
#splash #loading-status { top:84.90%; line-height:1.5; }
#splash.loading-failed #loading-status { top:84.90%; }
#splash #loading-error { top:94.5%; font-size:.72em; line-height:1.3; }
#splash #loading-retry { left:23.88%; top:88.79%; width:52.24%; height:5.492%; min-height:44px; padding:0; background:#267D78; color:white; font-size:1.21429em; font-weight:700; }
#splash .loading-language { left:62.189%; top:5.95%; width:33.831%; height:5.035%; min-height:44px; padding:0; border:1px solid #6197C4; border-radius:14px; background:#0B315C; color:white; font:inherit; font-size:.92857em; display:flex; justify-content:center; align-items:center; gap:8px; }
#splash .language-modal { position:absolute; inset:0; z-index:5; }
#splash .language-shade { position:absolute; inset:0; background:rgba(7,28,56,.64); }
#splash .language-panel { position:absolute; left:3.98%; top:58.35%; width:92.04%; height:37.30%; border-radius:26px; background:#F7F3EA; color:#203543; text-align:left; }
#splash .language-panel h2 { position:absolute; left:6.486%; top:9.8%; margin:0; font-size:1.71429em; line-height:1.5; font-weight:800; }
#splash .language-panel button { left:4.324%; width:91.352%; height:19.632%; min-height:44px; padding:0 6.5%; border-radius:16px; background:white; color:#203543; font-size:1.28571em; font-weight:700; text-align:left; }
#splash #language-en { top:25.15%; }
#splash #language-mn { top:49.69%; }
#splash .language-panel button[aria-checked=true] { background:#E2EDE8; }
#splash .language-check { float:right; color:#267D78; visibility:hidden; }
#splash [aria-checked=true] .language-check { visibility:visible; }
#splash #language-close { top:78.5%; height:15%; background:transparent; color:#267D78; text-align:center; font-size:1em; font-weight:400; }
#splash.loading-complete .loading-friend, #splash.loading-complete .chat-dot { animation:none; }

/* Intro reuses the prepared splash artwork and language dialog. */
#splash.loading-intro .loading-language { left:3.98%; font-weight:700; }
#splash.loading-intro #intro-skip { left:74.63%; top:5.95%; width:14.18%; height:5.035%; min-height:44px; padding:0; border:0; border-radius:0; background:transparent; color:#fff; font-size:1em; text-align:right; }
#splash.loading-intro #intro-subline { position:absolute; left:0; top:75.40%; width:100%; font-size:1em; font-weight:400; line-height:1.5; color:#D8E8F8; pointer-events:none; }
#splash.loading-intro .loading-friend { animation-name:playdown-intro-bob; }
@keyframes playdown-intro-bob { 0%,60%,100% { transform:translateY(0); } 30% { transform:translateY(-16px); } 80% { transform:translateY(4px); } }
@media (prefers-reduced-motion:reduce) { #splash.loading-intro .loading-friend, #splash.loading-intro .chat-dot { animation:none; } }
#splash.loading-complete .loading-friend, #splash.loading-complete .chat-dot { animation:none; }

/* Intro keeps the splash host and background; automatic focus must not draw a box. */
#splash .loading-content { box-sizing:border-box; border:0; transform:none; transform-origin:center; }
#splash.loading-intro #intro-skip { appearance:none; -webkit-appearance:none; box-shadow:none; background:none; border:0; font-weight:700; min-width:44px; }
#splash.loading-intro #intro-skip:focus:not(:focus-visible) { outline:none; }
#splash.loading-intro #intro-skip:focus-visible { outline:2px solid #FFD17A; outline-offset:2px; border-radius:4px; }
#splash:focus { outline:none; }
#splash.loading-common .loading-language { display:none; }

/* OAuth return keeps engine preparation visible without replaying promotion. */
#splash.loading-return .loading-content { background:#154E89; font-family:Arial,sans-serif; }
#splash.loading-return .loading-art,
#splash.loading-return .loading-brand,
#splash.loading-return .loading-kicker,
#splash.loading-return .loading-tagline,
#splash.loading-return .loading-language,
#splash.loading-return .progress-bar,
#splash.loading-return #intro-subline,
#splash.loading-return #intro-skip { display:none; }
#splash.loading-return #loading-status { top:44%; left:8%; width:84%; font-size:16px; }
#splash.loading-return #loading-error { top:54%; left:8%; width:84%; font-size:14px; }
#splash.loading-return #loading-retry { top:65%; }

/* A user-selected Facebook page return keeps the established loading artwork. */
#splash.loading-facebook-return #intro-skip,
#splash.loading-facebook-return #intro-subline { display:none; }

#playdown-session-recovery { position:absolute; inset:0; z-index:120; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; padding:24px max(24px,env(safe-area-inset-right)) 24px max(24px,env(safe-area-inset-left)); box-sizing:border-box; background:#154E89; color:#fff; font:16px/1.6 Arial,sans-serif; text-align:center; }
#playdown-session-recovery[hidden] { display:none; }
#playdown-session-recovery p { max-width:360px; overflow-wrap:anywhere; }
#playdown-session-recovery button { min-height:44px; padding:10px 18px; margin:6px; border:1px solid #6197C4; border-radius:12px; background:#0B315C; color:#fff; font:inherit; }

/* Match the Intro language typography in both loading presentations. */
#splash .loading-language { font-family:'Playdown Splash',Arial,sans-serif; font-size:.9285714286em; font-weight:700; }

/* Keep Facebook return artwork behind the existing authority/retry gate. */
html.facebook-page-return #playdown-session-recovery { background:linear-gradient(transparent 72%,#154E89 84%); justify-content:flex-end; gap:8px; padding-bottom:max(24px,env(safe-area-inset-bottom)); }
html.facebook-page-return #playdown-session-recovery p { margin:0; background:#154E89; border-radius:12px; padding:8px 12px; }
html.facebook-page-return #playdown-session-recovery>div { background:#154E89; border-radius:12px; }
