/* 渋滞させるな！（/jutai/・2026-11-17）: 入口はサイトの明るい地のまま、遊ぶ画面（.mc-game）は画面全体を使う
   色: 地図の外＝生成り --mbg・文字＝こげ茶 --mink・選んでいる道具＝こげ茶の地に白。建物の色は site/js/michi/draw.js の COLORS */
:root { --mbg: #efe8d8; --mpanel: #fffaf0; --mline: #ddd2bb; --mink: #3b352c; --mmut: #7b715f; --mhot: #e0352b; }

/* ── 入口 ── */
.mc-top { display: grid; gap: 16px; padding-top: 8px; }
.mc-hero { position: relative; margin: 0; border-radius: 20px; overflow: hidden; background: var(--mbg); aspect-ratio: 16 / 10; box-shadow: 0 18px 40px -26px rgba(60, 50, 30, .7); }
.mc-hero canvas { display: block; width: 100%; height: 100%; }
.mc-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(239, 232, 216, 0) 50%, rgba(59, 53, 44, .72)); }
.mc-hero-cap { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; display: grid; gap: 2px; color: #fff; }
.mc-eb { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #ffe3a3; }
.mc-hero-cap b { font-family: var(--f-round); font-size: clamp(28px, 8.5vw, 42px); line-height: 1.15; letter-spacing: .04em; text-shadow: 0 2px 16px rgba(40, 30, 10, .5); }
.mc-top .lead b { color: #b8361d; }
.mc-start { display: grid; gap: 10px; }
.mc-start .btn.go { --go: #2f8f5f; --go-step: #1c5e3c; --go-soft: rgba(28, 94, 60, .5); }
.mc-note { font-size: 13px; color: var(--muted); }
.mc-note b { color: var(--ink); }
.mc-h2 { font-size: 20px; margin-top: 12px; }
.mc-how { margin: 0; padding: 0; list-style: none; counter-reset: mc; display: grid; gap: 10px; }
.mc-how li { counter-increment: mc; position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 50px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.mc-how li::before { content: counter(mc); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #2f8f5f; color: #fff; font: 800 14px/1 var(--f-round); }
.mc-how b { font-size: 15.5px; }
.mc-how span { font-size: 13.5px; color: var(--ink2); line-height: 1.6; }
.mc-how span b { font-size: inherit; }
.mc-faq details { border-bottom: 1px solid var(--line); padding: 10px 2px; }
.mc-faq summary { cursor: pointer; font-weight: 700; }
.mc-faq p { margin-top: 6px; font-size: 14px; color: var(--ink2); }

/* ── 遊ぶ画面 ── */
html.mc-lock, html.mc-lock body { overflow: hidden; overscroll-behavior: none; }
.mc-game { position: fixed; inset: 0; z-index: 2147483000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); background: var(--mbg); color: var(--mink); font-family: var(--f-body); line-height: 1.5; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.mc-game[hidden] { display: none; }
.mc-game button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.mc-hud { display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 6px max(10px, env(safe-area-inset-left, 0px)); }
.mc-clock { display: grid; line-height: 1.15; min-width: 0; }
.mc-clock b { font: 800 17px/1.15 var(--f-round); white-space: nowrap; }
.mc-clock span { font-size: 11.5px; color: var(--mmut); white-space: nowrap; }
.mc-dayline { display: block; position: relative; width: 64px; height: 4px; margin-top: 3px; border-radius: 4px; background: var(--mline); overflow: hidden; }
.mc-dayline i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--mink); border-radius: 4px; }
.mc-score { margin-left: auto; display: flex; align-items: baseline; gap: 5px; padding: 5px 11px; border-radius: 999px; background: var(--mpanel); border: 1px solid var(--mline); white-space: nowrap; }
.mc-score b { font: 800 19px/1 var(--f-round); font-variant-numeric: tabular-nums; }
.mc-score span { font-size: 11.5px; color: var(--mmut); }
.mc-score.pop b { animation: mc-pop .3s ease-out; }
.mc-speed { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--mline); background: var(--mpanel); }
.mc-speed button { border: 0; background: none; width: 36px; height: 34px; display: grid; place-items: center; padding: 0; }
.mc-speed button[aria-checked="true"] { background: var(--mink); color: #fff; }
.mc-speed svg { width: 16px; height: 16px; fill: currentColor; }
.mc-speed .mc-fast { width: 48px; grid-auto-flow: column; gap: 2px; place-content: center; }
.mc-speed .mc-fast svg { width: 15px; height: 15px; }
.mc-x { font: 800 11.5px/1 var(--f-round); font-style: normal; font-variant-numeric: tabular-nums; min-width: 1.9em; text-align: left; }
/* せまい画面: 「運んだ」を消し、すきまを詰めて1行に（tools/test/michi-flow.mjs が幅320〜430で、いちばん長い表示「第15週・9999人・×8」を測る） */
@media (max-width: 380px) {
  .mc-hud { gap: 6px; }
  .mc-score { padding: 5px 9px; gap: 3px; }
  .mc-score span:first-child { display: none; }
  .mc-speed button { width: 32px; }
  .mc-speed .mc-fast { width: 44px; }
  .mc-menu-btn { width: 34px; }
}
@media (max-width: 340px) {
  .mc-hud { padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
  .mc-clock b { font-size: 15px; }
  .mc-dayline { width: 48px; }
  .mc-score b { font-size: 17px; }
  .mc-speed button { width: 30px; }
  .mc-speed .mc-fast { width: 42px; }
  .mc-menu-btn { width: 32px; }
}
.mc-menu-btn { display: grid; gap: 3px; place-content: center; width: 36px; height: 36px; border: 1px solid var(--mline); border-radius: 10px; background: var(--mpanel); }
.mc-menu-btn i { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--mink); }
.mc-mapbox { position: relative; min-height: 0; overflow: hidden; }
#mc-map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: crosshair; }
.mc-banner { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 12px; background: rgba(59, 53, 44, .92); color: #fff; font-size: 13.5px; font-weight: 700; text-align: center; box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .7); pointer-events: none; animation: mc-in .25s ease-out; }
.mc-banner.hot { background: rgba(224, 53, 43, .95); }
.mc-banner[hidden] { display: none; }
.mc-banner i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; border: 2px solid #fff; }
.mc-toast { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 12px; background: rgba(255, 250, 240, .97); border: 1px solid var(--mline); color: var(--mink); font-size: 13.5px; font-weight: 700; text-align: center; box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .5); pointer-events: none; }
.mc-toast[hidden] { display: none; }
.mc-toast.in { animation: mc-in .2s ease-out; }
.mc-tools { display: flex; gap: 6px; padding: 6px max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); justify-content: center; }
.mc-tool { position: relative; flex: 1 1 0; max-width: 96px; min-width: 0; display: grid; justify-items: center; gap: 1px; padding: 7px 2px 6px; border-radius: 14px; border: 1.5px solid var(--mline); background: var(--mpanel); }
.mc-tool svg { width: 26px; height: 26px; }
.mc-tool span { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.mc-tool em { position: absolute; top: -7px; right: -2px; min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--mink); color: #fff; font: 800 12px/1.4 var(--f-round); font-style: normal; text-align: center; font-variant-numeric: tabular-nums; }
.mc-tool[aria-pressed="true"] { background: var(--mink); border-color: var(--mink); color: #fff; }
.mc-tool[aria-pressed="true"] em { background: #ffd23a; color: var(--mink); }
.mc-tool.zero { opacity: .45; }
.mc-tool.zero em { background: var(--mhot); }
.mc-tool.info { cursor: default; background: transparent; border-style: dashed; }
.mc-tool.bump em { animation: mc-pop .35s ease-out 2; }

/* 週のおくりもの・おわり・メニュー（地図の上の札） */
.mc-sheet { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(59, 53, 44, .42); animation: mc-fade .2s ease-out; }
.mc-sheet[hidden] { display: none; }
.mc-card { width: min(420px, 100%); max-height: calc(100% - 8px); overflow: auto; padding: 18px 18px 16px; border-radius: 20px; background: var(--mpanel); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6); display: grid; gap: 12px; animation: mc-up .25s ease-out; }
.mc-card h2 { font: 800 21px/1.3 var(--f-round); text-align: center; }
.mc-card .sub { font-size: 14px; color: var(--mmut); text-align: center; }
.mc-gift { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px dashed var(--mline); font-weight: 700; }
.mc-gift svg { width: 24px; height: 24px; flex: none; }
.mc-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mc-choice { display: grid; justify-items: center; gap: 4px; padding: 14px 8px 12px; border-radius: 16px; border: 2px solid var(--mline); background: #fff; text-align: center; transition: transform .08s; }
.mc-choice:active { transform: scale(.97); }
.mc-choice svg { width: 44px; height: 44px; }
.mc-choice b { font: 800 16px/1.2 var(--f-round); }
.mc-choice small { font-size: 12px; color: var(--mmut); line-height: 1.45; }
@media (hover: hover) { .mc-choice:hover { border-color: var(--mink); } }
.mc-big { text-align: center; }
.mc-big b { font: 900 54px/1 var(--f-round); font-variant-numeric: tabular-nums; }
.mc-big span { font-size: 16px; font-weight: 700; margin-left: 4px; }
.mc-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--mmut); }
.mc-facts b { color: var(--mink); }
.mc-best { text-align: center; font-size: 13.5px; font-weight: 700; color: #2f8f5f; }
.mc-place { text-align: center; font-size: 14px; color: var(--mmut); margin: -4px 0 0; }
.mc-place b { display: inline-block; margin-left: 2px; padding: 2px 10px; border-radius: 999px; background: var(--mink); color: #fff; font: 800 15px/1.5 var(--f-round); font-variant-numeric: tabular-nums; }
.mc-place[hidden] { display: none; }
/* 共有のかたまり（../js/share.js の shareBlock・2026-11-18 画像と町が育つ動画）。札の中なので、上の余白をつめて見出しを小さく左に
   .mc-game button の font: inherit・color: inherit が、共有の部品のボタンの字に効かないように戻す */
.mc-sharebox:empty { display: none; }
.mc-sharebox .section { margin-top: 2px; gap: 10px; }
.mc-sharebox .share > h2 { font: 800 15px/1.3 var(--f-round); text-align: left; }
.mc-sharebox .btn { min-height: 50px; color: #fff; font: 700 16px/1.3 var(--f-round); }
.mc-sharebox .seg button { font: 700 13px/1.5 var(--f-body); }
.mc-sharebox .share-apps { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); } /* 札の中はせまいので2つずつ（3つだと「リンクをコピー」が折れた） */
.mc-sharebox .seg button:not([aria-pressed="true"]) { color: var(--mmut); }
/* 全画面のゲームの上に出す: 知らせ（.toast）と、画像を長押しで保存する窓（.share-sheet・アプリの中のブラウザ） */
.mc-lock .toast, .mc-lock .share-sheet { z-index: 2147483100; }
.mc-lock .pc-cols .toast { left: 50%; }
.mc-acts { display: grid; gap: 8px; }
.mc-acts .btn { min-height: 48px; font-size: 16px; }
.mc-acts .btn.mc-main { background: #2f8f5f; color: #fff; }
.mc-menu-list { display: grid; gap: 8px; }
.mc-menu-list button { min-height: 48px; border-radius: 12px; border: 1px solid var(--mline); background: #fff; font-weight: 700; }
.mc-help { display: grid; gap: 8px; font-size: 13.5px; line-height: 1.6; }
.mc-help p { margin: 0; }

@keyframes mc-pop { 0% { transform: scale(1.35); } 100% { transform: none; } }
@keyframes mc-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes mc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mc-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mc-banner, .mc-toast.in, .mc-card, .mc-sheet, .mc-score.pop b, .mc-tool.bump em { animation: none; } }

/* 横向き・パソコン: 道具は右の列に */
@media (orientation: landscape) and (min-width: 700px) {
  .mc-game { grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) auto; }
  .mc-hud { grid-column: 1 / -1; }
  .mc-tools { flex-direction: column; justify-content: center; padding: 8px max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) 4px; }
  .mc-tool { flex: 0 0 auto; width: 84px; max-width: none; padding: 10px 4px 8px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .mc-hud { padding-top: max(4px, env(safe-area-inset-top, 0px)); padding-bottom: 2px; }
  .mc-tools { gap: 4px; }
  .mc-tool { width: 70px; padding: 5px 2px 4px; }
  .mc-tool svg { width: 20px; height: 20px; }
}
