/* kunitoku.com 全ページ共通のスタイル */

/* 配色は「ゲーム機のホーム画面」。明るい面に、選択の青と差し色のオレンジを置く */
:root {
  --bg: #eef1f7;
  --card: #ffffff;
  --ink: #1b2030;
  /* 背景の上でも文字のコントラスト比4.5以上になる濃さ */
  --sub: #626a80;
  --line: #dde2ec;
  /* 選んでいるものの枠の色 */
  --sel: #2f6bff;
  /* リンクの文字の色。白の上で4.5以上 */
  --acc: #2459e0;
  --acc-soft: #e6edff;
  --hot: #ff6a3d;
  --soon: #b8441c;
  --soon-soft: #ffeee7;
  --shadow: 0 1px 2px rgba(20, 30, 60, .07), 0 4px 14px rgba(20, 30, 60, .05);
  --radius: 18px;
  --font-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  --font-en: "Nunito", "Zen Maru Gothic", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141821;
    --card: #1f2533;
    --ink: #e8ecf4;
    --sub: #9aa3b8;
    --line: #2e3647;
    --sel: #5b8cff;
    --acc: #8aaaff;
    --acc-soft: #22305a;
    --hot: #ff7a50;
    --soon: #ff9a73;
    --soon-soft: #3a2620;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.75 "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: var(--acc);
}

a:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
  /* 日本語の見出しは<wbr>の所でだけ折り返す。auto-phraseに対応するブラウザは文節で折り返す */
  word-break: keep-all;
  word-break: auto-phrase;
  /* それでも幅に収まらない時は、どこででも折り返してはみ出しを防ぐ */
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

/* ヘッダー */

.wrap.wide {
  max-width: 1040px;
}

.bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 14px;
}

.logo {
  color: var(--ink);
  font-family: var(--font-en);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logo i {
  color: var(--hot);
  font-style: normal;
}

/* メニューは丸いボタンを並べる */
.bar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.bar nav a {
  color: var(--ink);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 13px;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.bar nav a:hover {
  color: var(--acc);
}

/* 白い文字が読める濃さの青に、暗い配色でも固定する */
.bar nav a[aria-current="page"] {
  color: #fff;
  background: #2f6bff;
}

main {
  padding-block: 8px 40px;
}

/* トップの見出し */

.hero {
  padding-block: 20px 0;
}

.hero h1 {
  font-size: clamp(18px, 3.4vw, 24px);
  margin: 0 0 6px;
}

.hero p {
  margin: 0;
  color: var(--sub);
  font-size: 14px;
}

.section-title {
  font-size: 18px;
  margin: 36px 0 14px;
}

/* ゲームのカード */

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* 未リリースのゲームは、一覧の最後に横長で置く */
.card.upcoming {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.card .catch {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.card .thumbs img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1284 / 2778;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.card-link {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.card-link img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.card-link h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.card-link:hover h3 {
  color: var(--acc);
}

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  padding: 1px 10px;
  border-radius: 99px;
  background: var(--acc-soft);
  color: var(--acc);
}

.tag.soon {
  background: var(--soon-soft);
  color: var(--soon);
}

/* ストアのバッジ */

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.stores a {
  display: block;
  line-height: 0;
}

.stores .apple {
  height: 44px;
  width: auto;
}

/* Google Playのバッジは、画像の上下(英語版は四方)に透明な余白があるので、枠で切り取って高さをApp Storeに揃える */
.stores .google-link {
  overflow: hidden;
  height: 44px;
  width: 148px;
}

.stores .google {
  width: 148px;
  height: auto;
  max-width: none;
  margin: -6.64px 0 0;
}

.stores .google-link:lang(en) {
  width: 147.7px;
}

.stores .google-link:lang(en) .google {
  width: 169.2px;
  margin: -10.74px;
}

.coming {
  margin: 0;
  color: var(--soon);
  font-weight: 600;
  white-space: nowrap;
}

/* トップ: 選んでいるゲームの大きな枠。
   JSが動かない時は、全部の枠を縦に並べる。home.jsが<html>にjsを付けると、枠を重ねて1つだけ見せる */

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.slides {
  display: grid;
  gap: 16px;
  margin-top: 4px;
}

.slide {
  position: relative;
  display: grid;
  min-height: 380px;
  border-radius: 24px;
  overflow: hidden;
  background: #1b2030;
  color: #fff;
  isolation: isolate;
}

/* 画面写真を大きくぼかして背景にする。小さい画像で足りる */
.slide-bg {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  max-width: none;
  height: calc(100% + 80px);
  object-fit: cover;
  filter: blur(28px) saturate(1.3);
  opacity: .85;
  z-index: -2;
}

.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(14, 18, 30, .85) 0%, rgba(14, 18, 30, .58) 52%, rgba(14, 18, 30, .12) 100%);
}

.slide-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding: 32px;
  align-items: center;
}

.slide-info {
  display: grid;
  gap: 14px;
  justify-items: start;
  min-width: 0;
}

.slide-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slide-top img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

.genre {
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, .18);
  padding: 3px 11px;
  border-radius: 999px;
}

