/* 手書きの字（つくった人のひとこと・メモに使う）。ほかの字は各ページの <link> で読み込み */
@import url('https://fonts.googleapis.com/css2?family=Yusei+Magic&display=swap');

/* =============================================================
   KEPIGAME サイト共通スタイル（トップ・ブログ・説明ページ）
   ゲーム画面の見た目は games/games.css と各ゲームのファイルにあります。

   2026年11月6日に見た目を作り直しました（どこにでもある「AIっぽい」形をやめる）。
   ・ページの地は、うすいラベンダー（マスコットは背景をぬいた絵 images/mascot-nobg.webp を、地にそのまま立たせる）
   ・線は、マスコットと同じ「マーカーで描いた線」。囲みの線は、押せるもの（ボタン）だけ
   ・ゲームは段ボール箱。箱の前に、紙のラベルをテープで貼った形（ここだけ大胆に）
   ・強調は黄色の蛍光ペン、日付は朱色のハンコ、つくった人のひとことは手書きの字
   ・ずらした黒い影・丸いピル形・灰色の説明文は使わない
   ・文字は傾けない（読みにくいので。2026年11月7日、ユーザーの希望）。傾けてよいのは、文字のない飾り（テープ・写真・ハンコの輪）だけ
   ============================================================= */

:root {
  --ink: #1B171D;          /* 線と文字 */
  --ink-soft: #5B5463;     /* 紙の上の補足の文字 */
  --ink-lav: #3A3241;      /* ラベンダーの地の上の補足の文字（読みやすい濃さ） */
  --paper: #FFFFFF;
  --bg: #ECE7F4;           /* ページの地（うすいラベンダー。2026年11月6日にユーザーの希望でうすく） */
  --lav: #BEB2D1;
  --lav-tint: #EEE9F5;     /* 紙の上のうすいラベンダー */
  --lav-mid: #D9D1E6;
  --lav-deep: #4E3F86;     /* リンク */
  --box: #E7D8B4;          /* 段ボール（明るい面。マスコットの箱と同じ色） */
  --box-mid: #DAC7A2;
  --box-dark: #B09666;
  --tape: rgba(238, 224, 186, 0.88);  /* マスキングテープ */
  --pop: #FFD23F;          /* 押すボタン */
  --pop-hover: #FFC800;
  --marker: #FFE45C;       /* 蛍光ペン */
  --stamp: #C8423A;        /* ハンコの朱色 */
  --line: 2px solid var(--ink);
  --radius: 14px;
  --radius-sm: 10px;
  /* 手で切ったような、少しずつちがう角の丸み */
  --cut: 13px 17px 14px 18px / 17px 13px 18px 14px;
  --cut-sm: 9px 12px 10px 13px / 12px 9px 13px 10px;
  /* 紙を置いたときの、やわらかい影 */
  --lift: 0 1px 0 rgba(27, 23, 29, 0.05), 0 10px 22px -12px rgba(46, 30, 72, 0.45);
  --header-h: 64px;
  --font: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
  --font-display: 'Dela Gothic One', 'M PLUS Rounded 1c', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --font-hand: 'Yusei Magic', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Yu Gothic UI', sans-serif;

  /* マーカーで引いた線（横にのばして使う。線の太さはのばしても変わらない） */
  --svg-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 8' preserveAspectRatio='none'%3E%3Cpath d='M1 4.8C70 3 130 5.9 205 4.2S330 2.5 410 4.5 530 6 599 3.6' fill='none' stroke='%231B171D' stroke-width='2.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  /* うすいマーカーの線（ラベンダーの地の上の区切り） */
  --svg-line-soft: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 8' preserveAspectRatio='none'%3E%3Cpath d='M1 4.2C80 5.6 150 2.8 230 4.3S360 5.9 440 3.9 560 2.9 599 4.6' fill='none' stroke='%23786C86' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  /* 鉛筆でうすく引いた区切りの線（くり返して使う） */
  --svg-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='6' viewBox='0 0 44 6'%3E%3Cpath d='M2 3.4Q8 2.3 15 3.3M24 3.1Q31 4 38 2.9' fill='none' stroke='%23B4AAC3' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  /* 黄色の蛍光ペン */
  --svg-marker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M5 8C45 3 125 6 193 3c4 0 6 4 5 10l-1 17c-1 5-7 7-37 6-50-2-110 2-152 1-5 0-7-4-6-10l1-13c0-3 1-5 2-6z' fill='%23FFE45C'/%3E%3C/svg%3E");
  /* 手書きの矢印（→ のかわり） */
  --svg-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 16'%3E%3Cpath d='M2 9.5C9 8 17 8.6 26 7.6M20 2.8c2.2 1.9 4.5 3.5 6.6 4.9-2.6 1.7-4.7 3.6-6.4 5.6' fill='none' stroke='%231B171D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, p, ul, ol {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--lav-deep);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 800;
}

.skip-link:focus {
  top: 12px;
}

