/* deanwild.co.uk: the desktop. A made-up 90s operating system with bevelled grey windows.
   Original styling; no real operating system's name, logo or artwork. */

@font-face {
  font-family: 'Pixelify Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/pixelify-sans-latin-wght-normal.woff2) format('woff2-variations');
}

@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/vt323-latin-400-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2');
}

/* Italics written on the dashboard; loaded only when a window uses them. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-400-italic.woff2) format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-600-italic.woff2) format('woff2');
}

:root {
  --face: #c5c5be;
  --hil: #ffffff;
  --lit: #e2e2dc;
  --shade: #85857f;
  --dark: #0b0b0b;
  --title: #5a3a0c;
  --title-2: #a8670f;
  --title-off: #7d7f79;
  --desk: #2b5f5a;
  --desk-2: #26544f;
  --desk-3: #1f4844;
  --sel: #5a3a0c;
  --link: #0d4f8b;
  --pixel: 'Pixelify Sans', 'Trebuchet MS', Verdana, sans-serif;
  --ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --vga: 'VT323', ui-monospace, monospace;
  color-scheme: light;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--desk);
  color: #111;
  font: 15px/1.25 var(--pixel);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

button {
  font: inherit;
  color: inherit;
}

.bev-out {
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hil), inset -2px -2px var(--shade), inset 2px 2px var(--lit);
}

.bev-in,
.wbtn:active,
.g-btn:active,
.menu-btn[aria-expanded='true'],
.task[aria-pressed='true'] {
  box-shadow: inset -1px -1px var(--hil), inset 1px 1px var(--dark), inset -2px -2px var(--lit), inset 2px 2px var(--shade);
}

/* ------------------------------------------------------------ desktop */

.gui {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.desk {
  position: relative;
  overflow: hidden;
  background: var(--desk);
}

.icons {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: 8px;
  bottom: 10px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 86px);
  grid-auto-columns: 92px;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.icon__img {
  line-height: 0;
}

.icon__label {
  padding: 1px 3px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.icon.is-selected .icon__label {
  background: var(--sel);
  outline: 1px dotted #fff;
}

.icon.is-selected .icon__img {
  filter: brightness(0.7) sepia(0.5);
}

.icon:focus {
  outline: none;
}

.icon:focus-visible .icon__label {
  outline: 1px dotted #fff;
}

/* ------------------------------------------------------------ windows */

.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 3px;
  background: var(--face);
}

.win:focus {
  outline: none;
}

.win.is-min {
  display: none;
}

.win.is-max {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Resize handles along the frame (desktop.js). Invisible; the cursor shows them. */
.win-edge {
  position: absolute;
  z-index: 2;
  touch-action: none;
}

.win-edge--n,
.win-edge--s {
  right: 10px;
  left: 10px;
  height: 6px;
  cursor: ns-resize;
}

.win-edge--e,
.win-edge--w {
  top: 10px;
  bottom: 10px;
  width: 6px;
  cursor: ew-resize;
}

.win-edge--n {
  top: -2px;
}

.win-edge--s {
  bottom: -2px;
}

.win-edge--e {
  right: -2px;
}

.win-edge--w {
  left: -2px;
}

.win-edge--ne,
.win-edge--nw,
.win-edge--se,
.win-edge--sw {
  width: 14px;
  height: 14px;
}

.win-edge--ne {
  top: -2px;
  right: -2px;
  cursor: nesw-resize;
}

.win-edge--sw {
  bottom: -2px;
  left: -2px;
  cursor: nesw-resize;
}

.win-edge--nw {
  top: -2px;
  left: -2px;
  cursor: nwse-resize;
}

.win-edge--se {
  right: -2px;
  bottom: -2px;
  cursor: nwse-resize;
}

.win.is-max .win-edge {
  display: none;
}

/* The ridged grip in the corner of a status bar. */
.win-status .win-grip {
  flex: none;
  width: 14px;
  padding: 0;
  background: linear-gradient(
    135deg,
    transparent 0 45%,
    var(--hil) 45% 50%,
    var(--shade) 50% 58%,
    transparent 58% 66%,
    var(--hil) 66% 71%,
    var(--shade) 71% 79%,
    transparent 79%
  );
  box-shadow: none;
}

.win.is-max .win-grip {
  visibility: hidden;
}

.win-title {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 2px 0 4px;
  background: var(--title-off);
  color: #e6e6e0;
  cursor: default;
  touch-action: none;
  user-select: none;
}

.win.is-active .win-title {
  background: linear-gradient(90deg, var(--title), var(--title-2));
  color: #fff;
}

.win-title h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.win-title svg {
  flex: none;
}

.wbtns {
  display: flex;
  flex: none;
  gap: 2px;
}

.wbtn {
  display: grid;
  place-items: center;
  width: 20px;
  height: 18px;
  padding: 0;
  border: 0;
  background: var(--face);
  cursor: pointer;
}

.wbtn--close {
  margin-left: 2px;
}

.win-tools {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 2px 2px;
}

.win-body {
  flex: 1;
  min-height: 0;
  margin-top: 3px;
  padding: 12px 14px;
  overflow: auto;
  background: #fff;
  color: #161616;
  font: 14px/1.55 var(--ui);
}

.win-body.is-flush {
  padding: 0;
}

/* Pushes what follows it in a toolbar to the right. */
.g-gap {
  flex: 1;
}

/* The CV page, framed in its window (desktop.js); the grey is the page's own. */
.cv-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #7d7f79;
}

/* Freedoom's page, framed in its window (games.js). */
.fd-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.win.is-dialog .win-body {
  background: var(--face);
  font-family: var(--pixel);
}

.win-status {
  display: flex;
  flex: none;
  gap: 3px;
  margin-top: 3px;
  /* The plain font, because the pixel font's 2 and 5 read as an S. */
  font: 12.5px/1.45 var(--ui);
}

.win-status span {
  flex: 1;
  min-width: 0;
  padding: 1px 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: inset 1px 1px var(--shade), inset -1px -1px var(--hil);
}

/* ------------------------------------------------------- window contents */

.gui h3 {
  margin: 0 0 2px;
  color: #111;
  font: 600 22px/1.15 var(--pixel);
}

.gui h4 {
  margin: 16px 0 8px;
  font: 600 16px/1.2 var(--pixel);
}

.win-body p,
.win-body ul,
.win-body ol {
  max-width: 64ch;
  margin: 0 0 10px;
}

.win-body a {
  color: var(--link);
}

.muted {
  color: #5b5d58;
}

.g-btn {
  min-width: 84px;
  padding: 4px 12px;
  border: 0;
  background: var(--face);
  color: #111;
  font: 14px/1.2 var(--pixel);
  text-decoration: none;
  cursor: pointer;
}

.g-btn:focus-visible {
  outline: 1px dotted #111;
  outline-offset: -5px;
}

.g-btn[disabled] {
  color: var(--shade);
  text-shadow: 1px 1px var(--hil);
  cursor: default;
}

.g-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.g-about {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.g-about > div {
  min-width: 0;
}

.g-folder {
  display: grid;
  grid-template-columns: repeat(auto-fill, 108px);
  align-content: start;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-folder .icon {
  width: 108px;
  border: 0;
  background: none;
  color: #111;
  font-family: var(--pixel);
}

.g-folder .icon.is-selected .icon__label {
  color: #fff;
}

.g-folder .icon:focus-visible .icon__label {
  outline-color: #111;
}









.g-thumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.g-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border: 0;
  background: none;
  color: #111;
  font: 13px/1.2 var(--pixel);
  cursor: default;
}

.g-thumb .tf {
  display: block;
  max-width: 100%;
  padding: 2px;
  background: #fff;
  line-height: 0;
}

.g-thumb img {
  display: block;
  max-width: 100%;
  height: 150px;
  width: auto;
  object-fit: contain;
}

.g-thumb.is-wide img {
  height: 108px;
}

.g-thumb .tf--blank {
  display: grid;
  place-items: center;
  width: 192px;
  height: 108px;
  background: #222;
}

.g-thumb.is-selected > span:last-child {
  background: var(--sel);
  color: #fff;
  outline: 1px dotted #fff;
}

.g-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 10px;
  background: #6f716b;
}

.g-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}

