*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  font-family: "Roboto", "Noto Sans KR", Arial, sans-serif;
  background-color: #1a1a1a;
  color: #e0e0e0;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.game-container {
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border: 3px solid #4a3b2a;
  width: 100%;
  max-width: 800px;
}
h2 {
  text-align: center;
  color: #4caf50;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}
.controls,
.game-info,
.community-cards-area,
.pot-area,
.user-actions-area,
.log-area {
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #333;
}
.controls {
  margin-bottom: 20px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.players-area {
  background-color: transparent;
  border: none;
  padding: 0;
}
.card {
  width: 50px;
  height: 75px;
  border: 1px solid #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  font-size: 1.2em;
  font-weight: bold;
  background: #fff;
  border-radius: 4px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease-in-out;
  position: relative;
}
.card::before,
.card::after {
}
.card:hover {
  transform: translateY(-3px);
}
.card.placeholder {
  background: #555;
  color: #aaa;
}
.card.card-red {
  color: #e53935;
}
.card.card-black {
  color: #212121;
}
.player {
  padding: 8px;
  margin-bottom: 5px;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  background-color: #3a3a3a;
}
.player.active-turn {
  border-left: 5px solid #007bff;
  background-color: #4a5a7a;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}
.player-name {
  font-weight: bold;
  color: #66bb6a;
}
.player-status {
  font-style: italic;
  color: #aaa;
}
.player.player-folded {
  opacity: 0.5;
  background-color: #2a2a2a;
}
.player-bet {
  color: #29b6f6;
  font-weight: bold;
}

button {
  padding: 8px 12px;
  margin: 5px;
  border: none;
  border-radius: 6px;
  background-image: linear-gradient(to bottom, #5cb85c, #4cae4c);
  color: white;
  cursor: pointer;
  font-size: 14px;
  text-transform: uppercase;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s ease, transform 0.1s ease;
}
button:hover {
  background-color: #388e3c;
  transform: translateY(-1px);
}
button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
button:disabled {
  background-image: none;
  background-color: #444;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
input[type="number"] {
  padding: 8px;
  margin-right: 5px;
  border: 1px solid #555;
  background-color: #444;
  color: #e0e0e0;
  border-radius: 4px;
}
.controls input[type="number"] {
  padding: 8px;
  margin-right: 10px;
  border: 1px solid #555;
  background-color: #444;
  color: #e0e0e0;
  border-radius: 4px;
}
.ai-slider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 450px;
}
.ai-slider-container label {
  font-weight: bold;
  margin-right: 10px;
  color: #b0bec5;
  white-space: nowrap;
}
input[type="range"]#aiCountSlider {
  width: 100%;
  max-width: 300px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: #545454;
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.15s ease-in-out;
}
input[type="range"]#aiCountSlider:hover {
  opacity: 1;
}

input[type="range"]#aiCountSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #4caf50;
  border: 2px solid #2c2c2c;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

input[type="range"]#aiCountSlider::-moz-range-track {
  width: 100%;
  height: 8px;
  cursor: pointer;
  background: #545454;
  border-radius: 5px;
}

input[type="range"]#aiCountSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #4caf50;
  border: 2px solid #2c2c2c;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.controls > button#startGameBtn {
  padding: 10px 20px;
  min-width: 180px;
}

.log-area {
  max-height: 150px;
  overflow-y: auto;
  background-color: #222;
  border: 1px solid #444;
}
.log-area div {
  padding: 3px 0;
  border-bottom: 1px dashed #555;
}
.log-area div:last-child {
  border-bottom: none;
}
.community-cards-area,
.pot-area {
  background-image: radial-gradient(circle, #3a5a3a 0%, #2a4a2a 100%);
  border: 2px solid #5a7a5a;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}
.community-cards-area span,
.pot-area span {
  font-weight: bold;
  color: #ffeb3b;
}
#user-action-controls button#betRaiseBtn {
  background-image: linear-gradient(to bottom, #d9534f, #c9302c);
}
#user-action-controls button#betRaiseBtn:hover {
  background-image: none;
  background-color: #ac2925;
}
.user-actions-area {
  text-align: center;
}
.user-actions-area .action-group {
  margin-bottom: 10px;
}
.user-actions-area .action-group:last-child {
  margin-bottom: 0;
}
.user-actions-area button {
  min-width: 80px;
  margin: 5px;
}
.user-actions-area input[type="number"] {
  width: 100px;
  text-align: right;
}

@media (max-width: 600px) {
  body {
    padding: 10px;
    font-size: 14px;
  }
  .controls {
    gap: 10px;
    padding: 10px;
  }
  .ai-slider-container {
    flex-direction: column;
    gap: 8px;
  }
  .ai-slider-container label {
    margin-right: 0;
    margin-bottom: 5px;
  }
  .game-container {
    padding: 10px;
  }
  h2 {
    font-size: 1.5em;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .controls label {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
  }
  .controls input[type="number"] {
    width: 100%;
    margin-top: 5px;
    margin-right: 0;
  }
  .controls button {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .card {
    width: 38px;
    height: 56px;
    font-size: 10px;
    margin: 1px;
  }
  .user-actions-area button {
    padding: 10px 8px;
    font-size: 0.85em;
    margin: 3px;
  }
  .user-actions-area input[type="number"] {
    padding: 8px;
    width: 70px;
    margin: 3px;
    font-size: 0.9em;
  }
  .user-actions-area .action-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  .user-actions-area .action-group button,
  .user-actions-area .action-group input {
    flex-wrap: wrap;
    justify-content: center;
  }
  .log-area {
    max-height: 100px;
    font-size: 0.85em;
  }
  .player {
    padding: 6px;
  }
  .player-name,
  .player span {
    font-size: 0.9em;
  }
  .player-cards-container .card {
    width: 38px;
    height: 56px;
    font-size: 10px;
  }
  .controls > button#startGameBtn {
    width: 100%;
    padding: 12px;
  }
}
