:root {
  --bg: #0b1117;
  --panel: #131d26;
  --panel-2: #192632;
  --border: #243444;
  --ink: #eef4f8;
  --muted: #8ea3b5;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --gold: #f5b731;
  --cyan: #38bdf8;
  --red: #ef4444;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: radial-gradient(circle at 50% -10%, #132c28 0%, var(--bg) 52%);
  color: var(--ink);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 17, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.badge-90 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald), #047857);
  color: #04130d;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.5px;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}
.brand-text { display: flex; flex-direction: column; text-align: left; line-height: 1.1; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 11px; color: var(--gold); font-weight: 700; }

.nav { display: flex; gap: 6px; overflow-x: auto; }
.nav button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.nav button.active {
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.4);
}

.container { max-width: 1040px; margin: 0 auto; padding: 18px 14px 48px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h2, .card h3 { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { border-color: var(--emerald); }
.btn.primary {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  color: #04130d;
  border-color: transparent;
}
.btn.gold {
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #1c1002;
  border-color: transparent;
}
.btn.danger { background: rgba(239, 68, 68, 0.14); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.chip.active { background: rgba(16, 185, 129, 0.18); border-color: var(--emerald); color: var(--emerald); font-weight: 700; }
.chip.gold { border-color: rgba(245, 183, 49, 0.5); color: var(--gold); }

input, select {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 5px; }

.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px; margin: 10px 0; }
.kpi { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; }
.kpi small { display: block; color: var(--muted); font-size: 11px; }
.kpi strong { font-size: 18px; }
.kpi strong.gold { color: var(--gold); }
.kpi strong.emerald { color: var(--emerald); }
.kpi strong.cyan { color: var(--cyan); }

.radar-wrap { display: flex; align-items: center; justify-content: center; }
.radar-wrap svg { width: 100%; max-width: 270px; height: auto; }

.log-list { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow-y: auto; font-size: 13px; }
.log-list li { padding: 6px 0; border-bottom: 1px solid rgba(36, 52, 68, 0.6); }

/* 11인 풀 피치 */
.pitch {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border-radius: 16px;
  background:
    repeating-linear-gradient(180deg, #0d3b26 0, #0d3b26 36px, #0b3321 36px, #0b3321 72px);
  border: 2px solid rgba(255, 255, 255, 0.28);
  overflow: hidden;
}
.pitch::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.22);
}
.pitch::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 84px; height: 84px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}
.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 72px;
  padding: 5px 4px;
  border-radius: 10px;
  background: rgba(11, 17, 23, 0.88);
  border: 1.5px solid var(--border);
  text-align: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.pitch-slot.filled { border-color: var(--emerald); }
.pitch-slot.selected { border-color: var(--gold); box-shadow: 0 0 12px rgba(245, 183, 49, 0.55); transform: translate(-50%, -50%) scale(1.06); }
.pitch-slot .role { font-size: 10px; color: var(--gold); font-weight: 800; }
.pitch-slot .ovr { font-size: 15px; font-weight: 900; color: var(--emerald); line-height: 1.1; }
.pitch-slot .pname { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: center; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td.left, th.left { text-align: left; }
tr.promo td:first-child { color: var(--emerald); font-weight: 800; }
tr.releg td:first-child { color: var(--red); font-weight: 800; }
tr.mine { background: rgba(16, 185, 129, 0.12); }

.footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 14px 28px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--emerald);
  color: #04130d;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.hidden { display: none !important; }