/* アイコン（KepiIcons）の線を、マーカーで描いたように少しゆらす（フィルターは js/site.js が入れる） */
.ki:not(.ki-ava) {
  filter: url(#kepi-hand);
}

/* ---------- テープで貼る（紙・箱の上に1枚） ---------- */
.taped {
  position: relative;
}

.taped::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -13px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(-2.5deg);
  background: var(--tape);
  box-shadow: 0 1px 1px rgba(27, 23, 29, 0.08);
  clip-path: polygon(2% 0, 98% 0, 100% 12%, 97% 28%, 100% 44%, 97% 60%, 100% 76%, 97% 92%, 98% 100%, 2% 100%, 0 88%, 3% 72%, 0 56%, 3% 40%, 0 24%, 3% 8%);
  pointer-events: none;
}

/* ---------- ボタン（マーカーで囲んだ紙） ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border: var(--line);
  border-radius: var(--cut);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.btn-primary {
  background: var(--pop);
}

.btn-primary:hover {
  background: var(--pop-hover);
}

.btn-youtube {
  background: #FF0033;
  color: #fff;
}

.btn-x {
  background: var(--ink);
  color: #fff;
}

.btn-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 16px;
  font-size: 0.85rem;
  border-radius: var(--cut-sm);
}

.text-link {
  color: var(--lav-deep);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* 蛍光ペンを引くリンク（なぞると、ペンを引いたように色がのびる） */
.marker-link {
  padding: 0 3px;
  font-weight: 800;
  background: var(--svg-marker) no-repeat 0 88% / 100% 44%;
  transition: background-size 0.25s ease;
}

.marker-link:hover {
  background-size: 100% 90%;
}

/* ---------- ヘッダー（紙を1枚、上に貼った形） ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
}

.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 8px;
  background: var(--svg-line) center / 100% 100% no-repeat;
  pointer-events: none;
}

.header-inner {
  max-width: 1120px;
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-synthesis: none;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: var(--line);
  transition: transform 0.2s ease;
}

.brand:hover img {
  transform: rotate(-8deg);
}

.site-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* いまのページは、蛍光ペンで引いた形。なぞると、ペンがのびる */
.site-nav a {
  padding: 6px 10px;
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
  background: var(--svg-marker) no-repeat 0 82% / 0% 46%;
  transition: background-size 0.22s ease;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  background-size: 100% 46%;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-height: 42px;
  padding: 3px 14px 3px 5px;
  border: var(--line);
  border-radius: var(--cut);
  background: var(--paper);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}

.member-pill:hover {
  background: var(--lav-tint);
}

.member-pill-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lav-tint);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.member-pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- レイアウト ---------- */
.layout {
  max-width: 1120px;
  margin: 26px auto 64px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}

.layout-side {
  display: grid;
  gap: 34px;
  padding-top: 10px;
}

.page-narrow {
  max-width: 780px;
  margin: 26px auto 64px;
  padding: 0 20px;
}

/* ---------- メインビジュアル（マスコットが、ページの地にそのまま立っている） ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 26px;
}

.hero-text {
  padding: 30px 0 42px;
}

.hero h1 {
  word-break: auto-phrase;
  font-family: var(--font-display);
  font-weight: 800;
  font-synthesis: none;
  font-size: clamp(1.9rem, 3.9vw, 2.6rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.hero-lead {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 700;
  max-width: 25em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 26px;
}

.hero-actions .btn {
  min-height: 52px;
  padding: 12px 30px;
  font-size: 1.02rem;
}

.hero-link {
  font-weight: 800;
  padding: 2px 34px 2px 3px;
  background:
    var(--svg-arrow) no-repeat right 2px center / 26px 14px,
    var(--svg-marker) no-repeat 0 88% / 0% 44%;
  transition: background-size 0.25s ease;
}

.hero-link:hover {
  background-size: 26px 14px, calc(100% - 32px) 44%;
}

.hero-art {
  align-self: end;
  justify-self: center;
  width: 100%;
  max-width: 330px;
}

.phrase {
  display: inline-block;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- セクション ---------- */
.section {
  margin-bottom: 64px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

/* 見出しは、蛍光ペンを引いた形 */
.section-title {
  width: fit-content;
  max-width: 100%;
  padding: 0 6px;
  margin-left: -6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-synthesis: none;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
  background: var(--svg-marker) no-repeat 0 86% / 100% 46%;
}

/* 見出しのそばの、つくった人のひとこと（手書き） */
.section-lead {
  margin: 2px 0 20px;
  font-family: var(--font-hand);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-lav);
}

.section-more {
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0 32px 0 3px;
  text-decoration: none;
  color: var(--ink);
  background: var(--svg-arrow) no-repeat right center / 24px 13px;
}

.section-more:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------- ゲーム一覧（段ボール箱。前にラベルをテープで貼ってある） ---------- */
.game-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 28px;
  padding-top: 16px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 18px;
  background:
    linear-gradient(var(--box-mid), var(--box-mid)) no-repeat 0 0 / 100% 7px,
    var(--box);
  border-radius: 4px 6px 5px 3px;
  box-shadow: inset 0 -5px 0 rgba(176, 150, 102, 0.35), 0 12px 20px -14px rgba(46, 30, 72, 0.6);
  transition: transform 0.15s ease;
}

