@import url('https://fonts.googleapis.com/css2?family=Dela+Gothic+One&family=DotGothic16&family=M+PLUS+Rounded+1c:wght@500;800;900&display=swap');
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #14101f; color: #fff; font-family: "M PLUS Rounded 1c", "Hiragino Sans", sans-serif; overflow: hidden; }
#wrap { position: relative; height: calc(100% - 56px); display: grid; place-items: center; }
canvas { max-width: 100%; max-height: 100%; display: block; }
body.still #wrap { height: 100%; }
body.still #bar { display: none; }
body.still canvas { width: 100%; height: 100%; max-width: none; max-height: none; }
.go { position: absolute; font: 400 clamp(22px, 3.2vw, 44px) "Dela Gothic One", sans-serif; color: #fff; background: #FF7A1A; border: 6px solid #2B2140; border-radius: 999px; padding: .5em 1.4em; box-shadow: 0 10px 0 #2B2140; cursor: pointer; transition: transform .12s; }
.go:hover { transform: scale(1.06) rotate(-2deg); }
.go:active { transform: scale(.94); box-shadow: 0 4px 0 #2B2140; }
#bar { height: 56px; display: flex; gap: 12px; align-items: center; padding: 0 16px; background: #1f1830; }
#bar button { font: 800 18px inherit; width: 44px; height: 40px; border-radius: 12px; border: 3px solid #2B2140; background: #FFC53D; cursor: pointer; }
#bar input { flex: 1; accent-color: #FF7A1A; }
#bar span { font: 800 14px inherit; min-width: 110px; color: #ddd; }
#bar a { color: #3EE0B0; font-weight: 800; text-decoration: none; white-space: nowrap; }

/* mp4 で書き出す */
#bar .recbtn { width: auto; padding: 0 12px; background: #FF5DA2; color: #fff; white-space: nowrap; }
body.recording #bar { pointer-events: none; opacity: .5; }
#recbox { position: absolute; top: 16px; right: 16px; z-index: 5; display: grid; gap: 4px; background: #2B2140; color: #fff; border: 4px solid #fff; border-radius: 18px; padding: 12px 16px; max-width: min(420px, 90%); box-shadow: 0 8px 0 rgba(0,0,0,.35); font-weight: 800; }
#recbox b { font-size: 18px; } #recbox span { font-size: 14px; } #recbox small { font-size: 12px; opacity: .75; }
#recbox .btn-close { justify-self: start; margin-top: 4px; border: 3px solid #fff; border-radius: 999px; background: #FFC53D; color: #2B2140; font-weight: 900; padding: 2px 12px; cursor: pointer; }
body.still #recbox { display: none; }

#bar a.back { background: #fff; color: #2B2140; border: 3px solid #2B2140; border-radius: 999px; padding: 2px 12px; }

#recbox[hidden] { display: none; }

/* 横に広い画面でも動画をバーの上に収める */
#wrap { overflow: hidden; min-height: 0; }
#wrap canvas { max-height: calc(100vh - 56px); max-width: 100vw; }
#bar { position: relative; z-index: 2; }
body.still #wrap canvas { max-height: none; max-width: none; }

/* X でシェア */
#bar .xbtn { width: auto; padding: 0 12px; background: #000; color: #fff; border-color: #fff; white-space: nowrap; }
#recbox .recbtns { display: flex; gap: 8px; margin-top: 4px; }
#recbox .btn-x { border: 3px solid #fff; border-radius: 999px; background: #000; color: #fff; font-weight: 900; padding: 2px 14px; cursor: pointer; }
