/* ===============================
   RESET BASE
   =============================== */

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #083b21;
  color: #f0f0f0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===============================
   DARK MODE STYLES
   =============================== */

.dark-mode body {
  background: #0a0a0a;
  color: #e0e0e0;
}

.dark-mode #game-container {
  background: transparent;
}

.dark-mode #table {
  background: radial-gradient(circle at top, #1a1a1a 0%, #0f0f0f 55%, #050505 100%);
}

.dark-mode .scoreRow {
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
  border-color: #333;
}

.dark-mode .briscola-box {
  background: #0f0f0f;
  border-color: #333;
}

.dark-mode .card {
  filter: brightness(0.9);
}

.dark-mode .card:hover {
  filter: brightness(1.1);
}

.dark-mode .button-rect {
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  border-color: #444;
  color: #e0e0e0;
}

.dark-mode .button-rect:hover {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
}

/* ===============================
   CONTENITORE PRINCIPALE
   =============================== */

#game-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===============================
   RIGA 1 — Pulsanti + Punteggi + Briscola
   =============================== */

#topRow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}

/* GRUPPO PUNTEGGI + BRISCOLA */
#score-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  position: relative;
}

/* ===============================
   PULSANTI ICONA
   =============================== */

#button-group {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

button,
#button-group button {
  background: linear-gradient(180deg, #f7d774 0%, #e0a800 100%);
  border: 2px solid #b8860b;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1b1202;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 0 #8a6408;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

button:hover {
  background: linear-gradient(180deg, #ffe58a 0%, #f0b800 100%);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 0 #8a6408, 0 0 20px rgba(255, 215, 0, 0.5);
}

button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 1px 0 #8a6408;
}

/* Glow effect quando attivo/pronto */
button.ready,
button.active {
  animation: buttonGlow 2s ease-in-out infinite;
  box-shadow: 0 2px 0 #8a6408, 0 0 15px rgba(255, 215, 0, 0.6);
}

@keyframes buttonGlow {
  0%, 100% {
    box-shadow: 0 2px 0 #8a6408, 0 0 15px rgba(255, 215, 0, 0.6);
  }
  50% {
    box-shadow: 0 2px 0 #8a6408, 0 0 25px rgba(255, 215, 0, 0.9);
  }
}

.dark-mode button {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border-color: #555;
  color: #e0e0e0;
  box-shadow: 0 2px 0 #1a1a1a;
}

.dark-mode button:hover {
  background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
  box-shadow: 0 4px 0 #1a1a1a, 0 0 20px rgba(100, 100, 100, 0.5);
}

.dark-mode button.ready,
.dark-mode button.active {
  box-shadow: 0 2px 0 #1a1a1a, 0 0 15px rgba(150, 150, 150, 0.6);
  animation: buttonGlowDark 2s ease-in-out infinite;
}

@keyframes buttonGlowDark {
  0%, 100% {
    box-shadow: 0 2px 0 #1a1a1a, 0 0 15px rgba(150, 150, 150, 0.6);
  }
  50% {
    box-shadow: 0 2px 0 #1a1a1a, 0 0 25px rgba(150, 150, 150, 0.9);
  }
}

/* ===============================
   PULSANTI RETTANGOLARI
   =============================== */

.button-rect,
#nextHandBtn,
.panel-close-btn {
  background: linear-gradient(180deg, #f7d774 0%, #e0a800 100%);
  border: 2px solid #b8860b;
  border-radius: 10px;
  padding: 8px 16px;
  min-height: 38px;
  font-size: 1rem;
  font-weight: 700;
  color: #1b1202;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 0 #8a6408;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.button-rect:hover {
  background: linear-gradient(180deg, #ffe58a 0%, #f0b800 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #8a6408;
}

.button-rect:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #8a6408;
}

/* Stile premium specifico per pulsante Prossima Mano */
#nextHandBtn {
  background: linear-gradient(180deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%) !important;
  border: 2px solid #b8860b !important;
  padding: 5px 32px !important;
  min-height: unset !important;
  height: auto !important;
  min-width: 180px;
  width: fit-content;
  font-size: 0.85rem !important;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-weight: 600;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 0 #8a6408 !important;
  animation: nextHandPulse 0.6s ease-in-out infinite;
  white-space: nowrap !important;
}

#nextHandBtn:hover {
  background: linear-gradient(180deg, #ffed4e 0%, #ffff99 50%, #ffed4e 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #8a6408, inset 0 1px 0 rgba(255,255,255,0.6), 0 0 20px rgba(255, 215, 0, 0.6);
}

#nextHandBtn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #8a6408, inset 0 1px 0 rgba(255,255,255,0.3);
}

@keyframes nextHandPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.02);
  }
}

/* ===============================
   AVVERSARI (IA1 / IA2)
   =============================== */

/* Spazio riservato per popup/notifications in mobile */
#popup-space {
  display: none;
  height: 0;
  width: 0;
  background: transparent;
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

