[hidden] { display: none !important; }

/* ZenouMath interface, revision 3.
 *
 * A monochrome reading of the reference layout: one compact top bar, a narrow
 * content column, pill navigation and search, square game artwork and text
 * labels underneath. Proportions are taken from the reference at 736px and
 * 1080px (48px search, 7.5rem game tiles, 12px gaps, 16px card radius) but the
 * palette stays black and grey instead of the reference violet.
 *
 * Loaded last so it settles the older page styles without rewriting them.
 */

:root {
  --zn-bg: #08090a;
  --zn-bg-2: #0b0d0e;
  --zn-surface: #101214;
  --zn-surface-2: #15181a;
  --zn-line: rgba(255, 255, 255, .10);
  --zn-line-strong: rgba(255, 255, 255, .22);
  --zn-text: #f1f2f3;
  --zn-muted: #a3a8ad;
  --zn-dim: #7c8187;
  --zn-ok: #59c07a;
  --zn-warn: #d5b25c;
  --zn-bad: #d97272;
  --zn-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --zn-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --zn-shell: 1120px;
  --zn-radius: 12px;
  --zn-ease: cubic-bezier(.2, .7, .3, 1);
}

html:has(.za-rail),
html[data-site-masthead] {
  --za-canvas: var(--zn-bg);
  --za-nav: #0c0e0f;
  --za-panel: var(--zn-surface);
  --za-line: var(--zn-line);
  --za-frost: #101214;
  --za-frost-fill: #101214;
  --za-frost-field: #ffffff08;
  --za-frost-edge: inset 0 1px #ffffff0d;
  --za-frost-shadow: 0 18px 40px #00000066;
  --za-tone: #e9eaeb;
  --za-tone-deep: #8a8f94;
  --za-ambient: var(--zn-bg);
  --za-radius: var(--zn-radius);
  --bg: var(--zn-bg);
  --bg-soft: var(--zn-bg-2);
  --surface: var(--zn-surface);
  --surface-solid: var(--zn-surface);
  --surface-2: var(--zn-surface-2);
  --panel: var(--zn-surface);
  --panel-2: var(--zn-surface-2);
  --line: var(--zn-line);
  --line-strong: var(--zn-line-strong);
  --text: var(--zn-text);
  --muted: var(--zn-muted);
  --muted-2: var(--zn-dim);
  --za-glow: 0;
  --za-bloom: 0px;
  --glow-a: 0;
  --glow-b: 0px;
  background: var(--zn-bg);
  background-attachment: fixed;
  color-scheme: dark;
}

html[data-site-masthead] body:has(> .za-rail),
html[data-site-masthead] body[data-arcade-page],
html[data-site-masthead] body.arcade-discover {
  background: var(--zn-bg);
  color: var(--zn-text);
  font-family: var(--zn-sans);
}

/* Remove the old ambient and glow washes: the reference is flat. */
body:has(> .za-rail)::after,
body:has(> .za-rail)::before,
body > .atmo { display: none !important; }

/* ---------------------------------------------------------------- masthead */

html[data-site-masthead] {
  --masthead-height: 56px;
  scroll-padding-top: 72px;
}

html[data-site-masthead] .site-masthead {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: var(--masthead-height);
  padding: 0 20px;
  border: 0;
  border-bottom: 1px solid var(--zn-line);
  background: rgba(8, 9, 10, .92);
  box-shadow: none;
  backdrop-filter: blur(14px) saturate(1.1);
}

.site-masthead .za-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: auto;
  padding: 0;
  margin: 0 auto 0 0;
  color: var(--zn-text);
  font: 700 16px/1 var(--zn-mono);
  letter-spacing: -.02em;
}

.site-masthead .za-brand .za-mark {
  width: 27px;
  height: 27px;
  margin: 0;
  border-radius: 7px;
  box-shadow: none;
}

.masthead-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
}

.masthead-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--zn-muted);
  font: 600 12.5px/1 var(--zn-mono);
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s var(--zn-ease), background-color .18s var(--zn-ease);
}

.masthead-links a:hover { color: var(--zn-text); background: #ffffff0a; }

.masthead-links a[aria-current=page] {
  color: #08090a;
  background: #e9eaeb;
  border-color: transparent;
}

.masthead-links svg { width: 14px; height: 14px; opacity: .75; }
.masthead-links a[aria-current=page] svg { opacity: 1; }

.site-masthead :is(.settings-btn, .sidebar-toggle, .quick-launch) {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  height: 34px;
  min-height: 0;
  margin: 0;
  padding: 0 11px;
  border: 1px solid var(--zn-line);
  border-radius: 999px;
  background: transparent;
  color: var(--zn-text);
  box-shadow: none;
  font: 600 12px/1 var(--zn-mono);
  cursor: pointer;
}

.site-masthead :is(.settings-btn, .sidebar-toggle) { width: 34px; padding: 0; }
.site-masthead :is(.settings-btn, .sidebar-toggle, .quick-launch):hover {
  border-color: var(--zn-line-strong);
  background: #ffffff0a;
}
.site-masthead .quick-launch kbd {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid var(--zn-line);
  border-radius: 4px;
  color: var(--zn-dim);
  font: 500 10px/1 var(--zn-mono);
}
.site-masthead .quick-launch svg { width: 14px; height: 14px; }

html[data-site-masthead] .za-rail { display: none; }

/* ------------------------------------------------------------- page shell */

.zn-main {
  width: 100%;
  max-width: var(--zn-shell);
  margin: 0 auto;
  padding: 26px 20px 60px;
}

html[data-site-masthead] body[data-arcade-page] > main.zn-main,
html[data-site-masthead] body.arcade-discover > main.zn-main {
  max-width: var(--zn-shell);
  padding: 26px 20px 60px;
  margin: 0 auto;
}

.zn-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.zn-page-head h1 {
  margin: 0;
  color: var(--zn-text);
  font: 700 clamp(25px, 3vw, 30px)/1.15 var(--zn-mono);
  letter-spacing: -.035em;
}

.zn-page-meta {
  margin: 7px 0 0;
  color: var(--zn-dim);
  font: 400 12.5px/1.5 var(--zn-mono);
}

.zn-page-meta a { color: var(--zn-muted); text-decoration: underline; text-underline-offset: 3px; }
.zn-page-meta a:hover { color: var(--zn-text); }
.zn-page-head .zn-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.zn-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 26px;
}

