/* ============================================
   Poncade - サイバーHUDテーマ
   ============================================ */

:root {
  --bg: #05060f;
  --panel: rgba(16, 20, 42, 0.55);
  --panel-solid: #101428;
  --border: rgba(120, 140, 255, 0.18);
  --border-hi: rgba(0, 240, 255, 0.55);
  --text: #eaefff;
  --text-sub: #8b95bd;
  --cyan: #00f0ff;
  --violet: #7c4dff;
  --magenta: #ff2e88;
  --lime: #58ffb1;
  --gradient: linear-gradient(120deg, var(--cyan), var(--violet) 55%, var(--magenta));
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  /* ノッチ端末（viewport-fit=cover）でも左右が欠けないようにする */
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* ============ 背景レイヤー ============ */
#bg-stars {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  perspective: 340px;
  perspective-origin: 50% 38%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(transparent 40%, #000 72%);
  mask-image: linear-gradient(transparent 40%, #000 72%);
}

.bg-grid::before {
  content: "";
  position: absolute;
  left: -60vw;
  right: -60vw;
  bottom: -55vh;
  /* transformで1マス分ループさせるため上に64px余分に伸ばしておく */
  height: calc(100vh + 64px);
  transform: rotateX(78deg) translateY(0);
  transform-origin: center top;
  background-image:
    linear-gradient(rgba(124, 77, 255, 0.3) 2px, transparent 2px),
    linear-gradient(90deg, rgba(124, 77, 255, 0.3) 2px, transparent 2px);
  background-size: 64px 64px;
  will-change: transform;
  animation: grid-flow 2.6s linear infinite;
}

/* background-positionではなくtransformを動かす（毎フレームの再ペイントを避けてGPU合成にする） */
@keyframes grid-flow {
  to { transform: rotateX(78deg) translateY(64px); }
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 50% 40% at 15% 0%, rgba(124, 77, 255, 0.16), transparent),
    radial-gradient(ellipse 50% 40% at 85% 8%, rgba(0, 240, 255, 0.10), transparent),
    radial-gradient(ellipse 70% 45% at 50% 108%, rgba(255, 46, 136, 0.10), transparent);
  pointer-events: none;
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 6, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* ロゴ画像（img/logo-s.svg ＝ 小さいサイズ用に押し出しを浅くした版） */
.logo-img {
  display: block;
  width: auto;
  height: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.35));
}

.logo-svg {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--border-hi);
  padding: 3px;
  fill: var(--cyan);
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6));
  flex-shrink: 0;
}

.sys-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-sub);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.sys-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.sys-clock { color: var(--cyan); }

/* ============ Hero ============ */
/* 開いた画面のおよそ1/3におさまるコンパクト構成 */
.hero {
  position: relative;
  padding: 40px 0 36px;
  text-align: center;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--lime);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  min-height: 1.6em;
}

.prompt { color: var(--cyan); }

