/* 高み：落ち着いた 色。のぼのぼの パステルは 使わない */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1c2136; color: #f1ece4; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
[hidden] { display: none !important; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#touch { position: fixed; inset: 0; touch-action: none; }

/* 上：いまの 高さ と 経過時間 */
#hud { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; justify-content: center; gap: 10px; pointer-events: none; }
#hud .cell { background: rgba(20, 24, 40, 0.55); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 6px; padding: 5px 12px; font-size: 18px; font-variant-numeric: tabular-nums; min-width: 108px; text-align: right; }
#hud .label { float: left; font-size: 12px; opacity: 0.75; margin-right: 10px; line-height: 26px; }
/* 新しい 時代に 入った ときの 名前（まん中の 上に 2秒ほど 出して 消す） */
#era-name { position: fixed; top: calc(62px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-size: 26px; letter-spacing: 0.3em; text-indent: 0.3em; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.4s; pointer-events: none; }
#era-name.on { opacity: 1; }
html[lang="en"] #era-name { letter-spacing: 0.14em; text-indent: 0.14em; }  /* 英語は 字数が 多いので 字の 間を つめる */
#cross { position: fixed; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: rgba(255, 255, 255, 0.7); box-shadow: 0 0 2px rgba(0, 0, 0, 0.8); pointer-events: none; }
body:not(.playing) #cross { display: none; }

/* 長く 落ちている ときの 風の 線（画面の ふち） */
#wind { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0) 0deg 5deg, rgba(255, 255, 255, 0.5) 5.3deg 5.6deg, rgba(255, 255, 255, 0) 6deg 11deg);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 42%, #000 95%); mask-image: radial-gradient(ellipse at center, transparent 42%, #000 95%);
  animation: wind 0.25s steps(3) infinite; }
#wind.on { opacity: 1; }
@keyframes wind { from { transform: scale(1.5) rotate(0deg); } to { transform: scale(1.5) rotate(11deg); } }

/* スマホの 操作 */
#stick, #jump-btn, #pause-btn { display: none; }
body.touch.playing #jump-btn, body.touch.playing #pause-btn { display: block; }
body.touch.playing #stick { display: block; }
#stick { position: fixed; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.08); pointer-events: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transform: translate(-50%, -50%); }
#jump-btn { position: fixed; right: calc(22px + env(safe-area-inset-right)); bottom: calc(34px + env(safe-area-inset-bottom)); width: 92px; height: 92px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.14); color: #fff; font: inherit; font-size: 15px; touch-action: none; }
#jump-btn.on { background: rgba(255, 255, 255, 0.4); }
#pause-btn { position: fixed; right: calc(10px + env(safe-area-inset-right)); top: calc(10px + env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(20, 24, 40, 0.55); color: #fff; font-size: 16px; }

/* スマホの 目印（遊びはじめに 1回だけ）：左半分＝移動、右半分＝なぞって 見回す。指の しるしが 動く */
.hint { display: none; position: fixed; top: 52%; width: 50%; text-align: center; pointer-events: none; font-size: 15px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85); }
body.touch.playing .hint { display: block; }
#hint-move { left: 0; }
#hint-look { right: 0; }
.hint span { display: inline-block; margin-top: 12px; padding: 4px 12px; border-radius: 14px; background: rgba(20, 24, 40, 0.6); border: 1px solid rgba(255, 255, 255, 0.25); }
.hint .finger { display: block; width: 38px; height: 38px; margin: 0 auto; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.3); box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); }
#hint-look .finger { animation: hint-swipe 1.6s ease-in-out infinite; }
#hint-move .finger { animation: hint-push 1.6s ease-in-out infinite; }
@keyframes hint-swipe { 0%, 100% { transform: translateX(-42px); } 50% { transform: translateX(42px); } }
@keyframes hint-push { 0%, 100% { transform: translateY(14px); } 50% { transform: translateY(-22px); } }

/* ゴールの 演出：隕石が 落ちた ときの 白い 光（濃さは main.js が 決める）。結果の パネルより 下 */
#flash { position: fixed; inset: 0; background: #fff8ec; opacity: 0; pointer-events: none; }