.zn-search > svg {
  position: absolute;
  left: 17px;
  width: 15px;
  height: 15px;
  color: var(--zn-dim);
  pointer-events: none;
}

.zn-search input {
  width: 100%;
  height: 48px;
  padding: 0 52px 0 42px;
  border: 1px solid var(--zn-line);
  border-radius: 999px;
  background: #0d0f10;
  color: var(--zn-text);
  font: 400 13.5px/1 var(--zn-mono);
  text-align: left;
  outline: none;
  transition: border-color .18s var(--zn-ease);
}

.zn-search input::placeholder { color: var(--zn-dim); }
.zn-search input:focus { border-color: var(--zn-line-strong); }

.zn-search kbd {
  position: absolute;
  right: 14px;
  padding: 3px 6px;
  border: 1px solid var(--zn-line);
  border-radius: 5px;
  color: var(--zn-dim);
  font: 500 10px/1 var(--zn-mono);
}

/* ---------------------------------------------------------------- sections */

.zn-section { margin: 0 0 30px; }

.zn-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 13px;
}

.zn-section-head h2 {
  flex: 1;
  margin: 0;
  color: var(--zn-text);
  font: 700 17px/1.3 var(--zn-mono);
  letter-spacing: -.02em;
  text-align: center;
}

.zn-section-head .zn-side {
  flex: none;
  width: 110px;
  color: var(--zn-dim);
  font: 500 11.5px/1.4 var(--zn-mono);
  text-align: right;
}

.zn-section-head .zn-side:first-child { text-align: left; }
.zn-section-head .zn-side a { color: inherit; text-decoration: none; }
.zn-section-head .zn-side a:hover { color: var(--zn-text); }

/* ---------------------------------------------------------- website cards */

.zn-sites {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 142px));
  justify-content: center;
  gap: 16px;
}

.zn-site {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--zn-line);
  border-radius: var(--zn-radius);
  background: #0e1011;
  color: var(--zn-text);
  text-decoration: none;
  transition: transform .18s var(--zn-ease), border-color .18s var(--zn-ease);
}

.zn-site:hover,
.zn-site:focus-visible {
  transform: translateY(-2px);
  border-color: var(--zn-line-strong);
  color: var(--zn-text);
}

.zn-site-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #ffffff0d;
  border-radius: 8px;
  background: #f2f2f0;
}

.zn-site-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.zn-site-art .zn-glyph {
  color: #0b0c0d;
  font: 700 30px/1 var(--zn-mono);
  letter-spacing: -.04em;
}

.zn-site-name {
  display: -webkit-box;
  min-height: 2.5em;
  padding: 0 1px 1px;
  overflow: hidden;
  color: var(--zn-muted);
  font: 500 12px/1.25 var(--zn-mono);
  text-align: center;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.zn-site:hover .zn-site-name { color: var(--zn-text); }

.zn-site-dot {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa0a6;
  box-shadow: 0 0 0 2px #0e1011;
}

.zn-site-dot[data-frame=allowed],
.zn-site-dot[data-frame=internal] { background: var(--zn-ok); }
.zn-site-dot[data-frame=denied] { background: var(--zn-warn); }
.zn-site-dot[data-frame=unknown] { background: #8b9096; }

/* ------------------------------------------------------------- game grid */

.zn-games,
#grid.zn-games,
#recentGrid.zn-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 14px 12px;
  margin: 0;
}

.zn-game-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}

.zn-game {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--zn-line);
  border-radius: var(--zn-radius);
  background: #0e1011;
  color: var(--zn-text);
  text-decoration: none;
  content-visibility: auto;
  contain-intrinsic-size: auto 11rem;
  transition: transform .16s var(--zn-ease), border-color .16s var(--zn-ease);
}

.zn-game:hover,
.zn-game:focus-visible {
  transform: translateY(-2px);
  border-color: var(--zn-line-strong);
  color: var(--zn-text);
}

.zn-game-art {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: #171a1c;
}

.zn-game-art > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zn-game-art > .zn-glyph-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #cfd3d7;
  font: 700 22px/1 var(--zn-mono);
  letter-spacing: -.03em;
}

.zn-game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(5, 6, 7, .58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s var(--zn-ease);
}

.zn-game:hover .zn-game-overlay,
.zn-game:focus-visible .zn-game-overlay { opacity: 1; }

.zn-game-overlay .zn-play {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f2f3;
  color: #08090a;
  font: 700 11.5px/1 var(--zn-mono);
}

