.action-panel {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0 0 0;
  flex-wrap: wrap;
  align-items: center;
  background: var(--panel-bg);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 0 20px #00e2ff33, inset 0 0 10px rgba(0, 226, 255, 0.1);
  border: 1px solid rgba(0, 226, 255, 0.15);
  backdrop-filter: blur(5px);
  width: 100%;
  max-width: 350px;
}

.action-btn {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.1em;
  font-weight: 600;
  padding: 16px 26px;
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(0, 226, 255, 0.1) 30%, 
    rgba(0, 226, 255, 0.15) 70%, 
    rgba(0, 0, 0, 0.7) 100%);
  color: #00e2ff;
  border: 2px solid rgba(0, 226, 255, 0.5);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 226, 255, 0.2), inset 0 0 10px rgba(0, 226, 255, 0.05);
  text-shadow: 0 0 10px rgba(0, 226, 255, 0.8);
  position: relative;
  overflow: hidden;
  text-align: center;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

.action-btn:active {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(0, 226, 255, 0.2) 30%, 
    rgba(0, 226, 255, 0.25) 70%, 
    rgba(0, 0, 0, 0.7) 100%);
  color: #00e2ff;
  transform: scale(0.97);
  box-shadow: 0 0 25px rgba(0, 226, 255, 0.4);
}

.action-btn:disabled {
  background: linear-gradient(135deg, #333, #222);
  border-color: #444;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  text-shadow: none;
}

/* Checkout button specific styling */
#checkout-btn {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(255, 215, 0, 0.1) 30%, 
    rgba(255, 215, 0, 0.15) 70%, 
    rgba(0, 0, 0, 0.7) 100%);
  color: #ffd700;
  border: 2px solid rgba(255, 215, 0, 0.5);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2), inset 0 0 10px rgba(255, 215, 0, 0.05);
}

#checkout-btn:active {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(255, 215, 0, 0.2) 30%, 
    rgba(255, 215, 0, 0.25) 70%, 
    rgba(0, 0, 0, 0.7) 100%);
  color: #ffd700;
  transform: scale(0.97);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
}

/* Remove the old action panel from the bottom of the screen */
.action-panel {
  display: none;
}

#regen-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffae00;
  font-weight: 700;
  border: 2px solid #ffdc4a;
  min-width: 72px;
  box-shadow: 0 0 7px #ffae0033;
  text-shadow: 0 0 7px #ffdc4a88, 0 0 2px #fff;
  transition: all 0.2s ease;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
}

#regen-btn:active {
  background: #ffdc4a;
  color: #fff;
  transform: scale(0.97);
  box-shadow: 0 0 15px #ffae0088;
}

/* Regen button container */
.regen-button-container {
  display: flex;
  justify-content: center;
  margin: 15px auto;
  position: relative;
  z-index: 50;
}

/* Style regen button */
#regen-btn {
  background: linear-gradient(to bottom, #ffae00, #ff8c00);
  color: #fff;
  font-weight: 700;
  border: 2px solid #ffdc4a;
  padding: 10px 20px;
  box-shadow: 0 0 10px #ffae0055;
  text-shadow: 0 0 7px #ffdc4a88, 0 0 2px #fff;
  transition: all 0.2s ease;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  font-size: 1em;
  display: block;
  border-radius: 8px;
  cursor: pointer;
}

#meditate-btn {
  background: linear-gradient(to bottom, #19ffb9, #00c897);
  color: #003321;
  font-weight: 700;
  border: 2px solid #19ffb9;
  min-width: 75px;
  box-shadow: 0 0 7px #19ffb988;
  text-shadow: 0 0 7px #ffffff88, 0 0 2px #fff;
  transition: all 0.2s ease;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
}

#meditate-btn:active {
  background: #19ffb9;
  color: #003321;
  transform: scale(0.97);
  box-shadow: 0 0 15px #19ffb988;
}

#shoot-btn {
  background: linear-gradient(to bottom, #ff00aa, #cc0088);
  color: #fff;
  font-weight: 700;
  border: 2px solid #ff00aa;
  min-width: 75px;
  box-shadow: 0 0 7px #ff00aa88;
  text-shadow: 0 0 7px #ff00aa88, 0 0 2px #fff;
  transition: all 0.2s ease;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
}

