/* ============================================================
   PlayArcade — Dark Premium Theme
   ============================================================ */
:root {
  --bg: #0b0e1a;
  --bg-2: #0e1222;
  --surface: #141a30;
  --surface-2: #1a2140;
  --surface-3: #222a4d;
  --border: #232b4a;
  --border-soft: #1b2138;
  --text: #eef1fb;
  --text-dim: #9aa3c4;
  --text-faint: #6b7398;
  --accent: #6d5cff;
  --accent-2: #00d4ff;
  --accent-grad: linear-gradient(135deg, #6d5cff 0%, #00d4ff 100%);
  --hot: #ff4d6d;
  --new: #36e0a0;
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 64px;
  --sidebar-w: 232px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --glow: 0 0 0 1px rgba(109, 92, 255, 0.4), 0 12px 40px rgba(109, 92, 255, 0.28);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 15% -10%, rgba(109, 92, 255, 0.10), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(0, 212, 255, 0.08), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(11, 14, 26, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.logo-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-grad);
  box-shadow: 0 6px 18px rgba(109, 92, 255, 0.45);
  font-size: 1rem;
}
.logo-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.search {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-left: auto;
}
.search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px 10px 40px;
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--text-faint); }
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 4px rgba(109, 92, 255, 0.16); }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.menu-toggle span { display: block; height: 2px; width: 18px; margin: 0 auto; background: var(--text); border-radius: 2px; }

/* ---------- Shell / layout ---------- */
.shell { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 18px 12px;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
}
.nav-head { color: var(--text-faint); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 12px; margin-bottom: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { color: var(--text); background: linear-gradient(135deg, rgba(109,92,255,.22), rgba(0,212,255,.14)); box-shadow: inset 0 0 0 1px rgba(109,92,255,.3); }
.nav-ico { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 14px 12px 4px; color: var(--text-faint); font-size: 0.78rem; border-top: 1px solid var(--border-soft); }
.sidebar-foot .muted { color: var(--text-faint); opacity: .7; }
.sidebar-foot p:first-child { color: var(--text-dim); font-weight: 700; }

.content { flex: 1; min-width: 0; padding: 24px 28px 40px; max-width: 1280px; }

.scrim { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 32px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--hero-a) 30%, transparent), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--hero-b) 26%, transparent), transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
}
/* ---------- Hero carousel ---------- */
.hero-carousel { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 26px; }
.hero-track { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.hero.slide { flex: 0 0 100%; margin-bottom: 0; border-radius: 0; border-left: 0; border-right: 0; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; z-index: 3;
  background: rgba(11,14,26,.55); border: 1px solid var(--border); color: #fff;
  font-size: 1.5rem; line-height: 1; cursor: pointer; backdrop-filter: blur(6px);
  display: grid; place-items: center; transition: background .15s, transform .15s;
}
.hero-arrow:hover { background: rgba(11,14,26,.85); }
.hero-arrow.prev { left: 14px; } .hero-arrow.next { right: 14px; }
.hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: rgba(255,255,255,.35); transition: width .2s, background .2s; }
.hero-dot.active { width: 26px; border-radius: 6px; background: #fff; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.03));
  pointer-events: none;
}
.hero-info { flex: 1; min-width: 0; z-index: 1; }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--accent-2); letter-spacing: 0.04em; margin-bottom: 10px; }
.hero-info h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 12px; }
.hero-info p { color: var(--text-dim); max-width: 52ch; margin-bottom: 22px; }
.hero-art {
  flex-shrink: 0; width: 280px; aspect-ratio: 3/2; border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border); transition: transform .25s;
}
.hero-art:hover { transform: translateY(-4px) scale(1.02); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-grad); color: #fff;
  padding: 12px 26px; border-radius: 999px;
  font-weight: 700; font-size: 0.96rem;
  box-shadow: 0 10px 26px rgba(109, 92, 255, 0.4);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(109, 92, 255, 0.55); }

/* ---------- Rows / section heads ---------- */
.row { margin: 30px 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.row-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.page-head { margin: 8px 0 22px; }
.page-head h1 { font-size: 1.9rem; letter-spacing: -0.02em; }
.page-head p { color: var(--text-dim); margin-top: 6px; }

/* ---------- Category chips ---------- */
.category-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 0.84rem; font-family: inherit;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(109,92,255,.35); }

