/* Variables */
:root {
    --primary-color: #e30612;
    --secondary-color: #ffff00;
    --white: #ffffff;
    --black: #000000;
}

/* W356-4 event name gate — match #start_screen / theme .button */
.event-initials-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/themes/custom/kitkat_racing/images/KIT_KAT_BREAKZONE_BG_DESKTOP.png') var(--primary-color) center center / cover no-repeat;
  text-align: center;
  padding: 1.5rem;
  color: var(--white);
  text-shadow: var(--kkr-text-shadow-thick);
}
.event-initials-gate__inner {
  max-width: 28rem;
  width: 100%;
}
.event-initials-gate__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: 400;
  color: var(--secondary-color);
  -webkit-animation: flash 1s infinite linear;
  -moz-animation: flash 1s infinite linear;
  animation: flash 1s infinite linear;
}
.event-initials-gate__headline {
  margin: 0 0 1.5rem;
  font-size: clamp(1.35rem, 5vw, 3.857rem);
  font-weight: 400;
  color: var(--white);
  text-shadow: var(--kkr-text-shadow-thick);
  text-transform: none;
}
.event-initials-gate .initials-input {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: min(25rem, 100%);
  margin-left: auto;
  margin-right: auto;
  text-shadow: none;
}
.event-initials-gate .event-name-field {
  position: relative;
  width: 100%;
}
.event-initials-gate input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 14px 22px;
  font-size: 1.571rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center !important;
  text-transform: none;
  border: 0;
  border-top: 1px solid #d76066;
  border-bottom: 1px solid #aa0607;
  background: var(--white);
  color: var(--black);
  box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.5);
  -webkit-box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.5);
  font-family: inherit;
}
.event-initials-gate .event-name-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #888;
  font-size: 1.571rem;
  font-weight: 400;
  line-height: 1.2;
  text-shadow: none;
  text-transform: uppercase;
}
.event-initials-gate input[type="text"]:focus + .event-name-ph,
.event-initials-gate input[type="text"]:not(:placeholder-shown) + .event-name-ph {
  opacity: 0;
}
.event-initials-gate .initials-input .button {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
}
.event-initials-gate__error {
  text-align: center;
  color: var(--secondary-color);
  text-shadow: var(--kkr-text-shadow);
  font-size: 1rem;
  margin: 0;
}
.event-initials-gate .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body.kkr-name-gate .page-title,
body.kkr-name-gate .region-highlighted {
  visibility: hidden;
}

/* W356-4 stripped event: never show site chrome on game or podium. */
body.path-frontpage header,
body.path-frontpage footer,
body.path-frontpage .page-title,
body.path-frontpage .region-highlighted,
body.path-frontpage #block-kitkat-racing-main-menu,
body.path-frontpage .region-header,
body.path-leaderboards header,
body.path-leaderboards footer,
body.path-leaderboards .page-title,
body.path-leaderboards .region-highlighted,
body.path-leaderboards #block-kitkat-racing-main-menu,
body.path-leaderboards .region-header {
  display: none !important;
}

/* W356-4: single-lap event — no in-race menu or best/last/lap HUD. */
#hud #race__main_menu,
#hud #fast_lap_time,
#hud #last_lap_time,
#hud #lap_count,
#hud #last_lap_notice,
#race__main_menu,
#fast_lap_time,
#last_lap_time,
#lap_count,
#last_lap_notice {
  display: none !important;
  visibility: hidden !important;
}

/* W356-4 lobby copy — same flash yellow as start_screen h2 */
#lobby_waiting_copy {
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 400;
  color: var(--secondary-color);
  text-shadow: var(--kkr-text-shadow-thick);
  -webkit-animation: flash 1s infinite linear;
  -moz-animation: flash 1s infinite linear;
  animation: flash 1s infinite linear;
  margin: 0.5rem 0 0;
}