#shoot-btn:active {
  background: #ff00aa;
  color: #fff;
  transform: scale(0.97);
  box-shadow: 0 0 15px #ff00aa88;
}

/* Ability cooldown styling */
.cooldown-overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2em;
  font-weight: bold;
  pointer-events: none;
  border-radius: 6px;
}

.ability-container {
  position: relative;
  display: inline-block;
}

#status-bar {
  margin: 0 0 0 0;
  font-size: 1em;
  color: var(--primary);
  text-align: center;
  min-height: 28px;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  text-shadow: 0 0 17px #00e2ff8a, 0 0 3px #fff;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: all 0.3s ease;
  padding: 8px 10px 6px 10px;
  background: rgba(11,21,41,0.5);
  border-radius: 10px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 350px;
  box-shadow: 0 0 13px #00e2ff22, inset 0 0 8px rgba(0, 226, 255, 0.1);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(0, 226, 255, 0.1);
  box-sizing: border-box;
}

#end-screen {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(10, 15, 35, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 200;
  animation: fadeIn 0.26s;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  backdrop-filter: blur(8px);
}

#end-modal {
  background: rgba(24, 30, 60, 0.95);
  border-radius: 18px;
  padding: 25px 20px;
  box-shadow: 0 8px 52px #00e2ff48, 0 0 80px #00e2ff33;
  text-align: center;
  min-width: 270px;
  max-width: 90%;
  border: 3px solid #00e2ff55;
  color: var(--secondary);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 15px;
}

#end-modal h2 {
  margin: 0 0 12px 0;
  font-size: 1.8em;
  color: var(--primary);
  text-shadow: 0 0 40px #00e2ff, 0 0 20px #fff;
}

#end-modal p {
  font-size: 1.1em;
  margin: 0 0 25px 0;
  color: var(--secondary);
  text-shadow: 0 0 10px rgba(0, 226, 255, 0.4);
}

/* RESTART BUTTON - Updated to match neon blue theme */
#restart-btn {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(0, 226, 255, 0.1) 30%, 
    rgba(0, 226, 255, 0.15) 70%, 
    rgba(0, 0, 0, 0.7) 100%);
  color: #00e2ff;
  border: 2px solid rgba(0, 226, 255, 0.5);
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Exo 2', sans-serif;
  text-shadow: 0 0 10px rgba(0, 226, 255, 0.8);
  box-shadow: 0 0 20px rgba(0, 226, 255, 0.2), inset 0 0 10px rgba(0, 226, 255, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#restart-btn:active {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(0, 226, 255, 0.2) 30%, 
    rgba(0, 226, 255, 0.25) 70%, 
    rgba(0, 0, 0, 0.7) 100%);
  transform: scale(0.97);
  box-shadow: 0 0 25px rgba(0, 226, 255, 0.4);
}

#end-to-menu-btn {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(0, 226, 255, 0.1) 30%, 
    rgba(0, 226, 255, 0.15) 70%, 
    rgba(0, 0, 0, 0.7) 100%);
  color: #00e2ff;
  border: 2px solid rgba(0, 226, 255, 0.5);
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 1.3em;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Exo 2', sans-serif;
  text-shadow: 0 0 10px rgba(0, 226, 255, 0.8);
  box-shadow: 0 0 20px rgba(0, 226, 255, 0.2), inset 0 0 10px rgba(0, 226, 255, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  width: 100%;
  max-width: 300px;
}

#end-to-menu-btn:active {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(0, 226, 255, 0.2) 30%, 
    rgba(0, 226, 255, 0.25) 70%, 
    rgba(0, 0, 0, 0.7) 100%);
  transform: scale(0.97);
  box-shadow: 0 0 25px rgba(0, 226, 255, 0.4);
}

#splash {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: var(--splash-bg);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 5vh;
  color: var(--primary);
  animation: fadeIn .7s;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  box-shadow: var(--splash-glow);
  text-align: center;
  transition: opacity 0.5s;
  font-size: 1em;
  background: radial-gradient(ellipse at center, #0e1a42 0%, #09101f 100%);
  overflow-y: auto;
}

