:root {
  --bg: #1A1816;
  --surface: #2A2724;
  --primary: #FF9F1C;
  --accent: #00FFCC;
  --text: #F0EBE3;
  --muted: #A89F94;
  --radius: 24px;
  --radius-sm: 14px;
  --font-heading: 'Courier New', 'Lucida Console', monospace;
  --font-body: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
  --shadow: 0 8px 24px rgba(0,0,0,.45);
  --glow: 0 0 18px rgba(255,159,28,.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 20% 0%, rgba(255,159,28,.06), transparent 45%),
    radial-gradient(circle at 90% 100%, rgba(0,255,204,.05), transparent 40%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26,24,22,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,159,28,.18);
}

.header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(255,159,28,.5);
}
.logo span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.nav a:hover, .nav a.active {
  color: var(--bg);
  background: var(--primary);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid rgba(255,159,28,.25);
  border-radius: 999px;
  padding: 4px 6px 4px 14px;
  min-width: 200px;
}
.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  min-width: 0;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  transition: box-shadow .2s;
}
.search-box button:hover { box-shadow: var(--glow); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 24px auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  aspect-ratio: 21 / 9;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26,24,22,.92) 0%, rgba(26,24,22,.55) 45%, transparent 80%),
              repeating-linear-gradient(0deg, rgba(0,255,204,.05) 0 1px, transparent 1px 4px);
  pointer-events: none;
}
.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 32px;
  max-width: 60%;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--text);
  text-shadow: 2px 0 rgba(255,159,28,.6), -2px 0 rgba(0,255,204,.5);
  animation: glitch 4s infinite;
}
.hero-info p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes glitch {
  0%, 92%, 100% { transform: translate(0); }
  93% { transform: translate(-2px, 1px); }
  95% { transform: translate(2px, -1px); }
  97% { transform: translate(-1px, 0); }
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ---------- Section ---------- */
.sec { margin: 40px auto; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--text);
  position: relative;
  padding-left: 16px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.sec-more {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-heading);
  transition: color .2s;
}
.sec-more:hover { color: var(--primary); }

/* ---------- Grid & Card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.04);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glow), var(--shadow);
  border-color: rgba(255,159,28,.4);
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #1f1c1a;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card-cover img { transform: scale(1.05); }

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(26,24,22,.85);
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,159,28,.5);
}

.card-info { padding: 10px 12px 14px; }
.card-title {
  font-family: var(--font-heading);
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Categories ---------- */
.cat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.cat-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.cat-item:hover {
  transform: translateY(-3px);
  border-color: rgba(0,255,204,.4);
  box-shadow: 0 0 16px rgba(0,255,204,.15);
}
.cat-item span:first-child {
  font-family: var(--font-heading);
  font-size: 15px;
}
.cat-count {
  font-size: 12px;
  color: var(--primary);
  background: rgba(255,159,28,.12);
  padding: 1px 9px;
  border-radius: 999px;
}

/* ---------- Rank ---------- */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.04);
  transition: transform .2s, border-color .2s;
}
.rank-item:hover { transform: translateX(4px); border-color: rgba(255,159,28,.4); }
.rank-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  min-width: 34px;
  text-align: center;
  color: var(--muted);
}
.rank-item:nth-child(1) .rank-num { color: #FFD700; }
.rank-item:nth-child(2) .rank-num { color: #C0C0C0; }
.rank-item:nth-child(3) .rank-num { color: #CD7F32; }
.rank-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rank-score {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--accent);
}

/* ---------- Detail ---------- */
.detail { margin: 30px auto; }
.detail-head {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: var(--shadow);
}
.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #1f1c1a;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.detail-meta { display: flex; flex-direction: column; gap: 12px; }
.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1.25;
  color: var(--text);
}
.detail-meta p { color: var(--muted); font-size: 14px; }
.detail-meta p b { color: var(--text); font-weight: 400; }
.detail-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 12px rgba(255,159,28,.5);
}
.detail-body {
  margin-top: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.05);
  line-height: 1.9;
}
.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  margin: 20px 0 10px;
  color: var(--primary);
}
.detail-body h2:first-child { margin-top: 0; }
.detail-body p { margin-bottom: 12px; color: var(--text); }

/* ---------- Tags ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12px;
  font-family: var(--font-heading);
  color: var(--accent);
  background: rgba(0,255,204,.08);
  border: 1px solid rgba(0,255,204,.25);
  padding: 3px 12px;
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.tag:hover { background: var(--accent); color: var(--bg); }

/* ---------- Pager ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 32px 0;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.06);
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--muted);
  transition: all .2s;
}
.pg:hover { color: var(--primary); border-color: rgba(255,159,28,.5); }
.pg.current {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  font-weight: 700;
}
.pg.disabled {
  opacity: .35;
  pointer-events: none;
}

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px auto;
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.05);
  transition: color .2s, border-color .2s;
}
.link-item:hover { color: var(--accent); border-color: rgba(0,255,204,.4); }

/* ---------- Crumbs ---------- */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin: 18px auto 0;
  font-family: var(--font-heading);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }

/* ---------- Highlight ---------- */
.hl {
  color: var(--bg);
  background: var(--primary);
  border-radius: 4px;
  padding: 0 3px;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 50px;
  padding: 30px 0;
  border-top: 1px solid rgba(255,159,28,.15);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-heading);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }
.footer p { margin: 6px 0; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .header .wrap {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px;
    gap: 10px;
  }
  .logo { font-size: 17px; }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .search-box { min-width: 0; flex: 1; }

  .hero {
    aspect-ratio: 4 / 3;
    margin: 16px auto;
    border-radius: var(--radius-sm);
  }
  .hero-info { max-width: 100%; padding: 18px; }
  .hero-info h2 { font-size: 20px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }

  .sec { margin: 26px auto; }
  .sec-title { font-size: 18px; }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .cat-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .detail-head {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
  .detail-cover { max-width: 200px; margin: 0 auto; }
  .detail-meta h1 { font-size: 20px; }
  .detail-body { padding: 16px; }

  .rank-item { padding: 8px 12px; gap: 10px; }
  .rank-num { font-size: 16px; min-width: 26px; }
  .rank-title { font-size: 13px; }

  .pg { min-width: 34px; height: 34px; font-size: 13px; }
}