/* === GLOBAL RESET === */
html {
  box-sizing: border-box;
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
*, *:before, *:after {
  box-sizing: inherit;
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* === BASE === */

@font-face {
  font-family: 'LoRes9OTWide';
  src: url('../fonts/LoRes9OTWide-Regular.woff2') format('woff2'),
       url('../fonts/LoRes9OTWide-Regular.woff') format('woff'),
       url('../fonts/LoRes9OTWide-Regular.ttf') format('truetype'),
       url('../fonts/LoRes9OTWide-Regular.eot');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LoRes9PlusOTWide';
  src: url('../fonts/LoRes9PlusOTWide-Bold.woff2') format('woff2'),
       url('../fonts/LoRes9PlusOTWide-Bold.woff') format('woff'),
       url('../fonts/LoRes9PlusOTWide-Bold.ttf') format('truetype'),
       url('../fonts/LoRes9PlusOTWide-Bold.eot');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  color: #000;
  background-color: #161B79;
  font: 15px/1.467 "Roboto", "Arial", "Helvetica Neue", "Helvetica", sans-serif;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* === BACKGROUND IMAGE AND BLUR LAYER === */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #161B79 url('../images/splash.jpg') bottom center no-repeat;
  background-size: 100% auto;
  z-index: 0;
  transition: filter 1s ease;
}
body.blur-bg::before {
  filter: blur(6px);
}

/* Keep content above blurred background */
#wrapper, header, footer, #main {
  position: relative;
  z-index: 2;
}

/* === IMAGES & TEXT === */
img {
  max-width: 100%;
  height: auto;
  border: none;
  vertical-align: top;
}
h1, h2, h3 {
  font-family: "Raleway", "Arial", "Helvetica Neue", "Helvetica", sans-serif;
  font-weight: bold;
  color: inherit;
  margin: 0 0 .5em;
}
h1 { font-size: 34px; }
h2 { font-size: 27px; }
h3 { font-size: 24px; }
p { margin: 0 0 1em; }
a {
  color: #39f;
  background-color: transparent;
  text-decoration: none;
}
a:hover, a:focus {
  outline: 0;
  text-decoration: none;
  opacity: 0.8;
}
hr {
  width: 54px;
  height: 1px;
  border: none;
  background: #8c7851;
  margin: 3px 0 2px;
}
.container {
  padding: 0 11px;
  margin: 0 auto;
  max-width: 1180px;
}

/* === HEADER === */
.header {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  transition: all 0.2s linear;
  z-index: 10001;
}
.header__container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 20px;
}
.header__logo-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.header__logo-wrapper p {
  font-family: Lato, sans-serif;
  font-size: 10px;
  color: #fff;
  font-weight: 400;
  line-height: 8px;
  margin: 0;
}
.header__client_compliance {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.header__logo {
  display: block;
  width: 120px;
  height: auto;
}
.header__compliance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.header__compliance p {
  font-size: 10px;
  color: #fff;
  font-weight: 400;
  line-height: 12px;
  text-align: right;
  margin-bottom: 10px;
}
.header__compliance a {
  color: #fff;
  font-size: 10px;
  font-weight: 400;
  padding-top: 10px;
  text-decoration: none;
}
.header__compliance hr {
  width: 100%;
  border: 0;
  border-top: 0.5px solid #fff;
  margin: -8px 0;
}
.header__client-logo__image {
  max-width: 116px;
  /*margin: 0 0 9px 12px;*/
	margin-top: -9px;
  display: block;
}

/* === CLOUDS (floaty top layer) === */
.cloud-layer {
  position: fixed;
  top: 100px;        /* 100px padding from top */
  left: 0;
  width: 100%;
  height: calc(100% - 100px);
  overflow: hidden;
  z-index: 2;        /* above background, below splash text */
  pointer-events: none;
}

/* Shared cloud base */
.cloud {
  position: absolute;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.75;
  will-change: transform;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

/* Cloud 1 – slow rightward drift */
.cloud1 {
  background-image: url('../images/cloud1.png');
  width: 140px;
  height: 70px;
  top: 30%;           /* slightly higher in the sky */
  left: 5%;
  animation: floatRight 80s ease-in-out infinite;
}

/* Cloud 2 – slower leftward drift */
.cloud2 {
  background-image: url('../images/cloud2.png');
  width: 170px;
  height: 80px;
  top: 32%;           /* a bit lower for layering depth */
  left: 70%;
  animation: floatLeft 110s ease-in-out infinite;
}
.cloud3 {
  background-image: url('../images/cloud1.png');
  width: 210px;
  height: 100px;
  top: 35%;
  left: 10%;
  opacity: 0.5;
  animation: floatRight 140s ease-in-out infinite;
}

/* Keyframes for soft back-and-forth floating */
@keyframes floatRight {
  0%   { transform: translateX(0) translateY(0); opacity: 0.8; }
  25%  { transform: translateX(5vw) translateY(-1vh); opacity: 0.9; }
  50%  { transform: translateX(10vw) translateY(1vh); opacity: 0.85; }
  75%  { transform: translateX(5vw) translateY(-0.5vh); opacity: 0.9; }
  100% { transform: translateX(0) translateY(0); opacity: 0.8; }
}

@keyframes floatLeft {
  0%   { transform: translateX(0) translateY(0); opacity: 0.8; }
  25%  { transform: translateX(-5vw) translateY(1vh); opacity: 0.9; }
  50%  { transform: translateX(-10vw) translateY(-1vh); opacity: 0.85; }
  75%  { transform: translateX(-5vw) translateY(0.5vh); opacity: 0.9; }
  100% { transform: translateX(0) translateY(0); opacity: 0.8; }
}


/* === SPLASH SCREEN === */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  z-index: 10000;
  transition: opacity 1s ease, z-index 0s 1s;
}

#splash.fade-out {
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
/* Positioning for splash content and button */
.splash-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 15% 20px; /* 10% top + bottom spacing, 20px side padding */
  text-align: center;
  position: relative;
  z-index: 5;
}

