/* ================================
   ORBIT RUSH 3D — style.css
   Font: Orbitron Bold 700/900
   MAPI GAMES
   ================================ */

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

body {
  background: #03030c;
  overflow: hidden;
  font-family: 'Orbitron', 'Arial Black', sans-serif;
  user-select: none;
}

#gameCanvas { position:fixed; top:0; left:0; display:block; }

/* ── Death flash ── */
#deathFlash {
  position: fixed; inset: 0;
  background: #ff0033;
  opacity: 0; pointer-events: none;
  z-index: 20;
  transition: opacity 1.0s ease-out;
}

/* ── UI root ── */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

/* ════════════════════════════════
   SPLASH SCREEN
   ════════════════════════════════ */
#splashScreen {
  position: fixed; inset: 0;
  background: #03030c;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity 0.7s ease-out;
}

.splashTitle {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(52px, 14vw, 110px);
  font-weight: 900;
  color: #e5eeff;
  text-align: center;
  line-height: 1.0;
  letter-spacing: 6px;
  text-shadow:
    0 0 22px rgba(130,170,255,1),
    0 0 55px rgba(80,120,255,0.7);
}

.splashAccent {
  color: #5599ff;
  text-shadow: 0 0 18px rgba(80,150,255,1), 0 0 44px rgba(60,120,255,0.85);
}

.splashSub {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(13px, 3.5vw, 22px);
  font-weight: 700;
  color: #2a3a70;
  letter-spacing: 14px;
}

.splashBarWrap {
  width: clamp(180px, 50vw, 320px);
  height: 5px;
  background: rgba(80,100,200,0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 24px;
}

#splashBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2244ee, #88aaff);
  border-radius: 10px;
  transition: width 0.12s linear;
  box-shadow: 0 0 10px #4466ff;
}

.splashLoading {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(9px, 2vw, 12px);
  font-weight: 700;
  color: rgba(130,160,255,0.4);
  letter-spacing: 5px;
}

.splashBrand {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(9px, 1.8vw, 11px);
  font-weight: 700;
  color: rgba(200, 40, 40, 0.55);
  letter-spacing: 5px;
  margin-top: 10px;
}

/* ════════════════════════════════
   IN-GAME SCORE
   ════════════════════════════════ */
#scoreDisplay {
  position: absolute;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(40px, 10vw, 72px);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 6px;
  text-shadow:
    0 0 10px rgba(130,180,255,1),
    0 0 28px rgba(80,130,255,0.8);
  white-space: nowrap;
}

/* ════════════════════════════════
   PAUSE OVERLAY
   ════════════════════════════════ */
#pauseOverlay {
  position: absolute; inset: 0;
  background: rgba(2,2,14,0.78);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
}

.pauseTitle {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(44px, 12vw, 86px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 8px;
  text-shadow: 0 0 22px rgba(120,160,255,0.9), 0 0 55px rgba(80,120,255,0.5);
}

.pauseSub {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(10px, 2.8vw, 16px);
  font-weight: 700;
  color: rgba(160,190,255,0.45);
  letter-spacing: 3px;
}

/* ════════════════════════════════
   MENU SCREEN
   ════════════════════════════════ */
#menuScreen {
  position: absolute; inset: 0;
  background: rgba(3,4,18,0.62);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6% 0 5%;
}

.menuTitle { text-align: center; }

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(36px, 10vw, 78px);
  font-weight: 900;
  color: #e5eeff;
  letter-spacing: 5px;
  text-shadow:
    0 0 18px rgba(140,180,255,1),
    0 0 45px rgba(90,130,255,0.7);
}

.titleAccent {
  color: #5599ff;
  text-shadow: 0 0 16px rgba(80,160,255,1), 0 0 40px rgba(60,130,255,0.85);
}

.edition {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(11px, 2.8vw, 18px);
  font-weight: 700;
  color: #2a3a70;
  letter-spacing: 12px;
  margin-top: 4px;
}

/* ── Skin selector ── */
#skinSelector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  /* vertically centered between title and bottom buttons */
}

#skinName {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(11px, 3vw, 18px);
  font-weight: 900;
  color: rgba(170,210,255,0.50);
  letter-spacing: 5px;
  text-shadow: 0 0 8px rgba(100,170,255,0.3);
}

#skinDots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.skinDot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(80,110,200,0.22);
  border: 1px solid rgba(100,140,255,0.35);
  transition: background 0.18s, box-shadow 0.18s;
}
.skinDot.active {
  background: #4488ff;
  border-color: #88bbff;
  box-shadow: 0 0 6px #2266ee;
}

