@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700;800&display=swap');



/* --------------------------------------------------
   GLOBAL PAGE STYLE (Prototype Accurate)
-------------------------------------------------- */
body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    font-family: 'Orbitron', sans-serif;
    color: white;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
}

/* --------------------------------------------------
   HARD GAME COVER — NO FLASH GUARANTEE
-------------------------------------------------- */
#game-cover {
    position: fixed;
    inset: 0;
    z-index: 48;
    background: #000;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#game-cover.hidden {
    opacity: 0;
}

/* --------------------------------------------------
   HUD — Score
-------------------------------------------------- */
#scoreDisplay {
    position: fixed;
    top: 14px;
    left: 20px;
    z-index: 40;
    color: #8fd3e8;
    font-size: 20px;
    font-weight: 600;
    text-shadow:
        0 0 10px #8fd3e8,
        0 0 20px #66ccff;
    pointer-events: none;
}

/* --------------------------------------------------
   Fade Overlay
-------------------------------------------------- */
#fadeOverlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(10,15,25,1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* --------------------------------------------------
   GAME OVER PANEL
-------------------------------------------------- */
#gameover {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 46;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    color: #8fd3e8;
    text-shadow:
        0 0 14px #8fd3e8,
        0 0 30px #66ccff;
    font-size: 24px;
}

#go-score {
    margin-top: 12px;
    font-size: 22px;
}

/* --------------------------------------------------
   SPLASH SCREEN
-------------------------------------------------- */
#splash {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: black;
    opacity: 1;
    transition: opacity 0.8s ease;
}

#logo {
    width: 220px;
    height: auto;
    filter: brightness(0) invert(1);
    clip-path: inset(0 100% 0 0);
}

@keyframes fillLogo {
    to { clip-path: inset(0 0 0 0); }
}

#loading-text {
    color: white;
    margin-top: 15px;
    font-size: 16px;
    opacity: 0.85;
}

/* ==================================================
   START SCREEN
================================================== */
#start-screen {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: radial-gradient(circle at center, #050505 0%, #000 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

#start-screen.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ==================================================
   START SCREEN – CUBE BACKGROUND
================================================== */

.cube-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    perspective: 900px;
}