:root {
  --kkr-text-shadow:
    1px 1px 0 var(--black),
    -1px 1px 0 var(--black),
    1px -1px 0 var(--black),
    -1px -1px 0 var(--black),
    0px 1px 0 var(--black),
    0px -1px 0 var(--black),
    -1px 0px 0 var(--black),
    1px 0px 0 var(--black),
    2px 2px 0 var(--black),
    -2px 2px 0 var(--black),
    2px -2px 0 var(--black),
    -2px -2px 0 var(--black),
    0px 2px 0 var(--black),
    0px -2px 0 var(--black),
    -2px 0px 0 var(--black),
    2px 0px 0 var(--black),
    1px 2px 0 var(--black),
    -1px 2px 0 var(--black),
    1px -2px 0 var(--black),
    -1px -2px 0 var(--black),
    2px 1px 0 var(--black),
    -2px 1px 0 var(--black),
    2px -1px 0 var(--black),
    -2px -1px 0 var(--black);
    --kkr-text-shadow-thick:
    1px 1px 0 var(--black),
    -1px 1px 0 var(--black),
    1px -1px 0 var(--black),
    -1px -1px 0 var(--black),
    0px 1px 0 var(--black),
    0px -1px 0 var(--black),
    -1px 0px 0 var(--black),
    1px 0px 0 var(--black),
    2px 2px 0 var(--black),
    -2px 2px 0 var(--black),
    2px -2px 0 var(--black),
    -2px -2px 0 var(--black),
    0px 2px 0 var(--black),
    0px -2px 0 var(--black),
    -2px 0px 0 var(--black),
    2px 0px 0 var(--black),
    1px 2px 0 var(--black),
    -1px 2px 0 var(--black),
    1px -2px 0 var(--black),
    -1px -2px 0 var(--black),
    2px 1px 0 var(--black),
    -2px 1px 0 var(--black),
    2px -1px 0 var(--black),
    -2px -1px 0 var(--black),
    3px 0px 0 var(--black),
    -3px 0px 0 var(--black),
    0px 3px 0 var(--black),
    0px -3px 0 var(--black),
    3px 3px 0 var(--black),
    -3px 3px 0 var(--black),
    3px -3px 0 var(--black),
    -3px -3px 0 var(--black),
    1px 3px 0 var(--black),
    -1px 3px 0 var(--black),
    1px -3px 0 var(--black),
    -1px -3px 0 var(--black),
    3px 1px 0 var(--black),
    -3px 1px 0 var(--black),
    3px -1px 0 var(--black),
    -3px -1px 0 var(--black),
    2px 3px 0 var(--black),
    -2px 3px 0 var(--black),
    2px -3px 0 var(--black),
    -2px -3px 0 var(--black),
    3px 2px 0 var(--black),
    -3px 2px 0 var(--black),
    3px -2px 0 var(--black),
    -3px -2px 0 var(--black);
}

#landscape_popup {
    display: none;
    z-index: 999;
}

@media screen and (max-width: 1400px) and (orientation: portrait) {
  #landscape_popup {
    display: block;
  }
}

#start_clicker {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 998;
  pointer-events: auto;
  display: none;
}

/* Phone CTA — same red KitKat .button as name-gate GO, centered */
#start_screen .start-race-btn {
  position: relative;
  z-index: 999;
  display: block;
  width: auto !important;
  min-width: 12rem;
  max-width: 18rem;
  min-height: 3.5rem;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 1.25rem;
  padding: 18px 28px;
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

/* Tall/wide invisible hit zone — icon-sized button, much easier to tap. */
#start_screen .start-race-btn::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 420px);
  height: min(42vh, 280px);
  z-index: -1;
}

#start_screen .start-race-btn:hover,
#start_screen .start-race-btn:focus {
  color: var(--primary-color);
  background: var(--white);
}

.track_selection_wrapper {
  width: 100%;
  max-width: 100vw;
}

#track_selection {
  z-index: 9999;
  position: absolute;
  width: 670px;
  height: 494px;
  margin: 0 auto;
  top: 0;
  padding: 20px;
  background: url('../images/break_sign.png') var(--black) center center no-repeat;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-transform: uppercase;
  top: 429px;
  z-index: 20;
}

#track_selection h2, #track_selection h3, #track_selection button {
  padding: 5px;
  margin: 0;
  transition-property: background-color;
  transition-duration: 2s;
  -webkit-transition-property: background-color;
  -webkit-transition-duration: 2s;
  font-size: 2.571rem;
  color: var(--white);
  font-weight: 500;
  /* font-style: italic; */
  /* text-shadow: 0px 4px #e22b17; */
  color: var(--secondary-color);
  /* text-shadow: 3px 3px 0 var(--black), -3px 3px 0 var(--black), -3px -3px 0 var(--black), 3px -3px 0 var(--black); */
  text-shadow: var(--kkr-text-shadow-thick);
  font-style: italic;
  background: none;
  /* -webkit-animation: textflicker 0.01s alternate, flicker 4s alternate infinite;
  -moz-animation: textflicker 0.01s infinite alternate, flicker 4s alternate infinite;
  animation: textflicker 0.01s infinite alternate, flicker 4s alternate infinite; */
}

.track_selection__copy {
  /* background: #e30612ad;
  padding: 5px 10px; */
  text-shadow: 0px 0px 10px #CE0000;
}