.caret {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--lime);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-title {
  position: relative;
  display: inline-block;
  font-size: clamp(2rem, 6.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  background: linear-gradient(120deg, #ffffff 15%, #9be8ff 45%, #b39dff 75%, #ff9ac6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* グリッチ */
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
}

.glitch::before { text-shadow: -2px 0 var(--cyan); }
.glitch::after { text-shadow: 2px 0 var(--magenta); }

/* JSが .glitching を付与した間だけグリッチが走る（この間にテキストが書き換わる） */
.glitching::before { animation: glitch-a 0.55s steps(1) both; }
.glitching::after { animation: glitch-b 0.55s steps(1) both; }

@keyframes glitch-a {
  0%, 100% { opacity: 0; clip-path: none; transform: none; }
  8% { opacity: 0.85; clip-path: inset(10% 0 58% 0); transform: translate(-4px, -2px); }
  26% { opacity: 0.85; clip-path: inset(62% 0 8% 0); transform: translate(3px, 1px); }
  44% { opacity: 0.85; clip-path: inset(35% 0 40% 0); transform: translate(-2px, 2px); }
  62% { opacity: 0.85; clip-path: inset(78% 0 2% 0); transform: translate(4px, -1px); }
  80% { opacity: 0.85; clip-path: inset(20% 0 65% 0); transform: translate(-3px, 1px); }
  95% { opacity: 0; }
}

@keyframes glitch-b {
  0%, 100% { opacity: 0; clip-path: none; transform: none; }
  8% { opacity: 0.85; clip-path: inset(55% 0 15% 0); transform: translate(4px, 2px); }
  26% { opacity: 0.85; clip-path: inset(5% 0 70% 0); transform: translate(-3px, -1px); }
  44% { opacity: 0.85; clip-path: inset(42% 0 30% 0); transform: translate(2px, -2px); }
  62% { opacity: 0.85; clip-path: inset(12% 0 55% 0); transform: translate(-4px, 1px); }
  80% { opacity: 0.85; clip-path: inset(68% 0 6% 0); transform: translate(3px, -1px); }
  95% { opacity: 0; }
}

/* メインヴィジュアルのロゴ（img/logo.svg の 1 枚）。開いたときに 1 回だけ下からせり上がって現れ、
   そのあとは main.js がときどき .glitching を付けて短いグリッチを走らせる */
.hero-logo {
  display: grid;
  place-items: center;
  width: min(560px, 92%);
  aspect-ratio: 1886 / 370;
  margin: 0 auto 14px;
}

.hero-logo-img {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  animation: logo-in 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

@keyframes logo-in {
  0% { opacity: 0; transform: translateY(16px) scale(0.92); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

.hero-logo.glitching { animation: logo-glitch 0.55s steps(1) both; }

@keyframes logo-glitch {
  0%, 100% { transform: none; filter: none; clip-path: none; }
  8%  { transform: translate(-5px, -2px); filter: drop-shadow(4px 0 0 rgba(255, 46, 136, 0.8)) drop-shadow(-4px 0 0 rgba(0, 240, 255, 0.8)); clip-path: inset(0 0 40% 0); }
  26% { transform: translate(4px, 1px); filter: drop-shadow(-4px 0 0 rgba(255, 46, 136, 0.8)) drop-shadow(4px 0 0 rgba(0, 240, 255, 0.8)); clip-path: inset(30% 0 0 0); }
  44% { transform: translate(-3px, 2px) skewX(-6deg); filter: hue-rotate(40deg) drop-shadow(3px 0 0 rgba(255, 46, 136, 0.8)); clip-path: none; }
  62% { transform: translate(5px, -1px); filter: drop-shadow(-5px 0 0 rgba(0, 240, 255, 0.85)); clip-path: inset(15% 0 25% 0); }
  80% { transform: translate(-2px, 1px); filter: hue-rotate(-30deg); clip-path: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo.glitching { animation: none; }
  .hero-logo-img { animation: none; }
}

/* h1 はサイト名＋キャッチコピーの2行（見出しとしては1つ）。見た目は中の span 側で付ける */
.hero-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: inherit;
  line-height: inherit;
}

.hero-sub {
  display: block;
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.hero-lead {
  color: var(--text-sub);
  font-size: clamp(0.88rem, 2.4vw, 1rem);
}

@keyframes hue-slide {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 404ページ等のCTAボタン */
.hero-cta { margin-top: 26px; }

.btn-start {
  position: relative;
  display: inline-block;
  min-width: 220px;
  border-radius: 10px;
  padding: 1.5px;
  background: var(--gradient);
  background-size: 200% 200%;
  animation: hue-slide 4s linear infinite;
  overflow: hidden;
}

.btn-start-inner {
  display: block;
  padding: 12px 28px;
  border-radius: 9px;
  background: rgba(10, 13, 31, 0.9);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  transition: background 0.25s;
}

.btn-start:hover .btn-start-inner { background: rgba(10, 13, 31, 0.55); }

/* ============ ティッカー ============ */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 13, 31, 0.6);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker-scroll 28s linear infinite;
}

.ticker-item {
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--text-sub);
}

.ticker-item::after {
  content: "◆";
  margin: 0 28px;
  color: var(--violet);
}

@keyframes ticker-scroll {
  to { transform: translateX(-50%); }
}

/* ============ セクション ============ */
.section { padding: 36px 0 32px; }

.section-head { text-align: center; margin-bottom: 32px; }

.section-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  color: var(--cyan);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.section-lead {
  max-width: 640px;
  margin: 12px auto 0;
  color: var(--text-sub);
  font-size: 0.92rem;
}

.game-count {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--text-sub);
}
.game-count:empty { display: none; }
.game-count .count-num { color: var(--cyan); font-weight: 700; }

/* ============ 表示切り替えトグル ============ */
.view-toggle {
  display: inline-flex;
  margin-top: 18px;
  padding: 3px;
  gap: 3px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.view-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.view-btn:hover { color: var(--text); }

.view-btn.is-active {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.35);
}

/* ============ タグ絞り込み（アイコン表示時のみJSが表示） ============ */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

/* display: flex が hidden 属性の display: none を上書きしないようにする */
.tag-filter[hidden] { display: none; }

.filter-btn {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--panel);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.filter-btn:hover { color: var(--text); }

.filter-btn.is-active {
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.1);
}

/* ============ ゲームカード ============ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.game-card {
  position: relative;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* 3Dチルトはホバー可能端末（PC）でのみ動作する（JS側も (hover:hover) で分岐）。
   transform-style / will-change を全カードに常時付けると、カード枚数ぶんの
   合成レイヤーが常駐してGPUメモリを圧迫し、特にiOS Safariではスクロール中に
   タブが破棄・再読み込みされて先頭に戻ってしまう。ホバー端末に限定し、
   will-change は実際にホバー中のカードだけに付けて常駐レイヤーを増やさない。 */
@media (hover: hover) and (pointer: fine) {
  .game-card.tilt { transform-style: preserve-3d; }
  .game-card.tilt:hover { will-change: transform; }
}

.game-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.25), 0 18px 60px rgba(0, 240, 255, 0.12), 0 8px 40px rgba(124, 77, 255, 0.22);
}

/* コーナーブラケット */
.card-frame::before,
.card-frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--cyan);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 3;
}

