:root {
  --bg: #090909;
  --panel: #131313;
  --panel-2: #191919;
  --text: #f5f1ed;
  --muted: #d5c9be;
  --line: rgba(255, 255, 255, 0.1);
  --red: #b91320;
  --red-2: #e52c3b;
  --pill: #26090d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(229, 44, 59, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(185, 19, 32, 0.18), transparent 22%),
    linear-gradient(180deg, #050505 0%, #0c0c0c 100%);
  color: var(--text);
}

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

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

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

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--red-2), #571013);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand strong,
.video-meta h2,
.grid-head h3 {
  font-family: "Times New Roman", Georgia, serif;
}

.brand strong {
  display: block;
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.tab,
.download-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-btn,
.ghost-btn {
  padding: 12px 18px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--red-2), var(--red));
  color: white;
  box-shadow: 0 12px 32px rgba(185, 19, 32, 0.36);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.primary-btn:hover,
.ghost-btn:hover,
.tab:hover,
.download-btn:hover {
  transform: translateY(-1px);
}

.page {
  width: min(1160px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.lookup-card,
.result-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.95), rgba(14, 14, 14, 0.95));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow,
.meta-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--pill);
  color: #ffb9bf;
  padding: 8px 12px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lookup-card,
.result-card {
  padding: 22px;
}

.result-card {
  margin-top: 20px;
}

.mode-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(229, 44, 59, 0.28), rgba(229, 44, 59, 0.12));
  color: var(--text);
  border: 1px solid rgba(229, 44, 59, 0.46);
}

.mode-btn:hover {
  transform: translateY(-1px);
}

.lookup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.lookup-row input {
  min-width: 0;
  border: 1px solid var(--line);
  background: #0e0e0e;
  color: var(--text);
  border-radius: 16px;
  padding: 16px 18px;
  outline: none;
}

.status,
.meta-row,
.picker-meta {
  color: var(--muted);
}

.status {
  margin: 14px 0 0;
  min-height: 1.4em;
}

.status.is-error {
  color: #ff9ba5;
}

.video-head {
  display: grid;
  grid-template-columns: minmax(0, 280px) 1fr;
  gap: 20px;
}

.video-head img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #111;
}

.video-meta h2 {
  margin: 12px 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.meta-row {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-row a {
  color: #ffc9ce;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.tab {
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tab.active {
  background: linear-gradient(135deg, rgba(229, 44, 59, 0.28), rgba(229, 44, 59, 0.12));
  border: 1px solid rgba(229, 44, 59, 0.46);
}

.tab-panel {
  display: none;
  margin-top: 18px;
}

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

.grid-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.grid-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.picker-card {
  display: grid;
  gap: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  padding: 16px;
}

.picker-label {
  color: var(--muted);
  font-size: 0.94rem;
}

.picker-select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0e0e0e;
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}

.picker-meta {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  font-weight: 700;
  background: #f0d7d9;
  color: #51070d;
}

.thumb-preview {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #111;
}

.footer-bar {
  display: flex;
  justify-content: center;
  padding: 0 0 26px;
}

.apk-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.apk-footer-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.apk-footer-link:hover {
  transform: translateY(-1px);
  background: rgba(229, 44, 59, 0.12);
  color: var(--text);
}

@media (max-width: 860px) {
  .topbar,
  .lookup-row,
  .video-head {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    position: static;
  }

  .topbar-actions {
    width: 100%;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 16px, 100%);
    padding-top: 16px;
  }

  .lookup-card,
  .result-card {
    padding: 16px;
    border-radius: 20px;
  }

  .mode-toggle {
    width: 100%;
  }

  .mode-btn {
    flex: 1;
  }
}
