/* Copyright 2013 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

html, body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

.icon {
  -webkit-user-select: none;
  user-select: none;
  display: inline-block;
}

.icon-offline {
  content: -webkit-image-set( url(assets/default_100_percent/100-error-offline.png) 1x, url(assets/default_200_percent/200-error-offline.png) 2x);
  position: relative;
}

.hidden {
  display: none;
}


/* Offline page */

.offline .interstitial-wrapper {
  color: #2b2b2b;
  font-size: 1em;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 600px;
  padding-top: 100px;
  width: 100%;
}

.offline .runner-container {
  height: 150px;
  max-width: 600px;
  overflow: hidden;
  position: absolute;
  top: 35px;
  width: 44px;
}

.offline .runner-canvas {
  height: 150px;
  max-width: 600px;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  top: 0;
  z-index: 2;
}

.offline .controller {
  background: rgba(247, 247, 247, .1);
  height: 100vh;
  left: 0;
  position: absolute;
  top: 0;
  width: 100vw;
  z-index: 1;
}

#offline-resources {
  display: none;
}

@media (max-width: 420px) {
  .suggested-left > #control-buttons, .suggested-right > #control-buttons {
    float: none;
  }
  .snackbar {
    left: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
  }
}

@media (max-height: 350px) {
  h1 {
    margin: 0 0 15px;
  }
  .icon-offline {
    margin: 0 0 10px;
  }
  .interstitial-wrapper {
    margin-top: 5%;
  }
  .nav-wrapper {
    margin-top: 30px;
  }
}

@media (min-width: 600px) and (max-width: 736px) and (orientation: landscape) {
  .offline .interstitial-wrapper {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (min-width: 420px) and (max-width: 736px) and (min-height: 240px) and (max-height: 420px) and (orientation:landscape) {
  .interstitial-wrapper {
    margin-bottom: 100px;
  }
}

@media (min-height: 240px) and (orientation: landscape) {
  .offline .interstitial-wrapper {
    margin-bottom: 90px;
  }
  .icon-offline {
    margin-bottom: 20px;
  }
}

@media (max-height: 320px) and (orientation: landscape) {
  .icon-offline {
    margin-bottom: 0;
  }
  .offline .runner-container {
    top: 10px;
  }
}

@media (max-width: 240px) {
  .interstitial-wrapper {
    overflow: inherit;
    padding: 0 8px;
  }
}

.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas {
  image-rendering: pixelated;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode #buttons,
.arcade-mode #main-content {
  opacity: 0;
  overflow: hidden;
}

.arcade-mode .interstitial-wrapper {
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode .runner-container {
  left: 0;
  margin: auto;
  right: 0;
  transform-origin: top center;
  transition: transform 250ms cubic-bezier(0.4, 0, 1, 1) 400ms;
  z-index: 2;
}


html, body {
  background-image: url('assets/bg.webp');
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  background-color: #f4a574; 
}

/* Le canvas du jeu reste transparent pour laisser voir le bg */
.runner-canvas {
  background: transparent !important;
}
.offline .controller {
  background: transparent !important;
}
.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas,
.arcade-mode .interstitial-wrapper {
  background: transparent !important;
}










html, body {

  background:
    
    url('assets/bg.png') no-repeat center calc(45% + 30px) / 100% auto,
    linear-gradient(to bottom, #1a2940 0%, #2d4a72 20%, #4a5b80 32%, transparent 38%) !important;
  background-color: #d2b482 !important;
}

#main-frame-error,
.snackbar,
.interstitial-wrapper,
.runner-container,
.runner-canvas,
.offline,
.offline .controller,
.offline .interstitial-wrapper,
.offline .runner-container,
.offline .runner-canvas,
.arcade-mode,
.arcade-mode .interstitial-wrapper,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas,
.icon,
.icon-offline {
  background-color: transparent !important;
  background-image: none !important;
}


/* ENSEIGNES */
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;

  top: max(calc(50vh + 75px), calc(45vh + 22.825vw + 50px));
  height: 8vh;           
  background-image: url('assets/enseignes-banner.png');
  background-repeat: repeat-x;
  background-size: auto 8vh;
  background-position: left center;
  animation: defile-enseignes 40s linear infinite;
  z-index: 0;           
  pointer-events: none;  
}

@keyframes defile-enseignes {
  from { background-position-x: 0; }
  to   { background-position-x: -3139px; }  
}



/*Confettis*/
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('assets/confettis-tile.png');
  background-repeat: repeat;
  background-size: 400px 400px;
  image-rendering: pixelated;
  animation: ivea-confettis-rain 6s linear infinite;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 1.5s ease-out;  /* fade quand on lance */
}


body.istore-playing::before{
  opacity: 0;
  animation-play-state: paused;  
}

@keyframes ivea-confettis-rain {
  from { background-position: 0 0; }
  to   { background-position: 0 400px; }
}

/* === TROPHÉE COUPE DU MONDE (à voir) === */
.interstitial-wrapper::before {
  content: '';
  position: fixed;
  top: 15%;
  left: 0;
  width: 60px;
  height: 80px;
  background-image: url('assets/trophy.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px gold);
  animation: ivea-trophy-flyby 20s linear infinite;
  z-index: 3;
  pointer-events: none;
}

@keyframes ivea-trophy-flyby {
  0%, 50%   { transform: translateX(-100px); opacity: 0; }
  55%       { transform: translateX(-50px); opacity: 1; }
  90%       { transform: translateX(calc(100vw - 30px)); opacity: 1; }
  95%       { transform: translateX(calc(100vw + 50px)); opacity: 0.5; }
  100%      { transform: translateX(calc(100vw + 100px)); opacity: 0; }
}


/*Positionnement du perso*/
body .interstitial-wrapper {
  top: max(calc(50vh - 75px), calc(45vh + 22.825vw - 100px)) !important;
  transform: none !important;
}


/* IVEA ATMOSPHERE */
/* Vignette et éclaircissement du bg*/
html::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
   
    radial-gradient(ellipse 90% 75% at center,
      transparent 55%,
      rgba(10, 20, 40, 0.28) 100%
    ),
    
    linear-gradient(to bottom,
      transparent 35%,
      rgba(255, 240, 220, 0.14) 50%,
      rgba(255, 230, 210, 0.08) 60%,
      transparent 72%
    );
}