/* 箱のふたを止めたガムテープ（上のふちにかかる） */
.game-card::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -8px;
  left: 50%;
  width: 58px;
  height: 30px;
  transform: translateX(-50%);
  background: rgba(214, 190, 140, 0.92);
  box-shadow: inset 0 -2px 0 rgba(150, 120, 70, 0.25);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 92% 88%, 84% 100%, 76% 88%, 68% 100%, 60% 88%, 52% 100%, 44% 88%, 36% 100%, 28% 88%, 20% 100%, 12% 88%, 4% 100%, 0 92%);
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-3px);
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border: var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: #111827;
}

.game-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 自己ベスト（箱にはった小さな紙） */
.game-best {
  position: absolute;
  left: 8px;
  top: 8px;
  max-width: calc(100% - 16px);
  padding: 1px 9px;
  border-radius: 2px;
  background: var(--paper);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 紙のラベル（絵の下のほうに重ねて貼る。文字は傾けない） */
.game-body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  margin: -26px 12px 0;
  padding: 16px 18px 18px;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(27, 23, 29, 0.06), 0 6px 14px -6px rgba(60, 40, 10, 0.45);
}

.game-genre {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.game-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-synthesis: none;
  font-size: 1.3rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.game-desc {
  flex: 1;
  color: var(--ink-soft);
  font-size: 0.9rem;
  /* カードの形をそろえるため、説明は3行まで（全部は、ゲームのページで） */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.game-meta {
  margin-top: 4px;
  font-family: var(--font-hand);
  font-size: 0.86rem;
  color: var(--ink);
}

/* 「遊ぶ」は、ラベルの右上に貼った黄色のシール */
.game-cta.btn {
  position: absolute;
  top: -16px;
  right: -10px;
  min-height: 0;
  padding: 7px 16px 8px;
  border: var(--line);
  border-radius: 999px 999px 999px 999px / 800px 800px 900px 900px;
  background: var(--pop);
  font-size: 0.92rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.game-card:hover .game-cta.btn {
  background: var(--pop-hover);
}

/* カードの下のタグ（#タイミング など） */
.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--lav-deep);
}

/* ---------- ゲームの並べかえ・タグ・さがす ---------- */
.game-tools {
  display: grid;
  gap: 8px;
  margin: 0 0 6px;
}

.game-tools-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.game-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}

/* ジャンルの選択ボックスと、さがす（2026年11月13日から。タグが増えても1つの箱のまま） */
.game-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pick {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  padding: 0 8px 0 12px;
  border: var(--line);
  border-radius: var(--cut-sm);
  background: var(--paper);
  cursor: pointer;
}

.pick:focus-within {
  outline: 3px solid var(--lav);
}

.pick-label {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* 手書きの「v」の矢印。しぼりこんでいるときは、文字に蛍光ペンを引く */
.pick select {
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1.6 2.2C4 4.3 5.6 5.9 7.1 7.2 8.8 5.6 10.4 4 12.4 1.8' fill='none' stroke='%231B171D' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  max-width: 12em;
  height: 38px;
  padding: 0 24px 0 2px;
  border: 0;
  border-radius: 0;
  background: var(--chev) no-repeat right 4px center / 13px 9px;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  text-overflow: ellipsis;
  cursor: pointer;
  outline: none;
}

.pick.is-on select {
  background: var(--chev) no-repeat right 4px center / 13px 9px, var(--svg-marker) no-repeat 0 84% / calc(100% - 22px) 46%;
}

/* 押すと、蛍光ペンを引いた形になる（文字だけのボタン） */
.view-btn {
  min-height: 38px;
  padding: 4px 9px;
  border: 0;
  background: var(--svg-marker) no-repeat 0 84% / 0% 46%;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-size 0.22s ease;
}

.view-btn:hover {
  background-size: 100% 46%;
}

.view-btn[aria-pressed='true'] {
  background-size: 100% 46%;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.game-search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 260px;
  max-width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: var(--line);
  border-radius: var(--cut-sm);
  background: var(--paper);
}

.game-search:focus-within {
  outline: 3px solid var(--lav);
}

.game-search-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.game-search input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

.game-note {
  font-family: var(--font-hand);
  font-size: 0.92rem;
  color: var(--ink-lav);
}

/* しぼりこんで、1つもなかったとき */
.game-empty {
  grid-column: 1 / -1;
  padding: 26px 0;
  text-align: center;
  font-weight: 700;
}

.game-reset {
  margin-left: 8px;
  padding: 4px 6px;
  border: 0;
  background: none;
  font-weight: 800;
  color: var(--lav-deep);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* ---------- ランキング（1枚の紙にまとめた表） ---------- */
.rank-grid {
  position: relative;
  margin-top: 22px;
  padding: 14px 24px 10px;
  background: var(--paper);
  border-radius: 3px;
  box-shadow: var(--lift);
}

.rank-grid::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -13px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(2deg);
  background: var(--tape);
  clip-path: polygon(2% 0, 98% 0, 100% 12%, 97% 28%, 100% 44%, 97% 60%, 100% 76%, 97% 92%, 98% 100%, 2% 100%, 0 88%, 3% 72%, 0 56%, 3% 40%, 0 24%, 3% 8%);
  pointer-events: none;
}

/* ゲームの選択ボックスと「挑戦する」（2026年11月13日から。ゲームが増えても1つの箱のまま。形はゲームの一覧のジャンルと同じ .pick） */
.rank-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 12px;
}

