:root {
  --bg: #1a1230;
  --panel: #251a42;
  --sidebar: #20163a;
  --text: #ffffff;
  --muted: #c9bfe6;
  --pink: #ff4fa3;
  --violet: #8b5cf6;
  --line: #3c2c63;
  --side-w: 232px;
  --top-h: 64px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding-top: var(--top-h);
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

button, input { font: inherit; }
img { max-width: 100%; }

a { color: var(--pink); }
a:hover { color: #ff8ac4; }

:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--panel);
  color: #fff;
}

.skip-link:focus { left: 12px; }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--top-h);
  z-index: 50;
  background: #17102b;
  border-bottom: 1px solid var(--line);
}

.topbar {
  height: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle,
.drawer-close {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: #fff;
  cursor: pointer;
}

.menu-toggle svg,
.drawer-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wordmark {
  flex: 0 0 auto;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--pink);
  background: linear-gradient(90deg, var(--pink), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark { color: var(--pink); background: none; -webkit-text-fill-color: currentColor; }
}

.search-wrap {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.search { position: relative; display: flex; align-items: center; }

.search input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 46px 0 16px;
  border: 1px solid #e6d9ff;
  border-radius: 999px;
  background: #f6f1ff;
  color: #211a34;
  font-size: 0.92rem;
  font-weight: 600;
}

.search input::placeholder { color: #6b5c86; }

.search-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  cursor: pointer;
}

.search-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}

.search-item:hover,
.search-item:focus { background: #38265f; color: #fff; }
.search-item img { width: 64px; height: 48px; border-radius: 6px; object-fit: cover; }
.search-empty { display: block; padding: 10px; color: var(--muted); }

.my-games-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
}

.my-games-btn:hover { border-color: var(--pink); color: #fff; }

.my-games-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--pink);
  stroke-width: 2;
  stroke-linejoin: round;
}