.cube:nth-child(4n + 1) { color: #00f6ff; }
.cube:nth-child(4n + 2) { color: #ff2fb2; }
.cube:nth-child(4n + 3) { color: #00ffaa; }
.cube:nth-child(4n)     { color: #f8e807; }

.cube:nth-child(odd) {
    animation-duration: 22s, 9s;
}

.cube:nth-child(even) {
    animation-duration: 16s, 5s;
}


/* ================================
   RESTART TRANSITION
================================ */

#restart-transition {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#restart-transition.hidden {
  display: none;
}

.rt-logo {
  width: 180px;
  /* filter: brightness(0) invert(1); */
}
.rt-slogo {
  width: 18px;
  /* filter: brightness(0) invert(1); */
}
.rt-logo-mask {
  width: 180px;
  overflow: hidden;

  /* splash-style mask */
  clip-path: inset(0 100% 0 0);
  animation: rtLogoReveal 1.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}
.rt-text {
  margin-top: 18px;
  font-size: 24px;
  letter-spacing: 10px;
  color: #fff;

  /* splash-style reveal */
  clip-path: inset(0 100% 0 0);
  animation: rtTextReveal 1.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
  animation-delay: 0.6s;
}
.rt-logo-wrap {
  overflow: hidden;
  width: 140px;
}
@keyframes rtLogoReveal {
  to { clip-path: inset(0 0 0 0); }
}
@keyframes rtTextReveal {
  to { clip-path: inset(0 0 0 0); }
}




/* ===============================
   TRUE 3D CUBES (REQUIRED)
================================ */

.cube-layer {
    perspective: 1200px;
    opacity: 0.5;
}

.cube {
    width: 26px;
    height: 26px;
    position: absolute;
    transform-style: preserve-3d;
    animation: cubeRotate 6s linear infinite;
    
}

 .face {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 2px solid currentColor;
     box-shadow:
        0 0 10px currentColor,
        0 0 20px currentColor; 
    background: rgba(255,255,255,0.02);
} 

/* 6 faces */
.face.front  { transform: translateZ(13px); }
.face.back   { transform: rotateY(180deg) translateZ(13px); }

.face.right  { transform: rotateY(90deg)  translateZ(13px); }
.face.left   { transform: rotateY(-90deg) translateZ(13px); }

.face.top    { transform: rotateX(90deg)  translateZ(13px); }
.face.bottom { transform: rotateX(-90deg) translateZ(13px); }

@keyframes cubeRotate {
    from { transform: rotateX(0deg) rotateY(0deg); }
    to   { transform: rotateX(360deg) rotateY(360deg); }
}

.face {
    backface-visibility: hidden;
}


/* Content */
.start-inner {
    position: relative;
    z-index: 3;
    text-align: center;
    animation: startFloat 1.6s ease-out forwards;
}

@keyframes startFloat {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 68px;
    font-weight: 800;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: transparent;                    /* ❌ no fill */
    -webkit-text-stroke: 2px #00f6ff;      /* ✅ outline */
    text-shadow:
        0 0 8px rgba(0, 200, 255, 0.6),
        0 0 18px rgba(0, 160, 255, 0.5),
        0 0 32px rgba(0, 120, 255, 0.4);

    animation:
        titleGlow 2.6s ease-in-out infinite,
        titleFloat 4s ease-in-out infinite;

}


@keyframes titleGlow {
    0%, 100% {
        text-shadow:
            0 0 8px rgba(0, 200, 255, 0.4),
            0 0 18px rgba(0, 120, 255, 0.35);
    }
    50% {
        text-shadow:
            0 0 14px rgba(0, 220, 255, 0.7),
            0 0 28px rgba(0, 140, 255, 0.6);
    }
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.game-subtitle {
    margin-top: -5px;
    font-size: 14px;
    letter-spacing: 15px;
    transform: scaleY(1.5);
    text-transform: uppercase;
        color: transparent;                    /* ❌ no fill */
    -webkit-text-stroke: 2px #a741a0;      /* ✅ outline */
}

.start-buttons {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.primary-btn,
.secondary-btn {
    padding: 14px 32px;
    font-size: 15px;
    letter-spacing: 2px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
}

.primary-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    border: none;
    color: #fff;
}

.primary-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.35),
        transparent
    );
    transform: translateX(-120%);
}

.primary-btn:hover::after {
    animation: btnSweep 0.8s ease forwards;
}

@keyframes btnSweep {
    to { transform: translateX(120%); }
}

.primary-btn:active {
    transform: scale(0.96);
}

.secondary-btn {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
}

.secondary-btn:hover {
    border-color: #00c6ff;
    color: #fff;
    box-shadow:
        0 0 8px rgba(0, 200, 255, 0.4),
        0 0 18px rgba(0, 120, 255, 0.3);
}

/* ==================================================
   HOW TO PLAY OVERLAY
================================================== */
#how-to-play {
    position: fixed;
    inset: 0;
    z-index: 51;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#how-to-play.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ==================================================
   TRANSITION FLASH — CINEMATIC TEXT ONLY
================================================== */

#transition-flash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
}

#transition-flash.active {
    opacity: 1;
}

/* Base state (hidden) */
.transition-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #fff;
    -webkit-text-stroke: 2px #ffffff;
    animation: transitionText 2.2s ease forwards;
}



@keyframes transitionText {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}





/* --------------------------------------------------
   MOBILE OPTIMIZATION
-------------------------------------------------- */
@media(max-width:600px){
    #logo { width:160px; }
    #gameover { font-size:28px; }
    #scoreDisplay { font-size:16px; }
    .game-title { font-size: 2.6rem; }
}

.hold-instruction {
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.8;
    /* color: transparent;                    ❌ no fill */
    -webkit-text-stroke: 2px #f8e807;      /* ✅ outline */
}

.hold-progress {
    width: 260px;
    height: 8px;
    border: 1px solid #fff;
    margin: 12px auto;
    overflow: hidden;
}

.hold-progress-fill {
    height: 100%;
    width: 0%;
    background: #00f6ff;
}
/* ===== HOLD TO START (BIG CTA) ===== */

.hold-wrapper {
    margin-top: 40px;
    text-align: center;
}

.hold-instruction {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 6px;
}

.hold-sub {
    font-size: 14px;
    opacity: 0.7;
    letter-spacing: 2px;
    margin-bottom: 18px;
}

/* ===== PROGRESS BAR ===== */

.hold-progress {
    position: relative;
    width: 420px;
    height: 30px;
    border: 2px solid #ffffff;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
}

.hold-progress-fill {
    position: relative;
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        #dac405,
        #eff148
    );
    transition: width 0.05s linear;
}

/* Score Reverse Delta */
#deltaDisplay {
    position: fixed;
    top: 44px;
    left: 20px;
    font-size: 14px;
    letter-spacing: 2.5px;
    color: #aaa;
    z-index: 40;
}

#deltaDisplay.new-high {
    color: #00ffaa;
    font-weight: 700;
    text-shadow:
        0 0 10px rgba(0,255,170,0.7),
        0 0 20px rgba(0,255,170,0.4);
}