#splash::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  z-index: -1;
  background: 
    radial-gradient(circle at 30% 40%, #00e2ff33 0%, transparent 30%),
    radial-gradient(circle at 70% 60%, #0079ff22 0%, transparent 30%);
}

#splash-content {
  background: rgba(17, 26, 51, 0.95);
  border-radius: 20px;
  box-shadow: 0 0 38px #00e2ff55, 0 0 14px #00e2ff22;
  border: 2.5px solid #00e2ff44;
  padding: 15px 15px;
  max-width: 90%;
  width: 90%;
  color: #fff;
  margin: 0 auto 20px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(5px);
}

#splash h2 {
  font-size: 1.5em;
  margin: 0 0 15px 0;
  color: #00e2ff;
  text-shadow: 0 0 18px #00e2ff, 0 0 7px #fff;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.sw-crawl {
  margin: 0 0 13px 0;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  font-size: 0.85em;
  color: #ffdb57;
  text-shadow: 0 0 7px #ffdb57, 0 0 3px #fff;
  letter-spacing: 0.01em;
  line-height: 1.2em;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 15px;
}

#splash ul {
  text-align: left;
  margin: 0 auto 11px auto;
  padding: 0 0 0 20px;
  max-width: 100%;
  width: 100%;
  color: #a6f9ff;
  font-size: 0.85em;
  box-sizing: border-box;
}

#splash li {
  margin-bottom: 10px;
  line-height: 1.3;
  text-shadow: 0 0 5px rgba(166, 249, 255, 0.3);
}

#splash li b {
  color: #00e2ff;
  text-shadow: 0 0 5px rgba(0, 226, 255, 0.5);
}

#start-btn {
  background: linear-gradient(to bottom, #00e2ff, #0096da);
  color: #00161f;
  border: none;
  border-radius: 12px;
  padding: 10px 25px;
  font-size: 1.1em;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 18px #00e2ff;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0.09em;
  border: 2px solid #00e2ff;
  margin-top: 10px;
  margin-bottom: 0;
  text-shadow: 0 0 8px #fff8;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}

#start-btn:active {
  background: #16e7ff;
  color: #001f27;
  transform: scale(0.97) translateY(0);
  box-shadow: 0 0 15px #00e2ff;
}

.action-counter {
  font-size: 0.9em;
  color: #00f7ff;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  background: rgba(24, 35, 60, 0.9);
  border-radius: 8px;
  padding: 3px 10px;
  margin: 5px 0;
  box-shadow: 0 0 10px #00e2ff33, inset 0 0 5px rgba(0, 247, 255, 0.1);
  letter-spacing: 0.03em;
  user-select: none;
  border: 1px solid rgba(0, 247, 255, 0.3);
}