.g-player {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #000;
}

.g-player video {
  max-width: 100%;
  max-height: 100%;
}

.g-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.g-list th {
  position: sticky;
  top: 0;
  padding: 3px 8px;
  background: var(--face);
  font: 600 14px var(--pixel);
  text-align: left;
  white-space: nowrap;
}

.g-list td {
  padding: 3px 8px;
  vertical-align: top;
}

.g-list tr:nth-child(even) td {
  background: #f2f2ee;
}

.g-list td:first-child {
  color: #444;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.g-dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 18px;
  margin: 0;
}

.g-dl dt {
  color: #444;
  font-weight: 600;
}

.g-dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.g-radio {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
  font: 14px var(--pixel);
}

.g-radio label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.g-radio input {
  margin: 0;
  accent-color: var(--sel);
}

/* ------------------------------------------------------------ taskbar */

.taskbar {
  position: relative;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(36px + env(safe-area-inset-bottom, 0px));
  padding: 3px 3px calc(3px + env(safe-area-inset-bottom, 0px));
  background: var(--face);
  box-shadow: inset 0 1px var(--lit), inset 0 2px var(--hil);
}

.menu-btn {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px 0 5px;
  border: 0;
  background: var(--face);
  font-weight: 600;
  cursor: pointer;
}

.menu-btn > span:first-child {
  line-height: 0;
}

.tasks {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.task {
  display: flex;
  flex: 0 1 170px;
  align-items: center;
  gap: 5px;
  min-width: 36px;
  height: 30px;
  padding: 0 7px;
  overflow: hidden;
  border: 0;
  background: var(--face);
  font-size: 14px;
  cursor: pointer;
}

.task[hidden] {
  display: none;
}

.task span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task[aria-pressed='true'] {
  background: color-mix(in srgb, var(--lit) 80%, var(--face));
  font-weight: 600;
}

.tray {
  display: flex;
  flex: none;
  align-items: center;
  height: 30px;
  padding: 0 3px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 1px 1px var(--shade), inset -1px -1px var(--hil);
}

.clock {
  height: 24px;
  padding: 0 7px;
  border: 0;
  background: none;
  font: 13px var(--ui);
  font-variant-numeric: tabular-nums;
}

.clock:not([disabled]) {
  cursor: pointer;
}

.clock:focus-visible {
  outline: 1px dotted #111;
}

.clock[disabled] {
  color: inherit;
}

.menu {
  position: absolute;
  left: 3px;
  bottom: calc(39px + env(safe-area-inset-bottom, 0px));
  z-index: 9500;
  display: flex;
  padding: 3px;
  background: var(--face);
}

.menu-band {
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: center;
  width: 28px;
  padding: 10px 0;
  background: linear-gradient(0deg, var(--title), var(--title-2));
  color: #fff;
}

.menu-band span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 600 19px/1 var(--pixel);
  letter-spacing: 0.04em;
}

.menu ul {
  min-width: 200px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu li button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 20px 6px 8px;
  border: 0;
  background: none;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.menu li button:hover,
.menu li button:focus-visible {
  background: var(--sel);
  color: #fff;
  outline: none;
}

.menu hr {
  margin: 3px 2px;
  border: 0;
  border-top: 1px solid var(--shade);
  border-bottom: 1px solid var(--hil);
}

/* -------------------------------------------------------------- boot */

.boot {
  position: fixed;
  inset: 0;
  z-index: 9900;
  padding: max(18px, env(safe-area-inset-top, 0px)) 22px 18px;
  overflow: hidden;
  background: #000;
  color: #b9b9b4;
  font: 22px/1.15 var(--vga);
  white-space: pre-wrap;
  cursor: pointer;
}

.boot:focus {
  outline: none;
}

/* The page arrives with the boot screen already covering the desktop, so the desktop
   never shows before it boots. Without JavaScript it stays out of the way. */
#boot {
  display: none;
}

@media (scripting: enabled) {
  #boot {
    display: block;
  }
}

#boot.is-on {
  display: block;
}

.boot-logo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #000;
  color: #fff;
}

.boot-logo .name {
  font: 600 46px/1 var(--pixel);
  letter-spacing: 0.02em;
}

.boot-logo .rel {
  color: #9a9b96;
  font: 18px/1 var(--pixel);
}

.prog {
  display: flex;
  gap: 3px;
  width: min(270px, 70%);
  height: 18px;
  margin-top: 10px;
  padding: 3px;
  border: 2px solid #8c8c87;
}

.prog i {
  flex: 0 0 calc((100% - 33px) / 12);
  background: #ffb22e;
}

.boot-skip {
  position: absolute;
  right: 18px;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  color: #6d6d69;
  font: 18px/1 var(--vga);
}

/* ------------------------------------------------- clickable lists */