.track_selection__copy p {
  line-height: 1.25;
  font-family: 'franklin-gothic-heavy-regular', Arial, Helvetica, sans-serif;
  margin-bottom: 0;
  font-size: 1.429rem;
}

#track_selection > p:nth-of-type(2) {
  font-size: 1rem;
}

.retro-font, #track_selection > p.retro-font {
  font-family: 'upheavtt', Arial, Helvetica, sans-serif;
  letter-spacing: 1px;
  font-weight: 400;
}

#track_selection_wrapper {
  /* display: flex;
  flex-direction: column; */
  /* max-width: calc(100% + 40px); */
  width: 100%;
  margin-top: 30px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#track_selection button {
  border: 0;
  color: var(--black);
  text-shadow: none;
  /* text-shadow: 1px 1px 0 var(--black), -1px 2px 0 var(--black), -1px -2px 0 var(--black), 1px -2px 0 var(--black); */
  font-style: normal;
  background: none;
  /* font-family: 'upheavtt', Arial, Helvetica, sans-serif; */
  letter-spacing: 1px;
  font-size: 1.286rem;
  margin-bottom: 10px; cursor: pointer;
  position: relative;
  margin: 10px;
  padding: 10px;
  background: var(--white);
  width: calc(100% - 40px);
  max-width: 500px;
}

#track_selection button:disabled {
  cursor: not-allowed;
  opacity: 0.8; 
}

#track_selection button .track_selection__border {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, black 50%, transparent 50%), 
              linear-gradient(90deg, black 50%, transparent 50%), 
              linear-gradient(0deg, black 50%, transparent 50%), 
              linear-gradient(0deg, black 50%, transparent 50%);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-size: 16px 4px, 16px 4px, 4px 16px, 4px 16px;
  background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0px;
  border-radius: 0;
  padding: 0;
  animation: dash 10s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

#track_selection button:hover .track_selection__border {
  opacity: 1;
}

#track_selection button:disabled .track_selection__border {
  display: none;
}

.track_button__image {
  margin-bottom: 10px;;
}

.track_button__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0 auto;
}

.track_button p {
  margin-bottom: 5px;
}

.track_button__current_position {
  font-size: 1rem;
}

/* #track_selection button.track_selection__pick {
  -webkit-animation: textflicker 0.01s alternate, flicker 4s alternate infinite, flash 0.5s infinite linear;
  -moz-animation: textflicker 0.01s infinite alternate, flicker 4s alternate infinite, flash 0.5s infinite linear;
  animation: textflicker 0.01s infinite alternate, flicker 4s alternate infinite, flash 0.5s infinite linear;
} */

#track_selection button.track_selection__pick span {
  position: relative;
}

#track_selection button.track_selection__pick span:before {
  content: ">";
  position: absolute;
  left: -20px;
}

#track_selection h2 {
  text-align: center;
  font-size: 3.429rem;
  margin-bottom: 40px;
}

#track_selection h2 {
  margin-bottom: 40px;
}

#track_selection button.slick-arrow {
  background: none;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  height: 72px;
  width: 72px;
  text-indent: -9999px;
  font-size: 0;
  color: var(--secondary-color);
  /* width: auto; */
  text-shadow: var(--kkr-text-shadow);
  background: url('../images/sprites/LEFT_ARROW.svg') no-repeat center center;
  background-size: contain;
  margin-left: 20px;
}

#track_selection button.slick-arrow:hover {
  animation: arrowmoveleft 0.5s infinite alternate;
}

#track_selection button.slick-arrow.slick-next {
  right: 0;
  left: auto;
  margin-left: 0;
  margin-right: 20px;
  background-image: url('../images/sprites/RIGHT_ARROW.svg');
}

#track_selection button.slick-arrow.slick-next:hover {
  animation: arrowmoveright 0.5s infinite alternate;
}

#stats {
  border: 2px solid black;
}

#start_screen h1,
#start_screen__leaderboard {
  font-size: 1.857rem;
  color: var(--white);
  /* text-shadow: 3px 3px 0 var(--black), -3px 3px 0 var(--black), -3px -3px 0 var(--black), 3px -3px 0 var(--black); */
  text-shadow: var(--kkr-text-shadow-thick);
  font-style: normal;
  font-weight: 400;
}

#start_screen h2 {
  margin: 0;
}

#start_screen #start_screen__leaderboard {
  display: none !important;
}

#start_screen__leaderboard div {
  flex: 0 0 48%;
  text-align: center;
  padding-bottom: 5px;
}

#controls {
  width: 28em;
  float: left;
  padding: 1em;
  font-size: 0.7em;
}

