@charset "UTF-8";

/* ==========================================================
   マッドウマックス — 横スクロール・ジャンプアクション

   構成は「村の開墾ラン」に合わせている:
   - 画面いっぱいの 1 カラム（PC は中央寄せ、左右は淡い余白）
   - 上部固定の統計タイル、残りの高さは全部プレイエリア
   - モーダルは viewport 全面のオーバーレイ＋ピル型ボタン

   このゲーム固有の点:
   - プレイ画面は縦横比を固定せず、空いている領域いっぱいに広がる。
     論理座標の大きさは実寸から mizuhiki-game.js が毎回決める
   - 2D キャンバス（背景・足場・水）の上に、
     WebGL キャンバス（車の3Dモデル）を同じ大きさで重ねる
   ========================================================== */

:root {
  --mz-chrome: #3b2f24;        /* アプリの地色（トップバー）。線画と同じ色 */
  --mz-chrome-tint: #d9cdb0;   /* 画面外の余白 */
  --mz-soil: #7d6647;
  --mz-soil-deep: #4d3b26;
  --mz-accent: #c23c22;        /* 注意・強調の赤 */
  --mz-accent-deep: #8f2a14;
  --mz-gold: #f5b027;
  --mz-gold-deep: #d98a10;
  --mz-ink: #3b2d1e;
  --mz-ink-soft: #7a6850;
  --mz-line: rgba(59, 45, 30, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* display 指定を持つ要素でも hidden 属性を効かせる */
[hidden] { display: none !important; }

html, body { height: 100%; }

.mz-page {
  background: var(--mz-chrome-tint);
  color: var(--mz-ink);
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

/* ---------- アプリ列 ---------- */

/* ゲーム画面は横幅を制限しない（プレイ画面を画面いっぱいに使う）。
   トップ画面だけ .mz-app--top で 1 カラム幅に絞る */
.mz-app {
  max-width: none;
  min-height: 100%;
  height: 100vh;
  height: 100dvh;   /* アドレスバー込みの実高さ（対応ブラウザのみ） */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--mz-chrome);
  box-shadow: 0 0 24px rgba(0, 0, 0, .12);
  overflow: hidden;
}

/* ゲーム中は画面のどこをタップしてもジャンプできる。
   スクロールやダブルタップ拡大に取られないよう、列ごと touch を止める */
.mz-app--game {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* ---------- トップバー（統計タイル） ---------- */

.mz-topbar {
  flex: none;
  display: flex;
  gap: 6px;
  /* ノッチ・ダイナミックアイランドの下に潜らせない。
     一括指定（padding: a b c）だと左右を別々に扱えず、
     横持ちでノッチ側のタイルが隠れてしまうので 4 辺とも個別に書く。
     どの辺も max(8px, …) で、安全領域が 0 の端末でも必ず 8px 空く。 */
  padding-top: max(8px, env(safe-area-inset-top));
  padding-right: max(8px, env(safe-area-inset-right));
  padding-bottom: 8px;
  padding-left: max(8px, env(safe-area-inset-left));
  background: var(--mz-chrome);
}

.mz-stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  /* 余白を詰めてあるのは、うまい棒の目盛りを足してもトップバーの高さを
     変えないため。背が伸びるとそのぶんプレイ画面が削れてしまう */
  padding: 4px 4px 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .15);
}

.mz-stat__label {
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .82);
}

.mz-stat__value {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-family: "Oxanium", monospace;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.mz-stat__value b { font-size: 30px; font-weight: 800; }
.mz-stat__value i { font-size: 16px; font-weight: 700; font-style: normal; opacity: .8; }

.mz-stat--up .mz-stat__value b { color: #f7d81b; }

/* うまい棒の進捗。必要本数ぶんの目盛りを JS が並べる（列数も JS が決める） */
.mz-pips {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 116px;
}
.mz-pips i {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .25);
  transition: background .12s ease, transform .12s ease;
}
.mz-pips i.is-on {
  background: #f7d81b;
  box-shadow: 0 0 5px rgba(247, 216, 27, .85);
  transform: scaleY(1.4);
}
.mz-stat--best { flex: 0.8; min-width: 84px; }
.mz-stat--best .mz-stat__value b { font-size: 22px; opacity: .9; }

/* スコアが伸びた瞬間だけ跳ねる */
.mz-stat__value.is-pop b { animation: mz-pop .22s ease-out; }
@keyframes mz-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); color: #f7d81b; }
  100% { transform: scale(1); }
}

