:root {
  --bg: #07070b;
  --bg-2: #0b0b12;
  --surface: #111119;
  --surface-2: #171722;
  --surface-3: #1f1b2e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(119, 0, 255, 0.35);
  --purple: #7700ff;
  --purple-bright: #a855ff;
  --pink: #ff0080;
  --pink-soft: #ff4da6;
  --green: #00e58a;
  --yellow: #ffc93c;
  --danger: #ff3860;
  --text: #f6f2ff;
  --muted: #a695c6;
  --muted-2: #74658f;
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 70px;
  --top-h: 62px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  --glow: 0 0 42px rgba(119, 0, 255, 0.28);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 700px at 78% -10%, rgba(119, 0, 255, 0.22), transparent 62%),
    radial-gradient(900px 600px at 8% 8%, rgba(255, 0, 128, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(255, 0, 128, 0.35); color: #fff; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 999;
  background: var(--purple); color: #fff; padding: 10px 16px; border-radius: 10px;
  transition: top .2s;
}
.skip-link:focus { top: 10px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  padding-top: var(--safe-t);
  background: rgba(7, 7, 11, 0.76);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; min-height: var(--top-h);
  display: flex; align-items: center; gap: 20px; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, #1a0230, #08080e);
  border: 1px solid rgba(119, 0, 255, 0.5);
  display: grid; place-items: center;
  box-shadow: 0 0 20px rgba(119, 0, 255, 0.28);
}
.brand-word { font-weight: 900; letter-spacing: 2.4px; font-size: 15px; color: #ebe4fb; }
.brand-word span { color: var(--pink); }
.desktop-nav { display: none; align-items: center; gap: 4px; margin-left: 10px; }
.desktop-nav a {
  color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 9px 14px; border-radius: 10px;
  transition: color .18s, background .18s;
}
.desktop-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.desktop-nav a.active { color: #fff; background: rgba(119, 0, 255, 0.16); }
.desktop-nav a.nav-premium { color: #ffd6ec; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  border-radius: 11px; color: #dcd3ed; transition: background .18s, border-color .18s;
}
.icon-btn:hover { background: rgba(119, 0, 255, 0.16); border-color: var(--line-strong); }
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(145deg, var(--purple), var(--pink));
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 18px rgba(255, 0, 128, 0.24);
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; z-index: 70; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 7px 8px calc(7px + var(--safe-b));
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(10, 10, 16, 0.9);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted-2); font-size: 10px; font-weight: 600; letter-spacing: .2px; border-radius: 10px;
  transition: color .18s;
}
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: #fff; }
.bottom-nav a.active svg { filter: drop-shadow(0 0 8px rgba(168, 85, 255, 0.8)); color: var(--purple-bright); }
.bottom-nav a.active span { color: var(--pink-soft); }

/* ---------- layout ---------- */
#view { max-width: 1240px; margin: 0 auto; padding: 18px 16px 6px; min-height: 60vh; }
.site-footer {
  max-width: 1240px; margin: 34px auto 0; padding: 26px 16px 22px;
  border-top: 1px solid var(--line); color: var(--muted-2); font-size: 12px;
  display: grid; gap: 10px;
}
.site-footer strong { color: #d9d0eb; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a, .link-btn { color: var(--muted); font-size: 12px; }
.footer-links a:hover, .link-btn:hover { color: #fff; }
.link-btn { background: none; border: 0; padding: 0; text-align: left; }
.footer-note { max-width: 760px; line-height: 1.7; font-size: 11px; color: #5e5276; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; }
.page-head h1 { font-size: clamp(23px, 5vw, 32px); letter-spacing: -0.5px; font-weight: 850; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--pink-soft); font-size: 10.5px; font-weight: 800; letter-spacing: 2.2px; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 14px; height: 2px; background: linear-gradient(90deg, var(--purple), var(--pink)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 13px; padding: 12px 18px;
  font-weight: 750; font-size: 13.5px; letter-spacing: .2px; white-space: nowrap;
  transition: transform .16s, box-shadow .16s, background .16s, border-color .16s, opacity .16s;
  background: var(--surface-2); color: #fff;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(100deg, var(--purple) 0%, #b100b7 55%, var(--pink) 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(119, 0, 255, 0.3), 0 2px 10px rgba(255, 0, 128, 0.18);
}
.btn-primary:hover { box-shadow: 0 14px 38px rgba(119, 0, 255, 0.42), 0 0 20px rgba(255, 0, 128, 0.24); }
.btn-ghost { background: rgba(255, 255, 255, 0.055); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.16); }
.btn-outline { background: transparent; border-color: rgba(168, 85, 255, 0.45); color: #e5d8ff; }
.btn-outline:hover { background: rgba(119, 0, 255, 0.12); }
.btn-danger { background: rgba(255, 56, 96, 0.12); border-color: rgba(255, 56, 96, 0.35); color: #ff97ad; }
.btn-danger.solid { background: var(--danger); border-color: transparent; color: #fff; }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 15px; }
.btn-block { width: 100%; }
.btn-icon-solo { padding: 10px; width: 40px; height: 40px; }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* ---------- chips / tags ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035); color: var(--muted); font-size: 12px; font-weight: 650;
  transition: all .16s;
}
.chip:hover { color: #fff; border-color: rgba(168, 85, 255, 0.4); }
.chip.active { color: #fff; background: linear-gradient(100deg, rgba(119, 0, 255, 0.45), rgba(255, 0, 128, 0.3)); border-color: rgba(255, 0, 128, 0.4); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 7px;
  font-size: 10px; font-weight: 750; letter-spacing: .6px; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06); color: #cbbce6; border: 1px solid var(--line);
}
.tag.purple { color: #d8c2ff; background: rgba(119, 0, 255, 0.16); border-color: rgba(119, 0, 255, 0.3); }
.tag.pink { color: #ffb3d5; background: rgba(255, 0, 128, 0.12); border-color: rgba(255, 0, 128, 0.28); }
.tag.green { color: #7dffc9; background: rgba(0, 229, 138, 0.1); border-color: rgba(0, 229, 138, 0.25); }
.tag.yellow { color: #ffdd85; background: rgba(255, 201, 60, 0.1); border-color: rgba(255, 201, 60, 0.25); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- hero ---------- */
.hero { margin-top: 6px; }
.hero-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 2px;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-card {
  position: relative; flex: 0 0 100%; scroll-snap-align: start;
  min-height: 390px; border-radius: 24px; overflow: hidden;
  border: 1px solid rgba(168, 85, 255, 0.28);
  background: var(--surface);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.04); filter: saturate(1.05); }
.hero-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 7, 11, 0.12) 0%, rgba(7, 7, 11, 0.18) 32%, rgba(7, 7, 11, 0.94) 78%, #07070b 100%),
    linear-gradient(90deg, rgba(7, 7, 11, 0.6), transparent 70%);
}
.hero-content {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.hero-content h2 { font-size: clamp(28px, 7vw, 44px); font-weight: 900; letter-spacing: -1.2px; line-height: 1.02; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6); }
.hero-content p { color: #cdbfe5; font-size: 13.5px; max-width: 520px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 9px; margin-top: 5px; width: 100%; }
.hero-actions .btn { flex: 1; max-width: 190px; }
.hero-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.hero-dots span { width: 6px; height: 6px; border-radius: 50%; background: #392c50; transition: all .2s; }
.hero-dots span.active { width: 20px; border-radius: 6px; background: linear-gradient(90deg, var(--purple), var(--pink)); }

/* ---------- sections ---------- */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.2px; display: flex; align-items: center; gap: 9px; }
.section-head h2::before { content: ""; width: 4px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--purple), var(--pink)); }
.section-head .link { font-size: 12px; color: var(--muted); font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
.section-head .link:hover { color: #fff; }
.h-scroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 0 10px; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * { flex: 0 0 158px; scroll-snap-align: start; }

/* ---------- game cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px 12px; }
.game-card { position: relative; display: block; border-radius: var(--radius); min-width: 0; transition: transform .2s; }
.game-card:hover { transform: translateY(-4px); }
.game-cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(150deg, #1d1030, #0c0a14);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.game-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2,.7,.3,1); }
.game-card:hover .game-cover img { transform: scale(1.055); }
.game-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 5, 9, 0.82) 100%);
}
.game-cover .cover-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; z-index: 2; }
.game-cover .cover-bottom { position: absolute; left: 9px; right: 9px; bottom: 8px; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.game-cover .price-badge { font-size: 9px; font-weight: 800; padding: 3px 7px; border-radius: 6px; background: rgba(7,7,11,.72); backdrop-filter: blur(6px); color: #ffd6ec; border: 1px solid rgba(255, 0, 128, 0.3); }
.game-cover .play-fab {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(7, 7, 11, 0.7); border: 1px solid rgba(255, 255, 255, 0.25); backdrop-filter: blur(8px);
}
.game-cover .play-fab svg { width: 14px; height: 14px; margin-left: 1px; }
.game-title { margin-top: 9px; font-size: 13.5px; font-weight: 750; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-sub { color: var(--muted-2); font-size: 11px; margin-top: 2px; display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; }
.game-sub .dot { width: 2px; height: 2px; border-radius: 50%; background: currentColor; }
.card-fav {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(7, 7, 11, 0.65); border: 1px solid rgba(255,255,255,.14);
  color: #fff; backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s;
}
.game-card:hover .card-fav, .card-fav.active { opacity: 1; }
.card-fav.active { color: var(--pink); }

/* ---------- featured strip ---------- */
.featured-card { position: relative; height: 210px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.featured-card img { width: 100%; height: 100%; object-fit: cover; }
.featured-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(7,7,11,.92) 100%); }
.featured-card .fc-body { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; }
.featured-card h3 { font-size: 15px; font-weight: 800; }
.featured-card span { font-size: 10.5px; color: var(--muted); }

/* ---------- sponsored ---------- */
.sponsored { margin-top: 28px; }
.sponsored-card {
  display: flex; gap: 14px; align-items: center; padding: 16px;
  border: 1px dashed rgba(255, 201, 60, 0.32); border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(255, 201, 60, 0.055), rgba(255, 0, 128, 0.04));
}
.sponsored-icon { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 201, 60, 0.12); border: 1px solid rgba(255, 201, 60, 0.3); color: var(--yellow); }
.sponsored-body { flex: 1; min-width: 0; }
.sponsored-body strong { display: block; font-size: 13.5px; }
.sponsored-body p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sponsored-body small { display: block; margin-top: 4px; font-size: 9.5px; color: var(--muted-2); letter-spacing: .3px; }

/* ---------- stats / info strips ---------- */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; }
.stat-box { background: linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); border: 1px solid var(--line); border-radius: 15px; padding: 14px; }
.stat-box b { display: block; font-size: 21px; font-weight: 850; }
.stat-box span { font-size: 10px; color: var(--muted-2); letter-spacing: 1px; text-transform: uppercase; }

.notice {
  display: flex; gap: 11px; padding: 13px 15px; border-radius: 14px; font-size: 12px; line-height: 1.55;
  border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--muted);
}
.notice svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; color: var(--purple-bright); }
.notice.warn { border-color: rgba(255, 201, 60, 0.25); background: rgba(255, 201, 60, 0.06); }
.notice.warn svg { color: var(--yellow); }
.notice.danger { border-color: rgba(255, 56, 96, 0.28); background: rgba(255, 56, 96, 0.06); }
.notice.danger svg { color: var(--danger); }
.notice.success { border-color: rgba(0, 229, 138, 0.25); background: rgba(0, 229, 138, 0.06); }
.notice.success svg { color: var(--green); }