#opponent-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.opponent {
  background: radial-gradient(circle at top, #16663a 0%, #0f4f2e 55%, #0a3a22 100%);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 8px;
  border-radius: 10px;
  width: 120px;
  text-align: center;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
}

.player-name {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.ai-difficulty {
  font-size: 0.85rem;
  margin-left: 4px;
}

.opponent-hand {
  font-size: 0.95rem;
  font-weight: 600;
}

/* ===============================
   TAVOLO + IA + TUA MANO
   =============================== */

#table-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

/* ===============================
   PUNTEGGI
   =============================== */

#score-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.scoreRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(180deg, #115533 0%, #0b3a23 100%);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}

.scoreRow span {
  color: #ffd700;
}

/* ===============================
   TAVOLO DI GIOCO
   =============================== */

#table {
  background: #0b3d24;
  border-radius: 12px;
  padding: 14px 12px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 600px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ===============================
   BRISCOLA
   =============================== */

#briscola-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: column;
  min-width: 70px;
}

#briscola {
  min-width: 66px;
  min-height: 26px;
  border-radius: 6px;
  background: #125b36;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
}

/* ===============================
   CARTE GIOCATE
   =============================== */

#table-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

#played {
  display: flex;
  gap: 14px;
  text-align: center;
}

.played-slot {
  width: 132px;
  height: 198px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.played-label {
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 0 4px black;
}

#deck-box {
  font-size: 0.95rem;
}

/* ===============================
   TUA MANO
   =============================== */

#player-area {
  background: radial-gradient(circle at top, #166c3f 0%, #0f4f2e 45%, #0a3a22 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 10px 14px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  max-width: 460px;
  margin: 0 auto;
}

.player-hand {
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* ===============================
   CARTE — PREMIUM
   =============================== */

.card {
  width: min(26vw, 132px);
  height: calc(min(26vw, 132px) * 1.5);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.25);
}

/* ===============================
   EVIDENZIAZIONE VINCITORE
   =============================== */

.winner-highlight {
  border: 3px solid #ffd700 !important;
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.95) !important;
  z-index: 5;
}

/* ===============================
   JOKER UI
   =============================== */

.player-box {
  position: relative;
  padding: 6px 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.player-box.joker {
  border: 3px solid gold;
  box-shadow: 0 0 12px gold;
}

.joker-banner {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: gold;
  color: black;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.player-box.joker .joker-banner {
  opacity: 1;
  transform: translateX(-50%) translateY(2px);
}
/* ===============================
   RESPONSIVE — TABLET (max 900px)
   =============================== */

@media (max-width: 900px) {

  #topRow {
    flex-wrap: wrap;
    gap: 8px;
  }

  #opponent-row {
    gap: 10px;
  }

  #player-ai1,
  #player-ai2 {
    width: 110px;
  }

  #table-layout {
    flex-wrap: wrap;
  }
}

/* ===============================
   RESPONSIVE — MOBILE GRANDE (max 768px)
   =============================== */

@media (max-width: 768px) {

  #topRow {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  #score-group {
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  #score-column {
    max-width: 260px;
  }

  .scoreRow {
    max-width: 260px;
    gap: 8px;
    font-size: 0.9rem;
  }

  #briscola-box {
    margin-left: 12px;
    margin-top: -36px; /* 🔥 MODIFICA VISIBILE */
  }

  #player-ai1,
  #player-ai2 {
    width: 46%;
    min-width: 95px;
    padding: 4px 6px;
  }

  #table {
    width: 100%;
    max-width: 360px;
  }

  .played-slot {
    width: min(28vw, 110px);
    height: calc(min(28vw, 110px) * 1.5);
  }
}

/* ===============================
   RESPONSIVE — MOBILE PICCOLO (max 480px)
   =============================== */

@media (max-width: 480px) {

  #topRow {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  #score-group {
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  #score-column {
    max-width: 220px;
  }

  .scoreRow {
    max-width: 220px;
    gap: 8px;
    font-size: 0.85rem;
  }

  #briscola-box {
    min-width: 70px;
    margin-left: 18px; /* 👉 più a destra su schermi piccoli */
    margin-top: -42px; /* 🔥 MODIFICA PIÙ FORTE SU MOBILE PICCOLO */
  }

  /* Spazio designato per popup SOTTO score-column a sinistra */
  #popup-space {
    display: block;
    height: 105px; /* 3 righe più grandi: 32px * 3 + gap */
    width: 200px;
    background: transparent;
    position: fixed;
    top: 140px; /* Sotto topRow e punteggi */
    left: 75px;
    overflow: visible;
    pointer-events: none;
    z-index: 9999;
  }

  #player-ai1,
  #player-ai2 {
    width: 47%;
    min-width: 88px;
    padding: 2px 4px;
  }

  #table-row {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ===============================
   DESKTOP — ORDINAMENTO (min 901px)
   =============================== */

@media (min-width: 901px) {

  #topRow {
    flex-direction: column;
    align-items: flex-start;
  }

  #button-group {
    order: 1;
  }

  #score-group {
    order: 2;
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    margin-top: 6px;
  }
}

