/* ===== 色・共通 ===== */
:root {
  --ink: #141414;
  --paper: #fffaf0;
  --cream: #fff3c9;
  --yellow: #ffd23f;
  --leaf: #7ed957;
  --green: #12b04c;
  --blue: #1a5fe6;
  --red: #ec1f1f;
  --muted: #5b5647;
  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-s: 4px 4px 0 var(--ink);
  --radius: 18px;
  --font-display: "Dela Gothic One", "M PLUS Rounded 1c", system-ui, sans-serif;
  --font-body: "M PLUS Rounded 1c", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--paper);
  /* パイナップルの皮っぽい斜め格子 */
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 210, 63, .18) 0 2px, transparent 2px 28px),
    repeating-linear-gradient(-45deg, rgba(255, 210, 63, .18) 0 2px, transparent 2px 28px);
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.card, .ring-card { text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ===== ヘッダー ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: var(--yellow);
  border-bottom: var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-brand img { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); padding: 2px; }
.nav-brand span { font-family: var(--font-display); font-size: 22px; line-height: 1; display: flex; flex-direction: column; }
.nav-brand small { font-family: var(--font-body); font-weight: 800; font-size: 10px; letter-spacing: .5em; margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: clamp(8px, 2vw, 22px); }
.nav-links a { font-weight: 800; text-decoration: none; letter-spacing: .08em; font-size: 14px; }
.nav-links a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.nav-x {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: #fff;
}
.nav-x:hover { background: var(--blue); }

/* ===== ヒーロー ===== */
.hero {
  position: relative;
  max-width: 1080px;
  margin: 36px auto 0;
  padding: 0 16px;
  text-align: center;
}
.hero-logo {
  margin: 0 auto;
  max-width: 760px;
  background: #fff;
  border: var(--line);
  border-radius: 28px;
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
  animation: pop-in .7s cubic-bezier(.2, 1.6, .4, 1) both;
}
.hero-logo img { width: 100%; height: auto; margin: -6% 0; } /* 画像の上下余白を少し詰める */
.hero-lead { font-size: clamp(15px, 2.4vw, 19px); font-weight: 800; margin: 28px 0 12px; }
.hero-meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.counter {
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: .12em;
  background: var(--ink); color: var(--yellow);
  padding: 4px 14px; border-radius: 999px;
}
.counter b { font-weight: 400; color: #fff; }
.press-start {
  display: inline-block;
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 24px);
  letter-spacing: .1em;
  text-decoration: none;
  background: var(--red); color: #fff;
  padding: 12px 34px;
  border: var(--line); border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
  animation: blink 1.4s steps(2, jump-none) infinite;
}
.press-start:hover { animation: none; transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.press-start:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }

/* コントローラーのボタン風の飾り */
.hero-deco { position: absolute; inset: 0; pointer-events: none; }
.btn-dot {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  border: var(--line);
  animation: float 5s ease-in-out infinite;
}
.b-blue { background: var(--blue); left: 2%; top: 12%; }
.b-red { background: var(--red); right: 3%; top: 4%; animation-delay: -1.2s; width: 34px; height: 34px; }
.b-green { background: var(--green); right: 6%; bottom: 8%; animation-delay: -2.4s; }
.b-black { background: var(--ink); left: 7%; bottom: 2%; animation-delay: -3.6s; width: 30px; height: 30px; }

/* ===== セクション見出し ===== */
section { scroll-margin-top: 80px; }
.showcase, .games, .about { max-width: 1180px; margin: 0 auto; padding: 72px 16px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 {
  margin: 0;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(26px, 5vw, 40px);
  letter-spacing: .04em; line-height: 1.2;
  display: flex; align-items: center; gap: 12px;
}
.num {
  font-size: 14px; letter-spacing: .05em;
  background: var(--leaf); border: var(--line); border-radius: 10px;
  padding: 2px 8px;
}
.hint { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); }

/* ===== 回転ショーケース ===== */
.ring-stage {
  --card-w: clamp(200px, 30vw, 300px);
  position: relative;
  height: calc(var(--card-w) * 0.95);
  perspective: 1400px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.ring-stage.dragging { cursor: grabbing; }
.showcase { overflow-x: clip; }
.ring {
  position: absolute; left: 50%; top: 50%;
  width: var(--card-w); height: calc(var(--card-w) * 0.8);
  margin-left: calc(var(--card-w) / -2);
  margin-top: calc(var(--card-w) * -0.4);
  transform-style: preserve-3d;
}
.ring-card {
  position: absolute; inset: 0;
  background: #fff;
  border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  backface-visibility: hidden;
  display: flex; flex-direction: column;
  transition: filter .3s;
}
.ring-card .thumb { flex: 1; min-height: 0; }
.ring-card p {
  margin: 0; padding: 8px 12px;
  font-weight: 800; font-size: 15px;
  border-top: var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ring-card.is-back { filter: saturate(.6) brightness(.85); }
.ring-ctrl { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.ring-title { margin: 0; min-width: 12em; text-align: center; font-family: var(--font-display); font-size: clamp(16px, 3vw, 22px); }
.round-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: var(--line); background: var(--yellow);
  box-shadow: var(--shadow-s); cursor: pointer;
  font-size: 14px;
  transition: transform .1s, box-shadow .1s;
}
.round-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

/* ===== サムネ（画像 or 自動ダミー） ===== */
.thumb { position: relative; background: var(--c, var(--yellow)); overflow: hidden; }
.thumb img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.thumb-fake {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 12px;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,.35) 0 14%, transparent 15%),
    radial-gradient(circle at 85% 80%, rgba(0,0,0,.14) 0 18%, transparent 19%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 12px, transparent 12px 24px),
    var(--c, var(--yellow));
}
.thumb-fake span {
  font-family: var(--font-display);
  font-size: clamp(18px, 3.4vw, 30px);
  line-height: 1.15; text-align: center;
  color: #fff;
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  word-break: keep-all; overflow-wrap: anywhere;
}