/* ---------- library toolbar ---------- */
.toolbar { position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 30; padding: 8px 0 12px; background: linear-gradient(180deg, var(--bg) 70%, transparent); }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); pointer-events: none; }
.search-box input {
  width: 100%; padding: 13px 42px 13px 42px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.045); color: #fff;
  font-size: 14px; outline: none; transition: border-color .2s, background .2s;
}
.search-box input::placeholder { color: #6f6189; }
.search-box input:focus { border-color: rgba(168, 85, 255, 0.55); background: rgba(255, 255, 255, 0.06); }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: 8px; }
.filter-row { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-row::-webkit-scrollbar { display: none; }
.select {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  padding: 9px 32px 9px 12px; border-radius: 11px; border: 1px solid var(--line);
  background: #14121d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239c8dbb' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: #d9ceef; font-size: 12px; min-width: 0;
}
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 2px 14px; color: var(--muted-2); font-size: 11.5px; }
.load-more-wrap { display: flex; justify-content: center; padding: 22px 0 6px; }

/* ---------- game detail ---------- */
.detail-hero { position: relative; margin: -18px -16px 0; padding: 26px 16px 20px; overflow: hidden; }
.detail-hero::before {
  content: ""; position: absolute; inset: -40px -20px 0;
  background-image: var(--bg-img); background-size: cover; background-position: center 28%;
  filter: blur(34px) saturate(1.2) brightness(.48); transform: scale(1.15); z-index: -2;
}
.detail-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 0%, rgba(7,7,11,.65) 60%, var(--bg) 100%); }
.detail-top { max-width: 1120px; margin: 0 auto; display: flex; gap: 20px; align-items: flex-end; }
.detail-poster { width: 132px; flex: 0 0 auto; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.14); box-shadow: var(--shadow); aspect-ratio: 3/4; background: var(--surface); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { min-width: 0; flex: 1; }
.detail-info h1 { font-size: clamp(24px, 6vw, 40px); font-weight: 900; letter-spacing: -1px; line-height: 1.05; }
.detail-info .detail-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0; }
.detail-info p { color: var(--muted); font-size: 13px; max-width: 640px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.detail-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.detail-actions .btn-primary, .detail-actions .btn-play { min-width: 128px; }
.detail-body { max-width: 1120px; margin: 24px auto 0; display: grid; gap: 24px; }
.detail-section h2 { font-size: 16px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.detail-section h2::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: linear-gradient(180deg, var(--purple), var(--pink)); }
.detail-desc { color: #c9bce0; font-size: 13.5px; line-height: 1.75; white-space: pre-line; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.info-cell { background: #0e0d15; padding: 13px 15px; }
.info-cell span { display: block; color: var(--muted-2); font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 4px; }
.info-cell strong { font-size: 12.5px; font-weight: 650; color: #e3daf4; word-break: break-word; }
.gallery { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.gallery::-webkit-scrollbar { display: none; }
.gallery button { flex: 0 0 220px; padding: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: none; aspect-ratio: 9 / 16; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.requirements { display: grid; gap: 12px; }
.requirements .notice { align-items: flex-start; }
.legal-note { color: #6f6189; font-size: 11px; line-height: 1.7; }

/* ---------- auth / forms ---------- */
.auth-wrap { max-width: 430px; margin: 32px auto; }
.auth-card { background: linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; font-weight: 850; letter-spacing: -.5px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-top: 4px; margin-bottom: 20px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(255,255,255,.045); padding: 4px; border-radius: 12px; margin-bottom: 20px; }
.auth-tabs button { border: 0; background: transparent; color: var(--muted); padding: 9px; border-radius: 9px; font-weight: 700; font-size: 12.5px; }
.auth-tabs button.active { background: linear-gradient(100deg, rgba(119,0,255,.6), rgba(255,0,128,.4)); color: #fff; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 6px; letter-spacing: .3px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 13px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); color: #fff; font-size: 14px; outline: none;
  transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(168, 85, 255, 0.55); background: rgba(255,255,255,.06); }
.field .hint { font-size: 10.5px; color: var(--muted-2); margin-top: 5px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { color: #ff8ca5; font-size: 12px; margin: 6px 0 0; min-height: 16px; }
.form-success { color: #7dffc9; font-size: 12px; margin: 6px 0 0; min-height: 16px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; }
.check-row input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--purple); }
.check-row div { flex: 1; }
.check-row strong { font-size: 12.5px; display: block; }
.check-row span { font-size: 11px; color: var(--muted-2); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { font-size: 13px; display: block; }
.switch-row span { font-size: 11px; color: var(--muted-2); }
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #2a2338; transition: background .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #8b7aa7; transition: all .2s; }
.switch input:checked + i { background: linear-gradient(100deg, var(--purple), var(--pink)); }
.switch input:checked + i::after { left: 21px; background: #fff; }

/* ---------- downloads ---------- */
.dl-note { margin-bottom: 16px; }
.storage-meter { height: 5px; background: rgba(255,255,255,.07); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.storage-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--pink)); }
.dl-list { display: grid; gap: 11px; }
.dl-item { display: flex; gap: 13px; padding: 14px; border-radius: 15px; border: 1px solid var(--line); background: linear-gradient(150deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); }
.dl-cover { width: 54px; height: 72px; border-radius: 9px; overflow: hidden; flex: 0 0 auto; background: var(--surface-2); }
.dl-cover img { width: 100%; height: 100%; object-fit: cover; }
.dl-main { flex: 1; min-width: 0; }
.dl-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dl-head strong { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-head small { font-size: 10px; color: var(--muted-2); }
.dl-progress { height: 6px; border-radius: 4px; background: rgba(255,255,255,.08); margin: 8px 0 6px; overflow: hidden; }
.dl-progress i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--purple), var(--pink)); transition: width .25s; }
.dl-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted-2); font-size: 10.5px; }
.dl-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.dl-actions .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
.dl-actions .icon-btn svg { width: 15px; height: 15px; }
.dl-status { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.dl-status.downloading { color: var(--purple-bright); }
.dl-status.paused { color: var(--yellow); }
.dl-status.complete { color: var(--green); }
.dl-status.error { color: var(--danger); }
.history-table { display: grid; gap: 8px; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.history-row img { width: 34px; height: 45px; border-radius: 6px; object-fit: cover; }
.history-row .h-main { flex: 1; min-width: 0; }
.history-row strong { font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-row span { font-size: 10.5px; color: var(--muted-2); }

/* ---------- premium ---------- */
.premium-hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 28px 22px;
  background:
    radial-gradient(500px 260px at 85% 0%, rgba(255, 0, 128, .3), transparent 65%),
    radial-gradient(420px 300px at 0% 100%, rgba(119, 0, 255, .34), transparent 65%),
    linear-gradient(150deg, #17052b, #0b0a13);
  border: 1px solid rgba(168, 85, 255, .32);
  box-shadow: 0 24px 70px rgba(119, 0, 255, .18);
}
.premium-hero h1 { font-size: clamp(27px, 7vw, 42px); font-weight: 900; letter-spacing: -1px; margin: 8px 0; }
.premium-hero p { color: #cbbce6; font-size: 13.5px; max-width: 520px; }
.price-line { display: flex; align-items: baseline; gap: 4px; margin: 20px 0 16px; }
.price-line b { font-size: 46px; font-weight: 900; letter-spacing: -2px; background: linear-gradient(100deg, #fff, #ffb3d5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.price-line span { color: var(--muted); font-size: 13px; }
.plan-grid { display: grid; gap: 14px; margin-top: 20px; }
.plan-card { padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.plan-card.premium { border-color: rgba(255, 0, 128, .3); background: linear-gradient(160deg, rgba(119,0,255,.12), rgba(255,0,128,.055)); }
.plan-card h3 { font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-card .plan-price { font-size: 22px; font-weight: 850; margin: 6px 0 12px; }
.plan-card .plan-price small { font-size: 11px; color: var(--muted); font-weight: 500; }
.benefit-list { display: grid; gap: 9px; margin-top: 10px; }
.benefit-list li { display: flex; gap: 8px; font-size: 12.5px; color: #d7caea; }
.benefit-list svg { width: 15px; height: 15px; color: var(--green); flex: 0 0 auto; margin-top: 1px; }
.premium-status { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(0, 229, 138, .07); border: 1px solid rgba(0, 229, 138, .25); margin: 16px 0; }
.premium-status svg { color: var(--green); width: 24px; height: 24px; }
.premium-status strong { display: block; font-size: 13px; }
.premium-status span { font-size: 11px; color: var(--muted); }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 15px; padding: 18px; border-radius: 18px; background: linear-gradient(150deg, rgba(119,0,255,.16), rgba(255,0,128,.05)); border: 1px solid var(--line); }
.avatar-lg { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 900; background: linear-gradient(145deg, var(--purple), var(--pink)); box-shadow: 0 0 30px rgba(255,0,128,.25); }
.profile-head h1 { font-size: 20px; font-weight: 850; }
.profile-head p { font-size: 12px; color: var(--muted); }
.profile-grid { display: grid; gap: 16px; margin-top: 18px; }
.card-panel { padding: 19px 17px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.card-panel h2 { font-size: 14.5px; font-weight: 800; margin-bottom: 4px; }
.card-panel .panel-sub { font-size: 11.5px; color: var(--muted-2); margin-bottom: 12px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { border-color: rgba(255,56,96,.25); }

/* ---------- admin ---------- */
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.admin-tabs { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 0; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs button { flex: 0 0 auto; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 13px; font-size: 12.5px; font-weight: 700; }
.admin-tabs button.active { color: #fff; border-bottom-color: var(--pink); }
.admin-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.admin-kpi { padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.admin-kpi b { display: block; font-size: 23px; font-weight: 850; }
.admin-kpi span { color: var(--muted-2); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.admin-table { display: grid; gap: 8px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.admin-row .ar-thumb { width: 38px; height: 50px; border-radius: 6px; object-fit: cover; flex: 0 0 auto; }
.admin-row .ar-main { flex: 1; min-width: 0; }
.admin-row .ar-main strong { font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row .ar-main span { font-size: 10px; color: var(--muted-2); }
.admin-row .ar-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.admin-row .ar-actions .icon-btn { width: 31px; height: 31px; border-radius: 8px; }
.admin-row .ar-actions svg { width: 14px; height: 14px; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.admin-toolbar .search-box { flex: 1 1 180px; }
.admin-form { display: grid; gap: 2px; }
.admin-form .form-row { gap: 10px; }
.upload-progress { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; display: none; }
.upload-progress.show { display: block; }
.upload-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), var(--pink)); transition: width .2s; }
.admin-note { font-size: 11px; color: var(--muted-2); line-height: 1.6; margin: 8px 0 14px; }
.admin-tab-content { animation: fade .25s ease; }

/* ---------- emulator ---------- */
.emu-shell { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #05050a; }
.emu-frame { min-height: 320px; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); }
.emu-frame #ejs-game { width: 100%; height: 60vh; min-height: 320px; }
.emu-frame iframe, .emu-frame canvas { max-width: 100%; }
.emu-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.emu-controls .field { flex: 1 1 170px; margin: 0; }
.core-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 3, 8, 0.78);
  backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease; padding: 0;
}
.modal {
  width: 100%; max-width: 540px; max-height: 92dvh; overflow-y: auto;
  background: linear-gradient(170deg, #16121f, #0b0a11);
  border: 1px solid rgba(168, 85, 255, 0.24);
  border-radius: 22px 22px 0 0; padding: 22px 19px calc(20px + var(--safe-b));
  box-shadow: 0 -20px 80px rgba(0,0,0,.6); animation: slideUp .24s cubic-bezier(.2,.8,.3,1);
}
.modal.wide { max-width: 760px; }
.modal.full { max-width: none; width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 0; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-size: 18px; font-weight: 850; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-close { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); display: grid; place-items: center; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(9px + var(--safe-t)) 12px 9px; background: #0a0910; border-bottom: 1px solid var(--line); }
.player-bar strong { font-size: 12.5px; display: block; }
.player-bar span { font-size: 10px; color: var(--muted-2); }
.player-frame { flex: 1; border: 0; width: 100%; background: #05050a; }

/* ---------- toast / empty / skeleton ---------- */
.toast-stack { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  pointer-events: auto; padding: 12px 15px; border-radius: 12px; font-size: 12.5px;
  background: rgba(22, 18, 32, .96); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; gap: 9px; align-items: flex-start; animation: toastIn .25s ease;
}
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.toast.success { border-color: rgba(0,229,138,.3); } .toast.success svg { color: var(--green); }
.toast.error { border-color: rgba(255,56,96,.35); } .toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--purple-bright); }
.toast.warn { border-color: rgba(255,201,60,.3); } .toast.warn svg { color: var(--yellow); }

.empty { text-align: center; padding: 46px 20px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: #4e4168; margin-bottom: 12px; }
.empty h3 { color: #e3daf4; font-size: 15px; margin-bottom: 5px; }
.empty p { font-size: 12px; max-width: 320px; margin: 0 auto 16px; line-height: 1.6; }
.skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,.05); border-radius: 12px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.3s infinite; }
.skeleton-card .skeleton { aspect-ratio: 3/4; border-radius: var(--radius); }
.skeleton-card .line { height: 10px; margin-top: 9px; width: 75%; }

.offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: #4a2d00; color: #ffdd85; text-align: center; font-size: 11.5px; padding: 7px 12px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.offline-banner .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.update-banner, .install-banner {
  position: fixed; z-index: 120; left: 50%; transform: translateX(-50%);
  width: min(94vw, 520px); bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: rgba(24, 16, 38, .97); border: 1px solid rgba(168, 85, 255, .35);
  border-radius: 14px; box-shadow: var(--shadow);
}
.update-banner { justify-content: space-between; font-size: 12px; }
.update-banner button, .install-banner button {
  border: 0; border-radius: 9px; padding: 8px 13px; font-size: 11.5px; font-weight: 750;
  background: linear-gradient(100deg, var(--purple), var(--pink)); color: #fff;
}
.install-banner { bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
.install-banner > div { flex: 1; min-width: 0; }
.install-banner strong { display: block; font-size: 12.5px; }
.install-banner span { font-size: 10.5px; color: var(--muted); }
.install-banner .icon-btn { width: 28px; height: 28px; border: 0; background: none; font-size: 18px; color: var(--muted); }
.noscript { position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; background: var(--bg); padding: 30px; text-align: center; }
.page-loading { display: grid; place-items: center; min-height: 45vh; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(168,85,255,.2); border-top-color: var(--pink); animation: spin .8s linear infinite; margin-bottom: 12px; }
.inline-spinner { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (min-width: 720px) {
  :root { --nav-h: 0px; }
  body { padding-bottom: 30px; }
  .bottom-nav { display: none; }
  .desktop-nav { display: flex; }
  .topbar-inner { padding: 0 24px; }
  #view { padding: 26px 24px 10px; }
  .site-footer { padding: 30px 24px; }
  .hero-card { min-height: 430px; }
  .hero-content { padding: 34px 30px; }
  .detail-hero { margin: -26px -24px 0; padding: 44px 24px 26px; }
  .detail-poster { width: 190px; }
  .detail-body { grid-template-columns: 1.6fr 1fr; gap: 30px; }
  .detail-body .detail-main { min-width: 0; }
  .detail-body .detail-side { align-self: start; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
  .admin-kpis { grid-template-columns: repeat(4, 1fr); }
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .profile-grid .span-2 { grid-column: span 2; }
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: 22px; padding: 26px 24px; max-height: 88dvh; }
  .toast-stack { bottom: 24px; }
  .install-banner, .update-banner { bottom: 24px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px 16px; }
  .h-scroll > * { flex-basis: 178px; }
  .gallery button { flex-basis: 280px; }
}
@media (min-width: 1024px) {
  .hero-card { min-height: 470px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .h-scroll > * { flex-basis: 190px; }
  .detail-top { gap: 28px; }
  .detail-poster { width: 220px; }
}
@media (max-width: 380px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px 9px; }
  .hero-card { min-height: 350px; }
  .detail-poster { width: 108px; }
  .detail-actions .btn { flex: 1; padding: 11px 12px; }
  .hero-actions .btn { font-size: 12px; padding: 11px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
