/* Bedrock Bound の紹介ページ。下へ読むほど、ゲームの地層のように色が深くなる */
:root {
  --cream: #fff4e2;
  --cream-soft: rgba(255, 244, 226, 0.78);
  --gold: #ffd34d;
  --gold-deep: #c99a3a;
  --ink: #1f140e;
  --green: #2f8f83;
  --green-lip: #1d6158;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
/* 画面の上下の余白(Safari のバーの下・引っぱった時)も、白ではなくページの色に。上は表土、下は一番深い層の色 */
html { background: linear-gradient(180deg, #1f140e 0 50%, #2a2a36 50% 100%); }
html:has(.doc-body) { background: #1f140e; }

html, body { overflow-x: clip; }
body {
  margin: 0;
  color: var(--cream);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.75;
  /* 表土 → 粘土 → 赤土 → 砂岩 … → 黒曜石(ゲームの12の層の色) */
  /* ゲームと同じ地面のブロックを、ページ全体に切れ目なく重ねる */
  background: url("images/ground_shade.png") 0 0 / 192px 192px repeat, linear-gradient(180deg,
    #1f140e 0, #1f140e 960px, #865332 1800px, #7e5335 22%, #765339 32%, #6f533c 42%,
    #68523f 52%, #615142 61%, #5a4f45 70%, #544d46 78%, #4b4947 86%,
    #43434b 93%, #2a2a36 100%);
  -webkit-font-smoothing: antialiased;
}

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

.title-font { font-family: "Dela Gothic One", "Hiragino Sans", sans-serif; font-weight: 400; letter-spacing: 0.01em; }

/* 上の帯: アイコン・名前・言葉の切り替え */
.top {
  position: absolute; inset: 0 0 auto 0;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; z-index: 5;
}
.top img { width: 36px; height: 36px; border-radius: 9px; }
.top .name { color: var(--cream); text-decoration: none; font-family: "Rubik Dirt", sans-serif; font-size: 19px; letter-spacing: 0.02em; text-shadow: 1px 2px 0 #161b29; }
.top .name span { color: var(--gold); }
.top .lang { margin-left: auto; color: var(--cream-soft); text-decoration: none; font-size: 14px; }

/* 最初の画面: 起動の絵(暗い土・ドリル車・題)を大きく */
.hero {
  position: relative;
  min-height: min(100svh, 820px);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 80px 16px 64px;
  text-align: center;
  overflow: hidden;
}
.hero-art {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: min(100%, 720px); height: auto; display: block;
  /* 左右と下を、まわりの暗い土へなじませる(題字の両端にはかからない幅で) */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%), linear-gradient(180deg, #000 55%, transparent 96%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%), linear-gradient(180deg, #000 55%, transparent 96%);
  mask-composite: intersect;
}
@media (max-width: 720px) {
  .hero-art { -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 96%); mask-image: linear-gradient(180deg, #000 55%, transparent 96%); }
}
.hero > :not(.hero-art) { position: relative; z-index: 1; }
.hero .tagline { font-size: clamp(22px, 6vw, 34px); margin: 0 0 8px; text-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.hero .lead { margin: 0 auto 24px; max-width: 30em; color: var(--cream-soft); font-size: 16px; }

/* App Store のボタン(公開前は「近日公開」) */
.store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px 18px; border-radius: 16px;
  background: var(--green); box-shadow: inset 0 -6px 0 var(--green-lip), 0 8px 18px rgba(0,0,0,0.35);
  color: #fff; text-decoration: none; font-family: "Dela Gothic One", sans-serif; font-size: 18px;
}
.store.soon { background: #4a3a2c; box-shadow: inset 0 -6px 0 #2e241a, 0 8px 18px rgba(0,0,0,0.35); color: var(--cream-soft); cursor: default; }

/* 左のふちの深さ計(読み進むと数字がふえる) */
.depth {
  position: fixed; left: 12px; top: 50%; transform: translateY(-50%);
  z-index: 4; pointer-events: none;
  font-family: "Dela Gothic One", sans-serif; font-size: 20px; color: var(--cream);
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.3s;
}
.depth small { font-size: 12px; margin-left: 2px; }
.depth.on { opacity: 0.9; }

/* 底: もう一度ボタンと、リンク */
.bottom { text-align: center; padding: 96px 16px 40px; }
.bottom h2 { font-family: "Dela Gothic One", sans-serif; font-weight: 400; font-size: clamp(24px, 6vw, 36px); line-height: 1.45; margin: 0 0 24px; }
footer { text-align: center; padding: 28px 16px 40px; color: var(--cream-soft); font-size: 13px; }
footer a { color: var(--cream-soft); margin: 0 10px; }

/* プライバシーポリシーとサポート(読みやすい、明るい紙の面) */
.doc-body { background: #1f140e; }
.doc {
  max-width: 760px; margin: 0 auto; padding: 88px 16px 40px;
}
.doc .paper { background: var(--cream); color: var(--ink); border-radius: 22px; padding: 28px 22px; box-shadow: 0 18px 36px rgba(0,0,0,0.4); }
.doc h1 { font-family: "Dela Gothic One", sans-serif; font-weight: 400; font-size: 26px; margin: 0 0 4px; }
.doc h2 { font-size: 18px; margin: 28px 0 6px; font-weight: 800; }
.doc p, .doc li { font-size: 15px; }
.doc a { color: #8a5a10; }
.doc .updated { color: #7a6a58; font-size: 13px; margin: 0 0 18px; }
.doc .form { display: inline-block; margin-top: 8px; padding: 12px 22px 16px; border-radius: 14px; background: var(--green); box-shadow: inset 0 -5px 0 var(--green-lip); color: #fff; text-decoration: none; font-weight: 800; }
.doc .paper { overflow-wrap: anywhere; }
.doc ul { padding-left: 1.2em; }

/* 左のふちの深さ計: ドリル車の絵と数(読み進むと下へ) */
.depth { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.depth img { width: 46px; height: 46px; filter: drop-shadow(0 3px 2px rgba(0,0,0,0.4)); }


/* 左のふちの深さ計: ドリル車の絵と数(読み進むと下へ) */
.depth { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.depth img { width: 46px; height: 46px; filter: drop-shadow(0 3px 2px rgba(0,0,0,0.4)); }

/* ひとつずつの紹介(線で区切らず、余白だけで分ける) */
.block { max-width: 960px; margin: 0 auto; padding: 88px 16px; text-align: center; }
.block .text { max-width: 30em; margin: 0 auto 28px; }
.block h2 { font-family: "Dela Gothic One", sans-serif; font-weight: 400; font-size: clamp(24px, 6vw, 34px); line-height: 1.35; margin: 0 0 10px; color: var(--gold); text-shadow: 0 3px 0 rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.4); }
.block p { margin: 0; font-size: 16px; color: var(--cream); text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
.hidden { filter: brightness(0) opacity(0.4); }

/* なぞって掘る */
.dig-wrap { position: relative; width: min(100%, 420px); margin: 0 auto; }
#dig { display: block; width: 100%; touch-action: none; cursor: pointer; filter: drop-shadow(0 14px 24px rgba(0,0,0,0.45)); }
/* 拾った鉱石: 種類ごとに、絵の右下へ数を重ねて右から並ぶ */
.dig-count { position: absolute; right: 2px; top: 0; display: flex; flex-direction: row-reverse; align-items: center; gap: 2px; pointer-events: none; }
.dig-count .slot { position: relative; width: 40px; height: 40px; opacity: 0; transition: opacity 0.2s; }
.dig-count .slot.on { opacity: 1; }
.dig-count .slot img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.4)); }
.dig-count .slot b { position: absolute; right: -2px; bottom: -4px; font-family: "Dela Gothic One", sans-serif; font-weight: 400; font-size: 15px; color: var(--cream); text-shadow: 0 2px 0 rgba(0,0,0,0.6), 0 0 4px rgba(0,0,0,0.5); }
.dig-count .slot.pop { animation: pop 0.25s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }
.block .hint { margin-top: 12px; font-size: 14px; color: var(--cream-soft); }

/* 鉱石: 絵が並んで、ゆっくり浮く */
.ores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 8px; max-width: 640px; margin: 0 auto; }
.ore { margin: 0; }
.ore img { width: 100%; max-width: 120px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(0,0,0,0.4)); animation: bob 5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ore figcaption { font-size: 13px; font-weight: 800; color: var(--cream-soft); margin-top: -4px; }
.ore.hidden { filter: none; }
.ore.hidden img { filter: brightness(0) opacity(0.4); animation: none; }

/* ドリル車: 回せる展示と、3つの部品 */
model-viewer::part(default-progress-bar) { display: none; }
.drills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 880px; margin: 0 auto 48px; }
.drill { margin: 0; }
.drill model-viewer { width: 100%; aspect-ratio: 1 / 1.15; height: auto; display: block; background: radial-gradient(closest-side, rgba(255,214,140,0.2), rgba(0,0,0,0) 72%); --poster-color: transparent; }
.drill figcaption { font-family: "Dela Gothic One", sans-serif; font-size: 15px; color: var(--cream); }
.drill .sil { position: relative; aspect-ratio: 1 / 1.15; display: grid; place-items: center; }
.drill .sil img { width: 78%; filter: brightness(0) opacity(0.45); }
.drill .sil b { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Dela Gothic One", sans-serif; font-size: clamp(28px, 7vw, 44px); color: var(--gold); text-shadow: 0 3px 0 rgba(0,0,0,0.5); }
.drill.locked figcaption { color: var(--cream-soft); }
.parts { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 900px; margin: 0 auto; }
@media (min-width: 760px) { .parts { grid-template-columns: repeat(3, 1fr); } }
.part { background: rgba(20, 12, 8, 0.32); border-radius: 22px; padding: 18px 14px 20px; }
.strip { display: flex; justify-content: center; align-items: center; gap: 2px; margin-bottom: 8px; }
.strip img { width: 25%; max-width: 76px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.4)); }
.strip .more { position: relative; width: 25%; max-width: 76px; }
.strip .more img { width: 100%; max-width: none; filter: brightness(0) opacity(0.4); }
.strip .more b { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Dela Gothic One", sans-serif; font-size: 22px; color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,0.5); }
.part h3 { margin: 0 0 2px; font-family: "Dela Gothic One", sans-serif; font-weight: 400; font-size: 22px; color: var(--cream); }
.part h3 small { font-family: "M PLUS Rounded 1c", sans-serif; font-weight: 800; font-size: 13px; color: var(--gold); margin-left: 8px; }
.block .part p { font-size: 14px; color: var(--cream-soft); text-shadow: none; }

/* 化石: 3つは指で回せる3D、残りは影絵 */
.fossils3d { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 880px; margin: 0 auto 8px; }
.fossils3d model-viewer { width: 100%; aspect-ratio: 1; height: auto; display: block; background: radial-gradient(closest-side, rgba(255,236,200,0.16), rgba(0,0,0,0) 72%); --poster-color: transparent; }
.fossils-hidden { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.fossils-hidden img { width: min(13vw, 72px); aspect-ratio: 1; object-fit: contain; filter: brightness(0) opacity(0.4); }

/* 洞窟の遺物: 5つとも影絵と「?」 */
.relics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 640px; margin: 0 auto; }
.relic { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: radial-gradient(closest-side, rgba(110,200,255,0.14), rgba(0,0,0,0) 75%); }
.relic img { width: 88%; aspect-ratio: 1; object-fit: contain; filter: brightness(0) opacity(0.55); }
.relic b { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Dela Gothic One", sans-serif; font-size: clamp(20px, 5vw, 32px); color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,0.5); }

/* もぐら */
.mole { width: min(70vw, 300px); filter: drop-shadow(0 14px 16px rgba(0,0,0,0.45)); }

/* 触る所・絵は、なぞっても文字選択の青い面が出ないように */
.drills, .parts, .ores, .fossils3d, .fossils-hidden, .relics, .dig-wrap, .mole-block, .hero, .depth { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }

/* 狭い画面では、深さ計が見出しに重なるので出さない */
@media (max-width: 700px) { .depth { display: none; } }

/* 広い画面: 起動の場面を横長に写した絵(左右も同じ岩が続き、外ほど暗く沈む) */
@media (min-width: 721px) {
  .hero { background: #1f140e url("images/hero_wide.jpg") center top / max(100%, 1500px) auto no-repeat; min-height: calc(max(100vw, 1500px) / 2.118 + 180px); }
  .hero-art { display: none; }
  /* 下の方(もぐら・金のあたり)から、ページの暗い土へ溶かす。文字はその上 */
  .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,20,14,0) 50%, rgba(31,20,14,0.88) 78%, #1f140e 100%); }
}

/* ドリル車の姿の数と最大レベル */
.lv300 { text-align: center; margin: -8px auto 64px; }
.lv300 .stage { position: relative; width: min(300px, 70vw); aspect-ratio: 1; margin: 0 auto 8px; display: grid; place-items: center; }
.lv300 .stage img { position: relative; width: 74%; filter: drop-shadow(0 0 2px rgba(255,214,120,0.9)) drop-shadow(0 0 18px rgba(255,190,80,0.55)); animation: lvfloat 4s ease-in-out infinite; }
.lv300 .stage b { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Dela Gothic One", sans-serif; font-size: clamp(56px, 16vw, 84px); color: var(--gold); text-shadow: 0 4px 0 rgba(0,0,0,0.55), 0 0 24px rgba(255,200,90,0.6); animation: lvfloat 4s ease-in-out infinite, lvbeat 2.4s ease-in-out infinite; }
.lv300 .rays { position: absolute; inset: -6%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,214,140,0.22) 0deg 9deg, rgba(255,214,140,0) 9deg 24deg); -webkit-mask: radial-gradient(closest-side, #000 35%, transparent 100%); mask: radial-gradient(closest-side, #000 35%, transparent 100%); animation: lvspin 30s linear infinite; }
.lv300 .spark { position: absolute; width: 10px; height: 10px; background: #ffe7a8; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: 0; animation: lvtwinkle 2.8s ease-in-out infinite; }
.lv300 .s1 { left: 14%; top: 22%; } .lv300 .s2 { right: 12%; top: 30%; animation-delay: 0.7s; width: 14px; height: 14px; } .lv300 .s3 { left: 22%; bottom: 16%; animation-delay: 1.4s; } .lv300 .s4 { right: 20%; bottom: 12%; animation-delay: 2.1s; width: 8px; height: 8px; } .lv300 .s5 { left: 48%; top: 6%; animation-delay: 1s; width: 12px; height: 12px; }
.maxline { margin: 0 auto; color: var(--cream); font-size: 17px; font-weight: 800; line-height: 1.6; }
.maxline b { font-family: "Dela Gothic One", sans-serif; font-weight: 400; font-size: 30px; color: var(--gold); margin: 0 2px; text-shadow: 0 3px 0 rgba(0,0,0,0.3); }
@keyframes lvfloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes lvbeat { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }
@keyframes lvspin { to { rotate: 360deg; } }
@keyframes lvtwinkle { 0%, 100% { opacity: 0; scale: 0.4; } 50% { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .lv300 * { animation: none !important; } .lv300 .spark { opacity: 0.8; } }

/* 見出しをタイトル(BEDROCK BOUND)の作りにそろえる: 濃い紺のふちと、下へずらした同じ色の影(字は Dela Gothic のまま) */
.hero .tagline, .block h2, .bottom h2, .maxline b, .part h3 {
  -webkit-text-stroke: 0.16em #161b29;
  paint-order: stroke fill;
  text-shadow: 0 0.12em 0 #161b29;
  letter-spacing: 0.03em;
}
.hero .tagline { color: #fff8ec; }
.block h2 { color: #ffc93c; }
.bottom h2 { color: #fff8ec; }
.maxline b { color: #ffc93c; }
.part h3 { -webkit-text-stroke-width: 0.14em; }

/* 用途のわからない部品(3000m の前): 暗い岩の中で、部品の線がうすく光る。下から青い光の粒がのぼる(ゲームの深い層と同じ) */
.ship-block { position: relative; padding-bottom: 72px; }
.ship-block p { word-break: auto-phrase; }
/* 暗い帯は画面の幅いっぱい(段の幅で切れて、縦のふちが見えないように) */
.ship-block::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); z-index: -1; background: radial-gradient(90% 55% at 50% 72%, rgba(90,216,255,0.17), rgba(0,0,0,0) 70%), rgba(10,12,20,0.5);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 72%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 72%, transparent 100%); }
.shipparts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 420px; margin: 0 auto; }
.sp { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: radial-gradient(closest-side, rgba(110,220,255,0.16), rgba(0,0,0,0) 72%); }
.sp img { width: 92%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 10px rgba(110,220,255,0.35)) drop-shadow(0 8px 8px rgba(0,0,0,0.45)); animation: bob 6s ease-in-out infinite; }
.sp:nth-child(2) img { animation-delay: -1.2s; }
.sp:nth-child(3) img { animation-delay: -2.4s; }
.sp:nth-child(4) img { animation-delay: -3.6s; }
.sp:nth-child(5) img { animation-delay: -4.8s; }
.sp.hid img { filter: brightness(0) opacity(0.55); }
.sp b { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Dela Gothic One", sans-serif; font-size: clamp(20px, 5vw, 32px); color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,0.5); }
.block .whisper { margin-top: 30px; font-size: clamp(13px, 3.8vw, 15px); word-break: auto-phrase; color: #8fe3ff; letter-spacing: 0.06em; text-shadow: 0 0 12px rgba(90,216,255,0.55); animation: whisper 5.5s ease-in-out infinite; }
@keyframes whisper { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.motes { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.motes i { position: absolute; bottom: -12px; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle, rgba(200,245,255,0.95), rgba(90,216,255,0.5) 45%, rgba(90,216,255,0) 72%); animation: rise 10s linear infinite; opacity: 0; }
.motes i:nth-child(1) { left: 8%; animation-delay: 0s; }
.motes i:nth-child(2) { left: 19%; animation-delay: -6.5s; animation-duration: 12s; }
.motes i:nth-child(3) { left: 31%; animation-delay: -2.5s; }
.motes i:nth-child(4) { left: 42%; animation-delay: -8s; animation-duration: 11s; }
.motes i:nth-child(5) { left: 53%; animation-delay: -4s; }
.motes i:nth-child(6) { left: 61%; animation-delay: -9.5s; animation-duration: 13s; }
.motes i:nth-child(7) { left: 70%; animation-delay: -1s; }
.motes i:nth-child(8) { left: 79%; animation-delay: -5.5s; animation-duration: 12s; }
.motes i:nth-child(9) { left: 88%; animation-delay: -3s; }
.motes i:nth-child(10) { left: 95%; animation-delay: -7s; animation-duration: 11s; }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 0.9; } 50% { transform: translate(6px, -50vh); } 85% { opacity: 0.7; } 100% { transform: translate(-4px, -95vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .motes, .block .whisper, .sp img { animation: none; } .motes { display: none; } }
.shipparts { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