#controls th {
  text-align: right;
  vertical-align: middle;
}

#instructions {
  clear: left;
  float: left;
  width: 17em;
  padding: 1em;
  border: 1px solid black;
  box-shadow: 0 0 5px black;
}

#cabinet {
  background: url('../images/CabBackgroun.png') no-repeat top center;
  padding-top: 280px;
  max-width: 916px;
  margin: 0 auto;
  z-index: 2;
  position: absolute;
  width: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-height: 100dvh;
  pointer-events: none;
  top: 0;
}

.kkr-game-active #cabinet {
  display: block;
}

#racer {
  position: relative;
  z-index: 0;
  width: 710px;
  height: 534px;
  margin: 0 auto;
  image-rendering: pixelated;
  top: 109px;
  display: none;
}

#canvas {
  position: absolute;
  z-index: 0;
  width: 710px;
  height: 534px;
  z-index: 0;
  background-color: #72d7ee;
  image-rendering: pixelated;
  filter: brightness(0.2);
}

#mute {
  background-position: 0px 0px;
  width: 145px;
  height: 68px;
  background: url('../images/mute.png') no-repeat;
  display: inline-block;
  cursor: pointer;
  position: absolute;
  margin: 0;
  left: 5%;
}

#mute.on {
  background-position: -145px 0px;
}

#fullscreen {
  background-position: 0px 0px;
  width: 145px;
  height: 68px;
  background: url('../images/tiltcontrols.png') no-repeat;
  display: inline-block;
  cursor: pointer;
  position: absolute;
  margin: 0;
  right: 5%;
  opacity: 0.5;
}

#tiltcontrols {
  width: 175px;
  height: 68px;
  background: url('../images/tiltcontrols.png') no-repeat;
  background-position: 3px 0px;
  display: inline-block;
  cursor: pointer;
  position: absolute;
  margin: 0;
  right: 5%;
}

#tiltcontrols.on {
  background-position: -168px 0px;
}

#start_screen, #end_screen {
  /* animation: start_screen_fade_simple 5s infinite; */
  /* transition: background 5s linear; */
  position: absolute;
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 0;
  bottom: auto;
  /*background: rgba(255, 22, 2, 1); border: 4px solid #ffff00; outline: 4px solid var(--black); */
  width: 90%;
  max-width: 640px;
  /* background: linear-gradient(90deg, rgba(255, 22, 22, 1) 0%, rgba(145, 53, 53, 0.75) 100%); */
  z-index: 1000;
  text-align: center;
  font-size: 24px;
  color: var(--white);
  font-weight: 700;
  /* font-style: italic; */
  /* text-shadow: 2px 2px black; */
  text-shadow: var(--kkr-text-shadow-thick);
  pointer-events: none;
}

#start_screen .start-race-btn,
#end_screen {
  pointer-events: auto;
}

#end_screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-shadow: var(--kkr-text-shadow);
  padding: 16px 12px;
  overflow: visible;
  box-sizing: border-box;
}

#end_screen #initials_input_wrapper {
    max-width: 420px;
    margin: 0 auto 1rem;
    text-align: center;
}

#end_screen #initials_input_wrapper input {
    margin: 10px 0;
    font-size: 1.5rem;
    width: 5rem;
    text-align: center;
    text-transform: uppercase;
}

#end_screen #initials_input_wrapper button {
    margin: 0;
    cursor: pointer;
}

#button--share--back {
  display: none;
}

#end_screen .start_screen__mobile_instructions {
  padding-bottom: 0;
  display: block;
  width: 100%;
  text-align: center;
}

#end_screen .start_screen__mobile_instructions > p:first-of-type{
  text-shadow: var(--kkr-text-shadow-thick);
  font-size: clamp(22px, 7vw, 48px);
  margin-bottom: 5px;
}

#end_screen p {
  margin: 0 auto;
  line-height: 1.15;
  font-size: 28px;
  text-align: center;
  width: 100%;
}

#end_screen p.shrink_text {
  font-size: 30px;
  margin-bottom: 10px;
  margin-top:20px;
}

#end_screen p.shrink_text_plus {
  font-size: 1rem;
}

.end_screen__social {
  display: none;
  margin-top: -30px;
}

.end_screen__info {
  margin-bottom: 0;
  width: 100%;
  text-align: center;
}

#share_image {
  height: auto;
  max-height: 50vh;
  width: auto;
}

.end_screen__social a {
  text-decoration: none;
  transform: scale(1);
  transition: transform 0.3s ease-in-out;
  max-width: 48px;
  display: inline-block;
  margin: 16px 10px 8px;
}