.score-container {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(11, 21, 42, 0.6);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 0 15px rgba(0, 226, 255, 0.15);
  border: 1px solid rgba(0, 226, 255, 0.1);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-label {
  font-size: 0.7em;
  color: #00e2ff;
  margin-bottom: 2px;
  text-shadow: 0 0 5px rgba(0, 226, 255, 0.5);
}

.score-value {
  font-size: 1em;
  color: var(--score-text);
  font-weight: 700;
  text-shadow: 0 0 5px rgba(0, 226, 255, 0.4);
}
/* Mobile-Optimized UI Layout */
@media (max-width: 767px) {
  /* Bottom panel container for mobile */
  .mobile-ui-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, 
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.7) 50%,
      transparent 100%
    );
    pointer-events: none;
    z-index: 100;
  }
  
  .mobile-ui-container > * {
    pointer-events: auto;
  }
  
  /* Quick action bar for mobile */
  .mobile-action-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
  }
  
  .mobile-action-bar .action-btn {
    flex: 1;
    max-width: 150px;
    min-height: 50px;
    font-size: 0.9rem;
    padding: 12px;
    background: linear-gradient(135deg, #192245 0%, #1a2550 100%);
    border: 2px solid rgba(0, 226, 255, 0.4);
    border-radius: 12px;
    color: var(--primary);
    font-weight: bold;
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.3),
      0 0 20px rgba(0, 226, 255, 0.2);
    transition: all 0.2s ease;
  }
  
  .mobile-action-bar .action-btn:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 
      0 2px 10px rgba(0, 0, 0, 0.3),
      0 0 30px rgba(0, 226, 255, 0.5);
  }
  
  /* Floating score display for mobile */
  .mobile-score-display {
    position: fixed;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, 
      rgba(14, 21, 48, 0.95) 0%,
      rgba(20, 30, 60, 0.9) 100%
    );
    padding: 10px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.5),
      0 0 30px rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 101;
  }
  
  .mobile-score-display .score-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
      0 0 20px rgba(255, 215, 0, 0.8),
      0 0 10px rgba(255, 255, 255, 0.5);
    font-family: 'Audiowide', sans-serif;
  }
  
  /* Floating combo counter for mobile */
  .mobile-combo-display {
    position: fixed;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, 
      rgba(14, 21, 48, 0.95) 0%,
      rgba(20, 30, 60, 0.9) 100%
    );
    padding: 10px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255, 0, 170, 0.3);
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.5),
      0 0 30px rgba(255, 0, 170, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 101;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
  }
  
  .mobile-combo-display.active {
    opacity: 1;
    transform: scale(1);
  }
  
  .mobile-combo-display .combo-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff00aa;
    text-shadow: 
      0 0 20px rgba(255, 0, 170, 0.8),
      0 0 10px rgba(255, 255, 255, 0.5);
    font-family: 'Audiowide', sans-serif;
  }
  
  /* Swipe indicator for mobile */
  .swipe-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 102;
  }
  
  .swipe-indicator.show {
    opacity: 1;
  }
  
  /* Enhanced turn indicator */
  .turn-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, 
      rgba(14, 21, 48, 0.95) 0%,
      rgba(20, 30, 60, 0.9) 100%
    );
    padding: 8px 20px;
    border-radius: 15px;
    border: 2px solid rgba(0, 226, 255, 0.3);
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.5),
      0 0 20px rgba(0, 226, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 101;
    font-family: 'Audiowide', sans-serif;
    text-align: center;
  }
  
  .turn-indicator.player-turn {
    border-color: rgba(60, 239, 255, 0.5);
    color: #3cefff;
    text-shadow: 0 0 10px #3cefff;
  }
  
  .turn-indicator.enemy-turn {
    border-color: rgba(255, 62, 107, 0.5);
    color: #ff3e6b;
    text-shadow: 0 0 10px #ff3e6b;
  }
  
  /* Threshold warning bar */
  .threshold-warning-bar {
    position: fixed;
    bottom: 80px;
    left: 10px;
    right: 10px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    z-index: 101;
  }
  
  .threshold-warning-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--threshold-percentage, 0%);
    background: linear-gradient(90deg, 
      #19ffb9 0%,
      #FFD700 50%,
      #ff4f65 100%
    );
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 
      0 0 10px currentColor,
      0 0 20px currentColor;
  }
  
  /* Mobile gesture hints */
  .gesture-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0;
    pointer-events: none;
    z-index: 10000;
    animation: gestureHintFade 1s ease-out forwards;
  }
  
  @keyframes gestureHintFade {
    0% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(1.5);
    }
  }
}

/* MOBILE-FIRST ACTION PANEL SYSTEM */

/* Character Action Panel - Improved Mobile Positioning */
.character-action-panel {
  position: fixed;
  bottom: 20px; /* Add margin from bottom */
  left: 20px;
  right: 20px;
  
  /* Improved sizing - more compact */
  max-height: min(35vh, 250px); /* Reduced max height */
  min-height: 80px; /* Reduced min height */
  
  /* Safe area support with better spacing */
  padding: 15px 15px calc(var(--mobile-safe-area-bottom) + 15px) 15px;
  
  /* Mobile-first styling */
  background: linear-gradient(
    to top,
    rgba(14, 21, 48, 0.98) 0%,
    rgba(14, 21, 48, 0.95) 70%,
    rgba(14, 21, 48, 0.9) 100%
  );
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  
  /* Enhanced visual effects with better borders */
  border: 2px solid rgba(0, 226, 255, 0.4);
  border-radius: 20px; /* Fully rounded instead of bottom-sheet style */
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.8),
    0 4px 16px rgba(0, 226, 255, 0.3),
    inset 0 1px 20px rgba(0, 226, 255, 0.1);
  
  /* Touch optimizations */
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  
  /* Animation and interaction */
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Remove panel handle - no longer needed for floating panel */
.character-action-panel::before {
  display: none; /* Remove the drag handle since it's not a bottom sheet anymore */
}

