/* 画面の枠「机の上の色紙」。ux B が持つ */
:root { --desk: #3B302A; --paper: #F1E7D2; --ink: #35271F; --main: #C9582F; color-scheme: dark; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { overflow: hidden; overscroll-behavior: none; height: 100%; background: var(--desk); }
body { font-family: ui-rounded, "Hiragino Maru Gothic ProN", system-ui, sans-serif; color: var(--paper); }
#app { position: fixed; inset: 0; margin: 0 auto; max-width: 480px; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom);
  background: var(--desk); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #2A211D; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene { image-rendering: pixelated; }
#fx { touch-action: none; }
button { font: inherit; border: 0; border-radius: 10px; background: var(--paper); color: var(--ink); min-width: 44px; min-height: 44px; padding: 0 10px; box-shadow: 0 2px 0 #1c1410; cursor: pointer; touch-action: manipulation; }
button.main { background: var(--main); color: var(--paper); font-weight: 700; }
button[aria-pressed="true"] { outline: 3px solid var(--main); outline-offset: -1px; }
button:focus-visible { outline: 3px solid #FFD27A; outline-offset: 1px; }
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
/* 読み込み中は紙の地の白い人形だけ。最初の描画で hud.js が取り除く */
#boot { position: absolute; left: 50%; top: 40%; width: 56px; height: 84px; margin-left: -28px; background: #fff; animation: boot 1s ease-in-out infinite alternate;
  clip-path: polygon(30% 0, 70% 0, 82% 12%, 82% 28%, 68% 38%, 80% 42%, 100% 68%, 88% 72%, 70% 52%, 70% 70%, 68% 96%, 84% 100%, 54% 100%, 54% 74%, 46% 74%, 46% 100%, 16% 100%, 32% 96%, 30% 70%, 30% 52%, 12% 72%, 0 68%, 20% 42%, 32% 38%, 18% 28%, 18% 12%); }
@keyframes boot { from { opacity: .25; } to { opacity: 1; } }
.unsupported { position: fixed; inset: 0; z-index: 50; background: var(--desk); display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; padding: 24px; text-align: center; }
@media (prefers-reduced-motion: reduce) { #boot { animation: none; } }

/* PC: 列の左右は、部屋の外と同じ机の色紙（fx-paint.js の drawDesk と同じ色と斜めの筋） */
@media (min-width: 560px) and (min-height: 501px) {
  body { background: var(--desk) repeating-linear-gradient(135deg, #F1E7D217 0 4px, #0000 4px 9.9px); }
}
/* 左右に幅がある時だけ、左に題の札、右に色紙の切れ端の中で隠れる人形（どちらも飾り。押せない） */
@media (min-width: 1000px) and (min-height: 501px) {
  body::before, body::after { position: fixed; top: 50%; width: 210px; pointer-events: none; box-shadow: 0 3px 0 #1c1410, 0 8px 24px #0005; border-radius: 8px; }
  /* 列の幅（paint.css）の半分は 240px 以下。そこから 20px 以上離す */
  body::before { content: "Can't See Me\A どこでしょう"; white-space: pre; right: calc(50% + 264px); translate: 0 -50%; rotate: -3deg;
    padding: 22px 0; text-align: center; font-size: 22px; font-weight: 700; line-height: 1.7; background: var(--paper); color: var(--ink); }
  body::after { content: ''; left: calc(50% + 264px); height: 250px; translate: 0 -50%; rotate: 3deg; border: 10px solid var(--paper);
    background:
      linear-gradient(#fff 0 0) 112px 178px / 14px 36px no-repeat, linear-gradient(#fff 0 0) 112px 204px / 30px 10px no-repeat,
      linear-gradient(#35271F 0 0) 98px 82px / 10px 10px no-repeat, linear-gradient(#35271F 0 0) 122px 82px / 10px 10px no-repeat,
      repeating-linear-gradient(90deg, #A9473A 0 18px, #EBD3AE 18px 30px, #D8A23A 30px 56px, #7F352F 56px 74px); }
}