.end_screen__social a:hover {
  transform: scale(1.2);
}

.end_screen__buttons {
  flex-direction: column;
  display: flex;
  align-items: center;
  max-width: 280px;
  justify-content: center;
  margin: 0 auto;
}

.end_screen__buttons .button {
  margin-bottom: 15px;
}

.end_screen__buttons .button:last-of-type {
  margin-bottom: 0;
}

#iosInstall {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: var(--white);
  color: var(--primary-color);
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  font-style: italic;
  /* text-shadow: 2px 2px black; */
  z-index: 1;
  display: none;
}

#iosInstall img {
  width: 36px;
  transform: translate(1px, 8px);
  margin: -8px -4px 0;
}

.start_screen__mobile_instructions {
  display: none;
  font-size: 18px;
  font-weight: 400;
  padding: 0 10px;
}

.start_screen__mobile_instructions p {
  margin: 0 0 10px 0;
}

.keys {
  max-width: 500px;
}

.highscores {
  max-width: 520px;
  margin-bottom: 25px;
}

/* #bottom {
  position: relative;
  width: 100%;
  max-width: 830px;
  height: 100px;
  margin: 0 auto;
  top: 378px;
  z-index: 30;
  display: none;
} */

#bottom {
  z-index: 0;
  width: 100%;
  margin: 30px auto 0;
  height: 50px;
}

body.fullscreen {
  margin: 0;
}

body.fullscreen #racer, body.fullscreen #canvas {
  width: 100%;
  height: 100dvh;
  margin: 0 auto;
  object-fit: contain;
  top: 0;
  background-color: var(--primary-color);
  z-index: 15;
}

/* body.fullscreen #bottom {
  position: absolute;
  bottom: 0px;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  max-width: 85%;
  z-index: 20;
} */

body.fullscreen #fullscreen {
  background-position: -145px 0px;
}

body.fullscreen #cabinet {
  display: none;
}

body.fullscreen .highscores {
  display: block;
  margin: 0 auto 50px;
  max-width: 100%;
}

body.fullscreen .keys {
  max-width: 1020px;
}

body.fullscreen #hud, body.fullscreen #hud_bottom {
   z-index: 20;
}

body.fullscreen #start_screen, body.fullscreen#end_screen {
  z-index: 22;
}

/**************************************************/
/* rudimentary heads up display (only used in v4) */
/**************************************************/
#hud {
  position: absolute;
  z-index: 1;
  width: 100%;
  padding: 12px 12px 0;
  /*font-family: Verdana, Geneva, sans-serif;*/
  font-size: 0.8em;
  color: black;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  display: none;
}

#hud .hud {
  padding: 5px;
  margin: 0;
  transition-property: background-color;
  transition-duration: 2s;
  -webkit-transition-property: background-color;
  -webkit-transition-duration: 2s;
  font-size: 2.571rem;
  color: var(--white);
  font-weight: 500;
  /* font-style: italic; */
  /* text-shadow: 0px 4px #e22b17; */
  color: var(--secondary-color);
  /* text-shadow: 3px 3px 0 var(--black), -3px 3px 0 var(--black), -3px -3px 0 var(--black), 3px -3px 0 var(--black); */
  text-shadow: var(--kkr-text-shadow-thick);
}

#hud #speed {
  float: right;
}

#hud #current_lap_time {
  float: left;
  /*background: rgb(255,22,22); background: linear-gradient(90deg, rgba(255,22,22,1) 0%, rgba(145,53,53,0.75) 50%, rgba(255,255,255,0) 100%); padding-right: 120px;*/
  padding-left: 10px;
}

#hud #last_lap_time {
  position: absolute;
  right: 0;
  top: 62px;
  font-size: 1.857rem;
  /* padding-right: 10px; */
  display: none;
  /* background: rgb(255, 22, 22); */
  /* background: linear-gradient(270deg, rgba(255, 22, 22, 1) 0%, rgba(145, 53, 53, 0.75) 50%, rgba(255, 255, 255, 0) 100%); */
  float: right;
  text-align: center;
  transition-property: background-color;
  transition-duration: 2s;
  -webkit-transition-property: background-color;
  -webkit-transition-duration: 2s;
  padding-right: 22px;
}

#hud #fast_lap_time {
  /*padding-left: 120px; background: rgb(255,22,22); background: linear-gradient(270deg, rgba(255,22,22,1) 0%, rgba(145,53,53,0.75) 50%, rgba(255,255,255,0) 100%);*/
  float: right;
  text-align: center;
  transition-property: background-color;
  transition-duration: 2s;
  -webkit-transition-property: background-color;
  -webkit-transition-duration: 2s;
  padding-right: 10px;
}