.character-action-panel:active::before {
  display: none; /* Remove active state too */
}

/* Panel content layout */
.character-action-panel .panel-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin-top: 0; /* Remove top margin since no handle */
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Character action buttons - Mobile optimized */
.character-action-btn {
  /* Touch-friendly sizing */
  min-height: var(--mobile-touch-target);
  min-width: 120px;
  padding: 12px 16px;
  
  /* Mobile-first layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  
  /* Enhanced mobile styling */
  background: linear-gradient(135deg, #192245 0%, #1a2550 100%);
  border: 2px solid rgba(0, 226, 255, 0.3);
  border-radius: 15px;
  color: var(--primary);
  
  /* Typography */
  font-family: 'Audiowide', 'Orbitron', sans-serif;
  font-size: calc(var(--mobile-font-scale) * 0.9rem);
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  
  /* Enhanced visual effects */
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 2px 10px rgba(0, 226, 255, 0.2),
    inset 0 1px 3px rgba(255, 255, 255, 0.1);
  
  /* Touch interactions */
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
  outline: none;
  
  /* Mobile touch optimizations */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  
  /* Prevent text selection */
  -webkit-touch-callout: none;
}

/* Button icons */
.character-action-btn .btn-icon {
  font-size: calc(var(--mobile-font-scale) * 1.4rem);
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(0, 226, 255, 0.5));
  transition: all 0.2s ease;
}

/* Button text */
.character-action-btn .btn-text {
  font-size: calc(var(--mobile-font-scale) * 0.85rem);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(0, 226, 255, 0.3);
}

/* Button cost indicators */
.character-action-btn .btn-cost {
  font-size: calc(var(--mobile-font-scale) * 0.75rem);
  opacity: 0.8;
  color: #ffaa44;
  font-weight: 500;
}

/* Enhanced mobile touch feedback */
.character-action-btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(0, 226, 255, 0.5),
    inset 0 1px 5px rgba(255, 255, 255, 0.2);
  border-color: rgba(0, 226, 255, 0.6);
  background: linear-gradient(135deg, #1a2550 0%, #1c2760 100%);
}

.character-action-btn:active .btn-icon {
  filter: drop-shadow(0 0 15px rgba(0, 226, 255, 0.8));
  transform: scale(1.1);
}