body.is-busy,
body.is-busy * {
  cursor: progress !important;
}

/* ------------------------------------------- list-and-item browsers */
/* Projects and Experience: a list on the left, the chosen item on the right. */

.win-body.is-split {
  padding: 0;
  overflow: hidden;
  background: var(--face);
  container-type: inline-size;
}

.g-split {
  display: flex;
  gap: 4px;
  height: 100%;
}

.g-index {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 1px;
  width: 280px;
  padding: 4px;
  overflow: auto;
  background: #fff;
}

.g-index button {
  display: flex;
  flex: none;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: #161616;
  font: 14px/1.3 var(--ui);
  text-align: left;
  cursor: pointer;
}

.g-index button > svg,
.g-index button > .p-icon {
  flex: none;
  margin-top: 1px;
}

/* A project's own icon picture, fitted into the same square as a pixel icon. */
.p-icon {
  flex: none;
  object-fit: contain;
}

.g-index button > span {
  min-width: 0;
  flex: 1;
}

.g-index button:hover {
  background: #ecece6;
}

.g-index button[aria-current='true'] {
  background: var(--sel);
  color: #fff;
}

.g-index button:focus-visible {
  outline: 1px dotted currentColor;
  outline-offset: -4px;
}

.g-index b {
  font-weight: 600;
}

.g-index small {
  display: block;
  color: #5b5d58;
  font-size: 12.5px;
  line-height: 1.35;
}

.g-index [aria-current='true'] small {
  color: #f1e3cc;
}

.g-index-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.g-index-top small {
  flex: none;
}

.g-pane {
  flex: 1;
  min-width: 0;
  padding: 22px 26px 26px;
  overflow: auto;
  background: #fff;
  color: #161616;
  font: 14.5px/1.6 var(--ui);
  container-type: inline-size;
}

.g-pane:focus {
  outline: none;
}

.g-pane-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.g-pane-head > svg,
.g-pane-head > .p-icon {
  flex: none;
}

.g-pane-head > div {
  flex: 1;
  min-width: 0;
}

.gui .g-pane h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.win-body .g-pane-head p {
  margin: 4px 0 0;
  color: #2c2c2a;
  font-size: 15px;
}

.win-body .g-link {
  margin: 10px 0 0;
  font-size: 14px;
}

.g-link a {
  color: var(--sel);
}

.g-pane-media {
  margin-top: 18px;
}

.g-main {
  max-width: 68ch;
}

.g-desc {
  margin-top: 18px;
}

.g-job {
  margin-top: 20px;
}

.g-chip {
  flex: none;
  padding: 6px 12px;
  background: #f3f3ef;
  color: var(--sel);
  font: 600 16px/1 var(--pixel);
}

.g-related {
  margin-top: 8px;
}

.gui .g-related h4 {
  margin: 0 0 4px;
}

.g-btn--app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 14px/1.2 var(--ui);
}

.g-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.g-address {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 120px;
  height: 26px;
  padding: 0 8px;
  overflow: hidden;
  background: #fff;
  font: 13.5px/1 var(--ui);
  white-space: nowrap;
}

.g-sep {
  color: #85857f;
}

/* The back button only shows on a phone, where list and item take turns. */
.g-back {
  display: none;
  margin-bottom: 14px;
}

@container (max-width: 700px) {
  .g-index {
    width: 210px;
  }
}

.g-btn--icon {
  min-width: 30px;
  padding: 3px 8px;
}

.g-select {
  height: 26px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #111;
  font: 14px var(--pixel);
  box-shadow: inset 1px 1px var(--shade), inset -1px -1px var(--hil), inset 2px 2px var(--dark);
}

/* Shown over a game when it is won, lost or waiting to start. */
.g-over {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(11, 11, 11, 0.55);
  color: #fff;
  font: 16px/1.3 var(--pixel);
  text-align: center;
}

.g-over b {
  font: 600 28px/1.1 var(--pixel);
}

.g-over[hidden] {
  display: none;
}

/* ------------------------------------------------------------- clock */

.g-clock {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 18px 28px;
}

.g-clock__time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.g-face .rim {
  fill: #fff;
  stroke: var(--dark);
  stroke-width: 3;
}

.g-face .mark,
.g-face .hand,
.g-face .pin {
  fill: var(--dark);
}

.g-face .hand--s {
  fill: #b8533a;
}

.g-digits {
  margin-top: 6px;
  padding: 2px 10px;
  background: #0b0b0b;
  color: #ffb22e;
  font: 34px/1 var(--vga);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.g-date {
  font: 600 14px/1.3 var(--ui);
}

.g-zone {
  font-size: 13px;
}

.g-clock__cal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.g-cal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.g-month {
  font: 600 14px var(--ui);
}

.g-cal {
  display: grid;
  grid-template-columns: repeat(7, 28px);
  grid-auto-rows: 24px;
  padding: 4px;
  background: #fff;
  font: 13px var(--ui);
  text-align: center;
  box-shadow: inset 1px 1px var(--shade), inset -1px -1px var(--hil);
}

.g-cal span {
  display: grid;
  place-items: center;
}

.g-cal__head {
  color: #5b5d58;
  font-weight: 600;
}

.g-cal .is-today {
  background: var(--sel);
  color: #fff;
  font-weight: 600;
}

/* --------------------------------------------------------- solitaire */

.sol {
  --gap: 8px;
  --cw: min(72px, calc((100cqw - 6 * var(--gap)) / 7));
  --ch: calc(var(--cw) * 1.4);
  --fd: calc(var(--ch) * 0.09);
  --fu: calc(var(--ch) * 0.27);
  position: relative;
  container-type: inline-size;
  min-height: 100%;
  padding: 12px;
  background: #22624f;
  user-select: none;
  -webkit-user-select: none;
}

.sol__row {
  display: grid;
  grid-template-columns: repeat(7, var(--cw));
  justify-content: space-between;
  margin-bottom: 14px;
}

.pile {
  position: relative;
  width: var(--cw);
  height: var(--ch);
}

.slot,
.card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cw);
  height: var(--ch);
  margin: 0;
  padding: 0;
  border-radius: 4px;
}

.slot {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.12);
  color: rgba(255, 255, 255, 0.7);
  font: 600 calc(var(--cw) * 0.45) / 1 var(--pixel);
  cursor: pointer;
}

.slot.is-blank {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
  cursor: default;
}

.card {
  border: 1px solid var(--dark);
  background: #fff;
  color: var(--dark);
  font-family: var(--pixel);
  text-align: left;
}

