:root {
  --bg0: #050505;
  --bg1: #0c0c0c;
  --bg2: #141414;
  --ink: #f7f5f0;
  --muted: #a8a29a;
  --gold: #c9a227;
  --gold-bright: #e8c547;
  --gold-soft: rgba(201, 162, 39, 0.16);
  --white: #ffffff;
  --danger: #e57373;
  --ok: #c9a227;
  --panel: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(201, 162, 39, 0.18), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(255, 255, 255, 0.05), transparent 45%),
    linear-gradient(165deg, var(--bg0) 0%, var(--bg1) 48%, var(--bg2) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
  animation: rise 0.7s ease both;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  color: var(--white);
}

.brand span {
  color: var(--gold-bright);
}

.lead {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.search-shell {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
  animation: rise 0.8s ease 0.08s both;
}

@media (max-width: 860px) {
  .search-shell {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 1.35rem 1.35rem 1.2rem;
}

.form-panel h2 {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.85rem;
  align-items: end;
}

@media (max-width: 640px) {
  .fields {
    grid-template-columns: 1fr;
  }
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: #0a0a0a;
  color: var(--white);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  font-size: 1.05rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input::placeholder {
  color: #6b6560;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

select option {
  background: #111;
  color: var(--white);
}

button {
  font: inherit;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, #b8901f, var(--gold-bright));
  color: #111;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.2s ease;
  min-height: 3.1rem;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.25);
}

.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 0.75rem;
  width: 100%;
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  filter: none;
}

.aside {
  padding: 1.35rem;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  background:
    linear-gradient(160deg, rgba(201, 162, 39, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}

.aside h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--white);
}

.aside p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: var(--gold-bright);
  background: rgba(201, 162, 39, 0.08);
}

.status {
  min-height: 1.5rem;
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.status.error {
  color: var(--danger);
}

.status.ok {
  color: var(--gold-bright);
}

.results {
  display: none;
  gap: 1rem;
  animation: rise 0.55s ease both;
}

.results.show {
  display: grid;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

@media (max-width: 900px) {
  .summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .summary {
    grid-template-columns: 1fr;
  }
}

.stat {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
}

.stat .k {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.stat .v {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  color: var(--white);
}

.section {
  overflow: hidden;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.12), rgba(0, 0, 0, 0.25));
}

.section-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--white);
}

.section-head .meta {
  color: var(--gold);
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: top;
}

th {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #f0ece4;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tr:hover td {
  background: rgba(201, 162, 39, 0.05);
}

tfoot td {
  font-weight: 700;
  background: rgba(201, 162, 39, 0.1);
  border-bottom: 0;
  color: var(--white);
}

.empty {
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
}

.loader {
  display: none;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
}

.loader.show {
  display: flex;
}

.spinner {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid rgba(201, 162, 39, 0.25);
  border-top-color: var(--gold-bright);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.badge-cache {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.14);
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
}

.easter-egg {
  margin-top: 0.75rem;
  text-align: center;
  animation: rise 0.45s ease both;
}

.easter-egg img {
  max-width: min(280px, 100%);
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