/* ---------- プレイエリア ---------- */

.mz-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  /* プレイ画面もノッチとホームバーを避ける（理由はトップバーと同じ） */
  padding-top: 8px;
  padding-right: max(8px, env(safe-area-inset-right));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  padding-left: max(8px, env(safe-area-inset-left));
  overflow: hidden;
  background: #2e251b;
}

/* プレイ画面。縦横比は固定せず、ステージいっぱいに広がる。
   何 px になったかは mizuhiki-game.js の resize() が読み取って、
   そこから論理座標の大きさ（見える世界の広さ）を決める。 */
.mz-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #efe2c2;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .3);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* 2D（背景・足場・水引）と WebGL（3Dプレイヤー）を完全に重ねる。
   論理座標 800x400 を両方が共有するので、位置は自動で一致する */
#mz-canvas, #mz-3d {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
#mz-3d { pointer-events: none; }

/* ---------- 水路ゲージ（スーパー水引） ----------
   プレイエリアに重ねる＝通常時に高さを食わない。
   ためている間は控えめ、発動中は太い輪郭と硬い影で目立たせる */

/* ---------- うまいパワーのゲージ ----------
   開墾ゲームのスーパーゲージと同じ作り。
   ためている途中はトップバーの「UP n/需要数」で分かるので、
   この帯は発動中だけ出す。残り時間とバーの 2 つで「あと何秒か」を伝える。
   色だけ、うまい棒の紫と金に置き換えている */

.mz-super {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  padding: 9px 13px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #e06ccd, #a4218f);
  border: 3px solid #4d0842;
  box-shadow: 0 5px 0 #7d0f6c, 0 12px 22px rgba(80, 10, 70, .34);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-14px) scale(.92);
  transition: opacity .18s ease, transform .18s cubic-bezier(.34, 1.56, .64, 1),
              background .18s ease, box-shadow .18s ease;
}
.mz-super.is-on {
  opacity: 1;
  transform: none;
}

.mz-super__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: .01em;
  color: #fff;
  /* 白抜き文字＋濃い縁取り。paint-order で塗りを縁の上に出す */
  -webkit-text-stroke: 3.5px #4d0842;
  paint-order: stroke fill;
}
.mz-super__label span {
  flex: 1;
  min-width: 0;
}
.mz-super__label b {
  flex: none;
  font-family: "Oxanium", monospace;
  font-size: 30px;
  line-height: .9;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke-width: 4.5px;
}

.mz-super__bar {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: #4a0c40;
  border: 3px solid #4d0842;
}
.mz-super__bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .34) 0 9px, rgba(255, 255, 255, 0) 9px 20px),
    linear-gradient(180deg, #ffe07a, #f5b027);
  /* 縞を流して、減っている最中も止まって見えないようにする */
  animation: mz-superstripe .5s linear infinite;
  transition: width .1s linear;
}
@keyframes mz-superstripe {
  to { background-position: 40px 0, 0 0; }
}