.zn-game-overlay .zn-play svg { width: 11px; height: 11px; fill: currentColor; }

.zn-game-name {
  display: -webkit-box;
  min-height: 2.6em;
  padding: 8px 2px 2px;
  overflow: hidden;
  color: var(--zn-muted);
  font: 500 12.5px/1.3 var(--zn-mono);
  text-align: center;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.zn-game:hover .zn-game-name { color: var(--zn-text); }

.zn-game-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 3px 6px;
  border: 1px solid #ffffff1f;
  border-radius: 4px;
  background: rgba(8, 9, 10, .78);
  color: #c9cdd1;
  font: 600 8.5px/1.2 var(--zn-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.zn-game-badge[data-kind=external] { color: #e0c27c; }
.zn-game-badge[data-kind=unavailable] { color: #e09b9b; }

.zn-game-wrap .zn-game { width: 100%; }

.zn-queue {
  position: absolute;
  top: 10px;
  right: 62px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #ffffff1f;
  border-radius: 6px;
  background: rgba(8, 9, 10, .84);
  color: #e6e8ea;
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s var(--zn-ease);
}

.zn-game-wrap:hover .zn-queue,
.zn-game-wrap:focus-within .zn-queue { opacity: 1; }
.zn-queue svg { width: 12px; height: 12px; fill: currentColor; }
.zn-queue[aria-pressed=true] { color: #f1d79a; }

.zn-card-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .16s var(--zn-ease);
}

.zn-game:hover .zn-card-tools,
.zn-game:focus-within .zn-card-tools { opacity: 1; }

.zn-card-tools button {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #ffffff1f;
  border-radius: 6px;
  background: rgba(8, 9, 10, .84);
  color: #e6e8ea;
  cursor: pointer;
}

.zn-card-tools button:hover { background: #1d2023; }
.zn-card-tools button[aria-pressed=true] { color: #f3b3b3; }
.zn-card-tools svg { width: 12px; height: 12px; fill: currentColor; }

/* Four layouts, switched in place by html[data-game-layout]. */
html[data-game-layout=compact] #grid.zn-games,
html[data-game-layout=compact] #recentGrid.zn-games,
html[data-game-layout=compact] .zn-related .zn-games {
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 10px 9px;
}
html[data-game-layout=compact] .zn-game { padding: 5px; border-radius: 10px; }
html[data-game-layout=compact] .zn-game-name { font-size: 11px; padding-top: 6px; }

html[data-game-layout=large] #grid.zn-games,
html[data-game-layout=large] #recentGrid.zn-games,
html[data-game-layout=large] .zn-related .zn-games {
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 18px 14px;
}
html[data-game-layout=large] .zn-game { padding: 9px; }
html[data-game-layout=large] .zn-game-name { font-size: 13.5px; }

html[data-game-layout=list] #grid.zn-games,
html[data-game-layout=list] #recentGrid.zn-games,
html[data-game-layout=list] .zn-related .zn-games { display: flex; flex-direction: column; gap: 6px; }
html[data-game-layout=list] .zn-game {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-radius: 9px;
}
html[data-game-layout=list] .zn-game-art { flex: none; width: 54px; height: 54px; aspect-ratio: auto; }
html[data-game-layout=list] .zn-game-name {
  min-height: 0;
  padding: 0;
  font-size: 13px;
  text-align: left;
  -webkit-line-clamp: 1;
}
html[data-game-layout=list] .zn-game-overlay {
  inset: 6px auto 6px 6px;
  width: 54px;
  padding: 0;
}
html[data-game-layout=list] .zn-game-overlay .zn-play { min-height: 0; padding: 5px 8px; font-size: 9px; }
html[data-game-layout=list] .zn-card-tools { top: 50%; right: 8px; transform: translateY(-50%); }
html[data-game-layout=list] .zn-game-badge { display: none; }

/* ------------------------------------------------------------------ tools */

.zn-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
}

.zn-chips {
  display: flex;
  gap: 5px;
  max-width: 100%;
  overflow-x: auto;
  padding: 1px;
  scrollbar-width: none;
}
.zn-chips::-webkit-scrollbar { display: none; }

.zn-chip {
  flex: none;
  height: 31px;
  padding: 0 12px;
  border: 1px solid var(--zn-line);
  border-radius: 999px;
  background: transparent;
  color: var(--zn-muted);
  font: 600 11.5px/1 var(--zn-mono);
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s var(--zn-ease), background-color .16s var(--zn-ease), border-color .16s var(--zn-ease);
}

.zn-chip:hover { color: var(--zn-text); border-color: var(--zn-line-strong); }
.zn-chip[aria-pressed=true] { background: #e9eaeb; border-color: transparent; color: #08090a; }

.zn-tools-right { display: flex; align-items: center; gap: 7px; flex: none; }

.zn-seg {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--zn-line);
  border-radius: 7px;
}

.zn-seg button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 29px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--zn-line);
  background: transparent;
  color: var(--zn-dim);
  cursor: pointer;
}

.zn-seg button:last-child { border-right: 0; }
.zn-seg button:hover { color: var(--zn-text); background: #ffffff08; }
.zn-seg button[aria-pressed=true] { background: #e9eaeb; color: #08090a; }
.zn-seg svg { width: 13px; height: 13px; fill: currentColor; }

.zn-select {
  height: 31px;
  padding: 0 24px 0 9px;
  border: 1px solid var(--zn-line);
  border-radius: 7px;
  background: #0d0f10;
  color: var(--zn-muted);
  font: 600 11.5px/1 var(--zn-mono);
  cursor: pointer;
}

.zn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--zn-line);
  border-radius: 8px;
  background: transparent;
  color: var(--zn-text);
  font: 600 12px/1.2 var(--zn-mono);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .16s var(--zn-ease), background-color .16s var(--zn-ease);
}

.zn-btn:hover { border-color: var(--zn-line-strong); background: #ffffff08; color: var(--zn-text); }
.zn-btn svg { width: 13px; height: 13px; }
.zn-btn-solid { border-color: transparent; background: #e9eaeb; color: #08090a; }
.zn-btn-solid:hover { background: #fff; color: #08090a; }

.zn-more {
  display: flex;
  justify-content: center;
  margin: 24px 0 0;
}

.zn-empty {
  padding: 34px 18px;
  border: 1px dashed var(--zn-line);
  border-radius: var(--zn-radius);
  color: var(--zn-muted);
  font: 400 13px/1.6 var(--zn-mono);
  text-align: center;
}
.zn-empty p { margin: 0 0 12px; }

.zn-status {
  margin: 0 0 14px;
  color: var(--zn-dim);
  font: 400 12px/1.5 var(--zn-mono);
  text-align: center;
}

.zn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff24;
  border-top-color: #f1f2f3;
  border-radius: 50%;
  animation: zn-spin .7s linear infinite;
}

@keyframes zn-spin { to { transform: rotate(360deg); } }

@media (hover: none) {
  .zn-card-tools,
  .zn-queue,
  .zn-dir-fav { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .zn-game, .zn-site, .zn-site-art img, .zn-game-overlay, .zn-spinner { transition: none; animation: none; }
}
html[data-motion=calm] .zn-game,
html[data-motion=calm] .zn-site,
html[data-motion=calm] .zn-game-overlay,
html[data-motion=calm] .zn-spinner { transition: none; animation: none; }

/* -------------------------------------------------------- website directory */

.zn-dir-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
}

.zn-dir-head .zn-chip { height: 32px; }

.zn-dirbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
}

.zn-dirgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 16px 12px;
}

.zn-launch { display: flex; align-items: center; gap: 7px; margin: 0; }
.zn-launch > span { color: var(--zn-dim); font: 500 10.5px/1 var(--zn-mono); text-transform: uppercase; letter-spacing: .06em; }
.zn-tools-right { margin-left: auto; }

.zn-dir-card {
  position: relative;
  display: flex;
  min-width: 0;
}

.zn-site-label {
  display: inline-flex;
  align-self: center;
  padding: 3px 6px;
  border: 1px solid #ffffff2e;
  border-radius: 5px;
  background: #ffffff0d;
  color: #eef0f1;
  font: 700 8px/1 var(--zn-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.zn-dir-card .zn-site {
  flex: 1;
  width: 100%;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.zn-dir-card .zn-site-art { padding: 16px; }
.zn-dir-card .zn-site-art .zn-glyph { font-size: 24px; }
.zn-dir-card .zn-site-name { min-height: 2.6em; }

.zn-dir-fav {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #ffffff2e;
  border-radius: 6px;
  background: rgba(8, 9, 10, .7);
  color: #eef0f1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s var(--zn-ease), color .16s var(--zn-ease);
}

.zn-dir-card:hover .zn-dir-fav,
.zn-dir-fav:focus-visible,
.zn-dir-fav[aria-pressed=true] { opacity: 1; }
.zn-dir-fav[aria-pressed=true] { color: #f2b4b4; }
.zn-dir-fav svg { width: 11px; height: 11px; fill: currentColor; }

.zn-dirgrid[data-view=list] .zn-dir-card { border: 0; }
.zn-dirgrid[data-view=list] .zn-dir-fav { top: 50%; right: 10px; transform: translateY(-50%); }
.zn-dirgrid[data-view=list] .zn-site-note { display: block; }
.zn-dirgrid[data-view=list] .zn-site-name { flex: none; }

.zn-dirgrid[data-view=list] { display: flex; flex-direction: column; gap: 7px; }

.zn-dirgrid[data-view=list] .zn-site {
  flex-direction: row;
  align-items: center;
  gap: 13px;
  padding: 7px 44px 7px 7px;
  text-align: left;
}

.zn-dirgrid[data-view=list] .zn-site-art {
  flex: none;
  width: 48px;
  height: 48px;
  aspect-ratio: auto;
  padding: 8px;
}

.zn-dirgrid[data-view=list] .zn-site-art .zn-glyph { font-size: 17px; }
.zn-dirgrid[data-view=list] .zn-site-dot { position: static; flex: none; box-shadow: none; }
.zn-dirgrid[data-view=list] .zn-site-name {
  min-height: 0;
  padding: 0;
  font-size: 12.5px;
  text-align: left;
  -webkit-line-clamp: 1;
}
.zn-dirgrid[data-view=list] .zn-site-note { display: block; }

.zn-site-note {
  display: none;
  margin-left: auto;
  padding-right: 8px;
  color: var(--zn-dim);
  font: 400 11.5px/1.4 var(--zn-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zn-recents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
}

.zn-recents button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--zn-line);
  border-radius: 999px;
  background: transparent;
  color: var(--zn-muted);
  font: 500 11px/1 var(--zn-mono);
  cursor: pointer;
}

.zn-recents button:hover { color: var(--zn-text); border-color: var(--zn-line-strong); }
.zn-recents img { width: 14px; height: 14px; object-fit: contain; border-radius: 3px; }

.zn-dir-note {
  margin: 30px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--zn-line);
  color: var(--zn-dim);
  font: 400 12px/1.7 var(--zn-mono);
}
.zn-dir-note a { color: var(--zn-muted); }

/* viewer */
.zn-viewer {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  height: min(820px, calc(100dvh - 40px));
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--zn-line-strong);
  border-radius: 14px;
  background: #0b0d0e;
  color: var(--zn-text);
  box-shadow: 0 30px 90px #000000b8;
}

.zn-viewer::backdrop { background: rgba(4, 5, 6, .82); backdrop-filter: blur(4px); }

.zn-viewer-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 8px;
  border-bottom: 1px solid var(--zn-line);
  background: #0e1011;
}

.zn-viewer-bar .zn-iconbtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--zn-muted);
  cursor: pointer;
}

.zn-viewer-bar .zn-iconbtn:hover { color: var(--zn-text); background: #ffffff0a; }
.zn-viewer-bar .zn-iconbtn svg { width: 15px; height: 15px; fill: currentColor; }
.zn-viewer-bar .zn-iconbtn[hidden] { display: none; }

.zn-viewer-address {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--zn-line);
  border-radius: 7px;
  color: var(--zn-muted);
  font: 400 11.5px/1 var(--zn-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zn-viewer-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
  color: var(--zn-muted);
  font: 500 12px/1 var(--zn-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zn-viewer-title img { width: 16px; height: 16px; object-fit: contain; border-radius: 3px; }

.zn-viewer-stage { position: relative; height: calc(100% - 84px); background: #050607; }
.zn-viewer-loading[hidden],
.zn-viewer-blocked[hidden] { display: none !important; }
.zn-viewer-stage iframe { width: 100%; height: 100%; border: 0; background: #050607; }

.zn-viewer-loading,
.zn-viewer-blocked {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0b0d0e;
}

.zn-viewer-state {
  width: min(440px, 100%);
  text-align: center;
}

.zn-viewer-state .zn-spinner { margin: 0 auto 14px; }
.zn-viewer-state h2 {
  margin: 0 0 8px;
  color: var(--zn-text);
  font: 700 18px/1.3 var(--zn-mono);
}
.zn-viewer-state p {
  margin: 0 0 18px;
  color: var(--zn-muted);
  font: 400 13px/1.65 var(--zn-sans);
}
.zn-viewer-state .zn-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }

.zn-viewer-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border-top: 1px solid var(--zn-line);
  background: #0e1011;
  color: var(--zn-dim);
  font: 400 10.5px/1.3 var(--zn-mono);
  white-space: nowrap;
  overflow: hidden;
}

.zn-viewer-foot span { overflow: hidden; text-overflow: ellipsis; }
.zn-viewer-foot a { margin-left: auto; color: var(--zn-muted); }
.zn-viewer-foot a:hover { color: var(--zn-text); }

@media (max-width: 700px) {
  .zn-viewer { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; margin: 0; }
  .zn-viewer-stage { height: calc(100% - 84px); }
}

.zn-dialog {
  width: min(560px, calc(100vw - 28px));
  max-width: none;
  max-height: min(80dvh, 640px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--zn-line-strong);
  border-radius: 12px;
  background: #0c0e0f;
  color: var(--zn-text);
  box-shadow: 0 28px 80px #000000b8;
}
.zn-dialog::backdrop { background: rgba(4, 5, 6, .78); }
.zn-dialog .zn-viewer-bar { height: 46px; }

/* ------------------------------------------------------------- game player */

body.play-body > main.zn-main { padding: 18px 20px 46px; }

.zn-player-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.zn-player-head .zn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--zn-dim);
  font: 500 11.5px/1 var(--zn-mono);
  text-decoration: none;
}
.zn-player-head .zn-back:hover { color: var(--zn-text); }

.zn-player-head h1 {
  margin: 0;
  font: 700 clamp(22px, 3vw, 28px)/1.2 var(--zn-mono);
  letter-spacing: -.03em;
}

.zn-player-head .game-meta {
  margin: 5px 0 0;
  color: var(--zn-dim);
  font: 400 12px/1.5 var(--zn-mono);
}

.zn-player-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.play-main .player-stage,
.zn-player-stage {
  margin: 0;
  border: 1px solid var(--zn-line);
  border-radius: var(--zn-radius);
  background: #050607;
  overflow: hidden;
}

.zn-player-stage .frame-wrap {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 66vh;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0;
  background: #050607;
}

body[data-arcade-page=play] .zn-player-stage .frame-tall {
  aspect-ratio: 4 / 3;
  max-height: 64vh;
  min-height: 0;
}

.zn-player-stage .stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 10px;
  border-top: 1px solid var(--zn-line);
  background: #0e1011;
}

.zn-player-stage .stage-toolbar > p {
  flex: 1;
  margin: 0;
  color: var(--zn-dim);
  font: 400 11.5px/1.4 var(--zn-mono);
}

.zn-player-stage .player-actions { gap: 6px; }

.zn-player-stage .btn {
  min-height: 31px;
  padding: 6px 10px;
  border-radius: 7px;
  font: 600 11.5px/1.2 var(--zn-mono);
}

.zn-player-stage #startGame {
  position: absolute;
  inset: 0;
  transform: none;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 45%, #191c1f, #08090a 70%);
  color: transparent;
  font-size: 0;
  cursor: pointer;
}
.zn-player-stage #startGame::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border: 1px solid var(--zn-line-strong);
  border-radius: 50%;
  background: #ffffff0a;
}
.zn-player-stage #startGame::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -7px 0 0 -3px;
  border-left: 11px solid #f1f2f3;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.zn-player-stage .loading {
  display: grid;
  place-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  color: var(--zn-muted);
  font: 400 12px/1.5 var(--zn-mono);
}
.zn-player-stage .loading .game-spinner { border: 2px solid #ffffff24; border-top-color: #f1f2f3; }

.zn-info {
  margin: 16px 0 0;
  border: 1px solid var(--zn-line);
  border-radius: var(--zn-radius);
  background: #0e1011;
}

.zn-info .game-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.zn-info .game-info-title {
  margin: 0 0 8px;
  color: var(--zn-text);
  font: 700 15px/1.3 var(--zn-mono);
}

.zn-info .game-desc { margin: 0 0 12px; color: var(--zn-muted); font: 400 13px/1.7 var(--zn-sans); }
.zn-info .cat-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.zn-info .cat-tags a {
  padding: 4px 8px;
  border: 1px solid var(--zn-line);
  border-radius: 999px;
  color: var(--zn-muted);
  font: 500 10.5px/1 var(--zn-mono);
  text-decoration: none;
}
.zn-info .play-side-card { padding: 0; border: 0; background: transparent; }
.zn-info .play-side-card h3 { margin: 0 0 9px; color: var(--zn-text); font: 700 12px/1.3 var(--zn-mono); }
.zn-info .game-source { margin: 12px 0 0; color: var(--zn-dim); font: 400 10.5px/1.6 var(--zn-mono); }

.zn-related { margin: 26px 0 0; }
.zn-related h2 { margin: 0 0 12px; font: 700 16px/1.3 var(--zn-mono); }
.zn-related .zn-games { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }

.zn-related .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px 10px;
  margin: 0;
}