/* Disabled button state */
.character-action-btn:disabled {
  opacity: 0.4;
  background: linear-gradient(135deg, #151525 0%, #181830 100%);
  border-color: rgba(100, 100, 100, 0.3);
  color: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.3),
    inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.character-action-btn:disabled .btn-icon {
  filter: none;
  opacity: 0.5;
}

/* Character-specific button styling */
.character-action-panel.monk .character-action-btn:not(:disabled) {
  border-color: rgba(255, 140, 0, 0.4);
}

.character-action-panel.monk .character-action-btn:not(:disabled):active {
  border-color: rgba(255, 140, 0, 0.7);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(255, 140, 0, 0.4);
}

.character-action-panel.archer .character-action-btn:not(:disabled) {
  border-color: rgba(255, 0, 170, 0.4);
}

.character-action-panel.archer .character-action-btn:not(:disabled):active {
  border-color: rgba(255, 0, 170, 0.7);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(255, 0, 170, 0.4);
}

.character-action-panel.bandit .character-action-btn:not(:disabled) {
  border-color: rgba(27, 94, 32, 0.4);
}

.character-action-panel.bandit .character-action-btn:not(:disabled):active {
  border-color: rgba(27, 94, 32, 0.7);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(27, 94, 32, 0.4);
}

.character-action-panel.wizard .character-action-btn:not(:disabled) {
  border-color: rgba(30, 87, 153, 0.4);
}

.character-action-panel.wizard .character-action-btn:not(:disabled):active {
  border-color: rgba(30, 87, 153, 0.7);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(30, 87, 153, 0.4);
}

.character-action-panel.mage .character-action-btn:not(:disabled) {
  border-color: rgba(75, 0, 130, 0.4);
}

.character-action-panel.mage .character-action-btn:not(:disabled):active {
  border-color: rgba(75, 0, 130, 0.7);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(75, 0, 130, 0.4);
}

.character-action-panel.barbarian .character-action-btn:not(:disabled) {
  border-color: rgba(139, 0, 0, 0.4);
}

.character-action-panel.barbarian .character-action-btn:not(:disabled):active {
  border-color: rgba(139, 0, 0, 0.7);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(139, 0, 0, 0.4);
}

.character-action-panel.guardian .character-action-btn:not(:disabled) {
  border-color: rgba(255, 215, 0, 0.4);
}

.character-action-panel.guardian .character-action-btn:not(:disabled):active {
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(255, 215, 0, 0.4);
}

.character-action-panel.priest .character-action-btn:not(:disabled) {
  border-color: rgba(255, 215, 0, 0.4);
}

.character-action-panel.priest .character-action-btn:not(:disabled):active {
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(255, 215, 0, 0.4);
}

/* Cooldown overlay for mobile */
.character-action-btn .cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(20, 20, 40, 0.9) 100%
  );
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--mobile-font-scale) * 1.1rem);
  font-weight: bold;
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.8);
  border: 2px solid rgba(255, 107, 107, 0.4);
  animation: cooldownPulse 2s infinite ease-in-out;
}

@keyframes cooldownPulse {
  0%, 100% {
    opacity: 0.9;
    border-color: rgba(255, 107, 107, 0.4);
  }
  50% {
    opacity: 1;
    border-color: rgba(255, 107, 107, 0.7);
  }
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .character-action-panel {
    bottom: 15px;
    left: 15px;
    right: 15px;
    max-height: min(30vh, 200px); /* Even more compact on small screens */
    padding: 12px 12px calc(var(--mobile-safe-area-bottom) + 12px) 12px;
  }
  
  .character-action-panel .panel-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .character-action-btn {
    min-width: 100%;
    min-height: 44px; /* Ensure touch target size */
    padding: 10px 12px;
    gap: 4px;
  }
  
  .character-action-btn .btn-icon {
    font-size: calc(var(--mobile-font-scale) * 1.2rem);
  }
  
  .character-action-btn .btn-text {
    font-size: calc(var(--mobile-font-scale) * 0.8rem);
  }
}

@media (max-width: 360px) {
  .character-action-panel {
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-height: min(25vh, 180px); /* Very compact on tiny screens */
  }
  
  .character-action-panel .panel-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }
  
  .character-action-btn {
    min-width: 100%;
    min-height: 40px;
    padding: 8px 10px;
  }
  
  .character-action-btn .btn-text {
    font-size: calc(var(--mobile-font-scale) * 0.75rem);
  }
}

/* Landscape mobile optimization - IDENTICAL TO PORTRAIT */
@media (max-width: 767px) and (orientation: landscape) {
  .character-action-panel {
    /* Use exact same positioning as portrait base styles */
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-height: min(35vh, 250px);
    padding: 15px 15px calc(var(--mobile-safe-area-bottom) + 15px) 15px;
  }
  
  .character-action-panel .panel-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 0;
  }
  
  .character-action-btn {
    min-height: var(--mobile-touch-target);
    min-width: 120px;
    padding: 12px 16px;
    gap: 6px;
    width: 100%;
  }
  
  .character-action-btn .btn-icon {
    font-size: calc(var(--mobile-font-scale) * 1.4rem);
  }
  
  .character-action-btn .btn-text {
    font-size: calc(var(--mobile-font-scale) * 0.85rem);
  }
}