.card-frame::before {
  top: -2px;
  left: -2px;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 16px;
}

.card-frame::after {
  bottom: -2px;
  right: -2px;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 16px;
}

.game-card:hover .card-frame::before,
.game-card:hover .card-frame::after { opacity: 1; }

.game-card-link {
  display: block;
  color: inherit;
  height: 100%;
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 15px 15px 0 0;
  background: #0a0d1f;
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.game-card:hover .game-thumb img { transform: scale(1.04); }

/* シャイン */
.thumb-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.18) 50%, transparent 60%);
  transform: translateX(-120%);
  pointer-events: none;
}

.game-card:hover .thumb-shine {
  animation: shine 0.9s ease forwards;
}

@keyframes shine {
  to { transform: translateX(120%); }
}

.thumb-no {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(234, 239, 255, 0.75);
  background: rgba(5, 6, 15, 0.55);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.game-body { padding: 20px 22px 26px; }

.game-status {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--lime);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: pulse 2s ease-in-out infinite;
}

.game-status-dev { color: var(--text-sub); }

.status-dot-dev {
  background: var(--text-sub);
  box-shadow: none;
  animation: none;
}

.game-name {
  font-size: 1.22rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 4px;
  padding: 3px 9px;
  background: rgba(0, 240, 255, 0.06);
}

.game-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.75;
  margin-bottom: 20px;
}

.btn-play {
  position: relative;
  display: block;
  text-align: center;
  border-radius: 10px;
  padding: 1.5px;
  background: var(--gradient);
  background-size: 200% 200%;
  animation: hue-slide 4s linear infinite;
  overflow: hidden;
}

.btn-play-inner {
  display: block;
  padding: 12px;
  border-radius: 9px;
  background: rgba(10, 13, 31, 0.9);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  transition: background 0.25s;
}

.game-card:hover .btn-play-inner { background: rgba(10, 13, 31, 0.55); }

/* Coming soon */
.game-card-soon { border-style: dashed; opacity: 0.75; }

.game-card-soon:hover {
  border-color: var(--border);
  box-shadow: none;
}

.game-thumb-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(120, 140, 255, 0.05) 14px 28px),
    #0a0d1f;
}

.soon-q {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: rgba(139, 149, 189, 0.7);
  letter-spacing: 0.2em;
}

.soon-mark {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: var(--text-sub);
}

/* ============ アイコン表示スタイル ============ */
/* カード表示ではアイコンを出さない */
.game-icon-wrap { display: none; }

.game-grid.is-icons {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 22px 14px;
  justify-items: center;
}

/* カードの器を透明化してアイコン＋タイトルだけにする */
.game-grid.is-icons .game-card {
  background: none;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  width: 100%;
  max-width: 120px;
}

.game-grid.is-icons .game-card:hover { box-shadow: none; }

.game-grid.is-icons .game-thumb,
.game-grid.is-icons .card-frame,
.game-grid.is-icons .game-status,
.game-grid.is-icons .game-tags,
.game-grid.is-icons .game-desc,
.game-grid.is-icons .btn-play { display: none; }

.game-grid.is-icons .game-icon-wrap { display: block; }

.game-icon {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24%;
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.game-grid.is-icons .game-card:hover .game-icon,
.popular-link:hover .game-icon {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--border-hi);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.3), 0 10px 34px rgba(0, 240, 255, 0.2);
}

.game-icon-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: rgba(139, 149, 189, 0.7);
  background:
    repeating-linear-gradient(-45deg, transparent 0 10px, rgba(120, 140, 255, 0.06) 10px 20px),
    #0a0d1f;
  border-style: dashed;
}

.game-grid.is-icons .game-body { padding: 10px 0 0; }

.game-grid.is-icons .game-name {
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.45;
  letter-spacing: 0;
  margin-bottom: 0;
}

/* ============ もっと見る ============ */
/* 表示上限を超えたカードはJSがこのクラスで隠す（JS無効時は全件表示） */
.game-card.is-more-hidden { display: none; }

.more-wrap {
  margin-top: 34px;
  text-align: center;
}

.btn-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-more::after {
  content: "▼";
  font-size: 0.6rem;
  color: var(--cyan);
}

/* 別ページへ進む「もっと見る」（全国ランキング速報 → /ranking-feed/）。開くのではなく進むので矢印を右向きに */
.btn-more-link::after { content: "▶"; }
.rank-feed + .more-wrap { margin-top: 22px; }

.btn-more:hover {
  color: var(--cyan);
  border-color: var(--border-hi);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.25), 0 8px 30px rgba(0, 240, 255, 0.12);
}

/* ============ 人気ゲーム ============ */
/* 32位まで1列に並べ、PC・スマホ共通で横スクロールして見る。
   スクロール領域は .container の左右余白まで広げ、端でアイコンが切れて
   「続きがある」と分かるようにしている（余白ぶんは padding で戻す）。
   上の padding は順位バッジ（-9px）とホバー時の浮き上がりぶん */