.zn-related .card {
  padding: 6px;
  border: 1px solid var(--zn-line);
  border-radius: 10px;
  background: #0e1011;
}
.zn-related .card-thumb,
.zn-related .card-plaque { aspect-ratio: 1 / 1; border-radius: 7px; }
.zn-related .card-name {
  padding: 7px 2px 4px;
  color: var(--zn-muted);
  font: 500 11px/1.3 var(--zn-mono);
  text-align: center;
}
.zn-related .card-sub { display: none; }
.zn-related .card-play-badge { aspect-ratio: 1 / 1; border-radius: 7px; }

.zn-info + .zn-info,
#errorPanel.zn-info,
#missingView.zn-info {
  margin: 16px 0 0;
  padding: 20px;
  border: 1px solid var(--zn-line);
  border-radius: var(--zn-radius);
  background: #0e1011;
}
#errorPanel.zn-info h2,
#missingView.zn-info h2 { margin: 0 0 8px; font: 700 16px/1.3 var(--zn-mono); }
#errorPanel.zn-info p,
#missingView.zn-info p { color: var(--zn-muted); font-size: 13px; }

.zn-info .play-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.zn-info .btn {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 7px;
  font: 600 11px/1.2 var(--zn-mono);
}
.zn-info .note-box {
  width: 100%;
  min-height: 64px;
  padding: 7px 8px;
  border: 1px solid var(--zn-line);
  border-radius: 7px;
  background: #101214;
  color: var(--zn-text);
  font: 400 12px/1.5 var(--zn-sans);
}
.zn-info .session-timer { color: var(--zn-dim); font: 500 11px/1.4 var(--zn-mono); }
.zn-info .filter-row { display: block; margin: 10px 0 0; }
.zn-info .filter-row > span { display: block; margin-bottom: 4px; color: var(--zn-muted); font: 600 10.5px/1.4 var(--zn-mono); }
.zn-info .rating { display: flex; gap: 3px; }
.zn-info .rating button { background: transparent; border: 0; color: var(--zn-dim); cursor: pointer; }
.zn-info .cat-tags + .embed-note,
.zn-info .embed-note { margin: 10px 0 0; color: var(--zn-dim); font: 400 11px/1.6 var(--zn-mono); }

