:root {
  --bg: #ffffff;
  --surface: #f8f8f9;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --accent: #c4121e;
  --accent-hover: #9e0e18;
  --border: #e8e8ea;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  z-index: 1000;
}

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--accent);
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-label {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  position: relative;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-label span::before {
  top: -6px;
}

.nav-toggle-label span::after {
  top: 6px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover {
  color: var(--accent);
  background: rgba(196, 18, 30, 0.06);
}

@media (max-width: 767px) {
  .nav-toggle-label {
    display: flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0 0;
  }

  .site-nav a {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }
}

.main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  width: 100%;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
  font-weight: 700;
}

h2 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.75rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.flash-ok {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.flash-err {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ef9a9a;
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.money {
  font-weight: 700;
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-danger:hover {
  background: rgba(196, 18, 30, 0.08);
}

.btn-small {
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
  max-width: 420px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  max-width: 420px;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.help {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.player-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-card .overall {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.player-card .name {
  font-weight: 700;
  font-size: 1.05rem;
}

.player-card .team {
  font-size: 0.875rem;
  color: var(--muted);
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface);
  font-weight: 600;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.inline-form {
  display: inline;
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface);
}