.popular-grid {
  display: flex;
  gap: 16px;
  margin: 0 calc(-1 * max(20px, env(safe-area-inset-right))) 0 calc(-1 * max(20px, env(safe-area-inset-left)));
  padding: 12px max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-left: max(20px, env(safe-area-inset-left));
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 149, 189, 0.35) transparent;
}

.popular-grid::-webkit-scrollbar { height: 6px; }
.popular-grid::-webkit-scrollbar-track { background: transparent; }
.popular-grid::-webkit-scrollbar-thumb {
  background: rgba(139, 149, 189, 0.35);
  border-radius: 3px;
}

.popular-item {
  flex: 0 0 104px;
  width: 104px;
  scroll-snap-align: start;
}

.popular-link {
  position: relative;
  display: block;
  color: inherit;
}

.popular-rank {
  position: absolute;
  top: -9px;
  left: -9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background: var(--panel-solid);
  border: 1px solid var(--border);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

/* 1〜3位はメダルカラー */
.popular-rank-1 {
  color: #3d2c00;
  background: linear-gradient(150deg, #ffe89a, #f5b830 60%, #d99a12);
  border-color: rgba(255, 220, 120, 0.9);
  box-shadow: 0 0 12px rgba(245, 184, 48, 0.55), 0 3px 10px rgba(0, 0, 0, 0.5);
}

.popular-rank-2 {
  color: #23283a;
  background: linear-gradient(150deg, #f2f5ff, #bcc6dd 60%, #97a3c0);
  border-color: rgba(220, 228, 250, 0.9);
}

.popular-rank-3 {
  color: #3a2113;
  background: linear-gradient(150deg, #f0bc95, #cd8a55 60%, #a96a3a);
  border-color: rgba(240, 188, 149, 0.9);
}

.popular-name {
  display: block;
  margin-top: 10px;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.45;
  color: var(--text);
}

/* API応答待ちの間に表示するスケルトン（main.js が描画・実データで差し替え） */
.popular-shimmer {
  background:
    linear-gradient(100deg,
      rgba(139, 149, 189, 0) 40%,
      rgba(139, 149, 189, 0.16) 50%,
      rgba(139, 149, 189, 0) 60%),
    rgba(139, 149, 189, 0.1);
  background-size: 200% 100%, auto;
  animation: popular-shimmer 1.4s linear infinite;
}

@keyframes popular-shimmer {
  from { background-position: 100% 0, 0 0; }
  to { background-position: -100% 0, 0 0; }
}

.popular-skel-icon {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24%;
  border: 1px solid var(--border);
}

/* 実データのゲーム名（margin 10px + 1行ぶん約17px）と同じ高さになるようにする */
.popular-skel-name {
  display: block;
  width: 72%;
  height: 11px;
  margin: 13px auto 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .popular-shimmer { animation: none; }
}

/* ============ マイページ（/mypage/） ============ */
/* 件数が少なくてもフッターが画面の途中で浮かないようにする */
.page-my {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.page-my main { flex: 1 0 auto; }

/* マイページ上部の、アカウント（サイト全体で共通のログイン）の帯 */
.mp-account {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 680px;
  margin: 18px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.mp-account.is-on { border-color: rgba(0, 240, 255, 0.35); }
.mp-account[hidden] { display: none; }

.mp-account-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(124, 77, 255, 0.18);
  font-size: 1.2rem;
}

.mp-account.is-on .mp-account-icon { background: rgba(0, 240, 255, 0.14); }
.mp-account-body { flex: 1 1 auto; min-width: 0; }
.mp-account-name { font-weight: 700; font-size: 0.95rem; }
.mp-account-note { color: var(--text-sub); font-size: 0.76rem; line-height: 1.6; overflow-wrap: anywhere; }
.mp-account-link { flex: none; }
.mp-account-link .header-link-mark { color: var(--cyan); }

@media (max-width: 600px) {
  .mp-account { flex-wrap: wrap; }
  .mp-account-link { margin-left: 50px; }
}
.page-my .site-footer { margin-top: 40px; }

/* ヘッダー右のテキストリンク（マイページ ⇄ トップの行き来） */
.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.header-link:hover {
  color: var(--cyan);
  border-color: var(--border-hi);
  background: rgba(0, 240, 255, 0.08);
}

.header-link .header-link-mark { color: #ffd54a; }
.header-link-account .header-link-mark { color: var(--text-sub); }
.header-link-account.is-on .header-link-mark { color: var(--cyan); }

.fav-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.25s, box-shadow 0.25s, opacity 0.25s;
}

.fav-item:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.2), 0 10px 34px rgba(0, 240, 255, 0.1);
}

/* お気に入りから外した直後（同じ★をもう一度押せば元に戻せる） */
.fav-item.is-off {
  opacity: 0.5;
  border-style: dashed;
}

.fav-item.is-off:hover {
  border-color: var(--border);
  box-shadow: none;
}

.fav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
}

.fav-icon {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 24%;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s, border-color 0.25s;
}

.fav-link:hover .fav-icon {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--border-hi);
}

.fav-body {
  min-width: 0;
  line-height: 1.5;
}

.fav-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
  font-weight: 700;
}

.fav-genres {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-sub);
}