@media (max-width: 760px) {
  .zn-info .game-info { grid-template-columns: 1fr; gap: 16px; }
  .play-main .player-stage { border-radius: 10px; }
}

/* ---------------------------------------------------------------- settings */

.settings-overlay {
  padding: 20px;
  background: rgba(4, 5, 6, .78);
  backdrop-filter: blur(6px);
}

.settings-panel {
  width: min(720px, 100%);
  max-height: min(86dvh, 780px);
  border: 1px solid var(--zn-line-strong);
  border-radius: 14px;
  background: #0c0e0f;
  box-shadow: 0 28px 90px #000000b8;
  color: var(--zn-text);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--zn-line);
}

.settings-header h2 {
  margin: 0;
  font: 700 18px/1.2 var(--zn-mono);
  letter-spacing: -.02em;
}

.settings-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--zn-line);
  border-radius: 7px;
  background: transparent;
  color: var(--zn-muted);
}
.settings-close svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; }
.settings-close:hover { color: var(--zn-text); border-color: var(--zn-line-strong); }

.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--zn-line);
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }

.settings-tabs [role=tab] {
  flex: none;
  height: 30px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--zn-muted);
  font: 600 11.5px/1 var(--zn-mono);
  cursor: pointer;
}

.settings-tabs [role=tab]:hover { color: var(--zn-text); background: #ffffff08; }
.settings-tabs [role=tab][aria-selected=true] { background: #e9eaeb; color: #08090a; }

.settings-content { padding: 16px 18px; }

.settings-section { display: grid; gap: 15px; }

.settings-field {
  display: grid;
  gap: 7px;
  color: var(--zn-text);
  font: 500 12.5px/1.4 var(--zn-sans);
}

.settings-field > span:first-child { color: var(--zn-text); font: 600 12px/1.4 var(--zn-mono); }
.settings-field small { color: var(--zn-dim); font: 400 11px/1.6 var(--zn-sans); }
.settings-field :is(input[type=text], input[type=search], textarea, select) {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--zn-line);
  border-radius: 7px;
  background: #101214;
  color: var(--zn-text);
  font: 400 12px/1.4 var(--zn-sans);
}

.settings-field :is(input[type=range]) { accent-color: #e9eaeb; }

.settings-note { color: var(--zn-dim); font: 400 11px/1.6 var(--zn-sans); }

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.seg button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--zn-line);
  border-radius: 7px;
  background: transparent;
  color: var(--zn-muted);
  font: 600 11.5px/1.2 var(--zn-mono);
  cursor: pointer;
}

