:root {
  --bg: #0f1724;
  --panel: rgba(21, 34, 56, 0.94);
  --panel-strong: rgba(15, 24, 39, 0.98);
  --line: rgba(230, 195, 106, 0.24);
  --gold: #e6c36a;
  --gold-soft: #f6deb0;
  --text: #f5efe2;
  --muted: #b8c1d1;
  --danger: #e46f61;
  --ok: #7fd37f;
  --duplicate: #7db7ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  background:
    linear-gradient(rgba(9, 14, 23, 0.84), rgba(9, 14, 23, 0.95)),
    url("../textura.png") center / 420px repeat,
    var(--bg);
}

a { color: var(--gold); }

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.breadcrumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 22px;
}

.breadcrumbs a { text-decoration: none; }

.section-hero {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(22px, 4vw, 40px);
  background: linear-gradient(135deg, rgba(24, 37, 60, 0.96), rgba(14, 23, 37, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Cinzel, serif;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  letter-spacing: 0;
}

.hero-copy {
  max-width: 760px;
  margin: 12px 0 26px;
  color: var(--muted);
  line-height: 1.7;
}

.progress-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.progress-panel > div:not(.progress-track) {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.metric-value {
  display: block;
  color: var(--gold-soft);
  font-size: 2rem;
  font-weight: 800;
}

.metric-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.progress-track {
  grid-column: 1 / -1;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #71c788, var(--gold));
  transition: width 0.2s ease;
}

.archi-toolbar,
.actions-strip {
  margin-top: 18px;
  border: 1px solid rgba(70, 92, 122, 0.55);
  border-radius: 10px;
  background: var(--panel);
}

.archi-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(140px, 1fr));
  gap: 14px;
  padding: 16px;
}

.search-control,
.select-control {
  display: grid;
  gap: 7px;
  color: var(--gold-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(230, 195, 106, 0.25);
  border-radius: 8px;
  background: rgba(6, 10, 17, 0.76);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.actions-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--muted);
}

button,
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(230, 195, 106, 0.3);
  border-radius: 8px;
  background: rgba(230, 195, 106, 0.12);
  color: var(--gold-soft);
  min-height: 38px;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.import-button:hover { border-color: rgba(230, 195, 106, 0.65); }

.actions-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.export-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.export-select select {
  width: auto;
  min-width: 150px;
  min-height: 38px;
}

.archi-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.archi-card {
  display: grid;
  grid-template-columns: 86px minmax(180px, 1.3fr) repeat(2, minmax(120px, 0.7fr)) minmax(230px, 0.9fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(70, 92, 122, 0.55);
  border-radius: 10px;
  padding: 12px;
  background: var(--panel-strong);
}

.archi-card.is-owned { border-color: rgba(127, 211, 127, 0.34); }
.archi-card.is-duplicate { border-color: rgba(125, 183, 255, 0.44); }

.archi-portrait {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(230, 195, 106, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.archi-portrait img {
  max-width: 62px;
  max-height: 62px;
  object-fit: contain;
}

.archi-portrait i { color: var(--muted); font-size: 1.5rem; }

.archi-name h2 {
  margin: 0 0 6px;
  font-family: Cinzel, serif;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.archi-name a {
  color: var(--gold-soft);
  text-decoration: none;
}

.archi-name a:hover { color: var(--gold); }

.archi-note,
.cell-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.cell strong {
  display: block;
  color: var(--text);
  margin-top: 4px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.state-missing { background: rgba(228, 111, 97, 0.16); color: #ffb7ad; }
.state-owned { background: rgba(127, 211, 127, 0.14); color: var(--ok); }
.state-duplicate { background: rgba(125, 183, 255, 0.16); color: var(--duplicate); }

.tracker-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tracker-controls button {
  min-width: 40px;
  padding: 0 10px;
}

.count-box {
  min-width: 42px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-weight: 800;
}

.empty-state {
  padding: 24px;
  border: 1px solid rgba(70, 92, 122, 0.55);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
}

footer {
  padding: 28px 16px 42px;
  text-align: center;
  color: var(--muted);
  background: rgba(5, 9, 15, 0.8);
}

@media (max-width: 980px) {
  .archi-toolbar,
  .archi-card {
    grid-template-columns: 1fr 1fr;
  }

  .archi-card {
    align-items: start;
  }

  .archi-portrait {
    width: 78px;
    height: 78px;
  }

  .archi-name,
  .tracker-controls {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 22px;
  }

  .progress-panel,
  .archi-toolbar,
  .archi-card {
    grid-template-columns: 1fr;
  }

  .actions-strip,
  .tracker-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .actions-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .export-select {
    align-items: stretch;
    flex-direction: column;
  }

  .export-select select {
    width: 100%;
  }

  .tracker-controls {
    display: grid;
    grid-template-columns: 1fr 48px 48px 48px;
  }
}
