/* Runwith Games：森の夜の地に、木の板と、ちょうちんの色。角ばった影でドット絵のゲームに合わせる */
:root {
  --bg: #12261c;
  --bg-dot: #163024;
  --bg2: #1b3628;
  --plank: #7a5432;
  --plank-hi: #8d643d;
  --plank-lo: #5e3f24;
  --panel: #f4efe0;
  --panel2: #e9e1cb;
  --ink: #1f2a20;
  --ink-soft: #4b5647;
  --line: #0b1710;
  --text: #f2f5ea;
  --muted: #bcd0bb;
  --amber: #f2b23a;
  --amber-hi: #ffc95c;
  --red: #d24d3a;
  --leaf: #3f8a55;
  --link: #8a4b14;
  --link-dark: #ffd27a;
  --shadow: 5px 5px 0 var(--line);
  --radius: 4px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(45deg, var(--bg-dot) 25%, transparent 25%, transparent 75%, var(--bg-dot) 75%),
    linear-gradient(45deg, var(--bg-dot) 25%, transparent 25%, transparent 75%, var(--bg-dot) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--link-dark); text-underline-offset: 3px; }
a:hover { color: var(--amber-hi); }
:focus-visible { outline: 3px solid var(--amber-hi); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
main { flex: 1; }
.skip { position: absolute; left: -999px; top: 0; background: var(--amber); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ── 上の帯：木の板 ── */
.top {
  background:
    repeating-linear-gradient(0deg, transparent 0 19px, var(--plank-lo) 19px 21px),
    linear-gradient(var(--plank-hi), var(--plank));
  border-bottom: 4px solid var(--line);
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--panel); text-decoration: none; font-weight: 900; letter-spacing: .08em; font-size: 18px; text-shadow: 2px 2px 0 var(--line); white-space: nowrap; }
.logo img { width: 32px; height: 32px; border: 2px solid var(--line); }
.logo:hover { color: #fff; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--panel); text-decoration: none; font-weight: 700; font-size: 14px; padding: 6px 10px; border-radius: var(--radius); }
.nav a:hover { background: rgba(0,0,0,.2); color: #fff; }
.nav a[aria-current="page"] { background: rgba(0,0,0,.25); }
.nav .lang { border: 2px solid var(--line); background: var(--panel); color: var(--ink); box-shadow: 2px 2px 0 var(--line); }
.nav .lang:hover { background: #fff; color: var(--ink); }

/* ── 大見出し ── */
.hero { padding: 40px 0 16px; }
.hero h1 { font-size: clamp(28px, 6vw, 46px); line-height: 1.25; margin: 0 0 10px; font-weight: 900; letter-spacing: .02em; text-shadow: 3px 3px 0 var(--line); }
.hero p { margin: 0; color: var(--muted); font-size: 17px; max-width: 46em; }
.hero .accent { color: var(--amber-hi); }

.notice { background: var(--panel); color: var(--ink); border: 3px solid var(--line); box-shadow: var(--shadow); padding: 10px 14px; margin: 16px 0 0; border-radius: var(--radius); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notice a { color: var(--link); font-weight: 700; }
.notice button { margin-left: auto; font: inherit; background: none; border: 0; color: var(--ink-soft); cursor: pointer; padding: 4px 8px; }

/* ── ゲームの一覧 ── */
.cards { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 20px 0 8px; }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--panel); color: var(--ink); border: 3px solid var(--line); box-shadow: 7px 7px 0 var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img { position: relative; display: block; border-bottom: 3px solid var(--line); background: var(--line); aspect-ratio: 2 / 1; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--amber); color: var(--ink); font-weight: 900; font-size: 13px; padding: 2px 10px; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--line); letter-spacing: .04em; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h2, .card h3 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 900; }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; }
.card .sub { font-size: 14px; color: var(--ink-soft); font-weight: 700; margin: -4px 0 0; }
.card p { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.chip { font-size: 12px; font-weight: 700; padding: 1px 8px; border: 2px solid var(--line); background: var(--panel2); color: var(--ink); border-radius: 2px; }
.chip.ja { background: #fde3c4; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.actions .btn { flex: 1 1 auto; }

/* ── ボタン ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px; font: inherit; font-weight: 900; font-size: 16px; text-decoration: none; border: 3px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 var(--line); cursor: pointer; transition: transform .05s; text-align: center; line-height: 1.3; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn-main { background: var(--amber); color: var(--ink); }
.btn-main:hover { background: var(--amber-hi); color: var(--ink); }
.btn-sub { background: var(--panel); color: var(--ink); }
.btn-sub:hover { background: #fff; color: var(--ink); }
.btn-store { background: #111; color: #fff; }
.btn-store:hover { background: #2a2a2a; color: #fff; }
.btn-store small { display: block; font-size: 11px; font-weight: 700; opacity: .85; }
.btn-store .tri { width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 14px solid var(--amber); }
.btn .play-ico { width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 12px solid currentColor; }

/* ── 中身のページ（紙） ── */
.paper { overflow-wrap: anywhere; background: var(--panel); color: var(--ink); border: 3px solid var(--line); box-shadow: 7px 7px 0 var(--line); border-radius: var(--radius); padding: 22px 20px; margin: 18px 0 28px; }
@media (min-width: 760px) { .paper { padding: 30px 36px; } }
.paper a { color: var(--link); }
.paper a:hover { color: #5b2f07; }
.paper h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.3; margin: 0 0 12px; }
.paper h2 { font-size: 20px; line-height: 1.4; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 3px dashed #c9bd9c; }
.paper h2:first-child { margin-top: 0; }
.paper h3 { font-size: 17px; margin: 18px 0 6px; }
.paper p { margin: 0 0 12px; }
.paper ul, .paper ol { margin: 0 0 12px; padding-left: 1.4em; }
.paper li { margin: 4px 0; }
.small { font-size: 13px; color: var(--ink-soft); }
.facts { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 15px; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 2px solid #ddd3b8; }
.facts th { width: 8.5em; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
@media (max-width: 420px) { .facts th { width: auto; white-space: normal; } .facts th, .facts td { display: block; border: 0; padding: 2px 0; } .facts tr { display: block; padding: 8px 0; border-bottom: 2px solid #ddd3b8; } }
.mailbox { margin: 16px 0 20px; }
.mailbox .btn { font-size: 18px; word-break: break-all; }

/* ── ゲームの紹介 ── */
.crumbs { font-size: 13px; color: var(--muted); padding-top: 16px; }
.crumbs a { color: var(--muted); }
.game-hero { display: grid; gap: 0; grid-template-columns: 1fr; margin-top: 12px; }
@media (min-width: 860px) { .game-hero { grid-template-columns: 1.15fr 1fr; } .game-hero .card-img { border-bottom: 0; border-right: 3px solid var(--line); aspect-ratio: auto; } }
.game-hero .card-body { padding: 20px; gap: 10px; justify-content: center; }
.game-hero h1 { margin: 0; font-size: clamp(28px, 6vw, 40px); line-height: 1.2; font-weight: 900; }
.game-hero .lead1 { font-size: 17px; }
.howto { counter-reset: n; list-style: none; padding: 0 !important; }
.howto li { counter-increment: n; position: relative; padding: 4px 0 8px 44px !important; margin: 0 0 6px !important; }
.howto li::before { content: counter(n); position: absolute; left: 0; top: 4px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--leaf); color: #fff; font-weight: 900; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--line); }
.features { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 4px 0 8px; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
.feature { background: #fffaf0; border: 2px solid #cdbf9c; padding: 12px 14px; border-radius: var(--radius); }
.feature h3 { margin: 0 0 4px; font-size: 16px; }
.feature p { margin: 0; font-size: 15px; }
.gallery { display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 14px; margin: 0 -4px 6px; scroll-snap-type: x mandatory; }
.gallery figure { margin: 0; flex: 0 0 auto; width: 200px; scroll-snap-align: start; }
@media (min-width: 760px) { .gallery figure { width: 220px; } }
.gallery img { border: 3px solid var(--line); box-shadow: 4px 4px 0 var(--line); background: var(--line); aspect-ratio: 9 / 16; object-fit: cover; width: 100%; }
.gallery figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }
.note { background: #fde9cf; border: 2px solid #d9a35f; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
details { border: 2px solid #cdbf9c; background: #fffaf0; border-radius: var(--radius); margin: 0 0 8px; }
summary { cursor: pointer; padding: 10px 14px; font-weight: 700; list-style-position: inside; }
details > p { padding: 0 14px 10px; margin: 0; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px; }
.cta-row .btn { flex: 1 1 220px; }
.section-title { font-size: 22px; margin: 26px 0 0; text-shadow: 2px 2px 0 var(--line); }

/* ── 遊ぶページ ── */
body.play-page { background: #0b140f; }
.playbar { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 52px; background: linear-gradient(var(--plank-hi), var(--plank)); border-bottom: 3px solid var(--line); }
.playbar a.back { color: var(--panel); text-decoration: none; font-weight: 900; padding: 6px 8px; white-space: nowrap; }
.playbar .pname { color: var(--panel); font-weight: 900; text-shadow: 2px 2px 0 var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.playbar .btn { min-height: 36px; padding: 4px 10px; font-size: 14px; box-shadow: 0 3px 0 var(--line); }
@media (max-width: 420px) { .playbar .pname { display: none; } .playbar a.back { flex: 1; } }
.frame { width: 100%; height: calc(100vh - 52px); height: calc(100svh - 52px); background: #000; display: block; border: 0; }
.below { padding: 22px 0 8px; }

/* ── 下の帯 ── */
.foot { margin-top: 36px; background: #0b170f; border-top: 4px solid var(--line); color: var(--muted); font-size: 14px; }
.foot .wrap { padding-top: 22px; padding-bottom: 26px; display: grid; gap: 12px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--muted); display: inline-block; padding: 4px 0; }
.foot a:hover { color: #fff; }
.foot p { margin: 0; }
