.available-in-stores{
  position: fixed;
  top: 1em;
  z-index: 100;
  align-content: center;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
/* Reset default styles */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000000;
  touch-action: none;
  -ms-touch-action: none;
  -webkit-text-size-adjust: none; /* Prevent Safari text size adjustments */
}
/* WebGL content styling */
.webgl-content * {border: 0; margin: 0; padding: 0; overflow: hidden;}
.webgl-content {
  position: absolute !important; 
  top: 0 !important; 
  left: 0 !important; 
  width: 100% !important; 
  height: 100% !important; 
  margin: 0 !important;
  transform: none !important;
  transform-style: preserve-3d !important; /* Helps with iPad rendering */
  -webkit-transform-style: preserve-3d !important;
}
.webgl-content .overlay{
    background-color: #0d0d0d;
    width: 100%;
    height: 100%;
    z-index: 7;
    position: absolute;
    top: 0;
}
.webgl-content .logo, .progress {position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}
.webgl-content .logo {display: none !important;} /* Hide Unity logo */
.webgl-content .progress {height: 1.125rem; width: 8.75rem; margin-top: 2.5rem;}
.webgl-content .progress .empty {background: url('progressEmpty.Light.png') no-repeat right / cover; float: right; width: 100%; height: 100%; display: inline-block;}
.webgl-content .progress .full {background: url('progressFull.Light.png') no-repeat left / cover; float: left; width: 0%; height: 100%; display: inline-block;}

.webgl-content .logo.Dark {background-image: url('progressLogo.Dark.png');}
.webgl-content .progress.Dark .empty {background-image: url('progressEmpty.Dark.png');}
.webgl-content .progress.Dark .full {background-image: url('progressFull.Dark.png');}


body {
	background-image: url(bg.jpg);
    background-size: cover;
    background-repeat: repeat;
    background-position: 50% 50%;
	font-family: 'Titillium Web', sans-serif;
	text-align: center;
  height: 100%;
  overflow: hidden;
}

/* Responsive canvas container */
#gameContainer {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translateZ(0) !important; /* Force hardware acceleration */
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  perspective: 1000px !important;
  -webkit-perspective: 1000px !important;
}

#gameContainer canvas {
  width: 100% !important;
  height: 100% !important;
  transform: translateZ(0) !important; /* Force hardware acceleration */
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  touch-action: none !important;
  -ms-touch-action: none !important;
}

/* iPad specific fixes */
@media only screen and (max-device-width: 1024px) and (min-device-width: 768px) {
  #gameContainer canvas {
    image-rendering: -webkit-optimize-contrast; /* Improves pixel rendering on iPad */
    touch-action: none !important;
  }
}

/* Force-redraw class for iPad rendering fixes */
.force-redraw {
  animation: force-redraw 0.1s linear;
}

@keyframes force-redraw {
  from { opacity: 0.999; }
  to { opacity: 1; }
}

.counter {
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12.5rem;
  z-index: 8;
}
.counter p {
  font-size: 1.875rem;
  font-weight: 200;
  color: #43a94b;
}
.counter h1 {
  color: white;
  font-size: 3.75rem;
  margin-top: -0.625rem;
}
.counter .ProgressLineB {
  background: #a4a4a3;
  border: none;
  height: 0.0625rem;
  width: 12.5rem;
}
.counter .ProgressLine {
  background: #43a94b;
  border: none;
  height: 0.1875rem;
  width: 0;
  margin-top: -0.125rem;
}
.counter h1.abs {
  position: absolute;
  top: 0;
  width: 100%;
}
.counter .color {
  width: 0;
  overflow: hidden;
  color: #43a94b;
}

div#loadingBox {
  width: 100%;
  height: 1.25rem;
  position: absolute;
  top: 50%;
  margin-top: 3.125rem;
  text-align: center;
}

body .vertical-centered-box {
  position: absolute;
  width: 100%;
  height: 100%;
  text-align: center;
}
body .vertical-centered-box:after {
  content: '';
  display: inline-block;
  height: 100%;
  vertical-align: middle;
  margin-right: -0.25em;
}
body .vertical-centered-box .content {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
  text-align: left;
  font-size: 0;
}
* {
  -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  -o-transition: all 0.3s;
  transition: all 0.3s;
}

