@-webkit-keyframes anim {
  0%   { -webkit-transform: translateY(10px) }
  50% { -webkit-transform: translateY(-10px) }
  100% { -webkit-transform: translateY(10px) }
}
@-moz-keyframes anim {
  0%   { -moz-transform: translateY(10px) }
  50% { -moz-transform: translateY(-10px) }
  100% { -moz-transform: translateY(10px) }
}
@-o-keyframes anim {
  0%   { -o-transform: translateY(10px) }
  50% { -o-transform: translateY(-10px) }
  100% { -o-transform: translateY(10px) }
}
@keyframes anim {
  0%   { transform: translateY(10px) }
  50% { transform: translateY(-10px) }
  100% { transform: translateY(10px) }
}

@-webkit-keyframes animbg {
  0%   { -webkit-transform: translateY(5px) }
  50% { -webkit-transform: translateY(-5px) }
  100% { -webkit-transform: translateY(5px) }
}
@-moz-keyframes animbg {
  0%   { -moz-transform: translateY(5px) }
  50% { -moz-transform: translateY(-5px) }
  100% { -moz-transform: translateY(5px) }
}
@-o-keyframes animbg {
  0%   { -o-transform: translateY(5px) }
  50% { -o-transform: translateY(-5px) }
  100% { -o-transform: translateY(5px) }
}
@keyframes animbg {
  0%   { transform: translateY(5px) }
  50% { transform: translateY(-5px) }
  100% { transform: translateY(5px) }
}

* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html, body {
  overflow: hidden;
  font-family: 'BebasNeueRegular', arial, sans-serif;
  background: #000;
}

@font-face {
  font-family: 'OdysseyJP';
  src: url('NotoSansJP-Subset.otf') format('opentype');
}

#step-1 {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5vh;
  padding: 2.5vh 4vw 3.5vh;
  box-sizing: border-box;
  z-index: 1;
}

#global {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(70,0,0,0.20) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.93) 100%), url('bg.jpg') no-repeat center center fixed;
  overflow: hidden;
  text-align: center;
  -moz-background-size: cover;
  -webkit-background-size: cover;
  -ms-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-animation: animbg 3s ease-in-out infinite;
  -moz-animation: animbg 3s ease-in-out infinite;
  -o-animation: animbg 3s ease-in-out infinite;
  animation: animbg 3s ease-in-out infinite;
}

#title {
  position: relative;
  z-index: 1;
  width: 100%;
  height: clamp(120px, 40vh, 340px);
  margin-top: 0;
  flex: 0 0 auto;
  background: url('title.png') no-repeat center center;
  -moz-background-size: contain;
  -webkit-background-size: contain;
  -ms-background-size: contain;
  -o-background-size: contain;
  background-size: contain;
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-animation: anim 3s ease-in-out infinite;
  -moz-animation: anim 3s ease-in-out infinite;
  -o-animation: anim 3s ease-in-out infinite;
  animation: anim 3s ease-in-out infinite;
}

#menucontainer {
  position: relative;
  width: 100%;
  margin-bottom: 1.5vh;
  flex: 0 0 auto;
  z-index: 2;
}

#menu {
  position: relative;
  display: block;
  width: 100%;
  max-width: 600px;
  margin: auto;
  text-align: center;
  font-size: clamp(1.0em, 4.5vw, 2em);
  font-family: 'BebasNeueRegular', arial, sans-serif;
  text-transform: uppercase;
  color: #b9bfca;
}

/* Secondary menu items (settings) — quiet silver, no white glow/bars */
#menu div {
  padding: 0.12em 0 0 0;
  margin: 0;
  cursor: pointer;
  color: #8a909c;
  letter-spacing: 0.10em;
  font-size: 0.72em;
  transition: color 0.18s ease, text-shadow 0.18s ease, transform 0.18s ease;
  transform: scaleY(0.92);
}

#menu div:hover {
  color: #ff3a3a;
  text-shadow: 0 0 22px rgba(255,40,40,0.85);
  transform: scaleY(1.04);
}