.rank-pick {
  /* 絵と選択ボックスの2列。選択ボックスの列は 0 まで縮められる（長いゲームの名前でも、ページが横に広がらない） */
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  flex: 0 1 auto;
  max-width: min(100%, 24em);
  padding-left: 6px;
}

.rank-pick img {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.rank-pick select {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

/* 選んだゲームの上位5人 */
.rank-panel {
  padding: 10px 0 8px;
  background: var(--svg-dash) repeat-x left top / 44px 6px;
}

/* ランキングの種類（ゲームの中のランキングのタブと同じ） */
.rank-boards {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0 0 0 -9px;
}

.rank-card-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.rank-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 10.5rem; /* 5人分。タブを切りかえても、下が上下に動かないように */
}

.rank-row {
  display: grid;
  grid-template-columns: 30px 28px minmax(0, 1fr) auto;
  grid-template-areas: 'pos ava name val';
  align-items: center;
  column-gap: 6px;
  padding: 3px 6px;
  font-size: 0.9rem;
}

.rank-pos { grid-area: pos; }
.rank-ava { grid-area: ava; text-align: center; }
.rank-name { grid-area: name; }
.rank-val { grid-area: val; }

.rank-row.is-me {
  background: var(--svg-marker) no-repeat center / 100% 100%;
}

.rank-pos {
  font-weight: 800;
  text-align: center;
}

.rank-name {
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.rank-val {
  font-weight: 800;
  white-space: nowrap;
  font-size: 0.88rem;
  line-height: 1.3;
  text-align: right;
}

.rank-val small {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.rank-empty {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-family: var(--font-hand);
  font-size: 0.9rem;
  padding: 2px;
}

/* 上位5人に入っていないときの、自分の順位 */
.rank-mine {
  margin: 6px 0 0;
  padding: 0 6px;
  font-weight: 800;
  font-size: 0.86rem;
}

/* 「挑戦する」は、手書きの矢印のついた文字 */
.rank-try {
  flex-shrink: 0;
  min-height: 0;
  padding: 0 30px 0 2px;
  border: 0;
  border-radius: 0;
  background: var(--svg-arrow) no-repeat right center / 22px 12px;
  font-size: 0.84rem;
  white-space: nowrap;
  transform: none;
}

.rank-try:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------- お知らせ・ブログの一覧 ---------- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 22px;
}

.filter-btn {
  min-height: 38px;
  padding: 4px 10px;
  border: 0;
  background: var(--svg-marker) no-repeat 0 84% / 0% 46%;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-size 0.22s ease;
}

.filter-btn:hover {
  background-size: 100% 46%;
}

.filter-btn[aria-pressed='true'] {
  background-size: 100% 46%;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.post-list {
  display: grid;
}

/* お知らせは、掲示板に貼った紙 */
#news .post-list,
.page-narrow .post-list {
  position: relative;
  margin-top: 18px;
  padding: 10px 24px;
  background: var(--paper);
  border-radius: 3px;
  box-shadow: var(--lift);
}

#news .post-list::before,
.page-narrow .post-list::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -13px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--tape);
  clip-path: polygon(2% 0, 98% 0, 100% 12%, 97% 28%, 100% 44%, 97% 60%, 100% 76%, 97% 92%, 98% 100%, 2% 100%, 0 88%, 3% 72%, 0 56%, 3% 40%, 0 24%, 3% 8%);
  pointer-events: none;
}

.post-item {
  display: block;
  padding: 16px 2px 18px;
  background: var(--svg-dash) repeat-x left bottom / 44px 6px;
}

.post-item:last-child {
  background: none;
}

.post-item:hover .post-title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* 記事の絵（アイコン）は出さない */
.post-icon {
  display: none;
}

.post-meta,
.post-title,
.post-excerpt {
  display: block;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* 日付は朱色のハンコ */
.post-meta time,
.article-header time {
  display: inline-block;
  padding: 0 7px;
  border: 2px solid var(--stamp);
  border-radius: 5px;
  color: var(--stamp);
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.55;
  letter-spacing: 0.04em;
}

.post-title {
  font-weight: 800;
  line-height: 1.55;
}

.post-excerpt {
  margin-top: 4px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* 分類（手書き） */
.cat-tag {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--ink);
}

/* ブログは、ラベンダーの地にそのまま書いた目次 */
#blog .post-list {
  margin-top: 6px;
}

#blog .post-item {
  padding: 18px 0 20px;
  background: var(--svg-line-soft) no-repeat left bottom / 100% 6px;
}

#blog .post-item:last-child {
  background: none;
}

#blog .post-meta,
#blog .post-excerpt {
  color: var(--ink-lav);
}

#blog .post-title {
  font-size: 1.08rem;
}

/* ---------- サイドの紙 ---------- */
.card {
  position: relative;
  background: var(--paper);
  border-radius: 3px;
  padding: 22px 20px 20px;
  box-shadow: var(--lift);
}

.card-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

/* 会員証（本物のカードのような形） */
#member-card {
  padding: 0;
  background: none;
  box-shadow: none;
}

.mcard {
  position: relative;
  padding: 16px 18px 16px;
  border: var(--line);
  border-radius: 16px;
  background:
    linear-gradient(var(--lav), var(--lav)) no-repeat 0 0 / 100% 44px,
    var(--paper);
}

.member-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  margin: -6px 0 18px;
}