#hud #lap_count {
  position: absolute;
  left: 0;
  top: 62px;
  font-size: 1.857rem;
  float: left;
  text-align: left;
  transition-property: background-color;
  transition-duration: 2s;
  -webkit-transition-property: background-color;
  -webkit-transition-duration: 2s;
  padding-left: 22px;
}

#hud .value {
  color: var(--white);
  font-weight: bold;
}

#hud #last_lap_notice {
  display: none;
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translateX(-50%) rotate(-10deg);
  /* font-size: 4.571rem; */
  line-height: 0.7;
  text-align: end;
  animation: flash 1s infinite linear;
}

#race__main_menu {
  width: 50px;
  height: 44px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all .2s ease-in-out;
  background: var(--primary-color);
}

.race__main_menu__inner {
  width: 34px;
  height: 5px;
  background: var(--white);
  border-radius: 0;
  transition: all .2s ease-in-out;
}

.race__main_menu__inner::before, .race__main_menu__inner::after {
    content: '';
    position: absolute;
    height: 5px;
    width: 34px;
    background: var(--white);
    /* border-radius: 5px; */
    transition: all .2s ease-in-out;
}

.race__main_menu__inner::before {
    transform: translateY(-12px);
}

.race__main_menu__inner::after {
    transform: translateY(12px);
}

/* #hud .fastest          { background-color: rgba(255,215,0,0.5); } */
#hud_bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  padding: 20px 12px;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.8em;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  display: none;
}

.skid_source  {
  position: absolute;
  height: 1px;
  width: 1px;
  background: transparent;
  pointer-events: none;
  bottom: 20px;
  left: 50%;
  transform: translateX(13vw);
  z-index: 2;
}

.skid_source.skid_source--left {
  transform: translateX(-13vw);
}

.skid_smoke {
  display: block;
  background: white;
  border-radius: 0;
  opacity: 1;
  /* box-shadow: 0 0 6px 2px #fff, 0 0 2px #ccc; */
  position: absolute;
  will-change: transform, opacity;
  pointer-events: none;
  z-index: 2;
}

#mobile_controls {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55%;
  z-index: 5;
  justify-content: space-between;
  align-items: stretch;
  pointer-events: none;
  box-sizing: border-box;
}

#speedometer {
  position: relative;
  right: 0;
  bottom: 0;
  background: url('../images/sprites/audiNumbers.png') no-repeat center center;
  width: 120px;
  height: 120px;
  float: right;
  display: block;
}

#speedometer_dial {
  position: relative;
  background: url('../images/sprites/audiNumbersPointer.png') no-repeat center center;
  width: 14px;
  height: 62px;
  display: block;
  left: 52px;
  top: 52px;
  transform: rotate(0deg);
  transform-origin: 7px 7px;
}

#total_race_value {
  -webkit-animation: flash 0.5s infinite linear;
  -moz-animation: flash 0.5s infinite linear;
  animation: flash 0.5s infinite linear;
}

.yellow-text  {
  color: var(--secondary-color);
}

#start_screen__leaderboard .yellow-text {
  margin-right: 10px;
}

#track_selection_wrapper .slick-list {
  padding: 0 200px !important;
}

#track_selection_wrapper .slick-slide {
  transform: scale(0.8);
  transition: transform 0.3s ease-in-out;
}

#track_selection_wrapper .slick-slide.slick-center {
  transform: scale(1);
}

@keyframes start_screen_fade_simple {
  0% {
    background: rgb(277,6,18);
  }

  50% {
    background: rgb(145, 53, 53, 0.75);
  }

  100% {
    background: rgb(277,6,18);
  }
}

@keyframes start_screen_fade {
  0% {
    background: linear-gradient(90deg, rgba(277,6,18,1) 0%, rgba(145, 53, 53, 0.75) 100%);
  }

  25% {
    background: linear-gradient(90deg, rgba(277,6,18,1) 0%, rgba(145, 53, 53, 0.75) 0%);
  }

  50% {
    background: linear-gradient(90deg, rgba(145, 53, 53, 0.75) 0%, rgba(277,6,18,1) 100%);
  }

  75% {
    background: linear-gradient(90deg, rgba(145, 53, 53, 0.75) 0%, rgba(277,6,18,1) 0%);
  }

  100% {
    background: linear-gradient(90deg, rgba(277,6,18,1) 0%, rgba(145, 53, 53, 0.75) 100%);
  }
}