.loader-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.0625rem rgba(250, 250, 2500, 0.1);
  margin-left: -3.75rem;
  margin-top: -3.75rem;
  top: 5.9375rem;
}
.loader-line-mask {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.75rem;
  height: 7.5rem;
  top: 5.9375rem;
  margin-left: -3.75rem;
  margin-top: -3.75rem;
  overflow: hidden;
  -webkit-transform-origin: 3.75rem 3.75rem;
  -moz-transform-origin: 3.75rem 3.75rem;
  -o-transform-origin: 3.75rem 3.75rem;
  -ms-transform-origin: 3.75rem 3.75rem;
  transform-origin: 3.75rem 3.75rem;
  -webkit-mask-image: -webkit-linear-gradient(top, #000000, rgba(0, 0, 0, 0));
  -webkit-animation: rotate 1.2s infinite linear;
  -moz-animation: rotate 1.2s infinite linear;
  -o-animation: rotate 1.2s infinite linear;
  animation: rotate 1.2s infinite linear;
}
.loader-line-mask .loader-line {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.0625rem rgba(250, 250, 250, 0.5);
}
@-webkit-keyframes rotate{ 0% { -webkit-transform: rotate(0deg);} 100% { -webkit-transform: rotate(360deg);}}
@-moz-keyframes rotate{ 0% { -moz-transform: rotate(0deg);} 100% { -moz-transform: rotate(360deg);}}
@-o-keyframes rotate{ 0% { -o-transform: rotate(0deg);} 100% { -o-transform: rotate(360deg);}}
@keyframes rotate{ 0% {-webkit-transform: rotate(0deg);-moz-transform: rotate(0deg);-ms-transform: rotate(0deg);transform: rotate(0deg);} 100% {-webkit-transform: rotate(360deg);-moz-transform: rotate(360deg);-ms-transform: rotate(360deg);transform: rotate(360deg);}}

/* Orientation overlay */
#orientationOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #FFFFFF;
  font-family: Arial, sans-serif;
}

/* Style different orientation messages */
.mobile-orient, .desktop-orient, .superwide-orient {
  display: none;
  padding: 1.25rem;
  max-width: 80%;
}

/* Disable text selection */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Mobile rotate icon animation */
.rotate-icon {
    width: 3.75rem;
    height: 3.75rem;
    border: 0.1875rem solid #fff;
    border-radius: 50%;
    position: relative;
    margin: 0 auto 1.25rem;
    animation: rotateAnimation 2s infinite linear;
}

.rotate-icon:before {
    content: '';
    position: absolute;
    top: -0.625rem;
    right: 0.8125rem;
    width: 0;
    height: 0;
    border-left: 0.625rem solid transparent;
    border-right: 0.625rem solid transparent;
    border-bottom: 0.9375rem solid #fff;
    transform: rotate(30deg);
}

@keyframes rotateAnimation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Desktop resize icon animation */
.resize-icon {
    width: 3.75rem;
    height: 2.5rem;
    border: 0.1875rem solid #fff;
    position: relative;
    margin: 0 auto 1.25rem;
    animation: resizeAnimation 3s infinite ease-in-out;
}

@keyframes resizeAnimation {
    0% { width: 2.5rem; height: 3.75rem; }
    40% { width: 2.5rem; height: 3.75rem; }
    60% { width: 4.375rem; height: 2.5rem; }
    80% { width: 4.375rem; height: 2.5rem; }
    100% { width: 2.5rem; height: 3.75rem; }
}

