body {
  font-family: Arial, sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

#player-title {
  text-align: center;
  margin-bottom: 20px;
}

#play_area {
  max-height: 250px;
  border: 2px solid #ccc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  background: #f8f8f8;
  text-align: center;
  overflow-y: auto;
}

#round-info {
  font-weight: 700;
  margin-bottom: 16px;
  font-size: 18px;
}

.history-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.move-row {
  padding: 10px 12px;
  border-radius: 8px;
  background: white;
  border: 1px solid #ddd;
  text-align: left;
}

#out {
  margin-top: 20px;
  margin-bottom: 20px;
  display: grid;
  gap: 14px;
}

.hand {
  padding: 12px;
  border: 2px solid #ccc;
  border-radius: 10px;
  background: #f8f8f8;
}

.hand-title {
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 60px;
  border: 1px solid #bbb;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  font-size: 18px;
  user-select: none;
  cursor: pointer;
}

.card:hover {
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.6);
}

.card.red {
  color: #c00;
}

.card.selected {
  outline: 3px solid #2b7cff;
  transform: translateY(-2px);
}

#knappar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #2b7cff;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

#history-tab {
  margin-bottom: 25px;
  text-align: center;
}

.session-history-panel {
  margin-top: 15px;
  padding: 18px;
  border: 2px solid #ccc;
  border-radius: 12px;
  background: #f8f8f8;
  text-align: left;
}

#session-history-content {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 8px;
}

.session-history-panel.hidden {
  display: none;
}

.round-history-card {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: white;
}

.round-history-title {
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.round-score-header,
.round-score-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 100px;
  gap: 10px;
  padding: 8px 10px;
  align-items: center;
}

.round-score-header {
  font-weight: 700;
  border-bottom: 2px solid #ccc;
  margin-bottom: 6px;
}

.round-score-row {
  border-radius: 8px;
  border: 1px solid #eee;
  background: white;
}

.round-score-row.winner {
  background: #dff5df;
  font-weight: 700;
  border: 1px solid #7ac77a;
}

.score-positive {
  color: green;
  font-weight: 700;
}

.score-negative {
  color: #c00;
  font-weight: 700;
}

#player-status-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 220px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 999;
}

.player-status-title {
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
  font-size: 18px;
}

.player-status-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #f5f5f5;
}

.player-status-row.one-card {
  background: #ffdddd;
  color: #c00;
  font-weight: 700;
}

.player-status-row.current-turn {
  background: #dff5df;
  border: 2px solid #4caf50;
  font-weight: 700;
}

body.your-turn {
  background: #e8f9e8;
  transition: background 0.3s ease;
}

#past-sessions-tab {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 999;
}

.past-sessions-panel {
  margin-top: 10px;
  width: 280px;
  max-height: 500px;
  overflow-y: auto;
  background: white;
  border: 2px solid #ccc;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.past-sessions-panel.hidden {
  display: none;
}

.past-session-button {
  width: 100%;
  margin-bottom: 8px;
  background: #f5f5f5;
  color: black;
  border: 1px solid #ddd;
}

.past-session-summary-card {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #f8f8f8;
  border: 1px solid #ddd;
}

.past-session-player-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}