/* The frame round the game (ui/stage.js): the 16:9 stage and what fills the
   window around it. */
:root{color-scheme:light;background:#2b2a26}
html,body{margin:0;height:100%;overflow:hidden;background:#2b2a26}
body{position:fixed;inset:0;overscroll-behavior:none}
/* Two fingers never zoom the page: the game is fitted to the window, and a page
   zoomed in left its controls off the screen with no way back. The map zooms
   with two fingers itself (ui/app.js). */
html,body{touch-action:pan-x pan-y}
/* The key visual, blurred and darkened, under a paper grain and a vignette:
   the colour of the opening's evening light rather than a black bar. */
#backdrop{position:fixed;inset:-40px;background:#3b3128 url("./assets/story/key-visual-wide.webp") center/cover no-repeat;filter:blur(26px) brightness(.5) saturate(.85);transform:scale(1.04)}
#backdrop::after{content:"";position:fixed;inset:0;background:radial-gradient(ellipse at center,rgba(43,42,38,0) 40%,rgba(30,26,22,.55) 100%),repeating-radial-gradient(circle at 23% 31%,rgba(255,253,244,.035) 0 1px,transparent 1px 3px)}
#stage{position:fixed;overflow:visible;box-shadow:0 0 0 1px rgba(181,142,76,.55),0 18px 60px rgba(0,0,0,.45);background:#f6f7f2}
#game{position:absolute;left:0;top:0;border:0;display:block;transform-origin:0 0;background:#f6f7f2}
/* Crop marks at the corners of the sheet, and registration targets at the
   middle of each side, where the bars have room for them. */
.crop{position:absolute;width:18px;height:18px;pointer-events:none;opacity:.75}
.crop::before,.crop::after{content:"";position:absolute;background:#e8dcc4}
.crop::before{width:18px;height:1px}.crop::after{width:1px;height:18px}
.crop.tl{left:-24px;top:-24px}.crop.tl::before{bottom:6px;right:0}.crop.tl::after{right:6px;bottom:0}
.crop.tr{right:-24px;top:-24px}.crop.tr::before{bottom:6px;left:0}.crop.tr::after{left:6px;bottom:0}
.crop.bl{left:-24px;bottom:-24px}.crop.bl::before{top:6px;right:0}.crop.bl::after{right:6px;top:0}
.crop.br{right:-24px;bottom:-24px}.crop.br::before{top:6px;left:0}.crop.br::after{left:6px;top:0}
.register{position:absolute;width:16px;height:16px;border:1px solid #e8dcc4;border-radius:50%;opacity:0;pointer-events:none;background:linear-gradient(#e8dcc4,#e8dcc4) center/1px 22px no-repeat,linear-gradient(#e8dcc4,#e8dcc4) center/22px 1px no-repeat}
.register.top{left:calc(50% - 9px);top:-22px}.register.bottom{left:calc(50% - 9px);bottom:-22px}
.register.left{top:calc(50% - 9px);left:-22px}.register.right{top:calc(50% - 9px);right:-22px}
body.bars-y .register.top,body.bars-y .register.bottom,body.bars-x .register.left,body.bars-x .register.right{opacity:.7}
body:not(.bars-x):not(.bars-y) .crop{display:none}
body.bars-y:not(.bars-x) .crop.tl,body.bars-y:not(.bars-x) .crop.bl{left:0}
body.bars-y:not(.bars-x) .crop.tr,body.bars-y:not(.bars-x) .crop.br{right:0}
body.bars-x:not(.bars-y) .crop.tl,body.bars-x:not(.bars-y) .crop.tr{top:0}
body.bars-x:not(.bars-y) .crop.bl,body.bars-x:not(.bars-y) .crop.br{bottom:0}

html.pad-pointer-mode,html.pad-pointer-mode *{cursor:none!important}
.portrait-editor {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) 0 auto;
  width: min(92vw, 420px);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid #c3d0bf;
  border-radius: 14px;
  background: #fffefa;
  color: #303b33;
  font: 16px system-ui, sans-serif;
}
.portrait-editor::backdrop { background: #172b2480; }
.portrait-editor form, .portrait-editor label { display: grid; gap: 8px; }
.portrait-editor form > div { display: flex; justify-content: flex-end; gap: 8px; }
.portrait-editor label { display: grid; gap: 6px; flex: 1; min-width: 0; }
.portrait-editor input, .portrait-editor textarea, .portrait-editor button {
  min-width: 0;
  padding: 9px;
  border: 1px solid #a7b8a3;
  border-radius: 7px;
  font: inherit;
}
.portrait-editor button[type=button] { background: #f1f4ed; color: #30483a; }
.portrait-editor button:not([type]) { background: #355e49; color: white; }
