/* =========================================================
   PortVerse — Web Game Ports catalog
   ========================================================= */
:root {
  --bg: #07060f;
  --panel: rgba(24, 20, 48, .62);
  --panel-solid: #14112a;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --text: #eeedff;
  --muted: #a3a0cb;
  --dim: #6d6a94;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --amber: #fbbf24;
  --green: #34d399;
  --blue: #60a5fa;
  --grad: linear-gradient(120deg, var(--violet), var(--cyan) 50%, var(--pink));
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --top: 68px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.lock { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--violet); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, .35); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, .6); }

/* ---------- Ambient layers ---------- */
#bg, #fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bg { z-index: -3; }
#fx { z-index: 200; }
.aurora { position: fixed; inset: 0; z-index: -4; overflow: hidden; filter: blur(90px); opacity: .5; }
.aurora span { position: absolute; width: 46vw; height: 46vw; border-radius: 50%; animation: drift 24s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: #5b21b6; top: -18%; left: -12%; }
.aurora span:nth-child(2) { background: #0e7490; bottom: -22%; right: -12%; animation-duration: 30s; animation-delay: -8s; }
.aurora span:nth-child(3) { background: #9d174d; top: 35%; left: 38%; width: 30vw; height: 30vw; animation-duration: 36s; opacity: .7; }
@keyframes drift { to { transform: translate(9vw, 7vh) scale(1.18) rotate(35deg); } }
.noise {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: -1; width: 560px; height: 560px; margin: -280px 0 0 -280px;
  border-radius: 50%; pointer-events: none; transform: translate3d(-999px, -999px, 0);
  background: radial-gradient(circle, rgba(139, 92, 246, .16), transparent 62%);
}
.progress {
  position: fixed; top: 0; left: 0; z-index: 60; width: 100%; height: 3px; transform-origin: 0 50%;
  transform: scaleX(var(--p, 0)); background: var(--grad); box-shadow: 0 0 14px var(--cyan);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 clamp(14px, 3vw, 32px);
  border-bottom: 1px solid transparent; transition: background .35s, border-color .35s, backdrop-filter .35s;
}
.topbar.scrolled { background: rgba(9, 8, 20, .74); backdrop-filter: blur(18px) saturate(1.4); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--pixel); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.brand-icon { display: inline-block; font-size: 22px; animation: bob 3s ease-in-out infinite; }
.brand b, .grad-num { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-6deg); } }

.search { position: relative; flex: 1; max-width: 620px; margin: 0 auto; }
.search > svg { position: absolute; left: 14px; top: 50%; width: 18px; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 48px 0 44px; border-radius: 14px; outline: none;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .25s, background .25s, box-shadow .35s var(--ease);
}
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { border-color: transparent; background: rgba(20, 17, 40, .92); box-shadow: 0 0 0 2px var(--violet), 0 12px 44px -10px rgba(139, 92, 246, .7); }
.search kbd, .search-clear { position: absolute; right: 12px; top: 50%; translate: 0 -50%; }
.search-clear { width: 26px; height: 26px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .1); cursor: pointer; font-size: 12px; }
.search-clear:hover { background: rgba(244, 114, 182, .35); }
kbd {
  display: inline-block; min-width: 22px; padding: 2px 7px; border-radius: 6px; text-align: center;
  font-family: var(--font); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line-2); border-bottom-width: 2px; background: rgba(255, 255, 255, .06);
}
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; min-width: 42px; padding: 0 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05);
  transition: transform .25s var(--spring), background .2s, border-color .2s, box-shadow .3s;
}
.icon-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.active, .icon-btn[aria-pressed="true"] { background: rgba(139, 92, 246, .25); border-color: var(--violet); }
.icon-btn.accent { background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(244, 114, 182, .3)); border-color: rgba(244, 114, 182, .45); font-weight: 600; }
.icon-btn.accent:hover { box-shadow: 0 10px 30px -10px var(--pink); }
.dice { display: inline-block; }
.icon-btn:hover .dice { animation: roll .7s var(--ease); }
@keyframes roll { to { transform: rotate(360deg) scale(1.15); } }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--spring), box-shadow .3s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.big { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 15px; }
.btn.primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--violet), #6366f1 45%, #06b6d4); box-shadow: 0 14px 34px -14px var(--violet); }
.btn.primary:hover { box-shadow: 0 18px 40px -12px var(--violet); }
.btn.play { border-color: transparent; color: #03140d; background: linear-gradient(135deg, #10b981, #6ee7b7); box-shadow: 0 14px 34px -14px #34d399; }
.btn.play:hover { box-shadow: 0 18px 40px -10px #34d399; }
.btn.src { border-color: rgba(96, 165, 250, .45); background: rgba(96, 165, 250, .14); color: #dbeafe; }
.btn.on { border-color: var(--pink); background: rgba(244, 114, 182, .2); }
.btn.on-seen { border-color: var(--green); background: rgba(52, 211, 153, .16); }
.btn.shine::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  animation: sweep 3.6s var(--ease) infinite;
}
@keyframes sweep { 60%, 100% { transform: translateX(120%); } }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #1a0510; font-size: 11px; font-weight: 800; animation: pop .45s var(--spring); }
@keyframes pop { from { transform: scale(0); } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 100vh; margin-top: calc(var(--top) * -1); padding: calc(var(--top) + 40px) 0 34px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.hero-sun {
  position: absolute; left: 50%; top: 12%; width: min(560px, 78vw); aspect-ratio: 1; translate: -50% 0;
  border-radius: 50%; opacity: .3;
  background: linear-gradient(180deg, #fde68a, #f472b6 50%, #7c3aed);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 52% no-repeat, repeating-linear-gradient(180deg, #000 0 16px, transparent 16px 24px) bottom / 100% 48% no-repeat;
  mask: linear-gradient(#000 0 0) top / 100% 52% no-repeat, repeating-linear-gradient(180deg, #000 0 16px, transparent 16px 24px) bottom / 100% 48% no-repeat;
  animation: sunrise 1.8s var(--ease) both, sunpulse 7s ease-in-out 1.8s infinite;
}
@keyframes sunrise { from { opacity: 0; transform: translateY(80px) scale(.9); } }
@keyframes sunpulse { 50% { opacity: .42; transform: scale(1.03); } }
.hero-floor {
  position: absolute; left: -50%; bottom: 0; width: 200%; height: 46%;
  background-image: linear-gradient(rgba(139, 92, 246, .55) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(34, 211, 238, .4) 1.5px, transparent 1.5px);
  background-size: 64px 64px;
  transform: perspective(420px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 15%, transparent 92%);
  mask-image: linear-gradient(to top, #000 15%, transparent 92%);
  animation: floor 1.4s linear infinite;
}
@keyframes floor { to { background-position: 0 64px, 0 0; } }
.hero-inner { position: relative; z-index: 2; width: 100%; max-width: 1100px; padding: 0 20px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(14, 12, 30, .6); backdrop-filter: blur(8px); font-size: 13px; color: var(--muted);
  animation: rise .9s var(--ease) both; transition: border-color .2s;
}
.eyebrow:hover { border-color: var(--cyan); }
.eyebrow .refresh { display: inline-block; transition: transform .6s var(--ease); }
.eyebrow:hover .refresh { transform: rotate(360deg); }
.eyebrow.loading .refresh { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 currentColor; color: var(--amber); animation: ping 1.8s infinite; }
.dot.live { background: var(--green); color: var(--green); }
.dot.off { background: var(--pink); color: var(--pink); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

.title { margin: 0; line-height: .95; }
.t1 {
  display: block; min-height: 1.2em; margin-bottom: 22px;
  font-family: var(--pixel); font-size: clamp(10px, 1.4vw, 14px); letter-spacing: .32em; text-transform: uppercase;
  color: var(--cyan); text-shadow: 0 0 18px rgba(34, 211, 238, .7);
}
.t1::after { content: '▌'; margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.t2 {
  position: relative; display: inline-block;
  font-size: clamp(2.9rem, 10.5vw, 8.4rem); font-weight: 700; letter-spacing: -.045em;
  background: linear-gradient(90deg, #fff, #c4b5fd, #67e8f9, #f9a8d4, #fde68a, #fff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 34px rgba(139, 92, 246, .45));
  animation: reveal 1.3s var(--ease) .2s both, shimmer 9s linear infinite;
}
.t2::before, .t2::after {
  content: attr(data-text); position: absolute; inset: 0; background: none; -webkit-text-fill-color: currentColor; opacity: 0; pointer-events: none;
}
.t2::before { color: var(--cyan); animation: glitch 7s infinite steps(1); }
.t2::after { color: var(--pink); animation: glitch 7s infinite steps(1) reverse; animation-delay: .05s; }
@keyframes reveal { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(40px); filter: blur(12px); } }
@keyframes shimmer { to { background-position: 300% 0; } }
@keyframes glitch {
  0%, 89%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  90% { opacity: .8; transform: translate(-6px, 2px); clip-path: inset(10% 0 60% 0); }
  92% { opacity: .8; transform: translate(5px, -2px); clip-path: inset(55% 0 20% 0); }
  94% { opacity: .8; transform: translate(-3px, 1px); clip-path: inset(30% 0 40% 0); }
  96% { opacity: 0; }
}
.subtitle { max-width: 740px; margin: 24px auto 0; color: var(--muted); font-size: clamp(15px, 1.7vw, 18px); line-height: 1.6; animation: rise 1s var(--ease) .45s both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; max-width: 860px; margin: 38px auto 0; }
.counter {
  position: relative; overflow: hidden; padding: 18px 10px 16px; border-radius: 18px; cursor: pointer;
  border: 1px solid transparent;
  background: linear-gradient(rgba(20, 17, 42, .85), rgba(20, 17, 42, .85)) padding-box, linear-gradient(140deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .03)) border-box;
  backdrop-filter: blur(10px);
  transition: transform .4s var(--spring), box-shadow .35s;
  animation: rise .9s var(--ease) backwards; animation-delay: calc(.6s + var(--n, 0) * .1s);
}
.counter:nth-child(2) { --n: 1; } .counter:nth-child(3) { --n: 2; } .counter:nth-child(4) { --n: 3; }
.counter::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); box-shadow: 0 0 18px var(--c); }
.counter::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 120%, var(--c), transparent 65%); opacity: .14; transition: opacity .3s; }
.counter:hover { transform: translateY(-7px) scale(1.02); box-shadow: 0 24px 44px -20px var(--c); }
.counter:hover::after { opacity: .3; }
.counter i { display: block; font-style: normal; font-size: 18px; margin-bottom: 4px; }
.counter b { display: block; font-size: clamp(1.6rem, 3.8vw, 2.7rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.counter span { position: relative; z-index: 1; font-size: 13px; color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; animation: rise 1s var(--ease) 1s both; }
.btn.ghost.big { backdrop-filter: blur(8px); }

.marquee {
  position: relative; z-index: 2; width: 100%; margin-top: 14px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.hero .marquee:first-of-type { margin-top: 46px; }
.marquee-track { display: flex; gap: 12px; width: max-content; padding: 4px 0; animation: marquee 90s linear infinite; }
.marquee.reverse .marquee-track { animation-direction: reverse; animation-duration: 110s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.mq-item {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: rgba(16, 14, 34, .6); backdrop-filter: blur(6px); font-size: 14px; font-weight: 500;
  transition: transform .3s var(--spring), border-color .2s, background .2s;
}
.mq-item:hover { transform: translateY(-3px) scale(1.04); border-color: hsl(var(--h1) 90% 65%); background: hsl(var(--h1) 60% 25% / .5); }
.mq-item .cover { width: 34px; height: 34px; margin: 0; border-radius: 50%; aspect-ratio: auto; }
.mq-item .cover .mono { display: none; }
.mq-item .sprite-wrap svg { width: 62%; }

/* ---------- Stats ---------- */
.stats { max-width: 1480px; margin: 0 auto; padding: 30px clamp(14px, 3vw, 32px) 0; animation: rise .6s var(--ease); }
.stats-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 16px; }
.stats-head h2 { margin: 0; font-size: 26px; }
.stats-head h2 .muted { font-size: 16px; font-weight: 500; }
.stats-head p { margin: 0; }
.stats-grid { display: grid; grid-template-columns: 300px 1fr 1fr; gap: 16px; }
.panel {
  padding: 20px; border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 22, 54, .78), rgba(14, 12, 30, .78)); backdrop-filter: blur(12px);
}
.panel.wide { grid-column: 1 / -1; }
.panel h3 { margin: 0 0 16px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.donut-wrap { display: grid; justify-items: center; gap: 14px; }
.donut { width: 190px; height: 190px; transform: rotate(-90deg); overflow: visible; }
.donut circle { fill: none; stroke-width: 22; transition: stroke-dasharray 1.3s var(--ease), stroke-width .25s; cursor: pointer; }
.donut circle:hover { stroke-width: 28; }
.donut .track { stroke: rgba(255, 255, 255, .05); cursor: default; }
.donut-center { position: relative; display: grid; place-items: center; }
.donut-center > div { position: absolute; text-align: center; }
.donut-center b { display: block; font-size: 34px; letter-spacing: -.03em; }
.donut-center span { font-size: 12px; color: var(--muted); }
.legend { display: grid; gap: 6px; width: 100%; }
.legend button { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 14px; }
.legend button:hover { background: rgba(255, 255, 255, .06); }
.legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 7px; }
.bar-row {
  display: grid; grid-template-columns: minmax(110px, 38%) 1fr 42px; align-items: center; gap: 10px;
  padding: 5px 8px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 13.5px;
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 45ms);
}
.bar-row:hover { background: rgba(255, 255, 255, .06); }
.bar-row.on { background: rgba(139, 92, 246, .2); }
.bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label img { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.bar-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.bar-fill {
  display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--g, var(--grad)); transform-origin: 0 50%;
  animation: grow 1.1s var(--ease) both; animation-delay: calc(var(--i) * 45ms + .1s); box-shadow: 0 0 12px rgba(139, 92, 246, .5);
}
@keyframes grow { from { transform: scaleX(0); } }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.histogram { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 20px; }
.hcol { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 0; }
.hcol .hbar {
  width: 100%; max-width: 38px; height: var(--h); min-height: 3px; border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--cyan), var(--violet)); transform-origin: 50% 100%;
  animation: growY 1s var(--ease) both; animation-delay: calc(var(--i) * 30ms); transition: filter .2s;
}
.hcol:hover .hbar, .hcol.on .hbar { filter: brightness(1.4) drop-shadow(0 0 10px var(--cyan)); }
.hcol.on .hbar { background: linear-gradient(180deg, var(--amber), var(--pink)); }
.hcol small { font-size: 12px; font-weight: 700; color: var(--muted); }
.hcol em { position: absolute; top: -4px; font-style: normal; font-size: 11px; color: var(--text); opacity: 0; transform: translateY(6px); transition: .25s var(--ease); }
.hcol:hover em, .hcol.on em { opacity: 1; transform: none; }
@keyframes growY { from { transform: scaleY(0); } }
.stats-empty { color: var(--dim); font-size: 14px; }

/* ---------- Catalog ---------- */
.catalog { position: relative; max-width: 1480px; margin: 0 auto; padding: 34px clamp(14px, 3vw, 32px) 90px; }
.toolbar {
  position: sticky; top: calc(var(--top) + 6px); z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px; border-radius: 18px; border: 1px solid var(--line);
  background: rgba(10, 9, 22, .78); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .9);
}
.segmented { position: relative; display: flex; gap: 2px; max-width: 100%; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .04); overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { position: relative; z-index: 1; padding: 9px 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer; transition: color .25s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { color: #fff; }
.segmented em { margin-left: 4px; font-style: normal; font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
.seg-indicator {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px;
  background: linear-gradient(120deg, rgba(139, 92, 246, .95), rgba(34, 211, 238, .75));
  box-shadow: 0 6px 24px -6px rgba(139, 92, 246, .9);
  transition: transform .5s var(--spring), width .5s var(--spring);
}
.toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar .btn { height: 40px; padding: 0 14px; font-weight: 600; }
.select { position: relative; }
.select::after { content: '▾'; position: absolute; right: 12px; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--muted); }
.select select {
  height: 40px; padding: 0 34px 0 14px; border-radius: 12px; appearance: none; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-weight: 600;
}
.select select option { background: var(--panel-solid); }
.switch { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); cursor: pointer; font-weight: 600; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 36px; height: 20px; border-radius: 99px; background: rgba(255, 255, 255, .15); transition: background .3s; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .4s var(--spring); }
.switch input:checked + .track { background: linear-gradient(120deg, var(--violet), var(--cyan)); }
.switch input:checked + .track .thumb { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--cyan); outline-offset: 2px; }
.view-toggle { display: flex; padding: 3px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); }
.view-toggle button { display: grid; place-items: center; width: 34px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; transition: .2s; }
.view-toggle button.active { background: rgba(139, 92, 246, .35); color: #fff; }

.letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 20px 0 8px; }
.letter {
  position: relative; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .035); font-weight: 700; font-size: 14px;
  transition: transform .3s var(--spring), background .2s, border-color .2s, opacity .3s;
}
.letter::after {
  content: attr(data-count); position: absolute; left: 50%; bottom: calc(100% + 6px); translate: -50% 4px; padding: 2px 7px; border-radius: 6px;
  background: var(--panel-solid); border: 1px solid var(--line-2); font-size: 11px; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: .2s var(--ease);
}
.letter:hover:not(:disabled) { transform: translateY(-4px) scale(1.1); border-color: rgba(255, 255, 255, .3); }
.letter:hover::after { opacity: 1; translate: -50% 0; }
.letter.active { border-color: transparent; background: var(--grad); color: #0b0a17; box-shadow: 0 8px 22px -8px var(--violet); }
.letter:disabled { opacity: .22; cursor: default; }

.active-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 0; margin: 8px 0; }
.af-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid rgba(139, 92, 246, .45); background: rgba(139, 92, 246, .14); animation: pop .4s var(--spring);
}
.af-pill button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); cursor: pointer; font-size: 10px; }
.af-pill button:hover { background: var(--pink); color: #1a0510; }
.af-action { padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line-2); background: none; cursor: pointer; font-size: 13px; color: var(--muted); }
.af-action:hover { color: var(--text); border-color: var(--cyan); }

