:root {
  --bg: #14161c;
  --panel: #1e2129;
  --line: #2f3340;
  --text: #e6e6e6;
  --muted: #8b90a0;
  --me: #4ea1ff;
  --enemy: #ff6b6b;
  --good: #5fd38d;
  --bad: #ff8a8a;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 960px;
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  font-size: 15px;
}

h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }

section, header { margin-bottom: 12px; }

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

select, input, button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 15px;
}

button { cursor: pointer; }
button:hover { border-color: var(--muted); }

.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.team {
  background: var(--panel);
  border-radius: 8px;
  padding: 10px;
}

#team-me h2 { color: var(--me); }
#team-enemy h2 { color: var(--enemy); }

.preban { display: flex; gap: 6px; margin-bottom: 8px; min-height: 28px; flex-wrap: wrap; }
.preban .chip { text-decoration: line-through; opacity: 0.7; }

.picks { margin: 0; padding-left: 0; list-style: none; }
.picks li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  min-height: 32px;
}
.picks li .hand { color: var(--muted); font-size: 12px; width: 44px; }
.picks li.current { outline: 1px dashed var(--muted); outline-offset: 2px; }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: #2a2e3a;
  font-size: 14px;
}
.chip.banned { text-decoration: line-through; color: var(--bad); }

.attr-fire { border-left: 3px solid #ff7043; }
.attr-ice { border-left: 3px solid #4fc3f7; }
.attr-wind { border-left: 3px solid #81c784; }
.attr-light { border-left: 3px solid #ffd54f; }
.attr-dark { border-left: 3px solid #ba68c8; }

#hero-search { width: 100%; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel); }
td.good { color: var(--good); }
td.bad { color: var(--bad); }
td.low-sample { color: var(--muted); }

.advice { overflow-x: auto; }

footer { margin-top: 24px; line-height: 1.6; }

@media (max-width: 600px) {
  body { padding: 8px; font-size: 14px; }
  .board { gap: 8px; }
  .hide-mobile { display: none; }
}

#turn-label { margin: 0 0 8px; font-weight: bold; font-size: 16px; }
#turn-label.turn-me { color: var(--me); }
#turn-label.turn-enemy { color: var(--enemy); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.filter { padding: 4px 10px; font-size: 14px; }
.filter.active { background: #3a4152; border-color: var(--text); }

#hero-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-height: 50vh;
  overflow-y: auto;
}
.hero-btn { padding: 0; border: none; background: none; }
.hero-btn .chip { padding: 6px 10px; cursor: pointer; }
.hero-btn:hover .chip { background: #3a4152; }
