/* 牛乳びんのフタメーカー。画面の枠は水文字メーカー(water-maker.css)と同じで、ここは牛乳びんのフタだけの見た目(mc-*)。
   部品の形(段階ボタン・色の丸・見本のタイル)は、ほかの素材メーカーとそろえる */

/* 色は試作(design-sample/milk-cap-sample.html)のまま: 生成りの地に点の柄、こげ茶の線、牛乳びんのフタの青。
   つぶデコのピンクには合わせない(2026-12-04 ユーザー指示)。#lm の外(ページの地・読み込み画面)も同じ色にする */
html.maker-theme-light:has(.milkcap-maker), .milkcap-maker.theme-light {
  --bg:#efe6d2; --surface:#fffaf0; --surface2:#dbe7f7; --line:#cdbb98; --text:#3b2a1e; --sub:#8a7560;
  --stage:#f7f0e2; --stage-dot:rgba(59,42,30,.09);
  --accent:#2a5ea8; --accent-deep:#1c4380; --accent-hi:#2a5ea8; --step-done-text:#ffffff; --step-ring:rgba(42,94,168,.2);
  --lm-primary:#2a5ea8; --lm-primary-dark:#1c4380; --lm-primary-deep:#1c4380; --lm-bg:#efe6d2; --lm-bg-soft:#f6efe0;
  --lm-surface:#fffaf0; --lm-text:#3b2a1e; --lm-text-sub:#8a7560; --lm-line:#cdbb98; --lm-line-strong:#b9a47c;
  --mc-ink:#3b2a1e; --mc-cream:#f6e3a0;
}
/* 暗い画面は、夜の牛乳屋さん(こんの地に、明るい青) */
html.maker-theme-dark:has(.milkcap-maker), .milkcap-maker.theme-dark {
  --bg:#171a21; --surface:#20242d; --surface2:#26354f; --line:#3a4252; --text:#f1ebe0; --sub:#aaa294;
  --stage:#1c2029; --stage-dot:rgba(255,240,215,.07);
  --accent:#3f78c8; --accent-deep:#24508f; --accent-hi:#8ab4f0; --step-done-text:#14203a; --step-ring:rgba(138,180,240,.2);
  --lm-primary:#3f78c8; --lm-primary-dark:#24508f; --lm-primary-deep:#24508f; --lm-bg:#171a21; --lm-bg-soft:#1c2029;
  --mc-ink:#cfc4b2; --mc-cream:#5a4d2a;
}
html:has(.milkcap-maker.theme-light) body, .milkcap-maker.theme-light { background-color:var(--bg); background-image:radial-gradient(rgba(59,42,30,.08) 1.2px, transparent 1.3px); background-size:14px 14px; }

/* キャンバスは透明に描く(保存は透過PNG)。画面では枠も台も付けず、ページの地の上にフタを置く(枠があると操作欄と高さがずれて見える) */
.milkcap-maker .stage { background:none; box-shadow:none; touch-action:manipulation; }
.milkcap-maker .stage .stage-label { background:var(--mc-ink); color:var(--bg); box-shadow:none; }
.milkcap-maker .stage.tappable { cursor:pointer; user-select:none; -webkit-user-select:none; }
.milkcap-maker .stage:focus-visible { outline:2px solid var(--accent); outline-offset:-4px; }
.milkcap-maker .stage.mc-tappable .stage-label { display:inline-flex; align-items:center; gap:6px; }
.milkcap-maker .stage.mc-tappable .stage-label::before { content:'touch_app'; font-family:'Material Symbols Rounded'; font-size:14px; font-weight:400; line-height:1; }

