/**
 * Rocket Rush - Premium Space Theme
 * Landscape-First Design with Glassmorphism
 */

:root {
  /* Premium Color Palette */
  --bg-deep: #050510;
  --bg-space: #0b0b1e;

  --primary: #00f2ff;
  /* Neon Cyan */
  --secondary: #ff0055;
  /* Neon Pink */
  --accent: #ffee00;
  /* Neon Yellow */
  --success: #00ff9d;

  --glass-light: rgba(255, 255, 255, 0.08);
  --glass-medium: rgba(255, 255, 255, 0.15);
  --glass-heavy: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

  --text-main: #ffffff;
  --text-muted: #a0a0b0;

  /* Typography */
  --font-hero: 'Orbitron', sans-serif;
  --font-ui: 'Space Grotesk', sans-serif;

  /* Animations */
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-ui);
}

/* Force Landscape via Overlay */
#orientation-lock {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
  z-index: 9999;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

@media screen and (orientation: portrait) and (max-width: 1024px) {
  #orientation-lock {
    display: flex;
  }

  /* Hide main game when valid to save resources/confusions */
  #game-ui,
  #game-canvas {
    display: none;
  }
}

/* Screen Containers */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, var(--bg-space), var(--bg-deep));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-smooth);
  z-index: 10;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  z-index: 20;
}

/* Buttons - Premium Style */
.btn {
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 12px 24px;
  font-family: var(--font-hero);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s var(--ease-smooth);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--glass-medium);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
  text-shadow: 0 0 8px var(--primary);
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--primary);
  color: #000;
  border: none;
}

.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 30px var(--primary);
}

.btn-secondary {
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 0 20px var(--secondary);
}

.btn-danger {
  border-color: #ff3333;
  color: #ff3333;
}

.btn-menu {
  width: 220px;
  text-align: left;
  justify-content: flex-start;
}

/* ---------------- Splash Screen ---------------- */
#splash-screen {
  z-index: 100;
}

.game-title {
  font-family: var(--font-hero);
  font-size: clamp(3rem, 8vw, 6rem);
  background: linear-gradient(to right, var(--primary), #fff, var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 50px rgba(0, 242, 255, 0.5);
  animation: floatTitle 3s ease-in-out infinite;
}

@keyframes floatTitle {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }
}

.loading-bar {
  width: 300px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 40px;
}

.loading-progress {
  width: 0%;
  height: 100%;
  background: var(--primary);
  box-shadow: 0 0 15px var(--primary);
  animation: load 2s ease-out forwards;
}

@keyframes load {
  to {
    width: 100%;
  }
}

/* ---------------- Main Menu (Redesign) ---------------- */
.game-title-small {
  font-family: var(--font-hero);
  font-size: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(to right, var(--primary), #fff, var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(0, 242, 255, 0.4);
  margin-bottom: 10px;
  letter-spacing: 3px;
}

.menu-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.menu-play-container {
  margin: 40px 0;
  display: flex;
  justify-content: center;
}

.btn-play-large {
  width: 250px;
  height: 80px;
  background: var(--primary);
  color: #050510;
  font-family: var(--font-hero);
  font-size: 2.2rem;
  border: none;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 242, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  justify-content: center;
  align-items: center;
  letter-spacing: 2px;
}

.btn-play-large:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px var(--primary);
  background: #fff;
}

.player-info-center {
  background: var(--glass-light);
  padding: 15px 30px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  display: flex;
  gap: 30px;
  align-items: center;
  backdrop-filter: blur(10px);
}

.player-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.player-details #player-name {
  font-family: var(--font-hero);
  font-size: 1.1rem;
  color: var(--text-main);
}

.player-details .coin-display {
  position: static;
  transform: none;
  font-family: var(--font-hero);
  font-size: 1rem;
  color: var(--accent);
  background: transparent;
  padding: 0;
  border: none;
}

.high-score-display-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-hero);
  gap: 2px;
}

