/* ============================================================
   Kitaku Arcade — 「帰ったら、ひと遊び。」
   クリーム×ピンクの明色テーマ+ピクセルアート風味
   構造: ヒーロー+週間ランキング / PICK UP / NEW / POPULAR /
        カテゴリ帯 / ゲームページ=全画面ステージ(ダーク維持)
   ============================================================ */
:root {
  --bg: #f9f6f0;        /* クリーム地(イラストの地色と実測一致) */
  --bg2: #ffffff;
  --card: #ffffff;
  --line: #eddfc6;
  --text: #46322a;
  --dim: #97826f;
  --accent: #f2568c;    /* ピンク */
  --accent2: #8f7bff;   /* パープル */
  --amber: #eea52f;
  --mint: #35b78f;
  --radius: 14px;
  --bar-h: 48px;
  --hard: 4px 4px 0 rgba(242, 86, 140, .28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "BIZ UDGothic", "Yu Gothic UI",
    "Segoe UI", "Noto Naskh Arabic", system-ui, sans-serif;
  line-height: 1.6; font-size: 15px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.pixel { font-family: "DotGothic16", "Hiragino Kaku Gothic ProN", sans-serif; }

/* ---------- ヘッダー ---------- */
.site-head { background: var(--bg); position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 12px;
  min-height: 56px; flex-wrap: wrap; padding-block: 6px; }
.logo { font-family: "DotGothic16", sans-serif; font-size: 1.3rem; font-weight: 400;
  letter-spacing: .05em; display: flex; align-items: center; gap: 9px;
  background: linear-gradient(120deg, #4aa8ff, #8f7bff 55%, #f2568c);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo .dot { width: 16px; height: 16px; border-radius: 4px; flex: none;
  background: linear-gradient(135deg, #4aa8ff, #f2568c); transform: rotate(8deg); }
.lang-switch { margin-inline-start: auto; display: flex; gap: 6px; }
.lang-switch a { padding: 4px 13px; border-radius: 999px; font-size: .8rem;
  font-weight: 700; background: var(--bg); color: var(--dim);
  border: 1px solid var(--line); }
.lang-switch a[aria-current="true"] { background: var(--accent); color: #fff;
  border-color: var(--accent); }

.chips { display: flex; gap: 8px; padding-block: 12px 6px; overflow-x: auto;
  scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 6px 16px; border-radius: 999px;
  background: var(--bg2); color: var(--dim); font-weight: 700; font-size: .9rem;
  border: 1px solid var(--line); }
.chip:hover, .chip:focus-visible { color: var(--accent); border-color: var(--accent); }
.chip[aria-current="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- ティッカー ---------- */
.ticker { background: #ffe7f0; border-block: 1px solid #ffd2e3; overflow: hidden; }
.ticker-track { display: inline-block; white-space: nowrap; padding-block: 7px;
  font-size: .85rem; font-weight: 700; color: #d63d75;
  padding-inline-start: 100vw; animation: tick 28s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(calc(-100% - 100vw)); } }

/* ---------- ヒーロー+週間ランキング ---------- */
.hero { display: grid; gap: 18px; grid-template-columns: 1fr;
  padding-block: 22px 8px; align-items: stretch; }
@media (min-width: 900px) { .hero { grid-template-columns: 1fr 330px; } }
.hero-main { background: linear-gradient(135deg, #ffe9f2, #fff4e2 60%, #efe9ff);
  border: 1px solid var(--line); border-radius: 20px; padding: 26px 28px;
  display: grid; gap: 6px; align-content: center; position: relative; overflow: hidden; }
@media (min-width: 640px) { .hero-main { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.hero-t { font-family: "DotGothic16", sans-serif; font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0; letter-spacing: .03em; }
.hero-s { color: var(--accent); font-weight: 700; margin: 2px 0 6px; font-size: .95rem;
  letter-spacing: .12em; }
.hero-d { color: var(--dim); font-size: .92rem; margin: 0 0 14px; max-width: 40ch; }
.cta { display: inline-flex; align-items: center; gap: 8px; justify-self: start;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1rem;
  padding: 12px 26px; border-radius: 999px; box-shadow: var(--hard);
  transition: transform .12s; }
.cta:hover { transform: translate(-2px, -2px); }
.hero-art img { border-radius: 14px; }
.rankpanel { background: var(--bg2); border: 1px solid var(--line);
  border-radius: 20px; padding: 16px 18px; }
.rankpanel h2 { font-family: "DotGothic16", sans-serif; font-weight: 400;
  font-size: 1rem; margin: 0 0 2px; color: var(--amber); letter-spacing: .06em; }
.rankpanel .sub { font-size: .76rem; color: var(--dim); margin: 0 0 10px; }
.rankpanel ol { list-style: none; margin: 0; padding: 0; }
.rankpanel li { display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px dashed var(--line); font-size: .9rem; }
.rankpanel li:last-child { border-bottom: 0; }
.rk-no { width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: .74rem; font-weight: 800;
  background: var(--bg); color: var(--dim); }
.rankpanel li:nth-child(1) .rk-no { background: #f6b73c; color: #fff; }
.rankpanel li:nth-child(2) .rk-no { background: #b9c2cc; color: #fff; }
.rankpanel li:nth-child(3) .rk-no { background: #d98d55; color: #fff; }
.rankpanel b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 700; }
.rk-pl { color: var(--accent2); font-weight: 800; font-size: .82rem;
  font-family: ui-monospace, monospace; }

/* ---------- セクション帯 ---------- */
.shelf { margin-block: 22px 6px; }
.shelf-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px;
  flex-wrap: wrap; }
.shelf-head h2 { font-family: "DotGothic16", sans-serif; font-weight: 400;
  font-size: 1.1rem; margin: 0; display: flex; align-items: center; gap: 8px;
  letter-spacing: .05em; }
.shelf-head h2::before { content: ""; width: 10px; height: 10px; border-radius: 3px;
  background: var(--accent); transform: rotate(45deg); }
.shelf-head .sub { font-size: .78rem; color: var(--dim); }
.shelf-head .more { margin-inline-start: auto; font-size: .82rem; font-weight: 700;
  color: var(--accent); white-space: nowrap; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; }
.shelf-row { display: grid; grid-auto-flow: column;
  grid-auto-columns: clamp(120px, 24vw, 160px);
  gap: 14px; overflow-x: auto; padding: 4px 4px 10px;
  scroll-snap-type: x proximity; scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }

/* ---------- タイル ---------- */
.sq { scroll-snap-align: start; display: block; }
.sq .pic { display: block; position: relative; aspect-ratio: 1 / 1;
  border-radius: var(--radius); overflow: hidden; background: var(--bg2);
  border: 1px solid var(--line); transition: transform .13s, box-shadow .13s; }
.sq .pic::before { content: attr(data-l); position: absolute; inset: 0;
  display: grid; place-items: center; font-size: 2.6rem;
  font-family: "DotGothic16", sans-serif; color: #d9c6ac;
  background: linear-gradient(135deg, #fff6e8, #ffe9f2); }
.sq:hover .pic, .sq:focus-visible .pic { transform: translate(-2px, -2px);
  border-color: var(--accent); box-shadow: var(--hard); }
.sq .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sq .t { margin-top: 7px; font-size: .84rem; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sq .rt { display: block; font-size: .74rem; color: var(--amber); font-weight: 800; }

/* 年齢レーティング(PEGI風) */
.age { position: absolute; top: 7px; inset-inline-end: 7px;
  font-size: .68rem; font-weight: 800; padding: 2px 7px; border-radius: 6px;
  color: #fff; background: #58a75e; }
.age-6, .age-8 { background: #58a75e; }
.age-10 { background: #d1a41c; }
.age-16 { background: #e07b2a; }
.age-18 { background: #d84343; }
.age-big { position: static; font-size: .78rem; vertical-align: middle;
  margin-inline-start: 6px; padding: 3px 10px; }

/* NEWリボン */
.newb { position: absolute; top: 0; inset-inline-start: 0;
  font-size: .64rem; font-weight: 800; letter-spacing: .08em;
  background: var(--accent); color: #fff; padding: 3px 12px;
  border-end-end-radius: 10px; animation: newpulse 1.8s ease-in-out infinite; }
@keyframes newpulse { 50% { opacity: .55; } }

/* ---------- POPULAR(順位バッジ+再生数) ---------- */
.pop-row { display: grid; grid-auto-flow: column;
  grid-auto-columns: clamp(200px, 44vw, 250px); gap: 12px; overflow-x: auto;
  padding: 4px 4px 10px; scrollbar-width: none; }
.pop-row::-webkit-scrollbar { display: none; }
.pop-item { display: flex; align-items: center; gap: 10px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px;
  transition: transform .13s, box-shadow .13s; }
.pop-item:hover { transform: translate(-2px, -2px); border-color: var(--accent);
  box-shadow: var(--hard); }
.pop-no { width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: .74rem; font-weight: 800;
  background: var(--accent2); color: #fff; }
.pop-item:nth-child(1) .pop-no { background: #f6b73c; }
.pop-item:nth-child(2) .pop-no { background: #b9c2cc; }
.pop-item:nth-child(3) .pop-no { background: #d98d55; }
.pop-item img, .pop-thumb { width: 44px; height: 44px; border-radius: 9px;
  object-fit: cover; flex: none; background: #ffe9f2; }
.pop-thumb { display: grid; place-items: center; font-family: "DotGothic16", sans-serif;
  color: #d9a4bb; }
.pop-body { min-width: 0; }
.pop-body b { display: block; font-size: .85rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.pop-pl { font-size: .76rem; color: var(--accent2); font-weight: 800;
  font-family: ui-monospace, monospace; }

/* ---------- オリジナル訴求ボックス ---------- */
.tlbox { margin-block: 24px; background: linear-gradient(135deg, #e8f3ff, #f1ecff);
  border: 1px solid #d9e3f5; border-radius: 20px; padding: 20px 24px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tlbox h2 { font-family: "DotGothic16", sans-serif; font-weight: 400;
  font-size: 1.05rem; margin: 0; color: #3e6bd6; }
.tlbox p { margin: 2px 0 0; font-size: .88rem; color: #6d7ea8; }
.tlbox .go { margin-inline-start: auto; background: #3e6bd6; color: #fff;
  font-weight: 800; font-size: .9rem; padding: 10px 22px; border-radius: 999px;
  box-shadow: 4px 4px 0 rgba(62, 107, 214, .25); }

/* カテゴリページ用グリッド */
.grid { display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); padding-block: 8px; }
h1 { font-family: "DotGothic16", sans-serif; font-weight: 400;
  font-size: 1.35rem; margin: 16px 0 4px; }
h2.sec { font-family: "DotGothic16", sans-serif; font-weight: 400;
  font-size: 1.1rem; margin: 22px 0 10px; }

/* ---------- ゲームページ: 全画面ステージ(ダーク維持) ---------- */
.gp-shell { height: 100dvh; display: flex; flex-direction: column; background: #000; }
.gp-bar { height: var(--bar-h); flex: none; display: flex; align-items: center; gap: 10px;
  padding-inline: 10px; background: var(--bg2); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.gp-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--bg); color: var(--text);
  font-size: 1.05rem; border: 1px solid var(--line); cursor: pointer; }
.gp-icon:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.gp-title { font-weight: 700; font-size: .92rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.gp-frame { flex: 1; min-height: 0; position: relative; }
.gp-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gp-shell.fs { position: fixed; inset: 0; z-index: 100; }
.gp-shell.fs .gp-bar { display: none; }
.gp-shell.fs .gp-exit { display: grid; }
.gp-exit { display: none; position: absolute; top: max(8px, env(safe-area-inset-top));
  inset-inline-end: 8px; z-index: 101; width: 40px; height: 40px; place-items: center;
  border: 0; border-radius: 12px; background: rgba(30,30,30,.72); color: #fff;
  font-size: 1.1rem; cursor: pointer; backdrop-filter: blur(4px); }
html.fs-lock, html.fs-lock body { overflow: hidden; overscroll-behavior: none; }
.gp-below { padding-block: 18px 8px; }
.desc-box { color: var(--dim); max-width: 75ch; }

/* ---------- レーティング ---------- */
.rate-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.rate-label { font-size: .85rem; color: var(--dim); }
.stars { display: inline-flex; gap: 2px; }
.star { font-size: 1.5rem; line-height: 1; background: none; border: 0; cursor: pointer;
  color: #ddcbb3; padding: 2px; transition: transform .1s, color .1s; }
.star:hover, .star:focus-visible { transform: scale(1.2); }
.star.on { color: var(--amber); }
.rate-info { font-size: .9rem; font-weight: 700; color: var(--amber); }

/* ---------- スコアランキング ---------- */
.rank { margin-block: 18px; }
.rank-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.rtab { font: inherit; font-weight: 700; font-size: .82rem; border: 1px solid var(--line);
  cursor: pointer; padding: 5px 16px; border-radius: 999px; background: var(--bg2);
  color: var(--dim); }
.rtab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.rank-list { list-style: none; margin: 0; padding: 0; max-width: 480px; counter-reset: rk; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 10px; counter-increment: rk; }
.rank-list li:nth-child(odd) { background: var(--bg2); }
.rank-list li::before { content: counter(rk); font-weight: 800; color: var(--dim);
  min-width: 1.6em; text-align: center; }
.rank-list li:nth-child(1)::before { content: "🥇"; }
.rank-list li:nth-child(2)::before { content: "🥈"; }
.rank-list li:nth-child(3)::before { content: "🥉"; }
.rank-list b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-score { font-family: ui-monospace, monospace; font-weight: 700; color: var(--accent2); }
.rk-empty { color: var(--dim); font-size: .9rem; }
.rk-empty::before { content: "" !important; min-width: 0 !important; }
.rank-list li.mine { outline: 2px solid var(--accent);
  background: #ffe7f0 !important; animation: minePulse 1.4s ease-in-out 3; }
.rank-list li.rk-my::before { content: "👤"; }
@keyframes minePulse { 50% { box-shadow: 0 0 16px rgba(242, 86, 140, .55); } }
.score-bar { display: none; align-items: center; gap: 8px; margin-top: 12px;
  background: #fff; border: 1px solid var(--accent); border-radius: 12px;
  padding: 10px 12px; max-width: 480px; flex-wrap: wrap; }
.score-bar.show { display: flex; }
.score-bar #scoreval { font-weight: 800; color: var(--accent); }
.score-bar input { flex: 1; min-width: 120px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; }
.score-bar button { font: inherit; font-weight: 700; border: 0; border-radius: 8px;
  padding: 8px 16px; background: var(--accent); color: #fff; cursor: pointer; }

/* ---------- コメント ---------- */
.cm { margin-block: 18px; }
.cm-form { display: grid; gap: 8px; max-width: 560px; margin-bottom: 16px; }
.cm-form input, .cm-form textarea { background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font: inherit; font-size: .92rem; }
.cm-form textarea { min-height: 64px; resize: vertical; }
.cm-form button { justify-self: start; font: inherit; font-weight: 700; border: 0;
  border-radius: 10px; padding: 9px 22px; background: var(--accent); color: #fff;
  cursor: pointer; }
.cm-msg { font-size: .85rem; color: var(--mint); font-weight: 700; }
.cm-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cm-head { display: flex; gap: 10px; align-items: baseline; font-size: .88rem; }
.cm-time { color: var(--dim); font-size: .75rem; }
.cm-item p { margin: 4px 0 0; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- 広告枠 ---------- */
.ad-slot { min-height: 90px; display: grid; place-items: center; margin-block: 14px;
  border: 1px dashed var(--line); border-radius: var(--radius); color: #c7b79f;
  font-size: .75rem; background: var(--bg2); }

/* ---------- フッター ---------- */
.site-foot { margin-block-start: 36px; background: var(--bg2);
  border-top: 1px solid var(--line); padding-block: 20px;
  font-size: .85rem; color: var(--dim); }
.site-foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }
.site-foot .cnt { font-size: .72rem; font-weight: 700; margin-inline-start: auto;
  display: inline-flex; align-items: center; gap: 6px; }
.site-foot .cnt b { background: #10241a; color: #3ae06a;
  font-family: ui-monospace, monospace; font-size: .8rem; letter-spacing: 3px;
  padding: 2px 8px; border-radius: 4px; }
.site-foot .ver { font-size: .7rem; color: #c2b096; font-family: ui-monospace, monospace; }
.site-foot .cnt + .ver { margin-inline-start: 0; }

/* ---------- 専用アプリモード ---------- */
html.is-app .lang-switch, html.is-app .site-foot { display: none; }
html.is-app .site-head { position: static; }

:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .ticker-track, .newb { animation: none; }
  .sq:hover .pic, .pop-item:hover, .cta:hover { transform: none; box-shadow: none; }
  .rank-list li.mine { animation: none; }
}


/* ---------- イラスト素材 ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.logo img { height: 58px; width: auto; image-rendering: pixelated; display: block; }
.logo-sub { font-family: "DotGothic16", sans-serif; font-size: .68rem;
  letter-spacing: .38em; padding: 1px 10px 1px 14px; color: var(--text);
  border: 1.5px solid var(--text); border-radius: 999px; white-space: nowrap; }
.hero-art img { image-rendering: pixelated; border-radius: 14px;
  border: 1px solid var(--line); max-height: 240px; width: auto; margin-inline: auto; }
.site-foot { position: relative; }
.site-foot .foot-cat { position: absolute; bottom: 0; inset-inline-end: 12px;
  height: 74px; width: auto; image-rendering: pixelated;
  border-start-start-radius: 10px; border-start-end-radius: 10px; }
@media (max-width: 640px) { .site-foot .foot-cat { display: none; } }

/* ---------- 上部アイコンナビ ---------- */
.nav-icons { display: flex; gap: 4px; margin-inline: auto; }
.nav-icons a { display: grid; place-items: center; gap: 1px; padding: 5px 12px;
  border-radius: 12px; }
.nav-icons .nv-i { font-size: 1.15rem; line-height: 1; }
.nav-icons .nv-l { font-family: "DotGothic16", sans-serif; font-size: .62rem;
  letter-spacing: .1em; color: var(--dim); }
.nav-icons a:hover { background: #ffe7f0; }
.nav-icons a:hover .nv-l { color: var(--accent); }
@media (max-width: 760px) { .nav-icons { order: 3; width: 100%; justify-content: center; margin-inline: 0; } }

/* ---------- カテゴリーパネル ---------- */
.cat-panel { margin-block: 14px 4px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 20px; padding: 14px 18px; }
.cat-panel h2 { font-family: "DotGothic16", sans-serif; font-weight: 400;
  font-size: 1rem; margin: 0 0 10px; }
.cat-grid { display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.cat-grid a { display: flex; align-items: center; gap: 8px; font-size: .88rem;
  font-weight: 700; padding: 8px 12px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--line); transition: transform .12s, box-shadow .12s; }
.cat-grid a:hover { transform: translate(-2px, -2px); border-color: var(--accent);
  box-shadow: var(--hard); }
.cat-grid .ci { font-size: 1.1rem; }

/* ---------- RANKINGページ ---------- */
.rb-grid { display: grid; gap: 16px; padding-block: 10px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rb { background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; }
.rb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rb-head img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
  background: #ffe9f2; }
.rb-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: .95rem; }
.rb-head .more { font-size: .78rem; font-weight: 700; color: var(--accent);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; white-space: nowrap; }
.rb-list { max-width: none; }
