/* はめこみ絵あわせ（/ezu/・2026-11-24）: 入口はサイトの明るい地のまま、遊ぶ画面（.ez-game）は画面全体を使う
   色: 土壁 --ewall・木の額 --ewood・和紙 --epaper・文字＝こげ茶 --eink・松の緑 --egreen・朱 --ered */
:root { --ewall: #e9dcc0; --ewood: #7a4c24; --ewood2: #5a3618; --epaper: #fbf6ea; --eline: #e2cfa9; --eink: #3b2a1c; --emut: #7d6a55; --egreen: #3f7a4c; --ered: #b2462e; --egold: #f2b21b; }

/* ── 入口 ── */
.ez-top { display: grid; gap: 16px; padding-top: 8px; }
.ez-hero { position: relative; margin: 0; border-radius: 20px; overflow: hidden; background: var(--ewall); aspect-ratio: 1 / 1; max-height: 520px; box-shadow: 0 18px 40px -26px rgba(70, 45, 20, .75); }
.ez-hero canvas { display: block; width: 100%; height: 100%; }
.ez-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(233, 220, 192, 0) 70%, rgba(47, 30, 16, .72)); }
.ez-hero-cap { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 1; display: grid; gap: 2px; color: #fff; }
.ez-eb { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #ffe0a8; }
.ez-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, 20, 5, .6); }
.ez-top .lead b { color: var(--ered); }
.ez-start { display: grid; gap: 10px; }
.ez-start .btn.go { --go: #3f7a4c; --go-step: #2a5534; --go-soft: rgba(42, 85, 52, .5); }
.ez-note { font-size: 13px; color: var(--muted); }
.ez-note b { color: var(--ink); }
.ez-pick { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 4px 12px; }
.ez-pick[hidden] { display: none; }
.ez-pick summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.ez-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; padding: 4px 0 12px; max-height: 260px; overflow: auto; }
.ez-cell { display: grid; justify-items: center; gap: 1px; min-height: 48px; padding: 5px 2px 4px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 800 14px/1.2 var(--f-round); cursor: pointer; }
.ez-cell.now { border-color: var(--egreen); background: #eef6ef; }
.ez-mini { display: flex; gap: 1px; }
.ez-mini svg { width: 11px; height: 11px; }
.ez-stars svg.on, .ez-mini svg.on { fill: var(--egold); stroke: #b77a06; stroke-width: 1.4; stroke-linejoin: round; }
.ez-stars svg.off, .ez-mini svg.off { fill: rgba(120, 95, 60, .16); stroke: rgba(120, 95, 60, .25); stroke-width: 1.2; }
.ez-h2 { font-size: 20px; margin-top: 12px; }

/* 絵のアルバム（土壁に小さな額が並ぶ） */
.ez-album { display: grid; gap: 8px; }
.ez-album-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ez-album-head .ez-h2 { margin-top: 12px; }
.ez-al-count { font: 800 14px/1.2 var(--f-round); color: var(--emut); white-space: nowrap; }
.ez-album .note { margin: 0; }
.ez-al-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; padding: 14px 12px; border-radius: 16px; background: linear-gradient(180deg, #efe3cb, #e2cfad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 24px -20px rgba(70, 45, 20, .8); }
.ez-al-item { display: grid; gap: 3px; justify-items: center; align-content: start; min-width: 0; padding: 0; border: 0; background: none; color: var(--eink); font: inherit; text-align: center; cursor: pointer; }
.ez-al-item.locked { cursor: default; }
.ez-al-pic { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 7%; border-radius: 3px; background: linear-gradient(135deg, #b98149, #7a4c24 55%, #5a3618); box-shadow: 0 6px 10px -6px rgba(50, 28, 8, .7), inset 0 0 0 1px rgba(255, 226, 170, .25); }
.ez-al-pic img, .ez-al-pic i { display: block; width: 100%; height: 100%; object-fit: cover; border: 3px solid var(--epaper); background: var(--epaper); }
.ez-al-pic i { display: grid; place-items: center; font: 900 22px/1 var(--f-round); font-style: normal; color: #c7b38e; background: repeating-linear-gradient(45deg, #f3ead6, #f3ead6 6px, #ede2ca 6px, #ede2ca 12px); }
.ez-al-item b { font-size: 12px; line-height: 1.35; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: auto-phrase; }
.ez-al-item small { font-size: 11px; color: var(--emut); line-height: 1.3; }
.ez-al-item.locked b { color: var(--emut); font-weight: 700; }
@media (min-width: 560px) { .ez-al-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.ez-how { margin: 0; padding: 0; list-style: none; counter-reset: ez; display: grid; gap: 10px; }
.ez-how li { counter-increment: ez; position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 50px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.ez-how li::before { content: counter(ez); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ewood); color: #fff; font: 800 14px/1 var(--f-round); }
.ez-how b { font-size: 15.5px; }
.ez-how span { font-size: 13.5px; color: var(--ink2); line-height: 1.6; }
.ez-faq details { border-bottom: 1px solid var(--line); padding: 10px 2px; }
.ez-faq summary { cursor: pointer; font-weight: 700; }
.ez-faq p { margin-top: 6px; font-size: 14px; color: var(--ink2); }

/* 額にかかった絵（クリアの札・アルバムを大きく見る） */
.ez-wallbox { display: grid; place-items: center; padding: 6px 0 2px; border-radius: 14px; background: linear-gradient(180deg, #efe3cb, #e0cdaa); overflow: hidden; }
.ez-hang-cv { display: block; }
.ez-hang-cv.swing { animation: ez-swing 2.4s cubic-bezier(.3, .6, .3, 1) both; }
.ez-pic-name { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0; text-align: center; }
.ez-pic-name b { font: 900 19px/1.3 var(--f-round); color: var(--eink); }
.ez-season { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--egreen); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.ez-pic-line { margin: -6px 0 0; text-align: center; font-size: 13.5px; color: var(--emut); }
.ez-pic-meta { margin: -6px 0 0; text-align: center; font-size: 12.5px; color: var(--emut); }
.ez-album-new { margin: -4px 0 0; text-align: center; font-size: 13px; font-weight: 800; color: var(--egreen); }
.ez-viewer { position: fixed; inset: 0; z-index: 2147483200; display: grid; place-items: center; padding: 16px; background: rgba(47, 30, 16, .55); animation: ez-fade .2s ease-out; }
.ez-viewer-in { width: min(400px, 100%); max-height: calc(100% - 8px); overflow: auto; display: grid; gap: 12px; padding: 16px; border-radius: 20px; background: var(--epaper); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6); }
.ez-viewer .btn { min-height: 48px; color: var(--eink); }

/* ── 遊ぶ画面 ── */
html.ez-lock, html.ez-lock body { overflow: hidden; overscroll-behavior: none; }
.ez-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(--ewall); color: var(--eink); font-family: var(--f-body); line-height: 1.5; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ez-game button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.ez-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)) 7px max(10px, env(safe-area-inset-left, 0px)); background: var(--ewood2); color: #fbf1dc; }
.ez-title { display: grid; line-height: 1.2; min-width: 0; flex: 1 1 auto; }
.ez-title b { font: 800 17px/1.2 var(--f-round); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ez-title span { font-size: 12px; color: #f2cf8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ez-moves { display: flex; align-items: baseline; gap: 4px; padding: 4px 13px; border-radius: 999px; background: #fbf1dc; color: var(--eink); white-space: nowrap; }
.ez-moves b { font: 900 21px/1 var(--f-round); font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: right; }
.ez-moves span { font-size: 12px; font-weight: 700; color: var(--emut); }
.ez-menu-btn { display: grid; gap: 3px; place-content: center; flex: none; width: 40px; height: 38px; border: 1px solid rgba(251, 241, 220, .35); border-radius: 10px; background: rgba(255, 255, 255, .08); }
.ez-menu-btn i { display: block; width: 17px; height: 2px; border-radius: 2px; background: #fbf1dc; }
.ez-fieldbox { position: relative; min-height: 0; overflow: hidden; }
#ez-field { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: grab; }
#ez-field:active { cursor: grabbing; }
/* 見本の絵（押すと、かくす・見る） */
.ez-mihon { position: absolute; z-index: 1; padding: 5px; border: 0; border-radius: 4px; background: linear-gradient(135deg, #b98149, #7a4c24 55%, #5a3618); box-shadow: 0 8px 16px -8px rgba(50, 28, 8, .7); touch-action: manipulation; }
.ez-mihon img { display: block; width: 100%; height: 100%; object-fit: cover; border: 3px solid var(--epaper); background: var(--epaper); }
.ez-mihon em { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 1px 9px; border-radius: 999px; background: var(--epaper); color: var(--ewood2); font: 800 11px/1.5 var(--f-round); font-style: normal; white-space: nowrap; box-shadow: 0 2px 6px -2px rgba(50, 28, 8, .5); }
.ez-mihon-cover { position: absolute; inset: 5px; display: none; place-content: center; justify-items: center; gap: 2px; background: repeating-linear-gradient(45deg, #f3ead6, #f3ead6 6px, #ede2ca 6px, #ede2ca 12px); border: 3px solid var(--epaper); color: var(--ewood2); }
.ez-mihon-cover b { font: 800 14px/1.2 var(--f-round); }
.ez-mihon-cover small { font-size: 10.5px; color: var(--emut); }
.ez-mihon.off .ez-mihon-cover { display: grid; }
.ez-mihon.off em { display: none; }
.ez-banner { position: absolute; z-index: 2; left: 50%; top: 10px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 9px 15px; border-radius: 12px; background: rgba(63, 122, 76, .96); color: #fff; font-size: 14px; font-weight: 700; text-align: center; box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .7); pointer-events: none; animation: ez-in .25s ease-out; }
.ez-banner.hot { background: rgba(178, 64, 43, .96); }
.ez-banner[hidden] { display: none; }
.ez-toast { position: absolute; z-index: 2; 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(--eline); color: var(--eink); font-size: 13.5px; font-weight: 700; text-align: center; box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .5); pointer-events: none; }
.ez-toast[hidden] { display: none; }
.ez-toast.in { animation: ez-in .2s ease-out; }
.ez-tools { display: flex; gap: 8px; padding: 7px max(10px, env(safe-area-inset-right, 0px)) max(9px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); justify-content: center; background: var(--ewood2); }
.ez-tool { position: relative; flex: 1 1 0; max-width: 120px; min-width: 0; min-height: 54px; display: grid; justify-items: center; align-content: center; gap: 1px; padding: 6px 2px 5px; border-radius: 14px; border: 0; background: #fbf1dc; color: var(--eink); box-shadow: 0 3px 0 #b8925c; }
.ez-tool:active { transform: translateY(2px); box-shadow: 0 1px 0 #b8925c; }
.ez-tool svg { width: 26px; height: 26px; color: var(--eink); }
.ez-tool span { font-size: 12px; font-weight: 800; white-space: nowrap; }
.ez-tool em { position: absolute; top: -7px; right: -3px; min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--egreen); color: #fff; font: 800 12px/1.4 var(--f-round); font-style: normal; text-align: center; font-variant-numeric: tabular-nums; }
.ez-tool.zero { opacity: .5; }
.ez-tool.zero em { background: #8d7b63; }
.ez-tool[disabled] { opacity: .4; cursor: default; }

/* 札（メニュー・クリア） */
.ez-sheet { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 14px; background: rgba(47, 30, 16, .42); animation: ez-fade .2s ease-out; }
.ez-sheet[hidden] { display: none; }
.ez-card { width: min(420px, 100%); max-height: calc(100% - 4px); overflow: auto; padding: 18px 18px 16px; border-radius: 20px; background: var(--epaper); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6); display: grid; gap: 12px; animation: ez-up .25s ease-out; }
.ez-card h2 { font: 900 23px/1.3 var(--f-round); text-align: center; }
.ez-card .sub { font-size: 13.5px; color: var(--emut); text-align: center; margin: -4px 0 0; }
.ez-clear .ez-clear-eb { text-align: center; color: var(--egreen); font-size: 13px; letter-spacing: .08em; margin: 0 0 -8px; }
.ez-clear h2 { margin-bottom: -4px; }
.ez-stars.big { display: flex; justify-content: center; gap: 6px; }
.ez-stars.big svg { width: 44px; height: 44px; animation: ez-star .5s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.ez-stars.big svg:nth-child(2) { animation-delay: .15s; width: 52px; height: 52px; margin-top: -8px; }
.ez-stars.big svg:nth-child(3) { animation-delay: .3s; }
.ez-big { text-align: center; margin-top: -4px; }
.ez-big b { font: 900 50px/1 var(--f-round); font-variant-numeric: tabular-nums; color: var(--ered); }
.ez-big span { font-size: 16px; font-weight: 800; margin-left: 4px; }
.ez-best { text-align: center; font-size: 13.5px; font-weight: 700; color: #2f8f5f; margin: 0; }
.ez-acts { display: grid; gap: 8px; }
.ez-acts .btn { min-height: 48px; font: 700 16px/1.3 var(--f-round); color: var(--eink); }
.ez-acts .btn.ez-main { background: var(--egreen); color: #fff; box-shadow: 0 4px 0 #2a5534; }
.ez-menu-list { display: grid; gap: 8px; }
.ez-menu-list button { min-height: 48px; border-radius: 12px; border: 1px solid var(--eline); background: #fff; font-weight: 700; }
.ez-help { display: grid; gap: 8px; font-size: 13.5px; line-height: 1.6; }
.ez-help p { margin: 0; }
/* 共有のかたまり（../js/share.js の shareBlock）。札の中なので、上の余白をつめて見出しを小さく左に
   .ez-game button の font: inherit・color: inherit が、共有の部品のボタンの字に効かないように戻す */
.ez-sharebox .section { margin-top: 2px; gap: 10px; }
.ez-sharebox .share > h2 { font: 800 15px/1.3 var(--f-round); text-align: left; }
.ez-sharebox .btn { min-height: 50px; color: #fff; font: 700 16px/1.3 var(--f-round); }
.ez-sharebox .seg button { font: 700 13px/1.5 var(--f-body); }
.ez-sharebox .share-apps { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); }
.ez-sharebox .seg button:not([aria-pressed="true"]) { color: var(--emut); }
/* 全画面のゲームの上に出す: 知らせ（.toast）と、画像を長押しで保存する窓（.share-sheet・アプリの中のブラウザ） */
.ez-lock .toast, .ez-lock .share-sheet { z-index: 2147483100; }
.ez-lock .pc-cols .toast { left: 50%; }

@keyframes ez-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ez-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ez-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ez-star { from { opacity: 0; transform: scale(.2) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes ez-swing { 0% { transform: rotate(-7deg); } 30% { transform: rotate(4.5deg); } 55% { transform: rotate(-2.2deg); } 78% { transform: rotate(1deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .ez-banner, .ez-toast.in, .ez-card, .ez-sheet, .ez-viewer, .ez-stars.big svg, .ez-hang-cv.swing { animation: none; } }

@media (max-width: 360px) {
  .ez-hud { gap: 6px; }
  .ez-title b { font-size: 15.5px; }
  .ez-title span { font-size: 11px; }
  .ez-moves { padding: 4px 10px; }
  .ez-moves b { font-size: 19px; }
  .ez-menu-btn { width: 36px; }
  .ez-tool span { font-size: 11px; }
}
@media (min-width: 700px) {
  .ez-tools { gap: 12px; }
  .ez-tool { max-width: 140px; }
  .ez-hero { aspect-ratio: 4 / 3; }
}