/* 残り 3 秒。色を変えて「もうすぐ切れる」を出す */
.mz-super.is-warn {
  background: linear-gradient(180deg, #ffcabb, #ef7154);
  border-color: #7a2d18;
  box-shadow: 0 5px 0 #a33b22, 0 12px 22px rgba(120, 30, 10, .38);
}
.mz-super.is-warn .mz-super__label { -webkit-text-stroke-color: #7a2d18; }
.mz-super.is-warn .mz-super__bar { background: #7a2d18; border-color: #7a2d18; }
.mz-super.is-warn .mz-super__bar i {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .3) 0 9px, rgba(255, 255, 255, 0) 9px 20px),
    linear-gradient(180deg, #ff8f76, #d62d10);
}

/* 切れたあとの減速中（このあいだは無敵）。水色にして全開と分ける */
.mz-super.is-slow {
  background: linear-gradient(180deg, #4fb0ea, #1f6ea8);
  border-color: #144d77;
  box-shadow: 0 5px 0 #14567f, 0 12px 22px rgba(10, 50, 80, .3);
}
.mz-super.is-slow .mz-super__label { -webkit-text-stroke-color: #144d77; }
.mz-super.is-slow .mz-super__bar { background: #123f60; border-color: #144d77; }
.mz-super.is-slow .mz-super__bar i {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .3) 0 9px, rgba(255, 255, 255, 0) 9px 20px),
    linear-gradient(180deg, #f2fbff, #7fd0ff);
}


/* 発動した瞬間だけ出る帯 */
.mz-boost-msg {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translate(-50%, -50%) scale(.8);
  padding: 7px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c445b0, #a4218f);
  border: 3px solid #4d0842;
  box-shadow: 0 5px 0 #7d0f6c;
  color: #fff3b0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
/* 減速に入った合図。色を変えて「全開は終わった」ことを伝える */
.mz-boost-msg.is-slow {
  background: linear-gradient(180deg, #4fb0ea, #1f6ea8);
  border-color: #144d77;
  box-shadow: 0 5px 0 #14567f;
  color: #eaf7ff;
}
.mz-boost-msg.is-on { animation: mz-boost-in .9s ease-out; }
@keyframes mz-boost-in {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  22%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}


/* 2段ジャンプが出たときのバッジ */
.mz-air {
  position: absolute;
  left: 50%;
  /* top は resize() がジャンプの頂点より上に入れる */
  top: 12%;
  transform: translate(-50%, -6px) scale(.8);
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffeaa9, #ffbe3e);
  border: 2px solid #4a2a06;
  box-shadow: 0 3px 0 #b9741a;
  color: #4a2c05;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
.mz-air.is-on { animation: mz-air-in .5s ease-out; }
@keyframes mz-air-in {
  0%   { opacity: 0; transform: translate(-50%, 4px) scale(.7); }
  25%  { opacity: 1; transform: translate(-50%, -6px) scale(1.06); }
  75%  { opacity: 1; transform: translate(-50%, -8px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -16px) scale(1); }
}

/* 加速したことを知らせる帯 */
.mz-speedup {
  position: absolute;
  left: 0;
  right: 0;
  /* top は resize() が地面の上あたりに入れる */
  top: 42%;
  text-align: center;
  color: #fff;
  font-family: "Oxanium", monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .18em;
  pointer-events: none;
  opacity: 0;
  -webkit-text-stroke: 5px #4a2a06;
  paint-order: stroke fill;
}
.mz-speedup.is-on { animation: mz-speedup .9s ease-out; }
@keyframes mz-speedup {
  0%   { opacity: 0; transform: scale(.7); }
  30%  { opacity: 1; transform: scale(1.05); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* ---------- モーダル ---------- */

.mz-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(45, 30, 12, .55);
  line-height: 1.6;
  transition: opacity .2s ease;
}
.mz-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.mz-modal {
  width: 100%;
  max-width: 360px;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 20px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(180deg, #fffaec, #fdf1d6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  animation: mz-modal-in .3s ease-out;
}
@keyframes mz-modal-in {
  0%   { opacity: 0; transform: scale(.85) translateY(10px); }
  100% { opacity: 1; transform: none; }
}

.mz-modal__eyebrow {
  font-family: "Oxanium", monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3em;
  color: var(--mz-gold-deep);
}
.mz-modal__title {
  margin: 4px 0 6px;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: .03em;
  color: var(--mz-soil-deep);
}

.mz-result {
  display: flex;
  gap: 8px;
  margin: 6px 0 14px;
}
.mz-result > div {
  flex: 1;
  padding: 12px 8px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--mz-line);
}
.mz-result dt {
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--mz-ink-soft);
}
.mz-result dd {
  font-family: "Oxanium", monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--mz-soil);
  line-height: 1.05;
}
.mz-result dd b {
  font-size: 62px;
  font-weight: 800;
  color: var(--mz-soil-deep);
  font-variant-numeric: tabular-nums;
}
.mz-result dd i {
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  opacity: .7;
}

/* 自己ベスト更新の帯 */
.mz-newbest {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--mz-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  box-shadow: 0 3px 0 var(--mz-accent-deep);
}

/* 結果画面のひとこと（敗因＋次への助言） */
.mz-advice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--mz-line);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
  color: var(--mz-soil-deep);
}

/* ---------- ボタン（ピル型） ---------- */

.mz-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mz-btn {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}

.mz-btn:focus-visible {
  outline: 3px solid #7a4708;
  outline-offset: 3px;
}

.mz-btn--primary {
  color: #4a2c05;
  background: var(--mz-gold);
  box-shadow: 0 5px 0 var(--mz-gold-deep);
}
.mz-btn--primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--mz-gold-deep);
}

/* 達成を報告。決められた距離を超えたときだけ出る（JS が hidden を外す） */
.mz-btn--report {
  color: #fff;
  background: #1f7a3d;
  box-shadow: 0 5px 0 #145c2c;
}
.mz-btn--report:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #145c2c;
}
.mz-btn[hidden] { display: none; }

/* X 共有 */
.mz-btn--x {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  color: #fff;
  background: #111;
  box-shadow: 0 5px 0 #000;
}
.mz-btn--x:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #000;
}
.mz-btn__x {
  flex: none;
  width: 16px;
  height: 16px;
  display: block;
}