.seg button:hover { color: var(--zn-text); border-color: var(--zn-line-strong); }
.seg button[aria-pressed=true] { background: #e9eaeb; border-color: transparent; color: #08090a; }

.theme-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.theme-chips button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--zn-line);
  border-radius: 999px;
  background: transparent;
  color: var(--zn-muted);
  font: 600 11px/1 var(--zn-mono);
  cursor: pointer;
}

.theme-chips button[aria-pressed=true] { border-color: var(--zn-text); color: var(--zn-text); }
.theme-chips i { width: 10px; height: 10px; border-radius: 50%; }

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 18px;
  border-top: 1px solid var(--zn-line);
  background: #0a0c0d;
}

.settings-actions .btn {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 7px;
  font: 600 11.5px/1.2 var(--zn-mono);
}

.settings-tabs + .settings-content { overflow: auto; }

.settings-shortcut-group {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--zn-line);
  border-radius: 9px;
  background: #0f1113;
}

.settings-shortcut-group h3 {
  margin: 0;
  color: var(--zn-text);
  font: 700 12px/1.3 var(--zn-mono);
}

.settings-overlay .btn-solid,
.settings-panel .btn-solid { background: #e9eaeb; border-color: transparent; color: #08090a; }
.settings-panel .btn-ghost { background: transparent; border: 1px solid var(--zn-line); color: var(--zn-text); }
.settings-panel .btn-ghost:hover { border-color: var(--zn-line-strong); }
.settings-panel a { color: var(--zn-muted); text-decoration: underline; text-underline-offset: 2px; }
.settings-panel a:hover { color: var(--zn-text); }

.keymap { display: grid; gap: 5px; }
.keymap .keymap-row,
.keymap > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 0;
  border-bottom: 1px solid var(--zn-line);
}
.keymap > div:last-child { border-bottom: 0; }
.keymap :is(button, kbd, input) {
  font: 600 10.5px/1.2 var(--zn-mono);
}

