/* =====================================================================
   Arcadia — styles
   Dark, quiet, fast. Solid surfaces, thin borders, one accent.
   ===================================================================== */

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

:root {
  --bg: #0A0A12;
  --bg-soft: #101019;
  --surface: #131320;
  --surface-2: #1a1a2b;
  --text: #ECECF5;
  --muted: #8a8aa3;
  --muted-2: #6b6b85;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --accent: #7C3AED;
  --highlight: #22D3EE;
  --danger: #f43f5e;
  --radius: 12px;
  --max: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
h1, h2, h3, h4 { font-family: "Syne", "Inter", sans-serif; font-weight: 700; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
img, svg { display: block; }
::selection { background: rgba(124, 58, 237, 0.35); color: #fff; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }

/* ---------- Navbar ---------- */
.nav { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent; transition: background .2s, border-color .2s; }
.nav.scrolled { background: rgba(10, 10, 18, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--border); }
.nav-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.brand-mark .icon { width: 17px; height: 17px; }
.brand-name { font-family: "Syne", sans-serif; font-weight: 700; font-size: 18px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link { padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.fav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 5px; margin-left: 5px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.fav-badge.zero { display: none; }
.fav-badge.has { background: var(--accent); color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.donate-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); transition: color .15s, border-color .15s; }
.donate-btn:hover { color: var(--text); border-color: var(--border-2); }
.menu-btn { display: none; width: 36px; height: 36px; border-radius: 8px; place-items: center; color: var(--muted); }
.menu-btn:hover { color: var(--text); }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .menu-btn { display: grid; }
  .nav-links.open { display: flex; flex-direction: column; align-items: stretch; gap: 2px; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 10px 24px 14px; }
  .nav-links.open .nav-link { padding: 11px 12px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 9px; font-size: 14px; font-weight: 600; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #8b46f0; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-2); }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 48px; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; }
.hero p.sub { margin: 16px auto 0; max-width: 520px; color: var(--muted); font-size: clamp(15px, 2vw, 17px); }
.hero-search { margin: 28px auto 0; max-width: 480px; position: relative; }
.hero-search input { width: 100%; height: 52px; border-radius: 11px; font-size: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 0 44px 0 44px; transition: border-color .15s; }
.hero-search input::placeholder { color: var(--muted-2); }
.hero-search input:focus { outline: none; border-color: var(--border-2); }
.hero-search .search-ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }

/* ---------- Section ---------- */
.section { padding: 8px 0 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 18px; }
.section-head a.more { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.section-head a.more:hover { color: var(--text); }

/* ---------- Categories ---------- */
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 9px; font-size: 13px; font-weight: 500; background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: border-color .15s; }
.cat-chip:hover { border-color: var(--border-2); }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Scroller ---------- */
.scroller { display: flex; gap: 14px; overflow-x: auto; padding: 2px 0 12px; scroll-snap-type: x mandatory; }
.scroller::-webkit-scrollbar { height: 6px; }
.scroller::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 6px; }
.scroller > * { scroll-snap-align: start; flex: 0 0 auto; width: 210px; }

/* ---------- Card ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px){ .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 880px){ .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1160px){ .grid { grid-template-columns: repeat(5, 1fr); } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent-c, var(--accent)); }
.card:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--accent-c, var(--accent)) 50%, transparent); }
.card-thumb { position: relative; height: 96px; cursor: pointer; display: grid; place-items: center; background: color-mix(in oklab, var(--accent-c, var(--accent)) 10%, var(--surface)); border-bottom: 1px solid var(--border); }
.card-glyph { font-family: "Syne", sans-serif; font-weight: 800; font-size: 26px; color: color-mix(in oklab, var(--accent-c, var(--accent)) 75%, var(--text)); }
.card-cat { position: absolute; left: 8px; top: 8px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title { font-family: "Syne", sans-serif; font-weight: 700; font-size: 14px; line-height: 1.2; }
.heart-btn { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--muted-2); transition: color .15s, background .15s; }
.heart-btn:hover { color: var(--danger); background: rgba(244,63,94,.1); }
.heart-btn.on { color: var(--danger); }
.heart-btn.on .icon { fill: var(--danger); stroke: var(--danger); }
.heart-btn .icon { width: 15px; height: 15px; }
.card-desc { font-size: 12px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; min-height: 17px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.toolbar-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.search-box { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-box input { width: 100%; height: 42px; border-radius: 10px; font-size: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 0 36px 0 38px; transition: border-color .15s; }
.search-box input:focus { outline: none; border-color: var(--border-2); }
.search-box .search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search-box .search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--muted-2); }
.search-box .search-clear:hover { color: var(--text); }
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: color .15s, border-color .15s; }
.toggle:hover { color: var(--text); }
.toggle.on { color: var(--danger); border-color: rgba(244,63,94,.4); }
.toggle.on .icon { fill: var(--danger); stroke: var(--danger); }
.toggle .icon { width: 15px; height: 15px; }
.sort-group { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.sort-btn { padding: 6px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted); transition: background .12s, color .12s; }
.sort-btn:hover { color: var(--text); }
.sort-btn.on { background: var(--surface-2); color: var(--text); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: color .12s; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; }
.result-count { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.result-count b { color: var(--text); }
.empty { text-align: center; padding: 56px 20px; border: 1px solid var(--border); border-radius: var(--radius); }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 14px; max-width: 340px; margin: 0 auto 16px; }

/* ---------- Play ---------- */
.play-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.play-top .right { display: flex; gap: 6px; }
.play-top .btn { padding: 8px 13px; font-size: 13px; }
.frame-wrap { position: relative; width: 100%; aspect-ratio: 16/10; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
.frame-wrap:fullscreen { border-radius: 0; border: none; }
.play-meta { margin-top: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.play-meta-left { min-width: 0; flex: 1; }
.play-meta h1 { font-size: clamp(22px, 3.5vw, 28px); }
.play-meta .play-desc { color: var(--muted); font-size: 14px; max-width: 620px; margin-top: 6px; }
.cat-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.cat-label .dot { width: 8px; height: 8px; border-radius: 50%; }
.play-meta-right { display: flex; align-items: center; gap: 8px; }
.stars { display: flex; align-items: center; gap: 2px; }
.star { width: 28px; height: 28px; display: grid; place-items: center; color: var(--surface-2); transition: color .12s, transform .12s; }
.star:hover { transform: scale(1.1); }
.star.on { color: #f5b840; }
.star.on .icon { fill: #f5b840; stroke: #f5b840; }
.star .icon { width: 18px; height: 18px; }
.rate-hint { margin-left: 6px; font-size: 12px; color: var(--muted); }
.related-head { margin: 36px 0 14px; font-size: 16px; }
.related-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.related-row::-webkit-scrollbar { height: 6px; }
.related-row::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 6px; }
.related-row .card { flex: 0 0 auto; width: 190px; }

/* ---------- Footer ---------- */
.footer { margin-top: auto; border-top: 1px solid var(--border); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 32px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner .muted { font-size: 13px; }
.footer-inner a { color: var(--muted); font-size: 13px; }
.footer-inner a:hover { color: var(--text); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce){ .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); padding: 9px 15px; border-radius: 9px; font-size: 13px; animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
