/* MOBILE-FIRST PANELS DESIGN */

/* MOBILE GAME CONTAINER */
.game-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 25px;
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
  padding: 15px 10px 200px 10px; /* Extra bottom padding for action panels */
  box-sizing: border-box;
}

/* MOBILE HISTORY BUTTON - DISABLED (now in settings) */
/*
#history-button {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #00e2ff, #0079ff);
  border: 2px solid #00e2ff;
  color: #fff;
  font-family: 'Audiowide', cursive;
  font-weight: bold;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 0 15px rgba(0, 226, 255, 0.6);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  touch-action: manipulation;
}
*/

/* MOBILE TOUCH FEEDBACK FOR HISTORY BUTTON - DISABLED (now in settings) */
/*
#history-button:active {
  transform: scale(0.95);
  background: #00e2ff;
  box-shadow: 0 0 20px rgba(0, 226, 255, 0.8);
}
*/

.history-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

.history-content {
  background: rgba(17, 26, 51, 0.98);
  border-radius: 25px;
  padding: 30px 25px;
  max-width: 95%;
  width: 380px;
  border: 2px solid var(--primary);
  box-shadow: 0 0 40px rgba(0, 226, 255, 0.4);
  color: #e5edff;
  font-family: 'Exo 2', sans-serif;
  animation: slideIn 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}

.history-content h2 {
  color: var(--primary);
  text-align: center;
  margin: 0 0 25px 0;
  font-family: 'Audiowide', cursive;
  font-size: 1.8em;
  text-shadow: 0 0 12px rgba(0, 226, 255, 0.5);
  letter-spacing: 1px;
}

.history-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 226, 255, 0.2);
  font-size: 16px;
}

.history-stat:last-of-type {
  margin-bottom: 30px;
}

.history-label {
  color: var(--secondary);
  font-weight: 500;
}

.history-value {
  font-weight: bold;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(0, 226, 255, 0.4);
  font-family: 'Audiowide', cursive;
}

#history-close-btn, #history-reset-btn {
  background: var(--action-btn);
  color: var(--primary);
  border: 2px solid rgba(0, 226, 255, 0.3);
  padding: 15px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Audiowide', cursive;
  margin-top: 15px;
  transition: all 0.2s ease;
  font-size: 1em;
  text-shadow: 0 0 8px rgba(0, 226, 255, 0.4);
  min-height: 50px;
  touch-action: manipulation;
  font-weight: 600;
}

#history-close-btn {
  margin-right: 15px;
}

#history-reset-btn {
  background: rgba(255, 79, 101, 0.2);
  color: #ff4f65;
  border-color: rgba(255, 79, 101, 0.3);
  text-shadow: 0 0 8px rgba(255, 79, 101, 0.4);
}

/* MOBILE TOUCH FEEDBACK FOR HISTORY BUTTONS */
#history-close-btn:active, #history-reset-btn:active {
  transform: scale(0.97);
}

#history-reset-btn:active {
  background: rgba(255, 79, 101, 0.3);
}

.last-played .history-value {
  font-size: 0.9em;
  font-family: 'Exo 2', sans-serif;
}

/* MOBILE CHARACTER ACTION PANELS - MAIN DESIGN */
.character-action-panel {
  /* REMOVED ALL DESKTOP POSITIONING */
  position: fixed !important;
  bottom: 20px !important;
  left: 15px !important;
  right: 15px !important;
  top: auto !important;
  transform: none !important;
  background-color: rgba(0, 0, 0, 0.95);
  border-radius: 25px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: auto;
  max-width: none;
  width: auto;
  z-index: 9999;
  box-shadow: 
    0 0 40px rgba(0, 226, 255, 0.5), 
    0 -10px 30px rgba(0, 0, 0, 0.8);
  animation: mobileSlideUp 0.3s ease-out;
  backdrop-filter: blur(20px);
  border: 3px solid;
  align-items: stretch;
  visibility: visible;
  opacity: 1;
}