.fav-item-note {
  display: block;
  font-size: 0.68rem;
  color: var(--magenta);
}

.fav-item-note:empty { display: none; }

.fav-star {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(10, 13, 31, 0.6);
  color: #ffd54a;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.fav-star[aria-pressed="false"] { color: var(--text-sub); }

.fav-star:hover {
  border-color: var(--border-hi);
  background: rgba(0, 240, 255, 0.08);
}

.fav-star:focus-visible,
.fav-link:focus-visible,
.header-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* 空のとき */
.mp-empty {
  max-width: 520px;
  margin: 0 auto;
  padding: 34px 22px 30px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--panel);
  text-align: center;
}

.mp-empty[hidden] { display: none; }

.mp-empty-mark {
  font-size: 2.6rem;
  line-height: 1;
  color: #ffd54a;
  opacity: 0.8;
  margin-bottom: 10px;
}

.mp-empty-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.mp-empty-note {
  font-size: 0.85rem;
  color: var(--text-sub);
}

.mp-key {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(10, 13, 31, 0.7);
  color: var(--text);
  font-family: var(--mono);
}

.mp-actions {
  margin-top: 28px;
  text-align: center;
}

.mp-actions[hidden] { display: none; }

.mp-note {
  margin-bottom: 16px;
  font-size: 0.78rem;
  color: var(--text-sub);
}

.mp-lead {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* 件数表示（お気に入り件数・プレイ履歴のサマリー） */
.mp-count {
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--text-sub);
}

.mp-count:empty { display: none; }
.mp-count .count-num { color: var(--cyan); font-weight: 700; }

/* ---- タブ ---- */
.mp-tabs {
  display: flex;
  gap: 8px;
  /* 上のアカウント帯・スマゲータウンのステータスとくっつかないように空ける */
  margin-top: 26px;
  margin-bottom: 26px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-x: auto;
  scrollbar-width: none;
}

.mp-tabs::-webkit-scrollbar { display: none; }

.mp-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1 1 0;
  min-width: max-content;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.mp-tab:hover { color: var(--text); }

.mp-tab.is-active {
  color: #05060f;
  background: var(--gradient);
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.22);
}

.mp-tab:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.mp-tab-icon { font-size: 0.95rem; line-height: 1; }

.mp-tab-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(10, 13, 31, 0.5);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
}

.mp-tab-count:empty { display: none; }
.mp-tab.is-active .mp-tab-count { background: rgba(5, 6, 15, 0.28); color: #05060f; }

.mp-panel[hidden] { display: none; }
.mp-panel:focus { outline: none; }

/* ---- 見出し・状態表示 ---- */
.mp-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 12px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.mp-subtitle:first-child { margin-top: 0; }
.mp-subtitle-mark { font-size: 1.05rem; line-height: 1; }

.mp-status {
  margin-bottom: 14px;
  font-size: 0.78rem;
  color: var(--text-sub);
}

.mp-status--ok { color: var(--lime); }

/* ---- 一覧（ランクイン中・記録・プレイ履歴で共通） ---- */
.mp-rank-list,
.mp-rec-list,
.mp-his-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.mp-item { min-width: 0; }

.mp-row {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: inherit;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.mp-row:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.2), 0 10px 34px rgba(0, 240, 255, 0.1);
}

.mp-row:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* 順位バッジ（1〜3位は人気ゲーム欄と同じメダル配色 .popular-rank-N を重ねる） */
.mp-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.mp-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 24%;
  border: 1px solid var(--border);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.45);
}

.mp-row-body {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.45;
}

.mp-row-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 700;
}

.mp-mode {
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 13, 31, 0.5);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.mp-row-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--text-sub);
}

.mp-score { color: var(--cyan); font-weight: 700; }

.mp-player {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10em;
}

.mp-player::before { content: "/ "; }

.mp-chip {
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-sub);
}

.mp-chip--in {
  border-color: rgba(88, 255, 177, 0.5);
  background: rgba(88, 255, 177, 0.1);
  color: var(--lime);
}

.mp-when { color: var(--text); }

.mp-plays::before { content: "\00b7  "; }

.mp-row-date {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  color: var(--text-sub);
}

.mp-row-date:empty { display: none; }

.mp-row-go {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--cyan);
  opacity: 0.75;
}

/* ---- 履歴の削除 ---- */
.mp-clear {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 13, 31, 0.6);
  color: var(--text-sub);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.mp-clear:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

.mp-clear--danger {
  border-color: rgba(255, 46, 136, 0.55);
  color: var(--magenta);
}

.mp-clear--danger:hover {
  color: #fff;
  border-color: var(--magenta);
  background: rgba(255, 46, 136, 0.14);
}

.mp-clear:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.mp-clear-confirm {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.mp-clear-confirm[hidden] { display: none; }
.mp-clear-confirm .mp-note { margin-bottom: 0; }

/* ============ お知らせ（人気ゲームとゲーム一覧の間） ============ */
/* いつも最新の5件。その下に「過去のお知らせ一覧」へ進むボタン */
.news-section { padding-bottom: 8px; }

.news-list {
  display: grid;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
  list-style: none;
}

.news-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid rgba(0, 240, 255, 0.45);
  border-radius: 12px;
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

/* リンクのある行だけホバーで反応させる（リンクなしの行は div で描かれる） */
a.news-row:hover {
  transform: translateX(3px);
  border-color: var(--border-hi);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.1);
}