.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 18px 4px 4px; }
.results-head h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; }
.grad-num { font-variant-numeric: tabular-nums; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 20px; margin-top: 16px; }
.card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; isolation: isolate; cursor: pointer; outline: none;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(30, 26, 60, .88), rgba(15, 13, 32, .92));
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .55s var(--ease), border-color .3s, box-shadow .45s;
  animation: cardIn .7s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 26ms);
}
.grid.quiet .card { animation: fadeIn .3s ease backwards; animation-delay: 0s; }
.card.tilting { transition: transform .1s linear, border-color .3s, box-shadow .45s; }
@keyframes cardIn { from { opacity: 0; transform: perspective(900px) translateY(34px) rotateX(14deg) scale(.95); } }
@keyframes fadeIn { from { opacity: 0; } }
.card::before {
  content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, .1), transparent 42%);
}
.card::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(260px circle at var(--mx) var(--my), hsl(var(--h1) 95% 68%), hsl(var(--h2) 90% 60% / .4) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card:hover, .card:focus-visible { border-color: transparent; box-shadow: 0 32px 60px -26px hsl(var(--h1) 85% 50% / .6); }
.card:hover::before, .card:hover::after, .card:focus-visible::after { opacity: 1; }
.card.starred { background: linear-gradient(180deg, rgba(44, 34, 60, .9), rgba(18, 14, 32, .92)); }

.cover {
  --pat: none;
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 16 / 10; margin: 6px 6px 0; border-radius: calc(var(--radius) - 5px);
  background: radial-gradient(120% 90% at 18% 8%, hsl(var(--h1) 88% 64%), transparent 60%), linear-gradient(135deg, hsl(var(--h1) 72% 44%), hsl(var(--h2) 78% 26%));
}
.cover::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--pat), repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .14) 2px 3px);
  transition: transform 1.2s var(--ease);
}
.cover::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 46%, transparent 62%);
  transition: transform 1s var(--ease);
}
.card:hover .cover::after { transform: translateX(130%); }
.card:hover .cover::before { transform: scale(1.18) rotate(2deg); }
.pat-0 { --pat: linear-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px) 0 0 / 14px 14px, linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px) 0 0 / 14px 14px; }
.pat-1 { --pat: repeating-radial-gradient(circle at 85% 115%, transparent 0 14px, rgba(255, 255, 255, .1) 14px 16px); }
.pat-2 { --pat: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .08) 0 10px, transparent 10px 22px); }
.pat-3 { --pat: radial-gradient(circle at 78% 112%, hsl(var(--h2) 95% 72% / .75) 0 30%, transparent 31%), linear-gradient(transparent 62%, rgba(0, 0, 0, .25) 62%); }
.pat-4 { --pat: radial-gradient(rgba(255, 255, 255, .2) 1.3px, transparent 1.8px) 0 0 / 12px 12px; }
.pat-5 { --pat: conic-gradient(from 45deg, rgba(255, 255, 255, .07) 25%, transparent 0 50%, rgba(255, 255, 255, .07) 0 75%, transparent 0) 0 0 / 26px 26px; }
.sprite-wrap { position: absolute; inset: 0; display: grid; place-items: center; }
.sprite-wrap svg {
  width: 34%; height: auto; overflow: visible;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .28)) drop-shadow(0 0 18px hsl(var(--h1) 100% 72% / .65));
  transition: transform .6s var(--spring);
}
.sp-main { fill: rgba(255, 255, 255, .94); }
.sp-acc { fill: hsl(var(--h2) 96% 78%); }
.card:hover .sprite-wrap svg { transform: translateY(-6px) scale(1.12); animation: hover-bob 1.4s ease-in-out .6s infinite; }
@keyframes hover-bob { 0%, 100% { transform: translateY(-6px) scale(1.12); } 50% { transform: translateY(-12px) scale(1.12); } }
.mono {
  position: absolute; right: 10px; bottom: 6px; z-index: 1;
  font-family: var(--pixel); font-size: 22px; letter-spacing: 2px; color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .5); transition: transform .5s var(--spring), color .3s;
}
.card:hover .mono { color: rgba(255, 255, 255, .16); transform: translateX(-4px); }

