/* --- Glacier Glide Premium Glassmorphic Stylesheet --- */
:root {
  --primary-blue: #00d2ff;
  --accent-cyan: #3a7bd5;
  --electric-teal: #00f2fe;
  --neon-glow: rgba(0, 242, 254, 0.6);
  --gold-star: #ffd700;
  --glass-bg: rgba(10, 25, 47, 0.65);
  --glass-card: rgba(255, 255, 255, 0.08);
  --glass-card-hover: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-glow: rgba(0, 242, 254, 0.4);
  --text-primary: #ffffff;
  --text-secondary: #c0d6df;
  --text-muted: #8aa9c4;
  --danger-red: #ff4757;
  --success-green: #2ed573;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Rajdhani', sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #030a16;
  font-family: var(--font-main);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Base Mobile App Container */
#app-container {
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 100vh;
  position: relative;
  overflow: hidden;
  background: url('bg.jpg') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Ambient Deep Ice Overlay */
#app-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 20%, rgba(0, 30, 70, 0.45) 0%, rgba(3, 10, 25, 0.85) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Common Glassmorphism Utilities */
.glass-bar {
  background: rgba(10, 25, 47, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  z-index: 20;
}

.glass-card {
  background: var(--glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:active {
  transform: scale(0.98);
  border-color: var(--glass-border-glow);
}

.glass-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.glass-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--primary-blue);
}

.icon-btn {
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  border-radius: 12px;
}

/* Primary Gradient Action Button */
.primary-btn {
  position: relative;
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 50%, #00f2fe 100%);
  border: none;
  border-radius: 16px;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1.5px;
  padding: 16px 28px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 210, 255, 0.4);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

.primary-btn:active {
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-25deg);
  animation: shine-sweep 3s infinite;
}

@keyframes shine-sweep {
  0% { left: -100%; }
  30%, 100% { left: 200%; }
}

/* Top Bar Styling */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  min-height: 60px;
}

.user-stats {
  display: flex;
  gap: 12px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

.stat-icon {
  font-size: 1rem;
}

/* Screen Management */
.screen {
  position: absolute;
  top: 60px;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Welcome Screen */
#welcome-screen {
  top: 0;
  z-index: 30;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 360px;
  gap: 16px;
}

.logo-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 8px;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--primary-blue);
  box-shadow: 0 0 25px var(--neon-glow);
}

.glow-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 242, 254, 0.5);
  animation: rotate-ring 12s linear infinite;
}

@keyframes rotate-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.floating {
  animation: float-anim 3.5s ease-in-out infinite;
}

@keyframes float-anim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.game-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 210, 255, 0.7);
}

.highlight {
  background: linear-gradient(90deg, #00d2ff, #00f2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: -6px;
  font-weight: 600;
}

.welcome-card {
  padding: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feat-icon {
  font-size: 1.6rem;
  background: rgba(0, 210, 255, 0.15);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.feat-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.feat-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pulse-anim {
  animation: btn-pulse 2.2s infinite;
  width: 100%;
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 210, 255, 0.4); }
  50% { box-shadow: 0 8px 36px rgba(0, 242, 254, 0.8); }
}

/* Home Screen */
#home-screen {
  overflow-y: auto;
  padding: 16px 18px 24px 18px;
}

.home-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-brand {
  text-align: center;
  padding: 10px 0 4px 0;
}

.mini-logo-wrap {
  width: 60px;
  height: 60px;
  margin: 0 auto 8px auto;
}

.mini-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary-blue);
  box-shadow: 0 0 15px var(--neon-glow);
}

.home-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.level-indicator-badge {
  display: inline-block;
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #00f2fe;
  margin-top: 4px;
}