.member-head .card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-synthesis: none;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

/* 「この端末に保存」などは、カードに押したハンコ */
.status-chip {
  display: inline-block;
  padding: 0 6px;
  border: 2px solid var(--stamp);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--stamp);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.6;
  white-space: nowrap;
}

[data-kepi-status='google'] .status-chip {
  border-color: #2F7D55;
  color: #2F7D55;
}

.member-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.member-avatar {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border: var(--line);
  border-radius: 12px;
  background: var(--lav-tint);
  display: grid;
  place-items: center;
  font-size: 1.9rem;
}

.member-name {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-all;
}

.member-x {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.member-x a {
  color: var(--ink);
  font-weight: 800;
}

/* スタンプカード（遊んだゲームに、ハンコが押される） */
.stamp-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 6px;
  padding: 10px 0 2px;
  background: var(--svg-dash) repeat-x left top / 44px 6px;
}

.stamp-slot {
  position: relative;
  aspect-ratio: 1;
  border: 2px dashed #CFC6DC;
  border-radius: 50%;
  overflow: hidden;
  background: var(--lav-tint);
}

.stamp-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  opacity: 0.28;
}

.stamp-slot.is-on {
  border: 2px solid var(--ink);
}

.stamp-slot.is-on img {
  filter: none;
  opacity: 1;
}

/* 押したハンコ（朱色の輪） */
.stamp-slot.is-on::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 2px solid var(--stamp);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(200, 66, 58, 0.35);
  transform: rotate(-12deg) scale(0.92);
}

.stamp-count {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.stamp-count span {
  white-space: nowrap;
}

.stamp-count b {
  font-size: 1.05rem;
  color: var(--ink);
}

.member-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.member-note {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--ink-lav);
}

/* つくった人（写真をテープで貼ったメモ） */
.creator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.creator img {
  width: 76px;
  height: auto;
  flex-shrink: 0;
  padding: 5px 5px 14px;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(27, 23, 29, 0.08), 0 4px 10px rgba(46, 30, 72, 0.28);
  transform: rotate(-4deg);
}

.creator-name {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  line-height: 1.2;
}

.creator-role {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.creator-desc {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.sns-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 12px;
}

.sns-row a {
  padding: 4px 0;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: var(--lav);
}

.sns-row a:hover {
  text-decoration-color: currentColor;
}

/* ---------- フッター ---------- */
.site-footer {
  position: relative;
  padding: 34px 20px 36px;
  text-align: center;
  font-size: 0.84rem;
  background: var(--svg-line) no-repeat center top / min(1080px, calc(100% - 40px)) 8px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  font-weight: 800;
  font-synthesis: none;
}

.footer-brand img {
  width: 30px;
  height: 30px;
  border: var(--line);
  border-radius: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  margin-bottom: 8px;
}

.footer-links a {
  display: inline-block;
  padding: 8px 2px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-copy {
  color: var(--ink-lav);
}

/* ---------- スマホ用の下部メニュー ---------- */
.mobile-nav {
  display: none;
}

/* ---------- 会員証の設定（ダイアログ） ---------- */
.dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 26px 20px 20px;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 18px 40px -12px rgba(27, 23, 29, 0.55);
  color: var(--ink);
}

.dialog::backdrop {
  background: rgba(27, 23, 29, 0.55);
}

.dialog h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.dialog h2:focus {
  outline: none;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--lav-tint);
}