.card-flags { position: absolute; top: 14px; left: 14px; z-index: 4; display: flex; flex-wrap: wrap; gap: 5px; pointer-events: none; }
.flag {
  padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(8, 7, 18, .7); backdrop-filter: blur(6px);
}
.flag.star { animation: starpulse 2.6s ease-in-out infinite; }
.flag.seen-flag { border-color: rgba(52, 211, 153, .5); color: #a7f3d0; }
@keyframes starpulse { 50% { box-shadow: 0 0 16px rgba(251, 191, 36, .7); border-color: rgba(251, 191, 36, .7); } }
.fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 4; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(8, 7, 18, .55); backdrop-filter: blur(6px); color: #fff;
  opacity: .0; transform: scale(.7); transition: opacity .25s, transform .35s var(--spring), background .2s;
}
.card:hover .fav-btn, .card:focus-within .fav-btn, .fav-btn.on { opacity: 1; transform: none; }
.fav-btn:hover { background: rgba(244, 114, 182, .35); transform: scale(1.12); }
.fav-btn svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.fav-btn.on { color: var(--pink); background: rgba(244, 114, 182, .2); border-color: rgba(244, 114, 182, .6); }
.fav-btn.on svg { fill: currentColor; }
.fav-btn.pop { animation: heartpop .5s var(--spring); }
@keyframes heartpop { 30% { transform: scale(1.45); } }

