*{box-sizing:border-box} html,body{margin:0;height:100%;background:#060712;color:#dbeafe;font-family:Inter,system-ui,Segoe UI,Arial}
#game{display:block;width:100vw;height:100vh}
#ui{position:fixed;left:0;top:0;width:100%;display:flex;gap:12px;align-items:center;justify-content:space-between;padding:10px 14px;pointer-events:none}
#score{font-weight:800;font-size:26px;letter-spacing:1px;text-shadow:0 0 8px rgba(0,229,255,.5)}
#combo{font-weight:700;font-size:14px;border:1px solid #273a5a;border-radius:999px;padding:4px 10px;background:rgba(14,30,52,.45);box-shadow:inset 0 0 12px rgba(0,229,255,.15)}
#tips{opacity:.7;font-size:12px}

/* Mobile/portrait adjustments.  On narrow screens or portrait
   orientation, the site's header overlaps the HUD.  Lower the HUD
   slightly to ensure score and tips remain visible. */
@media (max-width: 700px), (orientation: portrait){
  #ui{ top: 50px; }
}
#overlay{position:fixed;inset:0;background:radial-gradient(1200px 800px at 50% 40%,rgba(0,229,255,.07),rgba(0,0,0,.86));display:none;align-items:center;justify-content:center}
#overlay.show{display:flex}
.panel{background:rgba(10,16,28,.8);border:1px solid #19324f;border-radius:18px;padding:28px 26px;box-shadow:0 8px 40px rgba(0,0,0,.5),0 0 40px rgba(0,229,255,.12)}
.panel h1{margin:0 0 12px;font-size:42px;letter-spacing:.06em;text-shadow:0 0 30px rgba(0,229,255,.35)}
.panel p{margin:0 0 16px;opacity:.9}
button{all:unset;background:#0ea5e9;color:white;padding:10px 18px;border-radius:12px;cursor:pointer;box-shadow:0 6px 20px rgba(14,165,233,.35)}
button:hover{filter:brightness(1.06)}
.small{margin-top:12px;opacity:.6;font-size:12px;text-align:center}

html,body,#game{touch-action:none;-webkit-user-select:none;user-select:none;overscroll-behavior:none}
/* Remove the flash that appears when tapping on mobile (Chrome/Safari). */
html,body,#game{-webkit-tap-highlight-color:transparent}

/*
 * Upgrade selection overlay styles.  When the overdrive bar fills, the
 * game pauses and the player is presented with a choice of upgrades.
 * The overlay darkens the background and presents two or more
 * options in a panel.  Options are responsive, wrapping on small
 * screens and aligning horizontally on wider screens.  A "portrait"
 * class is toggled on the overlay in script when the device is in
 * portrait orientation to force a vertical layout.
 */
#upgradeOverlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.78);
  z-index:999;
}
#upgradeOverlay.show{ display:flex; }

.upgrade-panel{
  background:rgba(10,16,28,0.93);
  border:1px solid #19324f;
  border-radius:18px;
  padding:24px 20px;
  box-shadow:0 8px 40px rgba(0,0,0,.5),0 0 40px rgba(0,229,255,.12);
  max-width:90%;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.upgrade-options{
  margin-top:16px;
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  justify-content:center;
}

.upgrade-option{
  display:flex;
  flex-direction:column;
  align-items:center;
  background:rgba(3,10,22,0.88);
  border:1px solid #0f2b3a;
  border-radius:14px;
  padding:12px 16px;
  cursor:pointer;
  transition:transform 0.1s;
  min-width:120px;
  max-width:160px;
}
.upgrade-option:hover{ transform:scale(1.05); }
.upgrade-option img{
  width:64px;
  height:64px;
  margin-bottom:8px;
  object-fit:contain;
}
.upgrade-option h3{
  margin:4px 0 2px;
  font-size:16px;
  color:#e0f2fe;
  text-align:center;
}
.upgrade-option p{
  margin:0;
  font-size:12px;
  opacity:0.8;
  text-align:center;
  line-height:1.35;
  max-width:160px;
}

/* Portrait layout overrides: stack options vertically */
#upgradeOverlay.portrait .upgrade-options{
  flex-direction:column;
  align-items:stretch;
}
#upgradeOverlay.portrait .upgrade-option{
  width:100%;
}