/* 手順: 番号の丸の下に小さく名前(手順が多いので、スマホでも1行に収める)。済んだ手順は生成りで塗る */
.milkcap-maker .steps { counter-reset:mc-step; align-items:flex-start; }
.milkcap-maker .step-tab { counter-increment:mc-step; flex:1 1 0; max-width:64px; height:auto; padding:0; border:0; border-radius:0; background:none; box-shadow:none; flex-direction:column; gap:3px; color:var(--sub); font-size:10.5px; }
.milkcap-maker .step-tab::before { content:counter(mc-step); display:grid; place-items:center; width:28px; height:28px; border:2px solid var(--mc-ink); border-radius:50%; background:var(--surface); color:var(--text); font:900 13px/1 "Noto Sans JP",sans-serif; transition:transform .2s, background .2s; }
.milkcap-maker .step-tab .ms { display:none; }
.milkcap-maker .step-tab.done { background:none; border:0; color:var(--text); }
.milkcap-maker .step-tab.done::before { background:#d9c9a8; color:#3b2a1e; }
.milkcap-maker .step-tab.current { background:none; border:0; box-shadow:none; color:var(--text); }
.milkcap-maker .step-tab.current::before { background:var(--accent); color:#fff; transform:scale(1.12); }
.milkcap-maker .step-link { margin-top:15px; height:2px; background:var(--line); max-width:16px; }
.milkcap-maker .step-link.filled { background:var(--mc-ink); }

/* 操作欄はカード(試作と同じ、こげ茶の線と影)。ボタンも同じ線 */
.milkcap-maker .panel.milkcap-panel { margin-top:12px; padding:14px; border:2px solid var(--mc-ink); border-radius:18px; background:var(--surface); box-shadow:3px 3px 0 var(--mc-ink); }
/* PC(左右に並ぶ配置): 操作欄の上をキャンバスとそろえ、影まで欄の中に収める(下で見切れない) */
@media (min-width:900px) and (min-height:520px) {
  .milkcap-maker .panel.milkcap-panel { align-self:start; height:auto; margin-top:0; max-height:calc(100% - 6px); }
}
.milkcap-maker .btn-main { border:2px solid var(--mc-ink); box-shadow:2px 2px 0 var(--mc-ink); }
.milkcap-maker .btn-main:active { transform:translate(2px,2px); box-shadow:none; }
.milkcap-maker .ghost-btn { border-color:var(--mc-ink); background:var(--surface); box-shadow:2px 2px 0 var(--mc-ink); }
.milkcap-maker .ghost-btn:active { transform:translate(2px,2px); box-shadow:none; }

/* 使いこみの目盛り(いまの段階と上限) */
.mc-meter { display:inline-flex; gap:3px; align-items:center; margin-left:2px; }
.mc-meter span { width:6px; height:6px; border-radius:50%; background:rgba(127,110,90,.4); }
.mc-meter span.is-on { background:var(--accent); }

.milkcap-panel .sect-label { margin:12px 0 6px; }
.milkcap-panel .sect-label:first-child { margin-top:0; }
.mc-note { margin:6px 0 4px; color:var(--sub); font-size:12px; line-height:1.5; text-align:center; }

/* 並べ方(等分) */
.mc-grid { display:grid; gap:6px; }
.mc-grid-2 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.mc-grid-4 { grid-template-columns:repeat(4, minmax(0, 1fr)); }
.mc-grid-5 { grid-template-columns:repeat(5, minmax(0, 1fr)); }

/* 選ぶタイル(帯の形・書体・使いこみ・絵)。選んだものは色の枠 */
.mc-thumb, .mc-font, .mc-wear, .mc-icon { min-width:0; border:2px solid var(--mc-ink); border-radius:12px; background:var(--surface); color:var(--text); cursor:pointer; transition:transform .1s, border-color .15s; }
.mc-thumb[aria-pressed="true"], .mc-font[aria-pressed="true"], .mc-wear[aria-pressed="true"], .mc-icon[aria-pressed="true"] { background:var(--surface2); box-shadow:inset 0 0 0 2px var(--accent); color:var(--accent-hi); }
.mc-thumb:active, .mc-font:active, .mc-wear:active, .mc-icon:active { transform:scale(.95); }
.mc-cap-tile { display:block; width:100%; height:auto; aspect-ratio:1; }
.mc-thumb { display:grid; grid-template-columns:64px 1fr; align-items:center; gap:8px; padding:6px 8px; font-size:15px; font-weight:800; text-align:left; }
.mc-thumb .mc-cap-tile { width:64px; }
.mc-font { display:flex; flex-direction:column; align-items:center; gap:2px; padding:8px 2px 6px; }
.mc-font b { font-size:22px; line-height:1.2; font-weight:inherit; }
.mc-font span { font-size:11px; white-space:nowrap; }
.mc-wear { padding:4px; }
.mc-icon { aspect-ratio:1; padding:6px; display:grid; place-items:center; }
.mc-icon canvas { width:100%; height:100%; display:block; }
.theme-dark .mc-icon canvas { filter:invert(1) brightness(.92); }
.mc-icon-image { display:flex; flex-direction:column; justify-content:center; gap:2px; font-size:11px; font-weight:800; }
.mc-icon-image .ms { font-size:22px; }

/* 段階ボタン(数に合わせて等分) */
.mc-seg { display:grid; grid-template-columns:repeat(var(--n, 3), minmax(0, 1fr)); gap:6px; }
.milkcap-maker .mc-option { width:100%; min-height:44px; padding:6px 2px; border:2px solid var(--mc-ink); border-radius:14px; background:var(--surface); color:var(--text); white-space:nowrap; justify-content:center; box-shadow:none; }
.milkcap-maker .mc-option[aria-pressed="true"] { background:var(--accent); border-color:var(--mc-ink); color:#fff; }
.milkcap-maker .mc-option:disabled { opacity:.35; cursor:default; }

/* スライダー(見出しを左に) */
.mc-sliders { display:grid; gap:2px; margin-top:10px; }
.mc-slider-row { display:grid; grid-template-columns:6.5em 1fr; align-items:center; gap:8px; font-size:13px; font-weight:800; color:var(--text); }
.mc-slider { width:100%; height:32px; accent-color:var(--accent); }

/* 入力欄(名字|名前、ローマ字を横に並べる) */
.mc-pair { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; margin-bottom:8px; }
.mc-fields { display:grid; gap:8px; margin-top:10px; }
.mc-field label { display:block; margin-bottom:4px; color:var(--sub); font-size:12px; font-weight:700; }
.mc-field-row { display:flex; gap:6px; }
.mc-input { flex:1; min-width:0; height:46px; padding:0 12px; border:2px solid var(--mc-ink); border-radius:12px; background:#fff; color:#3b2a1e; font:800 17px "Noto Sans JP", sans-serif; }
.mc-input.is-big { height:52px; font-size:21px; }
.mc-input:focus { outline:none; border-color:var(--accent); }
.mc-input::placeholder { color:var(--sub); opacity:.55; }
.mc-idea { flex:none; display:flex; align-items:center; gap:2px; height:46px; padding:0 12px; border:2px solid var(--mc-ink); border-radius:12px; background:var(--mc-cream); box-shadow:2px 2px 0 var(--mc-ink); color:var(--text); font:800 14px "Noto Sans JP", sans-serif; cursor:pointer; }
.mc-idea .ms { font-size:18px; }
.mc-idea:active { transform:translate(2px,2px); box-shadow:none; }

/* 自分の画像 */
.mc-upload { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:10px; }
.mc-mini { display:inline-flex; align-items:center; gap:4px; height:38px; padding:0 12px; border:2px solid var(--mc-ink); border-radius:999px; background:var(--surface); color:var(--text); font:800 13px "Noto Sans JP", sans-serif; cursor:pointer; }
.mc-mini .ms { font-size:18px; }
.mc-mini:disabled { opacity:.4; cursor:default; }

/* インクと紙の色の丸。同じ色どうしは選べない */
.mc-dots { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; padding:4px 2px 6px; }
.mc-dot { width:38px; height:38px; padding:0; border-radius:50%; border:2px solid var(--mc-ink); background:var(--dot); cursor:pointer; }
.mc-dot[aria-pressed="true"] { box-shadow:0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }
.mc-dot:disabled { opacity:.2; cursor:default; }
.mc-foil-label { display:flex; align-items:center; justify-content:center; gap:6px; margin:10px 0 2px; font-size:12px; font-weight:700; color:var(--sub, inherit); }
.mc-foil-label .mc-pro.td-pro-badge { width:18px; height:18px; }
.mc-foils { gap:8px; }
/* 箔の見本は名前つきの丸(色の丸より横に長い札) */
.mc-dot.mc-foil { width:auto; min-width:64px; height:38px; padding:0 10px; border-radius:19px; display:inline-flex; align-items:center; justify-content:center; }
.mc-dot.mc-foil span { font-size:11px; font-weight:800; color:#2a2218; text-shadow:0 1px 0 rgba(255,255,255,.7); white-space:nowrap; }

/* 完成: アイコンの大きさで見たところ */
.mc-icon-preview { display:flex; align-items:flex-end; justify-content:center; gap:14px; margin:0 0 10px; }
.mc-icon-preview .mc-cap-tile { width:48px; }
.mc-icon-preview .mc-cap-tile + .mc-cap-tile { width:32px; }
.mc-icon-preview span { color:var(--sub); font-size:11px; }

@media (max-width:420px) {
  .milkcap-maker .step-tab { font-size:9.5px; }
  .milkcap-maker .step-link { max-width:8px; margin-left:1px; margin-right:1px; }
  .mc-option { font-size:12px; }
  .mc-input.is-big { font-size:19px; }
  .mc-slider-row { grid-template-columns:5.8em 1fr; font-size:12px; }
}
