* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  color: white;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  width: 100%;
}

h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 10px;
  width: 100%;
}

.trump-suit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trump-card {
  width: 40px;
  height: 60px;
  background: white;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #b21f1f;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.game-table {
  width: 100%;
  aspect-ratio: 16/9;
  background: rgba(34, 139, 34, 0.7);
  border-radius: 20px;
  position: relative;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 8px solid rgba(139, 69, 19, 0.5);
  overflow: hidden;
}

.player {
  position: absolute;
  width: 200px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  text-align: center;
  transition: all 0.3s;
}

.player.active {
  box-shadow: 0 0 15px #fdbb2d;
  background: rgba(0, 0, 0, 0.7);
}

.player-1 {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.player-2 {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.player-3 {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.player-4 {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.player-cards {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  gap: 5px;
  height: 80px;
}

.card {
  width: 40px;
  height: 60px;
  background: white;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  user-select: none;
}

.card.selectable:hover {
  transform: translateY(-10px);
}

.card.red {
  color: #b21f1f;
}

.card.black {
  color: #2c3e50;
}

.card-value {
  font-size: 1.2rem;
}

.card-suit {
  font-size: 0.8rem;
  position: absolute;
  bottom: 5px;
  right: 5px;
}

.center-cards {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 10px;
}

.played-card {
  width: 60px;
  height: 90px;
  background: white;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
}

.played-card.red {
  color: #b21f1f;
}

.played-card.black {
  color: #2c3e50;
}

.controls {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  background: #fdbb2d;
  color: #2c3e50;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:hover {
  background: #ffa500;
  transform: translateY(-3px);
}

button:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
}

.quit-btn {
  background: #b21f1f;
  color: white;
}

.score-board {
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 10px;
  width: 100%;
}

.score-board h2 {
  text-align: center;
  margin-bottom: 15px;
}

.scores {
  display: flex;
  justify-content: space-around;
}

.score-item {
  text-align: center;
}

.score-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.game-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 30px;
  border-radius: 10px;
  z-index: 100;
  text-align: center;
  display: none;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.modal-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

.modal-confirm {
  background: #b21f1f;
  color: white;
}

.modal-cancel {
  background: #2c3e50;
  color: white;
}

.modal-btn:hover {
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .game-table {
    aspect-ratio: 4/3;
  }

  .player {
    width: 150px;
    padding: 10px;
  }

  .card {
    width: 30px;
    height: 45px;
  }

  .played-card {
    width: 45px;
    height: 67px;
  }

  h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .player {
    width: 120px;
    font-size: 0.9rem;
  }

  .card {
    width: 20px;
    height: 30px;
    font-size: 0.7rem;
  }

  .played-card {
    width: 30px;
    height: 45px;
    font-size: 0.7rem;
  }

  .controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  button {
    padding: 8px 15px;
    font-size: 0.9rem;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 10px;
  }
}
