/* Scoundrel Card Game Stylesheet */

/* Theme Variables */
:root {
  /* Dark Theme (Default) */
  --primary-bg: #2c3e50;
  --secondary-bg: #34495e;
  --card-bg: #2c3e50;
  --text-primary: #ecf0f1;
  --text-secondary: #bdc3c7;
  --text-muted: #95a5a6;
  --border-color: #95a5a6;
  --border-dashed: #95a5a6;
  
  /* Health Colors */
  --health-high: #27ae60;
  --health-medium: #e67e22;
  --health-low: #c0392b;
  
  /* Button Colors */
  --btn-primary: #2980b9;
  --btn-primary-hover: #3498db;
  --btn-secondary: #7f8c8d;
  --btn-secondary-hover: #95a5a6;
  
  /* Interactive Colors */
  --drag-target: #3498db;
  --drag-target-hover: #2980b9;
  --drag-target-bg: rgba(52, 152, 219, 0.2);
  
  /* Card Effects */
  --card-played: #e67e22;
  --card-shadow: rgba(0, 0, 0, 0.2);
  --card-hover-shadow: rgba(0, 0, 0, 0.3);
  
  /* Popup/Modal Colors */
  --modal-bg: rgba(0, 0, 0, 0.8);
  --modal-content-bg: #34495e;
  --modal-border: #95a5a6;
  
  /* Suit Colors */
  --suit-red: #e74c3c;
  --suit-black: #2c3e50;
}

/* Light Theme */
[data-theme="light"] {
  --primary-bg: #ecf0f1;
  --secondary-bg: #bdc3c7;
  --card-bg: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #34495e;
  --text-muted: #7f8c8d;
  --border-color: #bdc3c7;
  --border-dashed: #95a5a6;
  
  --health-high: #27ae60;
  --health-medium: #e67e22;
  --health-low: #c0392b;
  
  --btn-primary: #3498db;
  --btn-primary-hover: #2980b9;
  --btn-secondary: #95a5a6;
  --btn-secondary-hover: #7f8c8d;
  
  --drag-target: #2980b9;
  --drag-target-hover: #1f5f8b;
  --drag-target-bg: rgba(41, 128, 185, 0.2);
  
  --card-played: #e67e22;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --card-hover-shadow: rgba(0, 0, 0, 0.2);
  
  --modal-bg: rgba(255, 255, 255, 0.9);
  --modal-content-bg: #ffffff;
  --modal-border: #bdc3c7;
  
  --suit-red: #e74c3c;
  --suit-black: #2c3e50;
}

/* Global Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  /* Prevent horizontal scrolling on mobile */
  overflow-x: hidden;
}

/* Game Container */
.game-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Ensure proper mobile spacing */
  width: 100%;
}

/* Header */
.game-header {
  text-align: center;
  margin-bottom: 20px;
}

.game-header h1 {
  font-size: 3rem;
  text-transform: uppercase;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

/* Right Side Area (Discard + Health) */
.right-side-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-width: 180px;
}

/* Health Area (in right side) */
.health-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
}

.health-area h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  text-align: center;
  color: var(--text-primary);
}

.health-value {
  text-align: center;
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--health-high);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  transition: color 0.3s ease;
}

/* Main Game Board - Scoundrel Layout */
.game-board {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  padding: 20px;
  background-color: var(--secondary-bg);
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--card-shadow);
}

/* Top Row: Deck (left), Room Cards (center), Discard+Health (right) */
.top-game-row {
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  align-items: flex-start;
  margin-bottom: 40px;
  gap: 40px;
}

/* Deck Area (Left) */
.deck-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
}

/* Discard Area (Right side, top) */
.discard-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
}

.discard-area h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  text-align: center;
  color: var(--text-primary);
}

.discard-pile {
  width: 120px;
  height: 170px;
  border-radius: 8px;
  background-color: var(--card-bg);
  border: 2px dashed var(--border-dashed);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px var(--card-shadow);
  position: relative;
  overflow: visible;
  min-height: 44px;
  min-width: 44px;
}

.discard-pile img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.discard-count {
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Discard pile animation when cards are added */
.discard-pile.updated {
  animation: pulse 0.5s ease-in-out;
  border-color: var(--btn-primary);
}

.deck-area h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  text-align: center;
  color: #ecf0f1;
}

