:root {
  --bg: #060a14;
  --bg-2: #0b1120;
  --card: #0f172a;
  --card-2: #131e36;
  --border: rgba(148, 163, 184, 0.14);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --grad: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  --radius: 16px;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f1f5f9;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #475569;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .brand { font-family: 'Space Grotesk', 'Inter', sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 999;
  background: var(--accent-2); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 12px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.gr {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Header */
.hdr {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6, 10, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .hdr { background: rgba(255, 255, 255, 0.9); }
.hdr-in {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  height: 68px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; flex-shrink: 0; }
.brand img { border-radius: 10px; }

.hdr-search {
  flex: 1; max-width: 340px; display: flex; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 6px 4px 16px; transition: border-color .2s;
}
.hdr-search:focus-within { border-color: var(--accent); }
.hdr-search input {
  width: 100%; background: none; border: 0; outline: 0; color: var(--text); font-size: .92rem;
}
.hdr-search button {
  width: 34px; height: 34px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; flex-shrink: 0;
}
.hdr-search svg { width: 17px; height: 17px; fill: #fff; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 8px 12px; border-radius: 10px; font-size: .92rem; font-weight: 500;
  color: var(--muted); transition: .2s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--card); }

.drop { position: relative; }
.drop-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px; box-shadow: var(--shadow); display: none; z-index: 120;
}
.drop.open .drop-menu, .drop:hover .drop-menu { display: grid; gap: 2px; }
.drop-menu a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 8px; font-size: .88rem; color: var(--muted);
}
.drop-menu a:hover { background: var(--card-2); color: var(--text); }
.drop-menu .cnt {
  font-size: .75rem; padding: 2px 8px; border-radius: 999px;
  background: rgba(56, 189, 248, 0.12); color: var(--accent);
}

.theme-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); display: grid; place-items: center; flex-shrink: 0;
}
.theme-btn svg { width: 18px; height: 18px; fill: var(--text); }
.msearch { display: none; }
.burger { display: none; width: 38px; height: 38px; flex-direction: column; justify-content: center; gap: 5px; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* Hero */
.hero {
  padding: 46px 0 26px;
  background: radial-gradient(circle at 18% 15%, rgba(99, 102, 241, 0.16), transparent 45%),
              radial-gradient(circle at 82% 20%, rgba(6, 182, 212, 0.14), transparent 42%);
}
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 38px; align-items: center; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); font-size: .82rem; font-weight: 600; color: var(--accent);
}
.hero-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); line-height: 1.08; margin: 16px 0 14px; }
.hero .sub { color: var(--muted); font-size: 1.02rem; max-width: 540px; margin: 0 0 24px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; font-weight: 600; font-size: .94rem; transition: transform .16s, opacity .16s;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35); }
.btn-ghost { background: var(--card); border: 1px solid var(--border); color: var(--text); }

.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hstat b { display: block; font-size: 1.5rem; font-family: 'Space Grotesk', sans-serif; }
.hstat span { font-size: .83rem; color: var(--muted); }

/* Featured Slider */
.fslider {
  position: relative; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow);
  aspect-ratio: 16 / 10;
}
.fslides { display: flex; height: 100%; transition: transform .45s cubic-bezier(.22,1,.36,1); }
.fslide { min-width: 100%; height: 100%; position: relative; }
.fslide img { width: 100%; height: 100%; object-fit: cover; }
.fslide::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,10,20,.92) 8%, rgba(6,10,20,.25) 60%, transparent);
}
.fslide-info { position: absolute; left: 24px; right: 24px; bottom: 24px; z-index: 2; color: #fff; }
.fslide-info .tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(56, 189, 248, 0.22); color: #7dd3fc; font-size: .76rem; font-weight: 600;
}
.fslide-info h3 { margin: 8px 0 4px; font-size: 1.45rem; }
.fslide-info p { margin: 0 0 12px; color: #cbd5e1; font-size: .88rem; }
.fnav button {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; background: rgba(15, 23, 42, 0.72);
  color: #fff; font-size: 1.3rem; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.15);
}
#fPrev { left: 12px; }
#fNext { right: 12px; }
.fdots {
  position: absolute; right: 20px; bottom: 24px; z-index: 3; display: flex; gap: 6px;
}
.fdots button { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.35); transition: .2s; }
.fdots button[aria-selected="true"] { width: 22px; background: var(--accent); }

