* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #2b2724; color: #1b1b1d; 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: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }

/* the お手本 card on the left, its name on the right */
#hud { flex: none; height: 92px; display: flex; align-items: center; gap: 10px; padding: 8px 12px 0; color: #f4efe6; }
#hud.off { visibility: hidden; }
#model { width: 84px; height: 84px; flex: none; background: #3a3430; border: 2px solid #f4efe6; }
#hud-name { flex: 1; display: flex; flex-direction: column; }
#hud-name small { font-size: 12px; font-weight: 700; opacity: .8; }
#hud-name b { font-size: 18px; line-height: 1.3; }
#stage { position: relative; flex: 1; min-height: 0; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.panel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(244,239,230,.9); overflow-y: auto; overscroll-behavior: contain; padding: 16px; z-index: 10; }
.panel[hidden] { display: none; }
#title { background: rgba(244,239,230,.97); }
#result { background: #f4efe6; align-items: flex-start; }
.box { width: 100%; max-width: 360px; text-align: center; margin: auto; }
.box.wide { max-width: 520px; margin-top: 0; }
#tart { width: 100%; height: clamp(150px, 30vh, 230px); display: block; margin: 0 auto 6px; }
h1 { font-size: 52px; letter-spacing: 4px; margin: 0 0 4px; }
.sub { margin: 0 0 24px; font-size: 16px; font-weight: 700; }
button, .button { font: inherit; font-size: 16px; font-weight: 700; color: #1b1b1d; background: #fff; border: 2px solid #1b1b1d; border-radius: 0;
  padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
button.primary, .button.primary { background: #1b1b1d; color: #fff; }
button.big { width: 100%; padding: 14px; font-size: 18px; margin-top: 12px; }
#hero { width: 100%; aspect-ratio: 330 / 330; max-height: 62vh; display: block; margin: 0 auto; }
.row { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
#r-post { flex: 1.5; background: #1b1b1d; color: #fff; font-size: 17px; padding: 13px 6px; white-space: nowrap; }
#r-post svg { width: 18px; height: 18px; }
#again, #next { flex: 1; font-size: 14px; padding: 10px 2px; white-space: nowrap; }
#r-after { margin-top: 18px; }
#r-share { position: sticky; bottom: 0; z-index: 3; margin: 14px -12px 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: #f4efe6; box-shadow: 0 -8px 10px -8px rgba(27,27,29,.28); }
#r-share.wait { pointer-events: none; opacity: .6; }
#r-row { margin-top: 8px; }

/* 文言は文節で折る（docs/game-guidelines.md「文言」） */
h1, .sub, #r-after, #r-row, button, .button { word-break: auto-phrase; text-wrap: pretty; }