/* ===============================
   ANIMAZIONI PREMIUM
   =============================== */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0) rotateZ(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px) rotateZ(-1deg); }
  20%, 40%, 60%, 80% { transform: translateX(4px) rotateZ(1deg); }
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 215, 0, 0));
  }
  50% { 
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
  }
}

@keyframes flipCard {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

@keyframes cardHover {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.05); }
}

@keyframes winBanner {
  0% { 
    opacity: 0;
    transform: translateY(-30px) scale(0.8);
  }
  50% { 
    opacity: 1;
    transform: translateY(0) scale(1.1);
  }
  100% { 
    opacity: 0;
    transform: translateY(30px) scale(0.8);
  }
}

@keyframes scaleYDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-50%) scaleY(0);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-50%) scaleY(1);
  }
}

@keyframes scaleYUp {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(-50%) scaleY(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-50%) scaleY(0);
  }
}

/* ===============================
   TOAST NOTIFICATIONS
   =============================== */

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toast:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.toast-success { background-color: #10b981; color: white; }
.toast-error { background-color: #ef4444; color: white; }
.toast-warning { background-color: #f59e0b; color: white; }
.toast-info { background-color: #3b82f6; color: white; }

/* Toast migliorati con emoji e dettagli */
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 400px;
}

.toast-icon {
  font-size: 1.2em;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-weight: 600;
  font-size: 0.95em;
}

.toast-details {
  font-size: 0.85em;
  opacity: 0.9;
  line-height: 1.3;
}

.dark-mode .toast {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.dark-mode .toast-success { background-color: #059669; }
.dark-mode .toast-error { background-color: #dc2626; }
.dark-mode .toast-warning { background-color: #d97706; }
.dark-mode .toast-info { background-color: #2563eb; }

.victory-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: winBanner 2s ease-in-out forwards;
}

/* ===============================
   CARTE PREMIUM STYLES
   =============================== */

.card-image {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  border-radius: 4px;
}

.card-image:hover {
  animation: cardHover 0.3s ease-out forwards;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.card-image.clickable {
  cursor: pointer;
}

.card-image.card-selected {
  border: 3px solid #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
  animation: pulse 0.6s ease-in-out;
}

.card-image.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(100%);
}

/* ===============================
   PULSANTI PREMIUM
   =============================== */

button {
  transition: all 0.2s ease;
  border-radius: 6px;
  font-weight: 600;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===============================
   SFONDO TAVOLO PREMIUM
   =============================== */

#game-container {
  background: linear-gradient(135deg, #0f2818 0%, #083b21 50%, #051f14 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* ===============================
   EFFETTI HOVER PER PUNTEGGI
   =============================== */

.score-horizontal span {
  transition: all 0.2s ease;
}

.score-horizontal span:hover {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* ===============================
   EFFETTI DI DISABILITÀ CARTA
   =============================== */

.player-hand .card-image {
  position: relative;
}

.player-hand .card-image.disabled {
  opacity: 0.4;
  filter: grayscale(50%);
  pointer-events: none;
}

/* ===============================
   VISUALIZZAZIONE MANO DEL GIOCATORE
   =============================== */

.player-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.player-hand .card-image {
  margin-bottom: 8px;
}

/* ===============================
   BRISCOLA PREMIUM STYLING
   =============================== */

#briscola-box {
  border: 2px solid #fbbf24;
  border-radius: 8px;
  padding: 10px;
  background: rgba(251, 191, 36, 0.1);
}

#briscola {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===============================
   TRANSIZIONI SMOOTH
   =============================== */

* {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ===============================
   ACCESSIBILITY
   =============================== */

button:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

.card-image:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
/* ===============================
   ANIMAZIONI PHASER PREMIUM
   =============================== */

/* Particelle vittoria */
@keyframes particleFloat {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.5);
  }
}

@keyframes sparkleOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0) translateY(30px);
  }
}

@keyframes expansePulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* Coriandoli */
@keyframes confettiFade {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100px) scale(0) rotate(360deg);
  }
}

/* Briscola glow */
@keyframes briscolaGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  }
}

/* Hover carta premium */
.card-interactive {
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.card-interactive:hover {
  filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.4));
}

/* Effetto shine su hover */
.card-interactive::before {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-interactive:hover::before {
  opacity: 1;
  animation: shine 0.6s ease-out;
}

@keyframes shine {
  0% {
    top: -100%;
  }
  100% {
    top: 100%;
  }
}

/* Flip 3D carta */
@keyframes cardFlip {
  0% {
    transform: rotateY(0deg) scale(1);
  }
  50% {
    transform: rotateY(90deg) scale(1.05);
  }
  100% {
    transform: rotateY(0deg) scale(1);
  }
}

/* Victory highlight */
.card-victory {
  animation: victoryPulse 0.6s ease-out;
}

@keyframes victoryPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 20px rgba(52, 211, 153, 0);
  }
}

/* Smooth card entry */
@keyframes cardEntry {
  from {
    opacity: 0;
    transform: scale(0.7) rotateZ(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateZ(0deg);
  }
}

.card-entry {
  animation: cardEntry 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}