/* はじめの 画面・一時停止・ゴール */
.panel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(16, 19, 32, 0.62); padding: 16px; }
#title { cursor: pointer; }
.card { width: min(440px, 100%); background: rgba(28, 33, 54, 0.94); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 10px; padding: 22px 22px 18px; text-align: center; line-height: 1.75; max-height: calc(100% + 24px); overflow-y: auto; }  /* 高さは 画面の 上下 4px まで（100% は .panel の 余白 16px の 内がわ）。横向きの スマホなど 低い 画面では カードの 中を 送る（下の リンクまで 届く） */
.card h1, .card h2 { margin: 0 0 10px; font-weight: 600; letter-spacing: 0.08em; }
.card h1 { font-size: 30px; }
.card h2 { font-size: 21px; }
.card p { margin: 0 0 12px; font-size: 14px; }
.card .how { font-size: 13px; opacity: 0.85; }
.card .go { margin: 14px 0 0; font-size: 17px; color: #f5c58f; }
#title-save { color: #f5c58f; }
#title-save:empty { display: none; }
body.touch .pc, body:not(.touch) .sp { display: none; }
.card button { display: block; width: 100%; margin: 10px 0 0; padding: 12px; border-radius: 6px; border: 1px solid #f5c58f; background: #f5c58f; color: #23263a; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.card button.sub { background: transparent; color: #f1ece4; border-color: rgba(255, 255, 255, 0.4); font-weight: 400; }
/* 一時停止メニューの 設定（画面のゆれ：あり／なし）。「なし」は うすく する */
.card button.opt { font-size: 15px; }
.card button.opt[aria-pressed="false"] { color: rgba(241, 236, 228, 0.7); border-style: dashed; }
/* 音の 設定：はじめの 画面の 小さい 切りかえ・一時停止メニューの 音量 */
.card .snd { margin: 12px 0 0; font-size: 13px; opacity: 0.9; }
.card button.mini { display: inline-block; width: auto; margin: 0 0 0 12px; padding: 4px 14px; font-size: 13px; }
.card .vol { display: grid; grid-template-columns: auto 1fr 34px; align-items: center; gap: 10px; margin: 10px 0 0; padding: 4px 12px; font-size: 15px; }
.card .vol input { width: 100%; accent-color: #f5c58f; }
.card .vol b { text-align: right; font-weight: 400; font-variant-numeric: tabular-nums; }
/* 言語：日本語／English（はじめの 画面と 一時停止メニュー）。いまの 言語の ボタンを 塗る */
.card .lang { margin: 10px 0 0; font-size: 13px; opacity: 0.9; }
.card .lang button.mini + button.mini { margin-left: 6px; }
.card .lang button[aria-pressed="true"] { background: #f5c58f; border-color: #f5c58f; color: #23263a; font-weight: 600; }
/* 帰り道の リンク（はじめの 画面・一時停止・結果の いちばん 下）：小さい 文字で、ボタンより 目立たせない。入れば 横に ならべ、せまければ 2段に。押せる 高さは 44px */
.card .links { display: flex; flex-wrap: wrap; justify-content: center; margin: 8px 0 -8px; }
.card .links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-size: 12px; color: #f1ece4; opacity: 0.85; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 6px 0 8px; text-align: left; font-size: 15px; }
.card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-size: 18px; }

/* ?debug=1：手触りの スライダー */
#debug { position: fixed; left: 6px; bottom: 6px; width: 250px; max-height: 70%; overflow: auto; background: rgba(0, 0, 0, 0.6); padding: 6px 8px; font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace; border-radius: 4px; }
#debug label { display: grid; grid-template-columns: 70px 1fr 44px; align-items: center; gap: 4px; }
#debug input { width: 100%; }
#debug b { text-align: right; font-weight: 400; }
/* ?debug=1：音を 1つずつ 鳴らす ボタン */
#debug-sound { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0; }
#debug-sound button { padding: 2px 6px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.12); color: #fff; font: inherit; cursor: pointer; }
