@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700&display=swap");

:root {
  --bg: #040421;
  --panel: #0d131d;
  --panel-2: #111827;
  --line: #223044;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --quiet: #8b95aa;
  --yellow: #ff9900;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Rubik", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  background:
    linear-gradient(180deg, rgba(4, 4, 33, 0.82), rgba(4, 4, 33, 0.96)),
    url("../assets/images/background/IMAGE.png") center top / cover no-repeat,
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.mega-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 4, 33, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  height: 34px;
}

.brand img {
  display: block;
  width: 118px;
  height: auto;
}

.mega-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 10px;
  border: 1px solid rgba(169, 177, 227, 0.25);
  border-radius: 999px;
  background: rgba(8, 10, 39, 0.75);
}

.mega-nav a {
  min-width: 76px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #d5d7e8;
  font-size: 14px;
  text-align: center;
}

.mega-nav a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  min-width: 158px;
  padding: 0 28px;
  border-radius: 999px;
  color: #040421;
  background: var(--yellow);
  font-weight: 700;
}

.mega-page {
  min-height: calc(100vh - 78px);
  padding: 64px 24px;
}

.results-shell {
  width: min(1010px, 100%);
  margin: 0 auto;
}

.results-card {
  overflow: hidden;
  border-radius: 0 0 22px 22px;
  background: rgba(13, 19, 29, 0.98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 32px;
  background: #050505;
}

.results-head h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.close-link,
.dialog-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #9fb4d4;
  background: transparent;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.close-link:hover,
.dialog-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.table-wrap {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 0 32px;
  scrollbar-color: #56516f transparent;
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar {
  width: 7px;
}

.table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #56516f;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: #e5eaf4;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: #d9dee8;
  font-size: 16px;
  font-weight: 700;
}

td {
  font-size: 16px;
  font-weight: 400;
}

th:nth-child(1),
td:nth-child(1) {
  width: 13%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 15%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 12%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 22%;
}

th:nth-child(5),
td:nth-child(5) {
  width: 15%;
}

th:nth-child(6),
td:nth-child(6) {
  width: 11%;
}

th:nth-child(7),
td:nth-child(7) {
  width: 14%;
}

.numbers {
  white-space: nowrap;
}

.state-cell {
  padding: 44px 0;
  color: var(--quiet);
  text-align: center;
}

.details-button {
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid #31435d;
  border-radius: 999px;
  color: #e5eaf4;
  background: transparent;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.details-button:hover {
  border-color: #5a79a6;
  background: rgba(255, 255, 255, 0.05);
}

.details-dialog {
  width: min(640px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  color: var(--text);
  background: transparent;
}

.details-dialog::backdrop {
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
}

.dialog-card {
  position: relative;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #0d131d;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.dialog-card h2 {
  margin: 0 48px 24px 0;
  font-size: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-label {
  display: block;
  margin-bottom: 7px;
  color: var(--quiet);
  font-size: 14px;
}

.detail-value {
  overflow-wrap: anywhere;
  color: #edf2fb;
  font-size: 16px;
}

@media (max-width: 860px) {
  .mega-header {
    gap: 18px;
    padding: 18px 20px;
    flex-wrap: wrap;
  }

  .mega-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }

  .mega-page {
    padding: 32px 16px;
  }

  .table-wrap {
    padding: 0 18px;
    overflow-x: auto;
  }

  table {
    min-width: 900px;
  }
}

@media (max-width: 560px) {
  .mega-header {
    position: relative;
  }

  .header-button {
    min-width: 130px;
    min-height: 42px;
    padding: 0 20px;
  }

  .mega-nav {
    gap: 4px;
  }

  .mega-nav a {
    min-width: auto;
    padding-inline: 11px;
  }

  .results-head {
    padding: 0 18px;
  }

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