.slide h2 {
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.25;
  margin: 4px 0 0;
}

.slide h2 a {
  color: inherit;
  text-decoration: none;
}

.slide h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.slide p {
  margin: 0;
  line-height: 1.8;
  max-width: 30em;
  opacity: .92;
}

.slide a:focus-visible {
  outline-color: #fff;
}

.slide .detail {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  opacity: .9;
}

.soon-badge {
  font-family: var(--font-en);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .04em;
  /* オレンジの上の白い文字はコントラストが足りないので、濃い文字にする */
  color: #1b2030;
  background: var(--hot);
  border-radius: 999px;
  padding: 8px 18px;
}

.slide-shots {
  display: flex;
  gap: 12px;
}

.slide-shots img {
  display: block;
  width: 128px;
  height: auto;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  border-radius: 16px;
  border: 3px solid rgba(255, 255, 255, .9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.slide-shots img:nth-child(2) {
  transform: translateY(-14px);
}

/* 画面写真の無いゲームは、アイコンを大きく置く */
.slide-shots.icon-only img {
  width: 200px;
  aspect-ratio: 1;
  border-radius: 44px;
  transform: none;
}

.js .slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility 0s .3s;
}

.js .slide.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s;
}

/* アイコンの列。JSが動く時だけ見せる */
.picker {
  display: flex;
  gap: 18px;
  padding: 22px 12px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.picker[hidden] {
  display: none;
}

.picker button {
  flex: none;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  width: 96px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sub);
  font: inherit;
  cursor: pointer;
}

.picker img {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  box-shadow: 0 2px 6px rgba(20, 30, 60, .15);
  transition: transform .18s, box-shadow .18s;
}

.picker span {
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  min-height: 2.7em;
  /* 見出しと同じく、<wbr>か文節の所で折り返す */
  word-break: keep-all;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}

.picker button:hover img {
  transform: scale(1.06);
}

.picker button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 700;
}

.picker button[aria-pressed="true"] img {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--sel), 0 8px 18px rgba(47, 107, 255, .35);
}

.picker button:focus-visible {
  outline: none;
}

.picker button:focus-visible img {
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--sel);
}

/* お知らせのタイル */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tiles a {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s;
}

.tiles a:hover {
  transform: translateY(-3px);
}

.tiles time {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 13px;
  color: var(--acc);
  font-variant-numeric: tabular-nums;
}

.tiles span {
  font-size: 14px;
  line-height: 1.6;
}

/* プロフィール */

.profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 22px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sel), var(--hot));
  color: #fff;
  font-family: var(--font-en);
  font-weight: 900;
  font-size: 26px;
}

.profile p {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.profile h3 {
  font-size: 15px;
  margin: 18px 0 6px;
}

/* 詳細ページ */

.game-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px 18px;
  align-items: center;
  padding-block: 28px 16px;
}

.game-head > img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  border: 1px solid var(--line);
  grid-row: span 2;
}

.game-head > .stores {
  grid-column: 2;
}

.game-head h1 {
  font-size: clamp(21px, 4.6vw, 28px);
  margin: 0;
}