/* Sections */
.sec { padding: 34px 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.35rem; }
.tic {
  width: 34px; height: 34px; border-radius: 10px; background: rgba(56, 189, 248, 0.12);
  display: grid; place-items: center; color: var(--accent);
}
.tic svg { width: 18px; height: 18px; fill: currentColor; }
.link-more { font-size: .9rem; color: var(--accent); font-weight: 600; }

/* Trending */
.trend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.trank {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--border);
  transition: transform .18s, border-color .18s;
}
.trank:hover { transform: translateY(-2px); border-color: var(--accent); }
.trank .num {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem;
  color: var(--accent); min-width: 24px; text-align: center;
}
.trank img { width: 52px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.trank .tt { display: block; font-weight: 600; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.trank .tm { display: block; font-size: .78rem; color: var(--muted); }

/* Game Grid */
.ggrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.gcard {
  display: flex; flex-direction: column; height: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.gcard:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.gcard-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--card-2); }
.gcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gcard:hover .gcard-media img { transform: scale(1.06); }
.gcard-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(6,10,20,.45); opacity: 0; transition: opacity .2s;
}
.gcard:hover .gcard-play { opacity: 1; }
.gcard-play svg { width: 42px; height: 42px; fill: #fff; background: var(--grad); padding: 10px; border-radius: 50%; }
.gcard-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.gcard-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard-meta { display: flex; align-items: center; gap: 4px; font-size: .76rem; color: var(--muted); }
.gcard-meta svg { width: 13px; height: 13px; fill: var(--accent); }

/* Blog Grid */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.blog-card {
  display: flex; flex-direction: column; gap: 10px; padding: 20px;
  border-radius: 16px; background: var(--card); border: 1px solid var(--border);
  transition: transform .2s, border-color .2s;
}
.blog-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.blog-cat {
  align-self: flex-start; font-size: .74rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: 4px 10px; border-radius: 999px;
  background: rgba(99, 102, 241, 0.16); color: #a5b4fc;
}
.blog-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.blog-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.blog-meta { margin-top: auto; font-size: .8rem; color: var(--muted); }

/* Play Page */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .86rem; color: var(--muted); margin: 18px 0 14px; }
.breadcrumbs a:hover { color: var(--accent); }
.play-layout { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
.player-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
}
.player-frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #020617; }
.player-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-top: 1px solid var(--border);
}
.player-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.player-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .88rem; }

.info-card {
  margin-top: 16px; padding: 20px 22px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--border);
}
.info-card h2, .info-card h3 {
  margin: 0 0 10px; font-size: 1.1rem; padding-left: 12px; border-left: 3px solid var(--accent);
}
.info-card p, .info-card li { color: var(--muted); font-size: .95rem; }
.info-card ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }

.side-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 16px;
}
.side-card h3 { margin: 0 0 12px; font-size: 1rem; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--border); font-weight: 700; font-size: .85rem;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.rel-list { display: grid; gap: 10px; }
.rel-item { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; transition: background .15s; }
.rel-item:hover { background: var(--card-2); }
.rel-item img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.rel-item b { display: block; font-size: .88rem; }
.rel-item span { font-size: .76rem; color: var(--muted); }

