/* ===========================================================================
   Netflix-style skin.  Overrides site.css without changing HTML structure.
   =========================================================================== */

:root {
  --nf-bg:        #141414;
  --nf-bg-elev:  #1f1f1f;
  --nf-bg-elev2: #2a2a2a;
  --nf-text:      #ffffff;
  --nf-muted:     #b3b3b3;
  --nf-red:       #e50914;
  --nf-red-hover: #f6121d;
  --nf-radius:    6px;
}

/* ---------- global ---------- */
html, body {
  background: var(--nf-bg);
  color: var(--nf-text);
}
html, body, input, button, textarea {
  font-family: 'Netflix Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
}
body { padding-bottom: 60px; }

.container {
  width: auto;
  max-width: 1600px;
  padding: 0 4vw;
}

a         { color: var(--nf-text); }
a:hover   { color: var(--nf-text); }

/* ---------- header ---------- */
header {
  padding: 12px 0 0;
  background: linear-gradient(180deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.65) 70%, rgba(0,0,0,.4) 100%);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
header .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "logo .    search"
    "menu menu menu";
  gap: 8px 12px;
  align-items: center;
}

/* desktop: all in one row */
@media (min-width: 900px) {
  header .container {
    grid-template-rows: auto;
    grid-template-areas: "logo menu search";
    gap: 16px 24px;
  }
}

header a.logo-box {
  grid-area: logo;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
header a.logo-box img.logo {
  width: 110px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.4));
}
@media (max-width: 500px) {
  header a.logo-box img.logo { width: 90px; }
}

/* menu */
header .menu-block {
  grid-area: menu;
  width: auto;
  min-width: 0;
}
header .menu-block .menu-row {
  display: flex;
  margin: 0;
  gap: 2px 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  white-space: nowrap;
  align-items: center;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
header .menu-block .menu-row::-webkit-scrollbar { display: none; }
header .menu-block .menu-row > a.menu-item { flex: 0 0 auto; }
header .menu-block a.menu-item {
  padding: 5px 10px;
  font-size: 13px;
  color: var(--nf-muted);
  letter-spacing: .2px;
  transition: color .15s ease, background .15s ease;
  text-decoration: none;
  border-radius: 4px;
}
header .menu-block a.menu-item:hover,
header .menu-block a.menu-item:focus {
  color: var(--nf-text);
  text-decoration: none;
  background: rgba(255,255,255,.08);
}

/* search */
header > .container > .search-box {
  grid-area: search;
  justify-self: end;
  width: auto;
  flex: 0 0 auto;
}
header > .container > .search-box form {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.55);
  border-radius: 4px;
  overflow: hidden;
}
header > .container > .search-box input {
  background: transparent;
  color: var(--nf-text);
  border: 0;
  padding: 6px 10px;
  width: 200px;
  max-width: 50vw;
  font-size: 13px;
  outline: none;
}
header > .container > .search-box input::placeholder { color: var(--nf-muted); }
header > .container > .search-box button {
  background: var(--nf-red);
  color: #fff;
  border: 0;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s ease;
}
header > .container > .search-box button:hover { background: var(--nf-red-hover); }

@media (max-width: 700px) {
  header > .container > .search-box input { width: 120px; }
}
@media (max-width: 500px) {
  header > .container > .search-box input { width: 100px; padding: 5px 8px; }
  header > .container > .search-box button { padding: 0 10px; }
  header .menu-block a.menu-item { font-size: 12px; padding: 4px 8px; }
}

/* ---------- main / categories ---------- */
main { padding: 10px 0 40px; }

/* 3-column layout: left rail | content | right rail */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (min-width: 1100px) {
  .page-layout { grid-template-columns: 180px minmax(0, 1fr) 180px; }
}
@media (min-width: 1500px) {
  .page-layout { grid-template-columns: 240px minmax(0, 1fr) 240px; }
}

.ad-rail { display: none; position: sticky; top: 90px; }
@media (min-width: 1100px) { .ad-rail { display: block; } }
.ad-rail .ad-slot { margin: 0; min-height: 600px; }
@media (min-width: 1100px) { .ad-slot--skyscraper { min-height: 600px; } }

