        :root {
          --menu-glow-color: #00ffff; /* Color por defecto */
      }
      body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: #000; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color: #fff; position: relative; overflow: hidden; }
      canvas { border: 2px solid #333; background-color: #111; transition: transform 0.1s; }
      #gamepad-indicator { position: absolute; top: 15px; right: 15px; font-size: 2em; display: none; z-index: 110; text-shadow: 0 0 5px var(--menu-glow-color); }
     .hud { flex-shrink: 0; align-self: flex-start; left: 15px; color: white; z-index: 50; font-size: 1.1em; text-shadow: 1px 1px 3px #000; user-select: none; background-color: rgba(0, 0, 0, 0.7); padding: 15px; border-radius: 10px; box-shadow: 0 0 15px rgba(0, 0, 0, 0.8); border: 1px solid #333; width: 300px; }
      .stat-line { margin-bottom: 15px; }
      .bar-label { margin-bottom: 5px; font-weight: bold; font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px;}
      .bar-container { width: 100%; height: 22px; background-color: #222; border-radius: 5px; position: relative; overflow: hidden; border: 1px solid #555; }
      .bar-fill { height: 100%; transition: width 0.3s ease-out; }
      #health-bar-fill { background: linear-gradient(to right, #e74c3c, #c0392b); box-shadow: 0 0 5px #e74c3c; }
      #xp-bar-fill { background: linear-gradient(to right, #2ecc71, #27ae60); box-shadow: 0 0 5px #2ecc71; }
      .bar-text { position: absolute; width: 100%; text-align: center; line-height: 22px; font-size: 0.8em; font-weight: bold; color: #fff; text-shadow: 1px 1px 2px #000; }
      .info-panel { margin-top: 15px; padding: 12px; border: 1px solid #333; border-radius: 8px; background-color: rgba(0, 0, 0, 0.5); }
      #resource-grid { display: grid; grid-template-columns: 1fr; gap: 8px; font-size: 1.0em; align-items: center; }
      .wave-line, .resource-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: 0.95em;}
      .wave-value, .resource-value { font-weight: bold; }
      .wave-value { color: var(--menu-glow-color); }
      .resource-value { color: #ffaa00; }
      #time-display { text-align: center; font-size: 1.2em; font-weight: bold; color: #9b59b6; padding-top: 10px; border-top: 1px dashed #444; margin-top: 10px; }
      .menu-overlay { position: absolute; 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: 100; }
      .menu-content { background: #222; padding: 30px; border-radius: 10px; box-shadow: 0 0 20px var(--menu-glow-color); text-align: center; border: 1px solid var(--menu-glow-color); }
      .menu-content h2 { color: var(--menu-glow-color); margin-top: 0; text-shadow: 0 0 8px var(--menu-glow-color); }
      .menu-content button, .menu-button { display: block; width: 250px; text-decoration: none; text-align: center; padding: 10px 20px; margin: 15px auto; background-color: var(--menu-glow-color); color: #111; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; font-size: 1.1em; transition: all 0.2s; box-shadow: 0 0 8px var(--menu-glow-color); }
      .menu-content button:hover, .menu-button:hover { background-color: #fff; box-shadow: 0 0 15px #fff; }
      .menu-content button:disabled { background-color: #555; color: #888; cursor: not-allowed; box-shadow: none; }
      .menu-content button.selected, .menu-button.selected { background-color: #ffaa00; color: #111; box-shadow: 0 0 15px #ffaa00; }
      #levelup-menu .menu-content { width: 600px; display: flex; flex-direction: column; }
#character-select-menu .menu-content { width: 850px; display: flex; flex-direction: column; }
      #upgrade-options { display: flex; justify-content: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }

#character-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 15px;
  margin-top: 20px;
  width: 100%;
}
      .upgrade-card, .character-card { background: #333; padding: 15px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; text-align: left; }
      .upgrade-card.selected, .character-card.selected { border-color: #ffaa00; box-shadow: 0 0 15px #ffaa00; transform: scale(1.05); }
      .upgrade-card { width: 180px; }
      .character-card { padding: 10px; font-size: 0.9em; }
      .upgrade-card:hover, .character-card:hover { border-color: var(--menu-glow-color); background: #444; box-shadow: 0 0 10px var(--menu-glow-color); }
      .upgrade-card h3, .character-card h3 { margin-top: 0; color: #4dff4d; font-size: 1.1em; }
      .character-card h3 { font-size: 1.4em; color: var(--menu-glow-color); text-align: center; text-shadow: 0 0 5px var(--menu-glow-color); }
      .upgrade-card p { font-size: 0.8em; color: #ccc; }
      .char-stat { font-weight: bold; color: #4dff4d; }
      .character-card.locked { background-color: #222; opacity: 0.6; cursor: not-allowed; }
      .character-card.locked h3 { color: #888; text-shadow: none; }
      .character-card.locked:hover { border-color: transparent; background-color: #222; box-shadow: none; }
      .buy-button { margin-top: 10px; padding: 8px 15px; background-color: #ffaa00 !important; color: #111 !important; border: none; border-radius: 5px; font-weight: bold; }
      .buy-button:hover:not(:disabled) { background-color: #ffcc66 !important; }
      .buy-button:disabled { background-color: #555 !important; cursor: not-allowed; color: #888 !important; }
      #wave-indicator { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3em; color: white; text-shadow: 0 0 10px var(--menu-glow-color); opacity: 0; transition: opacity 0.5s; pointer-events: none; z-index: 70; }
      #buff-indicator { position: absolute; top: 10px; right: 10px; padding: 8px; background: #333; border: 2px solid #00ff00; border-radius: 5px; font-size: 0.9em; text-align: right; transition: border-color 0.5s; display: none; z-index: 60; }
      #buff-name { color: #ffcc00; font-weight: bold; }
      #buff-time { color: white; margin-left: 5px; }
      #rebirth-button { position: fixed; top: 10px; right: 110px; padding: 8px 15px; background: #9b59b6; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 1.1em; font-weight: bold; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); transition: background 0.1s; z-index: 60; }
      #rebirth-button:hover:not(:disabled) { background: #8e44ad; }
      #rebirth-button:disabled { background: #555; cursor: not-allowed; color: #bbb; }
      #admin-menu .menu-content { width: 80%; max-width: 900px; }
      #boss-health-container { display: none; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 500px; text-align: center; z-index: 100; }
      #boss-name { color: white; font-weight: bold; font-size: 1.2em; text-shadow: 2px 2px 4px #000; margin-bottom: 5px; }
      #boss-health-bar { width: 100%; height: 25px; background-color: #333; border: 2px solid #fff; border-radius: 5px; padding: 2px; }
      #boss-health-fill { height: 100%; width: 100%; background-color: #8e44ad; border-radius: 3px; transition: width 0.2s ease-out; }
      #roulette-menu .menu-content { width: 90%; max-width: 1000px; height: 150px; overflow: hidden; position: relative; }
      #roulette-wheel { display: flex; position: absolute; top: 0; left: 0; height: 100%; transition: left 3s cubic-bezier(0.25, 0.1, 0.25, 1); }
      #roulette-menu .upgrade-card { flex-shrink: 0; }
      #roulette-selector { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 4px; height: 100%; background-color: var(--menu-glow-color); box-shadow: 0 0 10px var(--menu-glow-color); }
      
      /* Estilos del Árbol de Talentos, Configuraciones y Logros */
      #talent-tree-menu .menu-content, #settings-menu .menu-content, #achievements-menu .menu-content { width: 80%; max-width: 950px; }
      #talent-tree-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
      #talent-points-display { font-size: 1.2em; color: #9b59b6; font-weight: bold; }
      #talent-tree-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
      .talent-card { background: #333; border: 2px solid #555; padding: 15px; border-radius: 8px; text-align: left; cursor: pointer; transition: all 0.2s; position: relative;}
      .talent-card.unlocked { border-color: var(--menu-glow-color); }
      .talent-card.maxed { border-color: #ffaa00; background-color: #444; }
      .talent-card.locked { background: #222; color: #666; cursor: not-allowed; }
      .talent-card h3 { margin-top: 0; color: #4dff4d; font-size: 1.1em; }
      .talent-card p { font-size: 0.8em; color: #ccc; margin-bottom: 10px; }
      .talent-card .cost, .talent-card .level { font-size: 0.9em; font-weight: bold; }
      .talent-card .cost { color: #9b59b6; }
      .talent-card .level { color: #ffaa00; }
      .talent-card.locked h3, .talent-card.locked p { color: #777; }
      .talent-card.locked .cost, .talent-card.locked .level { color: #555; }
      .talent-req { position: absolute; top: -10px; left: -10px; background: #c0392b; color: white; padding: 2px 5px; font-size: 0.7em; border-radius: 5px;}
      .settings-option { display: flex; justify-content: space-between; align-items: center; max-width: 400px; margin: 20px auto; font-size: 1.2em; }
      .toggle-switch { position: relative; display: inline-block; width: 60px; height: 34px; }
      .toggle-switch input { opacity: 0; width: 0; height: 0; }
      .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #555; transition: .4s; border-radius: 34px; }
      .slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
      input:checked + .slider { background-color: var(--menu-glow-color); }
      input:checked + .slider:before { transform: translateX(26px); }
      .achievement-card { background: #333; border: 2px solid #555; padding: 10px; border-radius: 8px; opacity: 0.5; text-align: center; }
      .achievement-card.unlocked { opacity: 1; border-color: #ffaa00; }
      .achievement-card h4 { margin: 0 0 5px 0; color: #ffcc66; font-size: 1em; }
      .achievement-card p { font-size: 0.75em; color: #ccc; margin: 0; }
      #color-swatches { display: flex; justify-content: center; gap: 15px; margin-top: 10px; }
      .color-swatch { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 3px solid #555; transition: all 0.2s; }
      .color-swatch:hover { transform: scale(1.1); }
      .color-swatch.selected { border-color: #fff; box-shadow: 0 0 10px #fff; }
      #char-card-STANDARD { grid-area: 1 / 1 / 2 / 2; }
#char-card-SNIPER { grid-area: 1 / 2 / 2 / 3; }
#char-card-TANK { grid-area: 1 / 3 / 2 / 4; }
#char-card-SUMMONER { grid-area: 1 / 4 / 3 / 5; } /* Ocupa dos filas */
#char-card-MAGE { grid-area: 2 / 1 / 3 / 2; }
#char-card-BARBARIAN { grid-area: 2 / 2 / 3 / 3; }
#char-card-CLERIC { grid-area: 2 / 3 / 3 / 4; }
  #inventory-menu .menu-content { 
          width: 80%; 
          max-width: 900px; 
      }
      #inventory-grid {
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
          gap: 15px;
          margin-top: 20px;
          max-height: 400px;
          overflow-y: auto;
          padding: 15px;
          background: #111;
          border-radius: 8px;
          border: 1px solid #444;
      }
      .inventory-card {
          background: #333;
          border: 1px solid var(--menu-glow-color);
          padding: 12px;
          border-radius: 5px;
          text-align: left;
          box-shadow: 0 0 8px var(--menu-glow-color);
      }
      .inventory-card h3 {
          color: #4dff4d;
          font-size: 1.1em;
          margin-top: 0;
          margin-bottom: 8px;
      }
      .inventory-card p {
          font-size: 1em;
          color: #fff;
          margin: 0;
          font-weight: bold;
      }
      .inventory-card .level-text {
          color: #ffcc66;
      }
      .inventory-card .evo-text {
          color: #ffaa00;
          font-weight: bold;
          text-shadow: 0 0 5px #ffaa00;
      }
      #fpsCounter {
        position: fixed;
        top: 10px;
        right: 10px;
        color: #00ff00; /* Color verde inicial */
        font-family: 'Courier New', Courier, monospace;
        font-weight: bold;
        background: rgba(0, 0, 0, 0.7); /* Fondo negro transparente */
        padding: 8px;
        border: 1px solid #444;
        border-radius: 5px;
        z-index: 1000;
        min-width: 70px;
        text-align: center;
        pointer-events: none;
    }
/* --- NUEVA TIENDA LATERAL (ESTILO TURQUESA) --- */

/* Contenedor para poner canvas y tienda juntos */
#game-run-container {
    display: flex;
    flex-direction: row; /* Uno al lado del otro */
    align-items: flex-start;
    justify-content: center;
    gap: 15px; /* Espacio entre el juego y la tienda */
    margin: 20px auto;
}

/* El panel principal de la tienda (Estilo Captura 1 - Verde) */
#in-game-shop {
    width: 280px;
    height: 600px; /* Misma altura que tu canvas */
    background: rgba(10, 10, 15, 0.95); /* Fondo oscuro profundo */
    border: 3px solid var(--menu-glow-color); /* Borde de Neón Turquesa brillante */
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5); /* Resplandor exterior */
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto; /* Por si añades muchas mejoras */
    font-family: 'Courier New', Courier, monospace; /* Fuente retro/ciberpunk */
}

/* El título que brilla */
.shop-header {
    color: var(--menu-glow-color);
    text-align: center;
    text-shadow: 0 0 10px var(--menu-glow-color);
    margin-top: 0;
    font-size: 1.3em;
}

/* El contador de score dentro de la tienda */
.shop-score-counter {
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1em;
}

/* Contenedor de las filas */
#run-upgrades-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Fila de mejora (Layout Captura 2 - Azul: Icono | Nombre | Botón) */
.upgrade-item {
    display: flex;
    align-items: center; /* Alinea los elementos verticalmente */
    justify-content: space-between; /* Espacio entre el texto y el botón */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px;
    transition: background 0.2s;
}

.upgrade-item:hover {
    background: rgba(0, 255, 255, 0.1);
}

/* El bloque de icono y info juntos */
.upgrade-info-block {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

/* El Icono del objeto */
.upgrade-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em; /* Emojis o iconos grandes */
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

/* El Nombre y Stats que brillan en turquesa */
.upgrade-text {
    display: flex;
    flex-direction: column;
}

.upgrade-name {
    font-weight: bold;
    color: var(--menu-glow-color);
    text-shadow: 0 0 5px var(--menu-glow-color);
    font-size: 0.9em;
}

.upgrade-stats {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.7);
}

/* El botón que brilla (Precio) */
.buy-button {
    background: transparent;
    color: var(--menu-glow-color);
    border: 2px solid var(--menu-glow-color);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.8em;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    text-shadow: 0 0 5px var(--menu-glow-color);
    transition: all 0.2s;
}

.buy-button:hover:not(:disabled) {
    background: var(--menu-glow-color);
    color: #000;
    box-shadow: 0 0 15px var(--menu-glow-color);
}

.buy-button:disabled {
    color: #555;
    border-color: #555;
    text-shadow: none;
    cursor: not-allowed;
}
.shop-score-counter {
    display: none;
}
/* ==========================================
   ESTILOS DEL MENÚ DE PARTIDAS GUARDADAS
   ========================================== */

/* Contenedor de cada fila de partida */
.partida-item {
    background: rgba(255, 255, 255, 0.1);
    margin: 10px auto;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--menu-glow-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
    cursor: pointer;
    width: 90%; /* Para que no pegue a los bordes */
    box-sizing: border-box;
}

/* Efecto al pasar el ratón por encima */
.partida-item:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: scale(1.02);
    border-color: #fff;
}

/* Columna de la izquierda (Fecha, Hora, Ronda) */
.partida-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.partida-fecha { 
    font-size: 0.85em; 
    color: #ccc; 
}

.partida-hora { 
    font-weight: bold; 
    color: var(--menu-glow-color); 
    font-size: 1.1em;
}

/* Columna de la derecha (Puntos) */
.partida-puntos { 
    font-size: 1.1em; 
    font-weight: bold; 
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Scroll personalizado para la lista si hay muchas partidas */
#lista-partidas::-webkit-scrollbar {
    width: 8px;
}
#lista-partidas::-webkit-scrollbar-thumb {
    background: var(--menu-glow-color);
    border-radius: 4px;
}