.splash-content h1 {
  font-family: 'LoRes9PlusOTWide', 'Press Start 2P', monospace;
  font-size: 85px;
  line-height: 1.2;
  margin: 0px;
  text-transform: uppercase;

  /* Core color and soft glow */
  color: #FFC534;
  text-shadow:
    -1px -1px 0 #0098AD,
     1px -1px 0 #0098AD,
    -1px  1px 0 #0098AD,
     1px  1px 0 #0098AD,
     0 0 10px rgba(0, 0, 0, 0.5);

  /* Crisp vector stroke (for WebKit browsers) */
  -webkit-text-stroke: 1px #0098AD;
  text-stroke: 1px #0098AD;
  paint-order: stroke fill;

  /* Optional: give letters a slight spacing boost for readability */
  letter-spacing: 1px;
}
.splash-content h2 {
  font-family: 'LoRes9PlusOTWide','Press Start 2P', monospace;
  font-size: 36px;
  line-height: 1.5;
	color: #C3FDFF;
  text-transform: uppercase;
}
.splash-content p{
  font-family: 'LoRes9OTWide','Press Start 2P', monospace;
  font-size: 17px;
  line-height: 1.5;
	color: #ffffff;
}
button#enter-race {
  position: fixed;
  bottom: 10%;             /* sit 10% from bottom of screen */
  left: 50%;
  transform: translateX(-50%);
  font-family: 'LoRes9PlusOTWide','Press Start 2P', monospace;
  font-size: 25px;
  padding: 14px 28px;
  border: 6px solid #0E8393;
  border-radius: 0;
  background: #88E1E4;
  color: #382672;
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 6;
}

button#enter-race:hover {
  transform: translateX(-50%) scale(1.05);
}

/* === MAIN / GAME === */
#wrapper {
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}
#main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
#game canvas {
  margin: 0 auto;
}
#game {
display: flex;
  /*justify-content: center;*/
  align-items: center;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  margin: 0 auto;
  position: relative;
}

/* === FOOTER === */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.5);
  /*backdrop-filter: blur(6px);*/
  color: #000;
  width: 100%;
  z-index: 10010;
}
.bottom__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.bottom_copyright {
  font-size: 10px;
  line-height: 1.4;
}
.bottom_copyright a {
  color: #000;
  text-decoration: none;
}
.bottom__menu {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
}
.bottom__menu__link {
  font-size: 10px;
  color: #000;
  text-decoration: none;
}
.bottom__menu__link:hover {
  opacity: 0.8;
}

/* === RESPONSIVE FOOTER === */
@media (max-width: 768px) {
  .bottom__container {
    flex-direction: row;
    align-items: flex-start;
  }
  .bottom_copyright {
    width: 51%;
}
  .bottom__menu {
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: -5px;
  }
}
@media (max-width: 468px) {
  .bottom_copyright {
    width: 51%;
}
  .bottom__menu {
    flex-direction: column;
    margin-top: 0px;
    gap: 0px;
  }
}
/* === DESKTOP FIRST BREAKPOINTS === */

