/* ui11：模様がえの画面と遊びの算数の紙。押す物は 54px（iPhone 横の縮みでも実寸44pt以上） */
.decor-mode .decor-top { position:absolute; left:22px; top:18px; display:flex; align-items:center; gap:16px; padding:10px 22px; border-radius:26px; background:#fff8e8; box-shadow:0 3px #e2cfab; font-size:20px; color:#3b2f2a; pointer-events:auto; }
.decor-mode .decor-top b { color:var(--teal2); font-size:22px; }
.decor-mode .decor-wallet { display:flex; align-items:center; gap:6px; font-size:18px; }
.decor-mode .decor-wallet b { font-size:20px; }
.jar-mini { display:inline-block; width:22px; height:26px; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 40'%3E%3Crect x='9' y='2' width='16' height='6' rx='2' fill='%23c9a24a'/%3E%3Cpath d='M8 9h18c4 4 5 9 5 15 0 8-5 14-14 14S3 32 3 24c0-6 1-11 5-15z' fill='%23e8f1ee' stroke='%232f6f73' stroke-width='2'/%3E%3Ccircle cx='13' cy='30' r='4' fill='%23e2b85c'/%3E%3Ccircle cx='21' cy='31' r='4' fill='%23d9a443'/%3E%3C/svg%3E") center / contain no-repeat; }
.decor-mode .decor-done { position:absolute; right:22px; top:16px; min-width:120px; height:56px; padding:0 24px; border:0; border-radius:28px; background:var(--teal); color:#fff; font-size:20px; font-weight:800; box-shadow:0 4px #1d4a4c; }
.decor-mode .decor-say { position:absolute; left:50%; transform:translateX(-50%); top:84px; max-width:640px; display:flex; align-items:center; gap:12px; padding:12px 22px 12px 12px; border-radius:20px; background:#fffaf0; box-shadow:0 4px #d8c6a4,0 12px 20px #28190a33; font-size:20px; line-height:1.45; z-index:14; pointer-events:none; }
.decor-mode .decor-say[hidden] { display:none; }
.decor-mode .decor-say .bust { --edge: 2px; }
/* 下の帳 */
.decor-mode .decor-book { position:absolute; left:16px; right:16px; bottom:8px; height:176px; display:flex; flex-direction:column; gap:6px; pointer-events:auto; z-index:13; }
.decor-mode .decor-tabs { display:flex; gap:6px; }
.decor-mode .decor-tabs[hidden] { display:none; }
.decor-mode .decor-tab { flex:1; height:46px; border:0; border-radius:14px 14px 6px 6px; background:#efe3c9; color:#6b543c; font-size:18px; font-weight:700; box-shadow:inset 0 -3px #dccaa6; }
.decor-mode .decor-tab.on { background:#fffaf0; color:var(--teal2); box-shadow:inset 0 0 0 2px #b9d6cc; }
.decor-mode .decor-shelf { position:relative; flex:1; min-height:0; border-radius:12px; background:var(--grain, none), #fffaf0; box-shadow:inset 0 0 0 1px rgba(160,120,70,.18), 0 3px #e2cfab; padding:6px 10px; display:flex; flex-direction:column; gap:4px; overflow:hidden; }
.decor-mode .decor-hint { margin:0; font-size:14px; color:#7a6656; line-height:1.3; }
.decor-mode .decor-row { display:flex; gap:8px; overflow-x:auto; overflow-y:hidden; padding-bottom:2px; flex:1; align-items:stretch; scrollbar-width:none; }
.decor-mode .decor-row::-webkit-scrollbar { display:none; }
.decor-mode .decor-card { flex:none; width:142px; min-height:72px; padding:2px 4px 4px; border:0; border-radius:12px; background:#f6efdf; box-shadow:inset 0 0 0 2px #e4d4b2; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; font-size:13px; color:#3b2f2a; line-height:1.2; }
.decor-mode .decor-card.wide { width:220px; justify-content:center; font-size:17px; gap:6px; }
.decor-mode .decor-card[aria-disabled="true"], .decor-mode .decor-card:disabled { opacity:.55; }
.decor-mode .decor-card b { font-weight:700; font-size:12px; max-width:100%; line-height:1.15; text-align:center; }
.decor-mode .decor-card i { font-style:normal; font-size:12px; color:#7a6656; }
.decor-mode .decor-card .decor-price { color:var(--teal2); font-weight:800; font-size:14px; display:flex; align-items:center; gap:3px; }
.decor-mode .decor-card .decor-own { color:#9a6f48; }
.decor-mode .decor-pic { width:72px; height:32px; display:flex; align-items:flex-end; justify-content:center; }
.decor-mode .decor-pic img { max-width:100%; max-height:100%; object-fit:contain; display:block; }
.decor-mode .decor-kinds { display:flex; gap:6px; align-items:center; }
.decor-mode .decor-tab.back { flex:0 0 auto; padding:0 16px; background:#e6efe9; color:var(--teal2); }
.decor-mode .decor-kind { height:30px; min-width:58px; padding:0 10px; border:0; border-radius:15px; background:#efe3c9; color:#6b543c; font-size:14px; font-weight:700; }
.decor-mode .decor-kind.on { background:var(--teal); color:#fff; }
.decor-mode .decor-seller { margin-left:auto; font-size:14px; color:#7a6656; }
/* 持ち上げている間の操作 */
.decor-mode .decor-held { position:absolute; inset:6px 10px; display:flex; align-items:center; justify-content:center; gap:10px; background:#fffaf0; }
.decor-mode .decor-held-name { font-size:18px; font-weight:800; color:#3b2f2a; margin-right:8px; max-width:200px; }
.decor-mode .decor-pad { display:grid; grid-template-columns:repeat(4,56px); gap:6px; }
.decor-mode .decor-pad button svg { width:26px; height:26px; display:block; margin:auto; }
.decor-mode .decor-pad button, .decor-mode .decor-act { height:56px; border:0; border-radius:14px; background:#eef6f2; color:var(--teal2); font-size:20px; font-weight:800; box-shadow:inset 0 0 0 2px #b9d6cc; }
.decor-mode .decor-act { padding:0 20px; }
.decor-mode .decor-act.main { background:var(--teal); color:#fff; box-shadow:0 4px #1d4a4c; }
.decor-mode .decor-act.main:disabled { background:#cfd9d4; color:#fff; box-shadow:none; }
.decor-mode .decor-act.quiet { background:#f6efdf; color:#7a6656; box-shadow:inset 0 0 0 2px #e4d4b2; }
/* お店の中：押す所・光るます・印 */
.decor-mode .decor-hit { position:absolute; min-width:54px; min-height:54px; border:0; background:transparent; border-radius:16px; z-index:10; }
.decor-mode .decor-hit:focus-visible { outline:3px solid #fff6c8; }
.decor-mode .paper-world .decor-cell { cursor:pointer; transition:background .15s; }
.decor-mode .decor-spot { position:absolute; width:54px; height:54px; border-radius:50%; border:3px dashed rgba(255,255,255,.7); background:rgba(255,255,255,.12); z-index:11; padding:0; }
.decor-mode .decor-spot.lit { border:3px solid #fff6c8; background:rgba(255,236,160,.55); box-shadow:0 0 0 4px rgba(255,236,160,.35), 0 0 18px #fff3b0; }
.decor-mode .decor-spot:disabled { display:none; }
.decor-mode .decor-wallpick { position:absolute; width:140px; height:54px; border:0; border-radius:27px; background:rgba(255,250,235,.94); color:var(--teal2); font-size:18px; font-weight:800; box-shadow:0 0 0 4px rgba(255,236,160,.6), 0 4px 10px #0003; z-index:11; }
.paper-scene .lifted > img, .paper-scene .lifted > .side3 img { filter:drop-shadow(0 0 5px #fff6c8) drop-shadow(0 0 2px #fff) drop-shadow(0 14px 8px rgba(40,25,10,.35)); }
.paper-scene .lifted { translate:0 -12px; }
.paper-scene .lifted.blocked > img, .paper-scene .lifted.blocked > .side3 img { filter:drop-shadow(0 0 3px #e0573c) drop-shadow(0 0 8px #e0573c) sepia(.4) saturate(1.4) hue-rotate(-18deg) opacity(.8); }
@media (prefers-reduced-motion: no-preference) { .paper-scene .lifted { animation:decor-bob 1.4s ease-in-out infinite; } }
@keyframes decor-bob { 50% { translate:0 -18px; } }
/* 背の低い画面（iPhone 横 900×470）：場面を少し小さく上へ、帳は下 */
.compact .decor-mode .paper-scene { transform:translate(64px,-44px) scale(.52); }
.compact .decor-mode .decor-top { left:10px; top:6px; padding:6px 14px; font-size:16px; }
.compact .decor-mode .decor-top b { font-size:18px; }
.compact .decor-mode .decor-done { right:10px; top:6px; height:54px; min-width:104px; font-size:18px; }

.compact .decor-mode .decor-book { left:8px; right:8px; bottom:4px; height:166px; gap:4px; }
.compact .decor-mode .decor-hint { display:none; }
.compact .decor-mode .decor-tab { height:54px; font-size:15px; }
.compact .decor-mode .decor-card { min-height:0; }
.compact .decor-mode .decor-pic { height:26px; }
.compact .decor-mode .decor-card { width:118px; }

/* ---- 遊びの算数の紙 ---- */
.pm-veil { position:absolute; inset:0; z-index:40; background:rgba(40,30,20,.32); display:flex; align-items:center; justify-content:center; pointer-events:auto; }
.pm-card { position:relative; width:760px; max-height:780px; padding:18px 22px 16px; border-radius:18px; background:var(--grain, none), #fffaf0; box-shadow:0 5px #d8c6a4, 0 20px 40px #0005; display:flex; flex-direction:column; gap:10px; }
.pm-head { display:flex; gap:14px; align-items:center; }
.pm-head .bust { --edge: 2.5px; }
.pm-head small { font-size:15px; color:#7a6656; }
.pm-prompt { margin:2px 0 0; font-size:22px; line-height:1.5; color:#3b2f2a; font-weight:700; }
.pm-body { display:grid; grid-template-columns:1fr 250px; grid-template-rows:auto auto; gap:8px 16px; }
.pm-fig { grid-column:1; justify-self:center; height:auto; max-height:260px; }
.pm-paper { fill:#f3ead6; stroke:#7a6656; stroke-width:3; }
.pm-tile { fill:transparent; stroke:#d8c7ae; stroke-width:1.5; }
.pm-tile.on { fill:#bad6cf; stroke:#5f8f88; }
.pm-board { fill:#c49a6c; }
.pm-dot { fill:#f0d9a6; stroke:#a8865a; stroke-width:2; }
.pm-dot.on { fill:#e8bd75; stroke:#7a5a3a; }
.pm-note { grid-column:1; margin:0; font-size:15px; color:#7a6656; text-align:center; }
.pm-formula { grid-column:1; margin:0; font-size:28px; font-weight:800; text-align:center; color:#3b2f2a; letter-spacing:.05em; }
.pm-column { grid-column:1; width:100%; max-height:300px; }
.pm-column .cell { fill:#fff; stroke:#a89377; stroke-width:2; }
.pm-column .cell.active { stroke:var(--teal); stroke-width:4; fill:#eef6f2; }
.pm-column .digit, .pm-column .cell-val { font-size:46px; fill:#3b2f2a; }
.pm-column .bar { stroke:#3b2f2a; stroke-width:3; }
.pm-answer { grid-column:2; grid-row:1; display:flex; flex-direction:column; gap:8px; }
.pm-field { min-height:56px; display:flex; align-items:center; justify-content:center; gap:6px; border:0; border-radius:12px; background:#f6efdf; box-shadow:inset 0 0 0 2px #e4d4b2; font-size:17px; color:#3b2f2a; padding:0 10px; }
.pm-field b { min-width:52px; height:44px; line-height:44px; border-radius:8px; background:#fff; font-size:26px; box-shadow:inset 0 0 0 2px #d8c7ae; }
.pm-field.active b { box-shadow:inset 0 0 0 3px var(--teal); }
.pm-units { display:flex; gap:8px; }
.pm-unit { flex:1; height:54px; border:0; border-radius:12px; background:#eef6f2; color:var(--teal2); font-size:22px; font-weight:800; box-shadow:inset 0 0 0 2px #b9d6cc; }
.pm-unit.on { background:var(--teal); color:#fff; }
.pm-keys { grid-column:2; grid-row:2; display:grid; margin:0; grid-template-columns:repeat(3,1fr); gap:6px; }
.pm-keys .key { height:54px; border:0; border-radius:12px; background:#fff; font-size:24px; font-weight:700; color:#3b2f2a; box-shadow:inset 0 0 0 2px #e4d4b2, 0 2px #e2cfab; }
.pm-keys .key-del { grid-column:span 2; font-size:18px; }
.pm-btns { display:flex; justify-content:flex-end; gap:12px; }
.pm-btns button { height:56px; padding:0 26px; border:0; border-radius:16px; font-size:20px; font-weight:800; }
.pm-go, .pm-next { background:var(--teal); color:#fff; box-shadow:0 4px #1d4a4c; }
.pm-go:disabled { background:#cfd9d4; box-shadow:none; }
.pm-p1 { background:#f6efdf; color:#6b543c; box-shadow:inset 0 0 0 2px #e4d4b2; }
.pm-stamp { align-self:center; width:120px; height:120px; border-radius:50%; border:6px double #b8573f; color:#b8573f; font-size:24px; font-weight:900; display:flex; align-items:center; justify-content:center; transform:rotate(-12deg); background:#fff4ec; }
.compact .pm-card { width:820px; max-height:456px; padding:10px 16px; gap:6px; overflow:auto; }

.compact .pm-prompt { font-size:18px; }
.compact .pm-body { grid-template-columns:1fr 220px 232px; }
.compact .pm-body .pm-answer { grid-column:2; grid-row:1; }
.compact .pm-body .pm-keys { grid-column:3; grid-row:1 / span 2; }
.compact .pm-body.nofig { grid-template-columns:220px 232px; }
.compact .pm-body.nofig .pm-answer { grid-column:1; }
.compact .pm-body.nofig .pm-keys { grid-column:2; grid-row:1; }
.compact .pm-fig { max-height:170px; }
.compact .pm-column { max-height:200px; }
.compact .pm-keys .key, .compact .pm-field, .compact .pm-unit, .compact .pm-btns button { height:54px; min-height:54px; }
.compact .pm-keys { gap:4px; }
/* お店の画面の入口（左上） */
.paper-shop .decor-door { position:absolute; left:22px; top:16px; height:56px; display:inline-flex; align-items:center; gap:8px; padding:0 20px; border:0; border-radius:28px; background:#fff8e8; color:var(--teal2); font-size:19px; font-weight:800; box-shadow:0 3px #e2cfab; z-index:12; }
.compact .paper-shop .decor-door { left:10px; top:6px; height:54px; font-size:16px; }
.paper-shop .decor-door img { width:34px; height:auto; display:block; } /* 絵と文字の組をボタンの真ん中に（左右の余白を同じに） */
.compact .paper-shop .decor-door { padding:0 16px; }
.compact .paper-shop .decor-door img { width:30px; }
.pm-body.nofig { grid-template-columns:300px; justify-content:center; }
.pm-body.nofig .pm-answer, .pm-body.nofig .pm-keys { grid-column:1; }
.pm-body.nofig .pm-keys { grid-row:2; }
.compact .decor-mode .decor-card.wide { width:250px; font-size:15px; }

/* ---- ui12 ---- */
/* 文節で改行（phrase.js の <wbr> だけで折り返す）・禁則 */
.decor-mode .decor-say span, .pm-prompt, .pm-note, .decor-mode .decor-hint, .decor-mode .decor-empty span, .decor-mode .decor-held-name { word-break:keep-all; overflow-wrap:break-word; line-break:strict; }
.pm-head > div { display:flex; flex-direction:column; gap:4px; }
/* 面積の図：1cm（床は1m）のますと、たて・横の長さ */
.pm-fig path.pm-paper { stroke:none; }
.pm-grid { fill:none; stroke:#b9a789; stroke-width:1.5; }
.pm-edge { fill:none; stroke:#7a6656; stroke-width:3; stroke-linejoin:round; }
.pm-len { font-size:20px; font-weight:800; fill:#3b2f2a; }
.pm-body { align-items:center; }
/* 壁紙を選んでいる間：柄の見本と、はるかべの案内 */
.decor-mode .decor-swatch { flex:none; width:96px; height:56px; border-radius:10px; background:#f3ead6 center / cover; box-shadow:inset 0 0 0 2px #d8c7ae; }
.decor-mode .decor-held-name small { display:block; font-size:14px; font-weight:700; color:#7a6656; }
/* 空のタブ：カタログへ */
.decor-mode .decor-empty { flex:1; display:flex; align-items:center; justify-content:center; gap:16px; font-size:17px; color:#6b543c; }
/* 小物の置き場の印：台の天板の上の光る楕円（押す所は 54px のまま） */
.decor-mode .decor-spot.surface { border:0; background:none; box-shadow:none; border-radius:0; }
.decor-mode .decor-spot.surface::before { content:''; position:absolute; left:3px; right:3px; top:30px; height:18px; border-radius:50%; background:rgba(255,236,160,.75); box-shadow:0 0 0 3px #fff6c8, 0 0 14px #fff3b0; }
/* カタログ：右に続きがある時は、はしを薄くして知らせる */
.decor-mode .decor-row.more { -webkit-mask-image:linear-gradient(90deg,#000 88%,transparent); mask-image:linear-gradient(90deg,#000 88%,transparent); }
.decor-mode .decor-price.jar { gap:1px; }
.decor-mode .decor-price.jar .jar-mini { width:16px; height:19px; }
.compact .decor-mode .decor-swatch { width:72px; height:46px; }
.compact .decor-mode .decor-empty { font-size:15px; gap:10px; }
.compact .pm-len { font-size:18px; }
/* iPhone 横：P1 の吹き出しは上の札のあいだ（部屋のまん中・床にかぶせない） */
.compact .decor-mode .decor-say { top:4px; left:300px; transform:none; max-width:520px; font-size:15px; line-height:1.35; padding:6px 14px 6px 8px; }

.decor-mode .decor-held-name { line-height:1.3; }
.compact .decor-mode .decor-wallpick { width:116px; font-size:16px; }
