/* ヴォカ（凸凹アプリ共通ルール：ヘッダー・フッターなし／説明文なし／拡大・バウンスなし／アイコンのボタン） */
:root{
  --bg:#f3f6fb;--ink:#22303c;--sub:#6a7682;--line:#dfe5ec;--blue:#2563eb;--blue-soft:#e5eeff;--yellow:#f6c343;--bad:#c9483a;
  --gap:clamp(8px,1.6vmin,16px);--pad:clamp(10px,2vmin,20px);
  --round:"Zen Maru Gothic","Hiragino Maru Gothic ProN","Hiragino Sans",system-ui,sans-serif;
  --plain:"Zen Kaku Gothic New","Hiragino Sans",system-ui,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;overscroll-behavior:none;background:var(--bg);color:var(--ink);font-family:var(--plain)}
body{height:100vh;height:100dvh;display:flex;flex-direction:column;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;border:none;background:none;padding:0}
button:focus:not(:focus-visible){outline:none}
svg{display:block}
[hidden]{display:none!important}

/* ---- パソコンのときだけのヘッダー ---- */
.pc-head{display:none}
@media (hover:hover) and (pointer:fine){
  .pc-head{display:flex;align-items:center;gap:10px;flex:none;padding:10px 18px;background:#fff;border-bottom:1px solid var(--line)}
  .pc-head img{width:28px;height:28px;border-radius:7px}
  .pc-head b{font:700 17px var(--round)}
  .pc-head small{color:var(--sub);font-size:13px}
}

/* ---- ボード ---- */
.stage{flex:1;min-height:0;display:flex;flex-direction:column;position:relative}
.pages{flex:1;min-height:0;position:relative;overflow:hidden;touch-action:pan-y}
.page{position:absolute;inset:0;padding:var(--pad);overflow-y:auto;overscroll-behavior:contain;transition:transform .32s cubic-bezier(.2,.8,.2,1)}
.page.off-left{transform:translateX(-104%)}
.page.off-right{transform:translateX(104%)}
.page.no-anim{transition:none}
.grid{display:grid;grid-template-columns:repeat(var(--cols,3),var(--cell,160px));grid-auto-rows:var(--cellh,190px);gap:var(--gap);justify-content:center;align-content:center;min-height:100%}
.page.scroll .grid{align-content:start}

.card{position:relative;display:flex;flex-direction:column;align-items:stretch;border-radius:clamp(14px,2.4vmin,24px);background:var(--card-bg,#fff);box-shadow:0 1px 0 rgba(30,50,80,.06),0 4px 14px rgba(30,50,80,.10);overflow:hidden;transition:transform .12s ease-out,box-shadow .12s ease-out}
.card .pic{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:8% 8% 2%}
.card .pic img{max-width:100%;max-height:100%;object-fit:contain;border-radius:10px;pointer-events:none;-webkit-user-drag:none}
.card .pic .emoji{font-size:calc(var(--cellh,190px) * .42);line-height:1;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
.card .pic .blank{width:46%;aspect-ratio:1;border-radius:14px;background:repeating-linear-gradient(45deg,#eef2f6 0 8px,#f7f9fb 8px 16px)}
.card .label{flex:none;padding:2px 8px 10%;text-align:center;font:700 clamp(15px,calc(var(--cellh,190px) * .13),40px)/1.25 var(--round);letter-spacing:.02em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card.no-label .label{display:none}
.card.no-label .pic{padding:8%}
.card.press{transform:scale(.94);box-shadow:0 1px 4px rgba(30,50,80,.12)}
.card.speaking{box-shadow:0 0 0 4px var(--yellow),0 6px 18px rgba(30,50,80,.16)}
@keyframes pop{0%{transform:scale(.94)}55%{transform:scale(1.04)}100%{transform:scale(1)}}
.card.pop{animation:pop .32s ease-out}

/* ---- ならべて話す ---- */
.strip{flex:none;display:flex;align-items:center;gap:10px;margin:var(--pad) var(--pad) 0;padding:8px 8px 8px 12px;min-height:clamp(64px,11vmin,96px);background:#fff;border-radius:18px;box-shadow:0 2px 10px rgba(30,50,80,.08)}
.chips{flex:1;min-width:0;display:flex;gap:8px;overflow-x:auto;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;width:clamp(52px,9vmin,80px);height:clamp(52px,9vmin,80px);border-radius:12px;background:var(--card-bg,#f6f8fb);padding:4px;animation:chipIn .22s ease-out}
@keyframes chipIn{from{transform:translateY(-40%) scale(.6);opacity:0}to{transform:none;opacity:1}}
.chip img{max-width:100%;flex:1;min-height:0;object-fit:contain}
.chip .emoji{font-size:clamp(24px,4.5vmin,40px);line-height:1;flex:1;display:flex;align-items:center}
.chip small{font:700 clamp(10px,1.6vmin,14px)/1.2 var(--round);max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.sbtn{flex:none;width:clamp(52px,9vmin,76px);height:clamp(52px,9vmin,76px);border-radius:50%;display:flex;align-items:center;justify-content:center}
.sbtn svg{width:58%;height:58%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sbtn.back{background:#f1f4f8;color:var(--sub)}
.sbtn.play{background:var(--blue);color:#fff}
.sbtn.play svg path:first-child{fill:currentColor}
.sbtn:active{transform:scale(.92)}
.strip.empty .sbtn{opacity:.35;pointer-events:none}

/* ---- ボードの切りかえ（下のまるいボタン） ---- */
.tabs{flex:none;display:flex;justify-content:center;gap:12px;padding:6px var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));overflow-x:auto}
.tab{flex:none;width:clamp(48px,8vmin,64px);height:clamp(48px,8vmin,64px);border-radius:16px;background:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 6px rgba(30,50,80,.10);transition:transform .2s,box-shadow .2s;overflow:hidden}
.tab img{width:80%;height:80%;object-fit:contain}
.tab .emoji{font-size:clamp(24px,4.4vmin,34px);line-height:1}
.tab.on{box-shadow:0 0 0 3px var(--blue),0 2px 8px rgba(30,50,80,.14);transform:translateY(-2px)}

/* ---- 編集のバー（大人用） ---- */
.editbar{flex:none;display:flex;align-items:center;gap:10px;padding:8px 12px;background:#fff;border-bottom:1px solid var(--line);flex-wrap:wrap;animation:dropIn .25s ease-out}
@keyframes dropIn{from{transform:translateY(-100%)}to{transform:none}}
.eb-done{display:flex;align-items:center;gap:4px;height:40px;padding:0 14px 0 10px;border-radius:999px;background:var(--blue);color:#fff;font-weight:500}
.eb-done svg,.eb-icon svg,.sh-ok svg,.sh-del svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.eb-kid{display:flex;align-items:center;gap:6px;height:40px;padding:0 12px 0 3px;border-radius:999px;border:1px solid var(--line)}
.eb-kid .face{width:34px;height:34px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center}
.eb-title{flex:1;min-width:140px;height:40px;border:1px solid transparent;border-radius:10px;padding:0 10px;font:700 18px var(--round);background:#f4f6f9}
.eb-title:focus{outline:none;border-color:var(--blue);background:#fff}
.eb-group{display:flex;gap:4px}
.eb-icon{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:var(--ink)}
.eb-icon:hover{background:#f1f4f8}
.eb-icon.danger{color:var(--bad)}
.eb-icon.on{background:var(--blue-soft);color:var(--blue)}
.settings{flex:none;display:flex;align-items:center;gap:18px;flex-wrap:wrap;padding:8px 12px;background:#fff;border-bottom:1px solid var(--line)}
.seg{display:flex;background:#f1f4f8;border-radius:999px;padding:3px}
.seg button{padding:6px 14px;border-radius:999px;font-size:14px;color:var(--sub)}
.seg button[aria-checked="true"]{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
.rate{display:flex;align-items:center;gap:8px;color:var(--sub)}
.rate svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.rate input{width:160px}

body.editing .stage .card{cursor:grab;touch-action:none}
body.editing .stage .card::after{content:"";position:absolute;top:8px;right:8px;width:28px;height:28px;border-radius:50%;background:rgba(255,255,255,.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3C/svg%3E") center/16px no-repeat;box-shadow:0 1px 3px rgba(0,0,0,.18)}
body.editing .card.dragging{opacity:.25}
body.editing .card.drop-over{box-shadow:0 0 0 4px var(--blue),0 6px 18px rgba(30,50,80,.16)}
.ghost{position:fixed;z-index:50;pointer-events:none;transform:rotate(-3deg) scale(1.04);box-shadow:0 12px 30px rgba(30,50,80,.28)!important;opacity:.95}
.add-tile{border:3px dashed #c6d2df;border-radius:clamp(14px,2.4vmin,24px);display:flex;align-items:center;justify-content:center;color:#9aabbd;background:rgba(255,255,255,.5)}
.add-tile svg{width:34%;height:34%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.add-tile.drop-over{border-color:var(--blue);color:var(--blue);background:var(--blue-soft)}
.page.file-over{outline:3px dashed var(--blue);outline-offset:-8px;border-radius:20px}

/* ---- カードの編集シート ---- */
dialog.sheet{position:fixed;inset:auto 0 0 0;margin:0 auto;width:min(620px,100%);max-width:100%;max-height:92vh;max-height:92dvh;border:none;padding:0;border-radius:22px 22px 0 0;background:#fff;color:var(--ink);box-shadow:0 -8px 40px rgba(20,30,50,.25);overflow:auto;overscroll-behavior:contain}
dialog.sheet[open]{animation:sheetUp .28s cubic-bezier(.2,.8,.2,1)}
@keyframes sheetUp{from{transform:translateY(100%)}to{transform:none}}
dialog.sheet::backdrop{background:rgba(15,25,40,.35)}
@media (min-height:700px) and (min-width:700px){dialog.sheet{inset:0;margin:auto;border-radius:22px;max-height:88vh;max-height:88dvh}}
.sheet-in{padding:14px 18px calc(18px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px;-webkit-user-select:text;user-select:text}
.sh-top{display:grid;grid-template-columns:48px 1fr 48px;grid-template-areas:'del pv ok';align-items:start}
.sh-del{grid-area:del}.sh-preview{grid-area:pv}.sh-ok{grid-area:ok}
.sh-del.off{visibility:hidden}
.sh-preview .card{cursor:pointer}
.sh-ok,.sh-del{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center}
.sh-ok{background:var(--blue);color:#fff}
.sh-ok svg{width:26px;height:26px}
.sh-del{color:var(--bad);background:#fbeceb}
.sh-preview{display:flex;justify-content:center}
.sh-preview .card{width:150px;height:170px;--cellh:170px;box-shadow:0 2px 12px rgba(30,50,80,.14)}
.sh-preview .card.drop-over{box-shadow:0 0 0 4px var(--blue)}
.sh-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width:480px){.sh-fields{grid-template-columns:1fr}}
.sh-fields label{display:flex;flex-direction:column;gap:3px;font-size:13px;color:var(--sub)}
.sh-fields small{font-size:11px}
.sh-fields input{height:44px;border:1px solid #c9d2dc;border-radius:10px;padding:0 12px;font-size:17px;color:var(--ink);-webkit-user-select:text;user-select:text}
.sh-fields input:focus{outline:none;border-color:var(--blue)}
.pick-tabs{display:flex;background:#f1f4f8;border-radius:12px;padding:3px}
.pick-tabs button{flex:1;padding:8px 4px;border-radius:9px;font-size:14px;color:var(--sub)}
.pick-tabs button[aria-selected="true"]{background:#fff;color:var(--ink);font-weight:500;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.pick{min-height:150px}
.lib{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:8px;max-height:260px;overflow:auto;padding:2px}
.lib button{aspect-ratio:1;border-radius:12px;background:#f4f6f9;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border:2px solid transparent;padding:4px}
.lib button img{width:100%;flex:1;min-height:0;object-fit:contain}
.lib button small{font-size:11px;color:var(--sub);max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.lib button.on{border-color:var(--blue);background:var(--blue-soft)}
.lib .lib-add{border:2px dashed #c6d2df;color:#8fa1b4;background:#fff}
.lib .lib-add svg{width:40%;height:40%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.pick-note{font-size:13px;color:var(--sub);margin:6px 2px}
.pick-note a,.pick-note button{color:var(--blue);text-decoration:none;font-size:13px}
.files{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.files button{height:96px;border-radius:14px;background:#f4f6f9;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--ink);font-size:14px;border:2px dashed transparent}
.files button svg{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.files .square{grid-column:1/-1;display:flex;align-items:center;gap:8px;font-size:13px;color:var(--sub)}
.emojis{display:grid;grid-template-columns:repeat(auto-fill,minmax(48px,1fr));gap:6px}
.emojis button{height:48px;border-radius:10px;font-size:28px;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
.emojis button.on{background:var(--blue-soft);box-shadow:inset 0 0 0 2px var(--blue)}
.emojis input{grid-column:1/-1;height:44px;border:1px solid #c9d2dc;border-radius:10px;padding:0 12px;font-size:22px}
.swatches{display:flex;gap:10px;justify-content:center}
.swatches button{width:36px;height:36px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.14)}
.swatches button.on{box-shadow:inset 0 0 0 1px rgba(0,0,0,.14),0 0 0 3px #fff,0 0 0 5px var(--blue)}
.busy{position:fixed;inset:0;z-index:80;background:rgba(255,255,255,.4)}
.busy::after{content:"";position:absolute;left:50%;top:50%;width:40px;height:40px;margin:-20px;border-radius:50%;border:4px solid var(--blue-soft);border-top-color:var(--blue);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}
