* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #f5f3ee; color: #3a2c1e; touch-action: manipulation;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; overflow: hidden; }
#app { touch-action: none; position: fixed; inset: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) 0; background: #f5f3ee; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#done { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 10px; z-index: 5; font: inherit; font-size: 16px; font-weight: 700;
  color: #3a2c1e; background: #fffaf0; border: 2px solid #3a2c1e; border-radius: 22px; height: 44px; padding: 0 18px; }
#done[hidden] { display: none; }

.panel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; overflow-y: auto; overscroll-behavior: contain; padding: 16px; z-index: 10; }
.panel[hidden] { display: none; }
#title { background: rgba(245,243,238,.15); align-items: flex-start; padding-top: max(18vh, 90px); }
#result { background: #f2efe8; align-items: flex-start; padding-top: 24px; }
.box { width: 100%; max-width: 320px; text-align: center; margin: 0 auto; }
#title .box { background: #fffdf7; border: 2px solid #3a2c1e; border-radius: 6px; padding: 14px 16px 12px; box-shadow: 0 4px 0 rgba(58,44,30,.25); }
.box.wide { max-width: 520px; }
h1 { font-size: 44px; letter-spacing: 3px; margin: 0 0 6px; white-space: nowrap; word-break: auto-phrase; text-wrap: pretty; }
button, .button { font: inherit; font-size: 16px; font-weight: 700; color: #3a2c1e; background: #fff; border: 2px solid #3a2c1e; border-radius: 6px;
  padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; word-break: auto-phrase; text-wrap: pretty; }
button.primary { background: #3a2c1e; color: #fff; }
button.big { width: 100%; padding: 14px; font-size: 18px; margin-top: 4px; }
#card { width: 100%; aspect-ratio: 1200 / 630; display: block; margin: 0 auto; border: 2px solid #3a2c1e; border-radius: 4px; }

.row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
#r-post { flex: 1.7; background: #3a2c1e; color: #fff; font-size: 18px; padding: 13px 8px; white-space: nowrap; }
#r-post svg { width: 18px; height: 18px; }
#again { flex: 1; font-size: 15px; padding: 10px 4px; white-space: nowrap; }
#r-share { position: sticky; bottom: 0; margin: 14px -12px 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: #f2efe8; }
#result.lock, #result.lock * { pointer-events: none; }