.tab-binder { display: grid; gap: 7px; }
.tab-binder > * {
  padding: 8px;
  border: 1px solid var(--zn-line);
  border-radius: 7px;
  background: #0b0d0e;
}

/* ------------------------------------------------------------------ footer */

.za-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-top: 1px solid var(--zn-line);
  background: var(--zn-bg);
  color: var(--zn-dim);
  font: 500 11px/1.4 var(--zn-mono);
}

.za-footer > a { color: var(--zn-text); text-decoration: none; }
.za-footer nav { display: flex; flex-wrap: wrap; gap: 7px 15px; }
.za-footer a { color: var(--zn-dim); text-decoration: none; }
.za-footer a:hover { color: var(--zn-text); }

/* ------------------------------------------------------- legacy page reset */

body[data-arcade-page] :is(.page-head, .web-hero, .ai-hero, .social-hero, .movies-hero, .dw-head) {
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--zn-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body[data-arcade-page] :is(.page-head, .web-hero, .ai-hero, .social-hero, .movies-hero, .dw-head) h1 {
  font: 700 clamp(25px, 3vw, 30px)/1.15 var(--zn-mono);
  letter-spacing: -.035em;
}

body[data-arcade-page] :is(.page-sub, .ai-deck, .web-deck, .social-deck, .movies-deck) {
  color: var(--zn-dim);
  font: 400 12.5px/1.6 var(--zn-mono);
}

body[data-arcade-page] > .topbar {
  min-height: 52px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--zn-line);
  background: #0a0c0d;
  backdrop-filter: none;
}

