
:root {
  --bg: #f6f7fb; --bg2: #ffffff; --text: #141826; --muted: #5d6478; --line: #e3e6ef;
  --accent: #6d4aff; --accent2: #ff7a45; --card: #ffffff; --shadow: 0 10px 30px rgba(20, 24, 38, .08);
  --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f17; --bg2: #141724; --text: #eef0f7; --muted: #9aa1b6; --line: #252a3b;
    --card: #161a28; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f17; --bg2: #141724; --text: #eef0f7; --muted: #9aa1b6; --line: #252a3b;
  --card: #161a28; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 "Plus Jakarta Sans", system-ui, sans-serif; }
a { color: var(--accent); }
img, svg { display: block; max-width: 100%; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }

/* header */
.top { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 80%, transparent); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; font-size: 18px; }
.brand i { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 15px; }
.top nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.top nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.top nav a:hover, .top nav a.on { color: var(--text); background: var(--bg2); }
.theme { border: 1px solid var(--line); background: var(--bg2); color: var(--text); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 16px; }

/* hero */
.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -.02em; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 18px; }

/* search + filters */
.tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 32px 0 28px; }
.search { flex: 1 1 260px; max-width: 420px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; }
.chip { border: 1px solid var(--line); background: var(--bg2); color: var(--muted); padding: 10px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 500; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* game cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-bottom: 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.game { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.game:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20, 24, 38, .16); }
.game .row { display: flex; gap: 14px; align-items: center; }
.icon { width: 64px; height: 64px; flex: none; border-radius: 18px; padding: 10px; }
.icon:has(img) { padding: 0; overflow: hidden; background: none !important; }
.icon img { width: 100%; height: 100%; object-fit: cover; }
.icon.big { width: 112px; height: 112px; border-radius: 28px; padding: 18px; }
.game h3 { margin: 0; font-size: 18px; }
.game p { margin: 0; color: var(--muted); font-size: 15px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.empty { text-align: center; color: var(--muted); grid-column: 1 / -1; padding: 40px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 14px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.btn.main { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.btn.ghost { background: var(--bg2); color: var(--text); border: 1px solid var(--line); }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }

/* detail page */
.detail { padding: 48px 0 64px; }
.dhead { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.dhead h1 { margin: 0 0 6px; font-size: clamp(28px, 5vw, 44px); line-height: 1.1; }
.dhead p { margin: 0 0 14px; color: var(--muted); font-size: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 36px; }
.cols h2 { margin-top: 0; font-size: 20px; }
.feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feats li { display: flex; gap: 10px; }
.feats li::before { content: "✓"; color: var(--accent); font-weight: 800; }
.links a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; }
.links a:last-child { border-bottom: 0; }
.shots { display: flex; gap: 14px; overflow-x: auto; padding: 8px 0 16px; scroll-snap-type: x mandatory; margin-top: 28px; }
.shot { flex: none; width: 200px; aspect-ratio: 9 / 19; border-radius: 26px; display: grid; place-items: center; scroll-snap-align: start; color: #fff; font-weight: 700; text-align: center; padding: 20px; }
.shot img { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; }

/* forms */
.form { display: grid; gap: 16px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
input, select, textarea { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); }
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus, .search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.types { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.types legend { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.types input { position: absolute; opacity: 0; }
.types label { display: inline-block; cursor: pointer; }
.types span { display: inline-block; border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; background: var(--bg2); color: var(--muted); }
.types input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.types input:focus-visible + span { outline: 2px solid var(--accent); }
.msg { padding: 14px; border-radius: 12px; display: none; }
.msg.ok { display: block; background: #e6f8ee; color: #136b3a; }
.msg.bad { display: block; background: #fde8e8; color: #9b1c1c; }
.hp { display: none; }

/* plain pages (about, privacy, terms) */
.page { width: min(760px, 100% - 32px); margin: 0 auto; padding: 40px 0 64px; }
body > main:not([class]) { width: min(760px, 100% - 32px); margin: 0 auto; padding: 32px 0 64px; }
body > main:not([class]) > nav a { text-decoration: none; font-weight: 500; }
body > main:not([class]) h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; }
body > main:not([class]) > footer { margin-top: 40px; color: var(--muted); }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; }
.foot a { color: var(--muted); text-decoration: none; margin-right: 16px; }
.foot a:hover { color: var(--text); }

@media (max-width: 720px) {
  .cols, .form .two { grid-template-columns: 1fr; }
  .top nav a { padding: 8px; }
  .hero { padding: 48px 0 24px; }
  .brand b { display: none; }
}

/* ===== app store layout ===== */
.home { padding-top: 24px; padding-bottom: 48px; }
.hero-slider { position: relative; border-radius: 28px; overflow: hidden; min-height: 280px; box-shadow: var(--shadow); }
.slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 36px 44px; color: #fff; opacity: 0; transition: opacity .6s; pointer-events: none; }
.slide.on { opacity: 1; pointer-events: auto; position: relative; }
.slide-txt { max-width: 560px; }
.slide small { opacity: .85; font-weight: 600; letter-spacing: .02em; }
.slide h2 { font-size: clamp(26px, 4.5vw, 42px); line-height: 1.1; margin: 6px 0 10px; }
.slide p { margin: 0 0 20px; opacity: .92; font-size: 17px; }
.slide-icon { width: 170px; flex: none; padding: 26px; border-radius: 40px; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); transform: rotate(-6deg); }
.dots { position: absolute; left: 44px; bottom: 18px; display: flex; gap: 8px; }
.dots button { width: 9px; height: 9px; border-radius: 99px; border: 0; padding: 0; background: rgba(255,255,255,.5); cursor: pointer; transition: width .3s; }
.dots button.on { width: 26px; background: #fff; }
.btn.white { background: #fff; color: #141826; }
.btn.glass { background: rgba(255,255,255,.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.btn.big { padding: 14px 36px; font-size: 17px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.shelf { margin: 36px 0 8px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; }
.shelf-head h2 { font-size: 22px; margin: 0 0 14px; }
.shelf-head a { font-weight: 600; text-decoration: none; }
.scroller { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; }
.app { flex: none; width: 128px; text-decoration: none; color: var(--text); scroll-snap-align: start; display: grid; gap: 4px; }
.app .icon { width: 128px; height: 128px; border-radius: 30px; padding: 22px; box-shadow: var(--shadow); transition: transform .2s; }
.app:hover .icon { transform: translateY(-3px) scale(1.03); }
.app b { font-size: 15px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app small { color: var(--muted); font-size: 13px; }
#results.grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); padding-top: 8px; }
#results .guide { grid-column: 1 / -1; }

.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.guide { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: transform .2s, box-shadow .2s; }
.guide:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.gthumb { width: 72px; height: 72px; flex: none; border-radius: 16px; padding: 14px; }
.gthumb img { border-radius: 16px; }
.guide small { color: var(--accent); font-weight: 600; font-size: 12px; }
.guide b { display: block; line-height: 1.3; margin: 2px 0 4px; }
.guide p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* game page */
.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.dev { color: var(--accent) !important; font-weight: 600; font-size: 16px !important; margin: 0 0 14px !important; }
.facts { display: flex; margin: 0 0 20px; }
.facts div { padding: 0 20px; border-left: 1px solid var(--line); text-align: center; display: grid; }
.facts div:first-child { border-left: 0; padding-left: 0; }
.facts b { font-size: 16px; }
.facts small { color: var(--muted); font-size: 12px; }
.cols > div, .cols > aside { display: grid; gap: 20px; align-content: start; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; font-weight: 600; }
.shot.ph { flex-direction: column; gap: 18px; display: flex; justify-content: center; align-items: center; }
.shot.ph svg { width: 70px; }
.review { padding: 12px 0; border-bottom: 1px solid var(--line); }
.stars { color: #f5a623; letter-spacing: 1px; }

/* guides / articles */
.page-wide { padding: 40px 0 64px; }
.article { width: min(760px, 100% - 32px); padding: 32px 0 64px; }
.article h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.15; margin: 0 0 8px; }
.article h2 { margin-top: 32px; }
.article li { margin: 6px 0; }
.get { display: flex; align-items: center; gap: 14px; margin: 32px 0; }
.get .icon { width: 64px; height: 64px; }
.get div:nth-child(2) { flex: 1; display: grid; }
.get small { color: var(--muted); }

/* ad slot */
.ad { margin: 28px 0; padding: 8px; border-radius: 16px; border: 1px dashed var(--line); min-height: 100px; }
.ad span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .hero-slider { min-height: 340px; border-radius: 22px; }
  .slide { padding: 28px 22px 48px; flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; }
  .slide-icon { width: 84px; padding: 14px; border-radius: 22px; }
  .dots { left: 22px; }
  .app, .app .icon { width: 104px; }
  .app .icon { height: 104px; border-radius: 24px; padding: 18px; }
  .facts div { padding: 0 12px; }
  .dhead .icon.big { width: 88px; height: 88px; border-radius: 22px; padding: 14px; }
}
.cols > *, .dhead > div { min-width: 0; }
h1, h2 { overflow-wrap: break-word; }
@media (max-width: 480px) {
  .top .wrap { gap: 8px; }
  .top nav { gap: 0; }
  .top nav a { padding: 6px 7px; font-size: 14px; }
  .theme { width: 32px; height: 32px; }
  .facts div { padding: 0 9px; }
  .facts b { font-size: 14px; }
}
/* slider: stack all slides in one grid cell so the box = tallest slide (no gap) */
.hero-slider { display: grid; min-height: 0; }
.slide, .slide.on { position: relative; grid-area: 1 / 1; inset: auto; min-height: 280px; }
.slide-phone { flex: none; width: 150px; align-self: stretch; margin: -36px 0 -80px; padding-top: 28px; }
.slide-phone img { width: 100%; border-radius: 22px; border: 5px solid rgba(255,255,255,.9); box-shadow: 0 20px 40px rgba(0,0,0,.3); transform: rotate(4deg); }
.hero-slider { overflow: hidden; }
@media (max-width: 720px) { .slide-phone { display: none; } }
.shot:has(img) { padding: 0; width: 220px; box-shadow: var(--shadow); }
.icon:has(img), .gthumb:has(img), .slide-icon:has(img) { padding: 0 !important; overflow: hidden; }
.gthumb img, .slide-icon img { width: 100%; height: 100%; object-fit: cover; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }

/* ===== phone layout: bottom tab bar like an app store ===== */
.tabbar { display: none; }
@media (max-width: 720px) {
  .top .wrap { height: 56px; }
  .brand { font-size: 17px; }
  .brand b { display: inline; }
  .top nav a { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg2) 92%, transparent);
    backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; border-radius: 14px; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a.on svg { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 12px; padding: 2px 14px; width: 52px; box-sizing: content-box; height: 22px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  .home { padding-top: 14px; }
  .hero-slider { min-height: 0; border-radius: 22px; }
  .slide, .slide.on { min-height: 230px; padding: 22px 20px 40px; flex-direction: row; align-items: center; }
  .slide h2 { font-size: 24px; }
  .slide p { font-size: 15px; margin-bottom: 16px; }
  .slide-icon { display: none; }
  .dots { left: 20px; bottom: 14px; }
  .tools { margin: 18px 0 6px; gap: 10px; }
  .search { flex-basis: 100%; max-width: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; justify-content: flex-start; padding-bottom: 4px; }
  .chip { flex: none; padding: 8px 16px; }
  .shelf { margin: 24px 0 4px; }
  .shelf-head h2 { font-size: 19px; }
  .scroller { gap: 14px; margin-right: -16px; padding-right: 16px; }
  .app, .app .icon { width: 92px; }
  .app .icon { height: 92px; border-radius: 22px; padding: 16px; }
  .app b { font-size: 14px; }
  .guides { grid-template-columns: 1fr; }

  /* game page */
  .detail { padding: 16px 0 32px; }
  .crumbs { margin-bottom: 14px; }
  .dhead { gap: 16px; align-items: flex-start; }
  .dhead > div:last-child { flex: 1 1 200px; }
  .dhead h1 { font-size: 26px; }
  .facts { overflow-x: auto; margin: 0 0 16px; }
  .facts div { flex: none; }
  .actions { width: 100%; }
  .actions .btn.big { flex: 1; justify-content: center; padding: 14px; }
  .shots { margin-top: 18px; gap: 10px; margin-right: -16px; padding-right: 16px; }
  .shot, .shot:has(img) { width: 150px; border-radius: 18px; }
  .shot img { border-radius: 18px; }
  .cols { margin-top: 18px; gap: 14px; }
  .card { padding: 18px; border-radius: 18px; }
  .page, .page-wide, .article { padding-top: 24px; }
  .form .two { gap: 16px; }
  input, select, textarea { font-size: 16px; } /* no zoom on focus (iOS) */
  .foot .wrap { flex-direction: column; }
  .foot a { display: inline-block; padding: 6px 0; margin-right: 14px; }
}
@media (max-width: 720px) {
  .dhead { display: grid; grid-template-columns: 84px 1fr; column-gap: 14px; row-gap: 0; align-items: center; }
  .dhead > div:last-child { display: contents; }
  .dhead .icon.big { grid-row: 1 / 3; width: 84px; height: 84px; border-radius: 20px; }
  .dhead h1 { grid-column: 2; align-self: end; font-size: 22px; margin: 0; }
  .dhead .dev { grid-column: 2; align-self: start; margin: 4px 0 0 !important; font-size: 14px !important; }
  .dhead .facts, .dhead .actions { grid-column: 1 / -1; }
  .facts { margin: 18px 0 16px; justify-content: space-between; overflow: visible; }
  .facts div { flex: 1; padding: 0 4px; }
  .facts b { font-size: 14px; }
  .facts small { font-size: 11px; }
}
.scroller, .shots, .chips, .facts { scrollbar-width: none; }
.scroller::-webkit-scrollbar, .shots::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }

/* ===== banner v2: layered look instead of flat colour ===== */
.slide { isolation: isolate; overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(255,255,255,.38), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(0,0,0,.35), transparent 55%),
    linear-gradient(125deg, var(--c1), var(--c2)); }
.slide::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--shot) right 12% center / 48% auto no-repeat;
  filter: blur(14px) saturate(1.3); opacity: .45; transform: scale(1.15); }
.slide::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.22) 1.2px, transparent 1.4px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 75%); mask-image: linear-gradient(100deg, transparent 35%, #000 75%); }
.slide-txt { position: relative; }
.slide-app { display: flex; align-items: center; gap: 10px; }
.slide-app .mini { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex: none; box-shadow: 0 6px 16px rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.7); background: rgba(255,255,255,.15); }
.slide-app .mini img, .slide-app .mini svg { width: 100%; height: 100%; object-fit: cover; }
.slide-app small { background: rgba(0,0,0,.22); padding: 5px 12px; border-radius: 999px; backdrop-filter: blur(6px); opacity: 1; }
.slide h2 { text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.btn.white { box-shadow: 0 8px 20px rgba(0,0,0,.2); }
@media (max-width: 720px) {
  .slide::before { background-position: right -30px center; background-size: 70% auto; opacity: .35; }
  .slide-app .mini { width: 38px; height: 38px; }
}
