* { box-sizing: border-box; }
body {
  font: 15px/1.4 system-ui, sans-serif;
  background: #0e1014;
  color: #e7e9ee;
  margin: 0;
  padding: 24px;
}
main { max-width: 880px; margin: 0 auto; }
h1 { margin-top: 0; }
.sub { color: #9aa1ac; margin-top: -8px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: #9aa1ac; margin: 28px 0 10px; }
section { margin-bottom: 18px; }

.bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.bg-grid button {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: #1b1f27;
  cursor: pointer;
  overflow: hidden;
  color: inherit;
}
.bg-grid button.active { border-color: #6cf; }
.bg-grid img { display: block; width: 100%; height: 70px; object-fit: cover; }
.bg-grid .name { display: block; padding: 6px 8px; font-size: 12px; text-align: left; }

.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.team-pick { background: #14171d; border-radius: 10px; padding: 14px; }
.team-pick input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #2a2f3a;
  background: #0e1014;
  color: inherit;
  font: inherit;
}
.results { list-style: none; padding: 0; margin: 6px 0 0; max-height: 220px; overflow: auto; }
.results li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px; border-radius: 6px; cursor: pointer;
}
.results li:hover { background: #1b1f27; }
.results img { width: 22px; height: 22px; object-fit: contain; }
.results .meta { color: #9aa1ac; font-size: 12px; margin-left: auto; }

.picked { margin-top: 10px; display: flex; align-items: center; gap: 8px; min-height: 28px; color: #9aa1ac; }
.picked img { width: 28px; height: 28px; object-fit: contain; }

.preview-wrap {
  background: repeating-conic-gradient(#1b1f27 0% 25%, #14171d 0% 50%) 0 / 16px 16px;
  padding: 16px;
  border-radius: 10px;
  display: inline-block;
}
#preview {
  display: block;
  width: 500px;
  max-width: 100%;
  height: auto;
}
#preview:not([src]) { display: none; }

.btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 6px;
  background: #6cf;
  color: #0e1014;
  text-decoration: none;
  font-weight: 600;
}

/* landing */
.landing { max-width: 540px; padding-top: 100px; text-align: center; }
.landing h1 { font-size: 42px; margin-bottom: 28px; letter-spacing: -0.01em; }
.pick { display: flex; gap: 10px; }
.pick a {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  border-radius: 8px;
  background: #14171d;
  border: 1px solid #2a2f3a;
  color: #e7e9ee;
  text-decoration: none;
  font-size: 14px;
}
.pick a:hover { border-color: #6cf; color: #6cf; }

a.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #9aa1ac;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 10px 4px 6px;
  border-radius: 6px;
  margin-bottom: 18px;
  transition: color 0.12s, background 0.12s;
}
a.back:hover { color: #e7e9ee; background: #14171d; }
a.back svg { width: 16px; height: 16px; }

/* match list */
.match-list { list-style: none; padding: 0; margin: 0; }
.match-list li {
  background: #14171d;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s, background 0.12s;
}
.match-list li:hover { border-color: #6cf; background: #181c25; }
.match-list .row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.match-list .row.top { margin-bottom: 6px; }
.match-list .row.top img { width: 44px; height: 44px; object-fit: contain; justify-self: center; }
.match-list .vs { color: #9aa1ac; font-weight: 700; font-size: 18px; }
.match-list .names { font-weight: 600; font-size: 15px; }
.match-list .names span { display: block; }
.match-list .meta { color: #9aa1ac; font-size: 12px; margin-top: 6px; }

.muted { color: #9aa1ac; }

@media (max-width: 600px) {
  .pick { flex-direction: column; }
  .teams { grid-template-columns: 1fr !important; }
}

.chips { display: flex; gap: 6px; margin-bottom: 12px; }
.chips button {
  background: #14171d;
  border: 1px solid #2a2f3a;
  color: #9aa1ac;
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.chips button:hover { color: #e7e9ee; border-color: #3a4150; }
.chips button.active { background: #6cf; border-color: #6cf; color: #0e1014; }

.section-head { display: flex; align-items: center; justify-content: space-between; }
.link-btn {
  background: none;
  border: none;
  color: #6cf;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.link-btn:hover { background: #14171d; }

.picked-match {
  display: grid;
  grid-template-columns: 36px 1fr auto 1fr 36px;
  align-items: center;
  gap: 12px;
  background: #14171d;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.picked-match img { width: 36px; height: 36px; object-fit: contain; }
.picked-match .name { font-weight: 600; }
.picked-match .name:first-of-type { text-align: right; }
.picked-match .vs { color: #9aa1ac; font-weight: 700; }
.picked-match .meta { grid-column: 1 / -1; color: #9aa1ac; font-size: 12px; text-align: center; margin-top: 2px; }

.step {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa1ac;
  margin: 20px 0 10px;
  font-weight: 600;
}

.picked-summary {
  background: #14171d;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picked-summary .champ-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9aa1ac;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.picked-summary .champ-tag img {
  width: 18px; height: 18px; object-fit: cover; border-radius: 3px;
}
.picked-summary .match-tag {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600;
}
.picked-summary .match-tag img { width: 28px; height: 28px; object-fit: contain; }
.picked-summary .match-tag .vs { color: #9aa1ac; font-weight: 700; }
.picked-summary .when { color: #9aa1ac; font-size: 12px; }

.match-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
#match-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #2a2f3a;
  background: #0e1014;
  color: inherit;
  font: inherit;
}
#match-search:focus { outline: none; border-color: #6cf; }
.match-filters .chips { margin-bottom: 0; }

/* belt-and-suspenders: ensure [hidden] truly hides even if a layout style sets display */
[hidden] { display: none !important; }

.logout-hint { margin-top: 24px; color: #9aa1ac; font-size: 13px; }
.logout-hint a { color: #9aa1ac; }
.logout-hint a:hover { color: #e7e9ee; }