.card.is-up {
  cursor: pointer;
  touch-action: none;
}

.card.is-red {
  color: #c8102e;
}

/* Card backs: an original woven pattern in the desktop's amber and brown. */
.card.is-down {
  border: 1px solid var(--dark);
  background:
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(255, 178, 46, 0.35) 3px 4px),
    repeating-linear-gradient(-45deg, #5a3a0c 0 3px, #8a5512 3px 4px);
  box-shadow: inset 0 0 0 2px #fff;
}

.card.is-stock {
  cursor: pointer;
}

.card__corner {
  position: absolute;
  top: 3px;
  left: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1;
}

.card__corner b {
  font: 600 max(11px, calc(var(--cw) * 0.23)) / 1 var(--ui);
  letter-spacing: -0.03em;
}

.card__corner svg {
  width: max(8px, calc(var(--cw) * 0.15));
  height: auto;
}

.card__pip {
  position: absolute;
  right: 12%;
  bottom: 10%;
  line-height: 0;
}

.card__pip svg {
  width: calc(var(--cw) * 0.42);
  height: auto;
}

.card.is-sel {
  background: #ffe4ad;
  box-shadow: 0 0 0 2px #ffb22e;
}

.card:focus-visible,
.slot:focus-visible {
  outline: 2px dotted #fff;
  outline-offset: 1px;
}

.card.is-lifted {
  visibility: hidden;
}

.sol__ghost {
  position: absolute;
  z-index: 10;
  width: var(--cw);
  pointer-events: none;
}

.sol__ghost .card {
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.3);
}

/* ------------------------------------------------------------- mines */

.mn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  padding: 8px;
  background: var(--face);
  container-type: inline-size;
}

.mn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
}

.led {
  min-width: 3ch;
  padding: 0 4px;
  background: #0b0b0b;
  color: #ffb22e;
  font: 28px/1 var(--vga);
  font-variant-numeric: tabular-nums;
}

.mn-msg {
  flex: 1;
  font: 600 15px var(--pixel);
  text-align: center;
}

.mn-well {
  align-self: center;
  padding: 3px;
}

.mn-grid {
  --cs: min(24px, calc((100cqw - 6px) / var(--cols)));
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.mn-row {
  display: flex;
}

.mn-cell {
  display: grid;
  place-items: center;
  width: var(--cs);
  height: var(--cs);
  padding: 0;
  border: 0;
  background: var(--face);
  box-shadow: inset -2px -2px var(--shade), inset 2px 2px var(--hil);
  font: 600 calc(var(--cs) * 0.62) / 1 var(--ui);
  cursor: pointer;
  touch-action: manipulation;
}

.mn-cell svg {
  width: calc(var(--cs) * 0.7);
  height: auto;
}

.mn-cell.is-open {
  background: #d6d6d0;
  box-shadow: inset 1px 1px var(--shade);
  cursor: default;
}

.mn-cell.is-boom {
  background: #c8102e;
}

.mn-cell.is-wrong {
  background: #f0c2c2;
}

.mn-cell:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #111;
  outline-offset: -2px;
}