/* Arrow row — close together, centered */
.skinArrowRow {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.skinArrow {
  font-family: 'Orbitron', sans-serif;
  width:  clamp(46px, 12vw, 62px);
  height: clamp(46px, 12vw, 62px);
  border-radius: 50%;
  background: rgba(30,50,180,0.16);
  border: 2px solid rgba(110,150,255,0.38);
  color: rgba(170,210,255,0.70);
  font-size: clamp(14px, 4.5vw, 22px);
  cursor: pointer; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.skinArrow:active { background: rgba(80,130,255,0.40); color:#fff; }

/* ── Bottom block ── */
.menuBottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  width: 100%;
}

.hint {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(8px, 1.8vw, 11px);
  font-weight: 700;
  color: rgba(130,165,255,0.30);
  letter-spacing: 1px;
  text-align: center;
}

.brandLabel {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(9px, 2vw, 12px);
  font-weight: 900;
  color: #cc2222;
  letter-spacing: 5px;
  text-shadow: 0 0 10px rgba(200,30,30,0.5);
  margin-top: 4px;
}

/* ════════════════════════════════
   HOW TO PLAY SCREEN
   ════════════════════════════════ */
#howToScreen {
  position: absolute; inset: 0;
  background: rgba(3,4,18,0.92);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5% 5% 3%;
  gap: 10px;
  pointer-events: all;
  overflow: hidden;
}

#htpList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  overflow-y: scroll;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(80,110,255,0.4) transparent;
}

.htpTitle {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(20px, 5.5vw, 36px);
  font-weight: 900;
  color: #e5eeff;
  letter-spacing: 5px;
  text-shadow: 0 0 18px rgba(120,160,255,0.8);
  flex-shrink: 0;
}

.htpSection {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(8px, 2vw, 11px);
  font-weight: 900;
  color: rgba(100,140,255,0.45);
  letter-spacing: 6px;
  padding: 4px 4px 2px;
  border-bottom: 1px solid rgba(80,110,200,0.18);
  margin-top: 4px;
}

.htpBlock {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: rgba(20,30,80,0.35);
  border: 1px solid rgba(80,110,200,0.18);
  border-radius: 12px;
  padding: 9px 14px;
  flex-shrink: 0;
}

.htpIcon {
  font-size: clamp(16px, 4.5vw, 24px);
  min-width: 40px;
  text-align: center;
  color: #88aaff;
}