.card-body { position: relative; z-index: 4; display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.card-title {
  margin: 0; min-height: 2.5em; font-size: 16px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
mark { color: inherit; background: linear-gradient(transparent 52%, rgba(250, 204, 21, .55) 0); border-radius: 2px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 24px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px 3px 5px; border-radius: 999px; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tag img { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.tag .ico { display: grid; place-items: center; width: 14px; height: 14px; font-size: 11px; flex: none; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 14px; }
.act {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border-radius: 10px;
  font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--spring), box-shadow .25s, background .2s;
}
.act:hover { transform: translateY(-2px); }
.act-play { background: linear-gradient(135deg, #10b981, #6ee7b7); color: #03140d; }
.act-play:hover { box-shadow: 0 10px 26px -8px #34d399; }
.act-src { border: 1px solid rgba(96, 165, 250, .38); background: rgba(96, 165, 250, .13); color: #bfdbfe; }
.act-src:hover { background: rgba(96, 165, 250, .25); box-shadow: 0 10px 26px -10px var(--blue); }
.act-off { border: 1px dashed var(--line-2); color: var(--dim); font-weight: 500; }
.act-search { border: 1px dashed rgba(251, 191, 36, .4); color: #fde68a; }
.card.seen .cover { filter: saturate(.7) brightness(.9); }

/* List view */
.grid.list { grid-template-columns: 1fr; gap: 10px; }
.grid.list .card { flex-direction: row; align-items: center; transform: none; }
.grid.list .cover { flex: none; width: 116px; margin: 6px; }
.grid.list .mono, .grid.list .card-flags { display: none; }
.grid.list .card-body { flex-direction: row; align-items: center; gap: 16px; padding: 8px 12px 8px 6px; }
.grid.list .card-title { flex: 1; min-height: 0; -webkit-line-clamp: 1; line-clamp: 1; }
.grid.list .card-title .inline-flag { display: inline; }
.grid.list .card-meta { margin: 0; flex: none; max-width: 34%; flex-wrap: nowrap; }
.grid.list .card-actions { flex: none; width: 250px; margin: 0; padding: 0; }
.grid.list .fav-btn { position: static; order: 5; flex: none; margin-right: 12px; opacity: 1; transform: none; }
.inline-flag { display: none; margin-left: 8px; font-size: 13px; }

/* Skeleton */
.card.skeleton { pointer-events: none; }
.card.skeleton .cover, .sk-line {
  background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)) 0 0 / 200% 100%;
  animation: skeleton 1.3s linear infinite;
}
.sk-line { height: 12px; border-radius: 6px; margin-top: 10px; }
@keyframes skeleton { to { background-position: -200% 0; } }

/* Empty */
.empty { padding: 70px 20px; text-align: center; animation: rise .5s var(--ease); }
.empty .ghost { width: 90px; fill: var(--violet); filter: drop-shadow(0 0 22px var(--violet)); animation: bob 2s ease-in-out infinite; }
.empty h3 { margin: 18px 0 6px; font-family: var(--pixel); font-size: 15px; line-height: 1.6; }
.empty p { margin: 0 0 22px; }
#sentinel { height: 1px; }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(3, 2, 10, .55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .4s; }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(450px, 94vw);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line); background: rgba(13, 11, 28, .95); backdrop-filter: blur(24px);
  box-shadow: -40px 0 90px -20px rgba(0, 0, 0, .85);
  transform: translateX(105%); visibility: hidden; transition: transform .6s var(--ease), visibility 0s .6s;
}
body.drawer-open .drawer { transform: none; visibility: visible; transition: transform .6s var(--ease), visibility 0s; }
.drawer-head, .drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px; }
.drawer-head { border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px 20px; }
.drawer-body section { padding: 16px 0; border-bottom: 1px solid var(--line); opacity: 0; transform: translateX(40px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
body.drawer-open .drawer-body section { opacity: 1; transform: none; transition-delay: calc(var(--d) * 80ms + 150ms); }
.drawer-body h4 { margin: 0 0 12px; font-size: 14px; letter-spacing: .02em; }
.drawer-foot { border-top: 1px solid var(--line); }
.drawer-foot .btn.primary { flex: 1; }
.mini-search {
  width: 100%; height: 38px; margin-bottom: 12px; padding: 0 12px; border-radius: 10px; outline: none;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 14px;
}
.mini-search:focus { border-color: var(--violet); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; cursor: pointer; font-size: 13px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04);
  transition: transform .25s var(--spring), background .2s, border-color .2s, box-shadow .25s;
}
.chip img { width: 16px; height: 16px; border-radius: 4px; }
.chip small { opacity: .6; font-variant-numeric: tabular-nums; }
.chip:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .32); }
.chip.on { border-color: transparent; background: linear-gradient(120deg, rgba(139, 92, 246, .6), rgba(34, 211, 238, .45)); box-shadow: 0 6px 22px -8px var(--violet); }
.chip.more { border-style: dashed; color: var(--cyan); }

/* ---------- Modal ---------- */
.modal {
  width: 100%; max-width: min(980px, 94vw); max-height: 92vh; padding: 0; border: 0; overflow: visible;
  background: transparent; color: var(--text);
}
.modal::backdrop { background: rgba(3, 2, 10, .72); backdrop-filter: blur(10px); animation: fadeIn .35s ease; }
.modal.closing::backdrop { animation: fadeOut .25s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.modal-card {
  position: relative; max-height: 92vh; overflow: auto; overscroll-behavior: contain; border-radius: 26px;
  border: 1px solid var(--line-2); background: linear-gradient(180deg, #181437, #0d0b1e 60%);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .95), 0 0 80px -30px hsl(var(--h1, 260) 90% 55% / .6);
  animation: modalIn .55s var(--spring);
}
.modal.closing .modal-card { animation: modalOut .25s var(--ease) forwards; }
@keyframes modalIn { from { opacity: 0; transform: translateY(46px) scale(.93); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(26px) scale(.96); } }
.modal-close, .modal-nav {
  position: absolute; z-index: 10; display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(8, 7, 18, .55); backdrop-filter: blur(8px);
  transition: transform .3s var(--spring), background .2s;
}
.modal-close { top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; }
.modal-close:hover { transform: rotate(90deg) scale(1.08); background: rgba(244, 114, 182, .35); }
.modal-nav { top: 110px; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1; }
.modal-nav.prev { left: 14px; }
.modal-nav.next { right: 14px; }
.modal-nav:hover { transform: scale(1.12); background: rgba(139, 92, 246, .45); }
.m-hero { position: relative; height: clamp(210px, 34vh, 310px); }
.m-hero .cover { position: absolute; inset: 0; margin: 0; border-radius: 0; aspect-ratio: auto; }
.m-hero .sprite-wrap { place-items: center end; padding-right: 9%; }
.m-hero .sprite-wrap svg { width: min(170px, 26%); animation: float-sprite 3.2s ease-in-out infinite; }
@keyframes float-sprite { 50% { transform: translateY(-14px) rotate(-3deg); } }
.m-hero .mono { display: none; }
.m-hero::after { content: ''; position: absolute; inset: auto 0 0; height: 70%; background: linear-gradient(transparent, #171336); pointer-events: none; }
.m-hero-text { position: absolute; left: 28px; right: 28px; bottom: 16px; z-index: 2; }
.m-kicker { font-family: var(--pixel); font-size: 10px; letter-spacing: .2em; color: rgba(255, 255, 255, .75); text-transform: uppercase; }
.m-hero h2 { margin: 10px 0 12px; max-width: 75%; font-size: clamp(1.6rem, 4vw, 2.7rem); line-height: 1.05; letter-spacing: -.03em; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
.m-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.m-content { display: grid; gap: 24px; padding: 22px 28px 30px; }
.m-content > * { animation: rise .5s var(--ease) both; }
.m-content > *:nth-child(2) { animation-delay: .06s; } .m-content > *:nth-child(3) { animation-delay: .12s; }
.m-content > *:nth-child(4) { animation-delay: .18s; } .m-content > *:nth-child(5) { animation-delay: .24s; }
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.m-actions .btn { height: 48px; }
.m-frame { position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--line-2); background: #000; animation: rise .5s var(--ease); }
.m-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; background: #000; }
.m-frame-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(255, 255, 255, .04); font-size: 13px; }
.m-frame-bar .muted { flex: 1; min-width: 200px; }
.m-frame-bar .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-card { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.info-card h4 { margin: 0 0 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.info-card dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.info-card dt { color: var(--dim); }
.info-card dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.info-card dd a { color: #c4b5fd; text-decoration: none; }
.info-card dd a:hover { text-decoration: underline; }
.linkish { padding: 0; border: 0; background: none; color: var(--cyan); cursor: pointer; text-align: left; font-weight: 600; }
.linkish:hover { text-decoration: underline; }
.m-note { margin: 0; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(251, 191, 36, .25); background: rgba(251, 191, 36, .07); color: #fde68a; font-size: 14px; }
.m-section h4 { margin: 0 0 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mini-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-game {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 12px 5px 5px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 13px; text-align: left;
  transition: transform .25s var(--spring), border-color .2s;
}
.mini-game:hover { transform: translateY(-2px); border-color: hsl(var(--h1) 90% 65%); }
.mini-game.current { border-color: var(--violet); background: rgba(139, 92, 246, .18); }
.mini-game .cover { flex: none; width: 34px; height: 26px; margin: 0; border-radius: 7px; aspect-ratio: auto; }
.mini-game .cover .mono { display: none; }
.mini-game .sprite-wrap svg { width: 60%; filter: none; }
.mini-game small { color: var(--dim); }
.m-ext { display: flex; flex-wrap: wrap; gap: 8px; }
.m-ext .btn { height: 38px; font-size: 13px; font-weight: 600; }

.help .modal-card { max-width: 520px; margin: auto; }
.help { max-width: min(520px, 94vw); }
.help-body { padding: 30px; }
.help-body h2 { margin: 0 0 20px; }
.shortcuts { display: grid; gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.shortcuts li { display: flex; align-items: center; gap: 6px; }
.shortcuts li span { margin-left: auto; color: var(--muted); font-size: 14px; }

/* ---------- Slot machine ---------- */
.slot { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: rgba(3, 2, 10, .7); backdrop-filter: blur(10px); animation: fadeIn .3s ease; }
.slot.out { animation: fadeOut .35s ease forwards; }
.slot-machine {
  position: relative; width: min(640px, 92vw); padding: 26px; border-radius: 30px; text-align: center;
  background: linear-gradient(180deg, #221b49, #120f28); border: 2px solid rgba(251, 191, 36, .5);
  box-shadow: 0 0 0 6px rgba(251, 191, 36, .08), 0 40px 100px -30px #000, 0 0 80px -20px rgba(244, 114, 182, .6);
  animation: modalIn .5s var(--spring);
}
.slot-lights { position: absolute; inset: 10px; border-radius: 22px; pointer-events: none; background: radial-gradient(circle, var(--amber) 2px, transparent 3px) 0 0 / 22px 22px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); padding: 6px; animation: lights .4s steps(2) infinite; }
@keyframes lights { 50% { background-position: 11px 0; filter: hue-rotate(90deg); } }
.slot-window {
  position: relative; height: 92px; overflow: hidden; border-radius: 16px; background: #07060f; border: 1px solid var(--line-2);
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.slot-window::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; translate: 0 -50%; background: rgba(244, 114, 182, .25); }
.slot-reel { will-change: transform; }
.slot-item { display: grid; place-items: center; height: 92px; padding: 0 20px; font-size: clamp(20px, 3.4vw, 30px); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-item:last-child { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.slot-caption { margin: 16px 0 0; font-family: var(--pixel); font-size: 11px; letter-spacing: .12em; color: var(--amber); animation: blink 1s steps(1) infinite; }

/* ---------- Misc ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 45; width: 52px; height: 52px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: rgba(14, 12, 30, .8); backdrop-filter: blur(10px); font-size: 18px; font-weight: 700;
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: opacity .35s, transform .45s var(--spring);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }
.to-top svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.to-top circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: rgba(255, 255, 255, .1); }
.ring { stroke: var(--cyan); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: calc(113.1 * (1 - var(--p, 0))); filter: drop-shadow(0 0 4px var(--cyan)); }
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 210; display: grid; gap: 8px; translate: -50% 0; pointer-events: none; }
.toast {
  padding: 12px 18px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(20, 17, 42, .95); backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px -20px #000; font-size: 14px; font-weight: 500; animation: toastIn .45s var(--spring);
}
.toast.out { animation: fadeOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
.footer { border-top: 1px solid var(--line); background: rgba(8, 7, 18, .6); backdrop-filter: blur(10px); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; max-width: 1480px; margin: 0 auto; padding: 36px clamp(14px, 3vw, 32px); }
.footer-inner > div:first-child { max-width: 680px; }
.footer a { color: #c4b5fd; }
.footer .btn { color: var(--text); }
.footer-links { display: flex; gap: 10px; }
.brand.static { margin-bottom: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid .panel:first-child { grid-column: 1 / -1; }
  .donut-wrap { grid-template-columns: auto 1fr; align-items: center; }
}
@media (max-width: 860px) {
  :root { --top: 112px; }
  .topbar { flex-wrap: wrap; height: auto; min-height: var(--top); padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .top-actions { margin-left: auto; }
  .lbl { display: none; }
  .counters { grid-template-columns: repeat(2, 1fr); }
  .toolbar { position: relative; top: auto; }
  .toolbar-right { width: 100%; flex-wrap: nowrap; }
  .toolbar-right .select { flex: 1; min-width: 0; }
  .toolbar-right .select select { width: 100%; }
  .eyebrow { font-size: 12px; }
  .switch-lbl { display: none; }
  .m-grid { grid-template-columns: 1fr; }
  .grid.list .card-meta { display: none; }
  .grid.list .card-actions { width: 180px; }
  .letters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 14px 2px 4px; scrollbar-width: none; }
  .letter { flex: none; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
  .card-title { font-size: 14px; }
  .card-body { padding: 10px 10px 12px; }
  .card-actions { grid-template-columns: 1fr; }
  .card-meta { display: none; }
  .fav-btn { opacity: 1; transform: none; }
  .grid.list .card-actions { width: 96px; }
  .grid.list .cover { width: 72px; }
  .m-hero h2 { max-width: 100%; }
  .m-content { padding: 18px; }
  .modal-nav { top: 70px; }
  .m-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