.high-score-display-center span:first-child {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.high-score-display-center #high-score {
  font-size: 1.5rem;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

/* Corner Actions */
.menu-corners {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.corner-group {
  position: absolute;
  display: flex;
  gap: 20px;
  pointer-events: auto;
}

.corner-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.top-right {
  top: 30px;
  right: 30px;
}

.top-right-2 {
  top: 30px;
  right: 110px;
}

/* Achievements next to Leaderboard */
.bottom-right {
  bottom: 30px;
  right: 30px;
}

.top-left {
  top: 30px;
  left: 30px;
}

.top-left-2 {
  top: 30px;
  left: 110px;
}

.circle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  font-size: 1.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s var(--ease-elastic);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.circle-btn:hover {
  transform: translateY(-5px) scale(1.1);
  background: var(--glass-medium);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary);
}

.label {
  position: absolute;
  bottom: -25px;
  font-size: 0.8rem;
  color: var(--text-main);
  font-family: var(--font-ui);
  opacity: 0;
  transition: 0.3s;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
}

.corner-item:hover .label,
.corner-group:hover .label {
  opacity: 1;
  bottom: -30px;
}



.btn-play {
  width: 100%;
  background: var(--primary);
  color: #050510;
  border: none;
  font-size: 1.2rem;
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.btn-play:hover {
  background: #fff;
  box-shadow: 0 0 40px var(--primary);
}

/* ---------------- Game Screen ---------------- */
#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#game-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#score-display {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-hero);
  font-size: 3rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.touch-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  pointer-events: all;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.touch-controls:hover {
  opacity: 1;
}

.control-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  color: #fff;
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.1s;
}

.control-btn:active,
.control-btn.active {
  background: var(--primary);
  transform: scale(0.9);
  box-shadow: 0 0 30px var(--primary);
  border: none;
}

.btn-dive {
  border-color: var(--secondary);
}

.btn-dive:active {
  background: var(--secondary);
  box-shadow: 0 0 30px var(--secondary);
}

#pause-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--glass-light);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  pointer-events: all;
  backdrop-filter: blur(5px);
}

.powers-hud {
  position: absolute;
  top: 80px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: all;
}

.power-btn {
  width: 50px;
  height: 50px;
  background: var(--glass-medium);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  position: relative;
}

.power-count {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: var(--secondary);
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
}

/* ---------------- Overlays ---------------- */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 50;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

.overlay-content {
  background: var(--glass-light);
  padding: 40px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  text-align: center;
  box-shadow: var(--glass-shadow);
  transform: scale(0.8);
  transition: 0.4s var(--ease-elastic);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  min-width: 320px;
  backdrop-filter: blur(20px);
}

.overlay-content h2 {
  font-family: var(--font-hero);
  margin-bottom: 10px;
  color: #fff;
}

#resume-btn,
#quit-btn {
  width: 100%;
  justify-content: center;
  font-size: 1.1rem;
}

.overlay.active .overlay-content {
  transform: scale(1);
}

/* ---------------- Shop & Leaderboard & Settings & Achievements ---------------- */

/* Screen Header */
.screen-header {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 60px;
  margin-bottom: 20px;
}

.screen-header h2 {
  font-family: var(--font-hero);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  color: var(--primary);
  text-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
}

.coin-display {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-hero);
  font-size: 1.2rem;
  color: var(--accent);
  background: var(--glass-light);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
}

/* Shop Tabs */
.shop-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.shop-tab {
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 12px 30px;
  font-family: var(--font-hero);
  font-size: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}

.shop-tab:hover {
  background: var(--glass-medium);
  color: var(--text-main);
}

.shop-tab.active {
  background: var(--primary);
  color: #050510;
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

/* Shop Grid */
.shop-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  padding: 20px;
  max-height: 55vh;
  overflow-y: auto;
  width: 90%;
  max-width: 900px;
}

.shop-grid.active {
  display: grid;
}

.shop-item {
  background: var(--glass-light);
  border-radius: 15px;
  padding: 15px;
  border: 1px solid var(--glass-border);
  text-align: center;
  transition: all 0.3s var(--ease-smooth);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.shop-item:hover {
  background: var(--glass-medium);
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

.shop-item.owned {
  border-color: var(--success);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.2);
}

.shop-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(255, 238, 0, 0.3);
}

