/* === OVERLAY DAMA === */
.gotchi-checkers-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1109;
  backdrop-filter: blur(2px);
}

.gotchi-checkers-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1e1e1e;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  padding: 2rem;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 95%;
  max-width: 500px;
  margin: 0 auto;
  z-index: 1101;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

/* === HEADER === */
.gotchi-checkers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

.gotchi-checkers-header h3 {
  margin: 0;
  font-size: 0.75rem;
  color: #fff;
}

.gotchi-checkers-controls {
  display: flex;
  gap: 0.5rem;
}

.checkers-popup-minimize-button,
.checkers-popup-close-button {
  background: #333;
  border: 1px solid #555;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s ease;
}

.checkers-popup-minimize-button:hover,
.checkers-popup-close-button:hover {
  background: #444;
  border-color: #666;
}

/* === INFO GIOCATORI === */
.gotchi-checkers-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: #2a2a2a;
  border-radius: 8px;
  box-sizing: border-box;
}

.player-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.player-label {
  font-size: 0.65rem;
  color: #aaa;
}

.player-pieces {
  font-size: 0.95rem;
  font-weight: bold;
  color: #fff;
}

.turn-indicator {
  text-align: center;
}

.turn-text {
  font-size: 0.7rem;
  font-weight: bold;
  color: #4CAF50;
}

/* === PLANCIA === */
.gotchi-checkers-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
  width: 75%;
  aspect-ratio: 1;
  margin: 0 auto;
  margin-bottom: 0.5rem;
  background: #111;
  border-radius: 8px;
  box-sizing: border-box;
}

.checkers-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 2px solid transparent;
}

.checkers-cell.light {
  background: #f5deb3;
}

.checkers-cell.dark {
  background: #8b7355;
}

.checkers-cell.valid-move {
  background: #6b9f2f;
  border-color: #a8d648;
  box-shadow: inset 0 0 8px rgba(168, 214, 72, 0.4);
}

.checkers-cell.valid-capture {
  background: #9f2f2f;
  border-color: #ff6b6b;
  box-shadow: inset 0 0 8px rgba(255, 107, 107, 0.4);
}

/* === PEDINE === */
.checkers-piece {
  width: 85%;
  height: 85%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.checkers-piece.black {
  background: radial-gradient(circle at 30% 30%, #333, #000);
  border: 2px solid #222;
}

.checkers-piece.white {
  background: radial-gradient(circle at 30% 30%, #fff, #e0e0e0);
  border: 2px solid #999;
  color: #000;
}

.checkers-piece.selected {
  box-shadow: 0 0 12px rgba(0, 150, 255, 0.8), inset 0 0 8px rgba(0, 150, 255, 0.4);
  transform: scale(1.05);
}

.checkers-piece:hover {
  transform: scale(1.08);
  cursor: grab;
}

.checkers-piece:active {
  cursor: grabbing;
}

.king-symbol {
  font-size: 1.2rem;
  font-weight: bold;
}

.checkers-piece.black .king-symbol {
  color: #ffd700;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.checkers-piece.white .king-symbol {
  color: #ffa500;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

/* === FOOTER === */
.gotchi-checkers-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 1rem;
  padding: 1rem;
  background: #2a2a2a;
  border-radius: 8px;
  box-sizing: border-box;
}

.timer-wrapper.checkers {
  flex-grow: 1;
  text-align: center;
}

.gotchi-checkers-timer {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  font-family: 'Courier New', monospace;
}

.gotchi-checkers-forfeit-btn {
  background: #ff4d4d;
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.gotchi-checkers-forfeit-btn:hover {
  background: #ff3333;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

/* === POPUP CONFERMA MOSSA === */
.gotchi-checkers-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1312;
}

.gotchi-checkers-confirm-overlay.gotchi-hidden {
  display: none;
}

.gotchi-checkers-confirm-popup {
  background: #1e1e1e;
  color: #fff;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  z-index: 1313;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.gotchi-checkers-confirm-popup p {
  margin: 0 0 1.5rem 0;
  font-size: 1.1rem;
}

.gotchi-btn-confirm {
  background: #28a745;
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  margin-right: 1rem;
}

.gotchi-btn-confirm:hover {
  background: #20c997;
}

.gotchi-btn-cancel {
  background: #ff4d4d;
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.gotchi-btn-cancel:hover {
  background: #ff3333;
}

/* === UTILITY === */
.gotchi-hidden {
  display: none;
}

.checkers-board-flipped { transform: rotate(180deg); }
.checkers-board-flipped .checkers-piece { transform: rotate(180deg); }
.checkers-board-flipped .checkers-piece.selected { transform: rotate(180deg) scale(1.05); }
.checkers-board-flipped .checkers-piece:hover { transform: rotate(180deg) scale(1.08); }