:root{
  --tl:#2aa198;
  --ink:#0b1b22;
}
*{box-sizing:border-box}
/* .err / .preview / .hint に display を指定しているので、これが無いと
   ブラウザ標準の [hidden]{display:none} に勝ってしまい、隠したはずの
   オーバーレイが出続ける。 */
[hidden]{display:none !important}
html,body{margin:0;height:100%;background:var(--ink);overflow:hidden;
  font:15px/1.6 "Noto Sans JP",-apple-system,"Hiragino Kaku Gothic ProN",Meiryo,sans-serif;
  color:#fff;-webkit-tap-highlight-color:transparent;word-break:auto-phrase}
#stage{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}

/* ---- 読み込み中 ---- */
.load{position:fixed;inset:0;display:grid;place-items:center;z-index:20;
  background:radial-gradient(ellipse at 50% 35%,#15303a,#070f14 72%);transition:opacity .35s}
.load.off{opacity:0;pointer-events:none}
.load-in{text-align:center}
.spin{width:38px;height:38px;margin:0 auto 14px;border-radius:50%;
  border:3px solid rgba(255,255,255,.2);border-top-color:var(--tl);animation:sp 1s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.load-tx{font-size:13.5px;opacity:.9}

/* ---- 顔待ちの案内 ---- */
.hint{position:fixed;inset:0 0 150px;display:grid;place-items:center;pointer-events:none;z-index:10;
  background:radial-gradient(ellipse at center,rgba(0,0,0,.08),rgba(0,0,0,.45));transition:opacity .35s}
.hint.off{opacity:0}
.hint-in{text-align:center;padding:0 24px;text-shadow:0 2px 14px rgba(0,0,0,.7)}
.hint-ttl{font-size:20px;font-weight:800;letter-spacing:.04em}
.hint-sub{margin-top:8px;font-size:13px;opacity:.94;line-height:1.8}

/* ---- 下の操作パネル ---- */
.panel{position:fixed;left:0;right:0;bottom:0;z-index:12;
  display:flex;flex-direction:column;gap:12px;
  padding:14px 12px calc(10px + env(safe-area-inset-bottom));
  background:linear-gradient(to top,rgba(6,14,18,.85) 55%,rgba(6,14,18,0))}

.themes{display:flex;gap:8px;justify-content:center;overflow-x:auto;scrollbar-width:none}
.themes::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;padding:8px 16px;cursor:pointer;border-radius:999px;
  border:1px solid rgba(255,255,255,.28);background:rgba(10,22,28,.55);
  color:#fff;font:inherit;font-size:12.5px;font-weight:700;line-height:1;white-space:nowrap}
.chip[aria-pressed="true"]{border-color:var(--tl);background:rgba(42,161,152,.3)}
.chip:active{transform:scale(.95)}

.ui{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 10px}
.icon,.spacer{width:46px;height:46px;flex:0 0 auto}
.icon{border:0;border-radius:50%;background:rgba(10,22,28,.6);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);display:grid;place-items:center;cursor:pointer}
.icon svg{width:23px;height:23px;fill:#fff}
.icon:active{transform:scale(.93)}

.shutter{width:72px;height:72px;border-radius:50%;border:4px solid rgba(255,255,255,.92);
  background:transparent;display:grid;place-items:center;cursor:pointer;padding:0;flex:0 0 auto}
.shutter span{width:54px;height:54px;border-radius:50%;background:#fff;transition:all .18s}
.shutter.rec span{width:28px;height:28px;border-radius:8px;background:#e04444}
.shutter:active span{transform:scale(.92)}

/* ---- 小さな通知 ---- */
.toast{position:fixed;left:50%;bottom:170px;transform:translateX(-50%);z-index:15;
  padding:8px 16px;border-radius:999px;background:rgba(6,14,18,.82);font-size:13px;
  transition:opacity .3s;pointer-events:none}
.toast.off{opacity:0}

/* ---- プレビュー ---- */
.preview{position:fixed;inset:0;background:rgba(6,14,18,.93);display:grid;place-items:center;z-index:30;padding:20px}
.preview-box{width:100%;max-width:380px;text-align:center}
.preview img,.preview video{width:100%;border-radius:12px;background:#000}
.preview-btns{margin-top:14px;display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.btn{display:inline-block;padding:11px 24px;border-radius:9px;border:0;cursor:pointer;
  background:var(--tl);color:#fff;font:inherit;font-weight:700;text-decoration:none}
.btn-ghost{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.4)}

.err{position:fixed;inset:0;display:grid;place-items:center;padding:30px;text-align:center;
  background:var(--ink);z-index:40;font-size:14.5px;line-height:1.9}

@media (max-height:680px){
  .panel{gap:9px;padding-top:10px}
  .shutter{width:62px;height:62px}
  .shutter span{width:46px;height:46px}
  .hint{inset:0 0 135px}
}