.deck-card {
  width: 120px;
  height: 170px;
  perspective: 1000px;
  margin-bottom: 10px;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  /* Better touch targets for mobile */
  min-height: 44px;
  min-width: 44px;
}

.deck-card img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.deck-count {
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
  color: #bdc3c7;
}

/* Room Cards Area (Center) */
.room-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  max-width: 600px;
}

.room-cards h3 {
  text-align: center;
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: #ecf0f1;
}

.card-slots {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.card-slot {
  width: 120px;
  height: 170px;
  border-radius: 8px;
  background-color: #2c3e50;
  border: 2px dashed #95a5a6;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  /* Better touch targets for mobile */
  min-height: 44px;
  min-width: 44px;
}

.card-slot img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  position: relative;
}

.card {
  position: relative;
  z-index: 1;
}

.empty-slot-text {
  color: #95a5a6;
  font-size: 0.9rem;
  padding: 10px;
  text-align: center;
}

/* Equipment Area (Below) */
.equipment-area {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-bottom: 30px;
  padding: 20px;
  background-color: #2c3e50;
  border-radius: 8px;
}

.equipment-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 180px;
  position: relative;
}

.equipment-slot h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  text-align: center;
  color: #ecf0f1;
}

.equipment-card {
  width: 150px;
  height: 210px;
  border-radius: 8px;
  background-color: #34495e;
  margin: 0 auto;
  border: 2px dashed #95a5a6;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  /* Better touch targets for mobile */
  min-height: 44px;
  min-width: 44px;
  position: relative;
  overflow: visible;
}

.equipment-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.equipment {
  width: 120px;
  height: 170px;
  object-fit: cover;
  border-radius: 6px;
}

.equipment-stats {
  margin-top: 10px;
  font-size: 0.9rem;
  text-align: center;
  color: #bdc3c7;
}

/* Weapon Stack for Defeated Monsters */
.weapon-stack-container {
  position: absolute;
  width: 150px;
  height: 210px;
  top: 40px; /* Account for h3 title (1.2rem + 15px margin) */
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none; /* Allow clicks to pass through to weapon below */
}

.weapon-base-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  z-index: 1;
  box-shadow: 0 2px 4px var(--card-shadow);
}

.weapon-stack-card {
  position: absolute;
  width: 135px; /* Slightly smaller than container for layering effect */
  height: 190px;
  object-fit: cover;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  background: #fff;
  transition: transform 0.2s ease;
  pointer-events: auto; /* Allow interaction with monster cards */
}

.weapon-stack-card:hover {
  transform: translateY(-2px);
}

/* Individual stack positions for up to 5 monsters */
.weapon-stack-card:nth-child(2) { /* First monster */
  top: 8px;
  left: 6px;
  z-index: 2;
}

.weapon-stack-card:nth-child(3) { /* Second monster */
  top: 16px;
  left: 12px;
  z-index: 3;
}

.weapon-stack-card:nth-child(4) { /* Third monster */
  top: 24px;
  left: 18px;
  z-index: 4;
}

.weapon-stack-card:nth-child(5) { /* Fourth monster */
  top: 32px;
  left: 24px;
  z-index: 5;
}

.weapon-stack-card:nth-child(6) { /* Fifth monster */
  top: 40px;
  left: 30px;
  z-index: 6;
}

/* Stack overflow indicator for many monsters */
.weapon-stack-overflow {
  position: absolute;
  top: 48px;
  left: 36px;
  width: 70%;
  height: 70%;
  background: var(--secondary-bg);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--text-primary);
  z-index: 7;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

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

.game-btn {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background-color: var(--btn-secondary);
  color: #fff;
  transition: all 0.3s ease;
  min-width: 120px;
  /* Better touch targets for mobile */
  min-height: 44px;
  touch-action: manipulation;
}

.game-btn:hover {
  background-color: var(--btn-secondary-hover);
  transform: translateY(-2px);
}

.game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.primary-btn {
  background-color: var(--btn-primary);
}

.primary-btn:hover {
  background-color: var(--btn-primary-hover);
}

/* Message Log Area */
.message-log-area {
  margin-top: auto;
  padding: 15px;
  background-color: #34495e;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.message-log-area h2 {
  margin-bottom: 10px;
  border-bottom: 1px solid #7f8c8d;
  padding-bottom: 5px;
}

.message-log {
  height: 150px;
  overflow-y: auto;
  padding: 10px;
  background-color: #2c3e50;
  border-radius: 5px;
}

