:root {
  --bg: #0b0b12;
  --panel: #14141d;
  --panel2: #1c1c28;
  --panel3: #262636;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f4f8;
  --muted: #a0a0b6;
  --faint: #6c6c82;
  --accent: #ff4f6d;
  --accent2: #ffb547;
  --link: #6fd3ff;
  --ok: #3ddc97;
  --warn: #ffb547;
  --danger: #ff5d5d;
  --grad: linear-gradient(135deg, #ff4f6d, #ffb547);
  --radius: 14px;
  --side: 224px;
  --sidew: 340px;
  --tabbar: 54px;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.js .ssr { display: none; } /* plain-HTML page version for no-JS readers (see web/js/boot.js) */
.ssr { overflow-y: auto; height: 100%; line-height: 1.8; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: flex; height: 100dvh; width: 100%; overflow: hidden; }
.view { flex: 1; min-width: 0; height: 100%; position: relative; overflow: hidden; }
.view.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.sidenav { width: var(--side); flex: none; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: 0.2px; color: var(--text); padding: 4px 8px 16px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.navlink { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 15px; }
.navlink:hover { background: var(--panel2); text-decoration: none; }
.navlink.active { background: var(--panel2); color: var(--accent); }
.navlink .ico { width: 22px; text-align: center; font-size: 18px; }
.sidenav .spacer { flex: 1; }
.sidenav .me { padding: 10px 12px; border-top: 1px solid var(--line); margin-top: 8px; font-size: 14px; }
.sidenav .foot { font-size: 12px; color: var(--faint); padding: 8px 12px; line-height: 1.8; }
.sidenav .foot a { color: var(--faint); margin-right: 8px; }
.sidenav .foot.langs { padding-top: 0; }
.sidenav .foot.langs a.active { color: var(--text); font-weight: 700; }

.tabbar { display: none; }
.navlink.compact-only { display: none; }

/* narrow PC / tablet landscape: icon-only side navigation, slimmer info panel */
@media (min-width: 900px) and (max-width: 1279px) {
  :root { --side: 72px; --sidew: 290px; }
  .sidenav { padding: 16px 10px; align-items: stretch; }
  .brand { justify-content: center; padding: 4px 0 14px; }
  .brand span, .navlink .lbl, .sidenav .foot, .sidenav .me { display: none; }
  .navlink { justify-content: center; padding: 12px 0; }
  .navlink .ico { width: auto; font-size: 20px; }
  .navlink.compact-only { display: flex; }
}

@media (max-width: 899px) {
  .sidenav { display: none; }
  .shell { flex-direction: column; }
  .view { height: calc(100dvh - var(--tabbar)); flex: none; }
  .tabbar { display: flex; height: var(--tabbar); flex: none; border-top: 1px solid var(--line); background: #08080d; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--text); }
  .tabbar a .ico { font-size: 19px; line-height: 1; }
  .tabbar a.post .ico { background: var(--grad); color: #fff; border-radius: 10px; width: 44px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
}

/* ---------- generic UI ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; cursor: pointer; background: var(--panel3); color: var(--text); font-size: 14px; text-decoration: none; }
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: #3a1820; color: #ff8a8a; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

.page { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; }
.page.narrow { max-width: 460px; }
.page h1 { font-size: 26px; margin: 4px 0 18px; }
.page h2 { font-size: 19px; margin: 28px 0 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-2 { grid-template-columns: 1fr; }
}
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--faint); font-size: 12px; margin-top: 4px; }
.stat.hl { border-color: rgba(255, 79, 109, 0.45); background: linear-gradient(160deg, rgba(255, 79, 109, 0.14), rgba(255, 181, 71, 0.05)); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], textarea, select {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 15px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 12px; color: var(--faint); margin-top: 5px; line-height: 1.6; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.6; margin: 10px 0 16px; }
.check input { margin-top: 4px; }
.radios { display: flex; gap: 10px; flex-wrap: wrap; }
.radios label { flex: 1; min-width: 120px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.radios label:has(input:checked) { border-color: var(--accent); }
.error-box { background: #3a1820; color: #ffb3b3; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.note { background: var(--panel2); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.note strong { color: var(--text); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs .active { color: var(--text); border-bottom-color: var(--accent); }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-size: 12px; font-weight: 700; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel3); color: var(--muted); }
.badge.ok { background: rgba(61, 220, 151, 0.15); color: var(--ok); }
.badge.warn { background: rgba(255, 181, 71, 0.15); color: var(--warn); }
.badge.bad { background: rgba(255, 93, 93, 0.15); color: var(--danger); }
.badge.accent { background: rgba(255, 79, 109, 0.15); color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

.progress { height: 8px; background: var(--panel3); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; width: 0; background: var(--grad); transition: width 0.2s; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 20px); transform: translate(-50%, 20px); background: #23232f; color: var(--text); padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 1000; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

.spinner { width: 34px; height: 34px; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modal & drawer ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 420px; padding: 20px; max-height: 90dvh; overflow: auto; }
.modal h3 { margin: 0 0 14px; }
.drawer-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 400; }
.drawer { position: fixed; z-index: 401; background: var(--panel); display: flex; flex-direction: column; border: 1px solid var(--line); }
@media (max-width: 899px) { .drawer { left: 0; right: 0; bottom: 0; height: 68dvh; border-radius: 18px 18px 0 0; } }
@media (min-width: 900px) { .drawer { top: 0; right: 0; bottom: 0; width: 400px; } }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 800; }
.drawer .list { flex: 1; overflow-y: auto; padding: 8px 16px; }
.drawer form { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.drawer form input { flex: 1; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.comment .who { font-weight: 700; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment .body { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.iconbtn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; padding: 4px 8px; border-radius: 8px; }
.iconbtn:hover { background: var(--panel2); color: var(--text); }

/* ---------- feed ---------- */
.feed { position: absolute; inset: 0; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { display: none; }
.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; display: flex; flex-direction: column; }
.stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.frame { position: relative; width: 100%; height: 100%; background: #000; overflow: hidden; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.poster { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background-size: cover; background-position: center; }
.poster .ptitle { font-size: 26px; font-weight: 800; text-align: center; padding: 0 24px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.poster .pemoji { font-size: 64px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4)); }
.frame.loaded .poster { opacity: 0; pointer-events: none; transition: opacity 0.25s 0.15s; }
/* first-visit hint; never blocks the game (no pointer events) and fades away by itself */
.swipehint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2; color: #fff; font-weight: 800; font-size: 14px; background: rgba(0, 0, 0, 0.6); padding: 9px 16px; border-radius: 999px; pointer-events: none; white-space: nowrap; animation: hint 4.5s ease-in-out forwards; }
@keyframes hint { 0% { opacity: 0; transform: translate(-50%, 8px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
/* fullscreen play: the browser's element fullscreen, or (iPhone etc.) the frame covering the page */
.frame:fullscreen { border-radius: 0; border: 0; box-shadow: none; }
.frame.fs-css { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100dvh !important; max-width: none !important; aspect-ratio: auto !important; border-radius: 0 !important; border: 0 !important; box-shadow: none !important; z-index: 1000; }
body.fs-open { overflow: hidden; }
.fs-exit { display: none; position: absolute; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); z-index: 5; width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 17px; cursor: pointer; opacity: 0.6; align-items: center; justify-content: center; }
.fs-exit:hover, .fs-exit:focus-visible { opacity: 1; }
.frame.fs-css .fs-exit { display: flex; }
.fs-hint { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5; background: rgba(0, 0, 0, 0.72); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.frame.fs-hint-on .fs-hint { opacity: 1; }

.rail { position: absolute; right: 8px; bottom: 16px; display: flex; flex-direction: column; gap: 14px; align-items: center; z-index: 3; }
.rbtn { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; cursor: pointer; color: #fff; font-size: 11px; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); padding: 0; }
.rbtn .circle { width: 44px; height: 44px; border-radius: 50%; background: rgba(20, 20, 30, 0.62); display: flex; align-items: center; justify-content: center; font-size: 20px; backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.08); }
.rbtn:hover .circle { background: rgba(50, 50, 70, 0.8); }
.rbtn.liked .circle { color: var(--accent); }
.rbtn .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; border: 2px solid #fff; }
.playing .rail .hide-playing { display: none; }

.side { flex: none; background: var(--bg); }
.info { padding: 8px 12px 6px; min-width: 0; }
.info .creator { font-weight: 800; font-size: 14px; color: var(--text); }
.info .title { font-weight: 700; font-size: 15px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .desc { display: none; }
.info .tags { display: none; }
.info .meta { display: none; }
/* space for the banner is reserved on phones so the game does not jump when an ad appears */
.adslot { height: 58px; display: flex; justify-content: center; align-items: center; }
@media (min-width: 900px) { .adslot { height: auto; } .adslot:empty { display: none; } }

.feed-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 18px; padding: 10px 0 18px; z-index: 20; pointer-events: none; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent); transition: opacity 0.2s; }
.feed-top a { pointer-events: auto; color: rgba(255, 255, 255, 0.7); font-weight: 800; font-size: 16px; padding: 4px 2px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.feed-top a.active { color: #fff; border-bottom: 2px solid #fff; }
.feed-top a:hover { text-decoration: none; }
.feed.is-playing ~ .feed-top { opacity: 0; pointer-events: none; }
.feed.is-playing ~ .feed-top a { pointer-events: none; }
.feed-nav { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 12px; z-index: 20; }
.feed-nav button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 18px; cursor: pointer; }
.feed-nav button:hover { background: var(--panel3); }
.feed-empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.feed-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ad card in the feed */
.slide.ad .stage { background: radial-gradient(circle at 50% 30%, #23233a, #0b0b12); }
.adcard { width: min(92%, 400px); background: var(--panel); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.adcard .adimg { aspect-ratio: 16 / 10; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 46px; font-weight: 900; color: #fff; }
.adcard .adbody { padding: 16px 18px 18px; }
.adcard .adtitle { font-size: 19px; font-weight: 800; }
.adcard .adtext { font-size: 14px; color: var(--muted); margin: 6px 0 14px; line-height: 1.6; }
.adlabel { display: inline-block; font-size: 11px; font-weight: 800; color: #111; background: var(--accent2); padding: 2px 7px; border-radius: 5px; margin-right: 6px; vertical-align: middle; }
.adby { font-size: 12px; color: var(--faint); margin-top: 10px; }

/* banner beside / under a game */
.banner { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 468px; height: 50px; padding: 0 10px; background: var(--panel2); border-radius: 10px; color: var(--text); text-decoration: none; overflow: hidden; border: 1px solid var(--line); }
.banner:hover { text-decoration: none; filter: brightness(1.1); }
.banner .bimg { width: 34px; height: 34px; border-radius: 8px; flex: none; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; }
.banner .btext { flex: 1; min-width: 0; }
.banner .btitle, .banner .bsub { display: block; }
.banner .btitle { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner .bsub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner .bcta { flex: none; font-size: 12px; font-weight: 800; background: var(--grad); color: #fff; padding: 6px 10px; border-radius: 8px; }
.adslot .adsbygoogle { flex: none; } /* fixed size set in ads.js */
.adcard.adsense { width: auto; padding: 8px 10px 10px; text-align: center; }
.adcard.adsense .adby { margin: 0 0 6px; text-align: left; }
.adslot { padding: 0 10px 8px; }

/* ad break overlay */
.break { position: fixed; inset: 0; z-index: 900; background: rgba(5, 5, 10, 0.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.break .bartop { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.break .adcard { width: min(92vw, 440px); }

/* ---------- PC layout for the feed ---------- */
/* Mouse users: the feed only moves by wheel / keys / buttons (one game per step), so a wheel
   that a game does not use can never half-scroll the page underneath it. Touch keeps native swiping. */
@media (hover: hover) and (pointer: fine) {
  .feed { overflow-y: hidden; }
}

@media (min-width: 900px) {
  .slide { flex-direction: row; }
  .stage { padding: 16px 76px 16px 20px; background: var(--bg); gap: 14px; }
  .frame { border-radius: 16px; box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5); border: 1px solid var(--line); flex: none; }
  .frame.portrait { height: 100%; width: auto; aspect-ratio: 9 / 16; max-width: calc(100% - 64px); }
  .frame.landscape { width: min(calc(100% - 64px), calc((100dvh - 32px) * 16 / 9)); height: auto; aspect-ratio: 16 / 9; }
  .rail { position: static; align-self: flex-end; margin-bottom: 10px; }
  .rbtn { color: var(--text); text-shadow: none; }
  .rbtn .circle { background: var(--panel2); border-color: var(--line); }
  .side { width: var(--sidew); flex: none; border-left: 1px solid var(--line); overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; gap: 16px; }
  .info { padding: 0; }
  .info .creator { font-size: 15px; }
  .info .title { font-size: 21px; white-space: normal; margin-top: 6px; }
  .info .desc { display: block; color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 10px; white-space: pre-wrap; word-break: break-word; }
  .info .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .info .tags { align-items: center; }
  .info .tags a { font-size: 12px; color: var(--link); }
  .info .tags a.genre-badge { color: var(--text); margin-top: 0; }
  .info .meta { display: block; font-size: 12px; color: var(--faint); margin-top: 10px; }
  .adslot { padding: 0; }
  .adslot .banner { flex-direction: column; height: auto; min-height: 250px; max-width: 300px; padding: 0; gap: 0; align-items: stretch; margin: 0 auto; }
  .adslot .banner .bimg { width: 100%; height: 130px; border-radius: 0; font-size: 34px; }
  .adslot .banner .btext { padding: 10px 12px 0; }
  .adslot .banner .btitle { font-size: 15px; white-space: normal; }
  .adslot .banner .bsub { white-space: normal; font-size: 12px; margin-top: 4px; }
  .adslot .banner .bcta { margin: 10px 12px 12px; text-align: center; }
  .feed-nav { display: flex; right: calc(var(--sidew) + 14px); }
  .feed-top { display: none; } /* the side navigation already has おすすめ / 新着 */
}

/* ---------- search ---------- */
.searchbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px 4px 16px; margin: 0 0 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
.searchbar:focus-within { border-color: var(--accent); }
.searchbar input { flex: 1; background: none; border: 0; padding: 10px 4px; font-size: 16px; }
.searchbar input:focus { border: 0; }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar .sicon { font-size: 16px; opacity: 0.8; }
.genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 8px; }
.genre { display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; cursor: pointer; text-align: left; min-width: 0; }
.genre:hover { border-color: rgba(255, 255, 255, 0.25); }
.genre.on { border-color: var(--accent); background: linear-gradient(150deg, rgba(255, 79, 109, 0.22), rgba(255, 181, 71, 0.08)); }
.genre .gi { font-size: 18px; }
.genre .gl { flex: 1; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre .gc { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  /* phones: one row that scrolls sideways, so results stay on the first screen */
  .genres { display: flex; overflow-x: auto; gap: 8px; margin: 0 -16px 8px; padding: 0 16px 6px; scrollbar-width: none; }
  .genres::-webkit-scrollbar { display: none; }
  .genre { flex: none; border-radius: 999px; padding: 8px 13px; }
  .genre .gl { overflow: visible; }
}
.genre-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--text); background: var(--panel3); border-radius: 999px; padding: 3px 10px; margin-top: 6px; }
.genre-badge:hover { text-decoration: none; filter: brightness(1.2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 7px 13px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 700; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.creators { display: flex; gap: 10px; flex-wrap: wrap; }
.creator-chip { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px 8px 8px; color: var(--text); }
.creator-chip:hover { text-decoration: none; border-color: rgba(255, 255, 255, 0.25); }
.creator-chip .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; flex: none; }
.creator-chip strong { display: block; font-size: 14px; }

/* ---------- studio / profile ---------- */
.gamelist { display: flex; flex-direction: column; gap: 10px; }
.gamerow { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.thumb { width: 64px; height: 64px; border-radius: 12px; flex: none; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.gamerow .grow { flex: 1; min-width: 0; }
.gamerow .gtitle { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gamerow .gstats { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile { display: block; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.tile:hover { text-decoration: none; border-color: rgba(255, 255, 255, 0.25); }
.tile .timg { aspect-ratio: 3 / 4; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.tile .tbody { padding: 8px 10px 10px; }
.tile .tt { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .ts { font-size: 12px; color: var(--muted); margin-top: 2px; }
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.profile-head .avatar { width: 76px; height: 76px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 900; color: #fff; flex: none; }
.hero { background: linear-gradient(150deg, rgba(255, 79, 109, 0.2), rgba(255, 181, 71, 0.08)); border: 1px solid rgba(255, 79, 109, 0.3); border-radius: 20px; padding: 26px; margin-bottom: 18px; }
.hero h1 { margin: 0 0 8px; }
.split { display: flex; gap: 0; border-radius: 12px; overflow: hidden; height: 34px; font-size: 13px; font-weight: 800; margin-top: 14px; }
.split .c { background: var(--grad); display: flex; align-items: center; padding: 0 12px; color: #fff; }
.split .p { background: var(--panel3); display: flex; align-items: center; justify-content: center; color: var(--muted); }
pre.code { background: #07070c; border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.doc { line-height: 1.9; font-size: 15px; }
.doc h2 { margin-top: 32px; }
.doc li { margin: 4px 0; }
/* studio: optional English title / description */
details.en-fields { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
details.en-fields > summary { cursor: pointer; font-weight: 700; font-size: 14px; }
details.en-fields[open] > summary { margin-bottom: 4px; }
/* title card: every game starts with its title over the game screen (taps go through to the game) */
.titlecard { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 55%, rgba(0, 0, 0, 0) 100%);
  animation: tc-in 0.35s ease-out both; transition: opacity 0.4s ease; }
.titlecard.out { opacity: 0; }
.titlecard .tc-inner { max-width: 86%; text-align: center; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7); animation: tc-rise 0.45s ease-out both; }
.titlecard .tc-genre { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.16);
  margin-bottom: 12px; text-shadow: none; backdrop-filter: blur(4px); }
.titlecard .tc-title { font-size: clamp(24px, 6.5vmin, 46px); font-weight: 900; line-height: 1.2; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.titlecard .tc-by { margin-top: 10px; font-size: 14px; font-weight: 600; opacity: 0.85; }
@keyframes tc-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tc-rise { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .titlecard, .titlecard .tc-inner { animation: none; } }