.mn-cell .n1 { color: #1f3fbf; }
.mn-cell .n2 { color: #1d7a2c; }
.mn-cell .n3 { color: #b3261e; }
.mn-cell .n4 { color: #1b2a6b; }
.mn-cell .n5 { color: #7a1f1f; }
.mn-cell .n6 { color: #1f7a7a; }
.mn-cell .n7 { color: #111; }
.mn-cell .n8 { color: #5b5d58; }

/* ------------------------------------------------------------ blocks */

.bk {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 8px;
  background: var(--face);
  user-select: none;
  -webkit-user-select: none;
}

.bk-main {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 10px;
  min-height: 0;
}

.bk-pit {
  position: relative;
  align-self: flex-start;
  padding: 2px;
  background: #0b0b0b;
  line-height: 0;
  box-shadow: inset 1px 1px var(--shade), inset -1px -1px var(--hil);
}

.bk-canvas {
  display: block;
  image-rendering: pixelated;
}

.bk-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(11, 11, 11, 0.6);
  color: #fff;
  font: 16px/1.3 var(--pixel);
  text-align: center;
}

.bk-over b {
  font: 600 26px/1.1 var(--pixel);
}

.bk-over[hidden] {
  display: none;
}

.bk-side {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 6px;
  width: 92px;
}

.bk-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 7px;
  background: #fff;
  font-size: 13px;
}

.bk-stat span {
  color: #5b5d58;
}

.bk-stat b {
  font: 24px/1 var(--vga);
  font-variant-numeric: tabular-nums;
}

.bk-next {
  width: 64px;
  height: 64px;
  margin-top: 2px;
  image-rendering: pixelated;
}

.bk-help {
  margin: 4px 0 0;
  color: #3c3c3a;
  font-size: 12.5px;
  line-height: 1.45;
}

.bk-pad {
  display: none;
  flex: none;
  gap: 6px;
}

.bk-key {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0;
  font-size: 20px;
  touch-action: none;
}

/* Snake takes swipes on the pit, Bricks follows a dragged finger. */
.sn-canvas,
.br-canvas,
.bk-pit:has(.sn-canvas) {
  touch-action: none;
}

.br-canvas {
  image-rendering: auto;
  cursor: none;
}

/* ------------------------------------------------------------- paint */

.pt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  background: var(--face);
  user-select: none;
  -webkit-user-select: none;
}

.pt-tools {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  align-content: start;
  gap: 2px;
  padding: 6px 4px;
}

.pt-tool,
.pt-size {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: var(--face);
  cursor: pointer;
}

.pt-tool[aria-pressed='true'],
.pt-size[aria-pressed='true'] {
  background: var(--lit);
  box-shadow: inset -1px -1px var(--hil), inset 1px 1px var(--dark), inset -2px -2px var(--lit), inset 2px 2px var(--shade);
}

.pt-tool:focus-visible,
.pt-size:focus-visible,
.pt-swatch:focus-visible {
  outline: 1px dotted #111;
  outline-offset: 1px;
}

.pt-area {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  background: var(--shade);
  box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--hil);
}

.pt-area.is-zoomed {
  place-items: start;
  overflow: auto;
}

.pt-paper {
  width: max-content;
}

.pt-canvas {
  display: block;
  background: #fff;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  touch-action: none;
  cursor: crosshair;
}

.pt-area.is-zoomed .pt-canvas {
  image-rendering: pixelated;
}

.pt-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 6px;
}

.pt-current {
  width: 34px;
  height: 34px;
  flex: none;
}

.pt-swatches {
  display: grid;
  grid-template-columns: repeat(14, 16px);
  grid-auto-rows: 16px;
  gap: 2px;
}

.pt-swatch {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  cursor: pointer;
}

/* "More…" is a label over an invisible colour input, so a click opens the browser's own colour chooser. */
.pt-more {
  position: relative;
  display: grid;
  place-items: center;
  height: 34px;
  padding: 0 10px;
  background: var(--face);
  font-size: 14px;
  cursor: pointer;
}

.pt-more:active {
  box-shadow: inset -1px -1px var(--hil), inset 1px 1px var(--dark), inset -2px -2px var(--lit), inset 2px 2px var(--shade);
}

.pt-more:focus-within {
  outline: 1px dotted #111;
  outline-offset: -5px;
}

.pt-custom {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.pt-sizes {
  display: flex;
  gap: 2px;
}

.pt-dot {
  display: block;
  border-radius: 50%;
  background: #111;
}

.pt-dot--1 { width: 3px; height: 3px; }
.pt-dot--2 { width: 6px; height: 6px; }
.pt-dot--3 { width: 10px; height: 10px; }
.pt-dot--4 { width: 16px; height: 16px; }

.pt-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}

.pt-check.is-off {
  color: var(--shade);
}

.pt-field {
  display: grid;
  gap: 4px;
}

.pt-name {
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #111;
  font: 15px var(--ui);
  box-shadow: inset 1px 1px var(--shade), inset -1px -1px var(--hil), inset 2px 2px var(--dark);
}

.pt-note {
  margin: 10px 0 0;
  color: #3c3c3a;
  font: 13px/1.45 var(--ui);
}

.pt-open {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pt-open .pt-note {
  margin: 0 0 8px;
}

.pt-pics {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 8px;
  overflow: auto;
  list-style: none;
  background: #fff;
  box-shadow: inset 1px 1px var(--shade), inset -1px -1px var(--hil), inset 2px 2px var(--dark);
}

.pt-pics li {
  position: relative;
}

.pt-pic {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 100%;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: #111;
  font: 13px/1.3 var(--ui);
  cursor: pointer;
}

.pt-pic:hover .pt-thumb,
.pt-pic:focus-visible .pt-thumb {
  outline: 2px solid var(--sel);
}

.pt-pic:focus-visible {
  outline: 1px dotted #111;
}

.pt-thumb {
  width: 128px;
  height: 80px;
  box-shadow: 0 0 0 1px var(--shade);
}

.pt-pic__name {
  max-width: 100%;
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pt-pic__date {
  color: #5b5d58;
  font-size: 12px;
}

.pt-del {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 18px;
  padding: 0;
  border: 0;
  background: var(--face);
  cursor: pointer;
}

@media (max-width: 600px) {
  .pt {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .pt-tools {
    grid-auto-flow: column;
    grid-template-columns: none;
    justify-content: start;
    overflow-x: auto;
  }

  .pt-bar {
    grid-column: 1;
  }

  .pt-swatches {
    grid-template-columns: repeat(14, minmax(0, 1fr));
    flex: 1 1 100%;
    order: 5;
  }

  .pt-swatch {
    width: auto;
    height: 20px;
  }
}

@media (pointer: coarse) {
  .bk-pad {
    display: flex;
  }

  .bk-help {
    display: none;
  }
}

/* ------------------------------------------------------- text fields */

/* A sunken white box, for anything typed on the desktop. */
.g-field {
  box-sizing: border-box;
  height: 28px;
  min-width: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #111;
  font: 14px var(--ui);
  box-shadow: inset -1px -1px var(--hil), inset 1px 1px var(--dark), inset -2px -2px var(--lit), inset 2px 2px var(--shade);
}

.g-field:focus {
  outline: 1px dotted #111;
  outline-offset: -5px;
}

.g-field[readonly] {
  background: var(--lit);
  color: #444;
}

textarea.g-field {
  height: auto;
  padding: 8px 10px;
  line-height: 1.55;
  resize: none;
}

/* -------------------------------------------------------------- mail */

.win-body.m-win {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: var(--face);
}

.m-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.m-note {
  margin: 0 0 2px;
  color: #1d1d1b;
  font: 14px/1.5 var(--ui);
}

.m-grid {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  font: 14px var(--pixel);
}

.m-body {
  flex: 1;
  min-height: 120px;
}

/* The field only bots fill in: off screen, out of the tab order. */
.m-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.m-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
}

.win-status .m-count {
  flex: none;
  width: 170px;
}

.m-dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 4px 0;
}

.m-dialog p {
  margin: 0;
}

.m-text {
  font: 14px/1.5 var(--ui);
}

.m-say {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.m-say svg {
  flex: none;
}

.m-end {
  justify-content: flex-end;
  margin-top: 0;
}

/* Sending: blocks that fill from the left and start again. */
.m-prog {
  height: 22px;
  padding: 4px;
  overflow: hidden;
  background: #fff;
}

.m-prog span {
  display: block;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--sel) 0 12px, transparent 12px 14px);
  animation: m-fill 2.4s steps(18) infinite;
}

@keyframes m-fill {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-prog span {
    animation: none;
    clip-path: inset(0 40% 0 0);
  }
}

/* Cloudflare's check draws itself in here, and only when it needs a click. */
.m-check:empty {
  display: none;
}

/* ------------------------------------------------------- high scores */

/* Over the playfield at the end of a game: initials, or the table (scores.js). */
.hs {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  overflow: auto;
  background: #0b0b0b;
  color: #fff;
  font: 16px/1.3 var(--pixel);
  font-variant-ligatures: no-common-ligatures;
  line-height: 1.3;
  text-align: center;
}

.hs b {
  font: 600 24px/1.1 var(--pixel);
}

.hs-score {
  font: 15px/1.4 var(--ui);
}

.hs-place {
  color: #ffb22e;
  font-size: 17px;
}

.hs-note {
  max-width: 28ch;
  color: #ccc;
  font: 13px/1.5 var(--ui);
}

.hs-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #ddd;
  font: 13px var(--ui);
}

/* Three boxes show the letters; a see-through input on top takes the typing. */
.hs-ini {
  position: relative;
  display: flex;
  gap: 8px;
}

.hs-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 50px;
  color: #ffb22e;
  font: 44px/1 var(--vga);
  box-shadow: inset 0 0 0 2px #ffb22e;
}

.hs-box.is-at {
  background: #2a1f0a;
  box-shadow: inset 0 0 0 2px #fff;
}

.hs-box.is-at:empty::after {
  content: '';
  align-self: flex-end;
  width: 22px;
  height: 4px;
  margin-bottom: 8px;
  background: #ffb22e;
}

.hs-input {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  cursor: text;
}

.hs-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.hs-row .g-btn {
  min-width: 80px;
}

.hs-list {
  width: min(220px, 100%);
  margin: 0;
  padding: 0;
  list-style: none;
  font: 20px/1.15 var(--vga);
  font-variant-numeric: tabular-nums;
}

.hs-list li {
  display: flex;
  gap: 10px;
  padding: 0 6px;
}

.hs-rank {
  width: 24px;
  color: #999;
  text-align: left;
}

.hs-who {
  flex: 1;
  text-align: left;
}

.hs-list li.is-mine {
  background: #ffb22e;
  color: #0b0b0b;
}

.hs-list li.is-mine .hs-rank {
  color: inherit;
}

@media (max-width: 600px) {
  .hs-row .g-btn {
    min-height: 44px;
    min-width: 100px;
  }
}

/* The table in its own window (Scores…). */
.hs.hs--win {
  position: static;
  height: 100%;
  box-sizing: border-box;
}

/* The Top box: the best anyone has posted, and who. */
.hs-top {
  background: #fff8e6;
}

.hs-top-who {
  font: 17px/1 var(--vga);
}

.g-btn.hs-open {
  font-size: 13px;
}

/* --------------------------------------------------------- assistant */

/* Pixelify Sans joins "fi" into a glyph that reads like "A" ("Check fit").
   Set on every element: a `font` shorthand would reset an inherited value. */
.win-body.k-win *,
.win-body.k-fit * {
  font-variant-ligatures: no-common-ligatures;
}

.win-body.k-win {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 3px 2px 2px;
  background: var(--face);
}

/* The conversation: a sunken white page that scrolls. */
.k-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 14px 16px 14px 12px;
  overflow-y: auto;
  background: #fff;
  color: #1d1d1b;
  font: 14px/1.55 var(--ui);
}