/* For better viewport handling, especially on iOS */
@media screen and (max-width: 100vw), screen and (max-height: 100vh) {
    body, html {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    
    #gameContainer, #gameContainer canvas {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        -webkit-transform: translate(-50%, -50%);
    }
    
    /* Center the orientation overlay correctly */
    #orientationOverlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%; 
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Force redraw class for Safari rendering fixes */
.force-redraw {
    animation-name: forceRedraw;
    animation-duration: 0.01s;
    animation-iteration-count: 1;
}

@keyframes forceRedraw {
    0% { opacity: 0.999; }
    100% { opacity: 1; }
}

/* For iPads and iPhones, improve rendering */
@media only screen and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) {
    #gameContainer canvas {
        image-rendering: -webkit-optimize-contrast;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        perspective: 1000;
        -webkit-perspective: 1000;
        touch-action: none;
    }
    
    /* Override Unity template styles for better mobile compatibility */
    .webgl-content * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* iPhone specific safari fixes */
@supports (-webkit-touch-callout: none) {
    #gameContainer, #gameContainer canvas, .webgl-content {
        width: 100% !important;
        height: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    /* Fix for iPhone safe area and URL bar */
    @media screen and (max-width: 767px) {
        body {
            position: fixed;
            width: 100%;
            height: 100%;
        }
        
        #gameContainer, .webgl-content {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100% !important;
            height: 100% !important;
        }
    }
}

/* Styles moved from smoother-2017.js and index.html - NOW WITH RELATIVE UNITS */

/* Fullscreen and PWA Buttons Baseline Styles */
.game-button {
  position: absolute;
  z-index: 100;
  right: 1.5vw; /* Example: relative to viewport width */
  /* Using clamp for responsive size: min, preferred, max */
  width: clamp(2.5em, 4vw, 4em); 
  height: clamp(2.5em, 4vw, 4em);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  /* Transition includes bottom for smooth animation later */
  transition: background 0.3s, opacity 0.3s, bottom 0.5s ease-out;
  opacity: 0.6; /* Default opacity */
}

#fullscreen-button {
  background: rgba(0, 0, 0, 0.3);
}

#fullscreen-button:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.5);
}

#pwa-button {
  background: rgba(0, 128, 0, 0.3);
  opacity: 0.4; 
}

#pwa-button:hover {
  opacity: 1;
  background: rgba(0, 128, 0, 0.5);
}

/* Class for animated lower position of buttons - to be handled by JS by setting new bottom value */
/* .game-button.final-position { bottom: 1.5vh; } /* Example target, actual dynamic set in JS */

/* Orientation Overlay Baseline Styles */
#orientationOverlay.smoother-overlay-styles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  z-index: 1000;
  display: none; 
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #FFFFFF;
  font-family: Arial, sans-serif; /* Consider a web-safe font stack */
}

#orientationOverlay .orient-content {
  display: none; 
  padding: 1.5em; /* Relative padding */
  background-color: rgba(0,0,0,0.7);
  border-radius: 0.5em; /* Relative border radius */
  max-width: 80%;
}

#orientationOverlay .orient-content p {
  font-size: clamp(1em, 2.2vh, 1.4em); /* Responsive font size */
  line-height: 1.5;
  color: #FFFFFF;
  margin: 0;
  padding: 0.5em; /* Relative padding */
  text-align: center;
}

#orientationOverlay .rotate-icon {
  width: clamp(3em, 6vh, 4em); /* Responsive icon size */
  height: clamp(3em, 6vh, 4em);
  margin: 0 auto 1em;
  border: clamp(0.1em, 0.3vh, 0.2em) solid #FFFFFF; /* Responsive border */
  border-radius: 50%;
  position: relative;
  animation: rotateAnimation 2s infinite linear;
}

#orientationOverlay .resize-icon {
  width: clamp(3em, 6vh, 4em);
  height: clamp(2em, 4vh, 3em);
  margin: 0 auto 1em;
  border: clamp(0.1em, 0.3vh, 0.2em) solid #FFFFFF;
  border-radius: 0.25em;
  position: relative;
  animation: resizeAnimation 3s infinite ease-in-out;
}

#orientationOverlay .rotate-icon:before {
    content: '';
    position: absolute;
    /* Scaled pseudo-element for arrow, using ems based on parent icon font-size if it had one, or vw/vh */
    /* For simplicity, let's assume these were fine relative to the icon box itself before or are decorative */
    /* Re-evaluating these if they look off. For now, keeping values that might scale with icon box if rems/ems were used, or make them explicitly relative */
    top: -0.5em; /* Relative to icon's font-size or its own font-size if set */
    right: 0.6em;
    width: 0;
    height: 0;
    border-left: 0.8em solid transparent;
    border-right: 0.8em solid transparent;
    border-bottom: 1em solid #fff;
    transform: rotate(30deg);
}