.game-head .en {
  margin: 0;
  color: var(--sub);
  font-size: 14px;
}

.game-head .tag {
  margin: 6px 0 10px;
}

.shots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}

.shots img {
  flex: 0 0 auto;
  width: 180px;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  scroll-snap-align: start;
}

/* 紹介動画は縦長なので、縦長の枠で画面写真のすぐ下に置く */
.video {
  position: relative;
  aspect-ratio: 9 / 16;
  width: min(300px, 100%);
  margin: 16px auto 0;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 14px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 4px 20px 18px;
  margin-top: 16px;
}

.panel h2 {
  font-size: 18px;
  margin: 18px 0 8px;
}

.panel p {
  margin: 0 0 8px;
  max-width: 40em;
  overflow-wrap: anywhere;
}

/* 説明文の中の見出し(元の文の「■」) */
.panel h3 {
  font-size: 15px;
  margin: 18px 0 6px;
}

/* 長い説明は「続きを読む」で畳む */
.more summary {
  display: inline-block;
  padding: 10px 0;
  color: var(--acc);
  font-weight: 600;
  cursor: pointer;
}

.more[open] summary {
  display: none;
}

.media {
  list-style: none;
  margin: 0;
  padding: 0;
}

.media li {
  border-top: 1px solid var(--line);
}

/* 記事1件を1つのリンクにして、行全体を押せるようにする */
.media a {
  display: block;
  padding-block: 10px;
  color: inherit;
  text-decoration: none;
}

.media h3 {
  font-size: 15px;
  margin: 0;
  color: var(--acc);
}

.media a:hover h3 {
  text-decoration: underline;
}

.media p {
  margin: 0;
  color: var(--sub);
  font-size: 14px;
}

/* ほかのゲーム */

.others {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 4px 12px;
}

.others a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding-block: 6px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}

.others a:hover {
  color: var(--acc);
}

.others img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.sns {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.sns a {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* プライバシーポリシー */

.doc h1 {
  font-size: 24px;
  margin: 28px 0 8px;
}

.doc h2 {
  font-size: 17px;
  margin: 26px 0 6px;
}

/* フッター */

footer {
  color: var(--sub);
  font-size: 12px;
  text-align: center;
  padding-block: 12px max(24px, env(safe-area-inset-bottom));
}

@media (max-width: 760px) {
  .slide-in {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 22px 22px 26px;
  }

  .slide::before {
    background: linear-gradient(180deg, rgba(14, 18, 30, .85) 0%, rgba(14, 18, 30, .6) 55%, rgba(14, 18, 30, .3) 100%);
  }

  .slide-shots {
    padding-top: 14px;
  }

  .slide-shots img {
    width: calc((100% - 24px) / 3);
    max-width: 128px;
  }

  .slide-shots.icon-only img {
    width: 150px;
    max-width: none;
    border-radius: 34px;
  }

  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  /* メニューを1段に収める */
  .bar nav {
    gap: 6px;
    font-size: 12px;
  }

  .bar nav a {
    padding: 5px 10px;
  }

  .slide h2 {
    font-size: 24px;
  }

  /* 狭い幅では改行の位置がずれて行が細切れになるので、改行をやめて流す */
  .profile p br {
    display: none;
  }

  .picker {
    gap: 12px;
    /* 列を画面の端まで流して、横に送れることが分かるようにする */
    margin-inline: calc(-1 * max(18px, env(safe-area-inset-left)));
    padding-inline: 18px;
  }

  .picker button {
    width: 84px;
  }

  .picker img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .profile {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 18px 16px;
  }

  .avatar {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .hero p {
    display: none;
  }

  .game-head {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  .game-head > img {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    grid-row: auto;
  }

  /* スマホでは入手ボタンを全幅に出し、1段に並べる */
  .game-head > .stores {
    grid-column: 1 / -1;
  }

  .shots img {
    width: 150px;
  }

  .panel {
    padding-inline: 16px;
  }
}

/* 動きを減らす設定の時は、切り替えと持ち上げの動きを止める */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }

  .tiles a:hover,
  .picker button:hover img {
    transform: none;
  }
}
