/* Component colors alias the shared tool palette; no separate page palette. */
body.tool-page {
  --bg: var(--tool-bg);
  --surface: var(--tool-surface);
  --surface-2: var(--tool-surface-2);
  --surface-3: var(--tool-surface-2);
  --text: var(--tool-text);
  --muted: var(--tool-muted);
  --gold: var(--tool-gold);
  --cream: var(--tool-gold-soft);
  --line: var(--tool-line);
}
.lineup-page a { color: inherit; text-decoration: none; }
.export-bar p,
.upload p,
.quiet {
  color: var(--muted);
  line-height: 1.7;
}
.lineup-page button,
#picker button,
.upload-label {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 4px;
}
.lineup-page button:hover,
#picker button:hover {
  border-color: var(--gold);
}
.lineup-page button.active,
.lineup-page .primary {
  color: var(--cream);
  border-color: var(--gold);
  background: rgba(234, 179, 8, .08);
  font-weight: 600;
}
.lineup-page button:disabled {
  opacity: 0.4;
  cursor: default;
}
.lineup-page label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
}
.lineup-page input,
.lineup-page select,
#picker input,
#picker select {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 12px;
  border-radius: 4px;
}
#picker select { width: auto; margin: 0 0 14px 10px; }
.lineup-page :focus-visible,
#picker :focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.panel,
.result-panel,
.lineup {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 24px;
}
.panel { border-top: 2px solid var(--gold); margin-bottom: 16px; }
.result-panel > .section-head { margin-top: 0; }
.section-head h2, .upload h2 { padding-left: 12px; border-left: 3px solid var(--gold); color: var(--cream); }
.export-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.export-control { max-width: 420px; }
#exportFeedback, .export-error { color: var(--tool-gold-soft); border-left: 3px solid var(--tool-gold); padding: 8px 12px; background: var(--tool-surface-2); font-size: 14px; }
.lineup-actions:has(.export-error:not([hidden])) { flex-wrap: wrap; }
.lineup-actions .export-error { flex-basis: 100%; order: 1; }
.settings {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
  align-items: start;
}
#name {
  margin-top: 8px;
}
.quiet {
  font-size: 13px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 28px 0 18px;
}
.lineup-page h2,
#picker h2 {
  font-size: 21px;
  margin: 0;
}
#lineups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.lineup-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.lineup-top span {
  color: var(--muted);
  font-size: 13px;
}
.slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.slots .slot {
  aspect-ratio: 1;
  padding: 0;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
  font-size: 26px;
  color: var(--muted);
}
.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slot span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  padding: 4px;
}
.lineup-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
}
.lineup-actions button {
  font-size: 13px;
}
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0;
}
.export-bar p {
  font-size: 13px;
  margin-bottom: 0;
}
.upload {
  text-align: left;
  padding: 24px;
}
.upload h2 {
  margin-top: 0;
}
.upload .upload-label {
  display: inline-block;
}
#files {
  max-width: 540px;
  margin: 0;
}
#files::file-selector-button { color: var(--cream); background: var(--surface-2); border: 1px solid var(--gold); padding: 9px 14px; margin-right: 12px; cursor: pointer; }
.merge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
#notice {
  white-space: pre-wrap;
  color: var(--cream);
  line-height: 1.8;
}
.lineup-page footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  color: var(--muted);
  font-size: 13px;
}
#picker {
  width: min(880px, 94vw);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
#picker::backdrop {
  background: rgba(10, 16, 30, 0.8);
}
#picker .section-head {
  margin-top: 0;
}
#selectedCount {
  color: var(--muted);
  margin-top: 16px;
}
#characters {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}
#characters .character {
  position: relative;
  padding: 4px;
  font-size: 12px;
}
.character img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
#characters .picked {
  outline: 2px solid var(--gold);
  background: var(--surface-3);
}
.picked::after {
  content: "✓";
  position: absolute;
  right: 4px;
  top: 4px;
  background: var(--gold);
  color: var(--bg);
  padding: 0 4px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  .settings,
  #lineups {
    grid-template-columns: 1fr;
  }
  #characters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .export-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .section-head {
    align-items: flex-start;
  }
  .main-nav {
    gap: 14px;
    font-size: 13px;
  }
}