/* MOBILE CHARACTER TYPE STYLING */
.character-action-panel.Monk {
  border-color: #FF8C00;
  box-shadow: 
    0 0 40px rgba(255, 140, 0, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

.character-action-panel.Archer {
  border-color: #ff00aa;
  box-shadow: 
    0 0 40px rgba(255, 0, 170, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

.character-action-panel.Bandit {
  border-color: #8E44AD;
  box-shadow: 
    0 0 40px rgba(142, 68, 173, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

.character-action-panel.Guardian {
  border-color: #1E5799;
  box-shadow: 
    0 0 40px rgba(30, 87, 153, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

.character-action-panel.Priest {
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

.character-action-panel.Barbarian {
  border-color: #DC143C;
  box-shadow: 
    0 0 40px rgba(220, 20, 60, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

.character-action-panel.Wizard {
  border-color: #00CED1;
  box-shadow: 
    0 0 40px rgba(0, 206, 209, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

.character-action-panel.Mage {
  border-color: #7C3AED;
  box-shadow: 
    0 0 40px rgba(124, 58, 237, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

.character-action-panel.Nerd {
  border-color: #FFD700;
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.4),
    0 -10px 30px rgba(0, 0, 0, 0.8);
}

/* MOBILE ACTION BUTTONS */
.character-action-btn {
  background: rgba(24, 32, 69, 0.9);
  color: #f1f7ff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 18px 20px;
  border-radius: 15px;
  font-size: 18px;
  font-family: 'Audiowide', cursive;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 0 8px rgba(0, 226, 255, 0.4);
  min-height: 60px;
  touch-action: manipulation;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* MOBILE CHARACTER-SPECIFIC BUTTON STYLING */
.Monk .character-action-btn {
  background: linear-gradient(to bottom, rgba(255, 140, 0, 0.2), rgba(255, 140, 0, 0.4));
  border: 2px solid rgba(255, 140, 0, 0.6);
  color: #FF8C00;
  text-shadow: 0 0 8px rgba(255, 140, 0, 0.6);
}

.Archer .character-action-btn {
  background: linear-gradient(to bottom, rgba(255, 0, 170, 0.2), rgba(255, 0, 170, 0.4));
  border: 2px solid rgba(255, 0, 170, 0.6);
  color: #ff00aa;
  text-shadow: 0 0 8px rgba(255, 0, 170, 0.6);
}

.Bandit .character-action-btn {
  background: linear-gradient(to bottom, rgba(142, 68, 173, 0.2), rgba(142, 68, 173, 0.4));
  border: 2px solid rgba(142, 68, 173, 0.6);
  color: #8E44AD;
  text-shadow: 0 0 8px rgba(142, 68, 173, 0.6);
}

.Guardian .character-action-btn {
  background: linear-gradient(to bottom, rgba(30, 87, 153, 0.2), rgba(30, 87, 153, 0.4));
  border: 2px solid rgba(30, 87, 153, 0.6);
  color: #1E5799;
  text-shadow: 0 0 8px rgba(30, 87, 153, 0.6);
}

.Priest .character-action-btn {
  background: linear-gradient(to bottom, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.4));
  border: 2px solid rgba(255, 215, 0, 0.6);
  color: #FFD700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.Barbarian .character-action-btn {
  background: linear-gradient(to bottom, rgba(220, 20, 60, 0.2), rgba(220, 20, 60, 0.4));
  border: 2px solid rgba(220, 20, 60, 0.6);
  color: #DC143C;
  text-shadow: 0 0 8px rgba(220, 20, 60, 0.6);
}

.Wizard .character-action-btn {
  background: linear-gradient(to bottom, rgba(0, 206, 209, 0.2), rgba(0, 206, 209, 0.4));
  border: 2px solid rgba(0, 206, 209, 0.6);
  color: #00CED1;
  text-shadow: 0 0 8px rgba(0, 206, 209, 0.6);
}

.Mage .character-action-btn {
  background: linear-gradient(to bottom, rgba(124, 58, 237, 0.2), rgba(124, 58, 237, 0.4));
  border: 2px solid rgba(124, 58, 237, 0.6);
  color: #7C3AED;
  text-shadow: 0 0 8px rgba(124, 58, 237, 0.6);
}

.Nerd .character-action-btn {
  background: linear-gradient(to bottom, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.4));
  border: 2px solid rgba(255, 215, 0, 0.6);
  color: #FFD700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* MOBILE TOUCH FEEDBACK FOR ACTION BUTTONS */
.character-action-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.Monk .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(255, 140, 0, 0.3), rgba(255, 140, 0, 0.5));
}

.Archer .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(255, 0, 170, 0.3), rgba(255, 0, 170, 0.5));
}

.Bandit .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(142, 68, 173, 0.3), rgba(142, 68, 173, 0.5));
}

.Guardian .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(30, 87, 153, 0.3), rgba(30, 87, 153, 0.5));
}

.Priest .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.5));
}

.Barbarian .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(220, 20, 60, 0.3), rgba(220, 20, 60, 0.5));
}

.Wizard .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(0, 206, 209, 0.3), rgba(0, 206, 209, 0.5));
}