.dialog-lead {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.field {
  margin-bottom: 14px;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: var(--line);
  border-radius: var(--cut-sm);
  background: var(--paper);
  font: inherit;
  font-size: 1rem;
}

.field input:focus {
  outline: 3px solid var(--lav);
  outline-offset: 0;
}

.field-hint {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.field-error {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #C81E1E;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-opt {
  width: 44px;
  height: 44px;
  border: 2px solid #D9D3E3;
  border-radius: 50%;
  background: var(--paper);
  font-size: 1.35rem;
  cursor: pointer;
}

.avatar-opt[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--pop);
}

.dialog-login {
  margin-top: 18px;
  padding-top: 18px;
  background: var(--svg-dash) repeat-x left top / 44px 6px;
}

.dialog-login p {
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---------- 記事ページ（テープで貼った紙） ---------- */
.breadcrumb {
  margin-bottom: 22px;
  font-size: 0.8rem;
  color: var(--ink-lav);
}

.breadcrumb ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.breadcrumb li + li::before {
  content: '›';
  margin-right: 4px;
}

.breadcrumb a {
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb li[aria-current='page'] {
  max-width: min(30em, 60vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article,
.doc {
  position: relative;
  background: var(--paper);
  border-radius: 3px;
  padding: 44px 46px 40px;
  box-shadow: var(--lift);
}

.article::before,
.doc::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -13px;
  left: 50%;
  width: 104px;
  height: 27px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--tape);
  clip-path: polygon(2% 0, 98% 0, 100% 12%, 97% 28%, 100% 44%, 97% 60%, 100% 76%, 97% 92%, 98% 100%, 2% 100%, 0 88%, 3% 72%, 0 56%, 3% 40%, 0 24%, 3% 8%);
  pointer-events: none;
}

.article-header {
  padding-bottom: 22px;
  margin-bottom: 26px;
  background: var(--svg-line) no-repeat left bottom / 100% 7px;
}

.article-header time {
  margin-right: 10px;
}

.article-header h1,
.doc h1 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-synthesis: none;
  font-size: clamp(1.4rem, 3.6vw, 1.85rem);
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.doc h1 {
  margin: 0 0 8px;
}

.article-body,
.doc-body {
  font-size: 1rem;
  line-height: 1.95;
}

.article-body > * + *,
.doc-body > * + * {
  margin-top: 1.1em;
}

/* 記事の見出しは、蛍光ペンを引いた形 */
.article-body h2,
.doc-body h2 {
  width: fit-content;
  max-width: 100%;
  margin-top: 2.1em;
  padding: 0 4px;
  margin-left: -4px;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.6;
  background: var(--svg-marker) no-repeat 0 90% / 100% 50%;
}

.article-body h3,
.doc-body h3 {
  margin-top: 1.6em;
  font-size: 1.05rem;
  font-weight: 800;
}

.article-body a,
.doc-body a {
  color: var(--lav-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body ul,
.article-body ol,
.doc-body ul,
.doc-body ol {
  padding-left: 1.4em;
}

.article-body strong {
  background: linear-gradient(transparent 62%, #FFE98A 62%);
}

/* 記事の写真（ブログの編集ページ blog/edit.html の「写真」で入れたもの。[ ] の中の説明は写真の下に出る） */
.article-body .post-photo {
  margin: 1.8em 0;
}

.post-photo img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  margin: 0 auto;
  border-radius: 3px;
  box-shadow: var(--lift);
}

.post-photo figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: center;
}

.article-body img {
  max-width: 100%;
  height: auto;
}

/* 記事の中の引用（> ではじまる行） */
.article-body blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 2px 0 2px 16px;
  border-left: 4px solid var(--lav);
  color: var(--ink-lav);
}

/* 記事の下の「遊んでみる」（段ボール箱の形） */
.cta-box {
  position: relative;
  padding: 26px 20px 22px;
  border-radius: 4px 6px 5px 3px;
  background:
    linear-gradient(var(--box-mid), var(--box-mid)) no-repeat 0 0 / 100% 7px,
    var(--box);
  text-align: center;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 58px;
  height: 30px;
  transform: translateX(-50%);
  background: rgba(214, 190, 140, 0.92);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 92% 88%, 84% 100%, 76% 88%, 68% 100%, 60% 88%, 52% 100%, 44% 88%, 36% 100%, 28% 88%, 20% 100%, 12% 88%, 4% 100%, 0 92%);
}

.cta-box p {
  font-weight: 800;
  margin-bottom: 12px;
}

.cta-box a.btn {
  color: var(--ink);
  text-decoration: none;
}

.article-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 36px;
  padding-top: 22px;
  background: var(--svg-dash) repeat-x left top / 44px 6px;
}

.doc-date {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.doc-table th,
.doc-table td {
  padding: 8px 10px;
  border: 1px solid #CFC8DA;
  vertical-align: top;
  text-align: left;
}

.doc-table th {
  background: var(--lav-tint);
  font-weight: 800;
}

.table-scroll {
  overflow-x: auto;
}

/* このサイトについて：ゲームの一覧（小さな箱の印つき） */
.game-links {
  list-style: none;
  padding: 0 !important;
  display: grid;
  gap: 4px;
}

.game-links a {
  display: block;
  position: relative;
  padding: 10px 12px 10px 34px;
  text-decoration: none !important;
  color: var(--ink) !important;
  border-radius: var(--cut-sm);
}

.game-links a::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 17px;
  width: 16px;
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: linear-gradient(var(--box-dark), var(--box-dark)) no-repeat center top / 2px 5px, var(--box);
}

.game-links a:hover {
  background: var(--lav-tint);
}

.game-links small {
  display: block;
  font-weight: 500;
  color: var(--ink-soft);
}

/* よくある質問（about.html） */
.faq {
  display: grid;
  gap: 4px;
}

.faq dt {
  position: relative;
  padding: 10px 0 2px 34px;
  font-weight: 800;
}

.faq dt::before {
  content: 'Q';
  position: absolute;
  left: 0;
  top: 7px;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 50% 46% 52% 48%;
  background: var(--pop);
  font-family: var(--font-display);
  font-size: 0.8rem;
  line-height: 22px;
  text-align: center;
}

.faq dd {
  margin: 0 0 10px;
  padding: 0 0 12px 34px;
  color: var(--ink-soft);
  background: var(--svg-dash) repeat-x left bottom / 44px 6px;
}

.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.email-row code {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--lav-tint);
  font-family: inherit;
  font-weight: 800;
}

/* ---------- 見つからないページ ---------- */
.notfound {
  text-align: center;
}

.notfound img {
  width: 220px;
  margin-bottom: 18px;
}

.notfound h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-synthesis: none;
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.notfound p {
  color: var(--ink-lav);
  margin-bottom: 22px;
}