.news-row:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.news-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-sub);
  white-space: nowrap;
}

.news-tag {
  justify-self: start;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
}

.news-tag-new { color: var(--lime); }
.news-tag-update { color: var(--cyan); }
.news-tag-info { color: #ffc861; }

.news-text {
  font-size: 0.9rem;
  line-height: 1.7;
}

/* 欄の下の「過去のお知らせ一覧」（/news/ へ進むボタン。.btn-more を共用） */
.news-list + .more-wrap { margin-top: 22px; }

/* ============ About ============ */
.about-text {
  max-width: 720px;
  margin: 0 auto 32px;
  color: var(--text-sub);
  font-size: 0.95rem;
  text-align: left;
}
.about-text p + p { margin-top: 14px; }

/* ============ ジャンルから探す ============ */
/* 上にジャンルのボタン（アイコン＋名前）、下にジャンルごとのゲームのアイコン列。
   アイコン列は人気ゲームと同じ横スクロール（.popular-grid を共用。.genre-row で差分だけ足す） */
.genre-icon {
  flex: none;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.45));
}

.genre-nav {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.genre-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 82px;
  padding: 12px 4px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.genre-chip:hover,
.genre-chip:focus-visible {
  border-color: var(--border-hi);
  background: rgba(0, 240, 255, 0.10);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.14);
}

.genre-chip-name {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.genre {
  /* ジャンルのボタンから飛んできたとき、固定ヘッダーに見出しが隠れないように */
  scroll-margin-top: 84px;
}

.genre + .genre { margin-top: 22px; }

.genre-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  padding-bottom: 2px;
}

.genre-title {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.genre-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-sub);
  white-space: nowrap;
}

.genre-desc {
  grid-column: 1 / -1;
  color: var(--text-sub);
  font-size: 0.84rem;
  line-height: 1.6;
}

.genre-row { padding-top: 10px; }

/* ============ つづきから遊ぶ・新着ゲーム（人気ゲームの .popular-grid を共用） ============ */
.section-compact { padding-bottom: 8px; }

.section-more {
  margin-top: 4px;
  text-align: right;
  font-size: 0.8rem;
}
.section-more a { color: var(--text-sub); text-decoration: underline; text-underline-offset: 3px; }
.section-more a:hover { color: var(--cyan); }

.recent-star { color: #ffd54a; margin-right: 2px; }

/* アイコン左上のしるし（お気に入りの ★・新着の NEW）。順位バッジ .popular-rank と同じ位置 */
.popular-star,
.popular-new {
  position: absolute;
  top: -9px;
  left: -9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  border-radius: 12px;
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.popular-star {
  width: 24px;
  font-size: 0.8rem;
  color: #ffd54a;
  background: var(--panel-solid);
  border: 1px solid rgba(255, 213, 74, 0.6);
}

.popular-new {
  padding: 0 8px;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: #04121a;
  background: linear-gradient(120deg, var(--lime), var(--cyan));
}

/* ============ 全国ランキング速報 ============ */
.rank-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 920px;
  margin: 0 auto;
}

.rank-feed-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.rank-feed-row:hover,
.rank-feed-row:focus-visible {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.1);
}

.rank-feed-icon {
  width: 44px;
  height: 44px;
  border-radius: 24%;
  border: 1px solid var(--border);
}

.rank-feed-body { min-width: 0; line-height: 1.45; }

