/* --- Component Base Styling --- */
  :root {
    --bg-overlay: rgba(10, 10, 12, 0.65);
    --bg-card: rgba(22, 22, 26, 0.8);
    --border-card: rgba(255, 255, 255, 0.08);
    
    /* Neutral State Buttons */
    --bg-btn: rgba(255, 255, 255, 0.06);
    --border-btn: rgba(255, 255, 255, 0.04);
    --color-icon: #ffffff;
    
    /* Toggle Active States */
    --bg-btn-active: rgba(255, 255, 255, 0.15);
    
    /* Danger States */
    --bg-danger: rgba(239, 68, 68, 0.12);
    --border-danger: rgba(239, 68, 68, 0.2);
    --color-danger: #ff5c5c;
  }

  /* --- Fullscreen Overlay --- */
  .pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Safari Support */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    box-sizing: border-box;
    padding: 24px;
    opacity: 1;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* --- Central Menu Card --- */
  .pause-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 28px;
    padding: 36px 32px;
    width: 100%;
    max-width: 340px; /* Locked constraint for clean, compact scaling */
	box-shadow: 0 4px 50px rgb(128 127 130 / 40%), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    /*box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);*/
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
    transform: scale(1);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* --- Row Configurations --- */
  .menu-row {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
  }

  .row-middle {
    justify-content: space-between;
    gap: 12px;
  }

  .row-bottom {
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 24px;
  }

  .utility-group {
    display: flex;
    gap: 10px;
  }

  /* --- Modern Flat Vector Buttons --- */
  .btn {
    border-radius: 50%;
    border: 1px solid var(--border-btn);
    background: var(--bg-btn);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    outline: none;
    padding: 0;
    transition: transform 0.1s cubic-bezier(0.25, 1, 0.5, 1), 
                background-color 0.2s ease, 
                border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent; /* Removes touch flash on mobile Chrome/Safari */
  }

  /* Universal Vector Line Definition */
  .icon {
    fill: none;
    stroke: var(--color-icon);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }


.btn-disabled {
	opacity: 0.30;
}

.btn-hidden {
	opacity: 0.10;
}



  /* --- Button Sizing Matrix --- */
  .btn-large {
    width: 84px;
    height: 84px;
    background: var(--bg-btn-active);
  }
  .btn-large .icon {
    width: 32px;
    height: 32px;
    fill: var(--color-icon); /* Play triangle filled for solid hierarchy */
    transform: translateX(2px); /* Optically centers asymmetric triangle */
  }

  .btn-standard {
    width: 58px;
    height: 58px;
  }
  .btn-standard .icon {
    width: 22px;
    height: 22px;
  }

  .btn-utility {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.03);
  }
  .btn-utility .icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    opacity: 0.8;
  }

  /* --- Context-Specific Status Modifiers --- */
  .btn-danger {
    background: var(--bg-danger);
    border-color: var(--border-danger);
    /*margin-left: auto; /* Explicitly forces visual separation */
  }
  .btn-danger .icon {
    stroke: var(--color-danger);
    opacity: 1;
  }

  /* --- Pure Vector Toggles (No DOM-swapping needed) --- */
  .mute-slash {
    display: none;
    stroke: var(--color-danger);
  }
  .btn.muted {
    border-color: var(--border-danger);
  }
  .btn.muted .audio-wave {
    display: none;
  }
  .btn.muted .mute-slash {
    display: block;
  }

  .btn.vibe-off .vibe-line {
    opacity: 0.15;
    transform: scale(0.8);
  }

  .btn.is-fs .fs-corner {
    transform: scale(0.85);
    transform-origin: center;
  }

  /* --- Touch/Hover Micro-interactions --- */
  @media (hover: hover) {
    .btn:hover {
      background: var(--bg-btn-active);
      border-color: rgba(255, 255, 255, 0.15);
    }
    .btn-danger:hover {
      background: rgba(239, 68, 68, 0.22);
      border-color: rgba(239, 68, 68, 0.4);
    }
  }

  /* Tactical Scale-Down for Snappy Mobile Touch Feedback */
  .btn:active {
    transform: scale(0.92);
  }

  /* --- Responsive Landscape Optimization --- */
  @media (orientation: landscape) and (max-height: 500px) {
    .pause-overlay {
      padding: 12px;
    }
    .pause-card {
      flex-direction: row;
      max-width: 580px;
      padding: 20px 24px;
      gap: 24px;
      border-radius: 20px;
    }
    .row-bottom {
      border-top: none;
      border-left: 1px solid rgba(255, 255, 255, 0.06);
      padding-top: 0;
      padding-left: 20px;
      flex-direction: column-reverse;
      gap: 16px;
      width: auto;
    }
    .utility-group {
      flex-direction: row;
      gap: 10px;
    }
    .btn-danger {
      margin-left: 0;
    }
    .row-middle {
      flex-grow: 1;
      gap: 10px;
    }
  }
  
  
  
    /* Pause Menu Styles */
    .pause-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(10, 10, 12, 0.85);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 99999;
      box-sizing: border-box;
      padding: 24px;
      opacity: 1;
      transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pause-overlay.hidden {
      display: none;
    }

    .menu-container {
      background: rgba(22, 22, 26, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 24px;
      padding: 32px 24px;
      width: 100%;
      max-width: 320px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5),
                  inset 0 1px 0 rgba(255, 255, 255, 0.1);
      display: flex;
      flex-direction: column;
      gap: 24px;
      align-items: center;
    }

    .menu-title {
      font-size: 24px;
      font-weight: 700;
      letter-spacing: 4px;
      color: #ffffff;
      text-transform: uppercase;
      margin: 0;
    }


