:root {
  --bg: #f7f7f7;
  --fg: #1f1f1f;
  --card: #ffffff;
  --line: #dfdfdf;
  --muted: #6b6b6b;
  --accent: #236b39;
  --accent-hover: #1a532c;
  --ok-bg: #e7f8ec;
  --ok-line: #9ad3ac;
  --err-bg: #fdeaea;
  --err-line: #f3b4b4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: #145ea8; }

.top-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 84px;
  padding: 16px 12px;
  color: #fff;
  text-decoration: none;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(90deg, #c62828 0%, #e65100 52%, #f9a825 100%);
}

.top-banner-main { font-size: 1.3rem; letter-spacing: 0.04em; }
.top-banner-sub { font-size: 0.95rem; font-weight: 600; }

.site-header { border-bottom: 1px solid var(--line); background: #fff; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.hero { padding: 20px 16px 14px; }
.hero h1 { margin: 0.2em 0; font-size: 2rem; }
.tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bf4300;
  font-size: 0.8rem;
  font-weight: 700;
}
.subtitle { margin: 0.35em 0 0; color: var(--muted); }

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 11px;
  padding-bottom: 12px;
  border-top: 1px solid #eee;
}
.nav a {
  text-decoration: none;
  color: #1f1f1f;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.nav a:hover { border-color: #c9c9c9; }
.nav .spacer { flex: 1; }
.nav-user { color: var(--muted); }
.inline-form { margin: 0; }

button, input, textarea { font: inherit; }

button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  padding: 8px 13px;
  font-weight: 700;
}
button:hover { background: var(--accent-hover); }

main.container { padding-top: 16px; }

.alerts { margin-bottom: 10px; }
.alert {
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.alert.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); }
.alert.error { background: var(--err-bg); border: 1px solid var(--err-line); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.muted { color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid #ececec;
  padding: 8px 7px;
  text-align: left;
}
th { color: var(--muted); font-size: 0.9rem; }

.match-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #fff;
}
.match-item:hover { border-color: #cdcdcd; }
.match-title { margin: 0; font-weight: 700; }
.right { text-align: right; white-space: nowrap; }

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form input,
.form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--fg);
}
.auth { max-width: 520px; margin: 0 auto 12px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.mini-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  background: #fff;
}
.mini-stat b { display: block; font-size: 1.3rem; }
.mini-stat span { color: var(--muted); font-size: 0.9rem; }

.site-footer {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding: 16px;
  text-align: center;
  color: var(--muted);
  background: #fff;
}

@media (max-width: 760px) {
  .hero h1 { font-size: 1.6rem; }
  .nav a { padding: 6px 8px; }
}
