* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
    }

    html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background-color: #040814;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      touch-action: none;
    }

    #stageContainer {
      position: absolute;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: radial-gradient(circle at 50% 50%, #0c1733 0%, #060b1a 60%, #03060f 100%);
    }

    canvas {
      display: block;
      image-rendering: -moz-crisp-edges;
      image-rendering: -webkit-crisp-edges;
      image-rendering: pixelated;
      image-rendering: crisp-edges;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
      border: 1px solid rgba(56, 189, 248, 0.22);
      transform: translateZ(0);
      backface-visibility: hidden;
    }

    /* =========================================================================
       PANTALLA DE INICIO / TITLE SCREEN (WEBP ARTWORK & CINEMATIC OVERLAY)
       ========================================================================= */
    #startScreen {
      position: fixed;
      inset: 0;
      z-index: 2000;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: #040814;
      overflow: hidden;
      cursor: pointer;
      opacity: 1;
      visibility: visible;
      transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.55s ease;
    }

    #startScreen.hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      display: none !important;
    }

    .start-backdrop {
      position: absolute;
      inset: 0;
      background-image: url('../backgorudn/Archer_fighting_slimes_20261001114511.webp');
      background-size: cover;
      background-position: center 30%;
      filter: brightness(0.88) contrast(1.05);
      transform: scale(1.02);
      animation: kenBurns 14s infinite alternate ease-in-out;
    }

    @keyframes kenBurns {
      0% { transform: scale(1.0) translate(0, 0); }
      100% { transform: scale(1.04) translate(-0.8%, -0.8%); }
    }

    .start-overlay {
      position: relative;
      z-index: 2;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      padding: calc(env(safe-area-inset-top, 16px) + 20px) 20px calc(env(safe-area-inset-bottom, 16px) + 24px);
      background: radial-gradient(circle at 50% 50%, rgba(4, 8, 20, 0.15) 0%, rgba(4, 8, 20, 0.65) 70%, rgba(4, 8, 20, 0.92) 100%);
    }

    .start-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      margin-top: 4px;
    }

    .start-badges {
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      margin-bottom: 4px;
    }

    .start-badge {
      font-family: 'JetBrains Mono', monospace;
      font-size: clamp(9px, 2.2vw, 11px);
      letter-spacing: 2.5px;
      color: #38bdf8;
      text-transform: uppercase;
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(56, 189, 248, 0.45);
      padding: 4px 12px;
      border-radius: 20px;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
    }

    .demo-badge {
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(217, 119, 6, 0.32) 100%);
      border-color: rgba(251, 191, 36, 0.65);
      color: #fbbf24;
      font-weight: 800;
      box-shadow: 0 0 20px rgba(245, 158, 11, 0.45);
      animation: demoPulse 2.4s infinite ease-in-out;
    }

    @keyframes demoPulse {
      0%, 100% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.35); }
      50% { box-shadow: 0 0 26px rgba(245, 158, 11, 0.7); }
    }

    .start-logo {
      width: clamp(230px, 44vw, 380px);
      max-height: clamp(90px, 20vh, 160px);
      object-fit: contain;
      filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 30px rgba(56, 189, 248, 0.5));
      animation: logoFloat 4s ease-in-out infinite alternate;
      user-select: none;
      -webkit-user-select: none;
      pointer-events: none;
      margin: 4px 0 2px;
    }

    @keyframes logoFloat {
      0% { transform: translateY(0px) scale(1); }
      100% { transform: translateY(-5px) scale(1.02); }
    }

    .start-subtitle {
      font-family: 'Outfit', sans-serif;
      font-size: clamp(11.5px, 2.5vw, 14px);
      color: #cbd5e1;
      font-weight: 600;
      letter-spacing: 0.5px;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
      margin-top: 2px;
    }

    .start-footer {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      margin-bottom: 8px;
    }

    .start-play-btn {
      background: linear-gradient(135deg, #0284c7 0%, #0369a1 55%, #082f49 100%);
      border: 2.5px solid #38bdf8;
      color: #ffffff;
      padding: clamp(12px, 3vw, 15px) clamp(28px, 6vw, 42px);
      border-radius: 40px;
      font-family: 'Outfit', sans-serif;
      font-size: clamp(14px, 3.5vw, 17px);
      font-weight: 800;
      letter-spacing: 1.5px;
      box-shadow: 0 0 35px rgba(56, 189, 248, 0.65), 0 8px 24px rgba(0, 0, 0, 0.7);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 10px;
      animation: startBtnPulse 2.2s infinite ease-in-out;
      touch-action: manipulation;
    }

    .start-play-btn:active {
      transform: scale(0.95);
      filter: brightness(1.2);
    }

    @keyframes startBtnPulse {
      0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 25px rgba(56, 189, 248, 0.5), 0 8px 24px rgba(0, 0, 0, 0.7);
      }
      50% {
        transform: scale(1.04);
        box-shadow: 0 0 45px rgba(56, 189, 248, 0.85), 0 10px 30px rgba(0, 0, 0, 0.8);
      }
    }

    .start-hint {
      font-family: 'JetBrains Mono', monospace;
      font-size: clamp(10px, 2.1vw, 11.5px);
      font-weight: 700;
      color: #94a3b8;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      margin-top: 8px;
      text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
      animation: startHintBlink 1.8s infinite ease-in-out;
    }

    @keyframes startHintBlink {
      0%, 100% { opacity: 0.65; }
      50% { opacity: 1; }
    }

    .start-community {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 8px;
    }

    .discord-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(88, 101, 242, 0.28);
      border: 1.5px solid rgba(129, 140, 248, 0.7);
      color: #e0e7ff;
      padding: 6px 16px;
      border-radius: 20px;
      font-family: 'Outfit', sans-serif;
      font-size: clamp(11.5px, 2.6vw, 13px);
      font-weight: 700;
      letter-spacing: 0.8px;
      text-decoration: none;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 0 22px rgba(88, 101, 242, 0.4);
      transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
      touch-action: manipulation;
      pointer-events: auto;
    }

    .discord-btn:active, .discord-btn:hover {
      background: rgba(88, 101, 242, 0.55);
      border-color: #a5b4fc;
      color: #ffffff;
      transform: scale(1.04);
      box-shadow: 0 0 32px rgba(88, 101, 242, 0.75);
    }

    .discord-icon {
      flex-shrink: 0;
      filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
    }

    .top-pill-btn.discord-top-btn {
      border-color: rgba(88, 101, 242, 0.55);
      color: #c7d2fe;
      text-decoration: none;
    }

    .top-pill-btn.discord-top-btn:active {
      background: rgba(88, 101, 242, 0.4);
      border-color: #818cf8;
      color: #ffffff;
    }

    /* =========================================================================
       CONTROLES TÁCTILES MÓVILES (GLASSMORPHISM / CONSOLA PORTÁTIL)
       ========================================================================= */
    #touchControls {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 1000;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      padding: calc(env(safe-area-inset-bottom, 14px) + 10px) calc(env(safe-area-inset-right, 20px) + 14px) calc(env(safe-area-inset-bottom, 14px) + 10px) calc(env(safe-area-inset-left, 20px) + 14px);
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    #touchControls.visible {
      opacity: 1;
      visibility: visible;
    }

    /* PALANCA ANALÓGICA TÁCTIL (VIRTUAL THUMBSTICK ERGONÓMICO) */
    .touch-stick-zone {
      position: relative;
      width: 190px;
      height: 190px;
      pointer-events: auto;
      touch-action: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .stick-base {
      position: relative;
      width: 156px;
      height: 156px;
      border-radius: 50%;
      background: radial-gradient(circle at 40% 40%, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.96) 70%, rgba(4, 8, 20, 0.98) 100%);
      border: 2px solid rgba(56, 189, 248, 0.38);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(56, 189, 248, 0.12);
      display: flex;
      align-items: center;
      justify-content: center;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
      transform: translateZ(0);
    }

    .stick-ring {
      position: absolute;
      width: 96px;
      height: 96px;
      border-radius: 50%;
      border: 1px dashed rgba(56, 189, 248, 0.25);
      pointer-events: none;
    }

    .stick-guide {
      position: absolute;
      font-size: 11px;
      font-weight: 800;
      color: rgba(56, 189, 248, 0.45);
      pointer-events: none;
      transition: color 0.1s ease, transform 0.1s ease, text-shadow 0.1s ease;
    }
    .stick-guide.guide-up    { top: 8px; left: 50%; transform: translateX(-50%); }
    .stick-guide.guide-down  { bottom: 8px; left: 50%; transform: translateX(-50%); }
    .stick-guide.guide-left  { left: 8px; top: 50%; transform: translateY(-50%); }
    .stick-guide.guide-right { right: 8px; top: 50%; transform: translateY(-50%); }

    .stick-guide.active {
      color: #38bdf8;
      text-shadow: 0 0 12px #38bdf8;
    }
    .stick-guide.guide-up.active    { transform: translateX(-50%) scale(1.35); }
    .stick-guide.guide-down.active  { transform: translateX(-50%) scale(1.35); }
    .stick-guide.guide-left.active  { transform: translateY(-50%) scale(1.35); }
    .stick-guide.guide-right.active { transform: translateY(-50%) scale(1.35); }

    /* Perilla / Pomo de la Palanca */
    .stick-knob {
      position: absolute;
      width: 66px;
      height: 66px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, #38bdf8 0%, #0284c7 50%, #0c4a6e 100%);
      border: 2.5px solid rgba(255, 255, 255, 0.7);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 22px rgba(56, 189, 248, 0.65), inset 0 2px 4px rgba(255, 255, 255, 0.6);
      display: flex;
      align-items: center;
      justify-content: center;
      touch-action: none;
      transform: translate3d(0, 0, 0);
      will-change: transform;
      pointer-events: none;
    }

    .stick-knob.returning {
      transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .knob-core {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: radial-gradient(circle at 40% 40%, #ffffff 0%, rgba(255, 255, 255, 0.4) 60%, transparent 100%);
      opacity: 0.85;
      box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
      pointer-events: none;
    }

    /* BOTONES DE ACCIÓN (DERECHA) */
    .touch-actions {
      position: relative;
      width: 270px;
      height: 210px;
      pointer-events: auto;
      touch-action: none;
    }

    .act-btn {
      position: absolute;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      font-family: 'Outfit', sans-serif;
      font-weight: 800;
      touch-action: manipulation;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
      transition: transform 0.08s ease, opacity 0.08s ease;
      overflow: hidden;
      transform: translateZ(0);
      will-change: transform;
    }

    .act-btn:active, .act-btn.pressed {
      transform: scale(0.91) translateZ(0);
      opacity: 0.88;
    }

    /* Botón Grande: Disparo Primario */
    .btn-shoot {
      right: 12px;
      bottom: 58px;
      width: 82px;
      height: 82px;
      background: radial-gradient(circle at 35% 35%, #f59e0b 0%, #d97706 55%, #78350f 100%);
      border: 2.5px solid #fbbf24;
      color: #ffffff;
      font-size: 28px;
      box-shadow: 0 0 18px rgba(245, 158, 11, 0.45), 0 4px 14px rgba(0, 0, 0, 0.7);
    }
    .btn-shoot .btn-label {
      font-size: 9.5px;
      letter-spacing: 0.6px;
      font-weight: 800;
      color: #fef3c7;
      margin-top: 1px;
    }

    /* Botón Grande: Salto */
    .btn-jump {
      right: 104px;
      bottom: 0px;
      width: 76px;
      height: 76px;
      background: radial-gradient(circle at 35% 35%, #0284c7 0%, #0369a1 55%, #082f49 100%);
      border: 2.5px solid #38bdf8;
      color: #ffffff;
      font-size: 24px;
      box-shadow: 0 0 18px rgba(56, 189, 248, 0.45), 0 4px 14px rgba(0, 0, 0, 0.7);
    }
    .btn-jump .btn-label {
      font-size: 9.5px;
      letter-spacing: 0.6px;
      font-weight: 800;
      color: #e0f2fe;
    }

    /* Satélite: Dash */
    .btn-dash {
      right: 190px;
      bottom: 12px;
      width: 56px;
      height: 56px;
      background: radial-gradient(circle at 40% 40%, rgba(58, 30, 95, 0.92) 0%, rgba(24, 18, 43, 0.96) 100%);
      border: 1.8px solid #a855f7;
      color: #c084fc;
      font-size: 19px;
      box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
    }
    .btn-dash .btn-label {
      font-size: 8px;
      color: #e9d5ff;
      letter-spacing: 0.5px;
    }

    /* Satélite: Flecha Triple */
    .btn-triple {
      right: 108px;
      bottom: 92px;
      width: 56px;
      height: 56px;
      background: radial-gradient(circle at 40% 40%, rgba(20, 60, 48, 0.92) 0%, rgba(10, 30, 24, 0.96) 100%);
      border: 1.8px solid #10b981;
      color: #34d399;
      font-size: 18px;
      box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
    }
    .btn-triple .btn-label {
      font-size: 8px;
      color: #a7f3d0;
      letter-spacing: 0.5px;
    }

    /* Satélite: Flecha Mágica */
    .btn-magic {
      right: 22px;
      bottom: 154px;
      width: 56px;
      height: 56px;
      background: radial-gradient(circle at 40% 40%, rgba(70, 24, 56, 0.92) 0%, rgba(35, 12, 28, 0.96) 100%);
      border: 1.8px solid #ec4899;
      color: #f472b6;
      font-size: 18px;
      box-shadow: 0 0 12px rgba(236, 72, 153, 0.35);
    }
    .btn-magic .btn-label {
      font-size: 8px;
      color: #fbcfe8;
      letter-spacing: 0.5px;
    }

    /* Cooldown Overlay en Satélites */
    .act-btn .cooldown-overlay {
      position: absolute;
      inset: 0;
      background: rgba(5, 10, 25, 0.82);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      color: #ffffff;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.12s ease;
    }
    .act-btn.on-cooldown .cooldown-overlay {
      opacity: 1;
    }

    /* BARRA SUPERIOR RÁPIDA (FULLSCREEN, MÚSICA, TOGGLE TOUCH) */
    .mobile-top-bar {
      position: fixed;
      top: calc(env(safe-area-inset-top, 6px) + 8px);
      right: calc(env(safe-area-inset-right, 14px) + 10px);
      display: flex;
      gap: 6px;
      pointer-events: auto;
      z-index: 10005;
      transition: opacity 0.3s ease;
    }

    /* Ocultar barra superior en la pantalla de bienvenida/inicio para mantenerla limpia y cinematográfica */
    #startScreen:not(.hidden) ~ .mobile-top-bar {
      opacity: 0;
      pointer-events: none;
    }

    .top-pill-btn {
      background: rgba(15, 23, 42, 0.94);
      border: 1.5px solid rgba(56, 189, 248, 0.40);
      color: #e2e8f0;
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 11.5px;
      font-weight: 700;
      font-family: 'JetBrains Mono', monospace;
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
      touch-action: manipulation;
      min-height: 36px;
      user-select: none;
      -webkit-user-select: none;
      -webkit-tap-highlight-color: transparent;
      transform: translateZ(0);
      transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
    }

    .top-pill-btn:active {
      background: rgba(56, 189, 248, 0.35);
      border-color: #38bdf8;
      transform: scale(0.92) translateZ(0);
    }

    @media (max-width: 900px) {
      .mobile-top-bar {
        gap: 5px;
        top: calc(env(safe-area-inset-top, 4px) + 6px);
        right: calc(env(safe-area-inset-right, 10px) + 8px);
      }
      .top-pill-btn {
        padding: 5px 9px;
        font-size: 11px;
        min-height: 34px;
      }
    }

    /* =========================================================================
       MODAL DE CONFIGURACIONES (SETTINGS MODAL GLASSMORPHISM)
       ========================================================================= */
    .settings-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(4, 8, 20, 0.88);
      z-index: 10020;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 1;
      visibility: visible;
      transition: opacity 0.22s ease, visibility 0.22s ease;
      padding: 16px;
    }

    .settings-modal-backdrop.hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      display: none !important;
    }

    .settings-card {
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(8, 14, 28, 0.98) 100%);
      border: 1.5px solid rgba(56, 189, 248, 0.45);
      border-radius: 20px;
      width: min(440px, 92vw);
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 0 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(56, 189, 248, 0.25);
      display: flex;
      flex-direction: column;
      animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      scrollbar-width: thin;
      scrollbar-color: rgba(56, 189, 248, 0.35) transparent;
    }

    .settings-card::-webkit-scrollbar {
      width: 5px;
    }
    .settings-card::-webkit-scrollbar-track {
      background: transparent;
    }
    .settings-card::-webkit-scrollbar-thumb {
      background: rgba(56, 189, 248, 0.35);
      border-radius: 4px;
    }

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

    .settings-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 20px;
      border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    }

    .settings-title-group {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .settings-title-group h3 {
      font-family: 'Cinzel', serif;
      font-size: 16px;
      color: #38bdf8;
      letter-spacing: 1.5px;
      font-weight: 800;
      margin: 0;
    }

    .btn-close-settings {
      background: rgba(30, 41, 59, 0.7);
      border: 1px solid rgba(148, 163, 184, 0.3);
      color: #94a3b8;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      cursor: pointer;
      transition: background 0.15s, color 0.15s, transform 0.15s;
      touch-action: manipulation;
    }

    .btn-close-settings:active {
      transform: scale(0.9);
      background: rgba(239, 68, 68, 0.4);
      color: #ffffff;
    }

    .settings-body {
      padding: 14px 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .setting-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(2, 6, 23, 0.6);
      border: 1px solid rgba(56, 189, 248, 0.15);
      border-radius: 12px;
      padding: 10px 14px;
      gap: 12px;
    }

    .setting-text {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .setting-name {
      font-family: 'Outfit', sans-serif;
      font-weight: 700;
      font-size: 13.5px;
      color: #f1f5f9;
    }

    .setting-hint {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10.5px;
      color: #94a3b8;
    }

    .setting-btn-toggle {
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      font-weight: 800;
      padding: 6px 16px;
      border-radius: 20px;
      border: 1.5px solid rgba(74, 222, 128, 0.5);
      background: rgba(34, 197, 94, 0.2);
      color: #4ade80;
      cursor: pointer;
      min-width: 62px;
      text-align: center;
      transition: all 0.15s ease;
      touch-action: manipulation;
    }

    .setting-btn-toggle.off {
      border-color: rgba(239, 68, 68, 0.5);
      background: rgba(239, 68, 68, 0.18);
      color: #f87171;
    }

    .setting-btn-action {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px;
      font-weight: 700;
      padding: 6px 14px;
      border-radius: 20px;
      border: 1.5px solid rgba(56, 189, 248, 0.45);
      background: rgba(14, 165, 233, 0.2);
      color: #38bdf8;
      cursor: pointer;
      min-width: 80px;
      text-align: center;
      transition: all 0.15s ease;
      touch-action: manipulation;
    }

    .setting-btn-action:active {
      transform: scale(0.94);
      background: rgba(14, 165, 233, 0.4);
    }

    .setting-btn-action.btn-danger {
      border-color: rgba(245, 158, 11, 0.45);
      background: rgba(245, 158, 11, 0.15);
      color: #fbbf24;
    }

    .setting-btn-action.btn-danger:active {
      background: rgba(245, 158, 11, 0.35);
    }

    .settings-footer {
      padding: 12px 20px 16px;
      border-top: 1px solid rgba(56, 189, 248, 0.15);
      display: flex;
      justify-content: center;
    }

    .settings-discord-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(88, 101, 242, 0.25);
      border: 1px solid rgba(129, 140, 248, 0.5);
      color: #e0e7ff;
      padding: 6px 16px;
      border-radius: 16px;
      font-family: 'Outfit', sans-serif;
      font-size: 12px;
      font-weight: 700;
      text-decoration: none;
      transition: background 0.15s, transform 0.15s;
      touch-action: manipulation;
    }

    .settings-discord-btn:active {
      transform: scale(0.96);
      background: rgba(88, 101, 242, 0.5);
    }

    /* MODAL DE ADVERTENCIA PARA ORIENTACIÓN VERTICAL (PORTRAIT) */
    #portraitWarning {
      position: fixed;
      inset: 0;
      background: rgba(4, 8, 20, 0.97);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      z-index: 99999;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 32px 24px;
      color: #ffffff;
    }

    #portraitWarning .phone-icon {
      font-size: 56px;
      margin-bottom: 22px;
      animation: rotatePhone 2.2s infinite ease-in-out;
      display: inline-block;
      filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.6));
    }

    @keyframes rotatePhone {
      0%, 15% { transform: rotate(0deg); }
      50%, 75% { transform: rotate(90deg); }
      90%, 100% { transform: rotate(90deg); }
    }

    #portraitWarning h2 {
      font-family: 'Cinzel', serif;
      font-size: clamp(18px, 5.2vw, 24px);
      font-weight: 800;
      color: #38bdf8;
      letter-spacing: 1.5px;
      margin-bottom: 12px;
      text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
      max-width: 90vw;
    }

    #portraitWarning p {
      font-family: 'Outfit', sans-serif;
      font-size: clamp(13px, 3.6vw, 14.5px);
      color: #94a3b8;
      max-width: 300px;
      line-height: 1.55;
      margin-bottom: 26px;
    }

    .btn-fullscreen-launch {
      background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
      color: #ffffff;
      border: 1.5px solid #38bdf8;
      padding: 12px 22px;
      border-radius: 14px;
      font-family: 'Outfit', sans-serif;
      font-weight: 800;
      font-size: clamp(12px, 3.4vw, 14px);
      letter-spacing: 0.8px;
      box-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
      cursor: pointer;
      touch-action: manipulation;
      max-width: 90vw;
    }
    .btn-fullscreen-launch:active {
      transform: scale(0.95);
    }

    @media (orientation: portrait) and (max-width: 1024px) {
      #touchControls {
        display: none !important;
      }
      #mobileTopBar {
        display: none !important;
      }
      #portraitWarning {
        display: flex !important;
      }
    }

    /* =========================================================================
       NUEVAS CARACTERÍSTICAS: REANUDAR, BRANDING WIZARDEV Y ADAPTACIÓN ANDROID
       ========================================================================= */

    /* Botón Reanudar Partida */
    .setting-btn-resume {
      width: 100%;
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.40) 0%, rgba(5, 150, 105, 0.50) 100%);
      border: 1.8px solid #10b981;
      color: #ecfdf5;
      font-family: 'Cinzel', serif;
      font-size: 13.5px;
      font-weight: 800;
      letter-spacing: 1.5px;
      padding: 11px 16px;
      border-radius: 12px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
      transition: all 0.15s ease;
      touch-action: manipulation;
    }
    .setting-btn-resume:hover, .setting-btn-resume:active {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.60) 0%, rgba(5, 150, 105, 0.70) 100%);
      transform: scale(0.98);
      box-shadow: 0 0 24px rgba(16, 185, 129, 0.5);
    }
    .setting-btn-resume .resume-icon {
      font-size: 15px;
      color: #34d399;
    }

    /* Branding WizzarDev Studios en Start Screen */
    .studio-brand-header {
      margin-bottom: 6px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .studio-brand-link {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      text-decoration: none;
      background: rgba(15, 23, 42, 0.85);
      border: 1.2px solid rgba(168, 85, 247, 0.45);
      padding: 5px 14px;
      border-radius: 20px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
      transition: transform 0.15s, border-color 0.15s;
    }
    .studio-brand-link:hover, .studio-brand-link:active {
      transform: scale(1.04);
      border-color: #c084fc;
    }
    .studio-brand-icon {
      width: 18px;
      height: 18px;
      object-fit: contain;
      border-radius: 4px;
    }
    .studio-brand-text {
      font-family: 'Cinzel', serif;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 1.5px;
      color: #e9d5ff;
      text-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
    }

    /* Botón Studio en Footer de Bienvenida */
    .discord-btn.studio-btn {
      background: rgba(88, 28, 135, 0.4);
      border-color: rgba(168, 85, 247, 0.45);
      color: #e9d5ff;
    }
    .discord-btn.studio-btn:hover, .discord-btn.studio-btn:active {
      background: rgba(168, 85, 247, 0.35);
      border-color: #c084fc;
    }

    /* Branding Card en Footer de Configuración */
    .settings-studio-card {
      margin-bottom: 8px;
      width: 100%;
    }
    .studio-footer-link {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      text-decoration: none;
      background: rgba(2, 6, 23, 0.7);
      border: 1px solid rgba(168, 85, 247, 0.3);
      padding: 8px 14px;
      border-radius: 12px;
      transition: all 0.15s ease;
    }
    .studio-footer-link:hover, .studio-footer-link:active {
      background: rgba(168, 85, 247, 0.15);
      border-color: #a855f7;
    }
    .studio-footer-icon {
      width: 24px;
      height: 24px;
      object-fit: contain;
      border-radius: 4px;
    }
    .studio-footer-info {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 1px;
    }
    .studio-footer-name {
      font-family: 'Outfit', sans-serif;
      font-size: 12px;
      font-weight: 700;
      color: #f1f5f9;
      letter-spacing: 0.5px;
    }
    .studio-footer-url {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px;
      color: #c084fc;
    }

    /* ANDROID ADAPTATIONS: Ocultar botón de maximizar en Android */
    body.is-android #settingFullscreenRow,
    body.is-android #btnLaunchLandscape {
      display: none !important;
    }

    @media (max-height: 480px) {
      .settings-card {
        max-height: 94vh;
        width: min(460px, 94vw);
      }
      .settings-header {
        padding: 8px 16px;
      }
      .settings-body {
        padding: 8px 16px;
        gap: 6px;
      }
      .setting-item {
        padding: 5px 12px;
      }
      .setting-btn-resume {
        padding: 8px 12px;
        font-size: 12px;
      }
      .settings-footer {
        padding: 8px 16px;
      }
      .settings-studio-card {
        margin-bottom: 4px;
      }
      .studio-footer-link {
        padding: 5px 10px;
      }
    }

