:root {
  --bg-1: #171717;
  --bg-2: #232323;
  --panel: rgba(34, 34, 34, 0.9);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f5f5f5;
  --muted: #c7c7c7;
  --accent: #72ff00;
  --accent-soft: rgba(114, 255, 0, 0.18);
  --warn: #f5f5f5;
  --nuke: #72ff00;
  --delpre: #d9d9d9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(114, 255, 0, 0.2) 0%, transparent 34%),
    radial-gradient(circle at 82% 4%, rgba(114, 255, 0, 0.07) 0%, transparent 26%),
    linear-gradient(130deg, var(--bg-1), var(--bg-2));
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-link:hover strong,
.brand-link:focus-visible strong {
  color: var(--accent);
}

.brand small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-dot {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(114, 255, 0, 0.75);
  animation: logoPulse 1.8s ease-in-out infinite;
}

.brand-dot::before,
.brand-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(114, 255, 0, 0.45);
  animation: logoRing 2.4s ease-out infinite;
}

.brand-dot::after {
  inset: -11px;
  border-color: rgba(114, 255, 0, 0.25);
  animation-delay: 0.5s;
}

@keyframes logoPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 10px rgba(114, 255, 0, 0.55),
      0 0 20px rgba(114, 255, 0, 0.35);
  }

  50% {
    transform: scale(1.28);
    box-shadow:
      0 0 18px rgba(114, 255, 0, 0.9),
      0 0 34px rgba(114, 255, 0, 0.55);
  }
}

@keyframes logoRing {
  0% {
    transform: scale(0.72);
    opacity: 0.75;
  }

  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: statusPulse 1.4s ease-out infinite;
}

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

.status.warn {
  color: #ff4a4a;
}

@keyframes statusPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 currentColor;
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px transparent;
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 transparent;
  }
}

.layout {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 18px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

h1,
h2 {
  margin-bottom: 14px;
}

.search-title {
  font-size: 18px;
  margin-bottom: 10px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
  flex: 1;
  min-width: 320px;
}

.search-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 14, 14, 0.85);
  color: var(--text);
  padding: 10px 12px;
  font-family: "JetBrains Mono", monospace;
}

.search-form button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #0b0b0b;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.hint {
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  max-height: 78vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.09em;
}

.release-link {
  color: var(--text);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.group-link {
  color: var(--muted);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
}

.section-link {
  text-decoration: none;
}

.release-link:hover {
  color: var(--accent);
}

.group-link:hover {
  color: var(--accent);
}

.section-link:hover .pill.section {
  background: rgba(114, 255, 0, 0.28);
  border-color: rgba(114, 255, 0, 0.52);
}

.pill {
  position: relative;
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  margin-right: 4px;
}

.pill[data-tooltip] {
  cursor: help;
}

.pill[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  min-width: 180px;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.96);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
  text-transform: none;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 4;
}

.pill[data-tooltip]:hover::after,
.pill[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.pill.nuke {
  background: rgba(114, 255, 0, 0.22);
  color: var(--nuke);
}

.pill.delpre {
  background: rgba(255, 255, 255, 0.18);
  color: var(--delpre);
}

.pill.section {
  background: rgba(114, 255, 0, 0.18);
  color: var(--accent);
  border: 1px solid rgba(114, 255, 0, 0.36);
}

.pill.meta-flag {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: "JetBrains Mono", monospace;
}

.pill-link {
  text-decoration: none;
}

.pill-link:hover {
  border-color: rgba(114, 255, 0, 0.52);
  background: rgba(114, 255, 0, 0.2);
  color: var(--accent);
}

.release-row.is-active td {
  background: rgba(114, 255, 0, 0.08);
}

.detail-inline-row td {
  border-bottom: 1px solid var(--line);
}

.detail-inline-cell {
  padding: 0;
  background: rgba(8, 8, 8, 0.68);
}

.inline-detail-panel {
  padding: 14px;
  border-top: 1px dashed rgba(114, 255, 0, 0.35);
}

.inline-detail-panel h2 {
  font-size: 16px;
  margin-bottom: 10px;
}

.release-head h3 {
  font-size: 18px;
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 8px;
}

.meta-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  margin-bottom: 14px;
}

.meta-line span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tab-btn.disabled,
.tab-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tab-content {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.72);
  padding: 12px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.meta-filename {
  margin: 6px 0 10px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.meta-viewer {
  margin: 8px 0;
  max-height: 42vh;
  overflow: auto;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 4;
  line-height: 1.2;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-family: "JetBrains Mono", monospace;
  background: rgba(0, 0, 0, 0.58);
}

.extra-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.extra-meta-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.52);
  padding: 12px;
}

.extra-meta-card h4 {
  margin-bottom: 10px;
}

.info-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.info-list div {
  display: grid;
  gap: 4px;
}

.info-list dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-list dd {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  word-break: break-word;
}

.url-value {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  word-break: break-word;
}

.url-value a {
  color: var(--accent);
  text-decoration: none;
}

.url-value a:hover {
  text-decoration: underline;
}

.nfo-viewer {
  font-family: "VT323", "JetBrains Mono", monospace;
  font-size: 22px;
  line-height: 0.88;
  letter-spacing: 0;
  text-rendering: optimizeSpeed;
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  .layout,
  .panel,
  .search-panel,
  .table-wrap,
  .detail-inline-cell,
  .inline-detail-panel,
  .tab-content,
  .tab-panel {
    width: 100%;
    max-width: 100%;
  }

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

  table {
    table-layout: fixed;
  }

  th,
  td {
    padding: 8px 6px;
  }

  th:nth-child(3),
  th:nth-child(4),
  td:nth-child(3),
  td:nth-child(4) {
    display: none;
  }

  th:nth-child(1) {
    width: 84px;
  }

  th:nth-child(5) {
    width: 140px;
  }

  td:nth-child(5) .pill {
    margin-bottom: 4px;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1 1 auto;
    min-width: 72px;
  }

  .meta-viewer,
  .nfo-viewer {
    width: 100%;
    max-width: 100%;
    max-height: 52vh;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .nfo-viewer {
    font-size: 17px;
    line-height: 0.95;
  }

  .info-list dd,
  .url-value {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

pre {
  margin: 8px 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-family: "JetBrains Mono", monospace;
  background: rgba(0, 0, 0, 0.42);
}

.hash,
.empty,
.empty-detail {
  color: var(--muted);
}

.footerbar {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin: 0 18px 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20, 20, 20, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-left strong {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
}

.footer-left span {
  color: var(--muted);
  font-size: 13px;
}

.footer-right {
  display: flex;
  gap: 8px;
}

.footer-right span {
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 8px;
}

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

  .table-wrap {
    max-height: 42vh;
  }

  .search-form {
    min-width: 0;
  }

  .hint {
    white-space: normal;
  }

  .footerbar {
    margin: 0 14px 14px;
    flex-direction: column;
    align-items: flex-start;
  }
}
