@font-face {
  font-family: "RubikLocal";
  src: url("../fonts/rubik-regular-universal.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg-1: #0f1216;
  --bg-2: #1a2027;
  --ink: #e9eef4;
  --muted: #a8b4c2;
  --steel: #7f8d9b;
  --line: #2e3944;
  --card: rgba(20, 27, 35, 0.88);
  --card-strong: rgba(14, 19, 26, 0.94);
  --accent: #ff9f1a;
  --accent-2: #e37000;
  --primary: #00a9e6;
  --primary-2: #0078b6;
  --ok: #7dc67d;
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "RubikLocal", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.7;
  background:
    radial-gradient(900px 460px at 108% -12%, rgba(0, 169, 230, 0.18), transparent 66%),
    radial-gradient(760px 420px at -16% 8%, rgba(255, 159, 26, 0.18), transparent 62%),
    linear-gradient(165deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
}

a {
  color: inherit;
}

.hero {
  padding: 2.7rem 1rem 1.8rem;
}

.hero__inner {
  max-width: 1160px;
  margin: 0 auto;
}

.hero-brand {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid rgba(57, 123, 156, 0.36);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-logo {
  width: 100%;
  max-width: 170px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-brand__text h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2.45rem);
  line-height: 1.28;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.79rem;
}

.hero__subtitle {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.8vw, 1.08rem);
}

.hero__stats {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.hero__stats div {
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(57, 123, 156, 0.36);
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero__stats strong {
  display: block;
  font-size: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero__stats span {
  color: var(--muted);
  font-size: 0.86rem;
}

.container {
  max-width: 1160px;
  margin: 0 auto 2.4rem;
  padding: 0 1rem;
}

.panel {
  border-radius: 16px;
  background: var(--card);
  border: 1px solid rgba(57, 123, 156, 0.36);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.filter-panel {
  padding: 1rem;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.filters label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.89rem;
}

.filters input,
.filters select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.72rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: rgba(9, 14, 20, 0.95);
  outline: 0;
}

.filters input:focus,
.filters select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 169, 230, 0.18);
}

.filters input,
.filters select,
.panel,
.hero-brand,
.hero__stats div,
.card,
.btn-secondary,
.pagination a,
.empty,
.detail-logo {
  animation: border-mellow 28s ease-in-out infinite;
}

.filter-hidden {
  display: none !important;
}

#error-code-group.is-visible {
  display: grid !important;
}

.actions {
  display: flex;
  gap: 0.55rem;
}

button,
.btn-secondary {
  border: 0;
  border-radius: 11px;
  padding: 0.74rem 1rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

button {
  color: #111;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px rgba(227, 112, 0, 0.35);
  font-weight: 700;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

button:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

.list-panel {
  margin-top: 1rem;
  padding: 1rem;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.list-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.list-head p {
  margin: 0;
  color: var(--muted);
}

.list-live-zone {
  position: relative;
  min-height: 220px;
}

.list-live-zone.is-loading .cards,
.list-live-zone.is-loading .empty {
  opacity: 0.24;
  pointer-events: none;
  filter: blur(0.3px);
}

.cards {
  display: grid;
  gap: 0.78rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  transition: opacity 180ms ease;
}

.card {
  border: 1px solid rgba(57, 123, 156, 0.36);
  border-radius: 14px;
  background: var(--card-strong);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

.card.in-view {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.card h3 {
  margin: 0;
  font-size: 1.07rem;
  line-height: 1.42;
}

.card h3 a {
  text-decoration: none;
  color: var(--primary);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.72rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.card p {
  margin: 0;
  color: #d8e2ec;
  font-size: 0.94rem;
}

.card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
}

.card-foot a {
  color: var(--ok);
  font-size: 0.89rem;
  text-decoration: none;
}

.card-foot time {
  font-size: 0.82rem;
  color: var(--steel);
}

.empty {
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  padding: 1.3rem;
  text-align: center;
  background: rgba(9, 14, 20, 0.74);
  transition: opacity 180ms ease;
}

.empty h3 {
  margin: 0;
}

.empty p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.list-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.65rem;
  border-radius: 14px;
  background: rgba(2, 7, 12, 0.74);
  backdrop-filter: blur(3px);
  color: #fff;
}

.list-loader[hidden] {
  display: none !important;
}

.mini-loader {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.9s linear infinite;
}

.pagination {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pagination a {
  text-decoration: none;
  min-width: 2.25rem;
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  text-align: center;
}

.pagination a.active {
  color: #111;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  animation: none;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.89rem;
  padding: 0 1rem 2rem;
}

.detail-container {
  padding-top: 1.2rem;
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.detail-logo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(57, 123, 156, 0.36);
}

.back-link {
  display: inline-block;
  text-decoration: none;
  color: var(--primary);
}

.detail-panel {
  padding: 1.08rem;
}

.detail-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
}

.detail-meta {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-body,
.detail-raw p {
  white-space: pre-line;
  font-size: 1rem;
  line-height: 1.9;
}

.detail-body {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
}

.detail-raw {
  margin-top: 1.35rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.detail-raw h2 {
  margin: 0 0 0.55rem;
  color: var(--primary);
  font-size: 1rem;
}

.detail-raw p {
  color: #d0d9e2;
  font-size: 0.93rem;
}

.detail-nav {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

#screen-loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  gap: 1rem;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 18% 8%, rgba(0, 169, 230, 0.42), transparent 55%),
    radial-gradient(circle at 82% 90%, rgba(255, 159, 26, 0.38), transparent 48%),
    #070d12;
  transition: opacity 360ms ease, visibility 360ms ease;
}

.loader-orbit {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  animation: spin 0.95s linear infinite;
}

body.loaded #screen-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

@keyframes border-mellow {
  0% {
    border-color: rgba(58, 132, 168, 0.42);
  }
  14% {
    border-color: rgba(74, 106, 170, 0.4);
  }
  28% {
    border-color: rgba(70, 132, 120, 0.4);
  }
  42% {
    border-color: rgba(108, 88, 164, 0.4);
  }
  56% {
    border-color: rgba(154, 112, 78, 0.4);
  }
  70% {
    border-color: rgba(150, 86, 120, 0.38);
  }
  84% {
    border-color: rgba(112, 144, 84, 0.4);
  }
  100% {
    border-color: rgba(58, 132, 168, 0.42);
  }
}

@media (max-width: 980px) {
  .hero-brand {
    grid-template-columns: 120px 1fr;
  }

  .hero-logo {
    max-width: 120px;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .hero {
    padding-top: 2rem;
  }

  .hero-brand {
    grid-template-columns: 84px 1fr;
    gap: 0.65rem;
    align-items: center;
  }

  .hero-logo {
    max-width: 84px;
    border-radius: 12px;
  }

  .hero-brand__text h1 {
    font-size: clamp(1.15rem, 6.8vw, 1.85rem);
    margin-top: 0.2rem;
  }

  .hero__subtitle {
    font-size: 0.98rem;
    margin-top: 0.45rem;
  }

  .hero__stats {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .detail-topbar {
    align-items: flex-start;
  }

  .detail-nav {
    flex-direction: column;
  }
}