.categories {
  display: flex;
  flex-direction: column;
  gap: 36px;
  min-width: 0;
}

/* Override site.css 3-column category grid — make each category a full-width row */
body.index-page .categories { display: flex; flex-direction: column; margin: 0; flex-wrap: nowrap; }
.category,
body.index-page .category,
body.index-page .category.nintendo { width: 100%; padding: 0; margin: 0; background: transparent; }
.category .category-box { background: transparent; border: 0; }

/* kill site.css decorations on category head */
.category .category-head {
  padding: 0;
  line-height: 1.2;
  background: transparent !important;
  font-family: inherit;
}
.category .category-head::before,
.category .category-head::after { content: none !important; display: none !important; }

.category-head {
  font-size: 20px;
  font-weight: 700;
  color: var(--nf-text);
  margin: 0 0 10px;
  padding: 0;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.category-head a {
  color: var(--nf-text);
  text-decoration: none;
  position: relative;
  padding-right: 22px;
  transition: color .2s ease;
}
.category-head a::after {
  content: "›";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-55%);
  color: var(--nf-red);
  font-size: 22px;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.category-head a:hover            { color: var(--nf-muted); }
.category-head a:hover::after     { opacity: 1; transform: translateY(-55%) translateX(4px); }

/* adaptive grid: card width 150–180px depending on screen */
.category .category-body,
.list-page .main-category .category-body {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 10px 0 18px;
  overflow: visible;
  justify-content: initial;
  flex-wrap: initial;
}
@media (min-width: 700px)  { .category .category-body { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .category .category-body { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; } }

/* ---------- game card ---------- */
a.game-link,
.game-link {
  width: auto !important;
  height: auto !important;
  flex: initial;
  display: block;
  color: var(--nf-text);
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
  border-radius: var(--nf-radius);
  overflow: hidden;
  background: var(--nf-bg-elev);
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  margin: 0 !important;
}

.game-link:hover {
  transform: scale(1.08);
  z-index: 3;
  box-shadow: 0 10px 30px rgba(0,0,0,.6), 0 0 0 2px rgba(255,255,255,.08);
  transition: transform .25s ease, box-shadow .25s ease;
}

a.game-link .game-preview,
.game-preview {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #000;
  background-repeat: no-repeat;
  position: relative;
}
.game-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.85) 100%);
  opacity: 0;
  transition: opacity .25s ease;
}
.game-link:hover .game-preview::after { opacity: 1; }

a.game-link span.game-name,
.game-name {
  display: block;
  padding: 8px 10px 10px !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3 !important;
  color: var(--nf-text) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent !important;
  text-align: left !important;
  width: 100% !important;
}

/* ---------- pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0 4px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--nf-muted);
  background: var(--nf-bg-elev);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.pagination a:hover { background: var(--nf-bg-elev2); color: var(--nf-text); }
.pagination .link_active {
  background: var(--nf-red);
  color: #fff;
}
.pagination i { color: var(--nf-muted); font-style: normal; padding: 0 4px; align-self: center; }

/* ---------- list page ---------- */
body.list-page main .container { display: block !important; }
body.list-page .main-category,
body.list-page .other-categories { width: 100% !important; margin: 0 !important; }
body.list-page .page-center { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
body.list-page .other-categories {
  margin-top: 20px !important;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- ad slots ---------- */
.ad-slot {
  position: relative;
  width: 100%;
  margin: 24px 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.02),
    rgba(255,255,255,.02) 10px,
    rgba(255,255,255,.04) 10px,
    rgba(255,255,255,.04) 20px
  );
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: var(--nf-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.35);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  overflow: hidden;
}
.ad-slot::before { content: "Advertisement"; }
.ad-slot > *      { position: relative; z-index: 1; }
.ad-slot:has(ins) { background: none; border: none; }
.ad-slot:has(ins)::before { content: none; }

.ad-slot--leaderboard { min-height: 90px;  }
.ad-slot--billboard   { min-height: 250px; }
.ad-slot--inline      { min-height: 120px; }
.ad-slot--footer      { min-height: 90px;  margin-bottom: 0; }

@media (max-width: 900px) {
  .ad-slot--billboard { min-height: 180px; }
}