/* START — the hero action: big, bright red, glowing */
#start {
  font-size: 1.9em;
  color: #ff2424;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-shadow: 0 0 28px rgba(255,28,28,0.75);
  margin-bottom: 0.28em;
  padding-bottom: 0.18em;
  border-bottom: 2px solid rgba(255,36,36,0.28);
}

#start:hover {
  color: #ff6a6a !important;
  text-shadow: 0 0 38px rgba(255,60,60,0.95) !important;
  transform: scaleY(1.06);
}

/* オデッセイ · JAY PHAROAH tagline above the menu */
#tagline {
  position: relative;
  margin-top: 0;
  margin-bottom: 0.4vh;
  flex: 0 0 auto;
  z-index: 2;
  text-align: center;
  color: #9aa0ab;
  font-family: 'BebasNeueRegular', arial, sans-serif;
  letter-spacing: 0.42em;
  font-size: clamp(0.7em, 2.4vw, 1.05em);
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255,40,40,0.35);
}

/* Small / embedded windows — keep everything clear of each other */
@media (max-height: 540px) {
  #title { height: clamp(48px, 20vh, 120px); margin-top: 0.6vh; }
  #menu { font-size: clamp(0.85em, 3.4vw, 1.35em); }
  #tagline { margin-bottom: 0.6vh; letter-spacing: 0.3em; }
  #step-1 { padding: 1.5vh 4vw 2vh; }
}
@media (max-width: 480px) {
  #tagline { letter-spacing: 0.25em; }
}
#tagline .jp {
  font-family: 'OdysseyJP', sans-serif;
  color: #d6dae2;
  letter-spacing: 0.18em;
  margin-right: 0.5em;
}

#step-2 {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: black;
  vertical-align: bottom;
  text-align: center;
  padding: 20px;
  color: white;
  font-size: 2em;
  background-repeat: no-repeat;
  background-position: center center;
  -moz-background-size: 60% auto;
  -webkit-background-size: 60% auto;
  -ms-background-size: 60% auto;
  -o-background-size: 60% auto;
  background-size: 60% auto;
}

#step-3 {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: black;
}

#step-3 #progressbar {
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 0%;
  background: white;
}

#step-5 {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: black;
  text-align: center;
  padding: 100px 20px;
  color: white;
  font-size: 2em;
}

#step-5 #time {
  font-size: 4em
}

#leapinfo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0,0,0,0.8);
  color: white;
  text-align: center;
  font-size: 3em;
  padding-top: 200px;
  z-index: 999999;
}

#credits {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  background: black;
  overflow-y: auto;
  text-align: center;
  color: white;
  font-size: 1.1em;
  padding: 40px 20px;
}

#credits h3 {
  font-size: 2em;
  color: #ff3535;
  letter-spacing: 0.1em;
}

#credits b {
  font-size: 1.2em;
  color: #cdd2db;
}

#credits h4 {
  color: #8a909c;
  font-size: 1.2em;
}

/* Race-progress minimap */
#minimap-box {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10000;
  text-align: center;
  pointer-events: none;
}
#minimap-label {
  font-family: 'BebasNeueRegular', arial, sans-serif;
  letter-spacing: 0.2em;
  font-size: 0.78em;
  color: #cdd2db;
  text-shadow: 0 0 10px rgba(255,40,40,0.5);
  margin-bottom: 5px;
}
#minimap {
  width: 180px !important;
  height: 180px !important;
  background: rgba(0,0,0,0.5);
  border: 2px solid rgba(255,36,36,0.6);
  border-radius: 6px;
  box-shadow: 0 0 22px rgba(255,30,30,0.28);
}
/* Smaller lap-position minimap on phones */
@media (max-width: 768px) {
  #minimap-box { top: 10px; right: 10px; }
  #minimap { width: 92px !important; height: 92px !important; border-width: 1px; }
  #minimap-label { font-size: 0.58em; margin-bottom: 2px; }
}