.mz-btn--sub {
  font-size: 15px;
  color: #fff;
  background: #b8a894;
  box-shadow: 0 5px 0 #93836f;
}
.mz-btn--sub:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #93836f;
}

/* ==========================================================
   トップ画面
   ローディング → ロゴ → あそびかた → スタート
   ========================================================== */

.mz-app--top {
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
  max-width: 480px;         /* トップだけは開墾ランと同じ 1 カラム幅 */
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 20px calc(40px + env(safe-area-inset-bottom));
  overflow: visible;
}

/* ---------- タイトル ---------- */

/* 実画像（MZ_ASSETS.title）を入れたとき用。未設定なら hidden のまま */
.mz-logo {
  display: block;
  align-self: stretch;
  width: auto;
  max-width: none;
  margin: 0 -20px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .28));
}

/* 画像が無いあいだのタイトル（SVG）。差し替え前提なので枠ではなく
   ちゃんと読める形にしておく */
.mz-title {
  width: 100%;
  max-width: 340px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35));
}

/* 難易度ページのタイトル画面に出す「これまでの最高記録」 */
.mz-top__best {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.mz-top__foot {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- スタートボタン ---------- */

.mz-start {
  display: block;
  width: 100%;
  padding: 18px;
  background: var(--mz-gold);
  color: #4a2c05;
  font-family: inherit;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .06em;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--mz-gold-deep), 0 8px 16px rgba(0, 0, 0, .2);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.mz-start:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--mz-gold-deep), 0 4px 10px rgba(0, 0, 0, .2);
}

/* ---------- ローディング画面 ---------- */

.mz-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--mz-chrome);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  transition: opacity .4s ease;
}
.mz-loader.is-hidden { opacity: 0; pointer-events: none; }

.mz-spinner {
  width: 54px;
  height: 54px;
  border: 6px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mz-spin .9s linear infinite;
}
@keyframes mz-spin { to { transform: rotate(360deg); } }

.mz-loader__txt {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}

/* ---------- 「あそびかた」ボタン ---------- */

.mz-howto-btn {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  padding: 15px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: center;
  cursor: pointer;
  transition: transform .08s ease, background .12s ease;
}
.mz-howto-btn:active {
  transform: translateY(2px);
  background: rgba(255, 255, 255, .2);
}

