* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  background: radial-gradient(circle at top, #1e1e1e, #111);
  color: #f5f5f5;
  padding: 20px;
  min-height: 100vh;
}

.back-nav {
  max-width: 1200px;
  margin: 0 auto 15px auto;
}

.back-nav a {
  color: #38bdf8;
  text-decoration: none;
  font-size: 14px;
}

.back-nav a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  padding: 20px;
  backdrop-filter: blur(8px);
}

.header {
  text-align: center;
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-weight: 700;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.leaderboard {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.leader-block {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 1.1em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leader-block:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

.button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background-color: #007bff;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.05em;
  min-width: 130px;
  min-height: 44px;
}

.button:hover:not(:disabled) {
  background-color: #3391ff;
  transform: scale(1.05);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button.save {
  background-color: #28a745;
}

.button.save:hover:not(:disabled) {
  background-color: #34c152;
}

.button.undo {
  background-color: #ffc107;
  color: #000;
}

.button.undo:hover:not(:disabled) {
  background-color: #ffd24d;
  transform: scale(1.05);
}

.button.danger {
  background-color: #dc3545;
}

.button.danger:hover:not(:disabled) {
  background-color: #ff4659;
}

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

.player-card {
  border-radius: 10px;
  padding: 15px;
  background-color: #fff;
  color: #000;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.player-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.name-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-right: 6px;
  font-weight: 500;
  font-size: 1.05em;
}

.total {
  font-weight: 700;
  font-size: 1.1em;
}

.color-select,
.score-input {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1.05em;
  min-height: 42px;
}

.bg-pink { background-color: #d55393; color: #fff; }
.bg-orange { background-color: #df6b52; color: #fff; }
.bg-green { background-color: #3d9668; color: #fff; }
.bg-yellow { background-color: #e5a039; color: #000; }
.bg-blue { background-color: #0074bf; color: #fff; }
.bg-purple { background-color: #713a95; color: #fff; }
.bg-teal { background-color: #00828f; color: #fff; }
.bg-black { background-color: #434a54; color: #fff; }

.round-history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.round-history-table th,
.round-history-table td {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  .players-grid {
    grid-template-columns: 1fr;
  }
  .player-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .button {
    width: 100%;
    font-size: 1.1em;
  }
}