/* Styles from index.html <style> block - ensure these are minimal and critical */
html, body.smoother-fullscreen-styles {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%; 
    /*
    iOS should behave consistently with the body one, so we don't need this.
    height: -webkit-fill-available; 
    */
    overflow: hidden;
    background-color: #000000; 
    touch-action: none;
    -ms-touch-action: none;
}

/* Combining gameContainer and webgl-content rules from index.html as they were similar */
.smoother-container-styles, /* Applied to #gameContainer and .webgl-content by JS */
#gameContainer.smoother-container-styles canvas {
    width: 100% !important;
    height: 100% !important;
    position: fixed !important; 
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important; /* Keep if it helps perf or fixes issues */
}

/*
#gameContainer.smoother-container-styles canvas {
     height: -webkit-fill-available !important; / * iOS specific for full viewport, if body one isn't enough  * /
}
*/

/* PWA Instructions Overlay - Base structure from index.html, enhanced with relative units */
#pwaInstructionsOverlay.smoother-pwa-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #FFFFFF;
    font-family: Arial, sans-serif;
    padding: 1em; /* Relative padding for the overlay itself */
}

#pwaInstructionsOverlay .pwa-modal-content {
    background-color: #2c2c2c;
    padding: clamp(1.5em, 3vw, 2.5em); /* Responsive padding */
    border-radius: 1em; /* Relative radius */
    max-width: 90vw; /* Max width relative to viewport */
    width: auto; /* Allow it to shrink */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0.25em 1em rgba(0,0,0,0.6); /* Relative shadow */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#pwaInstructionsOverlay #pwaInstructionsDynamicContent {
    margin-bottom: 1.5em;
    text-align: left; 
}
#pwaInstructionsOverlay #pwaInstructionsDynamicContent h2 {
    margin-top:0;
    margin-bottom: 1em;
    text-align: center;
    font-size: clamp(1.2em, 2.5vh, 1.6em);
}
#pwaInstructionsOverlay #pwaInstructionsDynamicContent p {
    margin: 0.8em 0 1em;
    text-align: center;
    font-size: clamp(0.9em, 2vh, 1.1em);
}
#pwaInstructionsOverlay #pwaInstructionsDynamicContent ol {
    text-align: left;
    display: block; /* Changed from inline-block for better flow */
    margin: 0 auto 1em auto; /* Centering the list block */
    padding-left: 2em; 
    font-size: clamp(0.85em, 1.9vh, 1em);
}
#pwaInstructionsOverlay #pwaInstructionsDynamicContent li {
    margin-bottom: 0.75em;
}


#pwaInstructionsOverlay #closePwaInstructions {
    margin-top: 1.5em;
    padding: 0.8em 1.8em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    font-size: clamp(0.9em, 2vh, 1.1em);
    font-weight: bold;
}

#pwaInstructionsOverlay #hidePwaInstructionsForever {
    margin-top: 0.8em;
    padding: 0.6em 1.2em;
    background-color: #757575;
    color: white;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    font-size: clamp(0.8em, 1.8vh, 1em);
}

/* Ensuring existing keyframes for loader are not affected or duplicated unless intended */
/* ... existing keyframes like @keyframes rotate, @keyframes resizeAnimation etc. ... */

/* Style for the INJECTED iPhone video player */
#paduInjectedVideoPlayer {
    /* Ensures it tries to fill height on iOS, potentially helping with aspect ratio issues */
    height: -webkit-fill-available !important; 
    /* The existing JS already sets: 
       position: fixed; top: 0; left: 0; width: 100%; height: 100% (as fallback);
       z-index: 2000; background-color: #000; object-fit: contain; display: block !important;
       So, these primarily ensure the height aspect for iOS specific scenarios.
    */
}
