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

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(135deg, #2d5a27 0%, #1a4d15 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 30px;
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.game-area {
  max-width: 1200px;
  width: 100%;
}

h1 {
  color: #2d5a27;
  font-size: 2.5em;
  margin-bottom: 10px;
}

h2 {
  color: #666;
  font-size: 1.5em;
  margin-bottom: 20px;
}

.subtitle {
  color: #666;
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input:focus {
  outline: none;
  border-color: #2d5a27;
}

.btn {
  background: #2d5a27;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin: 10px;
}

.btn:hover:not(:disabled) {
  background: #1a4d15;
  transform: translateY(-2px);
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #666;
}

.btn-secondary:hover:not(:disabled) {
  background: #555;
}

.btn-blue {
  background: #3b82f6;
}

.btn-blue:hover:not(:disabled) {
  background: #2563eb;
}

.btn-red {
  background: #ef4444;
}

.btn-red:hover:not(:disabled) {
  background: #dc2626;
}

.game-code {
  background: #f3f4f6;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #2d5a27;
  position: relative;
}

.copy-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 2px solid #2d5a27;
  color: #2d5a27;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}

.copy-btn:hover {
  background: #2d5a27;
  color: white;
}

.players-list {
  background: #f9fafb;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin: 5px 0;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #2d5a27;
}

.host-badge {
  background: #10b981;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
}

.status-indicator.disconnected {
  background: #ef4444;
}

/* ゲーム画面のスタイル */
.game-header {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dealer-area,
.players-area {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 20px;
}

.cards-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.card-item {
  width: 80px;
  height: 120px;
  background: white;
  border: 2px solid #333;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}

.card-item.red {
  color: #ef4444;
}

.card-item.hidden {
  background: #3b82f6;
  color: white;
}

.card-rank {
  font-size: 20px;
  font-weight: bold;
}

.card-suit {
  font-size: 24px;
}

.player-area {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin: 15px;
  position: relative;
}

.player-area.current {
  border: 4px solid #3b82f6;
}

.player-area.my-turn {
  border: 4px solid #10b981;
}

.players-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.score {
  font-size: 24px;
  font-weight: bold;
  margin: 15px 0;
}

.result {
  font-size: 20px;
  font-weight: bold;
  margin-top: 10px;
}

.result.win {
  color: #10b981;
}

.result.lose {
  color: #ef4444;
}

.result.draw {
  color: #f59e0b;
}

.result.bust {
  color: #ef4444;
}

.actions {
  background: white;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2d5a27;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.error-message {
  background: #fee2e2;
  color: #dc2626;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

.success-message {
  background: #dcfce7;
  color: #16a34a;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .card {
    padding: 20px;
  }

  .players-grid {
    grid-template-columns: 1fr;
  }

  .game-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .cards-container {
    gap: 5px;
  }

  .card-item {
    width: 60px;
    height: 90px;
  }
}