.log-entry {
  margin-bottom: 5px;
  padding: 5px;
  border-bottom: 1px solid #34495e;
}

/* Footer */
.game-footer {
  margin-top: 20px;
  text-align: center;
  padding: 10px;
  color: #95a5a6;
  font-size: 0.9rem;
}

/* Card Animation Effects */
@keyframes cardDeal {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.card-dealt {
  animation: cardDeal 0.5s ease-out forwards;
}

@keyframes victoryPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(241, 196, 15, 0.6);
  }
}

@keyframes defeatPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(192, 57, 43, 0.6);
  }
}

/* Card Movement Animations */
@keyframes cardMove {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.1) rotate(2deg);
    opacity: 0.9;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes cardDiscard {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  30% {
    transform: scale(1.05) rotate(5deg);
    opacity: 0.9;
  }
  100% {
    transform: scale(0.8) rotate(15deg);
    opacity: 0.7;
  }
}

@keyframes cardDealFlip {
  0% {
    transform: rotateY(180deg) scale(0.8);
    opacity: 0.8;
  }
  50% {
    transform: rotateY(90deg) scale(0.9);
    opacity: 0.9;
  }
  100% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes cardConsume {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
    opacity: 0.9;
    filter: brightness(1.2);
  }
  100% {
    transform: scale(0.7) rotate(10deg);
    opacity: 0.6;
    filter: brightness(0.8);
  }
}

/* Flying Card Styles */
.flying-card {
  position: absolute;
  z-index: 1100; /* Higher than modal z-index (1000) */
  pointer-events: none;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  transition: all 1.2s ease-in-out;
  border: 3px solid red; /* Debug border */
}

.card-move {
  animation: cardMove 0.6s ease-in-out;
}

.card-discard {
  animation: cardDiscard 0.7s ease-in-out;
}

.card-deal {
  animation: cardDealFlip 0.5s ease-out;
}

.card-consume {
  animation: cardConsume 0.6s ease-in-out;
}

/* Enhanced card interaction effects */
.card-highlight {
  box-shadow: 0 0 20px rgba(52, 152, 219, 0.8);
  transform: scale(1.05);
  transition: all 0.3s ease;
}

.card-glow {
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.6);
  transition: all 0.3s ease;
}

/* Pulse effect for important elements */
.pulse-effect {
  animation: pulse 1s ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.8);
  }
}

/* Responsive Design - Enhanced Mobile Support */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
  .game-container {
    padding: 15px;
  }
  
  .top-game-row {
    gap: 30px;
  }
  
  .equipment-area {
    gap: 40px;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .top-game-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
  }
  
  .room-cards {
    order: 1;
    max-width: 100%;
  }
  
  .deck-area {
    order: 2;
  }
  
  .right-side-area {
    order: 3;
    flex-direction: row;
    gap: 40px;
  }
  
  .equipment-area {
    gap: 30px;
  }
  
  .game-header h1 {
    font-size: 2.5rem;
  }
}

