/* えんそくバス（/ensoku/・2026-11-24）: 入口はサイトの明るい地のまま、遊ぶ画面（.ek-game）は画面全体を使う
   色: 遊ぶ画面の地＝草の色 --ekbg（canvas の草地とそろえる）・札＝生成り --ekpanel・文字＝こげ茶 --ekink */
:root { --ekbg: #cfe3a6; --ekpanel: #fffaf0; --ekline: #ddd2bb; --ekink: #3b352c; --ekmut: #7b715f; --ekhot: #e0352b; --ekgo: #e9503f; }

/* ── 入口 ── */
.ek-top { display: grid; gap: 16px; padding-top: 8px; }
.ek-hero { position: relative; margin: 0; border-radius: 20px; overflow: hidden; background: var(--ekbg); aspect-ratio: 16 / 10; box-shadow: 0 18px 40px -26px rgba(60, 50, 30, .7); }
.ek-hero canvas { display: block; width: 100%; height: 100%; }
.ek-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(207, 227, 166, 0) 58%, rgba(59, 53, 44, .7)); }
.ek-hero-cap { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 1; display: grid; gap: 2px; color: #fff; }
.ek-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #ffe3a3; }
.ek-hero-cap b { font-family: var(--f-round); font-size: clamp(28px, 8.5vw, 42px); line-height: 1.15; letter-spacing: .06em; text-shadow: 0 2px 16px rgba(40, 30, 10, .5); }
.ek-top .lead b { color: #c2412f; }
.ek-start { display: grid; gap: 10px; }
.ek-start .btn.go { --go: #e9503f; --go-step: #a8302a; --go-soft: rgba(168, 48, 42, .5); }
.ek-note { font-size: 13px; color: var(--muted); }
.ek-note b { color: var(--ink); }
.ek-note span { display: block; margin-bottom: 2px; }
.ek-pick { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 10px 12px; }
.ek-pick[hidden] { display: none; }
.ek-pick summary { cursor: pointer; font-weight: 700; }
.ek-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin-top: 10px; max-height: 260px; overflow: auto; }
.ek-pick-b { display: grid; justify-items: center; gap: 0; padding: 6px 2px 4px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; color: var(--ink); cursor: pointer; min-height: 48px; }
.ek-pick-b b { font: 800 16px/1.2 var(--f-round); }
.ek-pick-b span { font-size: 10.5px; color: #e0a400; letter-spacing: -.05em; min-height: 1.2em; }
.ek-pick-b.now { border-color: #e9503f; box-shadow: 0 0 0 2px rgba(233, 80, 63, .25) inset; }
.ek-pick-b.now span { color: #e9503f; }
.ek-h2 { font-size: 20px; margin-top: 12px; }
.ek-how { margin: 0; padding: 0; list-style: none; counter-reset: ek; display: grid; gap: 10px; }
.ek-how li { counter-increment: ek; position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 50px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.ek-how li::before { content: counter(ek); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e9503f; color: #fff; font: 800 14px/1 var(--f-round); }
.ek-how b { font-size: 15.5px; }
.ek-how span { font-size: 13.5px; color: var(--ink2); line-height: 1.6; }
.ek-how span b { font-size: inherit; }
.ek-faq details { border-bottom: 1px solid var(--line); padding: 10px 2px; }
.ek-faq summary { cursor: pointer; font-weight: 700; }
.ek-faq p { margin-top: 6px; font-size: 14px; color: var(--ink2); }

/* ── 遊ぶ画面 ── */
html.ek-lock, html.ek-lock body { overflow: hidden; overscroll-behavior: none; }
.ek-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(--ekbg); color: var(--ekink); font-family: var(--f-body); line-height: 1.5; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.ek-game[hidden] { display: none; }
.ek-game button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.ek-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)); background: var(--ekpanel); border-bottom: 1px solid var(--ekline); }
.ek-stage { display: grid; line-height: 1.15; min-width: 0; }
.ek-stage b { font: 800 16px/1.2 var(--f-round); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-stage span { font-size: 12px; color: var(--ekmut); font-variant-numeric: tabular-nums; }
.ek-left { margin-left: auto; position: relative; display: flex; align-items: baseline; gap: 4px; padding: 5px 12px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--ekline); white-space: nowrap; }
.ek-left b { font: 800 19px/1 var(--f-round); font-variant-numeric: tabular-nums; min-width: 1.4em; text-align: right; }
.ek-left span { font-size: 11.5px; color: var(--ekmut); }
.ek-bar { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 3px; border-radius: 3px; background: var(--ekline); overflow: hidden; }
.ek-bar i { display: block; height: 100%; width: 0; background: #e9503f; border-radius: 3px; transition: width .3s; }
.ek-menu-btn { display: grid; gap: 3px; place-content: center; width: 40px; height: 40px; border: 1px solid var(--ekline); border-radius: 12px; background: #fff; }
.ek-menu-btn i { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--ekink); }
.ek-mapbox { position: relative; min-height: 0; overflow: hidden; }
#ek-map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: pointer; }
.ek-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; line-height: 1.5; box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .7); pointer-events: none; animation: ek-in .25s ease-out; }
.ek-banner[hidden] { display: none; }
.ek-toast { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 32px); padding: 9px 15px; border-radius: 12px; background: rgba(255, 250, 240, .97); border: 1px solid var(--ekline); color: var(--ekink); font-size: 13.5px; font-weight: 700; text-align: center; box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .5); pointer-events: none; }
.ek-toast[hidden] { display: none; }
.ek-toast.in { animation: ek-pop .22s ease-out; }
.ek-tools { display: flex; gap: 8px; padding: 6px max(10px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); justify-content: center; background: var(--ekpanel); border-top: 1px solid var(--ekline); }
.ek-tool { position: relative; flex: 1 1 0; max-width: 120px; min-width: 0; min-height: 52px; display: grid; justify-items: center; align-content: center; gap: 1px; padding: 6px 2px 5px; border-radius: 14px; border: 1.5px solid var(--ekline); background: #fff; }
.ek-tool svg { width: 26px; height: 26px; }
.ek-tool span { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ek-tool em { position: absolute; top: -7px; right: -2px; min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--ekink); color: #fff; font: 800 12px/1.4 var(--f-round); font-style: normal; text-align: center; }
.ek-tool.zero { opacity: .45; }
.ek-tool.zero em { background: var(--ekhot); }
.ek-tool:active { transform: scale(.97); }

/* 札（メニュー・クリア・おしまい） */
.ek-sheet { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 14px; background: rgba(59, 53, 44, .42); animation: ek-fade .2s ease-out; }
.ek-sheet[hidden] { display: none; }
.ek-card { width: min(420px, 100%); max-height: calc(100% - 8px); overflow: auto; padding: 18px 18px 16px; border-radius: 20px; background: var(--ekpanel); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6); display: grid; gap: 12px; animation: ek-up .25s ease-out; }
.ek-card h2 { font: 800 22px/1.3 var(--f-round); text-align: center; }
.ek-card .sub { font-size: 14px; color: var(--ekmut); text-align: center; margin: 0; }
.ek-chip { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--c); color: #fff; border: 1.5px solid var(--d); font-weight: 800; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.ek-eb { margin: 0 0 -8px; text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--ekmut); }
.ek-clear h2 { font-size: 34px; color: #d8392b; letter-spacing: .06em; }
.ek-stars { display: flex; justify-content: center; gap: 10px; margin-top: -4px; }
.ek-stars i { width: 44px; height: 44px; background: #e6dccb; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.ek-stars i.on { background: #ffc53a; animation: ek-star .45s calc(var(--k) * .18s + .1s) ease-out both; }
.ek-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--ekmut); }
.ek-facts b { color: var(--ekink); font-variant-numeric: tabular-nums; }
.ek-why { margin: -4px 0 0; text-align: center; font-size: 12.5px; color: var(--ekmut); }
.ek-best { margin: 0; text-align: center; font-size: 13.5px; font-weight: 700; color: #2f8f5f; }
.ek-acts { display: grid; gap: 8px; }
.ek-acts .btn { min-height: 48px; font-size: 16px; }
.ek-acts .btn.ek-main { background: var(--ekgo); color: #fff; }
.ek-menu-list { display: grid; gap: 8px; }
.ek-menu-list button { min-height: 48px; border-radius: 12px; border: 1px solid var(--ekline); background: #fff; font-weight: 700; }
.ek-help { display: grid; gap: 8px; font-size: 13.5px; line-height: 1.6; }
.ek-help p { margin: 0; }
/* 共有のかたまり（../js/share.js の shareBlock）。札の中なので見出しを小さく左に。.ek-game button の font・color が共有のボタンに効かないように戻す */
.ek-sharebox:empty { display: none; }
.ek-sharebox .section { margin-top: 2px; gap: 10px; }
.ek-sharebox .share > h2 { font: 800 15px/1.3 var(--f-round); text-align: left; }
.ek-sharebox .btn { min-height: 50px; color: #fff; font: 700 16px/1.3 var(--f-round); }
.ek-sharebox .seg button { font: 700 13px/1.5 var(--f-body); }
.ek-sharebox .share-apps { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); }
.ek-sharebox .seg button:not([aria-pressed="true"]) { color: var(--ekmut); }
.ek-lock .toast, .ek-lock .share-sheet { z-index: 2147483100; }
.ek-lock .pc-cols .toast { left: 50%; }

@keyframes ek-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ek-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes ek-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ek-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ek-star { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.25) rotate(8deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .ek-banner, .ek-toast.in, .ek-card, .ek-sheet, .ek-stars i.on { animation: none; } .ek-bar i { transition: none; } }

/* 横向き・パソコン: 道具は右の列に */
@media (orientation: landscape) and (min-width: 700px) {
  .ek-game { grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) auto; }
  .ek-hud { grid-column: 1 / -1; }
  .ek-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)) 8px; border-top: 0; border-left: 1px solid var(--ekline); }
  .ek-tool { flex: 0 0 auto; width: 92px; max-width: none; padding: 10px 4px 8px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ek-hud { padding-top: max(4px, env(safe-area-inset-top, 0px)); padding-bottom: 3px; }
  .ek-tools { gap: 4px; }
  .ek-tool { width: 76px; min-height: 44px; padding: 5px 2px 4px; }
  .ek-tool svg { width: 20px; height: 20px; }
}
@media (max-width: 360px) {
  .ek-hud { gap: 6px; }
  .ek-stage b { font-size: 14.5px; }
  .ek-left { padding: 5px 9px 8px; }
  .ek-tool span { font-size: 10.5px; }
}