/*Player details */
.player-name {
    margin-top: 14px;
    font-size: 34px;
    letter-spacing: 4.5px;
    color: #58cf40;
    text-transform: uppercase;
    /* opacity: 0.8; */
    -webkit-text-stroke: 2px #58cf40;      /* ✅ outline */
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    color: transparent;                    /* ❌ no fill */
    text-shadow:
        0 0 8px rgba(98, 223, 16, 0.6),
        0 0 18px rgba(0, 160, 255, 0.5),
        0 0 32px rgba(0, 120, 255, 0.4);
}

#editNameBtn {
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.7;
}

#editNameBtn:hover {
    opacity: 1;
    color: #00ffaa;
}
.player-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #00ffaa;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    letter-spacing: 2px;
    outline: none;
    width: 180px;
    text-align: center;
}

/* Leaderboard Structure */
.lb-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.lb-modal.visible {
    display: flex;
}

.lb-modal-content {
    background: #000;
    padding: 24px;
    border-radius: 10px;
    min-width: 280px;
}

.lb-close {
    float: right;
    cursor: pointer;
    opacity: 0.7;
}
.lb-title {
    margin-bottom: 14px;
    font-size: 16px;
    letter-spacing: 2px;
    color: #00ffaa;
    text-align: center;
}
.lb-row {
    padding: 6px 4px;
    font-size: 15px;
    letter-spacing: 1.4px;
    color: #e6e6e6;
    font-family: 'Orbitron', sans-serif;
    text-align: left;
    opacity: 0.95;
}
.lb-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lb-row:nth-child(2)::before {
    content: "🥇 ";
}

.lb-row:nth-child(3)::before {
    content: "🥈 ";
}

.lb-row:nth-child(4)::before {
    content: "🥉 ";
}
.lb-row.highlight {
    color: #00ffaa;
    font-weight: 700;
    animation: newEntryGlow 1.4s ease-in-out infinite;
}
@keyframes newEntryGlow {
    0% {
        text-shadow: 0 0 6px rgba(0, 255, 170, 0.4);
    }
    50% {
        text-shadow:
            0 0 12px rgba(0, 255, 170, 0.9),
            0 0 22px rgba(0, 255, 170, 0.6);
    }
    100% {
        text-shadow: 0 0 6px rgba(0, 255, 170, 0.4);
    }
}
#leaderboard-btn {
    margin-top: 10px;
}
/* Hide buttons while holding SPACE */
#start-screen.holding .secondary-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.secondary-btn {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#gameover-leaderboard .lb-row {
    font-size: 14px;
}
/* Background design */
#void-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* below HUD, above game */
}
/* Mobile Optimizations */
#rotate-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

#rotate-overlay.active {
  display: flex;
}

.rotate-inner {
  text-align: center;
  color: #00ffd5;
  font-family: monospace;
}

.rotate-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: rotateHint 1.5s ease-in-out infinite;
}

.rotate-text {
  font-size: 18px;
  opacity: 0.9;
}

@keyframes rotateHint {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}
body {
  touch-action: none;
  overscroll-behavior: none;
}

/* ===== BIKE INDICATOR ===== */

.bike-indicator {
    position: absolute;
    right: -48px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;          
    height: auto;
    pointer-events: none;
    animation: bikePulse 1.6s ease-in-out infinite;

}

@keyframes bikePulse {
    0% {
        filter: drop-shadow(0 0 6px rgba(255, 140, 0, 0.6))
                drop-shadow(0 0 12px rgba(255, 100, 0, 0.4));
        transform: translateY(-50%) scale(1);
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(255, 170, 0, 0.9))
                drop-shadow(0 0 20px rgba(255, 120, 0, 0.7));
        transform: translateY(-50%) scale(1.05);
    }
    100% {
        filter: drop-shadow(0 0 6px rgba(255, 140, 0, 0.6))
                drop-shadow(0 0 12px rgba(255, 100, 0, 0.4));
        transform: translateY(-50%) scale(1);
    }
}


/* ===============================
   CINEMATIC TRANSITION SCREEN
=============================== */

#transition-flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}

#transition-flash.active {
  opacity: 1;
}

.transition-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 42px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 2px #00f6ff;
  text-shadow:
    0 0 12px rgba(0, 200, 255, 0.6),
    0 0 24px rgba(0, 200, 255, 0.4);
  clip-path: inset(0 100% 0 0);
  animation: transitionReveal 2.2s ease forwards;
}

@keyframes transitionReveal {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  70% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 0;
  }
}

