/* Design Tokens & Base Reset — 怪盗トワイッター・モノ〜ノ */
:root {
  --night: #0b0d1b;
  --panel: rgba(14, 17, 34, 0.92);
  --panel-solid: #101326;
  --line: #34396b;
  --line-brass: rgba(234, 184, 77, 0.44);
  --paper: #f6efe0;
  --paper-ink: #1c1826;
  --paper-line: #d4c5a3;
  --cape: #d93b44;
  --cape-deep: #821d26;
  --gold: #eab84d;
  --gold-deep: #8f6b24;
  --moon: #b4c1ff;
  --moon-deep: #5a64a6;
  --alert: #ff4f42;
  --safe: #74dcc4;
  --dark-px: #7056b0;
  --nalsa: #ffb26a;
  --nalsa-deep: #a8582a;
  --nalsa-bg: #1e1410;
  --text: #f3f1fa;
  --dim: #9ea2c9;
  --f-jp: "DotGothic16", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --f-body: "Noto Sans JP", "DotGothic16", "Hiragino Kaku Gothic ProN", sans-serif;
  --f-px: "Pixelify Sans", "IBM Plex Mono", "DotGothic16", ui-monospace, monospace;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  --r-btn: 6px;   /* 押せるものの角。表示だけの枠は、角を斜めに切る */
  --eye: 56px;
  --tb: max(0px, calc(100dvh - 100svh));
  color-scheme: dark;
}

@media (max-width: 380px) {
  :root {
    --eye: 50px;
  }
}

@media (min-width: 760px) {
  :root {
    --eye: 88px;
  }
}

[hidden] {
  display: none !important;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--night);
  color: var(--text);
  overflow: hidden;
  font-synthesis: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-jp);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

img, svg {
  -webkit-user-drag: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  --tb: max(0px, calc(100dvh - 100svh));
  --hud-b: 140px;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--night);
  touch-action: none;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 180ms ease-out;
  background: radial-gradient(ellipse at 50% 50%, transparent 56%, rgba(217, 59, 68, 0.26) 84%, rgba(255, 79, 66, 0.54) 100%);
}

#game {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

button, a, [role="button"] {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  cursor: pointer;
}

button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* 指で遊ぶときは、こちらから移した選択の枠を出さない */
html[data-input="touch"] button:focus-visible,
#gateBtn:focus-visible {
  outline: none;
}

#gateBtn:focus-visible .g-ring {
  filter: drop-shadow(0 0 8px rgba(234, 184, 77, 0.8));
}

.ic {
  width: 16px;
  height: 16px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.ic-card {
  width: 13px;
  height: 13px;
  flex: none;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
}

.kh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(14, 17, 34, 0.78);
  border: 1px solid var(--line);
  font: 12px/1.35 var(--f-body);
  color: var(--text);
}

.kh kbd {
  border-radius: 3px;
  font: 600 11px/1.2 var(--f-mono);
  padding: 1px 5px;
  background: rgba(234, 184, 77, 0.16);
  border: 1px solid var(--line-brass);
  color: var(--gold);
}

#pad, #btns, #cine {
  touch-action: none;
}

.ov {
  touch-action: pan-y;
}