.item-image {
  font-size: 3rem;
}

.item-name {
  font-weight: bold;
  color: #fff;
  font-size: 0.95rem;
}

.item-price {
  color: var(--accent);
  font-family: var(--font-hero);
  font-size: 0.9rem;
}

/* Settings Container */
.settings-container {
  background: var(--glass-light);
  padding: 30px 40px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  width: 90%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--glass-border);
}

.setting-item:last-of-type {
  border-bottom: none;
}

.setting-item label {
  font-size: 1.1rem;
  color: var(--text-main);
}

/* Custom Toggle Switch */
.setting-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 50px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
}

.setting-item input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.3s var(--ease-elastic);
}

.setting-item input[type="checkbox"]:checked {
  background: var(--primary);
}

.setting-item input[type="checkbox"]:checked::before {
  transform: translateX(24px);
  background: #fff;
}

/* Leaderboard List */
.leaderboard-list {
  width: 90%;
  max-width: 600px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: var(--glass-light);
  border-radius: 15px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
}

.leaderboard-item:hover {
  background: var(--glass-medium);
  transform: translateX(5px);
}

.leaderboard-item.top-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), var(--glass-light));
  border-color: gold;
}

.leaderboard-item.top-2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), var(--glass-light));
  border-color: silver;
}

.leaderboard-item.top-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), var(--glass-light));
  border-color: #cd7f32;
}

.leaderboard-rank {
  font-family: var(--font-hero);
  font-size: 1.5rem;
  min-width: 40px;
  text-align: center;
  color: var(--primary);
}

.leaderboard-name {
  flex: 1;
  font-size: 1.1rem;
  color: var(--text-main);
}

.leaderboard-score {
  font-family: var(--font-hero);
  font-size: 1.2rem;
  color: var(--accent);
}

/* Achievements List */
.achievements-list {
  width: 90%;
  max-width: 700px;
  max-height: 60vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  padding: 10px;
}

.achievement-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: var(--glass-light);
  border-radius: 15px;
  border: 1px solid var(--glass-border);
  text-align: center;
  transition: all 0.3s;
}

.achievement-item:hover {
  background: var(--glass-medium);
  transform: translateY(-3px);
}

.achievement-item.unlocked {
  border-color: var(--success);
  box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
}

.achievement-item.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-icon {
  font-size: 2.5rem;
}

.achievement-name {
  font-weight: bold;
  color: var(--text-main);
}

.achievement-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------------- Auth Screen ---------------- */
.auth-container {
  background: rgba(10, 10, 30, 0.6);
  padding: 40px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  width: 400px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 8px;
}

.form-group input:focus {
  border-color: var(--primary);
  outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Common Utilities */
.hidden {
  display: none !important;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 1.8rem;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  color: #fff;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s var(--ease-smooth);
  z-index: 10;
}

.back-btn:hover {
  background: var(--glass-medium);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
  transform: scale(1.1);
}

/* Share Buttons */
.share-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 25px;
}

.share-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  /* Adjusted for emoji */
  color: #fff;
  transition: 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.gameover-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}



.whatsapp {
  background: #25D366;
}

.facebook {
  background: #1877F2;
}

.twitter {
  background: #1DA1F2;
}

.instagram {
  background: #E1306C;
}

.share-btn:hover {
  transform: scale(1.1);
}

/* Mobile Landscape Optimization */
@media (max-height: 500px) {
  .menu-play-container {
    margin: 15px 0;
  }

  .btn-play-large {
    width: 200px;
    height: 60px;
    font-size: 1.6rem;
  }

  .game-title-small {
    font-size: 2rem;
    margin-bottom: 5px;
  }

  .player-info-center {
    padding: 8px 20px;
    gap: 20px;
  }

  .circle-btn {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }

  .top-right {
    top: 15px;
    right: 15px;
  }

  .top-right-2 {
    top: 15px;
    right: 80px;
  }

  .bottom-right {
    bottom: 15px;
    right: 15px;
  }

  .top-left {
    top: 15px;
    left: 15px;
  }

  .corner-group {
    gap: 10px;
  }
}