/* ---------- Game grid + cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.game-card:hover { transform: translateY(-6px); border-color: transparent; box-shadow: var(--glow); }
.thumb { position: relative; aspect-ratio: 3/2; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.game-card:hover .thumb img { transform: scale(1.06); }
.badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 6px; color: #fff; text-transform: uppercase;
}
.badge-hot { background: var(--hot); box-shadow: 0 4px 12px rgba(255,77,109,.5); }
.badge-new { background: var(--new); color: #06281c; box-shadow: 0 4px 12px rgba(54,224,160,.5); }
.play-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle at center, rgba(11,14,26,.25), rgba(11,14,26,.6));
  opacity: 0; transition: opacity .18s;
}
.game-card:hover .play-overlay { opacity: 1; }
.play-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-grad); color: #fff; font-size: 1.1rem;
  padding-left: 3px;
  box-shadow: 0 8px 22px rgba(109,92,255,.6);
  transform: scale(.8); transition: transform .18s;
}
.game-card:hover .play-btn { transform: scale(1); }
.card-body { padding: 11px 13px 13px; }
.game-title { display: block; font-weight: 700; font-size: 0.94rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-cat { display: block; color: var(--text-faint); font-size: 0.78rem; margin-top: 2px; }

.no-results { text-align: center; color: var(--text-dim); padding: 48px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: 0.84rem; margin: 4px 0 18px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--accent-2); }
.breadcrumb .current { color: var(--text-dim); }

/* ---------- Game detail ---------- */
.game-stage { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.game-frame-wrap { position: relative; width: 100%; aspect-ratio: 4/3; max-height: 72vh; background: #05070f; }
.game-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.game-toolbar-title { display: flex; align-items: center; gap: 12px; }
.g-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-grad); box-shadow: 0 6px 16px rgba(109,92,255,.4); }
.game-toolbar-title strong { display: block; font-size: 0.98rem; }
.game-toolbar-title small { color: var(--text-faint); font-size: 0.8rem; }
.btn-ghost {
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 0.86rem; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--surface); }
.game-info { margin: 24px 0; }
.game-info h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 10px; }
.game-info p { color: var(--text-dim); max-width: 70ch; }
.tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; }

/* ---------- Content pages ---------- */
.content-page { max-width: 760px; margin: 8px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 36px; }
.content-page h1 { margin-bottom: 18px; letter-spacing: -0.02em; }
.content-page h2 { margin: 24px 0 8px; font-size: 1.15rem; }
.content-page p { margin-bottom: 12px; color: var(--text-dim); }
.content-page a { color: var(--accent-2); }
.content-page a:hover { text-decoration: underline; }

/* ---------- Ad slots ---------- */
.ad-slot { margin: 26px 0; text-align: center; min-height: 90px; }
.ad-placeholder {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-faint); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(255,255,255,0.015); padding: 28px;
}

/* ---------- Game guide (SEO content) ---------- */
.guide { margin: 28px 0; max-width: 760px; }
.guide h2 { font-size: 1.4rem; letter-spacing: -0.02em; margin-bottom: 12px; }
.guide h3 { font-size: 1.08rem; margin: 22px 0 10px; color: var(--text); }
.guide p { color: var(--text-dim); margin-bottom: 12px; }
.guide-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.guide-list li {
  position: relative; padding: 10px 14px 10px 38px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 0.92rem;
}
.guide-list li::before {
  content: "▸"; position: absolute; left: 14px; top: 10px; color: var(--accent-2); font-weight: 800;
}
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 16px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 13px 0; font-weight: 600; font-size: 0.95rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent-2); font-size: 1.3rem; font-weight: 700; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--text-dim); padding-bottom: 14px; margin: 0; font-size: 0.92rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border-soft); }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-nav a { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }
.footer-nav a:hover { color: var(--text); }
.copyright { color: var(--text-faint); font-size: 0.8rem; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300;
  max-width: 880px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 20px; box-shadow: var(--shadow);
}
.cookie-banner p { color: var(--text-dim); font-size: 0.88rem; flex: 1; min-width: 220px; margin: 0; }
.cookie-banner a { color: var(--accent-2); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-accept { padding: 10px 22px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 60px 20px; }
.notfound h1 { font-size: 5rem; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; }
.notfound h2 { font-size: 1.4rem; margin: 8px 0 12px; }
.notfound p { color: var(--text-dim); margin-bottom: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 150;
    height: calc(100vh - var(--topbar-h));
    background: var(--bg-2);
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0; z-index: 140; background: rgba(0,0,0,.5); }
  .content { padding: 20px 16px 36px; }
  .hero { flex-direction: column-reverse; align-items: flex-start; padding: 24px; }
  .hero-art { width: 100%; }
}
@media (max-width: 560px) {
  .logo-text { display: none; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .content-page { padding: 22px 18px; }
}
