*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #0f172a;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  color: #111827;
}

.brand p {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.5);
}

.user-info img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.user-info span {
  font-size: 0.85rem;
  color: #111827;
}

.badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #22c55e;
  color: #022c22;
  font-weight: 600;
  font-size: 0.75rem;
}

.hidden {
  display: none !important;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  position: relative;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.4rem 1.6rem;
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.25rem;
  color: #111827;
}

.card-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.85rem;
  color: #374151;
}

input[type="text"],
input[type="number"] {
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 0.45rem 0.7rem;
  color: #111827;
  font-size: 0.9rem;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.7);
  background: #ffffff;
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-status {
  font-size: 0.85rem;
  color: #a0a7c5;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition:
    transform 0.11s ease,
    box-shadow 0.11s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.btn.primary {
  background: #22c55e;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.4);
}

.btn.secondary {
  background: #e5e7eb;
  color: #111827;
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.4);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.table-wrapper {
  margin-top: 1rem;
  border-radius: 0.9rem;
  overflow-y: auto;
  overflow-x: visible;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.table-controls {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.75rem;
}

.sort-toggle input[type="checkbox"] {
  accent-color: #22c55e;
}

.table-controls select {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 0.3rem 0.75rem;
  background: #ffffff;
  font-size: 0.85rem;
  color: #111827;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
}

thead {
  background: #f3f4f6;
}

th,
td {
  padding: 0.45rem 0.35rem;
  text-align: right;
  font-size: 0.8rem;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 1;
}

th {
  font-weight: 600;
  color: #111827;
}

tbody tr:nth-child(odd) {
  background: #ffffff;
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

tbody tr:hover {
  background: #e5f3ff;
}

td {
  color: #111827;
}

td.muted,
.muted {
  color: #9ca3af;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.player-cell img {
  width: 28px;
  height: 28px;
  border-radius: 0.4rem;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.8);
}

.player-name {
  font-weight: 600;
}

tfoot tr {
  background: #f3f4f6;
}

tfoot th,
tfoot td {
  font-weight: 600;
  color: #111827;
}

.app-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

@media (max-width: 768px) {
  .app {
    padding: 1rem;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-controls {
    align-self: stretch;
    justify-content: space-between;
  }
}


