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

body {
  margin: 0;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  color: #222;
  line-height: 1.5;
}

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

th {
  background: #4a4a6a;
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  font-size: .85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
}

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

tr:hover td {
  background: #f0f0ff;
}

h1, h2 {
  font-weight: 600;
  color: #333;
}

h2 {
  font-size: 1.2rem;
}

a {
  color: #4a4a6a;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

nav {
  margin-bottom: 16px;
}

nav a {
  margin-right: 16px;
  font-weight: 600;
}

.main {
  display: flex;
  justify-content: center;
  gap: 40px;
}

@media (max-width: 768px) {
  .main {
    flex-direction: column;
    gap: 20px;
  }
}

.match-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  max-width: 560px;
}

.match-form select,
.match-form button {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: .9rem;
  background: #fff;
}

.match-form button {
  background: #4a4a6a;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.match-form button:hover {
  background: #5e5e8a;
}

select[name="result1"], select[name="result2"] { font-weight: bold; }
select[name="result1"].win, select[name="result2"].win { color: green; }
select[name="result1"].loss, select[name="result2"].loss { color: red; }

.flashes {
  list-style: none;
  padding: 0;
}

.flashes li {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  max-width: 560px;
}

form:not(.match-form) {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  max-width: 400px;
}

form:not(.match-form) label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

form:not(.match-form) input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: .9rem;
}

form:not(.match-form) button {
  margin-top: 10px;
  padding: 8px 18px;
  background: #4a4a6a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

form:not(.match-form) button:hover {
  background: #5e5e8a;
}

.admin-table {
  max-width: 100%;
  margin-bottom: 12px;
}

.admin-table th:first-child,
.admin-table td:first-child {
  width: 40px;
  text-align: center;
}

.delete-btn {
  padding: 8px 18px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: .9rem;
}

.delete-btn:hover {
  background: #e74c3c;
}

.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.login-container h1 {
  margin-bottom: 16px;
}

.login-container form {
  text-align: center;
}

.login-container input {
  width: 100%;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  max-width: 560px;
}

.pagination a {
  padding: 6px 14px;
  background: #4a4a6a;
  color: #fff;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
}

.pagination a:hover {
  background: #5e5e8a;
  text-decoration: none;
}

.page-info {
  font-size: .9rem;
  color: #666;
}
