:root {
  --bg: #07111b;
  --bg-2: #0d1723;
  --panel: #101c2a;
  --panel-2: #132335;
  --panel-3: #0b1622;
  --text: #ecf3fb;
  --muted: #9db0c6;
  --line: rgba(180, 201, 226, .14);
  --blue: #4aa4ff;
  --green: #2dd881;
  --amber: #ffbf47;
  --violet: #8f7cff;
  --shadow: 0 18px 40px rgba(0,0,0,.28);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --wrap: 1420px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top left, rgba(74,164,255,.12), transparent 28%), linear-gradient(180deg, var(--bg), #04080d 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.wrap { width: min(calc(100% - 24px), var(--wrap)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 17, 27, .88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo {
  width: 48px; height: 48px; display: block; object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.28));
  flex: 0 0 48px;
}
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 1.05rem; letter-spacing: .02em; }
.brand-text small { color: var(--muted); font-size: .84rem; margin-top: 2px; }
.header-nav a {
  color: var(--muted); padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03);
}
.main-content { padding: 20px 0 34px; }
.hero-card, .toolbar-card, .stat-card, .list-card, .cards-panel {
  background: linear-gradient(180deg, rgba(16,28,42,.94), rgba(11,22,34,.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-card {
  border-radius: 28px; padding: 28px; margin-bottom: 18px;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, 320px); gap: 18px; align-items: center;
}
.hero-copy { min-width: 0; }
.hero-coin-wrap {
  display: flex; align-items: center; justify-content: center;
}
.hero-coin {
  width: min(100%, 280px); height: auto; display: block;
  filter: drop-shadow(0 22px 34px rgba(0,0,0,.34));
}
.eyebrow { margin: 0 0 10px; color: var(--blue); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.hero-card h1 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.05; }
.lead { margin: 0; color: var(--muted); font-size: 1.03rem; line-height: 1.6; max-width: 760px; }
.toolbar-card { border-radius: var(--radius-xl); padding: 18px; margin-bottom: 18px; }
.toolbar-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 14px; }
.field label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.field input, .field select {
  width: 100%; height: 48px; border: 1px solid rgba(180, 201, 226, .16); background: rgba(255,255,255,.04); color: var(--text);
  border-radius: 14px; padding: 0 14px; font: inherit; outline: none;
}
.field input::placeholder { color: #6f849c; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { border-radius: 20px; padding: 18px; position: relative; overflow: hidden; min-height: 118px; }
.stat-card::after { content: ''; position: absolute; right: -28px; top: -28px; width: 108px; height: 108px; border-radius: 50%; opacity: .12; }
.tone-blue::after { background: var(--blue); }
.tone-green::after { background: var(--green); }
.tone-amber::after { background: var(--amber); }
.tone-violet::after { background: var(--violet); }
.stat-label { display: block; color: var(--muted); font-weight: 700; font-size: .94rem; }
.stat-value { display: block; margin-top: 10px; font-size: clamp(2rem, 3vw, 2.65rem); line-height: 1; }
.list-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.list-card { border-radius: 20px; overflow: hidden; }
.list-toggle {
  width: 100%; border: 0; background: transparent; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; font: inherit;
}
.list-toggle span:first-child { font-weight: 800; font-size: 1rem; }
.toggle-right { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; }
.chev { transition: transform .18s ease; }
.list-card.open .chev { transform: rotate(180deg); }
.list-body { display: none; padding: 0 20px 18px; }
.list-card.open .list-body { display: block; }
.list-body ul { margin: 0; padding-left: 18px; }
.list-body li { margin-bottom: 8px; line-height: 1.5; }
.list-denom { color: var(--muted); }
.cards-panel { border-radius: 24px; overflow: hidden; }
.cards-head {
  padding: 18px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cards-head h2 { margin: 0; font-size: 1.05rem; }
.cards-result { color: var(--muted); font-weight: 700; }
.cards-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 18px; }
.coin-card {
  background: linear-gradient(180deg, rgba(19,35,53,.94), rgba(11,22,34,.98));
  border: 1px solid rgba(180, 201, 226, .12);
  border-radius: 22px; overflow: hidden; min-width: 0;
  display: flex; flex-direction: column;
}
.coin-card.owned { box-shadow: inset 0 0 0 1px rgba(45,216,129,.25); }
.coin-image-wrap {
  min-height: 220px; padding: 18px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
}
.coin-image { width: 100%; max-width: 220px; height: 170px; object-fit: contain; }
.coin-body { display: flex; flex-direction: column; flex: 1; padding: 16px; }
.coin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px;
  border-radius: 999px; font-size: .78rem; font-weight: 800;
}
.pill-year { background: rgba(74,164,255,.16); color: #9ad0ff; }
.pill-denom { background: rgba(143,124,255,.14); color: #c5b8ff; }
.state-owned { background: rgba(45,216,129,.14); color: #8df2b6; }
.state-missing { background: rgba(255,191,71,.14); color: #ffd989; }
.coin-title { font-size: 1.04rem; font-weight: 800; line-height: 1.32; min-height: 54px; margin-bottom: 12px; }
.coin-meta { color: var(--muted); font-size: .93rem; line-height: 1.55; margin-bottom: 14px; }
.coin-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(180, 201, 226, .10); }
.coin-state { font-weight: 800; }
.empty-box, .empty-panel {
  border: 1px dashed rgba(180, 201, 226, .16); border-radius: 16px; color: var(--muted);
  background: rgba(255,255,255,.02); text-align: center;
}
.empty-box { padding: 16px; }
.empty-panel { grid-column: 1 / -1; padding: 34px 18px; }
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 28px; }
.footer-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .92rem; }

@media (max-width: 1199.98px) {
  .toolbar-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .toolbar-grid { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .list-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .wrap { width: min(calc(100% - 16px), var(--wrap)); }
  .header-wrap { min-height: 64px; }
  .header-nav { display: none; }
  .hero-card, .toolbar-card, .stat-card, .list-card, .cards-panel { border-radius: 18px; }
  .hero-card { padding: 20px; }
  .toolbar-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cards-grid { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .coin-image-wrap { min-height: 200px; }
  .coin-image { max-width: 210px; height: 160px; }
  .footer-wrap { flex-direction: column; align-items: flex-start; }
}


/* dark select popup hint for supported browsers */
.field select, .field option {
  background-color: rgba(255,255,255,.04);
  color: var(--text);
}

@media (max-width: 980px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .hero-coin-wrap {
    justify-content: flex-start;
  }
  .hero-coin {
    width: min(100%, 180px);
  }
}

@media (max-width: 640px) {
  .header-wrap {
    min-height: 64px;
  }
  .brand-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
  .brand-text strong {
    font-size: .98rem;
  }
  .brand-text small {
    font-size: .78rem;
  }
  .header-nav a {
    padding: 8px 12px;
    font-size: .9rem;
  }
}
/* DARK SELECT FIX */
select {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
    border: 1px solid #1f2937 !important;
}

select option {
    background-color: #0f172a;
    color: #e5e7eb;
}
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #22c55e55;
}