/* Wide landscape screens - IDENTICAL TO PORTRAIT */
@media (min-width: 768px) and (orientation: landscape) {
  .character-action-panel {
    /* Use exact same positioning as portrait base styles */
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: none;
    max-height: min(35vh, 250px);
    padding: 15px 15px calc(var(--mobile-safe-area-bottom) + 15px) 15px;
  }
  
  .character-action-panel .panel-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .character-action-btn {
    min-height: var(--mobile-touch-target);
    min-width: 120px;
    padding: 12px 16px;
    gap: 6px;
    width: 100%;
  }
}

/* Volume Control Styling */
.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 226, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(0, 226, 255, 0.1);
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 50px;
  overflow: visible;
}

.volume-control label {
  color: var(--primary);
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  font-size: 0.9em;
  font-weight: 600;
  text-shadow: 0 0 5px #00e2ff88;
  min-width: 50px;
  flex-shrink: 0;
}

.volume-slider {
  flex: 1;
  height: 6px;
  background: rgba(0, 226, 255, 0.2);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary), #ffffff);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 226, 255, 0.5);
  transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary), #ffffff);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 226, 255, 0.5);
  border: none;
  transition: all 0.2s ease;
}

#volume-display {
  color: var(--primary);
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  font-size: 0.9em;
  font-weight: 600;
  text-shadow: 0 0 5px #00e2ff88;
  min-width: 40px;
  text-align: right;
}

/* REVIVE OPTIONS */
.revive-options {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.revive-option {
  background: rgba(15, 25, 45, 0.8);
  border: 2px solid #00e2ff44;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 226, 255, 0.2);
  backdrop-filter: blur(5px);
}

.revive-header h3 {
  margin: 0 0 8px 0;
  font-size: 1.2em;
  color: #00e2ff;
  text-shadow: 0 0 15px #00e2ff;
}

.revive-header p {
  margin: 0 0 15px 0;
  font-size: 0.9em;
  color: #a6f9ff;
  text-shadow: 0 0 5px rgba(166, 249, 255, 0.3);
}

.countdown-container {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.countdown-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.countdown-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff4f65, #ff8a00);
  border-radius: 4px;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(255, 79, 101, 0.5);
  animation: countdownPulse 1s infinite ease-in-out;
}

@keyframes countdownPulse {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(255, 79, 101, 0.5);
  }
  50% { 
    box-shadow: 0 0 20px rgba(255, 79, 101, 0.8);
  }
}

.countdown-text {
  font-size: 1.4em;
  font-weight: bold;
  color: #ff4f65;
  text-shadow: 0 0 15px #ff4f65, 0 0 5px #fff;
  font-family: 'Audiowide', monospace;
  animation: countdownTextPulse 1s infinite ease-in-out;
}

@keyframes countdownTextPulse {
  0%, 100% { 
    transform: scale(1);
    color: #ff4f65;
  }
  50% { 
    transform: scale(1.1);
    color: #ff8a00;
  }
}

.revive-btn {
  background: linear-gradient(145deg, #ff4f65, #e63946);
  color: #fff;
  border: 3px solid #ff6b7a;
  border-radius: 12px;
  padding: 12px 25px;
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 79, 101, 0.5);
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  width: 100%;
  margin-top: 10px;
}

.revive-btn:active {
  background: linear-gradient(145deg, #e63946, #d32f2f);
  transform: scale(0.98) translateY(0);
  box-shadow: 0 0 15px rgba(255, 79, 101, 0.6);
}

.revive-btn:disabled {
  background: rgba(100, 100, 100, 0.5);
  color: rgba(255, 255, 255, 0.4);
  border-color: rgba(100, 100, 100, 0.3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.end-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .revive-options {
    gap: 12px;
  }
  
  .revive-option {
    padding: 12px;
  }
  
  .revive-header h3 {
    font-size: 1.1em;
  }
  
  .revive-header p {
    font-size: 0.85em;
  }
  
  .revive-btn {
    padding: 10px 20px;
    font-size: 1em;
  }
  
  .countdown-text {
    font-size: 1.2em;
  }
}