.rank-feed-who {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-feed-who small { font-size: 0.74rem; font-weight: 400; color: var(--text-sub); margin-left: 3px; }

.rank-feed-game {
  display: block;
  font-size: 0.76rem;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-feed-side { text-align: right; white-space: nowrap; }

.rank-feed-rank {
  display: block;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
}
.rank-feed-rank.is-top { color: #ffd54a; }
.rank-feed-rank small { font-size: 0.7rem; margin-right: 1px; }

.rank-feed-time { display: block; font-size: 0.68rem; color: var(--text-sub); }

/* ============ ゲーム一覧の検索 ============ */
.game-search {
  position: relative;
  max-width: 360px;
  margin: 14px auto 0;
}
.game-search[hidden] { display: none; }

.game-search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-sub);
  stroke-width: 2.2;
  stroke-linecap: round;
  pointer-events: none;
}

.game-search-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(16, 20, 42, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* iOS で入力時に画面が拡大しないよう 16px 以上 */
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.game-search-input::placeholder { color: var(--text-sub); }
.game-search-input:focus {
  outline: none;
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.game-empty {
  padding: 28px 0 8px;
  text-align: center;
  color: var(--text-sub);
  font-size: 0.9rem;
}

/* ============ 運営者情報・プライバシーポリシー・利用規約（/company/ /privacy/ /terms/） ============ */
.legal {
  max-width: 780px;
  margin: 0 auto;
  color: var(--text-sub);
  font-size: 0.92rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}
.legal h2 {
  margin: 34px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--cyan);
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.5;
}
.legal h3 { margin: 18px 0 6px; color: var(--text); font-size: 0.95rem; font-weight: 700; }
.legal p + p { margin-top: 10px; }
.legal ul, .legal ol { margin: 8px 0 8px 1.4em; }
.legal ul { list-style: disc; }
.legal li + li { margin-top: 4px; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal-date { margin-top: 30px; text-align: right; font-size: 0.82rem; }

.legal-table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.legal-table th,
.legal-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.legal-table th { width: 30%; color: var(--text); font-weight: 700; background: rgba(120, 140, 255, 0.07); }
.legal-table thead th { width: auto; }

/* ============ お知らせ一覧・個別記事（/news/） ============ */
/* 個別記事へ進む行には「記事」のしるし（リンク型と見分ける） */
.news-row-article .news-text::after {
  content: "Read more ▶";
  display: inline-block;
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  white-space: nowrap;
}

.news-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.news-pager-prev::after { content: none; }
.news-pager-prev::before { content: "◀"; font-size: 0.6rem; color: var(--cyan); }

.news-article { max-width: 780px; margin: 0 auto; }
.news-article-head { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.news-article-meta { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.news-article-title {
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
}
.news-article-body { max-width: none; font-size: 0.98rem; color: var(--text); }
.news-article-body p + p { margin-top: 16px; }
.news-article-body > :first-child { margin-top: 0; }
.news-back { max-width: 780px; margin: 30px auto 0; font-size: 0.86rem; }
.news-back a { color: var(--text-sub); }
.news-back a:hover { color: var(--cyan); }

/* 別ページ（/about/・/faq/）の下のボタン */
.info-cta { text-align: center; margin-top: 34px; }

/* ============ よくある質問 ============ */
/* /faq/ のページで使う（トップページからは 2026-11-15 に別ページへ移した。About も同じ） */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.faq-q {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.faq-mark {
  flex: none;
  font-family: var(--mono);
  color: var(--cyan);
  font-weight: 700;
}

.faq-a {
  margin: 0;
  color: var(--text-sub);
  font-size: 0.9rem;
  padding-left: 30px;
}

.faq-a a { text-decoration: underline; text-underline-offset: 3px; }

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.feature {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 24px 26px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  overflow: hidden;
}

.feature:hover {
  transform: translateY(-4px);
  border-color: var(--border-hi);
  box-shadow: 0 12px 44px rgba(0, 240, 255, 0.12);
}

.feature-no {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(120, 140, 255, 0.16);
  letter-spacing: 0.1em;
}

.feature-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.5));
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.feature p {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* ============ Footer ============ */
.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  padding: 40px 0 calc(46px + env(safe-area-inset-bottom));
  text-align: center;
  background: rgba(5, 6, 15, 0.6);
}

.footer-log {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--lime);
  opacity: 0.75;
  margin-bottom: 14px;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 8px;
}

.footer-logo .logo-svg { width: 22px; height: 22px; }
.footer-logo-img { display: block; width: auto; height: 26px; }

/* フッターの補助リンク（お問い合わせ・不具合報告） */
.footer-links {
  margin: 6px 0 2px;
  font-size: 0.78rem;
}

.footer-links a { color: var(--text-sub); white-space: nowrap; }
.footer-links a:hover { color: var(--cyan); }

.copyright {
  color: var(--text-sub);
  font-size: 0.78rem;
}

/* ============ リビール ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* JS無効時も表示されるように（main.jsが .js-on を付与） */
html:not(.js-on) .reveal {
  opacity: 1;
  transform: none;
}

/* ============ タッチ端末のスクロール負荷対策 ============ */
/* backdrop-filterはスクロール中に毎フレーム再ブラーが走りカクつきの原因になるため、
   タッチ端末では無効化し、少し不透明度を上げた背景で代替する */
@media (hover: none) and (pointer: coarse) {
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(5, 6, 15, 0.92);
  }

  .view-toggle,
  .game-card,
  .fav-item,
  .mp-tabs,
  .mp-row,
  .news-row,
  .feature {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(16, 20, 42, 0.85);
  }

  .thumb-no {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(5, 6, 15, 0.8);
  }

  /* アイコン表示時はカードの器を透明に戻す */
  .game-grid.is-icons .game-card { background: none; }

  /* 無限アニメーションを停止する。全カードのプレイボタンのグラデーション
     （background-position アニメ＝毎フレーム再ペイント×カード枚数）と、
     220vw幅の背景グリッドの毎フレーム合成が積み重なると、iOS Safari が
     GPU/メモリ圧迫でタブを破棄→再読み込みし、スクロール位置が先頭に
     戻ってしまう。静止表示なら見た目はほぼ変わらない */
  .bg-grid::before {
    animation: none;
    will-change: auto;
  }

  .btn-play,
  .btn-start {
    animation: none;
  }

  /* カード表示では画面外のカードの描画をスキップして、
     縦に長い一覧のレンダリング負荷とGPUメモリを抑える
     （非対応ブラウザでは単に無視される。アイコン表示はカードが
     小さく高さの見積もりが合わないため対象外） */
  .game-grid:not(.is-icons) .game-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 560px;
  }
}

/* ============ レスポンシブ ============ */
@media (max-width: 600px) {
  .logo { font-size: 1rem; }
  .sys-status { font-size: 0.6rem; gap: 6px; }
  /* 狭い画面ではヘッダーが詰まるので、装飾のステータス表示は隠して
     マイページへの導線を優先する */
  .header-link + .sys-status { display: none; }
  .header-link { font-size: 0.74rem; padding: 5px 12px; }
  /* ログインの導線（アカウント）も並ぶので、狭い画面では文字を隠してアイコンだけにし、
     サイト名は折り返さない（サイト名は hero の h1 にもある）。ロゴの文字が縦に折れないよう最小幅を 0 に */
  .header-link-account .header-link-text { display: none; }
  .header-link-account { padding: 5px 9px; }
  .header-inner { gap: 8px; }
  .header-inner .logo-text { display: none; }
  /* 3つのタブを横スクロールなしで収める（件数は各パネル側にも出るので省く） */
  .mp-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
    overflow: visible;
  }
  .mp-tab { min-width: 0; padding: 9px 4px; font-size: 0.74rem; gap: 5px; }
  .mp-tab-icon { font-size: 0.84rem; }
  .mp-tab-count { display: none; }
  .mp-tab-name { overflow: hidden; text-overflow: ellipsis; }
  .mp-icon { width: 40px; height: 40px; }
  .mp-row { gap: 9px; padding: 9px 11px; }
  .mp-rank-list, .mp-rec-list, .mp-his-list { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 32px 0 30px; }
  .section { padding: 28px 0 22px; }
  .rank-feed { grid-template-columns: minmax(0, 1fr); }
  .legal-table th, .legal-table td { padding: 8px 9px; }
  /* 狭い画面では区切りの「|」を隠し、リンクをすき間つきで折り返す（行末に「|」だけ残らないように） */
  .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; line-height: 2.1; }
  .footer-links > span[aria-hidden] { display: none; }
  .genre-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 22px; }
  .genre-chip { min-height: 72px; padding: 10px 0 8px; gap: 5px; }
  .genre-chip-name { font-size: 0.66rem; letter-spacing: 0; white-space: nowrap; }
  .genre-icon { width: 26px; height: 26px; }
  .genre { scroll-margin-top: 68px; }
  .faq-item { padding: 15px 16px; }
  .faq-a { padding-left: 0; }
  .news-row { grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 12px 14px; }
  .news-text { grid-column: 1 / -1; font-size: 0.85rem; }
  .game-grid.is-icons { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 18px 10px; }
  .popular-item { flex-basis: 88px; width: 88px; }
  .popular-grid { gap: 12px; }
}