/* Power-up icons in HTP */
.htpPU {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(11px, 3vw, 16px);
  font-weight: 900;
  min-width: 40px;
  text-align: center;
  border-radius: 8px;
  padding: 4px 6px;
}
.htpPU.pu-x2   { color: #ffdd00; background: rgba(255,200,0,0.12);  border: 1px solid rgba(255,200,0,0.30); }
.htpPU.pu-inv  { color: #00eeff; background: rgba(0,200,255,0.12);  border: 1px solid rgba(0,200,255,0.30); }
.htpPU.pu-slow { color: #ff8800; background: rgba(255,130,0,0.12);  border: 1px solid rgba(255,130,0,0.30); }
.htpGem { color: #ff66ee; }

.htpText {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(8px, 2.1vw, 11.5px);
  font-weight: 700;
  color: rgba(200,215,255,0.72);
  line-height: 1.65;
  letter-spacing: 0.4px;
}

.htpText b { color: #88bbff; }
.htpTouchOnly { display: none; }

@media (pointer: coarse) {
  .htpTouchOnly { display: flex; }
}


/* ════════════════════════════════
   GAME OVER SCREEN
   ════════════════════════════════ */
#gameOverScreen {
  position: absolute; inset: 0;
  background: rgba(3,4,18,0.72);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.goTitle {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(34px, 10vw, 68px);
  font-weight: 900;
  color: #ff1144;
  letter-spacing: 5px;
  text-align: center;
  line-height: 1.0;
  text-shadow: 0 0 18px rgba(255,20,60,0.9), 0 0 44px rgba(255,20,60,0.55);
}

.goScoreBlock { text-align: center; }

.goLabel {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(11px, 2.8vw, 16px);
  font-weight: 700;
  color: rgba(150,190,255,0.45);
  letter-spacing: 5px;
}

.goValue {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(60px, 15vw, 108px);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 5px;
  line-height: 1.0;
  text-shadow: 0 0 18px rgba(120,170,255,0.9), 0 0 44px rgba(80,130,255,0.6);
}

.goBestBlock { text-align: center; margin-top: -8px; }

.goLabelSm {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(10px, 2.2vw, 13px);
  font-weight: 700;
  color: rgba(130,170,255,0.38);
  letter-spacing: 5px;
}

.goValueSm {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(22px, 6vw, 40px);
  font-weight: 900;
  color: rgba(130,185,255,0.65);
  letter-spacing: 4px;
  text-shadow: 0 0 12px rgba(80,140,255,0.45);
}

/* ════════════════════════════════
   SHARED BUTTONS
   ════════════════════════════════ */
.bigBtn {
  font-family: 'Orbitron', sans-serif;
  background: linear-gradient(135deg, #1833ee 0%, #6611bb 100%);
  color: #ffffff;
  border: 2px solid rgba(140,165,255,0.28);
  padding: 14px 50px;
  font-size: clamp(14px, 3.8vw, 22px);
  font-weight: 900;
  letter-spacing: 4px;
  border-radius: 60px;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 0 22px rgba(50,70,255,0.55), 0 6px 18px rgba(0,0,0,0.55);
  transition: transform 0.1s, box-shadow 0.12s;
}
.bigBtn:hover  { transform: scale(1.05); box-shadow: 0 0 38px rgba(80,110,255,0.85), 0 6px 18px rgba(0,0,0,0.5); }
.bigBtn:active { transform: scale(0.95); }

.btnSecondary {
  background: transparent;
  border: 2px solid rgba(140,165,255,0.28);
  color: rgba(180,200,255,0.60);
  box-shadow: none;
  font-size: clamp(11px, 2.8vw, 16px);
  padding: 10px 40px;
}
.btnSecondary:hover  { background: rgba(60,80,200,0.16); box-shadow: 0 0 18px rgba(80,110,255,0.30); color: #fff; }
.btnSecondary:active { transform: scale(0.95); }

/* ════════════════════════════════
   MOBILE CONTROLS
   ════════════════════════════════ */
#mobileControls {
  position: absolute;
  bottom: 24px; left: 0; width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 28px;
  pointer-events: none;
  z-index: 50;   /* above canvas and all overlays */
}

.ctrlBtn {
  font-family: 'Orbitron', sans-serif;
  width:  clamp(90px, 22vw, 120px);
  height: clamp(90px, 22vw, 120px);
  border-radius: 50%;
  background: rgba(30,55,190,0.22);
  border: 2.5px solid rgba(100,145,255,0.50);
  color: rgba(200,220,255,0.80);
  font-size: clamp(28px, 7vw, 40px);
  cursor: pointer;
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.08s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;   /* prevent scroll interference */
  user-select: none;
}
.ctrlBtn:active { background: rgba(70,120,255,0.50); color:#fff; transform: scale(0.92); }

/* ════════════════════════════════
   FULLSCREEN TAP ZONES
   ════════════════════════════════ */
#tapLeft, #tapRight {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  pointer-events: none;   /* enabled only during gameplay by JS */
  z-index: 8;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#tapLeft  { left: 0; }
#tapRight { right: 0; }

/* ── Mute button ── */
#muteBtn {
  position: absolute;
  top: 14px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(20,30,80,0.55);
  border: 1.5px solid rgba(100,140,255,0.30);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  pointer-events: all;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.1s;
}
#muteBtn:hover  { background: rgba(50,70,180,0.55); }
#muteBtn:active { transform: scale(0.90); }

   ════════════════════════════════ */
#gemInGame {
  position: absolute;
  top: 18px; left: 18px;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(13px, 3.5vw, 20px);
  font-weight: 900;
  color: #ff66ee;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255,80,220,0.8);
}

/* ════════════════════════════════
   MILESTONE POPUP
   ════════════════════════════════ */
#milestonePopup {
  position: absolute;
  top: 22%; left: 50%;
  transform: translateX(-50%) scale(1);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(16px, 5vw, 28px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 5px;
  text-shadow: 0 0 18px rgba(255,200,80,1), 0 0 40px rgba(255,160,0,0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  white-space: nowrap;
}

/* ════════════════════════════════
   ACHIEVEMENT POPUP
   ════════════════════════════════ */
#achPopup {
  position: absolute;
  bottom: 110px; left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(10,12,35,0.92);
  border: 1.5px solid rgba(120,160,255,0.35);
  border-radius: 16px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(80,100,255,0.4);
  min-width: 240px;
  max-width: 88vw;
}

#achIcon {
  font-size: clamp(24px, 6vw, 34px);
  flex-shrink: 0;
}

.achText { display: flex; flex-direction: column; gap: 2px; }

#achLabel {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(10px, 2.8vw, 14px);
  font-weight: 900;
  color: #ffcc44;
  letter-spacing: 3px;
}

#achDesc {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(8px, 2vw, 11px);
  font-weight: 700;
  color: rgba(180,200,255,0.55);
  letter-spacing: 1px;
}

/* ════════════════════════════════
   MENU STATS (BEST + GEMS)
   ════════════════════════════════ */
.menuStats {
  display: flex;
  gap: 32px;
  justify-content: center;
}

.menuStat { text-align: center; }

.menuStatLabel {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(9px, 2vw, 12px);
  font-weight: 700;
  color: rgba(130,160,255,0.40);
  letter-spacing: 4px;
}

.menuStatVal {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(22px, 6vw, 38px);
  font-weight: 900;
  color: #ccdeff;
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(100,150,255,0.5);
}

.gemColor { color: #ff66ee; text-shadow: 0 0 12px rgba(255,80,220,0.5); }

/* Menu secondary row */
.menuSecondaryRow {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  pointer-events: all;
}

/* ════════════════════════════════
   ACHIEVEMENTS SCREEN
   ════════════════════════════════ */
#achScreen {
  position: absolute; inset: 0;
  background: rgba(3,4,18,0.92);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5% 5% 4%;
  gap: 6px;
  overflow-y: hidden;   /* parent does NOT scroll */
  pointer-events: all;  /* capture mouse wheel */
}

#achList {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  max-width: 420px;
  overflow-y: scroll;          /* always show scrollbar */
  flex: 1;                     /* fill remaining height */
  min-height: 0;               /* flex child shrink fix */
  padding-right: 4px;
  pointer-events: all;
  -webkit-overflow-scrolling: touch;  /* smooth on iOS */
  scrollbar-width: thin;
  scrollbar-color: rgba(80,110,255,0.4) transparent;
}

.achRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(80,110,200,0.18);
  background: rgba(14,20,55,0.40);
}