@media(max-height: 999px) {
  body {
    min-height: 100dvh;
    overflow: visible;
  }

  #cabinet {
    min-height: 740px;
    height: 100dvh;
  }
}

@media(max-height: 580px) {
  #start_screen__leaderboard div {
      flex: 0 0 32%;
      font-size: 1.571rem;
  }
}

@media(max-height: 500px) {
  #end_screen {
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 8px 12px;
  }
}

@media(max-height: 480px) {
  #start_screen__leaderboard div {
    flex: 0 0 20%;
  }

  #start_screen__leaderboard.highscores {
    max-width: 100vw;
  }
}

@media(max-height: 430px) {
  #hud_bottom {
    display: none !important;
  }
}

@media(max-height: 380px) {
  #start_screen, #end_screen {
    padding-top: 0 !important;
    /* transform: translateY(-60%) !important; */
  }
  .highscores {
    max-width: 55% !important;
  }
}

@media screen and (max-width: 1400px) {
  html, body, button, canvas, #mobile_controls .control {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    user-select: none; 
    touch-action: manipulation;
  }

  html, body {
    background: var(--primary-color);
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  /* Lock to the dynamic visual viewport so chrome show/hide doesn't create scroll. */
  body.path-frontpage,
  body.kkr-game-active,
  body.kkr-game-running {
    width: 100dvw;
    height: 100dvh;
    max-width: 100dvw;
    max-height: 100dvh;
    overflow: hidden;
  }

  body.kkr-game-running {
    touch-action: none;
  }

  #track_selection_wrapper .slick-list {
    padding: 0 100px !important;
  }

  #track_selection {
    max-width: 100%;
    padding: 0;
    width: 100%;
    height: 100%;
  }

  #track_selection .slick-current button .track_selection__border {
    opacity: 1;
  }

  #track_selection h2 {
    font-size: 3rem;
    margin: 10px 10px 0;
  }

  #track_selection h3 {
    margin-bottom: 15px;
    font-size: 2.143rem;
  }

  #track_selection button {
    font-size: 1.714rem;
  }

  #racer {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    overflow: hidden;
    display: none;
    z-index: 20;
  }

  /* body.ios #racer {
    padding-top: 60px;
  } */

  #canvas {
    /* Fill the fixed #racer; JS sets the drawing buffer from clientWidth/Height. */
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: none;
    left: 0;
    top: 0;
  }

  /* #start_screen .highscores {
    max-width: 75%;
  } */

  #hud #last_lap_notice {
    top: 5vw;
    font-size: 8vw;
  }

  #mobile_controls.show_controls {
    display: flex;
  }

  .mobile_controls__section {
    display: flex;
    padding: 0 16px 12px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    pointer-events: none;
    height: 55%;
    min-height: 220px;
  }

  .mobile_controls__section--steer {
    width: auto;
    min-width: 200px;
  }

  .mobile_controls__section--throttle {
    width: auto;
    min-width: 180px;
  }

  #mobile_controls .control {
    position: relative;
    width: 96px;
    height: 100%;
    min-height: 200px;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    user-select: none;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center bottom 8px;
    background-size: 72px auto;
    transition: opacity 0.1s ease-in-out;
  }

  #mobile_controls .control#left {
    background-image: url('../images/sprites/UI_BUTTON_LEFT.svg');
  }

  #mobile_controls .control#right {
    background-image: url('../images/sprites/UI_BUTTON_RIGHT.svg');
  }

  #mobile_controls .control#up {
    background-image: url('../images/sprites/UI_BUTTON_FORWARD.svg');
    background-size: 72px auto;
    background-position: center bottom 8px;
  }

  #mobile_controls .control#down {
    background-image: url('../images/sprites/UI_BUTTON_BRAKE.svg');
  }

  #mobile_controls .control.pressed {
    opacity: 0.7;
  }

  /* .mobile_controls__section:last-of-type .control:last-of-type {
    margin-bottom: 20px;
  } */

  /* body.ios {
    height: 100vh;
  }
  
  body.ios #canvas {
    height: 85%;
    width: 85%;
    left: 50%;
    transform: translateX(-50%);
  } */
  
  /* body.ios #track_selection {
      padding-top: 65px;
  } */
  
  /* body.ios #mobile_controls {
    bottom: 60px;
  } */
}

/* @media screen and (max-width: 1400px) { */
  #cabinet,
  #canvas {
    display: none;
  }

  #track_selection {
    z-index: 10;
    position: relative;
    /* width: calc(100vw - 55px); */
    width: 100%;
    height: 100%;
    background: transparent;
    top: 0;
    padding: 0;
  }

  /* #racer {
    top: -10px;
  } */
