body { 
    margin: 0; 
    padding: 0;
    font-family: 'Courier New', monospace;
    background-color: #000;
    color: #0f0;
    overflow: hidden;
    width: 100%;
    height: 100vh;
  }
  
  .game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
  }
  
  /* Particle background */
  .particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: -1;
  }
  
  .particle {
    position: absolute;
    background: rgba(0, 255, 0, 0.5);
    border-radius: 50%;
    pointer-events: none;
    animation: floatUp linear forwards;
  }
  
  @keyframes floatUp {
    0% {
      transform: translateY(0) rotate(0deg);
      opacity: 0;
    }
    10% {
      opacity: 0.8;
    }
    90% {
      opacity: 0.5;
    }
    100% {
      transform: translateY(-100vh) rotate(360deg);
      opacity: 0;
    }
  }
  
  #gameCanvas {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 100vh;
    max-width: 100vw;
  }
  
  @media (orientation: portrait) {
    #gameCanvas {
      width: 100%;
      height: auto;
      top: 50%;
      transform: translateY(-50%);
    }
  }
  
  @media (orientation: landscape) {
    #gameCanvas {
      height: 100%;
      width: auto;
      left: 50%;
      transform: translateX(-50%);
    }
  }
  
  #welcomeSection {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    width: 600px;
    padding: 30px;
    background: rgba(0, 20, 0, 0.8);
    border: 2px solid #1a3;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2), inset 0 0 20px rgba(0, 100, 0, 0.3);
    text-align: center;
    animation: pulsate 4s infinite ease-in-out;
    z-index: 10;
    backdrop-filter: blur(5px);
    overflow-y: auto;
    max-height: 90vh;
  }
  
  @keyframes pulsate {
    0% { box-shadow: 0 0 20px rgba(0, 255, 0, 0.2), inset 0 0 10px rgba(0, 100, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 0, 0.4), inset 0 0 20px rgba(0, 100, 0, 0.5); }
    100% { box-shadow: 0 0 20px rgba(0, 255, 0, 0.2), inset 0 0 10px rgba(0, 100, 0, 0.3); }
  }
  
  .title {
    font-size: 3.5em;
    margin: 0 0 10px 0;
    font-weight: bold;
    background: linear-gradient(to right, #0a0, #5f5, #0f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    letter-spacing: 2px;
    animation: glow 3s infinite alternate;
  }

  .game-mode-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
  }

  .mode-button {
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
  }

  .mode-solo {
    background: linear-gradient(135deg, #0066cc, #004499);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 100, 200, 0.5);
    border: 2px solid #0088ff;
  }

  .mode-solo:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.7);
    background: linear-gradient(135deg, #0077dd, #0055aa);
  }

  .mode-multi {
    background: linear-gradient(135deg, #030, #060, #030);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 100, 0, 0.5);
  }

  .mode-multi:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.7);
    background: linear-gradient(135deg, #040, #080, #040);
  }
  
  @media (max-width: 600px) {
    .title {
      font-size: 2.5em;
    }
    
    #welcomeSection {
      padding: 20px;
    }
    
    .ancient-wisdom h2 {
      font-size: 1.5em;
    }
    
    .ancient-wisdom li {
      font-size: 0.9em;
    }
    
    #joinQueue {
      padding: 12px 25px;
      font-size: 1.1em;
    }
  }
  
  @keyframes glow {
    0% { text-shadow: 0 0 10px rgba(0, 255, 0, 0.5); }
    100% { text-shadow: 0 0 20px rgba(0, 255, 0, 0.8), 0 0 30px rgba(0, 255, 0, 0.6); }
  }
  
  .subtitle {
    font-size: 1.1em;
    margin: 0 0 25px 0;
    color: #dff;
    text-shadow: 0 0 5px rgba(0, 200, 200, 0.5);
    letter-spacing: 1px;
    line-height: 1.5;
  }
  
  .ancient-wisdom {
    background: rgba(0, 30, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #1a3;
    text-align: left;
  }
  
  .ancient-wisdom h2 {
    margin-top: 0;
    color: #3f3;
    text-shadow: 0 0 5px rgba(0, 200, 0, 0.5);
    font-size: 1.6em;
    letter-spacing: 1px;
  }
  
  .ancient-wisdom ul {
    list-style-type: none;
    padding-left: 10px;
    margin: 0;
  }
  
  .ancient-wisdom li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 18px;
    line-height: 1.4;
  }
  
  .ancient-wisdom li:before {
    content: "•";
    color: #3f3;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 18px;
  }
  
  .version {
    text-align: right;
    font-size: 0.8em;
    margin-top: 15px;
    color: rgba(0, 255, 0, 0.7);
  }
  
  .name-input {
    margin-bottom: 25px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .name-input input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 25px;
    background: rgba(0, 40, 0, 0.6);
    color: #fff;
    font-size: 1.1em;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 200, 0, 0.3), inset 0 0 5px rgba(0, 100, 0, 0.2);
  }
  
  .name-input input:focus {
    outline: none;
    background: rgba(0, 50, 0, 0.8);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5), inset 0 0 5px rgba(0, 150, 0, 0.3);
  }
  
  .name-input input::placeholder {
    color: rgba(200, 255, 200, 0.6);
  }
  
  #joinQueue {
    padding: 12px 30px;
    background: linear-gradient(135deg, #030, #060, #030);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 100, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
  }
  
  #joinQueue:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.7);
    background: linear-gradient(135deg, #040, #080, #040);
  }
  
  #joinQueue:active {
    transform: translateY(0);
  }
  
  #joinQueue::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
  }
  
  #joinQueue:hover::after {
    opacity: 1;
    transform: rotate(45deg) translate(10%, 10%);
  }
  
  #queueStatus {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 20, 0, 0.8);
    color: #0f0;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2em;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    border: 1px solid #1a3;
    z-index: 100;
    display: none;
  }
  
  @media (max-width: 600px) {
    #queueStatus {
      font-size: 1em;
      padding: 8px 15px;
      width: 80%;
    }
    
    .chat-container {
      bottom: 70px; /* Move up to avoid blocking queue menu */
      right: 5px;
      width: 250px; /* Slightly smaller on mobile */
      height: 250px; /* Reduced height on mobile */
    }
    
    .chat-messages {
      height: 150px;
    }
    
    .chat-input {
      width: calc(100% - 60px);
      padding: 8px;
    }
    
    .chat-send {
      padding: 8px 12px;
    }
  }
  
  @media (max-width: 768px) {
    .chat-container {
      height: 200px; /* Reduced height on mobile */
      bottom: 70px; /* Move up to avoid blocking queue menu */
    }
    
    .chat-messages {
      max-height: 120px;
      padding: 5px 10px;
    }
    
    .chat-input-container {
      padding: 5px 10px;
    }
    
    .chat-input {
      padding: 5px;
    }
    
    .chat-send {
      padding: 5px 10px;
    }
  }
  
  #gameInfo {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 18px;
    z-index: 100;
  }
  #roundDisplay {
    margin: 5px 0;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
  }
  #gameEndScreen {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    z-index: 1000;
    min-width: 300px;
  }
  #gameEndScreen h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 36px;
  }
  #gameEndScreen #gameEndStats {
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .stats-section {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    min-width: 200px;
  }
  .stats-section h3 {
    color: #4CAF50;
    margin: 0 0 10px 0;
    font-size: 18px;
    border-bottom: 1px solid rgba(76, 175, 80, 0.3);
    padding-bottom: 5px;
  }
  #gameEndScreen #playAgainBtn {
    padding: 10px 20px;
    font-size: 18px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
  }
  #gameEndScreen #playAgainBtn:hover {
    background: #45a049;
  }
  .stat-row {
    margin: 8px 0;
    white-space: nowrap;
    font-size: 14px;
  }
  .stat-value {
    color: #4CAF50;
    font-weight: bold;
  }
  #pipContainer {
    position: fixed; 
    bottom: 120px;
    left: 50%;
    transform: translate(-50%, 0);
    display: none; 
    flex-direction: column;
    align-items: center;
    background: rgba(20, 20, 30, 0.85);
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 99;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(100, 100, 255, 0.3);
    transition: all 0.3s ease-in-out, opacity 0.3s ease;
    animation: pip-container-show 0.5s ease-out;
    opacity: 0;
  }
  
  @keyframes pip-container-show {
    0% {
      opacity: 0;
      transform: translate(-50%, 50px);
    }
    100% {
      opacity: 1;
      transform: translate(-50%, 0);
    }
  }
  
  @media (max-width: 700px) {
    #pipContainer {
      width: 95%;
      padding: 10px;
      max-height: 40vh;
      top: 55vh;
    }
    
    #upgradeMenu {
      top: 25%;
    }
    
    .pip-views {
      flex-wrap: wrap;
    }
    
    .pip-canvas {
      width: 120px;
      height: 90px;
    }
    
    #enemySelector {
      flex-wrap: wrap;
    }
  }
  
  .pip-view {
    animation: pip-view-appear 0.4s ease-out backwards;
  }
  
  @keyframes pip-view-appear {
    0% {
      opacity: 0;
      transform: scale(0.8);
    }
    70% {
      transform: scale(1.05);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  .pip-views {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    max-height: 40vh;
    overflow-y: auto;
    width: 100%;
    padding: 5px;
  }
  
  .pip-view {
    background: rgba(30, 30, 50, 0.7);
    border-radius: 10px;
    padding: 8px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
  }
  
  .pip-view:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  }
  
  .pip-canvas {
    width: 200px;
    height: 150px;
    border-radius: 6px;
    background: #1a1a2a;
    border: 2px solid rgba(100, 100, 255, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s ease;
  }
  
  .pip-view:hover .pip-canvas {
    border-color: rgba(120, 120, 255, 0.6);
  }
  
  .pip-name {
    color: white;
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .pip-health {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
  }
  
  .pip-health-bar {
    height: 100%;
    background: linear-gradient(to right, #ff3e3e, #ff5c5c);
    width: 100%;
    transition: width 0.3s ease;
  }
  
  .points-display {
    background: rgba(50, 50, 80, 0.8);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(100, 100, 255, 0.3);
  }
  
  #availablePoints {
    color: #ffcc00;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
  }
  
  #enemySelector {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: auto;
    position: fixed;
    top: 40%;
    left: 40px;
    transform: translateY(-50%);
    padding: 15px;
    z-index: 100;
    background: rgba(10, 10, 20, 0.6);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(100, 100, 255, 0.2);
  }
  
  .enemy-option {
    position: relative;
    background: rgba(20, 20, 30, 0.7);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    height: auto;
    margin: 8px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  }
  
  .enemy-option:hover {
    background: rgba(30, 30, 50, 0.8);
    transform: translateX(5px);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
  }
  
  .enemy-option.selected {
    border-color: #FFD700;
    box-shadow: 0 0 10px #FFD700;
  }
  
  .enemy-option.cannot-afford {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .enemy-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 0;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
  }
  
  .enemy-preview svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    width: 80%;
    height: 80%;
  }
  
  .enemy-option span {
    display: block;
    text-align: center;
  }
  
  .enemy-option .enemy-cost {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: #FFD700;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 2px 8px;
    margin-left: 15px;
  }
  
  .how-to-play {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(51, 51, 51, 0.9);
    padding: 20px;
    border-radius: 5px;
    color: #fff;
    text-align: center;
    max-width: 600px;
    font-size: 14px;
  }
  
  .how-to-play h3 {
    margin: 0 0 10px;
    color: #4CAF50;
  }
  
  .how-to-play ul {
    text-align: left;
    margin: 0;
    padding-left: 20px;
  }
  
  .how-to-play li {
    margin: 5px 0;
  }
  
  .key {
    display: inline-block;
    background: #444;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 0 2px;
  }
  
  .chat-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 280px;
    background: rgba(0, 20, 0, 0.7);
    border-top: 1px solid #0f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    transition: height 0.3s ease;
  }

  .chat-container.hidden {
    height: 40px;
  }

  .chat-hide-button {
    position: absolute;
    top: 5px;
    right: 10px;
    background: rgba(0, 100, 0, 0.7);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    z-index: 101;
  }

  .chat-hide-button:hover {
    background: rgba(0, 120, 0, 0.8);
  }
  
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
    color: #fff;
    font-size: 14px;
    max-height: calc(100% - 50px);
  }
  
  .chat-input-container {
    display: flex;
    padding: 10px 20px;
    border-top: 1px solid rgba(0, 255, 0, 0.3);
    background: rgba(0, 30, 0, 0.8);
  }
  
  .chat-input {
    flex: 1;
    background: rgba(0, 30, 0, 0.8);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    margin-right: 5px;
  }
  
  .chat-send {
    background: rgba(0, 100, 0, 0.7);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .chat-message {
    margin: 5px 0;
    color: #fff;
    font-size: 14px;
    word-wrap: break-word;
    line-height: 1.4;
  }
  
  .chat-timestamp {
    color: #888;
    margin-right: 5px;
    font-size: 12px;
  }
  
  .chat-name {
    color: #4CAF50;
    margin-right: 5px;
    font-weight: bold;
  }
  
  .chat-input-container {
    display: flex;
    gap: 10px;
  }
  
  .chat-input:focus {
    outline: none;
    border-color: #666;
    background: rgba(255, 255, 255, 0.15);
  }
  
  .chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }
  
  .chat-send:hover {
    background: #555;
  }
  
  @keyframes message-fade-in {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }
  
  /* Small button style for reset stats */
  .small-btn {
    margin-top: 10px;
    padding: 5px 10px;
    font-size: 14px;
    background: rgba(150, 0, 0, 0.7);
    color: #fff;
    border: 1px solid #f00;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.2s;
  }
  
  .small-btn:hover {
    background: rgba(200, 0, 0, 0.8);
  }
  
  /* Leaderboard Styles */
  .leaderboard-container {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .leaderboard-title {
    color: #0f0;
    text-align: center;
    margin-bottom: 15px;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
  }
  
  .leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(0, 50, 0, 0.4);
    border-radius: 5px;
    border-left: 3px solid #0f0;
    margin-bottom: 5px;
  }
  
  .leaderboard-category {
    color: #0f0;
    font-weight: bold;
  }
  
  .leaderboard-value-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }
  
  .leaderboard-value {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
  }
  
  .leaderboard-name {
    color: rgba(0, 255, 0, 0.7);
    font-style: italic;
    font-size: 14px;
    margin-top: 2px;
  }
  
  .leaderboard-loading {
    text-align: center;
    color: #0f0;
    padding: 10px;
  }
  
  /* Player Achievements Styles */
  .achievement-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(0, 30, 60, 0.4);
    border-radius: 5px;
    border-left: 3px solid #00aaff;
    margin-bottom: 5px;
  }
  
  .achievement-category {
    color: #fff;
  }
  
  .achievement-value {
    color: #00aaff;
    font-weight: bold;
    font-size: 18px;
  }
  
  /* New style for pip-views when in game mode */
  .pip-views-game-mode {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
    max-height: 250px;
    background: rgba(20, 20, 30, 0.5);
    border-radius: 10px;
    padding: 10px;
    z-index: 90;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 100, 255, 0.2);
    opacity: 0.7;
    transition: all 0.3s ease;
  }
  
  .pip-views-game-mode:hover {
    opacity: 0.9;
  }
  
  .pip-views-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    overflow-y: auto;
    max-height: 40vh;
    padding: 5px;
    justify-content: center;
  }
  
  .pip-views-game-mode .pip-view {
    background: rgba(30, 30, 50, 0.7);
    border-radius: 10px;
    padding: 8px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
  }
  
  .pip-views-game-mode .pip-view:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  }
  
  .pip-views-game-mode .pip-canvas {
    width: 200px;
    height: 150px;
    border-radius: 6px;
    background: #1a1a2a;
    border: 2px solid rgba(100, 100, 255, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s ease;
  }
  
  .pip-views-game-mode .pip-view:hover .pip-canvas {
    border-color: rgba(120, 120, 255, 0.6);
  }
  
  .pip-views-game-mode .pip-name {
    color: white;
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .pip-views-game-mode .pip-health {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
  }
  
  .pip-views-game-mode .pip-health-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #00cc00, #33ff33);
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
  }
  
  .pip-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
  }
  
  .pip-title {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
  
  .pip-toggle-btn {
    background: rgba(60, 60, 100, 0.6);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
  }
  
  .pip-toggle-btn:hover {
    background: rgba(80, 80, 150, 0.8);
  }
  
  .pip-views-game-mode.collapsed {
    max-height: 40px;
    overflow: hidden;
  }
  
  .pip-views-game-mode.collapsed .pip-views-container {
    display: none;
  }
  
  /* CSS styles for the upgradeMenu to ensure proper formatting and layout */
  #upgradeMenu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: linear-gradient(to bottom, rgba(0, 10, 30, 0.95), rgba(0, 5, 20, 0.95));
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.5);
    text-align: center;
    user-select: none;
    border: 2px solid rgba(100, 200, 255, 0.3);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -55%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
  }

  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }

  .upgrade-title {
    color: #e0f0ff;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.8);
    letter-spacing: 1px;
  }

  .upgrade-timer {
    font-size: 24px;
    font-weight: bold;
    color: #80ffcc;
    margin-bottom: 25px;
    text-shadow: 0 0 8px rgba(0, 255, 150, 0.6);
  }

  .upgrade-timer.low-time {
    color: #ff8080;
    text-shadow: 0 0 8px rgba(255, 50, 50, 0.6);
    animation: pulse 0.5s infinite;
  }

  .upgrade-options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
  }

  .upgrade-option-modern {
    background: linear-gradient(to right, rgba(30, 40, 80, 0.5), rgba(40, 60, 120, 0.5));
    border: 2px solid rgba(100, 150, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }

  .upgrade-option-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
  }

  .upgrade-option-modern:hover {
    background: linear-gradient(to right, rgba(40, 70, 130, 0.6), rgba(60, 100, 180, 0.6));
    border-color: rgba(100, 200, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }

  .upgrade-option-modern:hover::before {
    left: 100%;
  }

  .upgrade-option-modern.selected {
    background: linear-gradient(to right, rgba(50, 100, 200, 0.7), rgba(100, 150, 255, 0.7));
    border-color: rgba(150, 200, 255, 0.8);
    box-shadow: 0 0 15px rgba(100, 150, 255, 0.5);
  }

  .upgrade-option-modern.chosen {
    background: linear-gradient(to right, rgba(0, 150, 50, 0.7), rgba(0, 200, 100, 0.7));
    border-color: rgba(100, 255, 150, 0.8);
    box-shadow: 0 0 15px rgba(0, 200, 100, 0.5);
  }

  .upgrade-option-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  }

  .selected-message {
    color: #00ff80;
    font-size: 22px;
    font-weight: bold;
    margin-top: 15px;
    text-shadow: 0 0 10px rgba(0, 255, 100, 0.8);
    animation: pulse 1.5s infinite;
  }

  /* CSS styles for different resolutions, including mobile phones */
  @media (max-width: 600px) {
    #upgradeMenu {
      width: 95%;
      padding: 20px;
    }
    
    .upgrade-title {
      font-size: 24px;
    }
    
    .upgrade-timer {
      font-size: 20px;
    }
    
    .upgrade-option-modern {
      padding: 12px;
    }
    
    .upgrade-option-text {
      font-size: 16px;
    }
  }
  
  /* Player list and active games styles */
  .player-list, .game-list {
    font-size: 14px;
  }
  
  .player-item, .game-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    margin-bottom: 5px;
    background: rgba(0, 30, 0, 0.6);
    border-radius: 4px;
    border-left: 3px solid #1a3;
  }
  
  .player-name {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .player-ready {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
  }
  
  .ready-yes {
    background: rgba(0, 180, 0, 0.4);
    color: #0f0;
    border: 1px solid #0f0;
  }
  
  .ready-no {
    background: rgba(180, 0, 0, 0.4);
    color: #f66;
    border: 1px solid #f66;
  }
  
  .game-info {
    flex: 1;
    text-align: left;
  }
  
  .game-players {
    color: #0ff;
    font-size: 12px;
  }
  
  .game-round {
    margin-left: 8px;
    padding: 2px 6px;
    background: rgba(0, 100, 180, 0.4);
    color: #0cf;
    border: 1px solid #0cf;
    border-radius: 4px;
    font-size: 12px;
  }

  /* Intermission layout */
  #intermissionMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 90;
    pointer-events: none;
    padding: 20px 0;
  }

  /* Intermission sections */
  .intermission-top {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex: 0 0 auto;
    padding-top: 0;
    margin-top: 0;
    margin-bottom: 0;
  }

  .intermission-middle {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 0 auto;
    margin: auto 0;
  }

  .intermission-bottom {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex: 0 0 auto;
    padding-bottom: 20px;
    margin-top: auto;
  }

  /* Upgrade menu at the top */
  #upgradeMenu {
    width: 90%;
    max-width: 600px;
    background: linear-gradient(to bottom, rgba(0, 10, 30, 0.95), rgba(0, 5, 20, 0.95));
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.5);
    text-align: center;
    user-select: none;
    border: 2px solid rgba(100, 200, 255, 0.3);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
    pointer-events: auto;
    position: relative;
    z-index: 95;
  }

  /* Fix for upgrade menu title and options */
  .upgrade-title {
    font-size: 24px;
    font-weight: bold;
    color: #00ccff;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.7);
  }

  .upgrade-options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
  }

  /* Enemy selector in the middle - horizontal layout */
  #enemySelector {
    position: static;
    transform: none;
    display: flex !important; /* Force display */
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 40, 0.9);
    border-radius: 10px;
    padding: 5px;
    margin: auto 0;
    width: auto;
    max-width: 90%;
    pointer-events: auto;
  }

  .points-display {
    background: rgba(30, 30, 50, 0.8);
    border-radius: 20px;
    padding: 5px 15px;
    margin-right: 15px;
    font-size: 16px;
    color: #FFD700;
  }

  .enemy-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    margin: 0 5px;
    border-radius: 8px;
    background: rgba(30, 30, 60, 0.6);
    cursor: pointer;
    transition: background 0.2s ease;
  }

  /* PiP container at the bottom */
  #pipContainer {
    position: static;
    transform: none;
    width: 90%;
    max-width: 800px;
    max-height: 30vh;
    pointer-events: auto;
  }

  /* Responsive adjustments */
  @media (max-width: 768px) {
    #enemySelector {
      flex-wrap: wrap;
    }
    
    .points-display {
      width: 100%;
      margin-bottom: 10px;
      margin-right: 0;
      text-align: center;
    }
  }
  
  /* Volume Controls */
  .volume-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #1a3;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2), inset 0 0 10px rgba(0, 100, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
    width: 180px;
  }

  .volume-controls.collapsed {
    width: 50px;
    height: 40px;
  }

  .volume-controls.collapsed .volume-sliders {
    display: none;
  }

  .volume-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0, 40, 0, 0.8);
    border-bottom: 1px solid #1a3;
  }

  .volume-title {
    font-size: 14px;
    font-weight: bold;
    color: #3f3;
    text-shadow: 0 0 5px rgba(0, 200, 0, 0.5);
  }

  .volume-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .volume-icon {
    fill: #3f3;
    transition: fill 0.2s ease;
  }

  .volume-toggle-btn:hover .volume-icon {
    fill: #5f5;
  }

  .volume-sliders {
    padding: 10px;
  }

  .volume-control {
    margin-bottom: 10px;
  }

  .volume-control:last-child {
    margin-bottom: 0;
  }

  .volume-label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #0f0;
  }

  .volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(0, 60, 0, 0.6);
    border-radius: 3px;
    outline: none;
  }

  .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3f3;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3f3;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
  }

  .volume-slider::-webkit-slider-thumb:hover,
  .volume-slider::-moz-range-thumb:hover {
    background: #5f5;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.7);
    transform: scale(1.1);
  }

  .volume-slider::-webkit-slider-runnable-track,
  .volume-slider::-moz-range-track {
    height: 6px;
    cursor: pointer;
    background: rgba(0, 60, 0, 0.6);
    border-radius: 3px;
  }

  /* Game end screen styles */
  #gameEndScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
  }
  
  #gameEndContent {
    background-color: rgba(10, 30, 15, 0.8);
    border: 2px solid #0f0;
    border-radius: 10px;
    padding: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
  }
  
  #gameEndTitle {
    font-size: 32px;
    margin-bottom: 20px;
    text-align: center;
    color: #0f0;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
  }
  
  .stats-section {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    padding-bottom: 15px;
  }
  
  .stats-section h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #0f0;
  }
  
  .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 16px;
  }
  
  /* Evolution contribution styles */
  .evolution-contribution {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(0, 40, 0, 0.4);
    border-radius: 8px;
    border-left: 3px solid #0f0;
  }
  
  .evolution-contribution h4 {
    margin: 0 0 10px 0;
    color: #0f0;
    font-size: 16px;
  }
  
  .evolution-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
  }
  
  .evolution-item {
    background-color: rgba(0, 80, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #fff;
    border: 1px solid rgba(0, 255, 0, 0.3);
  }
  
  .evolution-note {
    font-size: 12px;
    color: rgba(0, 255, 0, 0.7);
    font-style: italic;
  }
  
  /* Evolution entry in leaderboard */
  .evolution-entry {
    position: relative;
    border-left: 3px solid #0f0;
    background: linear-gradient(to right, rgba(0, 40, 0, 0.6), rgba(0, 20, 0, 0.4));
    margin-top: 15px;
  }
  
  .evolution-indicator {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
  }
  
  .evolution-indicator.centered {
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
  }
  
  .evolution-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: rgba(0, 60, 0, 0.8);
    border: 1px solid rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
  }
  
  /* Icons for each upgrade type */
  .health-icon::before {
    content: "♥";
    color: #f55;
  }
  
  .damage-icon::before {
    content: "⚔";
    color: #f80;
  }
  
  .attackSpeed-icon::before {
    content: "⚡";
    color: #ff0;
  }
  
  .projectileCount-icon::before {
    content: "⊕";
    color: #0ff;
  }
  
  .pierce-icon::before {
    content: "↗";
    color: #f0f;
  }
  
  .chain-icon::before {
    content: "⛓";
    color: #aaf;
  }
  
  .range-icon::before {
    content: "◎";
    color: #8f8;
  }
  
  .density-icon::before {
    content: "❋";
    color: #fa0;
  }
  
  /* Tooltip styles */
  .evolution-tooltip {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 250px;
    background-color: rgba(0, 20, 0, 0.9);
    border: 1px solid #0f0;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }
  
  .evolution-icon:hover + .evolution-tooltip {
    opacity: 1;
    visibility: visible;
  }
  
  .tooltip-header {
    font-size: 16px;
    color: #0f0;
    margin-bottom: 8px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    padding-bottom: 5px;
  }
  
  .evolution-stats-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  .evolution-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 3px 5px;
    border-radius: 3px;
  }
  
  .evolution-stat-row.most-popular {
    background-color: rgba(0, 80, 0, 0.6);
    font-weight: bold;
    color: #fff;
  }
  
  .stat-label {
    color: rgba(0, 255, 0, 0.8);
  }
  
  .stat-value {
    color: #fff;
  }
  .mode-planet {
    background: linear-gradient(135deg, #1d7a5f, #2f9e6b, #1b5e7a);
    color: #fff;
    box-shadow: 0 0 18px rgba(60, 200, 140, 0.5);
    border: 2px solid #5fd3a0;
  }

  .mode-planet:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 28px rgba(90, 230, 170, 0.75);
    background: linear-gradient(135deg, #22906f, #38b67c, #207090);
  }
