:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #1a1f2e;
  --bg-card: #2a2f3e;
  --accent-red: #c23c2a;
  --accent-blue: #4a9eff;
  --accent-gold: #ffd700;
  --accent-green: #2ed573;
  --text-primary: #ffffff;
  --text-secondary: #b8bcc8;
  --text-muted: #7a7f8a;
  --border-color: #3a3f4e;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --gradient: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

/* Radiant Theme (Light Mode) Variables */
:root.radiant-theme {
  --bg-primary: #e8eaed;
  --bg-secondary: #f1f3f5;
  --bg-card: #dadce0;
  --accent-red: #d93025;
  --accent-blue: #1a73e8;
  --accent-gold: #fbbc04;
  --accent-green: #34a853;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --border-color: #c1c7cd;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  --gradient: linear-gradient(135deg, #f1f3f5, #e8eaed);
}

/* Theme Toggle Button */
.header-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.theme-toggle-container {
  position: relative;
}

.theme-toggle {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border: 2px solid var(--border-color);
  border-radius: 25px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-family: "Orbitron", monospace;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.theme-toggle .theme-icon {
  font-size: 1.2rem;
  transition: all 0.4s ease;
}

.theme-toggle .theme-text {
  transition: all 0.4s ease;
}

/* Dire Theme (Dark Mode) - Default */
.theme-toggle {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: #ecf0f1;
}

.theme-toggle:hover {
  background: linear-gradient(135deg, #34495e, #2c3e50);
}

/* Radiant Theme Toggle Button */
.radiant-theme .theme-toggle {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #2c3e50;
  border-color: #e67e22;
}

.radiant-theme .theme-toggle:hover {
  background: linear-gradient(135deg, #e67e22, #d35400);
  transform: translateY(-2px);
}

.radiant-theme .theme-toggle .theme-icon {
  animation: radiantGlow 2s ease-in-out infinite alternate;
}

@keyframes radiantGlow {
  0% {
    text-shadow: 0 0 5px #f39c12;
  }
  100% {
    text-shadow: 0 0 15px #f39c12, 0 0 25px #e67e22;
  }
}

/* Theme Toggle Animation */
.theme-toggle.switching {
  animation: themeSwitch 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes themeSwitch {
  0% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.2) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
  }
}

/* Radiant Theme Overrides */
.radiant-theme body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.radiant-theme .ancient-tower-animated {
  background: linear-gradient(135deg, #f1f3f5, #e8eaed);
  border-color: #c1c7cd;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.15);
}

.radiant-theme .tower-top {
  background: linear-gradient(135deg, #17a2b8, #138496);
  border-color: #117a8b;
  box-shadow: 0 2px 10px rgba(23, 162, 184, 0.4);
}

.radiant-theme .tower-middle {
  background: linear-gradient(135deg, #007bff, #0056b3);
  border-color: #004085;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.radiant-theme .tower-base {
  background: linear-gradient(135deg, #28a745, #1e7e34);
  border-color: #155724;
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.radiant-theme .health-crystal {
  background: linear-gradient(45deg, #ffc107, #e0a800);
  border-color: #d39e00;
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
}

.radiant-theme .letter-slot {
  background: var(--bg-secondary);
  border-color: var(--accent-blue);
  color: var(--accent-gold);
}

.radiant-theme .letter-slot.filled {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.radiant-theme .health-bar-fill {
  background: linear-gradient(90deg, #28a745, #20c997);
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.6);
}

/* Radiant theme specific animations */
.radiant-theme .crystal-glow {
  background: radial-gradient(circle, rgba(255, 193, 7, 0.8), transparent);
}

.radiant-theme .title {
  background: linear-gradient(45deg, #dc3545, #007bff, #ffc107, #28a745);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Radiant theme damage effects */
.radiant-theme .crack {
  background: linear-gradient(45deg, #dc3545, #c82333);
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.6);
}

.radiant-theme .fire-effect {
  background: radial-gradient(ellipse at bottom, #fd7e14, #e8590c, transparent);
}

.radiant-theme .smoke-effect {
  background: radial-gradient(
    ellipse at bottom,
    rgba(108, 117, 125, 0.7),
    transparent
  );
}

/* Theme transition animation */
body {
  transition: background-color 0.6s ease, color 0.6s ease;
}

* {
  transition: border-color 0.4s ease, background-color 0.4s ease,
    color 0.4s ease, box-shadow 0.4s ease;
}

/* Theme-aware hover effects */
.radiant-theme .btn-guess:hover {
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.radiant-theme .btn-guess-word:hover {
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.radiant-theme .btn-hint:hover {
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.radiant-theme .btn-new-game:hover {
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Game Header */
.game-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px 0;
  background: var(--gradient);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

/* Game Stats */
.game-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* Main Game Area */
.game-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
  padding: 30px;
  background: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

/* Hangman (Ancient Tower) */
.hangman-container {
  text-align: center;
}

.hangman-container h3 {
  color: var(--accent-gold);
  margin-bottom: 20px;
  font-family: "Orbitron", monospace;
}

/* Ancient Tower Animation System */
.ancient-tower-animated {
  background: linear-gradient(135deg, #1a1f2e, #2a2f3e);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 15px;
  border: 2px solid var(--border-color);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.tower-structure {
  position: relative;
  width: 120px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

/* Tower Body Parts */
.tower-body {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  z-index: 2;
}

.tower-top {
  width: 60px;
  height: 40px;
  background: linear-gradient(135deg, #4a90e2, #357abd);
  border-radius: 8px 8px 0 0;
  border: 2px solid #2c5282;
  position: relative;
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
  transition: all 0.5s ease;
}

.tower-top::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-gold);
}

.tower-middle {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #5a6cb8, #4a5ba8);
  border: 2px solid #3a4b98;
  position: relative;
  box-shadow: 0 4px 15px rgba(90, 108, 184, 0.3);
  transition: all 0.5s ease;
}

.tower-middle::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 50%;
  border: 2px solid #5a67d8;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.tower-base {
  width: 100px;
  height: 80px;
  background: linear-gradient(135deg, #6b7db8, #5b6da8);
  border: 2px solid #4b5d98;
  border-radius: 0 0 10px 10px;
  position: relative;
  box-shadow: 0 6px 20px rgba(107, 125, 184, 0.4);
  transition: all 0.5s ease;
}

/* Health Crystal */
.health-crystal {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background: linear-gradient(45deg, var(--accent-green), #20c997);
  border-radius: 50%;
  border: 2px solid #17a085;
  z-index: 10;
  transition: all 0.5s ease;
  box-shadow: 0 0 15px rgba(46, 213, 115, 0.6);
}

.crystal-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
  border-radius: 50%;
  animation: crystalPulse 2s ease-in-out infinite;
}

@keyframes crystalPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

/* Damage Effects */
.damage-effects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.crack {
  position: absolute;
  background: linear-gradient(45deg, #c23c2a, #ff4757);
  opacity: 0;
  transform: scale(0);
  transition: all 0.8s ease;
  box-shadow: 0 0 10px rgba(194, 60, 42, 0.6);
}

.crack-1 {
  top: 30%;
  left: 20%;
  width: 3px;
  height: 40px;
  transform-origin: center bottom;
}

.crack-2 {
  top: 50%;
  right: 15%;
  width: 4px;
  height: 60px;
  transform-origin: center top;
}

.crack-3 {
  bottom: 20%;
  left: 15%;
  width: 5px;
  height: 50px;
  transform-origin: center bottom;
}

.crack.visible {
  opacity: 1;
  transform: scale(1);
  animation: crackGrow 0.8s ease-out;
}

@keyframes crackGrow {
  0% {
    height: 0;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

.fire-effect {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 80px;
  background: radial-gradient(ellipse at bottom, #ff6b35, #f7931e, transparent);
  opacity: 0;
  transition: all 0.6s ease;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.fire-effect.visible {
  opacity: 0.8;
  animation: fireFlicker 1s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  0% {
    transform: translateX(-50%) scale(1) rotate(-2deg);
  }
  100% {
    transform: translateX(-50%) scale(1.1) rotate(2deg);
  }
}

.smoke-effect {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 60px;
  background: radial-gradient(
    ellipse at bottom,
    rgba(100, 100, 100, 0.6),
    transparent
  );
  opacity: 0;
  transition: all 0.8s ease;
  border-radius: 50%;
}

.smoke-effect.visible {
  opacity: 0.7;
  animation: smokeRise 3s ease-out infinite;
}

@keyframes smokeRise {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    transform: translateX(-50%) translateY(-30px) scale(1.5);
    opacity: 0;
  }
}

.destruction-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.3), transparent);
  opacity: 0;
  transition: all 0.8s ease;
}

.destruction-effect.visible {
  opacity: 1;
  animation: destructionPulse 1.5s ease-in-out infinite;
}

@keyframes destructionPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.6;
  }
}

/* Damage Particles */
.damage-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-red);
  border-radius: 50%;
  opacity: 0;
  animation: particleExplosion 1s ease-out forwards;
}

@keyframes particleExplosion {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0) translate(var(--dx), var(--dy));
  }
}

/* Tower Damage States */
.ancient-tower-animated.damage-1 .tower-top {
  filter: brightness(0.9);
  transform: rotate(1deg);
}

.ancient-tower-animated.damage-2 .tower-middle {
  filter: brightness(0.8);
  transform: rotate(-1deg);
}

.ancient-tower-animated.damage-3 .tower-base {
  filter: brightness(0.7);
  transform: rotate(1deg);
}

.ancient-tower-animated.damage-4 .health-crystal {
  background: linear-gradient(45deg, var(--accent-gold), #ffa502);
  box-shadow: 0 0 15px rgba(255, 165, 2, 0.6);
}

.ancient-tower-animated.damage-5 .health-crystal {
  background: linear-gradient(45deg, var(--accent-red), #ff4757);
  box-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
  animation: crystalDanger 0.5s ease-in-out infinite alternate;
}

@keyframes crystalDanger {
  0% {
    transform: translateX(-50%) scale(1);
  }
  100% {
    transform: translateX(-50%) scale(1.2);
  }
}

.ancient-tower-animated.damage-6 {
  animation: towerDestruction 2s ease-in-out forwards;
}

.ancient-tower-animated.damage-6 .tower-body {
  animation: towerCollapse 2s ease-in-out forwards;
}

@keyframes towerDestruction {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(2);
  }
  100% {
    transform: scale(0.8);
    filter: brightness(0.3) grayscale(1);
  }
}

@keyframes towerCollapse {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: translateY(10px) rotate(5deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(30px) rotate(15deg);
    opacity: 0.3;
  }
}

/* Screen shake effect for damage */
@keyframes screenShake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(2px);
  }
}

.screen-shake {
  animation: screenShake 0.5s ease-in-out;
}

.damage-counter {
  font-family: "Orbitron", monospace;
  color: var(--accent-red);
  font-weight: bold;
  font-size: 1.2rem;
}

/* Hero Section */
.hero-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-hint {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 15px;
  border: 1px solid var(--border-color);
}

.hero-icon {
  font-size: 4rem;
  min-width: 80px;
  text-align: center;
}

.hero-info {
  flex: 1;
}

.hero-attribute {
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 15px;
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.hero-attribute.str {
  background: linear-gradient(45deg, #c23c2a, #ff4757);
  color: white;
}
.hero-attribute.agi {
  background: linear-gradient(45deg, #2ed573, #7bed9f);
  color: white;
}
.hero-attribute.int {
  background: linear-gradient(45deg, #3742fa, #70a1ff);
  color: white;
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.role-tag {
  background: var(--accent-blue);
  color: white;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.hero-hint-text {
  color: var(--text-secondary);
  font-style: italic;
}

/* Word Display */
.word-display {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 30px;
  background: var(--bg-card);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  min-height: 100px;
  align-items: center;
}

.letter-slot {
  width: 50px;
  height: 60px;
  border: 3px solid var(--accent-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Orbitron", monospace;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent-gold);
  background: var(--bg-secondary);
  transition: all 0.3s ease;
}

.letter-slot.filled {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
  transform: scale(1.1);
}

.letter-slot.space {
  border: none;
  background: none;
  width: 20px;
}

/* Input Section */
.input-section {
  margin-bottom: 30px;
  padding: 25px;
  background: var(--bg-secondary);
  border-radius: 15px;
  border: 1px solid var(--border-color);
}

.guess-input {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#letter-input {
  width: 80px;
  height: 50px;
  text-align: center;
  font-size: 1.5rem;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  text-transform: uppercase;
  padding: 0;
  border: 3px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
}

#letter-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

.btn-guess,
.btn-guess-word {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Roboto", sans-serif;
}

.btn-guess {
  background: linear-gradient(45deg, var(--accent-blue), #70a1ff);
  color: white;
}

.btn-guess-word {
  background: linear-gradient(45deg, var(--accent-green), #7bed9f);
  color: white;
}

.btn-guess:hover,
.btn-guess-word:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-guess:disabled,
.btn-guess-word:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Used Letters */
.used-letters {
  text-align: center;
}

.used-letters h4 {
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}

#used-letters-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  align-items: center;
}

.used-letter {
  background: var(--accent-red);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  font-size: 0.9rem;
  opacity: 0;
  animation: fadeInLetter 0.3s ease forwards;
}

@keyframes fadeInLetter {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Game Controls */
.game-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.btn-new-game,
.btn-hint,
.btn-give-up {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Roboto", sans-serif;
}

.btn-new-game {
  background: linear-gradient(45deg, var(--accent-gold), #ffed4e);
  color: #333;
}

.btn-hint {
  background: linear-gradient(45deg, var(--accent-blue), #70a1ff);
  color: white;
}

.btn-give-up {
  background: linear-gradient(45deg, var(--accent-red), #ff4757);
  color: white;
}

.btn-new-game:hover,
.btn-hint:hover,
.btn-give-up:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.title {
  font-family: "Orbitron", monospace;
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(
    45deg,
    var(--accent-red),
    var(--accent-blue),
    var(--accent-gold)
  );
  background-size: 200% 200%;
  animation: gradientShift 3s ease-in-out infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.dota-logo {
  font-size: 2.5rem;
  margin: 0 15px;
  filter: drop-shadow(0 0 10px var(--accent-gold));
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 300;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Navigation Styles */
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  padding: 25px;
  background: var(--bg-secondary);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: space-between;
}

.filter-group,
.search-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-group {
  flex: 1;
  justify-content: flex-end;
}

label {
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

select,
input {
  padding: 10px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.3s ease;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

#hero-search {
  min-width: 200px;
}

.btn-random {
  padding: 10px 20px;
  background: linear-gradient(45deg, var(--accent-red), #ff6b4a);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-random:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(194, 60, 42, 0.4);
}

/* Stats Overview */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--gradient);
  padding: 25px;
  border-radius: 15px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}

.stat-card span {
  font-family: "Orbitron", monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* Heroes Grid */
.heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.hero-card {
  background: var(--bg-card);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  cursor: pointer;
  position: relative;
}

.hero-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  border-color: var(--accent-blue);
}

.hero-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(45deg, var(--accent-red), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.hero-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.hero-card:hover .hero-image::before {
  transform: translateX(100%);
}

.hero-info {
  padding: 20px;
}

.hero-name {
  font-family: "Orbitron", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}

.role-tag {
  background: var(--accent-blue);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.hero-attribute {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.str {
  background: linear-gradient(45deg, #c23c2a, #ff4757);
}
.agi {
  background: linear-gradient(45deg, #2ed573, #7bed9f);
}
.int {
  background: linear-gradient(45deg, #3742fa, #70a1ff);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.stat {
  text-align: center;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.stat-value {
  font-family: "Orbitron", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.favorite-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.favorite-btn:hover,
.favorite-btn.favorited {
  color: var(--accent-gold);
  transform: scale(1.1);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--bg-secondary);
  margin: 5% auto;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  border: 1px solid var(--border-color);
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-header {
  padding: 25px 30px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 25px;
}

.modal-header h2 {
  font-family: "Orbitron", monospace;
  color: var(--accent-gold);
  margin: 0;
}

.close {
  color: var(--text-muted);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 0 30px 25px;
}

.hero-reveal {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 25px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 15px;
}

.hero-icon-large {
  font-size: 5rem;
  min-width: 100px;
  text-align: center;
}

.hero-details h3 {
  font-family: "Orbitron", monospace;
  color: var(--accent-gold);
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.hero-details p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.game-stats-modal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.game-stats-modal .stat {
  background: var(--bg-card);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.game-stats-modal .label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.game-stats-modal .stat span:last-child {
  font-family: "Orbitron", monospace;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-gold);
}

.modal-footer {
  padding: 0 30px 30px;
  text-align: center;
}

.btn-play-again,
.btn-submit,
.btn-cancel {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Roboto", sans-serif;
  margin: 0 10px;
}

.btn-play-again {
  background: linear-gradient(45deg, var(--accent-gold), #ffed4e);
  color: #333;
}

.btn-submit {
  background: linear-gradient(45deg, var(--accent-green), #7bed9f);
  color: white;
}

.btn-cancel {
  background: linear-gradient(45deg, var(--accent-red), #ff4757);
  color: white;
}

.btn-play-again:hover,
.btn-submit:hover,
.btn-cancel:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Word Guess Modal */
#word-guess-input {
  width: 100%;
  padding: 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-top: 15px;
  text-transform: uppercase;
}

#word-guess-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

/* Health Bar */
.health-bar-container {
  margin-bottom: 20px;
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.health-bar-bg {
  width: 100%;
  height: 30px;
  background: linear-gradient(135deg, #2a2f3e, #1a1f2e);
  border: 2px solid var(--border-color);
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.health-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #2ed573, #20c997);
  border-radius: 13px;
  transition: all 0.8s ease;
  position: relative;
  box-shadow: 0 0 15px rgba(46, 213, 115, 0.4);
}

.health-bar-fill::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.1)
  );
  border-radius: 13px 13px 0 0;
}

.health-bar-fill.health-75 {
  background: linear-gradient(90deg, #f39c12, #e67e22);
  box-shadow: 0 0 15px rgba(243, 156, 18, 0.4);
}

.health-bar-fill.health-50 {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
}

.health-bar-fill.health-25 {
  background: linear-gradient(90deg, #8e44ad, #9b59b6);
  box-shadow: 0 0 15px rgba(142, 68, 173, 0.4);
}

.health-bar-fill.health-0 {
  background: linear-gradient(90deg, #34495e, #2c3e50);
  box-shadow: 0 0 15px rgba(52, 73, 94, 0.4);
  animation: healthBarDanger 1s ease-in-out infinite alternate;
}

@keyframes healthBarDanger {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.8;
  }
}

.health-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
  font-family: "Orbitron", monospace;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  z-index: 10;
}

/* Health bar animation when taking damage */
.health-bar-damage {
  animation: healthBarHit 0.3s ease-in-out;
}

@keyframes healthBarHit {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    filter: brightness(1.3);
  }
}

/* ==================== ADDITIONAL ENGAGING ANIMATIONS ==================== */

/* Letter reveal animation with typewriter effect */
.letter-slot.revealed {
  animation: letterReveal 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes letterReveal {
  0% {
    transform: scale(0) rotateY(180deg);
    opacity: 0;
    background: var(--accent-gold);
    box-shadow: 0 0 20px var(--accent-gold);
  }
  50% {
    transform: scale(1.3) rotateY(90deg);
    background: var(--accent-blue);
    box-shadow: 0 0 30px var(--accent-blue);
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
  }
}

/* Success letter animation with golden glow */
.letter-slot.success-glow {
  animation: successGlow 1s ease-in-out;
}

@keyframes successGlow {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 25px var(--accent-gold), 0 0 35px var(--accent-gold);
    transform: scale(1.1);
    background: linear-gradient(45deg, var(--accent-gold), #ffed4e);
  }
}

/* Wrong guess shake animation for input */
.input-wrong-shake {
  animation: inputWrongShake 0.5s ease-in-out;
}

@keyframes inputWrongShake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-8px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(8px);
  }
}

/* Hero icon bounce when revealed */
.hero-icon.revealed {
  animation: heroIconBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes heroIconBounce {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(-90deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Game win celebration animation */
.game-win-celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent-gold);
  animation: confettiFall 3s linear infinite;
}

.confetti-piece:nth-child(2n) {
  background: var(--accent-blue);
}
.confetti-piece:nth-child(3n) {
  background: var(--accent-green);
}
.confetti-piece:nth-child(4n) {
  background: var(--accent-red);
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Button hover effects enhancement */
.btn-guess:hover {
  animation: buttonPulse 0.6s ease-in-out infinite alternate;
}

.btn-guess-word:hover {
  animation: buttonWave 1s ease-in-out infinite;
}

.btn-hint:hover {
  animation: buttonGlow 1.5s ease-in-out infinite alternate;
}

@keyframes buttonPulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--accent-blue);
  }
}

@keyframes buttonWave {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03) rotate(1deg);
  }
}

@keyframes buttonGlow {
  0% {
    box-shadow: 0 0 5px var(--accent-gold);
  }
  100% {
    box-shadow: 0 0 25px var(--accent-gold), 0 0 35px var(--accent-gold);
  }
}

/* Word completion wave animation */
.word-complete-wave {
  animation: wordWave 1s ease-in-out;
}

@keyframes wordWave {
  0% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-10px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Health bar critical warning animation */
.health-critical-warning {
  animation: criticalFlash 0.3s ease-in-out infinite alternate;
}

@keyframes criticalFlash {
  0% {
    filter: brightness(1);
  }
  100% {
    filter: brightness(1.5) saturate(1.5);
  }
}

/* Tower victory restoration animation */
.tower-victory-restore {
  animation: towerRestore 2s ease-in-out;
}

@keyframes towerRestore {
  0% {
    filter: brightness(0.3) grayscale(1);
    transform: scale(0.8);
  }
  50% {
    filter: brightness(2) hue-rotate(120deg);
    transform: scale(1.1);
  }
  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

/* Floating text animation for score */
.floating-score {
  position: absolute;
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--accent-gold);
  pointer-events: none;
  z-index: 1000;
  animation: floatingScore 2s ease-out forwards;
}

@keyframes floatingScore {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  20% {
    transform: translateY(-20px) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(-80px) scale(1);
    opacity: 0;
  }
}

/* Used letters animation */
.used-letter {
  animation: usedLetterAppear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes usedLetterAppear {
  0% {
    transform: scale(0) rotate(180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Modal entrance animation enhancement */
.modal.show-modal .modal-content {
  animation: modalSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
  0% {
    transform: translateY(-100px) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Typing indicator animation */
.typing-indicator {
  animation: typingBlink 1s ease-in-out infinite;
}

@keyframes typingBlink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Stats counter animation */
.stat-counter-update {
  animation: statUpdate 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes statUpdate {
  0% {
    transform: scale(1);
    color: var(--text-primary);
  }
  50% {
    transform: scale(1.3);
    color: var(--accent-gold);
    text-shadow: 0 0 10px var(--accent-gold);
  }
  100% {
    transform: scale(1);
    color: var(--text-primary);
  }
}

/* Background pulse animation for wrong guesses */
.ancient-tower-animated.damage-warning {
  animation: damageWarningPulse 0.8s ease-in-out;
}

@keyframes damageWarningPulse {
  0%,
  100% {
    background: linear-gradient(135deg, #1a1f2e, #2a2f3e);
  }
  50% {
    background: linear-gradient(135deg, #4a1f1e, #5a2f2e);
  }
}

/* Letter input focus enhancement */
.letter-input-focused {
  animation: inputFocusGlow 2s ease-in-out infinite alternate;
}

@keyframes inputFocusGlow {
  0% {
    box-shadow: 0 0 5px var(--accent-blue);
  }
  100% {
    box-shadow: 0 0 20px var(--accent-blue), 0 0 30px rgba(74, 144, 226, 0.3);
  }
}

/* Role tag hover animation */
.role-tag:hover {
  animation: roleTagFloat 0.5s ease-in-out;
}

@keyframes roleTagFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Game start animation */
.game-start-animation {
  animation: gameStartSlide 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes gameStartSlide {
  0% {
    transform: translateY(50px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