/* ==========================================================
   あそびかた（スライド 3 ページ）
   ========================================================== */

.mz-tut {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(45, 30, 12, .62);
  animation: mz-tut-in .18s ease-out;
}
@keyframes mz-tut-in { from { opacity: 0; } to { opacity: 1; } }

.mz-tut__panel {
  width: 100%;
  max-width: 380px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffaec, #fdf1d6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  animation: mz-modal-in .26s ease-out;
}

.mz-tut__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.mz-tut__heading {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--mz-soil-deep);
}
.mz-tut__close {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(59, 45, 30, .1);
  color: var(--mz-ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.mz-tut__close:active { background: rgba(59, 45, 30, .2); }

/* スライドの窓 */
.mz-tut__view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}
.mz-tut__track {
  display: flex;
  height: 100%;
  will-change: transform;
}
.mz-tut__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 2px;
  text-align: left;
}
.mz-tut__slide h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 900;
  color: var(--mz-soil-deep);
}
.mz-tut__slide p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--mz-ink);
}
.mz-tut__slide b { font-weight: 900; color: var(--mz-accent-deep); }

/* スライド内の図（プレースホルダーの代わりに簡単な図を SVG で置く） */
.mz-tut__fig {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #cbbfa4;
}

/* ページ表示 */
.mz-tut__dots {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 10px;
}
.mz-tut__dot {
  appearance: none;
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(59, 45, 30, .22);
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.mz-tut__dot.is-on {
  background: var(--mz-gold-deep);
  transform: scale(1.35);
}

.mz-tut__nav {
  flex: none;
  display: flex;
  gap: 8px;
}
.mz-tut__btn {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, opacity .12s ease;
}
.mz-tut__btn--main {
  color: #4a2c05;
  background: var(--mz-gold);
  box-shadow: 0 4px 0 var(--mz-gold-deep);
}
.mz-tut__btn--main:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--mz-gold-deep);
}
.mz-tut__btn--ghost {
  color: var(--mz-ink-soft);
  background: rgba(59, 45, 30, .09);
}
.mz-tut__btn--ghost:disabled { opacity: .4; cursor: default; }

/* ---------- 画面が低いとき ---------- */
/* 横向きのスマホなど。トップバーを薄くしてプレイ画面に高さを譲る */
@media (max-height: 460px) {
  .mz-topbar { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; }
  .mz-stat { padding: 3px 4px 4px; }
  .mz-stat__label { font-size: 12px; }
  .mz-stat__value b { font-size: 21px; }
  .mz-stat--best .mz-stat__value b { font-size: 17px; }
  .mz-stage { padding: 6px; }
}

/* ---------- 難易度バッジ（各難易度ページのトップに出す） ---------- */
.mz-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(59, 47, 36, .55);
  border: 1px solid rgba(245, 176, 39, .45);
}
.mz-badge__lv {
  color: var(--mz-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}
.mz-badge__name {
  color: #fff6e2;
  font-size: 17px;
  font-weight: 900;
}

/* ---------- 難易度えらび（index.html） ---------- */
.mz-levels {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.mz-lv {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 248, 232, .95);
  border: 1px solid var(--mz-line);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
  color: var(--mz-ink);
  text-decoration: none;
  text-align: left;
  transition: transform .08s ease, box-shadow .08s ease;
}
.mz-lv:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}
.mz-lv__no {
  color: var(--mz-gold-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}
.mz-lv__name {
  font-size: 19px;
  font-weight: 900;
  color: var(--mz-soil-deep);
}
/* 難易度が上がるほど、ふち色を赤へ寄せる */
.mz-lv--2 { border-left: 5px solid #cfa22a; }
.mz-lv--3 { border-left: 5px solid #c98122; }
.mz-lv--4 { border-left: 5px solid #c2561e; }
.mz-lv--5 { border-left: 5px solid var(--mz-accent); }
.mz-lv--1 { border-left: 5px solid #9bab5a; }