/* ===== 絞り込み ===== */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: var(--line); border-radius: 999px;
  background: #fff;
  padding: 4px 14px;
  font-weight: 800; font-size: 14px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .1s, box-shadow .1s, background .15s;
}
.chip:hover { background: var(--cream); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chip small { opacity: .6; margin-left: 4px; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-right input, .toolbar-right select {
  border: var(--line); border-radius: 12px;
  background: #fff;
  padding: 6px 12px;
  font-weight: 700; font-size: 14px;
  min-width: 0;
}
.toolbar-right input { width: 200px; max-width: 100%; }
.result-count { margin: 16px 0 12px; font-size: 13px; font-weight: 800; color: var(--muted); }

/* ===== カード一覧 ===== */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
}
.card {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  background: #fff;
  border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0; width: 100%;
  transition: transform .15s, box-shadow .15s;
  animation: pop-in .45s cubic-bezier(.2, 1.4, .4, 1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.card:hover { transform: translate(-3px, -3px) rotate(-.4deg); box-shadow: 9px 9px 0 var(--ink); }
.card:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.card .thumb { aspect-ratio: 1200 / 630; border-bottom: var(--line); }
.card .thumb img { transition: transform .4s; }
.card:hover .thumb img { transform: scale(1.05); }
.badge {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  font-family: var(--font-display); font-size: 12px; letter-spacing: .05em;
  padding: 2px 10px; border: var(--line); border-radius: 999px;
  transform: rotate(4deg);
}
.badge.new { background: var(--red); color: #fff; }
.badge.soon { background: #fff; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.3; }
.card-sub { margin: -4px 0 0; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--muted); }
.card-catch { margin: 0; font-size: 14px; flex: 1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--muted); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.tags li {
  font-size: 11px; font-weight: 800;
  background: var(--cream); border: 2px solid var(--ink); border-radius: 6px;
  padding: 0 7px;
}
.empty { text-align: center; font-weight: 800; padding: 40px 0; }

/* ===== About ===== */
.about-card {
  display: flex; gap: 28px; align-items: center;
  background: var(--leaf);
  border: var(--line); border-radius: 26px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 40px);
}
.about-icon { flex: none; width: 120px; height: 120px; border-radius: 28px; background: var(--ink); padding: 6px; border: var(--line); transform: rotate(-6deg); }
.about-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.about-card p { margin: 0 0 10px; }
.chip-link {
  display: inline-block; text-decoration: none; font-weight: 800;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 18px;
}
.chip-link:hover { background: var(--blue); }

/* ===== フッター ===== */
.footer {
  margin-top: 90px;
  padding: 36px 16px 44px;
  background: var(--ink); color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-weight: 800; font-size: 13px; letter-spacing: .06em;
}
.footer p { margin: 0; }
.footer a { color: #fff; text-underline-offset: 4px; }

/* ===== モーダル ===== */
.modal {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: var(--line); border-radius: 24px;
  box-shadow: 10px 10px 0 var(--ink);
  background: #fff; color: var(--ink);
  overflow: auto;
}
.modal[open] { animation: pop-in .35s cubic-bezier(.2, 1.4, .4, 1); }
.modal::backdrop { background: rgba(20, 20, 20, .55); backdrop-filter: blur(3px); }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%;
  border: var(--line); background: var(--yellow);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.modal-thumb { aspect-ratio: 16 / 9; border-bottom: var(--line); }
.modal-thumb .thumb { height: 100%; }
.modal-body { padding: 20px clamp(16px, 4vw, 32px) 28px; }
.modal-sub { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.modal-body h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 5vw, 34px); line-height: 1.25; }
.modal-desc { white-space: pre-line; margin: 14px 0; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 20px; font-size: 14px; }
.spec dt { font-weight: 800; }
.spec dd { margin: 0; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.play-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 20px; letter-spacing: .08em;
  text-decoration: none;
  background: var(--red); color: #fff;
  padding: 10px 30px;
  border: var(--line); border-radius: 999px;
  box-shadow: var(--shadow-s);
  transition: transform .1s, box-shadow .1s;
}
.play-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.play-btn.disabled { background: #ddd; color: var(--muted); box-shadow: none; pointer-events: none; }
.share-btn {
  border: var(--line); border-radius: 999px; background: #fff;
  padding: 10px 18px; font-weight: 800; cursor: pointer;
}
.modal-actions a.share-btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ===== アニメーション ===== */
@keyframes pop-in { from { opacity: 0; transform: scale(.85) translateY(10px); } }
@keyframes float { 50% { transform: translateY(-14px) rotate(8deg); } }
@keyframes blink { 50% { opacity: .55; } }

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

/* ===== スマホ ===== */
@media (max-width: 640px) {
  .nav-brand span { font-size: 18px; }
  .nav-links a:not(.nav-x) { font-size: 12px; }
  .btn-dot { width: 28px; height: 28px; }
  .b-red, .b-black { width: 22px; height: 22px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 32px); margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
  .chip { flex: none; }
  .toolbar-right { width: 100%; }
  .toolbar-right input { flex: 1; width: auto; }
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .about-card { flex-direction: column; text-align: center; }
  .about-icon { width: 96px; height: 96px; }
  .hero-logo { box-shadow: 6px 6px 0 var(--ink); }
}