.sidebar {
  position: fixed;
  top: var(--top-h);
  bottom: 0;
  left: 0;
  z-index: 40;
  width: var(--side-w);
  padding: 14px 10px 24px;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.side-head { display: none; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
}

.side-link:hover { background: #302354; color: #fff; }
.side-link[aria-current="page"] { background: #38265f; box-shadow: inset 3px 0 0 var(--pink); }

.side-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #6d28d9;
  color: #fff;
}

.side-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i-home { background: #d81b60; }
.i-new { background: #7c3aed; }
.i-heart { background: #db2777; }
.i-dress-up { background: #be185d; }
.i-makeup-beauty { background: #c026d3; }
.i-cooking { background: #b45309; }
.i-pets-animals { background: #0f766e; }
.i-decorating { background: #1d4ed8; }
.i-princess { background: #9333ea; }
.i-baby-care { background: #0e7490; }
.i-puzzle-skill { background: #4f46e5; }

.side-brand {
  font-size: 1rem;
  font-weight: 800;
  color: var(--pink);
  background: linear-gradient(90deg, var(--pink), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.drawer-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(9, 5, 20, 0.74);
}

main { padding: 18px 20px 24px; }
.content { max-width: 1280px; margin: 0 auto; }

h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}

h2 { font-size: 1.15rem; line-height: 1.3; margin: 0; }
p { margin: 0 0 12px; }

.lead { color: var(--muted); max-width: 70ch; }

.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin: 0 0 18px;
}

.intro h1 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.intro p { margin: 0; font-size: 0.9rem; color: var(--muted); max-width: 75ch; }

.crumbs { margin-bottom: 12px; font-size: 0.85rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--pink); }

.featured { margin: 6px 0 26px; }

.mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.feature-card { grid-column: span 2; grid-row: span 2; }
.feature-card .card-title { font-size: 1.1rem; }

.row { margin: 24px 0 28px; }

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.row-actions { display: inline-flex; align-items: center; gap: 10px; }

.more {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.more:hover { border-color: var(--pink); color: var(--pink); }
.arrows { display: inline-flex; gap: 6px; }

.arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.arrow:hover { background: #7c3aed; }

.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar { display: none; }
.rail > .card { flex: 0 0 220px; scroll-snap-align: start; }
.rail > .card.small { flex-basis: 180px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--pink);
  box-shadow: 0 0 0 1px rgba(255, 79, 163, 0.35), 0 12px 26px rgba(0, 0, 0, 0.4);
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: #302354;
}

.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.badges { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 5px; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.badge-new { background: var(--pink); color: #1a1230; }
.badge-pick { background: #7c3aed; color: #fff; }

.card-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 8px 2px 1px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.card-cat {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.category-card {
  min-height: 110px;
  justify-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-align: center;
}

.cat-name { margin: 0 0 4px; color: #fff; font-size: 1.05rem; font-weight: 800; }
.empty { margin: 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); }

.game-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #120c22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.game-frame iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }

.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 12px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.game-bar h1 { margin: 0; font-size: 1.15rem; line-height: 1.3; overflow-wrap: anywhere; }
.game-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.fav-btn,
.fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.fav-btn { border: 1px solid var(--line); background: #38265f; color: #fff; }
.fav-btn:hover { border-color: var(--pink); }
.fav-heart { display: inline-flex; }
.fav-heart svg { width: 18px; height: 18px; fill: none; stroke: var(--pink); stroke-width: 2; stroke-linejoin: round; }
.fav-btn.saved { border-color: #7c3aed; background: #7c3aed; }
.fav-btn.saved .fav-heart svg { fill: #fff; stroke: #fff; }
.fullscreen { border: 1px solid var(--pink); background: var(--pink); color: #1a1230; }
.fullscreen:hover { filter: brightness(1.1); }

.story { max-width: 760px; }

.panel {
  margin: 14px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.panel h2 { margin: 0 0 8px; color: #fff; font-size: 1.05rem; }
.panel p { margin: 0; max-width: 75ch; color: var(--muted); overflow-wrap: anywhere; }
.panel ul { margin: 0; padding-left: 22px; color: var(--muted); }
.panel li { margin-bottom: 6px; }
.panel details { padding: 8px 0; border-top: 1px solid var(--line); }
.panel details:first-of-type { border-top: 0; }
.panel summary { cursor: pointer; color: #fff; font-weight: 800; }
.panel.meta p { font-size: 0.9rem; }
.panel.meta strong { color: #fff; }
.panel.meta a { color: #ff8ac4; }

.tag {
  display: inline-block;
  margin: 3px 4px 3px 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #38265f;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.tag:hover { background: #4a3479; color: #fff; }

.pagination { display: flex; gap: 10px; margin: 18px 0; }

.pagination a {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.seo-copy { margin: 34px 0 16px; color: var(--muted); max-width: 85ch; }
.seo-copy h2 { margin: 0 0 8px; color: #fff; font-size: 1rem; }
.seo-copy p { max-width: 85ch; }

.site-footer {
  max-width: 1400px;
  margin: 30px auto 0;
  padding: 20px 20px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); font-weight: 800; text-decoration: none; }
.site-footer a:hover { color: var(--pink); }

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  body { padding-left: var(--side-w); }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :root { --side-w: 76px; }
  .side-link { justify-content: center; padding: 8px 0; }
  .side-label { display: none; }
}

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1500px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .search-results {
    position: fixed;
    top: calc(var(--top-h) + 6px);
    left: 10px;
    right: 10px;
  }
  .menu-toggle { display: inline-grid; }
  .wordmark { font-size: 1rem; }
  .my-games-btn { padding: 8px; }
  .my-games-btn span { display: none; }
  .sidebar {
    top: 0;
    z-index: 70;
    width: 280px;
    max-width: 86vw;
    padding-top: 14px;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s ease;
  }
  body.drawer-open { overflow: hidden; }
  body.drawer-open .sidebar { transform: translateX(0); visibility: visible; }
  .side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding: 0 4px; }
  .drawer-close { display: inline-grid; }
  main { padding: 14px 12px 20px; }
  h1 { font-size: 1.5rem; }
  .row-head h2 { font-size: 1.05rem; }
  .more { padding: 6px 10px; font-size: 0.8rem; }
  .arrows { display: none; }
  .rail > .card { flex-basis: 160px; }
  .mosaic {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .mosaic::-webkit-scrollbar { display: none; }
  .mosaic > .card { flex: 0 0 200px; scroll-snap-align: start; }
  .feature-card .card-title { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (hover: none), (pointer: coarse) {
  .arrows { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
  .sidebar { transition: none; }
}
