@font-face {
  font-family: "Artex SemiExtended";
  src: url("/assets/fonts/artex-semiextended-black.woff2") format("woff2");
  font-weight: 700 900;
  font-display: swap;
}
@font-face {
  font-family: Symbols;
  src: url("/assets/fonts/symbols.woff2") format("woff2");
  font-display: block;
}
@font-face {
  font-family: Inter;
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --base: #b5f6eb;
  --surface: #fff;
  --raised: #eff7fb;
  --line: #dcebf2;
  --ink: #19274b;
  --text: #2d4162;
  --muted: #465d78;
  --accent: #264ed3;
  --accent-soft: #eaf0ff;
  --cta: #3159f4;
  --cta-hover: #2248e3;
  --on-cta: #fff;
  --lime: #defc72;
  --shadow: 0 3px 0 #28698a0e, 0 9px 20px #2b75881b;
  --gutter: clamp(14px, 3.6vw, 42px);
  --content-width: 1184px;
  --body-font: Inter, Arial, sans-serif;
  --heading-font: "Artex SemiExtended", Inter, sans-serif;
  --bottom-nav: calc(62px + env(safe-area-inset-bottom));
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--base); }
body {
  margin: 0;
  min-height: 100vh;
  isolation: isolate;
  background: linear-gradient(155deg, #a9f5e8, #c2f9f0 46%, #a5eaf1) fixed;
  color: var(--ink);
  font: 400 14px/1.5 var(--body-font);
  -webkit-font-smoothing: antialiased;
}
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  width: min(390px, 43vw);
  height: min(670px, 85vh);
}
body::before {
  inset: 13vh auto auto 0;
  background: linear-gradient(135deg, #63dec277, #4ed6e059 73%, transparent 74%);
  clip-path: polygon(0 7%, 34% 16%, 69% 2%, 100% 49%, 56% 55%, 43% 94%, 0 77%);
}
body::after {
  inset: auto 0 0 auto;
  background: linear-gradient(132deg, #fff7 9%, #e7fff638 42%, #65d5e348 43%, #66d9da80);
  clip-path: polygon(39% 11%, 100% 0, 100% 100%, 0 100%, 17% 57%, 60% 50%);
}
h1, h2, h3, p, dl, dd { margin: 0; }
img { display: block; max-width: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
fieldset { margin: 0; padding: 0; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #4164ef; outline-offset: 3px; }
.skip-link {
  position: fixed;
  z-index: 60;
  inset: 6px auto auto 10px;
  padding: 10px 15px;
  border-radius: 14px;
  background: var(--cta);
  color: var(--on-cta);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.icon {
  display: inline-block;
  flex: none;
  font: 400 22px/1 Symbols;
  font-feature-settings: "liga";
  white-space: nowrap;
  direction: ltr;
}
.portal-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: none;
  background: currentColor;
  mask: var(--icon-url) center / contain no-repeat;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: transparent;
}
.icon-button:hover { background: var(--raised); }
.icon-button:disabled { cursor: default; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 16px;
}
.topbar-inner, .main-inner {
  width: min(var(--content-width), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}
.topbar-inner {
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding-inline: 15px;
  border: 1px solid #fff;
  border-radius: 19px;
  background: #fffffffa;
  box-shadow: var(--shadow);
}
.brand, .header-actions { display: flex; align-items: center; }
.brand { justify-self: start; gap: 8px; min-width: 0; }
.brand img { flex: none; object-fit: contain; }
.brand-wordmark {
  font: 900 27px/.92 var(--heading-font);
  letter-spacing: -.07em;
  white-space: nowrap;
}
.brand-wordmark span { color: var(--cta); }
.discovery-nav, .header-actions { gap: 7px; }
.discovery-nav { display: flex; }
.discovery-nav .nav-link .portal-icon { display: none; }
.header-actions { justify-self: end; }
.nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 11px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.nav-link .portal-icon { width: 17px; height: 17px; }
.nav-link:hover { background: var(--raised); color: var(--accent); }
.nav-link[aria-current="page"] { background: #c5fbec; color: #163f62; }
.search-toggle, .header-circle {
  height: 42px;
  border: 1px solid #d9e5f4;
  border-radius: 12px;
  background: #f1f6ff;
  color: var(--accent);
}
.search-toggle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding-inline: 12px;
  font-weight: 700;
}
.search-toggle:hover, .header-circle:hover { background: #e4eeff; }
.header-save[data-filled] { background: #daf9d2; color: #1c585d; }
.bottom-navigation { display: none; }

.main { min-width: 0; min-height: calc(100vh - 80px); margin-top: 20px; outline: none; }
.main-inner { min-width: 0; }
#all-games { scroll-margin-top: 106px; }
#all-games:focus { outline: none; }

.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 16px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
}
.primary { background: var(--cta); color: var(--on-cta); }
.primary:hover { background: var(--cta-hover); }
.surprise { box-shadow: 0 3px 0 #1839ac; font-size: 14px; min-height: 45px; }
.surprise:hover { transform: translateY(-1px); }
.surprise:active { box-shadow: 0 1px 0 #1839ac; transform: translateY(2px); }
.die-icon {
  width: 17px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  background:
    radial-gradient(circle, currentColor 1px, transparent 1.4px) 2px 2px / 4px 4px no-repeat,
    radial-gradient(circle, currentColor 1px, transparent 1.4px) center / 4px 4px no-repeat,
    radial-gradient(circle, currentColor 1px, transparent 1.4px) calc(100% - 2px) calc(100% - 2px) / 4px 4px no-repeat;
  transform: rotate(-12deg);
}
.secondary { background: var(--raised); color: var(--ink); }
.secondary:hover, .secondary[aria-pressed="true"] { background: var(--accent-soft); }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  color: var(--accent);
  font-weight: 700;
}
.text-link .portal-icon { width: 17px; height: 17px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.category-hero, .home-feature {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #f6ffff;
  border-radius: 23px;
  background: linear-gradient(114deg, #f2ffff 3%, #b6f4ff 55%, #85dafe);
  box-shadow: var(--shadow);
}
.category-hero::before, .home-feature::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -9%;
  width: min(66%, 770px);
  aspect-ratio: 1.65;
  border: clamp(25px, 4vw, 62px) solid #e9ffff50;
  border-radius: 50%;
  transform: translateY(-50%) rotate(-16deg);
  background: radial-gradient(#2c94cf46 1.4px, transparent 1.55px) center / 13px 13px;
}
.category-hero { min-height: 193px; padding: 21px clamp(22px, 4vw, 54px); }
.category-hero-copy, .home-feature-copy { z-index: 1; }
.category-hero h1, .home-feature h1, .listing h1, .tag-page h1, .search-page h1, .mode-choices h1 {
  font: 900 clamp(32px, 4.6vw, 62px)/1.04 var(--heading-font);
  letter-spacing: -.052em;
  text-wrap: balance;
}
.category-hero p, .home-feature p {
  margin: 9px 0 17px;
  color: var(--text);
  font-size: clamp(13px, 1.36vw, 17px);
}
.category-hero-art, .home-art {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 3%;
  width: 49%;
  height: auto;
  max-width: 495px;
  pointer-events: none;
  transform: translateY(-50%);
}
.category-hero-art { max-width: 436px; }
.category-section, .mode-section, .all-games, .shelf { margin-top: 22px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  margin-bottom: 10px;
}
.section-head h2, .tag-section h2, .personal-scores h2 {
  font: 900 clamp(19px, 2.0vw, 26px)/1.13 var(--heading-font);
  letter-spacing: -.04em;
}
.section-head h2 a { display: inline-flex; align-items: center; gap: 7px; }
.section-head h2 a:hover { color: var(--accent); }
.section-head h2 a .portal-icon { width: 17px; height: 17px; }

.category-grid, .play-modes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.category-card {
  display: grid;
  grid-template-columns: clamp(58px, 6.5vw, 83px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 91px;
  padding: 8px 11px 8px 8px;
  border: 1px solid #fff;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease;
}
.category-art {
  width: 100%;
  aspect-ratio: 1.08;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: radial-gradient(ellipse at 40% 20%, #fff9, transparent 67%), var(--card-tint);
}
.category-art img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.category-copy { display: grid; align-content: center; gap: 3px; }
.category-copy strong { font-size: clamp(13px, 1.23vw, 16px); line-height: 1.23; }
.category-copy small { color: var(--muted); font-size: 12px; }
.category-arrow {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #eef4ff;
  color: var(--accent);
}
.category-arrow .portal-icon { width: 15px; height: 15px; }
.category-card:hover, .category-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 4px 0 #2666ad28, 0 12px 26px #2b75882b;
}
.category-card:hover .category-arrow, .category-card:focus-visible .category-arrow { background: var(--cta); color: white; }
.play-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.play-modes .category-card { background: color-mix(in srgb, var(--card-tint) 58%, white); }
.play-modes .category-art { background: #ffffffa3; }
.cozy-grid .category-card { background: color-mix(in srgb, var(--card-tint) 48%, white); }
.cozy-grid .category-art img { height: 100%; object-fit: cover; }
@media (min-width: 1120px) {
  .cozy-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 13px;
}
.home-feature { min-height: 290px; padding: 25px clamp(22px, 3vw, 42px); }
.home-feature h1 { max-width: 9ch; font-size: clamp(35px, 4.7vw, 66px); text-wrap: wrap; }
.home-art { width: 61%; right: -5%; transform: translateY(-37%); }
.home-feature::before { width: 70%; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 15px; }
.hero-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hero-picks .card-link, .hero-picks .thumbnail { height: 100%; min-height: 100px; aspect-ratio: auto; }

.game-card { position: relative; min-width: 0; scroll-snap-align: start; }
.card-link {
  display: block;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card-link:hover, .card-link:focus-visible { box-shadow: 0 5px 0 #2666ad2e, 0 13px 24px #2b758833; transform: translateY(-3px); }
.thumbnail {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 16 / 10;
  background: #1b274b;
}
.thumbnail img { width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .22s ease; }
.game-card--square .thumbnail { aspect-ratio: 1; }
.game-card--square .thumbnail img { object-fit: contain; object-position: center 32%; }
.art-title {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 9px 8px;
  background: linear-gradient(transparent, #0d142ed9);
  color: white;
  font-size: clamp(11px, 1.28vw, 16px);
  line-height: 1.21;
  text-align: center;
  text-wrap: balance;
}
.card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--lime);
  color: #17284d;
  opacity: 0;
  transition: scale .16s ease, opacity .16s ease;
  translate: -50% -50%;
  scale: .8;
}
.card-link:hover .thumbnail img, .card-link:focus-visible .thumbnail img { transform: scale(1.055); }
.card-link:hover .card-play, .card-link:focus-visible .card-play { opacity: 1; scale: 1; }
.card-copy { display: grid; gap: 2px; padding: 10px 12px 11px; }
.card-copy strong { font-size: 15px; line-height: 1.25; }
.card-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.card-save {
  position: absolute;
  inset: 5px 5px auto auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #101d37c7;
  color: #fff;
  opacity: 0;
  transition: opacity .16s ease;
}
.card-save .portal-icon { width: 17px; height: 17px; }
.game-card:hover .card-save, .card-save:focus-visible, .card-save[aria-pressed="true"] { opacity: 1; }
.card-save:hover, .card-save[aria-pressed="true"] { background: var(--lime); color: #223356; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}
.load-games { display: flex; justify-content: center; margin-top: 16px; }
.pack-frame { width: 100%; height: 100%; border: 0; background: white; }
.stage:has(.pack-frame) { aspect-ratio: auto; height: clamp(470px, 72vh, 720px); }
.stage:has(.pack-frame--scratch) { aspect-ratio: 4 / 3; height: auto; max-height: 72vh; }
.player[data-expanded] .stage:has(.pack-frame) { height: auto; }
.game-facts a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.shelf-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 52px) / 5);
  gap: 13px;
  padding: 4px 4px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline-start: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.shelf-track::-webkit-scrollbar { display: none; }
.track--recent { grid-auto-columns: 102px; }
.carousel { position: relative; }
.carousel-arrows { position: absolute; inset: 0 -5px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.carousel-arrows .icon-button { width: 38px; height: 38px; pointer-events: auto; border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.carousel-arrows .icon-button:disabled { visibility: hidden; }
.carousel-arrows .slide-prev .portal-icon { transform: rotate(180deg); }
.carousel-arrows .portal-icon { width: 18px; height: 18px; }

.listing-intro {
  padding: 24px clamp(19px, 3vw, 38px);
  margin-bottom: 16px;
  border-radius: 20px;
  background: #ffffffba;
  box-shadow: var(--shadow);
}
.listing-intro--category {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  background: linear-gradient(113deg, #fff 0%, var(--card-tint) 88%);
}
.listing-intro h1 { font-size: clamp(30px, 4.3vw, 54px); text-wrap: wrap; overflow-wrap: anywhere; }
.listing-intro p { max-width: 60ch; margin-top: 8px; font-size: 16px; color: var(--text); }
.listing-art { width: clamp(100px, 18vw, 180px); height: auto; object-fit: contain; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumbs a { color: var(--accent); font-weight: 700; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .portal-icon { width: 12px; height: 12px; }
.listing-toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.listing-toolbar > p { color: var(--text); font-weight: 700; }
.sort-picker { position: relative; z-index: 2; }
.sort-picker summary {
  list-style: none;
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.sort-picker summary::-webkit-details-marker { display: none; }
.sort-picker .portal-icon { width: 14px; height: 14px; transform: rotate(90deg); }
.sort-picker[open] .portal-icon { transform: rotate(270deg); }
.sort-options {
  position: absolute;
  inset: calc(100% + 5px) 0 auto auto;
  min-width: 100%;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sort-options button { width: 100%; min-height: 38px; padding-inline: 10px; border: 0; border-radius: 7px; background: transparent; text-align: start; }
.sort-options button:hover, .sort-options button:focus-visible { background: var(--accent-soft); }
.show-description, .text-button { padding: 4px 0; border: 0; background: none; color: var(--accent); font-weight: 700; text-decoration: underline; }
.search-category-grid { margin-bottom: 17px; }
.empty { min-height: 130px; padding: 20px; border-radius: 15px; background: var(--surface); color: var(--text); }
.empty p { margin-bottom: 12px; }
.tag-section { margin-top: 18px; }
.tag-section h2 { margin-bottom: 8px; }
.genre-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.genre-tile { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 10px; background: var(--surface); font-weight: 700; }
.genre-tile:hover { background: var(--accent-soft); }
.genre-tile strong { color: var(--accent); }
.personal-scores { margin-top: 24px; }
.personal-scores h2 { margin-bottom: 10px; }
.score-table { width: 100%; border-spacing: 0; border-radius: 12px; overflow: hidden; text-align: left; background: var(--surface); }
.score-table th, .score-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.score-table a:hover { text-decoration: underline; }
.mode-choices, .multiplayer-list { border-radius: 18px; padding: 24px; background: #ffffffd9; }
.mode-choices h1 { margin-bottom: 15px; font-size: clamp(25px, 4vw, 42px); }
.mode-choice, .multiplayer-tabs a { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 12px; background: var(--raised); }
.mode-choice { min-height: 62px; margin-top: 8px; }
.mode-choice:hover, .multiplayer-tabs a:hover, .multiplayer-tabs a[aria-current="page"] { background: color-mix(in srgb, var(--mode-color) 35%, white); }
.mode-choice strong, .mode-choice small { display: block; }
.mode-choice small { color: var(--muted); }
.multiplayer-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: start; gap: 8px; }
.multiplayer-heading h1 { font-size: clamp(25px, 4vw, 44px); }
.multiplayer-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 13px; }
.listing-help { margin-block: 8px 14px; }
.listing-help summary { color: var(--accent); font-weight: 700; cursor: pointer; }
.listing-help p { margin-top: 8px; }

.search {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(590px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 23px 23px 0;
  background: linear-gradient(156deg, #d8fff5, #f8fffd 56%);
  color: var(--ink);
  box-shadow: 15px 0 40px #10285233;
  overscroll-behavior: contain;
}
.search[open] { animation: open-search .2s ease-out; }
@keyframes open-search { from { transform: translateX(-24px); opacity: .5; } }
.search::backdrop, .header-scrim { background: #17274686; }
body:has(.search[open]), body[data-overlay="panel"] { overflow: hidden; }
.search-inner { min-height: 100%; padding: clamp(15px, 3vw, 30px); }
.search-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.search-heading h2, .panel-heading h2 { font: 900 27px/1.1 var(--heading-font); letter-spacing: -.045em; }
.search-heading .icon-button { background: var(--surface); color: var(--accent); }
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 5px 5px 13px;
  border: 1px solid #b5d7eb;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-form:focus-within { border-color: #466bef; }
.search-form > .portal-icon { color: var(--accent); }
.search-form input {
  flex: 1;
  min-width: 0;
  height: 47px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.search-form input::placeholder { color: var(--muted); }
.search-submit {
  display: grid;
  place-items: center;
  flex: none;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--cta);
  color: white;
}
.search-submit:hover { background: var(--cta-hover); }
.search-browse { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 16px 22px; }
.search-browse .nav-link { min-height: 40px; padding-inline: 9px; background: white; box-shadow: 0 2px 4px #376c8620; font-size: 12px; }
.search-browse .nav-link:hover { background: var(--accent-soft); }
.search-browse .portal-icon { width: 15px; height: 15px; color: var(--accent); }
#suggestions-title { font: 900 18px/1.28 var(--heading-font); letter-spacing: -.04em; margin: 16px 0 8px; }
.search-status { padding: 17px 0; color: var(--muted); }
.suggestions { display: grid; gap: 6px; }
.suggestions[data-view="picks"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 47px;
  padding: 5px 8px;
  border: 1px solid #daeaf2;
  border-radius: 10px;
  background: white;
  font-weight: 700;
}
.suggestion:hover, .suggestion[aria-selected="true"] { border-color: #7391ff; background: var(--accent-soft); }
.suggestion img { width: 63px; height: 41px; border-radius: 7px; }
.suggestion small { display: block; color: var(--muted); font-weight: 400; }
.suggestion .portal-icon { margin-left: auto; color: var(--accent); }
.suggestion-illustration { width: 49px; height: 43px; display: grid; place-items: center; border-radius: 8px; background: var(--card-tint); }
.suggestion-illustration img { width: 44px; height: 44px; object-fit: contain; }
.suggestions[data-view="picks"] .suggestion { display: grid; gap: 6px; align-content: start; padding: 5px; font-size: 12px; }
.suggestions[data-view="picks"] img { width: 100%; height: auto; aspect-ratio: 16 / 10; }
.suggestions[data-view="picks"] .suggestion span { padding: 0 4px 3px; }

.header-scrim { position: fixed; z-index: 26; inset: 0; width: 100%; padding: 0; border: 0; }
.header-panel {
  position: fixed;
  z-index: 27;
  inset: 15px max(var(--gutter), calc((100vw - var(--content-width)) / 2)) 15px auto;
  width: min(406px, calc(100% - 2 * var(--gutter)));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #fff;
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 12px 38px #16264c55;
}
.panel-heading {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.panel-heading .close-panel { margin-left: auto; color: var(--accent); }
.panel-heading .back-panel { color: var(--accent); }
.panel-content { padding: 13px; }
.panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--raised);
}
.panel-tabs button, .utility-button {
  min-height: 39px;
  padding: 4px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-weight: 700;
}
.panel-tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 2px 5px #26385115; }
.panel-empty { display: grid; place-items: center; gap: 12px; min-height: 140px; border-radius: 12px; background: var(--raised); color: var(--text); text-align: center; padding: 14px; }
.panel-empty .portal-icon, .panel-empty .icon { width: 34px; height: 34px; font-size: 34px; color: var(--accent); }
.panel-content .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.library-actions { display: grid; gap: 4px; margin-top: 10px; }
.utility-button { display: flex; align-items: center; gap: 8px; text-align: start; }
.utility-button:hover { background: var(--accent-soft); }
.utility-button .portal-icon, .utility-button .icon { width: 19px; height: 19px; font-size: 19px; color: var(--accent); }
.notification-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #2e60ef; }
.friends-panel-content, .account-content { display: grid; gap: 13px; justify-items: center; padding: 16px 12px; text-align: center; }
.friends-panel-content img, .account-content img { object-fit: contain; }
.profile-form { width: 100%; display: grid; gap: 8px; }
.profile-form label { text-align: start; }
.profile-form input {
  min-width: 0;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  color: var(--ink);
  font-size: 16px;
}
.notice-list { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.notice-list li { display: flex; align-items: center; gap: 9px; padding: 12px; border-radius: 10px; background: var(--raised); }
.notice-list .portal-icon { color: var(--accent); }
.welcome-notice img { flex: none; }
.welcome-notice > div { flex: 1; }
.welcome-notice .primary { min-height: 36px; margin-top: 7px; }
.notice-options { position: relative; align-self: start; }
.notice-options summary { display: grid; place-items: center; min-height: 32px; cursor: pointer; list-style: none; }
.notice-options button { position: absolute; right: 0; width: max-content; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 18px; }
.game-main { min-width: 0; }
.player {
  color-scheme: dark;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #2d3b74;
  border-radius: 17px;
  background: #111633;
  color: white;
  box-shadow: var(--shadow);
}
.stage {
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1.95;
  background: #13183a;
}
.stage-cover {
  position: absolute;
  z-index: -2;
  inset: -12px;
  width: calc(100% + 24px);
  max-width: none;
  height: calc(100% + 24px);
  object-fit: cover;
  filter: blur(14px) brightness(.38);
}
.stage::before { content: ""; position: absolute; z-index: -1; inset: 0; background: #09102c66; pointer-events: none; }
.stage[data-active]::before { display: none; }
.stage-intro { display: grid; justify-items: center; gap: 9px; padding: 10px; text-align: center; }
.start-cover { border-radius: 10px; }
.stage-intro strong { font: 900 28px/1.1 var(--heading-font); }
.stage-intro .primary, .game-result .primary { background: var(--lime); color: #19294d; }
.stage-intro .primary:hover, .game-result .primary:hover { background: #eeffa0; }
.stage-message { padding: 20px; text-align: center; }
.stage-message p + button { margin-top: 12px; }
.game-canvas, .nes-canvas { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.nes-canvas { image-rendering: pixelated; }
.player-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 50px; padding: 5px 9px; background: #1c2553; }
.player-identity { display: flex; min-width: 0; align-items: center; gap: 8px; }
.player-identity img { border-radius: 6px; flex: none; }
.player-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 16px/1.3 var(--heading-font); }
.control-group, .ratings { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.control-group .icon-button { width: 35px; height: 33px; color: #eff1ff; background: #ffffff12; }
.control-group .icon-button:hover, .control-group button[aria-pressed="true"] { background: #ffffff26; }
.control-group .icon-button:disabled { opacity: .45; }
.control-group .portal-icon, .control-group .icon { width: 17px; height: 17px; font-size: 17px; }
.invite-button { display: flex; align-items: center; gap: 4px; min-height: 33px; padding: 0 9px; border: 0; border-radius: 17px; background: var(--lime); color: #1b2b50; font-weight: 700; }
.player[data-expanded] { position: fixed; z-index: 25; inset: 0; display: flex; flex-direction: column; border-radius: 0; }
.player[data-expanded] .stage { flex: 1; aspect-ratio: auto; min-height: 0; }
body:has(.player[data-expanded]) { overflow: hidden; }
.game-aside { min-width: 0; padding: 14px; align-self: start; border: 1px solid #fff; border-radius: 17px; background: #ffffffd9; box-shadow: var(--shadow); }
.game-aside h2 { margin-bottom: 9px; font: 900 18px/1.2 var(--heading-font); }
.game-score-link { display: grid; gap: 6px; min-height: 112px; margin-bottom: 16px; padding: 12px; border-radius: 13px; background: #e9e4ff; }
.game-score-link:hover { background: #ded6fc; }
.game-score-link > strong { font: 900 18px/1.15 var(--heading-font); }
.game-score-link > small { color: var(--accent); font-weight: 700; }
.score-cta { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin-top: 7px; padding: 7px 9px; border-radius: 9px; background: white; color: var(--accent); font-weight: 700; }
.game-promo { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 13px; background: #edf1ff; color: var(--ink); }
.game-promo:hover { background: #e2e8ff; }
.game-promo strong { font: 900 17px/1.14 var(--heading-font); }
.game-promo img { width: 45px; height: 45px; object-fit: contain; }
.game-promo .promo-arrow { display: grid; place-items: center; flex: none; width: 29px; height: 29px; margin-left: auto; border-radius: 50%; background: white; color: var(--accent); }
.player-details { margin-top: 14px; padding: 18px 21px; border: 1px solid #fff; border-radius: 14px; background: #ffffffd9; }
.details-tabs { display: flex; gap: 14px; margin: 13px 0; border-bottom: 1px solid var(--line); }
.details-tab { min-height: 37px; padding: 0 3px; border: 0; border-bottom: 3px solid transparent; background: transparent; font-weight: 700; }
.details-tab[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
.details-content { color: var(--text); }
.details-content h2 { margin-bottom: 7px; font: 900 21px/1.18 var(--heading-font); }
.game-facts { margin-top: 15px; }
.game-facts div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; margin-bottom: 5px; }
.game-facts dt { color: var(--ink); font-weight: 700; }
.aside-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.aside-list .art-title { font-size: 11px; }
.player .secondary { background: #344476; color: #f4f7ff; }
.player .secondary:hover, .player .secondary[aria-pressed="true"] { background: #5569a5; }
.mode-group, .touch-pad { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.mode-group button { min-height: 35px; }
.touch-pad { flex: none; padding: 8px; background: #19254c; touch-action: none; }
.touch-pad button { min-width: 44px; min-height: 44px; padding-inline: 10px; touch-action: none; }
.player .touch-pad button:active { background: var(--lime); color: #19294d; }
.game-result {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 10px;
  text-align: center;
  background: #101a3bed;
}
.game-result strong { font: 900 clamp(20px, 4vw, 40px)/1.08 var(--heading-font); }
.puzzle-screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 12px clamp(8px, 2vw, 20px);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  overflow: auto;
  text-align: center;
  background: radial-gradient(ellipse at top, #2a416e, #171e3a 76%);
}
.puzzle-screen h2 { font: 700 clamp(15px, 3vw, 26px)/1.15 var(--heading-font); }
.puzzle-actions, .word-tiles, .word-entry { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.memory-grid { width: min(78%, 410px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.memory-tile, .word-tiles button {
  min-height: 38px;
  aspect-ratio: 1.65;
  border: 1px solid #7b86c8;
  border-radius: 7px;
  background: #33477c;
  color: #f2f2ff;
  font-weight: 700;
}
.memory-tile[aria-pressed="true"] { background: #c4b1ff; color: #252047; }
.memory-tile:disabled, .word-tiles button:disabled { opacity: .62; }
.word-tiles button { min-width: 35px; }
.word-entry { width: min(310px, 100%); }
.word-entry input { min-width: 0; flex: 1; padding: 7px 9px; border: 1px solid #7b86c8; border-radius: 7px; background: #263b69; color: white; font-size: 16px; }
.quiz-answers { width: min(410px, 100%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.player .quiz-answers button[data-result="correct"] { background: #28684e; }
.player .quiz-answers button[data-result="incorrect"] { background: #8d3c5b; }

.page-footer { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 18px; padding: 28px 4px 36px; margin-top: 30px; border-top: 1px solid #ffffffa5; color: var(--muted); }
.page-footer nav { display: grid; align-content: start; gap: 5px; }
.page-footer nav strong, .page-footer a:hover { color: var(--ink); }
.page-footer nav strong { margin-bottom: 4px; }
.page-footer .footer-privacy {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px 20px;
  border-top: 1px solid #ffffffa5;
  padding-top: 12px;
  font-size: 13px;
}
.footer-privacy a[aria-current="page"], .footer-privacy a:hover { text-decoration: underline; text-underline-offset: 3px; }
.library-privacy { color: var(--accent); }

.privacy-page { width: min(100%, 860px); margin-inline: auto; color: var(--ink); }
.privacy-heading, .privacy-body { border: 1px solid #fff; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.privacy-heading { padding: clamp(18px, 4vw, 32px); }
.privacy-heading h1 { font: 900 clamp(26px, 4vw, 43px)/1.13 var(--heading-font); letter-spacing: -.04em; }
.privacy-heading p { margin-top: 8px; color: var(--text); }
.privacy-heading .privacy-date { color: var(--muted); font-size: 13px; }
.privacy-language, .privacy-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.privacy-language { margin-top: 12px; }
.privacy-language a, .privacy-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 5px 12px;
  border-radius: 9px;
  background: var(--raised);
  color: var(--text);
  font-weight: 700;
}
.privacy-language a[aria-current="page"], .privacy-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.privacy-language a:hover, .privacy-nav a:hover { color: var(--accent); text-decoration: underline; }
.privacy-nav { margin-block: 12px; }
.privacy-nav a { background: var(--surface); }
.privacy-body { padding: 4px clamp(16px, 4vw, 32px); }
.privacy-body section { padding-block: 17px; }
.privacy-body section + section { border-top: 1px solid var(--line); }
.privacy-body h2 { font: 700 19px/1.3 var(--body-font); }
.privacy-body p { margin-top: 8px; color: var(--text); line-height: 1.7; }
.privacy-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.privacy-body #privacy-contact { scroll-margin-top: 100px; }
.privacy-storage { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.privacy-storage div { display: grid; grid-template-columns: minmax(110px, 1fr) 3fr; gap: 4px 12px; padding: 10px 12px; }
.privacy-storage div + div { border-top: 1px solid var(--line); }
.privacy-storage dt { font-weight: 700; }
.privacy-storage dd { color: var(--text); overflow-wrap: anywhere; }
.privacy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.privacy-clear { min-height: 44px; padding: 4px 16px; border: 1px solid #b95065; border-radius: 12px; background: #fff4f6; color: #88243b; font-weight: 700; }
.privacy-clear:hover { background: #ffe6eb; }
.privacy-status:empty { margin: 0; }
.dialog .privacy-actions { justify-content: end; }
.dialog:has(.privacy-clear) h2 { padding-right: 28px; }

@media (max-width: 520px) {
  .privacy-storage div { grid-template-columns: 1fr; }
}

.dialog { width: min(420px, calc(100% - 24px)); padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.dialog::backdrop { background: #12244d99; }
.dialog .close-dialog { position: absolute; top: 8px; right: 8px; }
.dialog h2 { margin-bottom: 12px; font: 900 23px/1.2 var(--heading-font); }
.dialog p { color: var(--text); }
.toast { position: fixed; z-index: 29; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 28px); padding: 10px 15px; border-radius: 10px; background: #1d2c57; color: white; box-shadow: var(--shadow); }
.toast .icon { color: var(--lime); }

@media (max-width: 1070px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; }
  .discovery-nav { justify-self: center; }
  .discovery-nav .nav-link { padding-inline: 9px; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shelf-track { grid-auto-columns: calc((100% - 39px) / 4); }
}
@media (max-width: 820px) {
  .topbar { padding-top: 8px; }
  .topbar-inner { grid-template-columns: auto 1fr auto; padding-inline: 10px; }
  .brand-wordmark { font-size: 24px; }
  .discovery-nav, .header-save, .search-label { display: none; }
  .header-actions { gap: 4px; }
  .main { margin-top: 13px; margin-bottom: var(--bottom-nav); }
  .home-hero { grid-template-columns: 1fr; }
  .hero-picks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-feature { min-height: 245px; }
  .home-art { width: 48%; right: -1%; }
  .category-hero-art { width: 42%; right: 0; }
  .game-layout { grid-template-columns: 1fr; }
  .aside-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .game-score-link { min-height: 0; grid-template-columns: 1fr auto; align-items: center; }
  .game-score-link small { grid-row: 2; }
  .game-score-link .score-cta { grid-area: 1 / 2 / span 2; margin: 0; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shelf-track { grid-auto-columns: calc((100% - 26px) / 3); }
  .page-footer { grid-template-columns: 1.4fr repeat(2, 1fr); }
  .bottom-navigation {
    position: fixed;
    z-index: 22;
    inset: auto 0 0;
    display: flex;
    min-height: var(--bottom-nav);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: #fffffff4;
  }
  .bottom-link { flex: 1; display: grid; place-content: center; justify-items: center; gap: 2px; min-height: 58px; padding: 4px 6px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
  .bottom-link .portal-icon { width: 20px; height: 20px; }
  .bottom-link[aria-current="page"], .bottom-link[aria-expanded="true"] { background: #c8f9eb; color: var(--accent); }
  .header-panel { inset: auto 0 var(--bottom-nav); width: 100%; max-height: calc(100dvh - var(--bottom-nav) - 10px); border-radius: 19px 19px 0 0; }
  .search { width: 100%; border-radius: 0; }
}
@media (max-width: 570px) {
  :root { --gutter: 11px; }
  .topbar-inner, .main-inner { width: calc(100% - 2 * var(--gutter)); }
  .brand img { width: 34px; height: 34px; }
  .brand-wordmark { font-size: 21px; }
  .home-feature { min-height: 237px; padding: 20px 18px; align-items: start; }
  .category-hero { min-height: 181px; padding: 18px 15px; }
  .category-hero h1, .home-feature h1 { max-width: 8ch; font-size: 39px; }
  .category-hero h1 { font-size: clamp(28px, 8vw, 40px); }
  .category-hero p { max-width: 24ch; margin-block: 6px 11px; }
  .category-hero-art, .home-art { top: auto; bottom: -2px; right: -12px; width: 62%; transform: none; }
  .home-art { width: 65%; }
  .hero-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .cozy-grid .category-card:last-child { grid-column: 1 / -1; }
  .category-card { grid-template-columns: 53px minmax(0, 1fr) auto; min-height: 78px; gap: 6px; padding-right: 7px; }
  .category-arrow { width: 19px; height: 23px; }
  .category-arrow .portal-icon { width: 12px; height: 12px; }
  .category-copy strong { font-size: 13px; }
  .category-copy small { font-size: 11px; }
  .section-head { align-items: end; }
  .section-head h2 { font-size: 20px; }
  .text-link { font-size: 12px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .shelf-track { grid-auto-columns: calc((100% - 9px) / 2); gap: 9px; }
  .listing-intro { padding: 18px 16px; }
  .listing-intro--category { grid-template-columns: minmax(0, 1fr) 90px; }
  .listing-art { width: 90px; }
  .listing-intro h1 { font-size: 33px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-footer { grid-template-columns: 1fr 1fr; }
  .page-footer .brand { grid-column: 1 / -1; }
  .suggestions[data-view="picks"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-controls { align-items: start; flex-wrap: wrap; }
  .control-group { width: 100%; justify-content: start; }
  .stage { aspect-ratio: 16 / 9; }
  .stage:has(.mode-group), .stage:has(.puzzle-screen) { min-height: 235px; }
  .start-cover { width: min(112px, 31vw); height: auto; }
  .stage-intro { gap: 6px; }
  .stage-intro strong { font-size: 18px; }
  .aside-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 375px) {
  .category-card { grid-template-columns: 48px minmax(0, 1fr); }
  .category-arrow { display: none; }
  .game-score-link { grid-template-columns: 1fr; }
  .game-score-link .score-cta { grid-area: auto; }
}
@media (min-width: 741px) and (pointer: fine) {
  .touch-pad { display: none; }
}
@media (hover: none) {
  .card-save { width: 44px; height: 44px; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
