/* ユウのアプリ工房 共通スタイル */
:root { --ink: #2b2118; --paper: #fff8ec; --accent: #e8553d; --x: #111; font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif; font-weight: 500; --display: "Dela Gothic One", "M PLUS Rounded 1c", sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3a2a1d; color: var(--ink); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
canvas.lab-stage { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; touch-action: none; }

.lab-bar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(8px, env(safe-area-inset-top)) 10px 8px; pointer-events: none; z-index: 5; }
.lab-bar > * { pointer-events: auto; }
.lab-icon { border: 0; background: rgba(20,14,10,.75); color: #fff; font: 700 20px/1 inherit; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

.lab-modal { position: fixed; inset: 0; background: rgba(10,8,6,.55); display: grid; place-items: center; z-index: 20; padding: 16px; animation: lab-in .18s ease-out; }
.lab-sheet { background: var(--paper); border-radius: 18px; padding: 16px; width: min(560px, 100%); max-height: 100%; overflow: auto; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.lab-card { width: 100%; border-radius: 10px; display: block; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.lab-sharetext { font-size: 14px; margin: 12px 4px 10px; line-height: 1.5; word-break: break-word; }
.lab-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lab-btn { appearance: none; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: 800 15px/1 inherit; padding: 12px 16px; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; flex: 1 1 120px; }
.lab-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.lab-x { background: var(--x); border-color: var(--x); color: #fff; }
.lab-ghost { margin-top: 10px; width: 100%; background: transparent; }
.lab-hint { font-size: 11px; color: #7a6a5a; margin: 8px 0 0; }
.lab-credit { font-size: 11px; color: #9a8a7a; margin: 10px 0 0; }
.lab-toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 10px 16px; border-radius: 99px; font-weight: 700; z-index: 30; }

/* 撮影モード */
.lab-demo .lab-bar { display: none; }
.lab-caption { position: fixed; top: 4.5vh; left: 0; right: 0; text-align: center; z-index: 6; pointer-events: none; }
.lab-caption span { display: inline-block; background: #fff; color: var(--ink); font-family: var(--display); font-weight: 400; font-size: clamp(20px, 5.4vw, 40px); padding: .35em .8em; border-radius: 14px; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.lab-handle { position: fixed; bottom: 3.5vh; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.85); font-weight: 800; font-size: clamp(14px, 3.6vw, 26px); z-index: 6; pointer-events: none; text-shadow: 0 2px 4px rgba(0,0,0,.5); }
.lab-rec *, .lab-rec *::before, .lab-rec *::after { animation: none !important; transition: none !important; }

@keyframes lab-in { from { opacity: 0; } to { opacity: 1; } }

/* 結果画面：暗いカードに大きな数字 */
.lab-result { background: rgba(28,24,22,.94); color: #fff; width: min(340px, 100%); padding: 26px 20px 20px; }
.lab-result-value { font-family: var(--display); font-size: clamp(44px, 13vw, 64px); font-weight: 400; margin: 0; line-height: 1.05; letter-spacing: -.01em; }
.lab-result-sub { font-family: var(--display); font-size: 18px; font-weight: 400; margin: 6px 0 0; color: #ffd84a; }
.lab-result-best { font-size: 13px; font-weight: 700; color: #bdb3a8; margin: 8px 0 18px; }
.lab-col { display: flex; flex-direction: column; gap: 10px; }
.lab-result .lab-btn { background: transparent; border-color: #fff; color: #fff; border-radius: 99px; flex: none; width: 100%; }
.lab-result .lab-btn.lab-solid { background: #fff; color: #1c1816; }
.lab-share-modal { z-index: 25; }
/* メニュー */
.lab-menu-modal { z-index: 30; }
.lab-howto { background: rgba(28,24,22,.96); color: #f3ece4; text-align: left; width: min(420px, 100%); max-height: 88dvh; }
.lab-howto h1 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 4px 0 10px; }
.lab-howto h2 { font-weight: 800; font-size: 14px; margin: 16px 0 4px; color: #ffd84a; }
.lab-howto p { font-size: 14px; line-height: 1.75; margin: 0; }
.lab-howto .lab-btns { margin-top: 18px; }
.lab-howto .lab-btn { background: transparent; border-color: #8a7f74; color: #fff; border-radius: 99px; }
.lab-link { display: block; text-align: center; color: #fff; font-weight: 800; margin: 14px 0 4px; }
