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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  width: 100%;
  max-width: 600px;
}

.screen.active {
  display: flex;
}

.hidden {
  display: none !important;
}

/* AUTH SCREEN */
#auth-screen h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.auth-form {
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 15px;
  width: 100%;
  max-width: 350px;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #ffd700;
}

.auth-form input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1rem;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.auth-form input:focus {
  outline: none;
  border-color: #667eea;
}

.auth-form .btn-primary {
  width: 100%;
  margin-top: 10px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.auth-switch a {
  color: #667eea;
  text-decoration: none;
  font-weight: bold;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.error-message {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 10px;
  border-radius: 8px;
  margin-top: 15px;
  text-align: center;
  font-size: 0.9rem;
}

.btn-logout {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

/* HOME SCREEN */
#home-screen {
  position: relative;
}

#home-screen h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.username-display {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  font-size: 1.2rem;
}

.username-display strong {
  color: #ffd700;
  margin-left: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 15px 40px;
  font-size: 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 25px;
  font-size: 1rem;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 15px;
}

.status {
  margin-top: 30px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffd700;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* GAME SCREEN */
#game-screen {
  max-width: 100%;
  padding: 10px;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  width: 100%;
  max-width: 500px;
}

.player-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.indicator {
  font-size: 0.8rem;
}

.indicator.ally {
  color: #4ade80;
}

.indicator.enemy {
  color: #f87171;
}

.health-bar {
  flex: 1;
  height: 25px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.health-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.health-fill.ally {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.health-fill.enemy {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.health-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.energy-display {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.1rem;
  color: #fbbf24;
}

.game-container {
  margin: 15px 0;
  position: relative;
}

.turn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 15px;
}

.turn-index {
  padding: 8px 15px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid #8b5cf6;
  border-radius: 20px;
  font-weight: bold;
  color: #8b5cf6;
  font-size: 0.9rem;
}

.turn-indicator {
  flex: 1;
  text-align: center;
  padding: 8px 20px;
  background: rgba(74, 222, 128, 0.2);
  border: 1px solid #4ade80;
  border-radius: 20px;
  font-weight: bold;
  color: #4ade80;
}

.turn-indicator.enemy-turn {
  background: rgba(248, 113, 113, 0.2);
  border-color: #f87171;
  color: #f87171;
}

.turn-timer {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  font-weight: bold;
  min-width: 70px;
  justify-content: center;
}

.turn-timer.warning {
  background: rgba(251, 191, 36, 0.2);
  border-color: #fbbf24;
  color: #fbbf24;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

.turn-timer.critical {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ef4444;
  animation: pulse 0.3s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

.timer-icon {
  font-size: 1rem;
}

.timer-value {
  font-size: 1.1rem;
  font-family: "Courier New", monospace;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px;
  border-radius: 10px;
  max-width: 450px;
}

.cell {
  aspect-ratio: 1;
  background: #2d3748;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-width: 40px;
}

.cell:hover {
  background: #4a5568;
}

.cell.valid-move {
  background: rgba(74, 222, 128, 0.3);
  border: 2px solid #4ade80;
}

.cell.valid-target {
  background: rgba(251, 191, 36, 0.3);
  border: 2px solid #fbbf24;
}

.cell.in-range {
  background: rgba(251, 191, 36, 0.2);
}

.cell.damage-zone {
  background: rgba(248, 113, 113, 0.4);
  border: 2px dashed #f87171;
}

.cell.damage-preview {
  background: rgba(239, 68, 68, 0.5) !important;
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.cell.heal-preview {
  background: rgba(34, 197, 94, 0.5) !important;
  border: 2px solid #22c55e !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.damage-number {
  position: absolute;
  font-size: 0.75rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 10;
}

.damage-number.damage {
  color: #ff6b6b;
}

.damage-number.heal {
  color: #4ade80;
}

/* Floating damage/heal numbers - partono dall'icona del player */
.floating-number {
  position: absolute;
  font-size: 1.4rem;
  font-weight: bold;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.5),
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
  pointer-events: none;
  z-index: 100;
  animation: floatUp 1.2s ease-out forwards;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.floating-number.damage {
  color: #ff4444;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.9),
    0 0 15px rgba(255, 0, 0, 0.5),
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.floating-number.heal {
  color: #44ff88;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.9),
    0 0 15px rgba(0, 255, 100, 0.5),
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateX(calc(-50% + var(--float-x, 0px))) translateY(0)
      scale(0.5);
  }
  15% {
    transform: translateX(calc(-50% + var(--float-x, 0px))) translateY(-10px)
      scale(1.3);
  }
  100% {
    opacity: 0;
    transform: translateX(calc(-50% + var(--float-x, 0px))) translateY(-60px)
      scale(1);
  }
}

.cell .player {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
}

.cell .player.ally {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.cell .player.enemy {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* CARDS */
.cards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 500px;
}

.cards-hand {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px;
}

.card {
  width: 80px;
  height: 110px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  border: 2px solid #3b82f6;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.card.selected {
  border-color: #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
  transform: translateY(-15px);
}

.card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card-cost {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #fbbf24;
  color: #000;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 0.8rem;
}

.card-icon {
  font-size: 1.8rem;
  margin-top: 10px;
}

.card-name {
  font-size: 0.65rem;
  text-align: center;
  margin-top: auto;
  color: #94a3b8;
}

.card-damage {
  font-size: 0.75rem;
  color: #f87171;
  font-weight: bold;
}

.btn-end-turn {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border: none;
  color: white;
  padding: 12px 30px;
  font-size: 1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-end-turn:hover {
  transform: scale(1.05);
}

.btn-end-turn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-surrender {
  background: transparent;
  border: 1px solid #f87171;
  color: #f87171;
  padding: 8px 20px;
  font-size: 0.9rem;
  border-radius: 20px;
  cursor: pointer;
}

/* GAME OVER */
#gameover-screen {
  text-align: center;
}

#gameover-content {
  background: rgba(0, 0, 0, 0.5);
  padding: 50px;
  border-radius: 20px;
}

#gameover-title {
  font-size: 3rem;
  margin-bottom: 20px;
}

#gameover-title.victory {
  color: #4ade80;
  text-shadow: 0 0 30px rgba(74, 222, 128, 0.5);
}

#gameover-title.defeat {
  color: #f87171;
  text-shadow: 0 0 30px rgba(248, 113, 113, 0.5);
}

#gameover-message {
  font-size: 1.2rem;
  color: #94a3b8;
  margin-bottom: 30px;
}

/* MODAL */
.modal {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 15px 25px;
  border-radius: 15px;
  z-index: 1000;
  pointer-events: auto;
}

.modal-content {
  text-align: center;
}

.modal-content h3 {
  margin-bottom: 10px;
  color: #fbbf24;
}

.modal-content p {
  color: #94a3b8;
  margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 500px) {
  .cell {
    min-width: 35px;
    font-size: 1.2rem;
  }

  .card {
    width: 65px;
    height: 90px;
  }

  .player-info {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Turn notification */
.turn-notification {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 30px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1.2rem;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  text-align: center;
}

.turn-notification .main-text {
  display: block;
}

.turn-notification .sub-text {
  display: block;
  font-size: 0.8rem;
  font-weight: normal;
  margin-top: 5px;
  opacity: 0.8;
}

.turn-notification.turn-start {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.5);
}

.turn-notification.turn-end {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
}

.turn-notification.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

/* DECK BUILDER STYLES */
#deck-screen {
  max-width: 900px;
  padding: 20px;
}

.deck-header {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  margin-bottom: 20px;
}

.deck-header h1 {
  flex: 1;
  text-align: center;
  font-size: 2rem;
}

.btn-back {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

.deck-selector {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-bottom: 15px;
}

.deck-selector select {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.deck-selector select option {
  background: #1a1a2e;
}

.btn-small {
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-small.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-small.btn-danger:hover {
  background: rgba(239, 68, 68, 0.4);
}

.deck-active-indicator {
  width: 100%;
  margin-bottom: 15px;
}

.deck-active-indicator label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.deck-active-indicator label:hover {
  background: rgba(255, 255, 255, 0.1);
}

.deck-active-indicator input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.deck-active-indicator input[type="checkbox"]:checked + span {
  color: #4ade80;
  font-weight: bold;
}

.deck-name-editor {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 20px;
}

.deck-name-editor input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1rem;
}

.deck-name-editor input:focus {
  outline: none;
  border-color: #667eea;
}

.deck-section {
  width: 100%;
  margin-bottom: 25px;
}

.deck-section h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #ffd700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.deck-section h2 span {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.deck-cards-grid,
.collection-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  min-height: 100px;
}

.deck-cards-grid {
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
}

.deck-card {
  background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.deck-card:hover {
  transform: translateY(-5px);
  border-color: #ffd700;
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.2);
}

.deck-card.in-deck {
  opacity: 0.5;
  border-color: rgba(255, 255, 255, 0.1);
}

.deck-card.in-deck:hover {
  opacity: 0.7;
}

.deck-card-title {
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: #ffd700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-card-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.deck-card-cost {
  color: #60a5fa;
}

.deck-card-damage {
  color: #f87171;
}

.deck-card-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(239, 68, 68, 0.8);
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.deck-card:hover .deck-card-remove {
  opacity: 1;
}

.deck-card-remove:hover {
  background: #ef4444;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

#deck-error {
  width: 100%;
  margin-top: 10px;
}

/* Empty deck message */
.deck-cards-grid:empty::before {
  content: "Drag cards here or click to add";
  display: block;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  padding: 30px;
  grid-column: 1 / -1;
}

/* ============================================
   CARD DETAIL TOOLTIP
   ============================================ */

.card-detail-tooltip {
  position: fixed;
  z-index: 9999;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 16px;
  min-width: 260px;
  max-width: 320px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(59, 130, 246, 0.3);
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.card-detail-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.card-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-detail-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 10px;
}

.card-detail-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.card-detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.card-detail-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
}

.card-detail-stat-icon {
  font-size: 1.1rem;
}

.card-detail-stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
}

.card-detail-stat-value {
  color: #fff;
  font-weight: bold;
  margin-left: auto;
}

.card-detail-stat.damage .card-detail-stat-value {
  color: #f87171;
}

.card-detail-stat.energy .card-detail-stat-value {
  color: #fbbf24;
}

.card-detail-stat.range .card-detail-stat-value {
  color: #60a5fa;
}

.card-detail-stat.area .card-detail-stat-value {
  color: #a78bfa;
}

.card-detail-description {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-detail-description-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
}

.card-detail-description-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  font-style: italic;
}