body[data-arcade-page] .za-crumb { font: 500 11.5px/1.4 var(--zn-mono); color: var(--zn-dim); }
body[data-arcade-page] .za-crumb :is(a, strong) { color: var(--zn-muted); font-weight: 500; text-decoration: none; }
body[data-arcade-page] .za-crumb i { color: #4d5155; }

body[data-arcade-page] .topbar .searchbox {
  border: 1px solid var(--zn-line);
  border-radius: 999px;
  background: #0d0f10;
}
body[data-arcade-page] .topbar .searchbox input { color: var(--zn-text); font: 400 12px/1 var(--zn-mono); }

body[data-arcade-page] :is(.btn, .chip, .shuffle) { border-radius: 7px; font-family: var(--zn-mono); }

body[data-arcade-page] .card,
body[data-arcade-page] :is(.game-info, .play-side-card, .web-shell, .dw-card, .movies-card, .media-card, .legal-toc) {
  border-color: var(--zn-line);
  border-radius: var(--zn-radius);
  background: #0e1011;
  box-shadow: none;
}

body[data-arcade-page] .section-title {
  font: 700 17px/1.3 var(--zn-mono);
  letter-spacing: -.02em;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 960px) {
  .masthead-links a { padding-inline: 9px; font-size: 11.5px; }
  .masthead-links a span { display: none; }
  .masthead-links a svg { width: 16px; height: 16px; }
  .site-masthead .quick-launch span { display: none; }
}

@media (max-width: 780px) {
  html[data-site-masthead] { --masthead-height: 104px; }
  html[data-site-masthead] :is(body[data-arcade-page], body.arcade-discover) { padding-bottom: 0; }
  html[data-site-masthead] .player-bar { bottom: 0; }

  html[data-site-masthead] .site-masthead.site-masthead {
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    height: var(--masthead-height);
    padding: 8px 14px 0;
    gap: 8px;
    backdrop-filter: blur(10px);
  }
  html[data-site-masthead] .site-masthead .za-brand { margin-right: auto; }
  html[data-site-masthead] .site-masthead .masthead-links {
    position: static;
    inset: auto;
    flex: 0 0 100%;
    width: 100%;
    height: 47px;
    padding: 0 0 7px;
    border-bottom: 0;
  }
  html[data-site-masthead] .site-masthead .masthead-links a { flex: 0 0 auto; min-width: auto; }

  .site-masthead .za-brand { font-size: 15px; }
  .site-masthead .za-brand .za-mark { width: 25px; height: 25px; }

  .masthead-links {
    position: static;
    order: 3;
    width: 100%;
    height: 47px;
    margin: 0;
    padding: 0 0 7px;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 1px;
    border: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .masthead-links::-webkit-scrollbar { display: none; }
  .masthead-links a { min-width: auto; min-height: 34px; flex-direction: row; gap: 5px; padding: 6px 10px; font-size: 11.5px; }
  .masthead-links a span { display: inline; }
  .masthead-links svg { width: 14px; height: 14px; }

  .zn-main { padding: 18px 14px 44px; }
  html[data-site-masthead] body[data-arcade-page] > main.zn-main { padding: 18px 14px 44px; }

  .zn-page-head { align-items: flex-end; }
  .zn-page-head h1 { font-size: 25px; }
  .zn-search { margin-bottom: 22px; }
  .zn-search input { height: 44px; font-size: 12.5px; padding: 0 42px; }
  .zn-search kbd { display: none; }

  .zn-sites { grid-template-columns: repeat(auto-fit, minmax(104px, 118px)); gap: 10px; }
  .zn-site { padding: 6px; }
  .zn-site-art { padding: 15px; }
  .zn-site-name { font-size: 11px; }

  #grid.zn-games, #recentGrid.zn-games { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px 8px; }
  .zn-related .zn-games { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .zn-game { padding: 5px; }
  .zn-game-name { font-size: 11px; padding-top: 6px; }
  .zn-card-tools { top: 7px; right: 7px; }
  .zn-card-tools button { width: 22px; height: 22px; }
  .zn-queue { top: 7px; right: 54px; width: 22px; height: 22px; }
  .zn-game-badge { top: 7px; left: 7px; font-size: 7.5px; }
  .zn-dir-fav { top: 10px; right: 10px; }

  .zn-section-head h2 { font-size: 15px; }
  .zn-section-head .zn-side { width: auto; font-size: 10.5px; }
  .zn-tools { align-items: flex-start; }
  .zn-tools-right { width: 100%; justify-content: space-between; }
  .zn-chips { width: 100%; }

  .zn-dirgrid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px 8px; }
  .zn-dirbar { align-items: flex-start; }
  .zn-tools-right { width: 100%; margin-left: 0; justify-content: flex-end; }
  .zn-dirgrid[data-view=list] .zn-site-note { display: none; }
  .zn-dirgrid[data-view=list] .zn-site { padding: 6px 40px 6px 6px; gap: 10px; }
  .zn-dirgrid[data-view=list] .zn-site-art { width: 42px; height: 42px; padding: 7px; }
  .zn-dir-fav { top: 10px; right: 10px; }
  .zn-dir-note { font-size: 11px; }

  .zn-player-head h1 { font-size: 22px; }
  .zn-player-actions .btn span { display: none; }
  .zn-info .game-info { padding: 14px; }
  .zn-info .game-info-title { font-size: 13px; }

  .settings-overlay { padding: 0; }
  .settings-panel { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .settings-content { padding: 14px; }
  .settings-header { padding: 14px; }
  .settings-tabs { padding: 8px 14px; }
  .settings-actions { padding: 10px 14px; }
}

@media (max-width: 420px) {
  .zn-sites { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); justify-content: stretch; }
  #grid.zn-games, #recentGrid.zn-games { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .zn-card-tools, .zn-queue { opacity: 1; }
  .zn-page-head { flex-wrap: wrap; }
  .zn-page-head .zn-actions { width: 100%; }
}