/* ---------- footer ---------- */
footer {
  background: #0b0b0b;
  padding: 40px 0 30px;
  margin-top: 60px;
  color: var(--nf-muted);
}
footer .container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
footer a { color: var(--nf-muted); text-decoration: none; }
footer a:hover { color: var(--nf-text); text-decoration: underline; }
footer .footer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
}
footer .footer-head a.logo-box img.logo { width: 110px; height: auto; }
footer .footer-head .menu-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
footer .footer-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  font-size: 12px;
  line-height: 1.6;
}
footer .footer-body h3 {
  color: var(--nf-text);
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
footer .footer-body a { display: block; margin: 4px 0; }

/* ---------- game-page tweaks ---------- */
.game-page .game-container h1 {
  font-size: 26px;
  margin: 16px 0 14px;
}
.game-page .game-box iframe { background: #000; border-radius: var(--nf-radius); }
.game-page .keymap-box,
.game-page .game-description {
  background: var(--nf-bg-elev);
  padding: 14px 18px;
  border-radius: var(--nf-radius);
  margin: 16px 0;
  line-height: 1.6;
  color: var(--nf-muted);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .container { padding: 0 4vw; }
  header .container { gap: 14px; }
  header a.logo-box img.logo { width: 100px; }
  .game-link { width: 180px; }
  .category-head { font-size: 17px; }
}
@media (max-width: 560px) {
  .game-link { width: 150px; }
  header .menu-block .menu-row { gap: 6px 10px; }
  header .menu-block a.menu-item { font-size: 12px; padding: 3px 6px; }
}

/* =========================================================================
   Theme system — dark is default, light applied via [data-theme="light"]
   ========================================================================= */

:root[data-theme="light"] {
  --nf-bg:       #ffffff;
  --nf-bg-elev:  #f3f3f3;
  --nf-bg-elev2: #e6e6e6;
  --nf-text:     #141414;
  --nf-muted:    #555555;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

:root[data-theme="light"] header {
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.85) 70%, rgba(255,255,255,.72) 100%);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
:root[data-theme="light"] header .menu-block a.menu-item:hover,
:root[data-theme="light"] header .menu-block a.menu-item:focus {
  background: rgba(0,0,0,.06);
  color: var(--nf-text);
}
:root[data-theme="light"] header > .container > .search-box form {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.15);
}
:root[data-theme="light"] footer {
  background: #ffffff;
  color: #555;
  border-top: 1px solid rgba(0,0,0,.08);
}
:root[data-theme="light"] footer .footer-head {
  background: #f5f5f5;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
:root[data-theme="light"] footer .footer-head .menu-title { color: #141414; }
:root[data-theme="light"] footer .footer-head .tagline { color: #555; }
:root[data-theme="light"] footer .footer-head a.menu-item { color: #333; }
:root[data-theme="light"] footer .footer-head a.menu-item:hover { color: var(--nf-red); }
:root[data-theme="light"] footer .footer-body {
  background: #ffffff;
  color: #141414;
  border-color: rgba(0,0,0,.08);
}
:root[data-theme="light"] footer .footer-body a { color: #141414; }

/* Header grid: add a slot for the toggle */
header .container {
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas:
    "logo .    search toggle"
    "menu menu menu   menu";
}
@media (min-width: 900px) {
  header .container {
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "logo menu search toggle";
  }
}

/* Theme toggle button */
header > .container > .theme-toggle {
  grid-area: toggle;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: var(--nf-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  justify-self: end;
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
header > .container > .theme-toggle:hover {
  background: rgba(255,255,255,.16);
  border-color: var(--nf-red);
  color: var(--nf-red);
  transform: rotate(15deg);
}
header > .container > .theme-toggle .theme-icon { width: 14px; height: 14px; }
header > .container > .theme-toggle .icon-sun { display: block; }
header > .container > .theme-toggle .icon-moon { display: none; }

:root[data-theme="light"] header > .container > .theme-toggle {
  border-color: rgba(0,0,0,.15);
  background: rgba(0,0,0,.04);
}
:root[data-theme="light"] header > .container > .theme-toggle:hover {
  background: rgba(0,0,0,.08);
}
:root[data-theme="light"] header > .container > .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] header > .container > .theme-toggle .icon-moon { display: block; }