.Mage .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(124, 58, 237, 0.3), rgba(124, 58, 237, 0.5));
}

.Nerd .character-action-btn:active:not(:disabled) {
  background: linear-gradient(to bottom, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.5));
}

.character-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: rgba(100, 100, 100, 0.3) !important;
  color: #888 !important;
  border-color: rgba(100, 100, 100, 0.4) !important;
}

/* MOBILE TEXT STYLING */
.cooldown-text {
  color: #aabfe0;
  font-size: 14px;
  margin-top: -6px;
  font-style: italic;
  text-align: center;
  font-weight: 500;
}

.cost-text {
  color: #ff8888;
  font-size: 13px;
  text-align: center;
  font-style: italic;
  font-weight: 500;
}

.info-text {
  color: #88ccff;
  font-size: 12px;
  text-align: center;
  font-style: italic;
  line-height: 1.3;
  max-width: 100%;
  font-weight: 500;
}

.damage-text {
  color: #ffaaff;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(255, 170, 255, 0.5);
}

/* Mage-specific text colors */
.mage-cooldown {
  color: #E8BFFF;
}

.mage-cost {
  color: #A855F7;
}

.mage-damage {
  color: #F3E8FF;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(124, 58, 237, 0.6);
}

.mage-info {
  color: #C8A2FF;
}

/* MOBILE SLIDE UP ANIMATION */
@keyframes mobileSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Lose Threshold Section */
.threshold-section {
  background: rgba(255, 50, 50, 0.1);
  border: 2px solid rgba(255, 50, 50, 0.3);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.threshold-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    transparent 30%, 
    rgba(255, 50, 50, 0.1) 50%, 
    transparent 70%);
  transform: translateX(-100%);
  animation: threshold-shimmer 3s infinite;
}

@keyframes threshold-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.threshold-title {
  font-size: 14px;
  color: #ff6b6b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.threshold-value {
  font-size: 36px;
  font-weight: bold;
  color: #ff4444;
  text-shadow: 0 0 20px rgba(255, 68, 68, 0.6), 
               0 0 10px rgba(255, 68, 68, 0.4);
  margin-bottom: 5px;
  font-family: 'Audiowide', cursive;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.threshold-value.increasing {
  animation: threshold-pulse 0.5s ease;
  transform: scale(1.2);
  color: #ff0000;
  text-shadow: 0 0 30px rgba(255, 0, 0, 0.8), 
               0 0 20px rgba(255, 0, 0, 0.6);
}

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

.threshold-warning {
  font-size: 12px;
  color: #ffa500;
  background: rgba(255, 165, 0, 0.2);
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-radius: 5px;
  padding: 5px 10px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
  animation: warning-blink 1s ease-in-out infinite;
}

@keyframes warning-blink {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.threshold-warning #threshold-timer {
  font-weight: bold;
  color: #ffcc00;
  text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

/* Danger state when characters are close to threshold */
.threshold-section.danger {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.6);
  animation: danger-pulse 1s ease-in-out infinite;
}

@keyframes danger-pulse {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4); 
  }
  50% { 
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8), 
                inset 0 0 20px rgba(255, 0, 0, 0.2); 
  }
} 