.k-q {
  align-self: flex-end;
  max-width: 78%;
  padding: 7px 11px;
  background: #e8e0cf;
  box-shadow: inset 0 0 0 1px #b8a985;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.k-a {
  display: flex;
  gap: 10px;
}

.k-a > svg {
  flex: none;
}

.k-a-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.k-a-body p,
.k-prose p {
  margin: 0;
}

.k-typing {
  white-space: pre-wrap;
}

.k-prose {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-wrap: anywhere;
}

.k-prose ul,
.k-prose ol {
  margin: 0;
  padding-left: 20px;
}

.k-prose a,
.k-report a {
  color: var(--link);
}

.k-cut {
  color: #555;
  font-size: 13px;
}

.k-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.g-btn.k-chip {
  padding: 3px 10px;
  font: 13px/1.3 var(--ui);
  text-align: left;
}

.g-btn.k-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.k-form {
  display: flex;
  gap: 6px;
}

.k-q-field {
  flex: 1;
  height: 32px;
}

.g-btn.k-ask {
  min-width: 84px;
  font-weight: 600;
}

/* Waiting: what is happening, a bar that fills, and Stop. */
.k-wait {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.k-wait-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.k-wait-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.k-wait-text {
  font: 13px/1.4 var(--pixel);
}

.m-prog.k-prog {
  height: 16px;
  padding: 3px;
}

/* Check a role: the advert on the left, the report on the right. */
.win-body.k-fit {
  display: flex;
  gap: 6px;
  padding: 3px 2px 2px;
  background: var(--face);
}

.k-fit-form {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  width: 340px;
  padding: 8px 6px 4px;
}

.k-label {
  font: 600 14px/1.2 var(--pixel);
}

.k-advert {
  flex: 1;
  min-height: 160px;
  font-size: 13px;
}

.k-fit-note {
  margin: 0;
  color: #333;
  font: 12.5px/1.45 var(--ui);
}

.k-report {
  flex: 1;
  min-width: 0;
  padding: 18px 24px;
  overflow-y: auto;
  background: #fff;
  color: #1d1d1b;
  font: 14px/1.55 var(--ui);
}

.k-empty {
  margin: 0;
  color: #555;
}

.k-doc {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.k-doc-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.k-doc-head h3 {
  flex: 1;
  margin: 0;
  font: 600 21px/1.25 var(--pixel);
}

.k-doc-head span {
  color: #555;
  font-size: 12.5px;
}

.k-summary {
  margin: 0;
  padding: 10px 12px;
  background: #f2efe6;
  box-shadow: inset 0 0 0 1px #d8d2c2;
}

.k-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.k-cols section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.k-cols h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font: 600 15px/1.2 var(--pixel);
}

.k-cols h4.k-h-gap {
  margin-top: 10px;
}

.k-cols ul,
.k-cols ol {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
}

/* A tick and an exclamation mark on small squares, drawn in CSS. */
.k-mark {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
}

.k-mark--yes {
  background: #1f6f43;
}

.k-mark--yes::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.k-mark--ask {
  background: #b0640f;
}

.k-mark--ask::after {
  content: '!';
  position: absolute;
  inset: 0;
  color: #fff;
  font: 700 10px/12px var(--ui);
  text-align: center;
}

.k-doc-end {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--lit);
}