/* Large phones and small tablets */
@media (max-width: 768px) {
  .game-container {
    padding: 12px;
  }
  
  .game-board {
    padding: 15px;
  }
  
  .right-side-area {
    flex-direction: row;
    gap: 30px;
    justify-content: center;
  }
  
  .health-area h3 {
    font-size: 1.1rem;
  }
  
  .health-value {
    font-size: 1.6rem;
  }
  
  .discard-area h3 {
    font-size: 1.1rem;
  }
  
  .card-slots {
    gap: 12px;
    justify-content: center;
  }

  .card-slot {
    width: 90px;
    height: 130px;
  }
  
  .deck-card {
    width: 90px;
    height: 130px;
  }
  
  .equipment-card {
    width: 110px;
    height: 160px;
  }

  .equipment-area {
    flex-direction: column;
    gap: 20px;
    padding: 15px;
  }
  
  .equipment-slot {
    min-width: auto;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
  
  .game-controls {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .game-btn {
    min-width: 100px;
    padding: 12px 18px;
    font-size: 0.95rem;
  }
  
  .game-header h1 {
    font-size: 2.2rem;
    letter-spacing: 1px;
  }
  
  .message-log {
    height: 120px;
  }
  
  .top-game-row {
    gap: 20px;
    margin-bottom: 25px;
  }
}

/* Medium phones */
@media (max-width: 580px) {
  .game-container {
    padding: 10px;
  }
  
  .game-board {
    padding: 12px;
  }
  
  .right-side-area {
    flex-direction: column;
    gap: 15px;
  }
  
  .card-slots {
    gap: 8px;
  }
  
  .card-slot {
    width: 75px;
    height: 110px;
  }
  
  .deck-card,
  .discard-pile {
    width: 75px;
    height: 110px;
  }
  
  .equipment-card {
    width: 90px;
    height: 130px;
  }
  
  .empty-slot-text {
    font-size: 0.8rem;
    padding: 8px;
  }
  
  .game-btn {
    min-width: 90px;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  .equipment-area {
    gap: 15px;
    padding: 12px;
  }
  
  .weapon-stack-container {
    width: 110px;
    height: 160px;
  }
  
  .weapon-stack-card:nth-child(2) { top: 6px; left: 4px; }
  .weapon-stack-card:nth-child(3) { top: 12px; left: 8px; }
  .weapon-stack-card:nth-child(4) { top: 18px; left: 12px; }
  .weapon-stack-card:nth-child(5) { top: 24px; left: 16px; }
  .weapon-stack-card:nth-child(6) { top: 30px; left: 20px; }
  
  .weapon-stack-overflow {
    top: 36px;
    left: 24px;
    font-size: 0.7rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .game-container {
    padding: 8px;
  }
  
  .game-board {
    padding: 10px;
  }
  
  .right-side-area {
    gap: 12px;
  }
  
  .health-area h3,
  .discard-area h3 {
    font-size: 1rem;
    margin-bottom: 8px;
  }
  
  .health-value {
    font-size: 1.4rem;
  }
  
  .card-slots {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 100px;
    margin: 0 auto;
  }
  
  .card-slot {
    width: 80px;
    height: 115px;
  }
  
  .deck-card {
    width: 80px;
    height: 115px;
  }
  
  .equipment-card {
    width: 95px;
    height: 135px;
  }
  
  .game-header h1 {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }
  
  .top-game-row {
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .equipment-area {
    gap: 12px;
    padding: 10px;
  }
  
  .game-controls {
    gap: 8px;
  }
  
  .game-btn {
    min-width: 80px;
    padding: 10px 14px;
    font-size: 0.85rem;
    border-radius: 4px;
  }
  
  .message-log {
    height: 100px;
    font-size: 0.9rem;
  }
  
  .message-log-area {
    padding: 12px;
  }
  
  .deck-area h3,
  .room-cards h3,
  .equipment-slot h3,
  .health-area h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }
}

/* Extra small phones */
@media (max-width: 360px) {
  .game-container {
    padding: 6px;
  }
  
  .game-board {
    padding: 8px;
  }
  
  .card-slot,
  .deck-card,
  .discard-pile {
    width: 70px;
    height: 100px;
  }
  
  .equipment-card {
    width: 85px;
    height: 120px;
  }
  
  .game-header h1 {
    font-size: 1.6rem;
  }
  
  .game-btn {
    min-width: 70px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .health-value {
    font-size: 1.2rem;
  }
  
  .empty-slot-text {
    font-size: 0.7rem;
    padding: 5px;
  }
  
  .equipment-stats {
    font-size: 0.8rem;
  }
  
  .deck-count {
    font-size: 1rem;
  }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .game-container {
    padding: 8px;
  }
  
  .game-header h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }
  
  .top-game-row {
    flex-direction: row;
    gap: 20px;
    margin-bottom: 15px;
  }
  
  .equipment-area {
    flex-direction: row;
    gap: 20px;
    margin-bottom: 15px;
  }
  
  .card-slots {
    flex-direction: row;
    gap: 8px;
  }
  
  .message-log {
    height: 80px;
  }
  
  .game-footer {
    margin-top: 10px;
  }
}

/* Drag and Drop Styling */
.draggable {
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draggable:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.draggable:active {
  cursor: grabbing;
}

.non-draggable {
  cursor: default;
  transition: none;
}

.non-draggable:hover {
  transform: none;
  box-shadow: none;
}

.dragging {
  opacity: 0.6;
}

/* Custom Modal/Popup Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--modal-content-bg);
  border: 2px solid var(--modal-border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.7);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-icon {
  font-size: 2.5rem;
  margin-right: 1rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--secondary-bg);
}

.modal-title {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
}

.modal-body {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.modal-card-info {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.modal-card-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-card-details {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-btn-primary {
  background-color: var(--btn-primary);
  color: white;
}

.modal-btn-primary:hover {
  background-color: var(--btn-primary-hover);
  transform: translateY(-1px);
}

.modal-btn-secondary {
  background-color: var(--btn-secondary);
  color: white;
}

.modal-btn-secondary:hover {
  background-color: var(--btn-secondary-hover);
  transform: translateY(-1px);
}

.modal-btn-danger {
  background-color: var(--health-low);
  color: white;
}

.modal-btn-danger:hover {
  background-color: #a93226;
  transform: translateY(-1px);
}

/* Combat specific styles */
.combat-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.combat-stat {
  text-align: center;
  padding: 0.75rem;
  background-color: var(--secondary-bg);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.combat-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.combat-stat-value {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text-primary);
}

/* Mobile responsiveness for modals */
@media (max-width: 480px) {
  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .modal-actions {
    justify-content: stretch;
  }
  
  .modal-btn {
    flex: 1;
    min-width: auto;
  }
  
  .combat-stats {
    grid-template-columns: 1fr;
  }
}

.drop-target {
  border: 2px dashed #3498db;
  transition: all 0.3s ease;
}

.drop-target.drag-over {
  background-color: rgba(52, 152, 219, 0.2);
  border-color: #2980b9;
  transform: scale(1.05);
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
  .draggable:hover {
    transform: none;
    box-shadow: none;
  }
  
  .game-btn:hover {
    transform: none;
    background-color: #7f8c8d;
  }
  
  .primary-btn:hover {
    background-color: #2980b9;
  }
  
  /* Increase touch targets */
  .card-slot,
  .deck-card,
  .equipment-card {
    min-height: 48px;
    min-width: 48px;
  }
  
  .game-btn {
    min-height: 48px;
    padding: 14px 20px;
  }
}

/* Card suit colors and hover effects */
.card[data-suit="hearts"],
.card[data-suit="diamonds"] {
  border-left: 3px solid #e74c3c;
}

.card[data-suit="clubs"],
.card[data-suit="spades"] {
  border-left: 3px solid #2c3e50;
}

.card[data-suit="hearts"]:hover::before {
  content: "❤️ Health Potion";
  position: absolute;
  bottom: -25px;
  left: 0;
  width: 100%;
  text-align: center;
  background-color: rgba(44, 62, 80, 0.9);
  padding: 3px;
  border-radius: 3px;
  font-size: 0.8rem;
  z-index: 20;
}

.card[data-suit="diamonds"]:hover::before {
  content: "💎 Weapon";
  position: absolute;
  bottom: -25px;
  left: 0;
  width: 100%;
  text-align: center;
  background-color: rgba(44, 62, 80, 0.9);
  padding: 3px;
  border-radius: 3px;
  font-size: 0.8rem;
  z-index: 20;
}

.card[data-suit="clubs"]:hover::before {
  content: "♣️ Monster";
  position: absolute;
  bottom: -25px;
  left: 0;
  width: 100%;
  text-align: center;
  background-color: rgba(44, 62, 80, 0.9);
  padding: 3px;
  border-radius: 3px;
  font-size: 0.8rem;
  z-index: 20;
}

.card[data-suit="spades"]:hover::before {
  content: "♠️ Monster";
  position: absolute;
  bottom: -25px;
  left: 0;
  width: 100%;
  text-align: center;
  background-color: rgba(44, 62, 80, 0.9);
  padding: 3px;
  border-radius: 3px;
  font-size: 0.8rem;
  z-index: 20;
}

.card-played {
  opacity: 0.5;
  border: 2px solid #e67e22;
  filter: grayscale(60%);
}

.cards-played-display {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 0.5em;
  color: #ecf0f1;
  text-align: center;
}

/* Card count effect animation */
@keyframes cardCountEffect {
  0% {
    transform: scale(0) translateY(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) translateY(-10px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(-20px);
    opacity: 0;
  }
}

/* Mobile-specific performance optimizations */
@media (max-width: 768px) {
  * {
    /* Reduce animations on mobile for better performance */
    animation-duration: 0.2s !important;
    transition-duration: 0.2s !important;
  }
  
  .card-dealt {
    animation-duration: 0.3s;
  }
}