.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
}


    .menu-btn {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 20px;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(255, 255, 255, 0.06);
      color: #ffffff;
      font-size: 14px;
      font-weight: 600;
      letter-spacing: 1px;
      cursor: pointer;
      transition: all 0.2s ease;
      width: 100%;
      justify-content: flex-start;
    }

    .menu-btn:hover {
      background: rgba(255, 255, 255, 0.12);
      border-color: rgba(255, 255, 255, 0.2);
    }

    .menu-btn:active {
      transform: scale(0.98);
    }

    .menu-btn.primary {
      background: rgba(0, 255, 136, 0.15);
      border-color: rgba(0, 255, 136, 0.3);
    }

    .menu-btn.primary:hover {
      background: rgba(0, 255, 136, 0.25);
      border-color: rgba(0, 255, 136, 0.5);
    }

    .menu-btn.danger {
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.2);
      color: #ef4444;
    }

    .menu-btn.danger:hover {
      background: rgba(239, 68, 68, 0.2);
      border-color: rgba(239, 68, 68, 0.4);
    }

    .menu-btn span {
      flex: 1;
    }
	
	.menu-blueShadow {
		box-shadow: 0 0 10px 5px rgba(255, 255, 255, 0.5);
	}
	.menu-pinkShadow {
		box-shadow: 0 0 10px 5px rgb(108 151 255 / 50%);
	}
	.menu-greenShadow {
		box-shadow: 0 0 10px 5px rgba(70, 255, 55, 0.5);
	}
	.menu-orangeShadow {
		box-shadow: 0 0 10px 5px #FF9800;
	}
	.menu-reddishShadow {
	box-shadow: 0 0 10px 5px rgb(255 0 153 / 50%);
	}
	.menu-redShadow {
		box-shadow: 0 0 10px 5px rgba(255, 45, 0, 0.5);
	}


.asteroid{
	display: block !important;
	width: 100px;
	height: 100px;
/*position: absolute;*/
}




    /* Landscape mode optimization */
    @media (orientation: landscape) and (max-height: 500px) {
      .pause-overlay {
        padding: 12px;
      }

      .menu-container {
        flex-direction: row;
        max-width: 600px;
        padding: 16px 20px;
        gap: 20px;
        border-radius: 16px;
      }

      .menu-title {
        display: none;
      }

      .menu-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
      }

      .menu-btn {
        padding: 10px 14px;
        font-size: 12px;
      }
    }

/* Vesmírne pozadie s hviezdami */
body {
  background: radial-gradient(circle at center, #1a1a2e 0%, #0f0f1a 70%, #050508 100%);
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
}

/* GPU ACCELERATION - Force hardware rendering for animated elements */
.gpu-layer,
.bubble,
.asteroid,
.particle,
.star,
.orbit-particle,
.floating-text {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.star {
  position: absolute;
  background-color: #ffffff;
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out;
}


#planet-upgrade-btn {
	/*background: none;*/
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

/* Efekty planéty a guličiek */
@keyframes orbit {
  from { transform: rotate(0deg) translateX(var(--orbit-radius)) rotate(0deg); }
  to { transform: rotate(360deg) translateX(var(--orbit-radius)) rotate(-360deg); }
}
.orbit-particle {
  animation: orbit var(--orbit-duration) linear infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}
.upgrade-pulse {
  /* Voláme tvoju kombinovanú animáciu */
  animation: upgrade-pulse 2s infinite ease-in-out; 
  will-change: transform, opacity; /* Pridali sme aj opacity pre plynulosť grafiky */
}

@keyframes upgrade-pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.5;          /* 🌟 Na začiatku a konci jemne stmavne */
    }
    50% { 
        transform: scale(1.13); 
        opacity: 1;        /* 🌟 V strede sa zväčší a svieti naplno */
    }
}