/* } */

@media screen and (max-height: 550px) {
  #block-kitkat-racing-main-menu ul.menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    gap: 2%;
    justify-content: space-between;
  }

  #block-kitkat-racing-main-menu .menu-item {
    padding-top: 0.2em;
    display: flex;
    flex-basis: 100%;
    flex: 46%;
  }

  #block-kitkat-racing-main-menu ul.menu li a {
    font-size: 1rem;
  }
}

@media screen and (min-width: 1399px) {
  .skid_source {
      display: none !important;
  }

  .end_screen__social {
    margin-top: 60px;
  }

  #share_image {
    max-height: 200px;
    width: auto;
  }
}

@media screen and (max-width: 1400px) {
  #cabinet,
  .keys {
  /* #bottom { */
    display: none !important;
  }

  #hud_bottom {
    bottom: 50%;
    transform: translateY(50%);
  }

  .start_screen__mobile_instructions {
    display: block;
    height: auto;
    padding: 0.5rem 10px 0;
    text-align: center;
  }

  #start_screen .start-race-btn {
    display: block;
  }

  /* #racer {
    top: 1px;
  } */
}

@media screen and (max-width: 1080px) {
  #track_selection button.slick-arrow {
      height: 60px;
      width: 60px;
  }
}

@media screen and (max-width: 920px) {
  #start_screen__leaderboard div > span:last-of-type {
    display: block;
  }
}

@media screen and (max-width: 600px) {
  #track_selection button {
    max-width: 300px;
  }
}

@media screen and (max-width: 540px) {
  .highscores {
    max-width: 75%;
  }
}

@media screen and (max-width: 440px) {
    #mobile_controls {
      height: 58%;
    }

    .mobile_controls__section {
      min-height: 200px;
      height: 100%;
      padding: 0 10px 10px;
    }

    .mobile_controls__section--steer {
      min-width: 170px;
    }

    .mobile_controls__section--throttle {
      min-width: 150px;
    }

    #mobile_controls .control {
      width: 84px;
      min-height: 180px;
      background-size: 64px auto;
    }

    #fast_lap_time {
      display: none !important;
    }

    #track_selection_wrapper .slick-list {
      padding: 0 50px !important;
    }

    #hud_bottom {
      display: none !important;
    }

    #race__main_menu {
      left: auto;
      right: -25px;
      top: 10px;
    }
}

@media screen and (max-width: 400px) {
  #hud .hud {
    font-size: 1.429rem;
  }
}

@media screen and (max-width: 360px) {
  .highscores {
    max-width: 100%;
  }

  #mute {
    left: -10px;
  }

  #tiltcontrols {
    right: 10px;
  }
}

@keyframes flash {
  0% {
    opacity: 1
  }
  49% {
    opacity: 1
  }
  50% {
    opacity: 0
  }
  99% {
    opacity: 0
  }
  100% {
    opacity: 1
  }
}

@keyframes flicker {
  0% {
    box-shadow: 0 0 15px var(--primary-color), 0 0 15px var(--primary-color) inset;
  }
  10% {
    box-shadow: 0 0 15px var(--primary-color), 0 0 15px var(--primary-color) inset;
  }
  11% {
    box-shadow: 0 0 10px var(--primary-color), 0 0 10px var(--primary-color) inset;
  }
  17% {
    box-shadow: 0 0 10px var(--primary-color), 0 0 10px var(--primary-color) inset;
  }
  18% {
    box-shadow: 0 0 10px var(--primary-color), 0 0 15px var(--primary-color) inset;
  }
  19% {
    box-shadow: 0 0 10px var(--primary-color), 0 0 15px var(--primary-color) inset;
  }
  20% {
    box-shadow: 0 0 15px var(--primary-color), 0 0 15px var(--primary-color) inset;
  }
  100% {
    box-shadow: 0 0 15px var(--primary-color), 0 0 15px var(--primary-color) inset;
  }
}

@keyframes textflicker {
  from {
    text-shadow: 1px 0 0 #ea36af, -2px 0 0 #75fa69;
  }
  to {
    text-shadow: 2px 0.5px 2px #ea36af, -1px -0.5px 2px #75fa69;
  }
}

@keyframes arrowmoveright {
  from {
    right: 0;
  }
  to {
    right: -10px;
  }
}

@keyframes arrowmoveleft {
  from {
    left: 0;
  }
  to {
    left: -10px;
  }
}

@keyframes dash {
  to {
    background-position: 100% 0%, 0% 100%, 0% 0%, 100% 100%;
  }
}