:root {
  color-scheme: dark;
  --bg: #0b0d0e;
  --panel: #141719;
  --panel-soft: #191d20;
  --text: #f4f2ee;
  --muted: #aeb4b7;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #34c771;
  --accent-dark: #173b27;
  --gold: #d7b55f;
  --radius: 8px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(52, 199, 113, 0.09), rgba(52, 199, 113, 0) 250px),
    linear-gradient(180deg, #101315 0, var(--bg) 520px);
  color: var(--text);
  font-family: ui-sans-serif, "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, black, transparent 760px);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.skip-link {
  position: absolute;
  left: 16px;
  top: 8px;
  z-index: 80;
  transform: translateY(-150%);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #06100a;
  font-weight: 700;
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 60px;
  background: rgba(11, 13, 14, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  height: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 103px;
}

.brand img {
  width: 103px;
  height: auto;
}

.nav-actions,
.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-pill,
.language {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #e4e6e2;
  font-size: 14px;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}

.nav-pill[aria-current="page"] { color: var(--accent); }
.nav-pill:hover, .language:hover { color: #fff; transform: translateY(-1px); }
.nav-pill:focus-visible, .language:focus-visible, .card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.language-mark {
  width: 18px;
  height: 18px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.language-mark::before,
.language-mark::after {
  content: "";
  position: absolute;
}

.language-mark::before {
  inset: 3px 6px;
  border-left: 1.2px solid currentColor;
  border-right: 1.2px solid currentColor;
  border-radius: 50%;
}

.language-mark::after {
  left: 2px;
  right: 2px;
  top: 8px;
  border-top: 1.2px solid currentColor;
}

.page {
  max-width: 1340px;
  margin: 0 auto;
  padding: 30px 28px 52px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section {
  margin: 0 0 38px;
}

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

.title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-line {
  width: 4px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: var(--accent);
}

.section h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 820;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.section-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(134px, 13vw, 176px);
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 14px;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
  scrollbar-width: thin;
}

.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 99px; }

.card {
  min-width: 0;
}

.card-link {
  display: block;
  outline: none;
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  background: var(--panel-soft);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.27);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.card-link:hover .poster img,
.card-link:focus-visible .poster img {
  transform: scale(1.045);
  filter: saturate(1.08);
}

.poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.84));
  pointer-events: none;
}

.badge,
.score {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score {
  top: 8px;
  right: 8px;
  color: #161006;
  background: var(--gold);
}

.badge {
  left: 8px;
  bottom: 8px;
  color: #f8f8f8;
  background: rgba(0,0,0,.66);
}

.card h3 {
  margin: 10px 0 0;
  min-height: 40px;
  color: #f7f5f0;
  font-size: 15px;
  line-height: 1.33;
  font-weight: 740;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer {
  border-top: 1px solid var(--line);
  background: #090b0c;
}

.footer-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 34px 28px;
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(140px, 1fr));
  gap: 28px;
  color: var(--muted);
}

.footer-logo { width: 103px; margin-bottom: 14px; }
.footer p { margin: 0; font-size: 13px; line-height: 1.6; }
.footer h2 { margin: 0 0 12px; color: #f3f1ec; font-size: 14px; }
.footer-list { display: grid; gap: 9px; }
.footer-link { width: fit-content; color: var(--muted); font-size: 13px; }
.footer-link:hover { color: #fff; }

.notice {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.58);
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 150ms ease;
}

.notice.is-visible {
  opacity: 1;
  visibility: visible;
}

.notice-dialog {
  width: min(420px, 100%);
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: #131719;
  box-shadow: 0 28px 90px rgba(0,0,0,.52);
}

.notice-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(52,199,113,.14);
  color: var(--accent);
  font-weight: 900;
}

.notice-dialog h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.notice-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .topbar { height: 58px; }
  .topbar-inner { padding: 0 16px; }
  .nav-actions { gap: 14px; }
  .nav-menu { gap: 12px; }
  .nav-pill span,
  .language span { display: none; }
  .page { padding: 22px 16px 38px; }
  .section { margin-bottom: 34px; }
  .section h2 { font-size: 20px; }
  .section-count { display: none; }
  .rail {
    grid-auto-flow: unset;
    grid-auto-columns: unset;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    overflow: visible;
    padding: 0;
  }
  .poster { box-shadow: 0 12px 24px rgba(0,0,0,.24); }
  .card h3 { min-height: 38px; font-size: 14px; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    padding: 30px 16px;
  }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .topbar-inner { gap: 14px; }
  .brand img { width: 92px; }
  .nav-menu { gap: 10px; }
  .rail { gap: 15px 10px; }
  .footer-inner { grid-template-columns: 1fr; }
}
