/* クリスマスツリーメーカー。画面の枠は水文字メーカー(water-maker.css)と同じで、ここはツリーメーカーだけの見た目。
   色は、つぶデコのやわらかさを残したクリスマスの色(赤・緑・金・生成り)。手順の丸・ボタンの主の色は赤、選んだ印・目盛りに緑と金 */

/* クリスマスの色(明るい画面)。#lm の外(ページの地・読み込み画面)も同じ明るさにする */
html.maker-theme-light:has(.xmastree-maker), .xmastree-maker.theme-light {
  --bg:#fbf6ee; --surface:#fffdf9; --surface2:#f3ecdf; --line:#e7dccb; --text:#2a2b26; --sub:#6c6a60;
  --stage:#f4ede1; --stage-dot:rgba(46,117,80,.14);
  --accent:#cf3f3a; --accent-deep:#a52f2b; --accent-hi:#2e7550; --step-done-text:#ffffff;
}
/* 暗い画面は、夜の森の色 */
.xmastree-maker.theme-dark { --bg:#121a17; --surface:#1b2622; --surface2:#24322c; --line:#33443d; --text:#f3efe6; --sub:#b5b8ad; --stage:#1a2420; --stage-dot:rgba(255,255,255,.07); --accent:#d9534d; --accent-deep:#9e2f2b; --accent-hi:#8fd1a8; }
.xmastree-maker.theme-dark .xt-orn { background:#2b3833; }

/* キャンバスは透明に描く(保存は透過PNG)。画面の地は、生成りに小さな点 */
.xmastree-maker .stage { background-color:var(--stage); background-image:radial-gradient(var(--stage-dot) 1.5px, transparent 1.5px); background-size:18px 18px; box-shadow:inset 0 0 0 1px var(--line); touch-action:none; }
.xmastree-maker .stage .stage-label { box-shadow:0 1px 4px rgba(0,0,0,.18); }
.xmastree-maker .stage.tappable { cursor:pointer; user-select:none; -webkit-user-select:none; }
.xmastree-maker .stage:focus-visible { outline:2px solid var(--accent); outline-offset:-4px; }
.xmastree-maker .stage.xt-shake { animation:xtShake .3s ease; }
@keyframes xtShake { 0%,100% { transform:none } 25% { transform:translateX(-5px) } 75% { transform:translateX(5px) } }

/* 大きさの手順: なぞれることが分かるカーソル(上下左右の矢印)。なぞっているあいだは、その向きの矢印だけ */
.xmastree-maker .stage.xt-size canvas { cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='9' fill='white' stroke='%232e7550' stroke-width='2.5'/%3E%3Ccircle cx='20' cy='20' r='3.5' fill='%232e7550'/%3E%3Cpath d='M20 4 L25 11 L15 11 Z' fill='%232e7550' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M20 36 L25 29 L15 29 Z' fill='%232e7550' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M4 20 L11 15 L11 25 Z' fill='%232e7550' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M36 20 L29 15 L29 25 Z' fill='%232e7550' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 20 20, move; }
.xmastree-maker .stage.xt-size.drag-y canvas { cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='9' fill='white' stroke='%23cf3f3a' stroke-width='2.5'/%3E%3Ccircle cx='20' cy='20' r='3.5' fill='%23cf3f3a'/%3E%3Cpath d='M20 4 L25 11 L15 11 Z' fill='%23cf3f3a' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M20 36 L25 29 L15 29 Z' fill='%23cf3f3a' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 20 20, ns-resize; }
.xmastree-maker .stage.xt-size.drag-x canvas { cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='9' fill='white' stroke='%23cf3f3a' stroke-width='2.5'/%3E%3Ccircle cx='20' cy='20' r='3.5' fill='%23cf3f3a'/%3E%3Cpath d='M4 20 L11 15 L11 25 Z' fill='%23cf3f3a' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M36 20 L29 15 L29 25 Z' fill='%23cf3f3a' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 20 20, ew-resize; }
/* 飾りの手順: ツリーの上は置ける(十字)、飾りをつかんでいるあいだは、つかんだ手 */
.xmastree-maker .stage.xt-deco canvas { cursor:crosshair; }
.xmastree-maker .stage.xt-deco.is-grabbing canvas { cursor:grabbing; }

/* キャンバスの上に、変わったものの名前を短く出す */
/* キャンバス右下の札(なぞる・タップの案内)。明るい下地でも読めるよう、緑の札に白い文字 */
.xmastree-maker .stage .tap-hint { padding:4px 10px 4px 8px; border-radius:999px; background:rgba(31,90,60,.9); color:#fff; font-weight:800; text-shadow:none; box-shadow:0 2px 8px rgba(0,0,0,.15); }
.xmastree-maker .stage .tap-hint .ms { color:#fff; }
.xt-deco-guide { position:absolute; z-index:3; left:50%; top:50%; transform:translate(-50%, -50%); display:flex; align-items:center; gap:8px; padding:10px 16px; border-radius:999px; background:rgba(31,90,60,.92); color:#fff; font-size:15px; white-space:nowrap; pointer-events:none; box-shadow:0 4px 14px rgba(0,0,0,.18); }
.xt-deco-guide[hidden] { display:none; }
.xt-deco-hand { font-size:26px; animation:xtTap 1.1s ease-in-out infinite; }
@keyframes xtTap { 0%,100% { transform:translateY(0) scale(1) } 45% { transform:translateY(4px) scale(.9) } }
@media (prefers-reduced-motion: reduce) { .xt-deco-hand { animation:none; } }
.xt-say { position:absolute; z-index:3; top:12px; left:50%; transform:translateX(-50%); padding:4px 12px; border-radius:999px; background:rgba(31,90,60,.92); color:#fff; font-size:13px; font-weight:800; white-space:nowrap; pointer-events:none; opacity:0; }
.xt-say.is-on { animation:xtSay .9s ease forwards; }
@keyframes xtSay { 0% { opacity:0; transform:translate(-50%, 6px) } 15% { opacity:1; transform:translate(-50%, 0) } 75% { opacity:1 } 100% { opacity:0; transform:translate(-50%, -6px) } }
@media (prefers-reduced-motion: reduce) { .xt-say.is-on { animation:none; opacity:1; } .xmastree-maker .stage.xt-shake { animation:none; } }

.xmastree-panel .xt-section { min-width:0; margin-bottom:6px; }
.xmastree-panel .xt-note { margin:8px 0 4px; color:var(--sub); font-size:12px; line-height:1.5; text-align:center; }

/* かたち: 10種類を5×2の一覧で */
.xt-shapes { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:6px; }
.xt-shape { min-width:0; padding:2px 0 5px; border:2px solid var(--line); border-radius:14px; background:var(--surface); color:var(--text); display:flex; flex-direction:column; align-items:center; cursor:pointer; font:700 11px "Noto Sans JP",sans-serif; transition:transform .12s; }
.xt-shape canvas { width:100%; aspect-ratio:1 / 1; display:block; }
.xt-shape[aria-pressed="true"] { border-color:var(--accent-hi); background:var(--surface2); color:var(--accent-hi); }
.xt-shape:active { transform:scale(.95); }
.xt-shape-name { max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }

/* 大きさ: 段と太さの ＋ − と、点いている明かり */
.xt-stepper { display:grid; grid-template-columns:52px 44px minmax(0, 1fr) 44px; align-items:center; gap:8px; min-height:58px; margin-bottom:8px; padding:0 8px 0 14px; border:2px solid var(--line); border-radius:16px; background:var(--surface); }
.xt-stepper-label { font-size:14px; font-weight:800; }
.xt-step-btn { width:44px; height:44px; padding:0; border:0; border-radius:50%; background:var(--surface2); color:var(--accent-hi); font:900 24px/1 "Noto Sans JP",sans-serif; cursor:pointer; }
.xt-step-btn:disabled { opacity:.35; cursor:default; }
.xt-stepper-mid { display:flex; flex-direction:column; align-items:center; gap:4px; }
.xt-stepper-mid b { font-size:13px; color:var(--accent-hi); }
.xt-lights { display:flex; gap:5px; }
.xt-lights i { width:11px; height:11px; border-radius:50%; background:var(--line); }
.xt-lights i.is-on { background:#e8b948; box-shadow:0 0 6px rgba(232,185,72,.8); }
.xt-lights i.is-on:nth-child(2n) { background:#cf3f3a; box-shadow:0 0 6px rgba(207,63,58,.6); }
.xt-lights i.is-on:nth-child(3n) { background:#4f9a6f; box-shadow:0 0 6px rgba(79,154,111,.6); }

/* 色の丸(ツリーの色・飾りの色)。見本の帯の中に、丸を大きく */
.xt-color-name { display:flex; justify-content:center; margin:2px 0 4px; } .xt-color-name b { font-size:17px; }
.xt-swatch { display:block; width:34px; height:34px; margin:4px auto 2px; border-radius:50%; background:var(--sw); box-shadow:inset 0 0 0 1px rgba(0,0,0,.12); }
.xt-swatch.is-light { box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.18); }
.xt-color-strip .thumb { width:76px; height:72px; background:var(--surface); border-color:var(--line); }
.xt-color-strip .thumb[aria-pressed="true"] { border-color:var(--accent-hi); background:var(--surface2); }
.xt-icon-strip .thumb { background:var(--surface); border-color:var(--line); }
.xt-icon-strip .thumb[aria-pressed="true"] { border-color:var(--accent-hi); background:var(--surface2); }
/* 色の丸は、見本の箱の灰色の地を敷かない(丸の後ろに四角が出て二重に見える) */
.xmastree-maker .xt-color-strip .thumb > .thumb-canvas { background:none; }
.xmastree-maker .xt-icon-strip .thumb > .thumb-canvas { background:none; }

/* 飾り: タブ・一覧(グレーの地。白い飾りも見えるように)・色・大きさ */
.xt-tabs { display:grid; grid-template-columns:repeat(var(--n, 4), auto); justify-content:center; gap:6px; margin-bottom:10px; }
.xt-tabs .chip { min-width:0; padding:0 12px; height:38px; font-size:13px; white-space:nowrap; }
.xt-tabs-2 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.xt-tabs-2 .chip { width:100%; }
/* 星・鉢: 選べるものを全部並べる(3列×2段)。絵と名前 */
.xt-pick-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.xt-pick { min-width:0; padding:6px 4px 8px; border:2px solid var(--line); border-radius:14px; background:var(--surface); color:var(--text); display:flex; flex-direction:column; align-items:center; gap:2px; cursor:pointer; font:700 12px "Noto Sans JP",sans-serif; transition:transform .12s; }
.xt-pick canvas { width:64px; height:64px; display:block; }
.xt-pick[aria-pressed="true"] { border-color:var(--accent-hi); background:var(--surface2); color:var(--accent-hi); }
.xt-pick:active { transform:scale(.95); }
.xt-orn-grid { display:grid; grid-template-columns:repeat(6, minmax(0, 1fr)); gap:6px; }
.xt-orn { position:relative; aspect-ratio:1 / 1; min-width:0; padding:0; border:2px solid transparent; border-radius:12px; background:#e6e3dd; display:grid; place-items:center; overflow:hidden; cursor:pointer; }
.xt-orn canvas { width:78%; height:78%; }
.xt-orn.xt-pat canvas { width:100%; height:100%; }
.xt-orn[aria-pressed="true"] { border-color:var(--accent); }
.xt-orn-name { position:absolute; left:0; right:0; bottom:0; padding:1px 0; background:rgba(0,0,0,.38); color:#fff; font-size:10px; font-weight:800; text-align:center; }
.xt-orn-color { margin-top:2px; } .xt-orn-color .sect-label { margin-top:8px; }
.xt-orn-color[aria-disabled="true"] .strip-wrap { opacity:.35; pointer-events:none; }
.xt-orn-colors .thumb { width:58px; height:56px; }
.xt-orn-colors .xt-swatch { width:26px; height:26px; margin-top:2px; }
.xt-hue-row { display:flex; align-items:center; gap:10px; margin:8px 4px 2px; font-size:12px; font-weight:800; color:var(--sub); }
.xt-hue { flex:1; -webkit-appearance:none; appearance:none; height:14px; border-radius:999px; background:linear-gradient(90deg, hsl(0,68%,55%), hsl(60,68%,55%), hsl(120,68%,55%), hsl(180,68%,55%), hsl(240,68%,55%), hsl(300,68%,55%), hsl(360,68%,55%)); }
.xt-hue::-webkit-slider-thumb { -webkit-appearance:none; width:26px; height:26px; border-radius:50%; background:var(--thumb, #fff); border:3px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.35); }
.xt-hue::-moz-range-thumb { width:22px; height:22px; border-radius:50%; background:var(--thumb, #fff); border:3px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.35); }
.xt-deco-tools { display:flex; align-items:center; gap:6px; margin-top:8px; }
.xt-tools-label { font-size:12px; font-weight:800; color:var(--sub); white-space:nowrap; }
/* 選んだ飾りの向き */
.xt-rot-row { display:flex; align-items:center; gap:8px; margin:8px 0 2px; }
.xt-rot { flex:1; min-width:0; accent-color:var(--accent); }
.xt-rot-value { width:38px; font-size:12px; text-align:right; color:var(--accent-hi); }
.xt-mini { display:flex; align-items:center; gap:4px; height:36px; padding:0 12px; border:2px solid var(--line); border-radius:999px; background:var(--surface); color:var(--text); font:800 12.5px "Noto Sans JP",sans-serif; white-space:nowrap; cursor:pointer; }
.xt-mini .ms { font-size:16px; color:#e8b948; }
@media (max-width:420px) { .xt-tabs .chip { padding:0 10px; font-size:12px; } .xt-mini { padding:0 10px; } }
/* 飾りの手順: 説明文と、選んだ飾りの「向き」の欄を同じ高さにする(飾りを選んでも下のボタンが動かない) */
.xmastree-panel .xt-deco-tools + .xt-note, .xmastree-panel .xt-deco-tools + .xt-rot-row { box-sizing:border-box; height:40px; margin:6px 0 0; }
.xmastree-panel .xt-deco-tools + .xt-note { display:flex; align-items:center; justify-content:center; }
.xmastree-maker .stage.has-pick .tap-hint, .stage.has-pick .tap-hint { visibility:hidden; }
.xt-deco-tools .xt-mini { flex:1; justify-content:center; }
