/* Study Quest — closex.css (V7.8 round 6, lane S, v78-hud): THE ONE CLOSE X, in the TOP-LEFT corner of every window.
 * The user, 30 Oct 2026: "every in-game window gets a close/leave control in the TOP-LEFT corner, the same look and place
 * everywhere" (~13:15) · "an X icon" (~13:16) · "But a nice looking one" (~13:17): forged and inked in the game's own UI language,
 * flat colour + texture, NEVER a gradient, a clear hover and "Close (Esc)" on hover. ONE look for every close of the game:
 * the windows' iron boss (.win-close / .codex-close: panels, the books, the map, the Torba's ✕ ...) and SQ.CloseX's own (.sq-x,
 * js/ui-closex.js, for the windows that had none). Loaded after every window's css, so it wins by order at equal weight.
 * The X: a chamfered iron plate (flat #1b1c1f with a fine speckle), a bronze rim, four rivets and two forged strokes of bone,
 * tapered at the ends; on hover the strokes take the ember and the rim brightens. */

:root {
  --sqx-plate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M5 1h14l4 4v14l-4 4H5l-4-4V5z' fill='%23050506'/%3E%3Cpath d='M5.5 2h13L22 5.5v13L18.5 22h-13L2 18.5v-13z' fill='%231b1c1f' stroke='%238a6a3a' stroke-width='1.2'/%3E%3Crect x='6' y='5' width='1' height='1' fill='%23ffffff' fill-opacity='.06'/%3E%3Crect x='15' y='16' width='1' height='1' fill='%23000' fill-opacity='.4'/%3E%3Crect x='17' y='7' width='1' height='1' fill='%23ffffff' fill-opacity='.05'/%3E%3Crect x='7' y='17' width='1' height='1' fill='%23000' fill-opacity='.35'/%3E%3Ccircle cx='5' cy='5' r='.9' fill='%23c48a45'/%3E%3Ccircle cx='19' cy='5' r='.9' fill='%23c48a45'/%3E%3Ccircle cx='5' cy='19' r='.9' fill='%23c48a45'/%3E%3Ccircle cx='19' cy='19' r='.9' fill='%23c48a45'/%3E%3Cpath d='M7.2 8.4l1.2-1.2 3.6 3.6 3.6-3.6 1.2 1.2-3.6 3.6 3.6 3.6-1.2 1.2-3.6-3.6-3.6 3.6-1.2-1.2 3.6-3.6z' fill='%23050506' transform='translate(.5 .7)'/%3E%3Cpath d='M7.2 8.4l1.2-1.2 3.6 3.6 3.6-3.6 1.2 1.2-3.6 3.6 3.6 3.6-1.2 1.2-3.6-3.6-3.6 3.6-1.2-1.2 3.6-3.6z' fill='%23e8dcc4'/%3E%3C/svg%3E");
  --sqx-plate-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M5 1h14l4 4v14l-4 4H5l-4-4V5z' fill='%23050506'/%3E%3Cpath d='M5.5 2h13L22 5.5v13L18.5 22h-13L2 18.5v-13z' fill='%23241c14' stroke='%23e0a25a' stroke-width='1.3'/%3E%3Crect x='6' y='5' width='1' height='1' fill='%23ffffff' fill-opacity='.06'/%3E%3Crect x='15' y='16' width='1' height='1' fill='%23000' fill-opacity='.4'/%3E%3Ccircle cx='5' cy='5' r='.9' fill='%23f2c97a'/%3E%3Ccircle cx='19' cy='5' r='.9' fill='%23f2c97a'/%3E%3Ccircle cx='5' cy='19' r='.9' fill='%23f2c97a'/%3E%3Ccircle cx='19' cy='19' r='.9' fill='%23f2c97a'/%3E%3Cpath d='M7.2 8.4l1.2-1.2 3.6 3.6 3.6-3.6 1.2 1.2-3.6 3.6 3.6 3.6-1.2 1.2-3.6-3.6-3.6 3.6-1.2-1.2 3.6-3.6z' fill='%23050506' transform='translate(.5 .7)'/%3E%3Cpath d='M7.2 8.4l1.2-1.2 3.6 3.6 3.6-3.6 1.2 1.2-3.6 3.6 3.6 3.6-1.2 1.2-3.6-3.6-3.6 3.6-1.2-1.2 3.6-3.6z' fill='%23ff8a3d'/%3E%3C/svg%3E");
}

