@font-face {
  font-family: "InterVar";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2");
}

/* MyScape — Apple-style light theme */

:root {
  --bg: #f5f5f7;          /* page */
  --bg-deep: #ffffff;     /* panels, cards fallback */
  --darkest: #e8e8ed;     /* footer bottom strip */
  --card: #ffffff;        /* cards */
  --card-2: #f5f5f7;      /* hover surface */
  --card-3: #e8e8ed;      /* active surfaces, inputs */
  --accent: #0071e3;      /* apple blue */
  --accent-deep: #0077ed;
  --gold: #1d1d1f;        /* prices -> black */
  --gold-2: #0077ed;
  --gold-deep: #ffe3e3;   /* discount badge bg */
  --cta-text: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;      /* secondary */
  --text-3: #86868b;      /* tertiary */
  --strike: #86868b;
  --border: #d2d2d7;
  --bar: #e8e8ed;
  --rank: #e8e8ed;
  --search: #f5f5f7;
  --placeholder: #86868b;
  --btn2-a: #e8e8ed;      /* secondary button */
  --btn2-b: #e8e8ed;
  --btn2-text: #1d1d1f;
  --positive: #248a3d;
  --mixed: #b25000;
  --negative: #d70015;
  --glow: rgba(0,113,227,.12);
  --line: #e5e5e7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "InterVar", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* anchored sections clear the sticky header instead of hiding under it */
[id] { scroll-margin-top: 88px; }
a { color: var(--accent); }
img { display: block; }
.hidden { display: none !important; }
::selection { background: #0071e3; color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }

.page-main { min-height: 62vh; }

/* ---------- header (frosted dark, sticky) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(29,29,31,.85);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-text { color: #f5f5f7; font-size: 24px; font-weight: 800; letter-spacing: 4px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.main-nav {
  position: relative;
  display: inline-flex; gap: 3px; align-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 3px 5px;
  max-width: 100%;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-wrap { flex: 1; display: flex; justify-content: center; min-width: 0; }
.subnav { display: flex; justify-content: center; gap: 22px; padding: 0 0 12px; flex-wrap: wrap; }
.subnav a {
  color: rgba(255,255,255,.55); font-size: 12px; font-weight: 500; letter-spacing: .4px;
  text-decoration: none; padding: 2px 2px 4px; border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.subnav a:hover { color: rgba(255,255,255,.85); }
.subnav a.active { color: #fff; border-bottom-color: #0071e3; }
.presence-chip {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.85); font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 6px 12px; white-space: nowrap;
}
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: #34c759; box-shadow: 0 0 6px rgba(52,199,89,.8); }
.main-nav a {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.78); font-size: 13px; font-weight: 500; letter-spacing: .3px;
  text-decoration: none; padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
.main-nav a svg { flex: 0 0 auto; width: 13px; height: 13px; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.main-nav a.active { color: #1d1d1f; font-weight: 600; }
.main-nav a.active.menu-open { color: #1d1d1f; }
.main-nav a.menu-open { color: #fff; }
.main-nav a .nav-caret {
  width: 9px; height: 9px; margin-left: 2px;
  transition: transform .18s ease;
}
.main-nav a.menu-open .nav-caret { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
  min-width: 208px; padding: 6px;
  background: rgba(30,30,34,.94);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top center;
  pointer-events: none;
  transition: opacity .18s ease, transform .2s cubic-bezier(.22,.61,.36,1);
}
.nav-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.nav-menu::before {
  content: ""; position: absolute; top: -5px; left: 50%; margin-left: -5px;
  width: 10px; height: 10px; background: inherit; border-radius: 2px;
  border-left: 1px solid rgba(255,255,255,.14); border-top: 1px solid rgba(255,255,255,.14);
  transform: rotate(45deg);
}
.nav-menu a {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px;
  color: rgba(255,255,255,.85); font-size: 13px; font-weight: 500; text-decoration: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease, background .12s ease, color .12s ease;
  transition-delay: var(--d, 0ms);
}
.nav-menu a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-menu.open a { opacity: 1; transform: none; }
.nav-ind {
  position: absolute; z-index: 1; top: 3px; height: calc(100% - 6px);
  border-radius: 999px; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  transition: left .32s cubic-bezier(.22,.61,.36,1), width .32s cubic-bezier(.22,.61,.36,1);
  opacity: 0;
}

#global-search {
  background: rgba(255,255,255,.15); border: none; border-radius: 10px; color: #fff;
  font-size: 13px; padding: 8px 12px; width: 230px; outline: none;
}
#global-search::placeholder { color: rgba(255,255,255,.55); }
#global-search:focus { background: rgba(255,255,255,.22); box-shadow: 0 0 0 2px rgba(41,151,255,.6); }

.icon-btn {
  background: none; border: none; color: rgba(255,255,255,.85); cursor: pointer;
  padding: 7px 9px; position: relative; border-radius: 8px;
}
.icon-btn:hover { color: #fff; background: rgba(255,255,255,.12); }
.icon-btn svg { display: block; }
.badge {
  position: absolute; top: 1px; right: 0; background: #ff3b30; color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px;
  border-radius: 8px; text-align: center; padding: 0 4px;
}
.avatar-wrap { position: relative; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18);
  border: none; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
.avatar:hover { background: rgba(255,255,255,.3); }

/* dropdowns */
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
  min-width: 260px; padding: 10px; z-index: 100; text-align: left;
}
.dd-head { color: var(--text); font-size: 13px; padding: 4px 6px 10px; border-bottom: 1px solid rgba(0,0,0,.06); margin-bottom: 6px; }
.dd-link { display: block; color: var(--text); font-size: 13px; padding: 7px 10px; text-decoration: none; border-radius: 10px; }
.dd-link:hover { background: var(--card-2); color: var(--text); }
.dd-item { display: flex; gap: 8px; padding: 7px 10px; border-radius: 10px; cursor: pointer; align-items: flex-start; text-decoration: none; }
.dd-item:hover { background: var(--card-2); }
.dd-note { color: var(--text-2); font-size: 12px; padding: 8px; }

.search-wrap { position: relative; }
.search-dd {
  position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-height: 430px;
  overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 120; padding: 6px;
}
.dd-img { width: 38px; height: 51px; border-radius: 6px; flex: 0 0 auto; }
.dd-title { color: var(--text); font-size: 13px; line-height: 1.3; }
.dd-price { color: var(--text); font-size: 12px; margin-top: 2px; }
.dd-price.free { color: var(--text-2); }

/* ---------- buttons (pill) ---------- */
.btn-green {
  display: inline-block; background: #0071e3; color: #fff;
  border: none; border-radius: 980px; padding: 10px 22px; font-size: 14px;
  cursor: pointer; text-decoration: none; text-align: center; font-family: inherit; font-weight: 500;
  transition: background .15s;
}
.btn-green:hover { background: #0077ed; color: #fff; }
.btn-blue {
  display: inline-block; background: var(--btn2-a); color: var(--btn2-text);
  border: none; border-radius: 980px; padding: 10px 22px; font-size: 14px;
  cursor: pointer; text-decoration: none; text-align: center; font-family: inherit; font-weight: 500;
  transition: background .15s;
}
.btn-blue:hover { background: #e0e0e6; color: var(--text); }
.btn-dark {
  display: inline-block; background: transparent; color: var(--text); border: 1px solid var(--border);
  border-radius: 980px; padding: 10px 20px; font-size: 13px; cursor: pointer;
  text-decoration: none; text-align: center; font-family: inherit; font-weight: 500;
  transition: background .15s;
}
.btn-dark:hover { background: var(--card-2); color: var(--text); }
.btn-green.block, .btn-blue.block, .btn-dark.block { display: block; width: 100%; margin-top: 8px; }
.btn-green.small, .btn-blue.small { font-size: 12px; padding: 5px 12px; }
.install { font-size: 13px; padding: 8px 16px; }

/* ---------- store layout ---------- */
.store-layout { max-width: 1400px; margin: 0 auto; display: flex; gap: 24px; padding: 20px 20px 40px; }
.store-sidebar { width: 210px; flex: 0 0 auto; }
.side-head { font-size: 12px; letter-spacing: 1px; color: var(--text-2); text-transform: uppercase; margin: 0 0 6px; padding: 0 10px; }
.side-link {
  display: block; padding: 8px 10px; color: var(--text); font-size: 14px;
  text-decoration: none; border-radius: 10px; margin-bottom: 2px; cursor: pointer;
}
.side-link:hover { background: var(--card-3); color: var(--text); }
.side-link.active { background: var(--card-3); color: var(--text); font-weight: 600; }
.side-sep { height: 1px; background: rgba(0,0,0,.08); margin: 10px 0; }
.side-note { color: var(--text-3); font-size: 11px; padding: 4px 10px; }
.store-main { flex: 1; min-width: 0; }

/* ---------- sections ---------- */
.section { margin: 30px 0 6px; }
.section-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid rgba(0,0,0,.08); padding-bottom: 8px; margin-bottom: 14px; }
.section-title { color: var(--text); font-size: 16px; letter-spacing: .3px; text-transform: uppercase; font-weight: 700; margin: 0; }
.more-link { margin-left: auto; font-size: 12px; color: var(--accent); text-decoration: none; }
.more-link:hover { text-decoration: underline; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

/* ---------- game cards ---------- */
.game-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.game-card:hover {
  background: #fff; z-index: 30;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  transform: translateY(-4px);
}
.card-cover { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 13px 13px 0 0; }
.card-price-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; gap: 8px; }
.card-price { color: var(--text); font-size: 13px; }
.card-price.disc { color: var(--text); font-weight: 600; }
.card-price.free { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); }
.card-disc { background: var(--gold-deep); color: var(--negative); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }

/* hover panel */
.hover-panel {
  display: none; position: absolute; top: 0; left: 0; width: 320px; z-index: 40;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.18);
  border-radius: 16px; padding: 14px;
}
.game-card:hover .hover-panel { display: block; }
.hp-title { color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.hp-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hp-shots img { width: 100%; border-radius: 6px; }
.hp-tags { color: var(--text-2); font-size: 12px; margin-top: 8px; }
.hp-review { color: var(--text-2); font-size: 12px; margin-top: 6px; }
.hp-review .pos { color: var(--positive); }
.hp-review .mid { color: var(--mixed); }
.hp-review .neg { color: var(--negative); }
.hp-price-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.hp-org { color: var(--strike); text-decoration: line-through; font-size: 12px; }
.hp-disc { color: var(--text); font-size: 15px; font-weight: 600; }
.hp-price-free { color: var(--text); font-size: 14px; }
.hp-price-row .btn-green, .hp-price-row .btn-blue { margin-left: auto; }

/* ---------- hero carousel ---------- */
.hero { position: relative; height: 400px; border-radius: 18px; overflow: hidden; background: var(--card); }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .7s;
  background-size: cover; background-position: center;
}
.hero-slide.active { opacity: 1; }
.hero-slide.vid { background: #05050a; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-sound {
  position: absolute; right: 18px; bottom: 18px; z-index: 3;
  background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; font-family: inherit; cursor: pointer;
  backdrop-filter: blur(8px); transition: background .15s ease;
}
.hero-sound:hover { background: rgba(0,0,0,.75); }
.hero-content {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 28px; gap: 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.6) 100%);
}
.hero-kicker { color: rgba(255,255,255,.65); font-size: 12px; letter-spacing: 2px; margin-bottom: 6px; }
.hero-title { color: #fff; font-size: 34px; margin: 0 0 8px; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.hero-tag { color: #eaf4ff; font-size: 15px; margin-bottom: 6px; }
.hero-tags { color: rgba(255,255,255,.85); font-size: 13px; }
.hero-pricebox {
  background: rgba(255,255,255,.9); border-radius: 14px; padding: 16px 20px; min-width: 210px; flex: 0 0 auto;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.hp-title-sm { color: var(--text); font-size: 15px; margin-bottom: 8px; }
.hp-price-big { color: var(--text); font-size: 22px; font-weight: 600; margin: 6px 0 12px; }
.hp-price-big.free { color: var(--text-2); font-size: 17px; }
.hero-btns { display: flex; gap: 8px; }
.hero-wish { display: block; margin-top: 10px; font-size: 12px; color: var(--text-2); cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; }
.hero-wish:hover { color: var(--accent); }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  background: rgba(29,29,31,.4); border: none; color: #fff; font-size: 24px;
  width: 38px; height: 60px; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
  transition: background .15s;
}
.hero-arrow:hover { background: rgba(0,113,227,.6); color: #fff; }
.hero-arrow.prev { left: 12px; }
.hero-arrow.next { right: 12px; }
.hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 6; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; border: none; padding: 0; }
.dot.active { background: #fff; }

/* ---------- top sellers ---------- */
.top-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.top-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.top-row:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.rank { width: 26px; height: 26px; flex: 0 0 auto; background: var(--rank); color: var(--text); border-radius: 8px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.top-thumb { width: 38px; height: 51px; border-radius: 6px; flex: 0 0 auto; object-fit: cover; }
.top-body { flex: 1; min-width: 0; }
.top-title { color: var(--text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-meta { color: var(--text-2); font-size: 11px; margin-top: 2px; }
.top-price { flex: 0 0 auto; color: var(--text); font-size: 13px; }
.top-price.disc { color: var(--text); font-weight: 600; }

/* ---------- genre cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cat-card {
  height: 96px; border-radius: 14px; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px 14px; color: #fff; text-decoration: none; position: relative; overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.cat-card:hover { filter: brightness(1.12); }
.cat-name { font-size: 18px; font-weight: 700; }
.cat-count { font-size: 12px; opacity: .85; margin-top: 3px; }

/* ---------- game detail ---------- */
.detail { max-width: 1400px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 24px; align-items: start; }
.breadcrumb { grid-column: 1/-1; font-size: 12px; color: var(--text-2); margin: 0 0 6px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.detail-main { min-width: 0; }
.media-main { width: 100%; aspect-ratio: 16/9; display: block; border-radius: 14px; background: var(--card); object-fit: cover; }
.media-thumbs { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; margin-top: 6px; }
.media-thumb { width: 100%; aspect-ratio: 16/9; border-radius: 8px; cursor: pointer; border: 2px solid transparent; object-fit: cover; opacity: .85; }
.media-thumb:hover { opacity: 1; }
.media-thumb.active { border-color: var(--accent); opacity: 1; }
.block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-top: 14px; }
.block-title { color: var(--text); font-size: 15px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 10px; font-weight: 700; }
.about-text p { color: #4d4d52; font-size: 14px; line-height: 1.65; margin: 0 0 10px; }
.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.spec-col h4 { color: var(--text); font-size: 13px; margin: 0 0 8px; }
.spec-row { color: var(--text); font-size: 12px; line-height: 1.9; }
.spec-row span { color: var(--text-2); margin-right: 6px; }
.review-bar-row { display: flex; align-items: center; gap: 12px; font-size: 13px; margin: 8px 0; color: var(--text); flex-wrap: wrap; }
.rb-label { color: var(--text-2); width: 110px; flex: 0 0 auto; }
.review-bar { flex: 1; min-width: 140px; height: 7px; background: var(--bar); border-radius: 4px; overflow: hidden; }
.review-fill { height: 100%; background: #34c759; }
.review-fill.mid { background: #ff9500; }
.review-fill.neg { background: #ff3b30; }
.rb-pct { color: var(--text-2); font-size: 12px; }

/* buy box */
.buy-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; position: sticky; top: 80px; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.buy-img { width: 100%; border-radius: 10px; }
.buy-title { color: var(--text); font-size: 19px; margin: 12px 0 6px; }
.buy-review { color: var(--text-2); font-size: 12px; margin-bottom: 8px; }
.buy-review .pos { color: var(--positive); }
.buy-review .mid { color: var(--mixed); }
.buy-review .neg { color: var(--negative); }
.buy-tags { margin-bottom: 10px; line-height: 1.9; }
.tag { color: var(--accent); font-size: 13px; text-decoration: none; margin-right: 6px; }
.tag:hover { text-decoration: underline; }
.buy-meta { border-top: 1px solid rgba(0,0,0,.06); padding-top: 10px; margin-bottom: 12px; }
.meta-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); line-height: 2; gap: 12px; }
.meta-row b { color: var(--text); font-weight: 400; text-align: right; }
.price-block { background: var(--card-2); border-radius: 10px; padding: 14px; }
.price-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.price-org { color: var(--strike); text-decoration: line-through; font-size: 12px; }
.price-final { color: var(--text); font-size: 20px; font-weight: 600; }
.price-final.free { color: var(--text-2); font-size: 16px; }
.owned-note { color: var(--text-2); font-size: 12px; margin-bottom: 10px; }

/* ---------- library ---------- */
.library { max-width: 1400px; margin: 0 auto; display: flex; gap: 20px; padding: 20px; align-items: flex-start; }
.lib-sidebar { width: 200px; flex: 0 0 auto; }
.lib-main { flex: 1; min-width: 0; }
.lib-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.lib-search { background: var(--search); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 10px; flex: 1; max-width: 340px; outline: none; font-family: inherit; }
.lib-search::placeholder { color: var(--placeholder); }
.lib-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.15); }
.lib-sort { background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.lib-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; position: relative; transition: box-shadow .15s, transform .15s; }
.lib-card:hover { box-shadow: 0 10px 24px rgba(0,0,0,.1); transform: translateY(-3px); }
.lib-cover { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.lib-info { padding: 10px 12px; }
.lib-title { color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-hours { color: var(--text-2); font-size: 11px; margin-top: 3px; }
.lib-play { position: absolute; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.lib-card:hover .lib-play { opacity: 1; }
.fav-star {
  position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.45); border: none;
  color: rgba(255,255,255,.9); font-size: 15px; cursor: pointer; border-radius: 999px; padding: 4px 9px;
  opacity: 0; transition: opacity .15s; font-family: inherit;
}
.lib-card:hover .fav-star { opacity: 1; }
.fav-star.on { color: #ff9500; opacity: 1; }

/* ---------- empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.empty-state p { color: var(--text-2); font-size: 15px; margin: 0 0 16px; }

/* ---------- cart ---------- */
.cart-page { max-width: 1100px; margin: 0 auto; padding: 30px 20px; display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.cart-h1 { color: var(--text); font-size: 24px; font-weight: 700; margin: 0 0 16px; }
.cart-item { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; align-items: center; }
.cart-img { width: 64px; height: 86px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.cart-info { flex: 1; min-width: 0; }
.cart-title { color: var(--text); font-size: 15px; }
.cart-tags { color: var(--text-2); font-size: 12px; margin-top: 4px; }
.cart-remove { color: var(--text-2); font-size: 12px; text-decoration: underline; cursor: pointer; background: none; border: none; padding: 0; margin-top: 8px; font-family: inherit; }
.cart-remove:hover { color: var(--accent); }
.cart-price { color: var(--text); font-size: 16px; flex: 0 0 auto; font-weight: 600; }
.cart-price.free { color: var(--text-2); }
.cart-summary { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.sum-row { display: flex; justify-content: space-between; color: var(--text); font-size: 13px; padding: 5px 0; }
.sum-row .save { color: var(--positive); }
.sum-total { display: flex; justify-content: space-between; color: var(--text); font-size: 16px; font-weight: 700; border-top: 1px solid rgba(0,0,0,.08); margin-top: 8px; padding-top: 12px; }
.sum-note { color: var(--text-2); font-size: 11px; margin-top: 12px; line-height: 1.5; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 18px; padding: 28px 30px; max-width: 480px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 85vh; overflow: auto; }
.modal h2 { color: var(--text); font-size: 20px; margin: 12px 0 6px; }
.modal p { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.modal-check { width: 56px; height: 56px; border-radius: 50%; background: #34c759; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto; }
.modal-list { text-align: left; margin: 14px 0; color: var(--text); font-size: 14px; line-height: 1.8; }
.modal-btns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ---------- community ---------- */
.comm-layout { max-width: 1100px; margin: 0 auto; padding: 30px 20px 50px; }
.comm-tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(0,0,0,.08); margin-bottom: 16px; }
.comm-tab { padding: 9px 16px; color: var(--text-2); cursor: pointer; font-size: 14px; border-radius: 10px 10px 0 0; user-select: none; }
.comm-tab:hover { color: var(--text); }
.comm-tab.active { background: var(--card-3); color: var(--text); font-weight: 600; }
.comm-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.comm-search { background: var(--search); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 10px; flex: 1; max-width: 360px; outline: none; font-family: inherit; }
.comm-search::placeholder { color: var(--placeholder); }
.thread { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); padding: 14px 16px; border-radius: 14px; margin-bottom: 8px; }
.thread-cat { font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 3px 8px; border-radius: 6px; flex: 0 0 auto; color: #fff; }
.cat-general { background: #5a4a8f; }
.cat-help { background: #8f3a2f; }
.cat-mods { background: #6d4fd0; }
.cat-shots { background: #2f6b5c; }
.thread-body { flex: 1; min-width: 0; }
.thread-title { color: var(--accent); font-size: 15px; cursor: pointer; }
.thread-title:hover { text-decoration: underline; }
.thread-meta { color: var(--text-2); font-size: 12px; margin-top: 3px; }
.thread-replies { color: var(--text-2); font-size: 12px; text-align: right; flex: 0 0 auto; line-height: 1.6; }

/* ---------- about ---------- */
.about-hero { text-align: center; padding: 70px 20px 60px; background: radial-gradient(1200px 500px at 50% -10%, #ffffff 0%, var(--bg) 60%); }
.about-logo svg { width: 110px; height: 110px; }
.about-h1 { color: var(--text); font-size: 44px; letter-spacing: 8px; margin: 18px 0 6px; }
.about-tag { color: var(--accent); font-size: 18px; margin: 0 0 26px; }
.about-block { max-width: 1000px; margin: 0 auto; padding: 30px 20px 60px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 34px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 14px; text-align: center; }
.stat-num { color: var(--accent); font-size: 30px; font-weight: 700; }
.stat-label { color: var(--text-2); font-size: 12px; margin-top: 6px; }
.about-copy { max-width: 760px; margin: 0 auto; }
.about-copy h2 { color: var(--text); font-size: 18px; margin: 26px 0 8px; }
.about-copy p { color: #4d4d52; font-size: 14px; line-height: 1.7; margin: 0 0 10px; }
.about-cta { text-align: center; margin-top: 30px; }

/* ---------- hero band (page headers) ---------- */
.hero-band {
  position: relative; overflow: hidden;
  padding: 64px 20px 54px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
.hero-band-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 280px at 18% -20%, rgba(0,113,227,.14), transparent 70%),
    radial-gradient(520px 260px at 85% -10%, rgba(122,91,214,.16), transparent 70%);
}
.hero-band-inner { position: relative; max-width: 1100px; margin: 0 auto; text-align: center; }
.hb-media { margin-bottom: 14px; }
.hb-media svg { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.hb-eyebrow { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 10px; }
.hb-eyebrow.plain { text-transform: none; letter-spacing: .4px; font-weight: 600; }
.hb-title { margin: 0; font-size: 52px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: var(--text); }
.hb-title .accent { background: linear-gradient(92deg, #0071e3, #7a5bd6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hb-sub { margin: 14px auto 0; max-width: 560px; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.hb-meta { margin-top: 10px; color: var(--text-2); font-size: 13px; }
.hb-cta { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hb-form { max-width: 460px; margin: 18px auto 0; text-align: left; }
.hb-stats { margin-top: 30px; display: flex; gap: 44px; justify-content: center; flex-wrap: wrap; }
.hb-stat { text-align: center; min-width: 90px; }
.hb-num {
  font-size: 38px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(92deg, #0071e3, #7a5bd6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hb-label { margin-top: 2px; color: var(--text-2); font-size: 13px; }
.hero-band.slim { padding: 44px 20px 40px; }
.hero-band.slim .hb-title { font-size: 40px; }
.hero-band.slim .hb-sub { font-size: 15px; }
@media (max-width: 800px) {
  .hb-title { font-size: 36px; }
  .hero-band.slim .hb-title { font-size: 30px; }
  .hb-stats { gap: 26px; }
}

/* ---------- atlas (home feed of work in progress) ---------- */
.atlas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 26px; }
.atlas-chip { background: var(--btn2-a); color: var(--text-2); border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 500; }
.shelf-note { color: var(--text-2); font-size: 13px; margin: 0 0 4px; }
.atlas-note { color: var(--text-3); font-size: 12px; margin: 0 0 14px; }

/* ---------- home: places band (dark doorways on the light page) ---------- */
.home-places { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.hp-card {
  display: block; text-decoration: none; overflow: hidden; border-radius: 14px;
  background: #0b1017; border: 1px solid rgba(0,0,0,.14);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.hp-card:hover { transform: translateY(-3px); border-color: rgba(0,0,0,.22); box-shadow: 0 16px 34px rgba(0,0,0,.18); }
.hp-art { aspect-ratio: 16 / 9; overflow: hidden; background: #070b10; }
.hp-art svg { display: block; width: 100%; height: 100%; }
.hp-body { padding: 11px 13px 13px; }
.hp-kind {
  display: flex; align-items: baseline; gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
}
.hp-kind-label { color: var(--hp-accent, #4fd1ff); }
.hp-sep { color: rgba(255,255,255,.24); letter-spacing: 0; }
.hp-region { color: #6f859b; }
.hp-name { margin-top: 5px; font-size: 15px; font-weight: 650; letter-spacing: -.2px; color: #f4f8fd; }
.hp-tag {
  margin-top: 4px; min-height: 35px; font-size: 12px; line-height: 1.45; color: #93a7bb;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hp-by { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 11px; color: #8fa3b8; }
.hp-by svg { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; }
@media (max-width: 900px) { .home-places { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .home-places { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { background: #fafafc; margin-top: 50px; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 34px 20px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.footer-brand .logo-text { display: block; margin-top: 8px; font-size: 18px; letter-spacing: 3px; color: var(--text); font-weight: 700; }
.footer-brand p { color: var(--text-2); font-size: 13px; margin-top: 8px; line-height: 1.6; max-width: 280px; }
.footer-brand a { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 12px; text-decoration: none; }
.footer-brand a:hover { text-decoration: underline; }
.footer-col h4 { color: var(--text); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 10px; }
.footer-col a { display: block; color: var(--text-2); font-size: 13px; text-decoration: none; margin-bottom: 7px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { background: var(--bg); padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-3); flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 400; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.toast {
  background: rgba(255,255,255,.9); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 13px; padding: 11px 16px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgba(0,0,0,.15); opacity: 1; transition: opacity .4s;
}
.toast.out { opacity: 0; }

/* ---------- launch overlay (dark, game-launch feel) ---------- */
.launch-overlay {
  position: fixed; inset: 0; background: rgba(10,10,12,.96); z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; cursor: pointer;
}
.launch-logo svg { width: 90px; height: 90px; display: block; }
.launch-title { color: #fff; font-size: 22px; }
.launch-bar { width: 340px; max-width: 80vw; height: 6px; background: #3a3a3c; border-radius: 3px; overflow: hidden; }
.launch-fill { height: 100%; width: 0; background: #0071e3; }
.launch-note { color: #98989d; font-size: 13px; min-height: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .store-sidebar { display: none; }
  .detail { grid-template-columns: 1fr; }
  .buy-box { position: static; }
  .cart-page { grid-template-columns: 1fr; }
  .lib-sidebar { display: none; }
  .top-list { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 26px; }
  .nav-wrap { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .main-nav { max-width: 100%; }
}

/* ---------- phones ---------- */
/* .header-actions defaults to min-width:auto, so its intrinsic width (~444px)
   refuses to shrink below the viewport and pushes the whole document wider on
   every page — that was the 71px horizontal scroll on a 390px screen. */
.header-actions { min-width: 0; }
.main-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }

@media (max-width: 720px) {
  .header-inner { padding: 0 14px; }
  .header-top {
    gap: 8px 10px;
    padding: 10px 0;
    align-items: center;
  }
  .logo { flex: 0 0 auto; }
  .logo-text { font-size: 18px; letter-spacing: 3px; }
  .logo svg { width: 30px; height: 30px; }

  /* the nav becomes a horizontally scrollable chip row under the logo */
  .nav-wrap {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    min-width: 0;
    padding-bottom: 2px;
  }
  .main-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding: 3px 6px;
  }
  .main-nav a { white-space: nowrap; flex: 0 0 auto; }
  .main-nav a span { display: inline; }

  /* actions: search collapses to an icon-sized field, text buttons stay tappable */
  .header-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    flex-wrap: nowrap;
  }
  #global-search { width: 96px; font-size: 12px; padding: 7px 9px; }
  #global-search:focus { width: 132px; }
  .icon-btn { padding: 6px 5px; }
  .presence-chip { display: none; }
  .btn-green.install, #auth-area .btn-green {
    padding: 6px 9px;
    font-size: 11px;
    letter-spacing: 0.02em;
  }
  #auth-area { flex: 0 0 auto; }

  /* content rhythm */
  .page-main { min-height: 50vh; }
  .cart-page, .profile-wrap, .fr-wrap { padding-left: 14px; padding-right: 14px; }

  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; padding: 26px 14px; }
  .media-thumbs { grid-template-columns: repeat(3,1fr); }
  .specs-grid { grid-template-columns: 1fr; }
  .atlas-grid { grid-template-columns: 1fr; }
  .hp-shots { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .logo-text { font-size: 16px; letter-spacing: 2px; }
  /* below this the search field costs more than it earns; the icon stays */
  #global-search { width: 74px; }
  #global-search:focus { width: 104px; }
  .header-actions { gap: 2px; }
  .btn-green.install, #auth-area .btn-green { padding: 6px 8px; font-size: 10.5px; }
  .stat-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