/* ---------- タブレット・スマホ：メニューを画面の下に出す ---------- */
@media (max-width: 1000px) {
  .site-nav {
    display: none;
  }

  .member-pill {
    margin-left: auto;
    max-width: 48vw;
  }

  body {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    justify-content: space-around;
    padding: 7px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--paper);
  }

  .mobile-nav::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -4px;
    height: 8px;
    background: var(--svg-line) center / 100% 100% no-repeat;
    pointer-events: none;
  }

  .mobile-nav a {
    flex: 1;
    max-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 0 2px;
    font-size: 0.7rem;
    font-weight: 800;
  }

  .mobile-nav a span:first-child {
    font-size: 1.3rem;
    line-height: 1.25;
  }

  /* いまのページは、文字の下に蛍光ペン */
  .mobile-nav a span:last-child {
    padding: 0 4px;
  }

  .mobile-nav a[aria-current] span:last-child {
    background: var(--svg-marker) no-repeat 0 85% / 100% 55%;
  }
}

/* ---------- スマホ・タブレット：1列にする ---------- */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 14px;
  }

  .layout-side {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 34px 28px;
  }

  .rank-grid {
    padding: 12px 18px 6px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 8px 14px;
    gap: 10px;
  }

  .brand {
    font-size: 1.15rem;
    gap: 8px;
  }

  .brand img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .member-pill {
    padding-right: 10px;
    font-size: 0.8rem;
  }

  /* スマホは、見出しの右にマスコット。最初の画面に、ゲームの箱が見えるように */
  .hero {
    grid-template-columns: minmax(0, 1fr) 128px;
    grid-template-areas:
      'text art'
      'lead lead'
      'act act';
    gap: 0 6px;
    margin-bottom: 18px;
  }

  .hero-text {
    display: contents;
  }

  .hero h1 {
    grid-area: text;
    align-self: center;
    padding-top: 6px;
    font-size: clamp(1.45rem, 6.6vw, 1.8rem);
  }

  .hero-art {
    grid-area: art;
    max-width: 128px;
    align-self: end;
    margin-top: 14px;
  }

  .hero-lead {
    grid-area: lead;
    margin-top: 10px;
    font-size: 0.92rem;
  }

  .hero-actions {
    grid-area: act;
    margin-top: 16px;
    gap: 12px 20px;
  }

  .hero-actions .btn {
    min-height: 48px;
    padding: 10px 26px;
  }

  .section {
    margin-bottom: 52px;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .game-list {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .game-card .game-body {
    margin: -22px 10px 0;
  }

  /* スマホ：ジャンルとさがすを横にならべて、1行に（入らないときは2行） */
  .game-filters {
    width: 100%;
  }

  .game-search {
    flex: 1 1 150px;
    width: auto;
    min-width: 0;
    gap: 5px;
    padding: 0 10px;
  }

  .pick {
    gap: 4px;
    padding: 0 6px 0 10px;
  }

  .pick select {
    padding-right: 20px;
    background-position: right 2px center;
  }

  .pick.is-on select {
    background-position: right 2px center, 0 84%;
  }

  .game-title {
    font-size: 1.2rem;
  }

  .article,
  .doc {
    padding: 34px 18px 26px;
  }

  #news .post-list,
  .page-narrow .post-list {
    padding: 8px 16px;
  }

  .layout-side {
    grid-template-columns: 1fr;
  }
}

/* スマホを横にしたとき：マスコットを小さくして、すぐ下のゲームが見えるように */
@media (max-height: 520px) and (orientation: landscape) {
  .hero-text {
    padding: 12px 0 20px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-art {
    max-width: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- 広告（Googleアドセンス。data.js に ID を入れるまでは表示されない） ---------- */
.ad-slot {
  margin: 28px 0;
  padding: 8px 10px 10px;
  border-radius: 3px;
  background: var(--paper);
  min-height: 120px;
}

.ad-slot-side {
  margin: 0;
}

.ad-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* 記事の途中・記事の下の枠（js/site.js が記事のページに入れる） */
.ad-slot-article {
  margin: 30px 0;
  border: 1px dashed var(--lav-mid);
}

.ad-slot-article-end {
  margin: 26px 0 26px;
}

.ad-slot-article .ad-label,
.ad-slot-article-end .ad-label {
  text-align: center;
}

/* 出せる広告がなかったときは、枠ごと隠す */
.ad-slot:has(ins.adsbygoogle[data-ad-status='unfilled']) {
  display: none;
}

/* =============================================================
   ほかの言語（js/i18n.js が <html lang="…"> を切りかえる）
   ============================================================= */

/* ---------- 言語ごとの文字の形 ----------
   日本語の丸ゴシック（M PLUS Rounded 1c）には中国語・韓国語・タイ語の字がない・形がちがうので、
   その言語のときは、端末に入っているその言語の文字を使う（手書きの字も、その言語のふつうの字にする） */
html:lang(zh-Hans) {
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', 'Source Han Sans SC', sans-serif;
  --font-display: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif;
  --font-hand: var(--font);
}

html:lang(zh-Hant) {
  --font: 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', 'Noto Sans CJK TC', 'Source Han Sans TC', sans-serif;
  --font-display: 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', 'Noto Sans CJK TC', sans-serif;
  --font-hand: var(--font);
}

html:lang(ko) {
  --font: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'Noto Sans CJK KR', sans-serif;
  --font-display: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'Noto Sans CJK KR', sans-serif;
  --font-hand: var(--font);
}

html:lang(th) {
  --font: 'M PLUS Rounded 1c', 'Thonburi', 'Leelawadee UI', 'Noto Sans Thai', 'Noto Sans Thai UI', 'Loma', 'Tahoma', sans-serif;
  --font-display: 'M PLUS Rounded 1c', 'Thonburi', 'Leelawadee UI', 'Noto Sans Thai', 'Loma', sans-serif;
  --font-hand: var(--font);
}

/* ベトナム語は声調の記号が手書きの字にないので、ふつうの字で */
html:lang(vi) {
  --font-hand: var(--font);
}

/* 韓国語は単語の途中で改行しない */
html:lang(ko) body {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ただし日本語のまま出すところ（お知らせの題名など。日本語は単語の間に空白がない）は、ふつうに改行する */
html:lang(ko) [lang='ja'] {
  word-break: normal;
}

/* 日本語のまま出すところ（お知らせの記事など）は、日本語の文字の形で */
html:not(:lang(ja)) [lang='ja'] {
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
}

/* ロゴの「KEPIGAME」は、どの言語でも同じ形 */
.brand,
.footer-brand {
  font-family: 'Dela Gothic One', var(--font-display);
}

/* 英語などは単語が長いので、見出しの字間を詰める */
html:not(:lang(ja)) .hero h1,
html:not(:lang(ja)) .section-title,
html:not(:lang(ja)) .game-title {
  letter-spacing: 0;
}

/* 英語・スペイン語などは横に長くなるので、トップの大きな見出しを少し小さく */
html:lang(en) .hero h1,
html:lang(es) .hero h1,
html:lang(pt) .hero h1,
html:lang(id) .hero h1,
html:lang(vi) .hero h1,
html:lang(th) .hero h1 {
  font-size: clamp(1.45rem, 2.9vw, 2.05rem);
  line-height: 1.25;
  text-wrap: balance;
}

/* ---------- ヘッダーの🌐ボタン ---------- */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 3px 14px 3px 10px;
  border: var(--line);
  border-radius: var(--cut);
  background: var(--paper);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.lang-btn:hover {
  background: var(--lav-tint);
}

.lang-btn-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.lang-btn-short {
  display: none;
}

/* 🌐ボタンが入っても、会員証のボタンは縮んで名前を「…」で省く（画面からはみ出さない） */
.member-pill {
  flex-shrink: 1;
  min-width: 0;
}

/* フッターの「🌐 言語 / Language」 */
.footer-lang {
  display: inline-block;
  padding: 8px 2px;
  border: 0;
  background: none;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ゲームのカードの「いまは日本語のみ」 */
.game-lang-note {
  align-self: flex-start;
  padding: 0 6px;
  border: 2px solid var(--ink-soft);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
}

/* 訳したプライバシーポリシーの「正式なのは日本語版です」 */
.doc-note {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--lav-tint);
  font-size: 0.85rem;
  font-weight: 700;
}

/* お知らせの「記事は日本語で書いています」 */
.lang-note {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--lav-tint);
  font-size: 0.85rem;
  font-weight: 700;
}

.article .lang-note {
  margin: 16px 0 18px;
}

@media (max-width: 1000px) {
  /* メニューが下に移ると、🌐が右へ寄る */
  .lang-btn {
    margin-left: auto;
  }

  .lang-btn + .member-pill {
    margin-left: 0;
  }

  /* 言語の案内は、下のメニューの上に出す */
  html {
    --kepi-lang-hint-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  .lang-btn {
    padding: 3px 10px 3px 8px;
    gap: 4px;
    font-size: 0.8rem;
  }

  .lang-btn-name {
    display: none;
  }

  .lang-btn-short {
    display: inline;
  }
}

/* PCでも横幅がせまいとき（メニューが上に出ている間）は🌐だけにして、会員証のボタンの場所を空ける */
@media (min-width: 1001px) and (max-width: 1180px) {
  .lang-btn {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .lang-btn-name {
    display: none;
  }
}

/* 小さいスマホでは🌐だけにする */
@media (max-width: 420px) {
  .lang-btn {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .lang-btn-short {
    display: none;
  }
}

/* つくった人のカード：配信・動画OKの一言（配信・動画のガイドラインへ） */
.stream-ok { margin-top: 12px; font-size: .84rem; }
.stream-ok a { color: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: var(--lav, #BEB2D1); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.stream-ok a:hover { text-decoration-color: currentColor; }

/* 言語の窓・はじめの案内（js/i18n.js）も、サイトのページでは紙の形に（ゲームの画面は元の形のまま） */
body .kepi-lang-dialog {
  border: 0;
  border-radius: 4px;
  box-shadow: 0 18px 40px -12px rgba(27, 23, 29, 0.55);
}

body .kepi-lang-x {
  border: 0;
}

body .kepi-lang-x:hover {
  background: var(--lav-tint);
}

body .kepi-lang-list button {
  border-radius: var(--cut-sm);
}

body .kepi-lang-list button[aria-current="true"] {
  background: var(--svg-marker) no-repeat center / 100% 100%;
  box-shadow: none;
}

body .kepi-lang-hint {
  border: 0;
  border-radius: 4px;
  box-shadow: 0 12px 28px -8px rgba(27, 23, 29, 0.5);
}

body .kepi-lang-hint-yes {
  border-radius: var(--cut-sm);
}