/* ========================================
   COUNTDOWN OVERLAY
   ======================================== */

.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.countdown-overlay.hidden {
  display: none !important;
}

.countdown-content {
  text-align: center;
}

.countdown-number {
  font-size: 12rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow:
    0 0 30px rgba(255, 215, 0, 0.8),
    0 0 60px rgba(255, 215, 0, 0.5),
    0 0 100px rgba(255, 215, 0, 0.3);
  animation: countdown-pulse 0.5s ease-out;
}

.countdown-number.go {
  font-size: 8rem;
  color: #4ade80;
  text-shadow:
    0 0 30px rgba(74, 222, 128, 0.8),
    0 0 60px rgba(74, 222, 128, 0.5),
    0 0 100px rgba(74, 222, 128, 0.3);
}

.countdown-text {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 20px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

@keyframes countdown-pulse {
  0% {
    transform: scale(1.5);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   USER INFO DISPLAY (HOME)
   ======================================== */

.user-info-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.user-info-display .username {
  font-size: 1.4rem;
  color: #ffd700;
  font-weight: bold;
}

.rating-display,
.deck-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 1rem;
}

.rating-display {
  color: #fbbf24;
}

.rating-display .rating-value {
  font-weight: bold;
  font-size: 1.2rem;
}

.deck-display {
  color: #a78bfa;
}

.deck-display .deck-name {
  font-weight: bold;
}

/* ========================================
   RATING CHANGE (GAME OVER)
   ======================================== */

.rating-change {
  font-size: 1.5rem;
  font-weight: bold;
  padding: 10px 25px;
  border-radius: 25px;
  margin-top: 15px;
  animation: rating-pop 0.5s ease-out;
}

.rating-change.positive {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.2);
  border: 2px solid #4ade80;
}

.rating-change.negative {
  color: #f87171;
  background: rgba(248, 113, 113, 0.2);
  border: 2px solid #f87171;
}

@keyframes rating-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   MOVEMENT RANGE
   ======================================== */

/* All reachable cells have subtle background */
.cell.in-range {
  background: rgba(74, 222, 128, 0.15);
}

/* Only outer border cells have accent border */
.cell.in-range.range-border {
  box-shadow: inset 0 0 0 2px #4ade80;
}

/* ========================================
   MOVEMENT PATH (DRAG)
   ======================================== */

.cell.path-cell {
  background: rgba(74, 222, 128, 0.5) !important;
  box-shadow: inset 0 0 0 2px #22c55e !important;
}

.path-step-number {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  z-index: 5;
}

/* Disable text selection and improve touch */
.game-board {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
}
