:root {
  --orange: #ff7a1a;
  --navy: #14213d;
  --navy-light: #1f2f52;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --green: #1f9d55;
  --red: #d33;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

header.top {
  background: var(--navy);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

header.top .brand {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

header.top .brand .ball { color: var(--orange); }

header.top nav a {
  color: #dbe1f0;
  text-decoration: none;
  margin-left: 16px;
  font-size: 0.95rem;
}
header.top nav a:hover { color: #fff; }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

h1 { font-size: 1.5rem; margin: 8px 0 20px; }
h2 { font-size: 1.15rem; margin: 24px 0 10px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 14px;
}

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

.player-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  background: var(--card);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.1s ease;
}
.player-tile:hover { transform: translateY(-2px); }

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.player-tile .name { font-weight: 600; text-align: center; font-size: 0.95rem; }
.player-tile .sub { color: var(--muted); font-size: 0.8rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eee; font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #eee; }
.rank-num { width: 26px; font-weight: 800; color: var(--navy); }
.rank-num.top1 { color: var(--orange); }
.rank-name { flex: 1; font-weight: 600; }
.rank-bar-wrap { flex: 2; background: #eee; border-radius: 8px; height: 10px; overflow: hidden; }
.rank-bar { height: 100%; background: var(--orange); }
.rank-total { width: 70px; text-align: right; font-weight: 700; color: var(--navy); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--orange);
  color: #fff;
}

.note-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee; }
.note-row:last-child { border-bottom: none; }
.note-meta .date { color: var(--muted); font-size: 0.82rem; }
.note-value { font-size: 1.2rem; font-weight: 800; color: var(--navy); }
.note-comment { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.empty { color: var(--muted); text-align: center; padding: 30px 0; }

form.admin-form { display: flex; flex-direction: column; gap: 12px; }
form.admin-form label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
form.admin-form input, form.admin-form textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.btn {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn:hover { opacity: 0.92; }
.btn.secondary { background: var(--navy); }

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px 10px;
  align-items: center;
}
.notes-grid .pname { font-weight: 600; }
.notes-grid input { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 8px; text-align: center; }

.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 0.9rem; }
.msg.ok { background: #e7f7ee; color: var(--green); }
.msg.err { background: #fdecec; color: var(--red); }

.back-link { display: inline-block; margin-bottom: 12px; color: var(--navy); text-decoration: none; font-weight: 600; font-size: 0.9rem; }

.checklist-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.checklist-table th, .checklist-table td { border: 1px solid #eee; padding: 6px 8px; }
.checklist-table thead th { background: var(--navy); color: #fff; font-weight: 600; cursor: help; }
.checklist-table tbody tr:nth-child(even) { background: #fafafa; }
.checklist-table input[type="checkbox"] { width: 18px; height: 18px; }

.criteres-table { width: 100%; border-collapse: collapse; }
.criteres-table td { padding: 10px 8px; border-bottom: 1px solid #f0f0f0; font-size: 0.95rem; }
.criteres-table tr:last-child td { border-bottom: none; }
.criteres-table .crit-result { width: 34px; text-align: center; font-size: 1.15rem; font-weight: 800; }
.criteres-table .crit-ok { color: var(--green); font-weight: 600; }
.criteres-table .crit-ok + .crit-result, tr:has(.crit-ok) .crit-result { color: var(--green); }
.criteres-table .crit-fail { color: var(--red); font-weight: 600; }
.criteres-table tr:has(.crit-fail) .crit-result { color: var(--red); }
.criteres-table tr:has(.crit-ok) .crit-result { color: var(--green); }