/* Prose / Static / Contact / Pagination */
.page-head { padding: 34px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.page-head p { margin: 0; color: var(--muted); }

.prose {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 28px; max-width: 900px;
}
.prose h2, .prose h3 { margin-top: 22px; margin-bottom: 8px; }
.prose p, .prose li { color: var(--muted); }

.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); font-size: .86rem; color: var(--muted);
}
.pill.active, .pill:hover { background: var(--grad); color: #fff; border-color: transparent; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); font-size: .88rem;
}
.pagination span.current { background: var(--grad); color: #fff; border-color: transparent; }

.form-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 26px; max-width: 680px;
}
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 600; }
.field input, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font: inherit;
}
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: .92rem; }
.alert-ok { background: rgba(34, 197, 94, 0.14); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }
.alert-err { background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }
.ad-wrap { max-width: 1280px; margin: 16px auto; padding: 0 20px; text-align: center; overflow: hidden; }

/* Embed Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2,6,23,.75); z-index: 200;
  display: none; place-items: center; padding: 20px;
}
.modal-backdrop.open { display: grid; }
.modal-box {
  width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px; box-shadow: var(--shadow);
}
.modal-box textarea {
  width: 100%; min-height: 92px; padding: 10px; border-radius: 10px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); font-family: monospace;
}

/* Footer */
.ftr { margin-top: 48px; border-top: 1px solid var(--border); background: var(--bg-2); padding: 44px 0 24px; }
.ftr-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.ftr-brand p { color: var(--muted); font-size: .9rem; max-width: 340px; }
.ftr h4 { margin: 0 0 12px; font-size: .96rem; }
.ftr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ftr li a { color: var(--muted); font-size: .88rem; }
.ftr li a:hover { color: var(--accent); }
.ftr-bottom {
  margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .84rem; color: var(--muted);
}
.ftr-bottom .fl { display: flex; gap: 16px; flex-wrap: wrap; }

.totop {
  position: fixed; right: 20px; bottom: 20px; width: 42px; height: 42px;
  border-radius: 12px; background: var(--grad); color: #fff; font-weight: 700;
  display: none; place-items: center; box-shadow: var(--shadow); z-index: 90;
}
.totop.show { display: grid; }

@media (max-width: 1100px) {
  .ggrid { grid-template-columns: repeat(4, 1fr); }
  .play-layout { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .hero-grid, .ftr-cols, .blog-grid, .trend { grid-template-columns: 1fr; }
  .ggrid { grid-template-columns: repeat(3, 1fr); }
  .hdr-search { display: none; }
  .hdr-search.open {
    display: flex; position: absolute; left: 16px; right: 16px; top: 74px; max-width: none; z-index: 120;
  }
  .msearch, .burger { display: grid; }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; padding: 14px 20px;
  }
  .nav.open { display: flex; }
  .drop-menu { position: static; box-shadow: none; margin-top: 6px; }
}
@media (max-width: 560px) {
  .ggrid { grid-template-columns: repeat(2, 1fr); }
}

/* Lazy Player Facade, Specs & Directory */
.player-facade {
  position: relative; width: 100%; height: 100%; display: grid; place-items: center;
  overflow: hidden; cursor: pointer; background: #040814;
}
.facade-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(22px) brightness(0.4); transform: scale(1.12);
}
.facade-inner {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 12px; padding: 20px;
}
.facade-thumb {
  width: 148px; height: 112px; object-fit: cover; border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.22); box-shadow: 0 14px 30px rgba(0,0,0,0.55);
}
.facade-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.25rem; color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
.facade-btn { padding: 12px 26px; font-size: 1rem; }
.facade-btn svg { width: 18px; height: 18px; fill: currentColor; }
.facade-hint { font-size: .82rem; color: #cbd5e1; }

.game-specs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin-top: 8px;
}
.game-specs div {
  background: var(--card-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.game-specs span { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.game-specs b { font-size: .92rem; }

.prev-next {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px;
}
.pn-link {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border); transition: border-color .18s;
}
.pn-link:hover { border-color: var(--accent); }
.pn-link.next { text-align: right; }
.pn-link span { font-size: .78rem; color: var(--accent); font-weight: 600; }
.pn-link b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dir-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; margin-top: 12px;
}
.dir-link {
  padding: 8px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--border);
  font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color .15s;
}
.dir-link:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 720px) {
  .game-specs, .prev-next, .dir-grid { grid-template-columns: 1fr; }
}