.achRow.unlocked {
  border-color: rgba(255,200,60,0.35);
  background: rgba(30,25,8,0.45);
}

.achRowIcon {
  font-size: clamp(18px, 5vw, 24px);
  flex-shrink: 0;
  filter: grayscale(1);
  opacity: 0.35;
}
.achRow.unlocked .achRowIcon { filter: none; opacity: 1; }

.achRowText { flex: 1; }

.achRowLabel {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(9px, 2.4vw, 13px);
  font-weight: 900;
  color: rgba(160,180,255,0.45);
  letter-spacing: 2px;
}
.achRow.unlocked .achRowLabel { color: #ffcc44; }

.achRowDesc {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(7.5px, 1.8vw, 10px);
  font-weight: 700;
  color: rgba(130,155,220,0.35);
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.achRow.unlocked .achRowDesc { color: rgba(200,215,255,0.55); }

.achRowBadge {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(7px, 1.8vw, 10px);
  font-weight: 900;
  color: #ffcc44;
  letter-spacing: 1px;
  display: none;
}
.achRow.unlocked .achRowBadge { display: block; }

/* ════════════════════════════════
   POWER-UP POPUP
   ════════════════════════════════ */
.puPopup {
  position: absolute;
  top: 18%; left: 50%;
  transform: translateX(-50%) scale(1);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(15px, 4.5vw, 24px);
  font-weight: 900;
  letter-spacing: 4px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 0 18px currentColor;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.pu-x2   { color: #ffdd00; }
.pu-inv  { color: #00eeff; }
.pu-slow { color: #ff8800; }

/* ════════════════════════════════
   POWER-UP BARS
   ════════════════════════════════ */
#puBars {
  position: absolute;
  bottom: 135px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  min-width: 160px;
}

.puBarItem {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.puBarItem span {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(8px, 2.2vw, 11px);
  font-weight: 900;
  letter-spacing: 2px;
  min-width: 52px;
  text-align: right;
}

.puBarItem.pu-x2   span { color: #ffdd00; }
.puBarItem.pu-inv  span { color: #00eeff; }
.puBarItem.pu-slow span { color: #ff8800; }

.puBarTrack {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.10);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}

.puBarFill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.1s linear;
}

.pu-x2   .puBarFill { background: #ffdd00; box-shadow: 0 0 6px #ffaa00; }
.pu-inv  .puBarFill { background: #00eeff; box-shadow: 0 0 6px #0088cc; }
.pu-slow .puBarFill { background: #ff8800; box-shadow: 0 0 6px #cc4400; }
