/* issue #178: じゃんけん王国のホームページ。ゲームの色（クリーム・ティール・茶・金）に合わせる。外部のフォント・スクリプトは使わない（読み込みの速さと、利用者の情報の保護のため）。 */
:root {
  --cream: #faf2df;
  --cream-2: #f3e6c6;
  --card: #fffaeb;
  --teal: #6faaa3;
  --teal-dark: #4d8a83;
  --teal-light: #b9d9d3;
  --brown: #a98868;
  --brown-dark: #7a5f47;
  --text: #4b372b;
  --muted: #8a7462;
  --gold: #d9a93a;
  --gold-dark: #6b4a16;
  --red: #d2454e;
  --red-dark: #b3303a;
  --radius: 16px;
  --shadow: 0 6px 18px rgba(75, 55, 43, .16);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-title: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); line-height: 1.8; font-size: 16px;
  background: linear-gradient(180deg, #f6ebd2 0%, #ecdcb9 100%) fixed; min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--teal-dark); }
a:hover { color: var(--brown-dark); }
.container { width: min(1080px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5em 1em; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.todo { background: #fff3b8; color: #7a5a00; border-radius: 4px; padding: 0 .35em; font-size: .92em; }

/* ---- ヘッダー */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 242, 223, .96); backdrop-filter: blur(6px); border-bottom: 3px solid var(--teal); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.header-row { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--brown-dark); font-family: var(--font-title); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.brand img { border-radius: 8px; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; flex-wrap: nowrap; gap: 2px 2px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .3em .55em; border-radius: 999px; text-decoration: none; color: var(--text); font-size: .86rem; font-weight: 700; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--teal-light); }
.langs { display: flex; gap: 2px; margin-left: 6px; }
.langs a { padding: .2em .6em; border: 2px solid var(--teal); border-radius: 999px; text-decoration: none; font-size: .8rem; font-weight: 800; color: var(--teal-dark); }
.langs a.on { background: var(--teal); color: #fff; }
.navtoggle, .navbutton { display: none; }

/* ---- ボタン */
.btn { display: inline-block; padding: .65em 1.4em; border-radius: 999px; text-decoration: none; font-weight: 800; color: #fff !important; background: linear-gradient(180deg, #e0586a, var(--red-dark)); box-shadow: 0 3px 0 #8f232d, var(--shadow); border: 2px solid #f3c9a3; }
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: linear-gradient(180deg, #fffaeb, var(--cream-2)); color: var(--brown-dark) !important; border-color: var(--teal); box-shadow: 0 3px 0 var(--teal-dark), var(--shadow); }
.btn-big { font-size: 1.15rem; padding: .8em 1.8em; }
.btn-disabled { opacity: .78; cursor: default; filter: grayscale(.25); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- ヒーロー */
.hero { position: relative; color: #fff; text-align: center; overflow: hidden; background: #335 center / cover no-repeat url("hero-bg.webp"); }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,30,50,.12) 0%, rgba(20,30,50,.05) 45%, rgba(250,242,223,1) 100%); }
.hero .container { position: relative; padding: 36px 0 0; }
.hero-logo { width: min(520px, 82%); filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }
.hero h1 { margin: 0; }
.hero-tagline { display: inline-block; font-size: clamp(1rem, 2.4vw, 1.3rem); font-weight: 800; text-shadow: 0 2px 4px rgba(0,0,0,.7); margin: 10px auto 18px; max-width: 760px; background: rgba(60,40,20,.62); border-radius: 14px; padding: .35em 1em; }
.hero-chars { display: flex; justify-content: center; align-items: flex-end; gap: 0; margin-top: 18px; }
.hero .container { padding-bottom: 0; }
.hero-chars { --h: clamp(150px, 27vw, 300px); }
.hero-chars img { width: auto; max-width: 30%; height: var(--h); margin: 0 1%; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.hero-chars img:nth-child(1) { height: var(--h); }
.hero-chars img:nth-child(2) { height: calc(var(--h) * 1.0); }
.hero-chars img:nth-child(3) { height: var(--h); }
.hero .btn-row { justify-content: center; }

/* ---- 見出し・節 */
.section { padding: 44px 0; }
.section.alt { background: rgba(255,250,235,.62); border-block: 1px solid rgba(169,136,104,.25); }
h2.section-title, .page-title { font-family: var(--font-title); font-weight: 900; color: #fff3c2; text-align: center; margin: 0 0 8px; font-size: clamp(1.6rem, 4.4vw, 2.3rem); letter-spacing: .02em;
  -webkit-text-stroke: 5px var(--gold-dark); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(107,74,22,.55); }
.page-title { margin-top: 28px; }
.section-lead { text-align: center; color: var(--muted); margin: 0 auto 28px; max-width: 760px; font-weight: 700; }
h3 { font-family: var(--font-title); color: var(--brown-dark); margin: 1.8em 0 .4em; font-size: 1.3rem; border-left: 6px solid var(--teal); padding-left: .55em; }
h4 { color: var(--brown-dark); margin: 1.4em 0 .3em; }
.prose { background: var(--card); border: 2px solid var(--teal-light); border-radius: var(--radius); padding: 22px clamp(16px, 4vw, 36px) 28px; box-shadow: var(--shadow); margin: 18px 0 40px; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.note { background: #eef7f5; border-left: 6px solid var(--teal); border-radius: 8px; padding: .8em 1em; margin: 1em 0; }
.note.warn { background: #fff3e0; border-color: var(--gold); }
.updated { color: var(--muted); font-size: .9rem; text-align: right; }

/* ---- カード */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.card { background: var(--card); border: 2px solid var(--teal-light); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin: .2em 0 .3em; border: 0; padding: 0; font-size: 1.15rem; }
.card p { margin: .3em 0; font-size: .95rem; }
.card img.mode { width: 100%; border-radius: 12px; margin-bottom: 8px; }
.chara-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.chara { background: var(--card); border: 2px solid var(--teal-light); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow); }
.chara img { max-height: 240px; width: auto; }
.chara h3 { border: 0; padding: 0; margin: .4em 0 .1em; font-size: 1.15rem; }
.chara .role { color: var(--muted); font-size: .85rem; font-weight: 700; }
.chara .skill { background: #fdf3d0; border-radius: 10px; padding: .4em .7em; margin-top: .6em; font-size: .88rem; text-align: left; }
.chara.boss { background: #2d2230; color: #f5e9d6; border-color: #6b4a76; }
.chara.boss h3, .chara.boss .role { color: #f0c57a; }
.chara.boss .skill { background: #46304f; }

/* ---- スクリーンショット・動画 */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
figure.shot { margin: 0; background: #2a1d14; padding: 8px; border-radius: 18px; box-shadow: var(--shadow); }
figure.shot img { display: block; width: 100%; border-radius: 10px; }
figure.shot figcaption { color: #f5e9d6; font-size: .85rem; padding: 6px 4px 2px; text-align: center; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #2a1d14 center / cover no-repeat url("hero-bg.webp"); box-shadow: var(--shadow); border: 4px solid var(--gold); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .soon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; text-shadow: 0 2px 6px rgba(0,0,0,.8); background: rgba(30,20,10,.45); text-align: center; padding: 1em; }

/* ---- 表 */
table.simple { width: 100%; border-collapse: collapse; margin: 1em 0; background: #fff; border-radius: 10px; overflow: hidden; font-size: .95rem; }
table.simple th, table.simple td { border: 1px solid var(--teal-light); padding: .5em .7em; text-align: left; vertical-align: top; }
table.simple th { background: var(--teal-light); }
.table-wrap { overflow-x: auto; }
.rank-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; }
.rank-row figure { margin: 0; width: 96px; text-align: center; font-size: .78rem; font-weight: 800; }
.rank-row img { width: 72px; height: 72px; }
.medal-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.medal-row figure { margin: 0; width: 110px; text-align: center; font-size: .8rem; font-weight: 800; }
.medal-row img { height: 96px; width: auto; }

/* ---- FAQ */
details.faq { background: var(--card); border: 2px solid var(--teal-light); border-radius: 12px; margin: 10px 0; padding: 0; box-shadow: var(--shadow); }
details.faq summary { cursor: pointer; padding: .8em 1.1em; font-weight: 800; color: var(--brown-dark); list-style: none; }
details.faq summary::before { content: "Q"; display: inline-block; background: var(--teal); color: #fff; border-radius: 50%; width: 1.6em; height: 1.6em; text-align: center; margin-right: .6em; line-height: 1.6em; }
details.faq[open] summary { border-bottom: 1px dashed var(--teal-light); }
details.faq .answer { padding: .5em 1.2em 1em 3em; }

/* ---- フッター */
.site-footer { background: #5a4636; color: #f5e9d6; margin-top: 40px; padding: 30px 0 22px; text-align: center; }
.site-footer a { color: #ffe9b0; }
.footer-brand img { margin-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; list-style: none; padding: 0; margin: 10px 0; font-size: .9rem; }
.copyright { font-size: .8rem; opacity: .8; margin: 6px 0 0; }

/* ---- スマホ */
@media (max-width: 1180px) { .brand span { display: none; } }
@media (max-width: 860px) {
  .site-nav ul { flex-wrap: wrap; }
  .navbutton { display: block; margin-left: auto; width: 42px; height: 42px; cursor: pointer; padding: 11px 8px; }
  .navbutton span { display: block; height: 3px; background: var(--brown-dark); border-radius: 2px; margin: 5px 0; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--cream); border-bottom: 3px solid var(--teal); padding: 8px 16px 14px; }
  .site-nav ul { flex-direction: column; }
  .navtoggle:checked ~ .site-nav { display: block; }
  .langs { order: 2; margin-left: 0; }
  .header-row { flex-wrap: wrap; }
  .site-nav { margin-left: 0; }
}
@media (max-width: 520px) {
  body { font-size: 15px; }
  .section { padding: 32px 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- スライド（ストーリーのオープニング） */
.slider { position: relative; margin: 0 0 18px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; border-radius: 16px; border: 4px solid var(--gold); box-shadow: var(--shadow); background: #2a1d14; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; position: relative; }
.slide img { display: block; width: 100%; height: auto; }
.slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 14px; color: #fff; font-weight: 800; text-align: center; text-shadow: 0 2px 4px rgba(0,0,0,.8); background: linear-gradient(180deg, rgba(0,0,0,0), rgba(20,10,0,.78)); font-size: clamp(.9rem, 2.2vw, 1.15rem); }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff3c2; background: rgba(60,40,20,.7); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 0 4px; }
.slider-btn:hover { background: rgba(60,40,20,.9); }
.slider-btn.prev { left: 10px; } .slider-btn.next { right: 10px; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--teal-light); border: 1px solid var(--teal); }
.dots span.on { background: var(--gold); border-color: var(--gold-dark); }

.hand { margin: .7em 0 .2em; }
.hand img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--teal-light); display: block; }
.hand small { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; text-align: left; }

/* ---- 遊び方のページ */
.howto-fig { margin: 14px 0; }
.howto-fig img, .step-img { display: block; width: 100%; height: auto; border-radius: 12px; border: 3px solid var(--gold); box-shadow: var(--shadow); }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 16px 0; }
.three > div { background: #fdf3d0; border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; margin-right: .5em; flex: none; }
ol.legend { counter-reset: lg; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 18px; }
ol.legend li { counter-increment: lg; padding-left: 2.4em; position: relative; font-size: .93rem; }
ol.legend li::before { content: counter(lg); position: absolute; left: 0; top: .1em; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; text-align: center; line-height: 1.8em; font-size: .85rem; }
.rps { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin: 16px 0; }
.rps figure { margin: 0; text-align: center; font-weight: 800; font-size: .9rem; }
.rps img { display: block; margin: 0 auto 4px; border-radius: 8px; }
.rps .beats { font-weight: 900; color: var(--red); }
.rps .loop { width: 100%; text-align: center; color: var(--muted); font-size: .85rem; }
ol.steps { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 22px; }
li.step { display: grid; grid-template-columns: 2.4em 1fr; gap: 4px 12px; align-items: start; }
li.step h3 { border: 0; padding: 0; margin: 0 0 .2em; font-size: 1.1rem; }
li.step p { margin: 0 0 8px; }
li.step .step-img { grid-column: 2; max-width: 640px; }
.swaptable td:last-child { white-space: nowrap; }
.ok, .ng { display: inline-block; padding: .1em .7em; border-radius: 999px; font-weight: 800; color: #fff; }
.ok { background: var(--teal-dark); } .ng { background: var(--red); }
.when { display: inline-block; padding: .1em .6em; border-radius: 999px; font-size: .8rem; font-weight: 800; color: #fff; white-space: nowrap; }
.when.before { background: #8e6bb5; } .when.after { background: var(--teal-dark); }
.face-s { vertical-align: middle; border-radius: 50%; margin-right: 4px; }
details.more { background: var(--card); border: 2px solid var(--teal-light); border-radius: var(--radius); padding: 0 clamp(14px, 3vw, 28px) 10px; margin: 18px 0 40px; box-shadow: var(--shadow); }
details.more > summary { cursor: pointer; font-weight: 900; font-size: 1.1rem; color: var(--brown-dark); padding: 14px 0; }
details.more .prose { box-shadow: none; border: 0; padding: 0; margin: 0; }

.card img.card-shot { display: block; width: 100%; height: auto; border-radius: 10px; border: 2px solid var(--gold); margin-top: 8px; }

.cards.steps4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.cards.steps4 .card { display: flex; flex-direction: column; }
.cards.steps4 .card img.card-shot { margin-top: auto; }
.cards.steps4 .card p { margin-bottom: 10px; }