/* Stats Overview */
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-box {
  padding: 12px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-box-icon {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.stat-box-val {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #00d2ff;
}

.stat-box-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Menu Grid */
.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-action-btn {
  border: 1px solid var(--glass-border);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  color: #fff;
}

.menu-action-btn.primary-action {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(58, 123, 213, 0.35) 100%);
  border-color: rgba(0, 242, 254, 0.5);
  box-shadow: 0 8px 24px rgba(0, 210, 255, 0.25);
}

.menu-icon-glow {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.menu-text-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-main-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.menu-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.menu-arrow {
  font-size: 1.2rem;
  color: var(--primary-blue);
  font-weight: bold;
}

.menu-dual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.half-btn {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 16px 8px;
  gap: 8px;
}

.mini-ico {
  font-size: 1.6rem;
}

/* Game Screen & Canvas */
#game-screen {
  top: 0;
  z-index: 10;
}

.hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  min-height: 56px;
}

.hud-center {
  text-align: center;
}

.hud-level-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.hud-stars-req {
  font-size: 0.85rem;
}

.hud-shots {
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  font-weight: 700;
}

.hud-shot-val {
  color: #00f2fe;
}

.hud-shot-par {
  color: var(--text-muted);
}

#canvas-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100% - 56px);
  overflow: hidden;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hint-msg {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid rgba(0, 242, 254, 0.3);
  font-size: 0.85rem;
  font-weight: 600;
  color: #00f2fe;
  pointer-events: none;
  animation: fadeInOut 4s infinite;
  white-space: nowrap;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Screen Headers (Levels, Shop, Trophies) */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  min-height: 56px;
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.header-placeholder {
  width: 44px;
}

.shop-balance {
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 800;
  border: 1px solid rgba(0, 242, 254, 0.4);
}

.scrollable-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

/* Levels Screen */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.level-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  position: relative;
  text-align: center;
}

.level-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.level-card.unlocked {
  border-color: rgba(0, 242, 254, 0.5);
}

.level-card.completed {
  background: rgba(0, 210, 255, 0.15);
  border-color: #00d2ff;
}

.lvl-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
}

.lvl-stars {
  font-size: 0.75rem;
  margin-top: 4px;
}

.lvl-lock-ico {
  font-size: 1.4rem;
}

/* Achievements List */
.achievements-list {
  gap: 12px;
}

.achieve-card {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.achieve-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.achieve-info {
  flex: 1;
}

.achieve-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.achieve-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00d2ff, #00f2fe);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.achieve-reward {
  text-align: right;
  font-weight: 800;
  font-size: 0.85rem;
  color: #00f2fe;
}

.achieve-card.unlocked {
  border-color: rgba(46, 213, 115, 0.6);
  background: rgba(46, 213, 115, 0.1);
}

/* Shop Screen */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.shop-card {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.skin-preview-puck {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.shop-card:hover .skin-preview-puck {
  transform: rotate(30deg) scale(1.05);
}

.skin-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
}

.skin-perk {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.skin-btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 4px;
}

.skin-btn.equipped {
  background: rgba(46, 213, 115, 0.3);
  border: 1px solid #2ed573;
  color: #2ed573;
}

.skin-btn.owned {
  background: rgba(0, 210, 255, 0.2);
  border: 1px solid #00d2ff;
  color: #fff;
}

.skin-btn.buy {
  background: linear-gradient(135deg, #00d2ff, #3a7bd5);
  border: none;
  color: #fff;
}

/* Modals & Popups */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 10, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: rgba(10, 25, 47, 0.9);
  border: 1px solid var(--glass-border-glow);
}

.victory-banner {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  color: #00f2fe;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(0, 242, 254, 0.8);
}

.victory-stars {
  font-size: 2rem;
  letter-spacing: 6px;
}

.star-anim {
  display: inline-block;
  animation: starPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes starPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.victory-stats-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.v-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.v-stat-row strong {
  color: #fff;
}

.reward-row strong {
  color: #00f2fe;
}

.modal-btns {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-btn {
  width: 100%;
}

.modal-sub-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sub-btn {
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.defeat-icon {
  font-size: 3rem;
  color: var(--danger-red);
}

.defeat-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--danger-red);
}

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

.retry-btn {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.4);
}

.pause-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: #00d2ff;
}

.pause-menu-btns {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
