/* minesweeperworlds.com 共通スタイル。設計: docs/design.md §3（Web フォントは読み込まない） */
:root {
  --navy: #16324f;
  --navy-2: #0f2438;
  --ink: #1d2733;
  --muted: #5b6776;
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #dde4ee;
  --accent: #2f9e5b;
  --accent-2: #25824a;
  --cell: #8fc3f0;
  --cell-open: #e9eef4;
  --radius: 12px;
  --header-h: 56px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", "Noto Sans KR", "Apple SD Gothic Neo", Meiryo, sans-serif;
  line-height: 1.65;
}
a { color: #1a5fb4; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.3; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---- ヘッダー ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; }
.site-header .bar { height: var(--header-h); display: flex; align-items: center; gap: 16px; padding: 0 16px; }
.nc-logo { color: #fff; text-decoration: none; font-size: 21px; letter-spacing: -0.5px; white-space: nowrap; padding-right: 14px; border-right: 1px solid rgba(255,255,255,.22); }
.nc-logo span { font-weight: 700; color: #ff6b5b; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap; min-width: 0; margin-right: auto; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.brand img { border-radius: 8px; flex: none; }
.nav-btn { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; }
.lang { position: relative; }
.lang-btn { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 180px; }
.lang-menu a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; border-radius: 6px; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--bg); }

/* ---- 本体の 2 カラム（サイドバー＋内容） ---- */
.layout { display: flex; align-items: flex-start; }
.content { flex: 1; min-width: 0; }
.sidebar { position: sticky; top: var(--header-h); width: 220px; flex: none; height: calc(100vh - var(--header-h)); overflow-y: auto; background: #fff; border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.side-nav a:hover { background: var(--bg); }
.side-nav a[aria-current="page"] { background: #e3f2e9; color: var(--accent-2); }
.side-apps { border-top: 1px solid var(--line); padding: 14px 8px 0; }
.side-apps p { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.side-apps .stores { flex-direction: column; align-items: flex-start; }
.side-small { font-size: 13px; color: var(--muted); padding: 0 8px; margin-top: auto; }
.sidebar-scrim { position: fixed; inset: var(--header-h) 0 0 0; background: rgba(10,20,30,.45); z-index: 40; }

/* ---- サブタイトル帯（トップの H1） ---- */
.tagline-band { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1440px; margin: 0 auto; padding: 12px 16px 0; }
.tagline-band h1 { margin: 0; font-size: clamp(17px, 1.6vw, 22px); line-height: 1.35; }

/* ---- ゲーム枠（トップ・PC） ---- */
.stage { display: flex; gap: 16px; max-width: 1440px; margin: 0 auto; padding: 12px 16px 0; }
.game-wrap {
  position: relative; flex: 1; min-width: 0;
  height: calc(100vh - var(--header-h) - 70px); min-height: 540px; max-height: 900px;
  background: radial-gradient(circle at 50% 40%, #2a5680, var(--navy-2));
  border-radius: var(--radius); overflow: hidden;
}
.game-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.game-poster { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; transition: opacity .3s; }
.game-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; filter: blur(2px); }
.poster-ui { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; }
.game-wrap.ready .game-poster { opacity: 0; pointer-events: none; }
.loading { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fs-btn { position: absolute; right: 12px; bottom: 12px; z-index: 3; background: rgba(15,36,56,.75); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.game-wrap:fullscreen { border-radius: 0; max-height: none; height: 100vh; }
.ad.rail { width: 300px; flex: none; display: none; }
@media (min-width: 1400px) { .ad.rail { display: block; } }

/* ---- ボタン・ストア ---- */
.btn { display: inline-block; text-decoration: none; font-weight: 700; border-radius: 999px; padding: 12px 26px; border: 0; cursor: pointer; font-size: 17px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-2); }
.btn-primary:hover { background: var(--accent-2); }
.btn-small { padding: 7px 14px; font-size: 14px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.stores img { display: block; width: 135px; height: 40px; }
html.os-ios .google-play, html.os-android .app-store { display: none !important; }

/* ---- 本文 ---- */
.intro { text-align: center; padding-top: 28px; }
.intro h1 { font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 10px; }
.lead { font-size: 18px; color: var(--muted); max-width: 760px; margin: 0 auto 12px; }
.intro .stores { justify-content: center; }
.mobile-play { display: none; margin: 18px 0 6px; }
.mobile-play .hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
section h2 { font-size: 26px; margin: 44px 0 16px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; }
.feature { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-items: center; }
.feature img { width: 110px; border-radius: 10px; flex: none; }
.feature h3 { margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); }
.rules ol { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 40px; font-size: 17px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 6px; color: #1a5fb4; }
.card p { margin: 0; color: var(--muted); }
.apps { text-align: center; padding-bottom: 20px; }
.apps .stores { justify-content: center; }

/* ---- 記事 ---- */
.article { max-width: 780px; padding-top: 20px; padding-bottom: 20px; }
.article h1 { font-size: clamp(26px, 3.2vw, 36px); margin: 8px 0 10px; }
.article .lead { margin: 0 0 18px; text-align: left; }
.article h2 { font-size: 23px; margin: 36px 0 10px; }
.article h3 { font-size: 18px; margin: 20px 0 6px; }
.crumbs { font-size: 14px; color: var(--muted); }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.toc ol { margin: 6px 0 0; padding-left: 22px; }
.updated { color: var(--muted); font-size: 14px; }
.qa { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; margin: 12px 0; }
.qa summary { cursor: pointer; list-style: none; }
.qa summary h2 { font-size: 18px; margin: 10px 0; display: inline; }
.qa p { margin: 8px 0 12px; }
.cta-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; text-align: center; margin: 40px 0 10px; }
.cta-card h2 { margin: 0 0 6px; color: #fff; }
.cta-card .cta-apps { color: #c9d6e6; font-size: 14px; margin: 18px 0 0; }
.cta-card .stores { justify-content: center; }
.ad.inline { margin: 28px 0; min-height: 100px; }
.notfound { text-align: center; }

/* ---- 盤面図 ---- */
.board-fig { margin: 16px 0; display: flex; flex-direction: column; align-items: center; }
.board { display: grid; grid-template-columns: repeat(var(--cols), 40px); gap: 3px; }
.c { width: 40px; height: 40px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
.c-none { background: transparent; }
.c-hidden { background: var(--cell); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.c-open { background: var(--cell-open); }
.c-flag { color: #d23b2f; }
.c-mine { background: #f3b1ab; color: #9b1c12; }
.c-safe { background: #b9e6c5; color: #1f7a3f; }
.n1 { color: #1f5fd1; } .n2 { color: #23893e; } .n3 { color: #d23b2f; } .n4 { color: #3b2a9c; }
.n5 { color: #8a2b12; } .n6 { color: #0d8a8a; } .n7 { color: #222; } .n8 { color: #666; }
.board-fig figcaption { margin-top: 8px; color: var(--muted); font-size: 15px; text-align: center; max-width: 520px; }

/* ---- フッター ---- */
.site-footer { background: var(--navy-2); color: #c9d6e6; margin-top: 48px; padding: 32px 0 24px; }
.site-footer a { color: #e5edf7; }
.site-footer .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; align-content: start; }
.copy { grid-column: 1 / -1; font-size: 13px; margin: 0; }

/* ---- スマホの「アプリで遊ぶ」帯 ---- */
.sticky-app { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.sticky-app[hidden] { display: none; }
.sticky-app img { border-radius: 9px; }
.sticky-app span { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.3; }
.sticky-app .btn { box-shadow: none; background: var(--accent); color: #fff; }
.sticky-close { background: none; border: 0; font-size: 22px; color: var(--muted); padding: 4px 6px; cursor: pointer; }
html.has-sticky body { padding-bottom: 76px; }

/* ---- 幅の狭い画面・タッチ端末 ---- */
@media (max-width: 899px), (pointer: coarse) {
  .stage { display: none; }
  .mobile-play { display: block; }
  .intro { padding-top: 10px; }
  .tagline-band { justify-content: center; text-align: center; padding-top: 18px; }
  .tagline-band h1 { font-size: 22px; }
}
/* 幅が足りない画面ではサイドバーを引き出し式に（メニューボタンで開閉） */
@media (max-width: 1099px) {
  .nav-btn { display: block; }
  .sidebar { position: fixed; left: 0; top: var(--header-h); z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 16px rgba(0,0,0,.15); }
  .sidebar.open { transform: none; }
}
@media (max-width: 760px) {
  .nc-logo { font-size: 18px; padding-right: 10px; }
  .brand span { font-size: 16px; }
  .features { grid-template-columns: 1fr; }
  .feature img { width: 86px; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .lead { font-size: 16px; }
  .c { width: 34px; height: 34px; font-size: 17px; }
  .board { grid-template-columns: repeat(var(--cols), 34px); }
}
@media (max-width: 560px) {
  .site-header .bar { gap: 8px; padding: 0 10px; }
  .brand img { width: 28px; height: 28px; }
  .brand span { font-size: 14px; }
  .lang-btn span { display: none; }
}