/* Animácie pre guličky - optimized with GPU hints */
@keyframes spawn {
  0% { transform: translateZ(0) scale(0); }
  100% { transform: translateZ(0) scale(1); }
}
.bubble-spawn {
  animation: spawn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes mergeBounce {
  0% { transform: translateZ(0) scale(0.4); }
  40% { transform: translateZ(0) scale(1.35); }
  70% { transform: translateZ(0) scale(0.9); }
  100% { transform: translateZ(0) scale(1); }
}
.bubble-merge {
  animation: mergeBounce 0.4s ease-out forwards;
}

@keyframes pop {
  0% { transform: translateZ(0) scale(1); opacity: 1; }
  100% { transform: translateZ(0) scale(1.4); opacity: 0; }
}
.bubble-pop, .asteroid-pop {
  animation: pop 0.15s ease-out forwards;
  pointer-events: none !important;
}

/* Trasenie planéty - optimized */
@keyframes planetShake {
  0%, 100% { transform: translate(-50%, -50%) translateZ(0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(calc(-50% - 6px), calc(-50% + 4px)) translateZ(0); }
  20%, 40%, 60%, 80% { transform: translate(calc(-50% + 6px), calc(-50% - 4px)) translateZ(0); }
}
.shake-active {
  animation: planetShake 0.4s ease-in-out forwards;
}

.planet-glow {
  transition: background 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

/* --- 1-SEKUNDOVY POPLACHOVY ZABLESK --- */
.warning-flash {
  animation: proximityAlert 1.0s ease-in-out forwards;
}

@keyframes proximityAlert {
  0% {
    box-shadow: inset 0 0 0px rgba(239, 68, 68, 0);
    background-color: rgba(239, 68, 68, 0);
  }
  25% {
    box-shadow: inset 0 0 60px rgba(239, 68, 68, 0.7);
    background-color: rgba(239, 68, 68, 0.15);
  }
  100% {
    box-shadow: inset 0 0 0px rgba(239, 68, 68, 0);
    background-color: rgba(239, 68, 68, 0);
  }
}

/* --- 1-SEKUNDOVY POPLACHOVY ZABLESK --- */
.mystery-flash {
  animation: mysteryAlert 1.0s ease-in-out forwards;
}

@keyframes mysteryAlert {
  0% {
    box-shadow: inset 0 0 0px rgba(0, 71, 255, 0);
    background-color: rgba(0, 71, 255, 0);
  }
  25% {
    box-shadow: inset 0 0 60px rgba(0, 71, 255, 0.7);
    background-color: rgba(0, 71, 255, 0.15);
  }
  100% {
    box-shadow: inset 0 0 0px rgba(0, 71, 255, 0);
    background-color: rgba(0, 71, 255, 0);
  }
}

/* --- PLAVAJUCI ARTIFAKT TEXT --- */
.floating-text {
  position: absolute;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: bold;
  font-size: 16px;
  pointer-events: none;
  transform: translate(-50%, -50%) translateZ(0);
  animation: floatUpAndFade 1.0s ease-out forwards;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
  z-index: 9999;
}

@keyframes floatUpAndFade {
  0% {
    transform: translate(-50%, -50%) translateZ(0) scale(0.8);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -100px) translateZ(0) scale(1.1);
    opacity: 0;
  }
}

/* --- INDIKATOR ZIVOTA PLANETY --- */
.health-segment {
  width: 20px;
  height: 10px;
  border-radius: 2px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.health-segment.active {
  background: #00ffcc;
  box-shadow: 0 0 10px #00ffcc, inset 0 0 4px #00ffcc;
}

.health-segment.empty {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.health-segment.danger-pulse {
  background: #ef4444 !important;
  box-shadow: 0 0 15px #ef4444, inset 0 0 4px #ef4444 !important;
  animation: criticalHealth 0.6s infinite alternate;
}

@keyframes criticalHealth {
  0% { opacity: 0.3; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}


/* --- RAZOVA VLNA PLANETY --- */
#planet {
  position: relative;
}

.shockwave-active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(0, 255, 204, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%) translateZ(0) scale(1);
  animation: shockwave-expand 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes shockwave-expand {
  0% {
    transform: translate(-50%, -50%) translateZ(0) scale(1);
    opacity: 1;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.6);
  }
  100% {
    transform: translate(-50%, -50%) translateZ(0) scale(6);
    opacity: 0;
    box-shadow: 0 0 50px rgba(0, 255, 204, 0);
  }
}

/* ✨ Pulzovanie a magická žiara tajomnej guľôčky */
  @keyframes mysteryGlow {
    0%, 100% { transform: scale(0.8); box-shadow: 0 0 20px #22d3ee, 0 0 40px #06b6d4, inset 0 0 10px #ffffff; }
    50% { transform: scale(1.2); box-shadow: 10px 10px 50px #15f3fc, 2px 2px 30px #06b6d4, inset 0px 0px 10px #06b6d4; }
	/*50% { transform: scale(2); box-shadow: 0 0 35px #a5f3fc, 0 0 60px #22d3ee, inset 0 0 5px #ffffff; }*/
  }
  .mystery-ball-style {
    animation: mysteryGlow 1.2s infinite ease-in-out;
	background: rgba(50, 100, 150, 0.15);
    /*background: radial-gradient(circle at 50% 50%, #ecfeff 0%, #22d3ee 45%, #1e40af 100%);*/
  }

/* Prevent pull-to-refresh on mobile */
#game-container {
  overscroll-behavior: none;
  touch-action: none;
}



