:root {
  --felt: #16342b;
  --felt-dark: #0f241d;
  --felt-darker: #0a1712;
  --chalk: #ede6d6;
  --chalk-dim: #b9c2ba;
  --gold: #d9a441;
  --p1: #c1443d;
  --p2: #3d7ec1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 16px 60px;
  max-width: 700px;
  margin: 0 auto;
  background: var(--felt);
  color: var(--chalk);
  font-family: system-ui, -apple-system, sans-serif;
}

h1 {
  text-align: center;
  font-size: 1.7rem;
  margin-bottom: 24px;
}

h2 {
  font-size: 1.1rem;
  color: var(--chalk-dim);
  margin: 28px 0 12px;
}

/* ---------- FORM ---------- */

form {
  background: var(--felt-dark);
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.field-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.player-label {
  font-weight: 600;
  color: var(--chalk);
  text-align: right;
}

input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(237, 230, 214, 0.2);
  background: var(--felt-darker);
  color: var(--chalk);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus {
  border-color: var(--gold);
}

button[type="submit"] {
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  border-radius: 10px;
  border: none;
  background: var(--gold);
  color: var(--felt-darker);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

button[type="submit"]:hover {
  filter: brightness(1.08);
}

button[type="submit"]:active {
  transform: scale(0.98);
}

.error {
  color: var(--p1);
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 0.9rem;
}

/* ---------- CHART ---------- */

.chart-wrap {
  background: var(--felt-dark);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ---------- HISTORY TABLE ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--felt-dark);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(237, 230, 214, 0.08);
  font-size: 0.9rem;
}

th {
  color: var(--chalk-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td {
  border-bottom: none;
}

td:last-child {
  text-align: right;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  margin-left: 8px;
}

.delete-btn:hover {
  background: rgba(193, 68, 61, 0.15);
}

.delete-btn img {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  filter: invert(1);
}

.delete-btn:hover img {
  opacity: 1;
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px 40px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .field-row {
    grid-template-columns: 70px 1fr;
  }

  th, td {
    padding: 8px 6px;
    font-size: 0.8rem;
  }

  /* Date column takes too much space on narrow screens */
  th:first-child, td:first-child {
    display: none;
  }
}