@media (max-width: 600px) {
  .k-q-field {
    height: 44px;
  }

  .g-btn.k-ask {
    min-width: 72px;
    min-height: 44px;
  }

  .g-btn.k-chip {
    min-height: 40px;
    padding: 6px 12px;
    font-size: 14px;
  }

  .k-log {
    padding: 10px;
    font-size: 15px;
  }

  .win-body.k-fit {
    flex-direction: column;
    overflow-y: auto;
  }

  .k-fit-form {
    width: auto;
  }

  .k-report {
    flex: none;
    overflow: visible;
    padding: 14px;
  }

  .k-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------- phone */

@media (max-width: 600px) {
  .m-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .m-grid label:not(:first-child) {
    margin-top: 6px;
  }

  /* 16px stops phones zooming in on the field. */
  .g-field {
    height: 40px;
    font-size: 16px;
  }

  textarea.g-field {
    height: auto;
  }

  .win-status .m-count {
    width: auto;
  }

  /* Send and Clear share the toolbar, big enough for a thumb. */
  .m-send,
  .m-send + .g-btn {
    flex: 1;
    height: 40px;
    font-size: 15px;
  }

  .icons {
    right: 8px;
    bottom: auto;
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, 88px);
    justify-content: center;
  }

  .win {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .wbtn--max,
  .win-edge {
    display: none;
  }

  .win-grip {
    visibility: hidden;
  }

  .menu-btn__label {
    display: none;
  }

  .g-about {
    flex-direction: column;
  }

  /* Projects and Experience: the list, then one item with a back button. */
  .g-index {
    width: 100%;
  }

  .g-split .g-pane,
  .g-split.is-item .g-index {
    display: none;
  }

  .g-split.is-item .g-pane {
    display: block;
  }

  .g-pane {
    padding: 16px 16px 22px;
  }

  .g-back {
    display: inline-block;
  }

  .g-pane-head {
    flex-wrap: wrap;
  }

  .g-thumb img {
    height: 120px;
  }

  .bk-side {
    width: 76px;
  }

  .bk-stat b {
    font-size: 20px;
  }

  .boot {
    padding: 14px;
    font-size: 18px;
  }

  .boot-logo .name {
    font-size: 36px;
  }
}

/* ===================================================== display settings */
/* Colour schemes, wallpapers, the speaker by the clock, the Display window and
   the screensaver (desktop.js, display.js, saver.js). A visitor's choices are
   kept in their own browser. The games and the boot screen keep their colours. */

/* Colour schemes: WildOS is the :root set at the top of this file. Every scheme
   keeps light window faces, so text colours never change. */
:root[data-scheme='slate'] {
  --face: #c4c8cc;
  --lit: #e3e6e9;
  --shade: #848a90;
  --title: #1d3557;
  --title-2: #44709c;
  --title-off: #7c8288;
  --sel: #1d3557;
  --desk: #34495e;
  --desk-2: #2e4154;
  --desk-3: #263747;
}

:root[data-scheme='moss'] {
  --face: #c8c6b2;
  --lit: #e4e2d4;
  --shade: #86846f;
  --title: #2d4419;
  --title-2: #567431;
  --title-off: #7f7e6c;
  --sel: #2d4419;
  --desk: #4a5a35;
  --desk-2: #42512f;
  --desk-3: #374427;
}

:root[data-scheme='plum'] {
  --face: #cac2c6;
  --lit: #e5dfe2;
  --shade: #877f84;
  --title: #4a1d3e;
  --title-2: #84426f;
  --title-off: #82797e;
  --sel: #4a1d3e;
  --desk: #43303f;
  --desk-2: #3b2a38;
  --desk-3: #31232e;
}

:root[data-scheme='brick'] {
  --face: #cec5bb;
  --lit: #e7e0d8;
  --shade: #8b8279;
  --title: #6e1d10;
  --title-2: #ad4424;
  --title-off: #857d75;
  --sel: #6e1d10;
  --desk: #6a4e3a;
  --desk-2: #5f4534;
  --desk-3: #523b2c;
}

:root[data-scheme='mono'] {
  --face: #c6c6c6;
  --lit: #e3e3e3;
  --shade: #858585;
  --title: #1e1e1e;
  --title-2: #5c5c5c;
  --title-off: #808080;
  --sel: #1e1e1e;
  --desk: #5a5a5a;
  --desk-2: #515151;
  --desk-3: #464646;
}

/* Wallpapers, on the desktop and on the thumbnails in Display. All but Terminal
   and Night take their shade from the scheme. */
.wp-plain {
  background: var(--desk);
}

.wp-dots {
  background: repeating-conic-gradient(var(--desk) 0 25%, var(--desk-3) 0 50%) 0 0 / 4px 4px;
}

.wp-grid {
  background:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--desk);
}

.wp-pinstripe {
  background: repeating-linear-gradient(90deg, var(--desk) 0 7px, var(--desk-3) 7px 8px);
}

.wp-hills {
  background:
    radial-gradient(70% 34% at 22% 104%, var(--desk-3) 99%, transparent 100%),
    radial-gradient(70% 26% at 84% 104%, var(--desk-2) 99%, transparent 100%),
    var(--desk);
}

.wp-icons {
  background: url(/assets/wall-icons.svg) 0 0 / 80px 80px, var(--desk);
}

.wp-terminal {
  background:
    repeating-linear-gradient(0deg, rgba(255, 178, 46, 0.07) 0 1px, transparent 1px 3px),
    url(/assets/wall-logo.svg) center / 96px no-repeat,
    #0b0b0b;
}

.wp-night {
  background:
    radial-gradient(1.5px 1.5px at 12px 18px, #fff 99%, transparent),
    radial-gradient(1px 1px at 70px 50px, #cfd8e6 99%, transparent),
    radial-gradient(1.5px 1.5px at 100px 12px, #ffe7a8 99%, transparent),
    radial-gradient(1px 1px at 40px 80px, #fff 99%, transparent) 0 0 / 120px 96px,
    #10151f;
}

/* The speaker by the clock: sound on and off. */
.speaker {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: pointer;
}

.speaker:focus-visible {
  outline: 1px dotted #111;
}

/* ----------------------------------------------------- Display window */

.win-body.dp-body {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--face);
  color: #111;
  font: 14px/1.25 var(--pixel);
}

.dp-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  padding: 10px 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dp-tab {
  flex: none;
  margin-top: 3px;
  padding: 4px 12px;
  border: 0;
  background: var(--face);
  font: 14px var(--pixel);
  cursor: pointer;
  box-shadow: inset 1px 1px var(--hil), inset 2px 2px var(--lit), inset -1px 0 var(--dark), inset -2px 0 var(--shade);
}

.dp-tab[aria-selected='true'] {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 6px 14px 8px;
  font-weight: 600;
}

.dp-tab:focus-visible,
.dp-row:focus-visible,
.dp-wall:focus-visible {
  outline: 1px dotted #111;
  outline-offset: -4px;
}

.dp-sheet {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  margin: -2px 10px 0;
  padding: 16px;
  overflow: auto;
  background: var(--face);
}

.dp-sheet[hidden] {
  display: none;
}

.dp-cols {
  display: flex;
  flex: 1;
  gap: 16px;
  min-height: 0;
}

.dp-side {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 6px;
  width: 176px;
}

.dp-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dp-label {
  font-size: 14px;
}

.dp-side .dp-label + .g-select {
  height: 30px;
}

.dp-side .g-select {
  margin-bottom: 4px;
}

.dp-list {
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: #fff;
}

.dp-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: #111;
  font: 14px var(--pixel);
  text-align: left;
  cursor: pointer;
}

.dp-row[aria-selected='true'] {
  background: var(--sel);
  color: #fff;
}

.dp-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 1px var(--dark);
}

.dp-row[aria-selected='true'] .dp-swatch {
  box-shadow: 0 0 0 1px #fff;
}

.dp-note {
  margin: 0;
  font: 13px/1.45 var(--ui);
}

.dp-foot {
  display: flex;
  flex: none;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 10px 8px;
}

.dp-foot .g-btn {
  min-width: 80px;
}

.dp-foot .is-default {
  outline: 1px solid var(--dark);
  font-weight: 600;
}

/* The sample: two windows on the wallpaper, in the scheme being tried. */
.dp-sample {
  position: relative;
  flex: 1;
  min-height: 190px;
  padding: 2px;
}

.dp-sample > div {
  position: absolute;
  inset: 2px;
  overflow: hidden;
}

.dp-mini {
  position: absolute;
  display: flex;
  flex-direction: column;
  padding: 3px;
  background: var(--face);
}

.dp-mini--off {
  left: 5%;
  top: 6%;
  width: 66%;
  height: 46%;
}

.dp-mini--on {
  left: 18%;
  top: 24%;
  right: 5%;
  bottom: 6%;
}

.dp-mini-title {
  display: flex;
  flex: none;
  align-items: center;
  height: 20px;
  padding: 0 5px;
  overflow: hidden;
  background: var(--title-off);
  color: #e6e6e0;
  font: 600 13px var(--pixel);
  white-space: nowrap;
}

.dp-mini--on .dp-mini-title {
  background: linear-gradient(90deg, var(--title), var(--title-2));
  color: #fff;
}

.dp-mini-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 0;
  margin-top: 3px;
  padding: 6px 8px;
  overflow: hidden;
  background: #fff;
  font: 13px/1.3 var(--ui);
}