/* the place: the top-left corner, the same everywhere (the right-hand spot of the old iron boss is free again) */
:is(.win-close, .codex-close, .tb-close, .sq-x, .nk-x, .az-x, .bw-x, .town-put__x, .jb-sp-x):not(.sqx-keep) {
  position: absolute;
  left: 8px;
  right: auto;
  top: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  color: transparent;
  font-size: 0;
  line-height: 0;
  background: var(--sqx-plate) center / 100% 100% no-repeat;
  box-shadow: none;
  filter: none;
  cursor: pointer;
  z-index: 9;
}
:is(.win-close, .codex-close, .tb-close, .sq-x, .nk-x, .az-x, .bw-x, .town-put__x, .jb-sp-x):not(.sqx-keep) > * { display: none; }
:is(.win-close, .codex-close, .tb-close, .sq-x, .nk-x, .az-x, .bw-x, .town-put__x, .jb-sp-x):not(.sqx-keep):hover { background-image: var(--sqx-plate-hot); filter: none; box-shadow: none; color: transparent; }
:is(.win-close, .codex-close, .tb-close, .sq-x, .nk-x, .az-x, .bw-x, .town-put__x, .jb-sp-x):not(.sqx-keep):active { transform: translateY(1px); }
:is(.win-close, .codex-close, .tb-close, .sq-x, .nk-x, .az-x, .bw-x, .town-put__x, .jb-sp-x):not(.sqx-keep):focus { outline: none; }
:is(.win-close, .codex-close, .tb-close, .sq-x, .nk-x, .az-x, .bw-x, .town-put__x, .jb-sp-x):not(.sqx-keep):focus-visible { box-shadow: 0 0 0 2px #050506, 0 0 0 3px #ff8a3d; }
/* windows whose X sits in a bar (the map view's bar): it stays in its bar, at the LEFT end (fixer r56, play critic B1) */
.wm-bar-end .wm-close { position: relative; left: auto; top: auto; order: -1; }
.wm-bar > .wm-close { position: relative; left: auto; top: auto; flex: none; margin-right: 10px; }
/* a window's title moves clear of the X */
.win-header .win-title, .codex-window__head, .tb-head { padding-left: 34px; }
/* the books' close rides their outer corner like the windows' */
.book-layer .book-close, .book-layer.is-single .book-close, .book-layer.is-single.is-roomy .book-close, .book-layer.lp-book .lp-close, .book-layer.lp-book.is-single .lp-close { left: 8px; right: auto; top: 8px; width: 26px; height: 26px; }
/* the practice window (Today's hunt) */
#st-lectern > .sq-x { left: 6px; top: 6px; }
body.sq-compact :is(.win-close, .codex-close, .tb-close, .sq-x, .nk-x, .az-x, .bw-x, .town-put__x, .jb-sp-x):not(.sqx-keep) { width: 20px; height: 20px; top: 5px; left: 5px; }

/* fixer r56 (play critic r56 B1, the user ~13:15: "the same look and place everywhere"): the windows that kept their own close.
 * The Nauka and the Azbuka: the X is the book's own child (top-left of the cover); their titles move clear of it. */
.nk-layer .nk > .nk-band { padding-left: 44px; }
.nk-layer.is-small .nk > .nk-band { padding-left: 32px; }
.az > .az-x:not(.sqx-keep) { left: 6px; top: 6px; z-index: 9; }
/* the Inkwell and the Knigovez cards (ink.css loads after this file: these win by weight) */
:is(.bw-card, .ik-card) .bw-x:not(.sqx-keep) { left: 8px; right: auto; top: 8px; width: 24px; height: 24px; border-radius: 0; color: transparent; font-size: 0;
  background: var(--sqx-plate) center / 100% 100% no-repeat; }
:is(.bw-card, .ik-card) .bw-x:not(.sqx-keep):hover, :is(.bw-card, .ik-card) .bw-x:not(.sqx-keep):focus-visible { background: var(--sqx-plate-hot) center / 100% 100% no-repeat; color: transparent; }
:is(.bw-card, .ik-card) > h3:first-of-type { padding-left: 26px; }
/* the Putokaz (the town window) and the story / giver cards */
.town-put__head { padding-left: 40px; }
.jb-sp-zone, .jb-gc-name { padding-left: 28px; }
.jb-gc-name { padding-right: 0; }
/* the writer: the X before "Back to the world" in its bar; the Game Menu: the X in its top-left corner */
.wr-top > .sq-x:not(.sqx-keep) { position: relative; left: auto; top: auto; flex: none; }
.gm-menu > .sq-x:not(.sqx-keep) { left: 8px; top: 8px; }