/* Large tablets / small laptops (max-width 992px) */
@media (max-width: 992px) {
  {
  .splash-content
      padding: 15% 20px;
    }
  .splash-text-block h1 {
    font-size: 65px;
  }
  .splash-text-block h2 {
    font-size: 30px;
  }
  button#enter-race {
    font-size: 24px;
    padding: 12px 24px;
  }
}

/* Tablets (max-width 875px) */
@media (max-width: 875px) {
  body::before {
    background-image: url('../images/mobile-splash.jpg');
  }
  .splash-text-block h1 {
    font-size: 55px;
    line-height: 1;
  }
  .splash-text-block h2 {
    font-size: 26px;
  }
  .splash-text-block p {
    font-size: 15px;
    line-height: 1.6;
  }
  button#enter-race {
    font-size: 17px;
    padding: 10px 20px;
    margin-bottom: 25px;
  }
  .splash-content {
    padding: 20% 16px;
  }
}
@media (max-width: 768px) {
    button#enter-race {
        font-size: 17px;
        padding: 10px 20px;
        margin-bottom: 20px;
    }
    #main {
        align-items: flex-start;
        padding-top: 10px;
    }
    /* Change to solid background color when game starts */
    body.blur-bg::before {
      background-color: #4F2E0B;
      background-image: url('../assets/bricks.png');
      background-size: 260px auto;
      background-repeat: repeat;
      filter: none;
    }
    /* Remove footer background when game is active */
    body.blur-bg #footer {
        background: #4F2E0B;
        color: #ffffff;
    }
    body.blur-bg #footer a {
        color: #ffffff;
    }
}

/* mobile (max-width 600px) */
@media (max-width: 600px) {
  .splash-text-block h1 {
    font-size: 38px;
    line-height: 1.1;
  }
  .splash-text-block h2 {
    font-size: 20px;
  }
  .splash-text-block p {
    font-size: 14px;
  }
  button#enter-race {
    font-size: 15px;
    padding: 8px 16px;
    border-width: 4px;
    width: 60%;
  }

  /* Reduce cloud sizes for mobile */
  .cloud1, .cloud2 {
    width: 60%;
    height: auto;
    opacity: 0.7;
  }
  .bottom__container{
    gap:0px;
  }

  /* Optional tighter splash spacing */
  .splash-content {
    padding: 25% 12px;
  }
}
/* Small mobile (max-width 600px) */
@media (max-width: 468px) {
  .splash-text-block h1 {
    font-size: 30px;
    line-height: 1.1;
  }
  .splash-text-block h2 {
    font-size: 20px;
  }
  .splash-text-block p {
    font-size: 14px;
    padding-top: 10px;
  }
  button#enter-race {
    font-size: 15px;
    padding: 8px 16px;
    border-width: 4px;
    margin-bottom: 25%;
  }

  /* Reduce cloud sizes for mobile */
  .cloud1, .cloud2 {
    width: 60%;
    height: auto;
    opacity: 0.7;
  }
  .bottom_copyright{
    font-size: 9px;
  }
  .bottom__menu{
    font-size: 9px;
  }

  /* Optional tighter splash spacing */
  .splash-content {
    padding: 30% 30px;
  }
}
#ad-label {
      position: fixed;
      top: 0px;
      padding: 7px;
      left: 50%;
      transform: translateX(-50%);
      font-family: "BBC Reith Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
      font-size: 15px;
      z-index: 10010;
      display: none;
      pointer-events: none;
      width: 100%;
      text-align: center;
      background-color: #88E1E4;
      color: #20535A;
  }
/* Show ad label only on small screens */
@media (max-width: 768px) {
  #ad-label.show {
    display: block;
  }
}

/* === Splash fade-in and pop animations === */
/* Initial state for anything that should fade in */
.start-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
}
/* Paragraph fade-in */
.fade-in {
  opacity: 0;
  visibility: visible;
  transform: translateY(10px);
  animation: fadeInUp 0.8s ease forwards;
  animation-fill-mode: forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Improved pop-in for button === */
.fade-expand {
  opacity: 0;
  transform: translateX(-50%) scale(0.95);
  animation: fadeExpand 0.8s ease-out forwards;
  animation-delay: 1.5s;
  animation-fill-mode: forwards;
}

@keyframes fadeExpand {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.95);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}