.dp-mini-sel {
  padding: 0 4px;
  background: var(--sel);
  color: #fff;
}

.dp-mini-link {
  color: var(--link);
  text-decoration: underline;
}

.dp-mini-foot {
  display: flex;
  flex: none;
  justify-content: flex-end;
  padding-top: 5px;
}

.dp-mini-foot .g-btn {
  min-width: 70px;
  padding: 3px 10px;
  font-size: 13px;
  pointer-events: none;
}

/* Wallpaper thumbnails. */
.dp-walls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 12px 14px;
}

.dp-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 0;
  background: none;
  color: #111;
  font: 13px var(--pixel);
  cursor: pointer;
}

.dp-thumb {
  display: block;
  width: 100%;
  max-width: 116px;
  aspect-ratio: 116 / 74;
  padding: 2px;
}

.dp-thumb > span {
  display: block;
  width: 100%;
  height: 100%;
}

.dp-thumb .wp-terminal {
  background-size: auto, 30px, auto;
}

.dp-wall[aria-checked='true'] .dp-thumb {
  outline: 2px solid var(--dark);
  outline-offset: 2px;
}

.dp-wall-name {
  padding: 0 4px;
}

.dp-wall[aria-checked='true'] .dp-wall-name {
  background: var(--sel);
  color: #fff;
}

/* The screensaver's preview: the real one, running in a small box. */
.dp-preview {
  height: 210px;
  padding: 2px;
}

.dp-preview > div {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.dp-end {
  display: flex;
  justify-content: flex-end;
}

/* Sound. */
.dp-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
}

.dp-check input,
.dp-set input,
.dp-vol input {
  margin: 0;
  accent-color: var(--title);
}

.dp-check input {
  width: 18px;
  height: 18px;
}

.dp-vol {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dp-vol label {
  width: 90px;
}

.dp-vol input {
  width: min(220px, 100%);
}

.dp-set {
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--shade);
  box-shadow: 1px 1px var(--hil);
}

.dp-set legend {
  padding: 0 4px;
}

.dp-set div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font: 14px/1.4 var(--ui);
}

.dp-set label {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.dp-set b {
  font-weight: 600;
}

.dp-off {
  opacity: 0.5;
}

/* --------------------------------------------------------- screensaver */

.saver {
  position: fixed;
  inset: 0;
  z-index: 9800;
  overflow: hidden;
  background: #000;
  cursor: none;
}

.ss-drift {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 0;
  will-change: transform;
}

.ss-drift img {
  display: block;
  width: 100%;
  height: 100%;
}

.ss-show {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(80%, 460px);
  opacity: 0;
  transition: opacity 0.8s;
}

.ss-show.is-on {
  opacity: 1;
}

.ss-show img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.ss-show b {
  color: #ffb22e;
  font: 400 44px/1 var(--vga);
  overflow-wrap: anywhere;
}

.ss-show span {
  color: #b9b9b4;
  font: 24px/1.15 var(--vga);
}

.ss-term {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 28px 32px;
  overflow: hidden;
  color: #ffb22e;
  font: 26px/1.15 var(--vga);
  white-space: pre-wrap;
}

.ss-term i {
  font-style: normal;
}

.ss-term i.is-on {
  background: #ffb22e;
}

.ss-still {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #ffb22e;
  font: 44px/1 var(--vga);
}

.ss-none {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #85857f;
  font: 13px var(--ui);
}

/* Smaller type in the preview box. */
.dp-preview .ss-show b {
  font-size: 28px;
}

.dp-preview .ss-show span {
  font-size: 18px;
}

.dp-preview .ss-show img {
  width: 32px;
  height: 32px;
}

.dp-preview .ss-term {
  padding: 12px 14px;
  font-size: 18px;
}

.dp-preview .ss-still {
  gap: 8px;
  font-size: 28px;
}

@media (max-width: 600px) {
  .speaker {
    width: 40px;
    height: 32px;
  }

  .dp-tab {
    padding: 6px 10px;
  }

  .dp-tab[aria-selected='true'] {
    padding: 8px 12px 10px;
  }

  .dp-sheet {
    margin: -2px 6px 0;
    padding: 12px;
  }

  .dp-cols {
    flex-direction: column;
  }

  .dp-side {
    width: auto;
  }

  .dp-row {
    min-height: 44px;
    font-size: 15px;
  }

  .dp-sample {
    min-height: 140px;
  }

  .dp-walls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dp-foot {
    padding: 8px 6px 6px;
  }

  .dp-foot .g-btn {
    flex: 1;
    height: 44px;
    font-size: 15px;
  }

  .ss-show b {
    font-size: 34px;
  }

  .ss-show span {
    font-size: 20px;
  }

  .ss-term {
    padding: 18px;
    font-size: 20px;
  }
}
