/* 札の家 ドット版: the pixel skin over the kit's shell (the same windows, HUD, title and cards; only their look changes).
   The pixel font DotGothic16 (Google Fonts, loaded with every glyph of the game behind the title), square corners, two-pixel frames with
   stepped corners, hard-edged pictures. Sizes stay those of the kit (A12: readable on a phone) - a pixel font is never made smaller. */
:root[data-dot] {
  --gf-font: 'DotGothic16', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', sans-serif;
  --gf-radius: 0px; --gf-radius-lg: 0px; --gf-radius-sm: 0px;
  --dot-ink: #f1e6cc;
  --dot-line: #c9862f;
  --dot-dim: #7a5a2a;
  --dot-bg: #120d09;
  --dot-step: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
  --gf-shadow: none;
  --hk-serif: var(--gf-font);   /* the ending's serif lines: the pixel font too */
}
:root[data-dot] body { font-family: var(--gf-font); letter-spacing: 0.04em; -webkit-font-smoothing: none; font-smooth: never; }
/* every picture with hard edges (the photos are drawn small as pixel art; see js/dot/photos.js) */
:root[data-dot] img, :root[data-dot] canvas, :root[data-dot] .gf-ending-photo, :root[data-dot] .gf-mo-scene-photo, :root[data-dot] [style*="url("] { image-rendering: pixelated; }
:root[data-dot] *, :root[data-dot] *::before, :root[data-dot] *::after { border-radius: 0 !important; }
:root[data-dot] .gf-scanlines { opacity: 0.35; }
/* the film grain overlay is fine noise at screen resolution: it fights the pixels (the dots are the texture here) */
:root[data-dot] .kit-csspost > div[style*="kitGrain"] { display: none !important; }

/* the frames: windows, cards, talk, the HUD boxes */
:root[data-dot] .win, :root[data-dot] .wm-win, :root[data-dot] .gf-talk, :root[data-dot] .kcard, :root[data-dot] .gf-mo-card-in,
:root[data-dot] .tl-lookcard, :root[data-dot] .gf-title-box, :root[data-dot] #objective, :root[data-dot] .kc-fuda, :root[data-dot] .kc-seal,
:root[data-dot] .mg-card, :root[data-dot] .chip {
  border: 2px solid var(--dot-line) !important;
  /* the inner line is an inset shadow of the box itself, not an outline: iPhone Safari drew the outline (offset -6 px) up-left of the
     border and only as tall as part of the window, across the text (水無瀬病院 ドット版, landscape with the address bar, 2026-11-21) */
  box-shadow: 0 0 0 2px #000, 4px 4px 0 2px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 3px var(--dot-dim) !important;
  outline: none !important;
}
/* a window never grows past its frame: the body scrolls inside it; pictures keep their shape */
:root[data-dot] .wm-win { overflow: hidden; }
:root[data-dot] #gf-reader img, :root[data-dot] .tl-lookcard img, :root[data-dot] .kcard img, :root[data-dot] .wm-body img { object-fit: contain; }
:root[data-dot] .wm-head, :root[data-dot] .win-head { border-bottom: 2px dashed var(--dot-dim); }
:root[data-dot] .wm-title, :root[data-dot] .win-title, :root[data-dot] .gf-talk-who { letter-spacing: 0.1em; }
:root[data-dot] .gf-talk-who::before { content: '\25B6\FE0E'; display: inline-block; margin-right: 0.35em; color: var(--dot-line); font-size: 0.8em; }

/* the buttons: a raised block that sinks when pressed */
:root[data-dot] .btn, :root[data-dot] button.btn, :root[data-dot] .gf-sb-btn, :root[data-dot] .wm-btn {
  border: 2px solid var(--dot-line) !important;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.45), inset 2px 2px 0 rgba(255, 255, 255, 0.12), 0 0 0 2px #000 !important;
  clip-path: var(--dot-step);
  transition: none !important;
}
:root[data-dot] .btn:active, :root[data-dot] .gf-sb-btn:active { transform: translate(2px, 2px); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.45), 0 0 0 2px #000 !important; }
:root[data-dot] .btn.primary { background: var(--dot-line) !important; color: #1a1206 !important; }
:root[data-dot] .btn.primary::before { content: '\25B6\FE0E'; margin-right: 0.4em; font-size: 0.75em; vertical-align: 0.1em; }
:root[data-dot] .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* a pixel font reads worse than a smooth one at the same size: no label under 12 px */
:root[data-dot] .sg-step { font-size: max(12px, 1em) !important; }

/* the title */
:root[data-dot] #title .gf-title-box { background: rgba(10, 7, 5, 0.86) !important; }
:root[data-dot] #title h1, :root[data-dot] #title .gf-title { text-shadow: 2px 2px 0 #000, -2px 0 0 #3a0c08, 0 2px 0 #000; letter-spacing: 0.08em; }
:root[data-dot] #title .gf-title-box::after {
  content: attr(data-dot-label); display: block; margin-top: 6px; font-size: 15px; color: var(--dot-line); letter-spacing: 0.3em;
}

