:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e3e5e8;
  --ink: #1c2128;
  --muted: #6b7280;
  --accent: #111418;
  --pos: #1a7f37;
  --neg: #d1242f;
  --warn: #b35900;
  --link: #1f5fbf;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header.top {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; }
header.top .brand img { width: 26px; height: 26px; }
header.top nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.container { max-width: 1180px; margin: 0 auto; padding: 18px 20px 60px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  padding: 8px 14px; border-radius: 7px; font-size: 13px; font-weight: 500;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn.light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: #fff; color: var(--neg); border: 1px solid var(--line); }
.btn.danger:hover { background: var(--neg); color: #fff; }

/* Page title bar */
.titlebar {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.titlebar h1 { font-size: 18px; margin: 0; font-weight: 600; }
.titlebar .actions { margin-left: auto; display: flex; gap: 8px; }
.lock { color: var(--warn); }

/* Grid */
.grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 300px 360px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid, .grid-3 { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 12px; font-weight: 600; }

/* Summary rows */
.summary .row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.summary .row:last-child { border-bottom: none; }
.summary .row .k { color: var(--muted); }
.summary .row.diff .v { font-weight: 700; }

/* Cards / photos */
.photo { width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; object-fit: cover; background: #fff; }
.gamecard .title { color: var(--link); font-size: 18px; font-weight: 600; margin: 12px 0 2px; }
.gamecard .sub { color: var(--muted); }
.badge-curso { color: var(--link); margin-top: 8px; }
.badge-cerrada { color: var(--warn); margin-top: 8px; font-weight: 600; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
.pos { color: var(--pos); font-weight: 600; }
.neg { color: var(--neg); font-weight: 600; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }

/* List of partidas */
.partida-row { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.partida-row:hover { background: #fafbfc; }
.partida-row .thumb { width: 64px; height: 48px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.partida-row .meta { flex: 1; }
.partida-row .meta .name { font-weight: 600; color: var(--link); }
.partida-row .meta .count { color: var(--warn); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.partida-row .total { font-weight: 600; }

/* Forms */
label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 4px; }
input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 14px; background: #fff; color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
.field-inline { display: flex; gap: 8px; align-items: center; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.flash.ok { background: #e7f6ec; color: var(--pos); border: 1px solid #bfe6cb; }
.flash.error { background: #fde8ea; color: var(--neg); border: 1px solid #f5c2c7; }

details.player { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
details.player > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
details.player > summary::-webkit-details-marker { display: none; }
details.player[open] > summary { border-bottom: 1px solid var(--line); }
details.player .body { padding: 12px; }
.player-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.flex { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.tag { font-size: 11px; color: var(--muted); background: #f0f1f3; border-radius: 20px; padding: 2px 9px; }