/* さらに狭い画面ではタブのアイコンも省いて、ラベルが切れないようにする */
@media (max-width: 400px) {
  .mp-tab-icon { display: none; }
  .mp-tab { font-size: 0.72rem; }
  .mp-row-date { font-size: 0.62rem; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-grid::before, .ticker-track, .glitch::before, .glitch::after,
  .btn-play, .btn-start, .caret, .sys-dot, .status-dot, .thumb-shine {
    animation: none !important;
  }
  .glitch::before, .glitch::after { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .game-card, .feature, .game-icon, .fav-item, .fav-icon,
  .mp-tab, .mp-row, .mp-clear, .news-row { transition: none; }
  a.news-row:hover { transform: none; }
  .fav-link:hover .fav-icon { transform: none; }
}

/* ==========================================================================
   フッター固定バナー広告（スマホ表示時のみ / js/ad-banner.js が挿入する）
   --ad-h    : 広告そのものの高さ。広告なしのときは 0px
   --ad-space: レイアウトが空けるべき高さ（広告 + セーフエリア）
   ========================================================================== */
:root {
  --ad-h: 0px;
  --ad-space: 0px;
}

/* フッターの言語の切り替え（/js/sg-i18n.js が差し込む） */
.footer-lang {
  margin: 14px 0 6px;
  text-align: center;
}
.footer-lang select {
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(128, 128, 128, 0.5);
  border-radius: 8px;
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 16px;
}

/* 全国ランキングの国旗（速報の名前の横）。ゲームのページでは同じ決まりが /css/sg-header.css にある */
.sgr-flag {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 15px;
  background: url(/img/flags.webp?ver=20261122-1) no-repeat 0 0 / 600px 135px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  vertical-align: -2px;
}

/* アラビア文字（ar・ur・fa）は字間を空けると文字がつながらなくなるので、字間の指定を消す */
html:lang(ar) *, html:lang(ur) *, html:lang(fa) * { letter-spacing: 0 !important; }
/* 等幅フォントのアラビア文字は 1 字ずつ離れて読みにくいので、ポータルのページでは本文と同じ書体にそろえる */
html:lang(ar) body *, html:lang(ur) body *, html:lang(fa) body * { font-family: system-ui, -apple-system, "Segoe UI", "Geeza Pro", "Noto Sans Arabic", Tahoma, sans-serif !important; }