/* the HUD: the prompt and the thought band in boxes */
:root[data-dot] #prompt:not(:empty) { background: rgba(10, 7, 5, 0.82); border: 2px solid var(--dot-line); box-shadow: 0 0 0 2px #000; padding: 4px 10px; }
:root[data-dot] #objective { background: rgba(10, 7, 5, 0.8) !important; }
:root[data-dot] .kc-bootbar, :root[data-dot] .gf-boot-bar { height: 8px !important; border: 2px solid var(--dot-line); background: #000 !important; box-shadow: 0 0 0 2px #000; }
:root[data-dot] .kc-bootbar i { background: repeating-linear-gradient(90deg, var(--dot-line) 0 6px, transparent 6px 8px) !important; }
:root[data-dot] .gf-boot-bar::after { background: repeating-linear-gradient(90deg, var(--dot-line) 0 6px, transparent 6px 8px); }

/* the death card and the ending */
:root[data-dot] .gf-mo-card-in { background: rgba(14, 4, 3, 0.92) !important; }
:root[data-dot] .gf-ending-title { text-shadow: 3px 3px 0 #000; letter-spacing: 0.12em; }
:root[data-dot] .gf-ending-photo { filter: contrast(1.05); }

/* top-down: no crosshair (the nearest thing in front is used), the view does not need the mouse */
:root[data-dot="top"] #crosshair { display: none !important; }
:root[data-dot="top"] canvas { cursor: default; }
:root[data-dot="top"] .kit-look-prompt, :root[data-dot="top"] .kit-look-note { display: none !important; }

/* the inner margin (playtest 2026-11-21: 「UIの説明文などの枠からのマージンがほとんどないです」). The frames draw a second line 6 px inside the
   border, which sat on the kit's own 7-12 px: the text nearly touched it. Every framed box keeps at least 14 px between that line and
   its text, on a phone too (checked by tools/dot/frames-steps.mjs with game-kit tools/frame-padding.mjs, kit check P23) */
:root[data-dot] { --gf-win-pad: 22px; }

:root[data-dot] .wm-body:not(.wm-flush) { padding: 22px !important; }
:root[data-dot] .wm-head { padding-left: 20px !important; padding-right: 14px !important; }
:root[data-dot] .sg-card { padding: 14px 18px !important; }
:root[data-dot] .sg-card.sg-lv-off { padding: 10px 16px !important; }
:root[data-dot] .pg-hud { padding: 12px 16px !important; }
:root[data-dot] .pg-big, :root[data-dot] .pg-cur { padding: 16px 20px !important; }
:root[data-dot] .tl-item { padding: 16px 20px !important; }
:root[data-dot] .iv-feel { padding: 12px 16px !important; }
:root[data-dot] #say { padding: 14px 22px !important; }
:root[data-dot] #prompt:not(:empty) { padding: 8px 16px !important; }
:root[data-dot] .gf-title-box { padding: 24px 26px 18px !important; }
:root[data-dot] .gf-mo-card-in, :root[data-dot] .kcard, :root[data-dot] .gf-talk { padding: 20px 24px !important; }
:root[data-dot] .btn, :root[data-dot] .gf-sb-btn { padding-left: max(16px, 1em) !important; padding-right: max(16px, 1em) !important; }
:root[data-dot] .wm-btn { padding: 0 !important; }   /* the ⓘ / × of a window's header: a square with its icon in the middle (P38) */
:root[data-dot] #t-right button, :root[data-dot] .t-btn { padding-left: 10px !important; padding-right: 10px !important; }
:root[data-dot] .tm-tabs { padding-left: 18px !important; padding-right: 18px !important; }
:root[data-dot] .wm-body.wm-flush { padding-left: 8px !important; padding-right: 8px !important; }

/* short landscape phones (844x340 with the address bar): the small badges and the reader's voice box keep 14 px inside their frames */
:root[data-dot] body.gf-phone #kc-fuda, :root[data-dot] body.gf-phone .kc-fuda { padding: 14px 16px !important; }
:root[data-dot] body.gf-phone #prompt:not(:empty) { padding: 14px 18px !important; }
:root[data-dot] #gf-reader aside.iv-voice { padding-top: 14px !important; padding-bottom: 14px !important; }

/* 2.4.0 (kit P44 on the dot layer): DotGothic16 is taller and wider than the serif, so on a short landscape phone (667x375, 844x340) the
   steady-hand and trace-path mini games scrolled and 閉じる fell off the screen. The frame's words get smaller and tighter there. */
@media (max-height: 420px) {
  :root[data-dot] .mgx { font-size: 12px; letter-spacing: 0; line-height: 1.3; }
  :root[data-dot] .mgx .mgx-head { padding-block: 2px; }
  :root[data-dot] .mgx p, :root[data-dot] .mgx .mgx-help { margin-block: 2px; }
}
