/* DIRK/OS 98 — chrome + tokens (ADR-003). First-party. No vendored 98.css.
 * Own the whole cascade so nothing fights us. All chrome reads from tokens. */

:root {
  /* Type */
  --font-ui: Tahoma, "MS Sans Serif", "Segoe UI", Geneva, sans-serif;
  --font-mono: "Lucida Console", "Courier New", ui-monospace, monospace;
  --font-pixel: "Dirk Systems Terminal";   /* synthesized 5x7 chrome font (ADR-021) */

  /* Desktop / wallpaper */
  --desk: #0c6b5e;                 /* lounge-teal felt */
  --desk-2: #0a5a50;

  /* Control faces (warm beige-gray — "beige is the brand") */
  --btn-face: #cdc9bd;
  --btn-hi: #fffef7;               /* top/left raised edge */
  --btn-sh: #8f8a7c;               /* inner shadow edge */
  --btn-dk: #3f3c34;               /* bottom/right raised edge */
  --win-face: #cdc9bd;

  /* Title bars — dark gravy brown -> amber (not MS navy) */
  --title-a: #5b2d1d;
  --title-b: #9a5a2a;
  --title-ina: #837c6d;
  --title-inb: #a9a294;
  --title-text: #fff5e6;
  --title-text-ina: #efe9dc;

  /* Fields / lists */
  --field: #fbfaf3;
  --field-ink: #241f18;
  --sel: #5b2d1d;
  --sel-fg: #fff5e6;

  /* System */
  --phos: #3aff6e;                 /* terminals only */
  --amber: #ffb000;
  --line: #8f8a7c;
  --shadow: rgba(0,0,0,0.35);
  --taskbar-h: 34px;
}

/* Pixel chrome font (ADR-021): default on. Puts the synthesized face at the
 * front of the UI stack — any engine that rejects it falls straight back to
 * Tahoma. Reading surfaces use --font-mono, so this only restyles chrome. */
:root.pixel {
  --font-ui: var(--font-pixel), Tahoma, "MS Sans Serif", "Segoe UI", Geneva, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--font-ui); font-size: 13px; color: var(--field-ink);
  background: #000; -webkit-font-smoothing: none;
  user-select: none; -webkit-user-select: none;
}
button { font-family: inherit; font-size: inherit; }

/* ---- Raised / sunken bevels (the whole 98 look lives here) ---- */
.raised {
  background: var(--btn-face);
  border: 2px solid;
  border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 var(--btn-sh);
}
.sunken {
  background: var(--field);
  border: 2px solid;
  border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk);
  box-shadow: inset 1px 1px 0 var(--btn-sh), inset -1px -1px 0 #fff;
}

/* ---- Buttons ---- */
.btn {
  min-width: 68px; padding: 4px 12px; background: var(--btn-face);
  border: 2px solid; border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 var(--btn-sh);
  color: #201c16; cursor: default; line-height: 1.1;
}
.btn:focus-visible { outline: 1px dotted #201c16; outline-offset: -5px; }
.btn:active, .btn[aria-pressed="true"] {
  border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk);
  box-shadow: inset 1px 1px 0 var(--btn-sh);
  padding: 5px 11px 3px 13px;
}
.btn[disabled] { color: var(--btn-sh); text-shadow: 1px 1px 0 #fff; }

/* ---- Text fields ---- */
.field {
  background: var(--field); color: var(--field-ink);
  border: 2px solid; border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk);
  padding: 3px 5px; font-family: var(--font-ui); font-size: 13px;
}
.field:focus { outline: none; }
input.field, select.field { user-select: text; -webkit-user-select: text; }

/* ================= WINDOWS ================= */
#desktop-layer { position: absolute; inset: 0; }
#windows { position: absolute; inset: 0 0 var(--taskbar-h) 0; pointer-events: none; }

/* While dragging/resizing a window, iframes must not swallow mousemove —
   otherwise the drag freezes the moment the cursor crosses an app frame. */
body.wm-drag iframe { pointer-events: none !important; }

.win {
  position: absolute; min-width: 180px; min-height: 90px;
  background: var(--win-face);
  border: 2px solid; border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 var(--btn-sh), 2px 2px 0 var(--shadow);
  display: flex; flex-direction: column; pointer-events: auto;
}
.win.min { display: none; }
.win.max { border-radius: 0; }

.title-bar {
  display: flex; align-items: center; gap: 4px; height: 22px; padding: 0 3px 0 4px;
  background: linear-gradient(90deg, var(--title-ina), var(--title-inb));
  color: var(--title-text-ina); cursor: default; flex: 0 0 auto;
}
.win.active .title-bar {
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-text);
}
.title-bar .t-ico { width: 16px; height: 16px; flex: 0 0 16px; }
.title-bar .t-ico svg { display: block; width: 16px; height: 16px; }
.title-bar .t-text {
  flex: 1 1 auto; font-weight: bold; font-size: 12px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.title-bar .t-controls { display: flex; gap: 2px; }
.tb-btn {
  width: 18px; height: 16px; padding: 0; display: grid; place-items: center;
  background: var(--btn-face); border: 2px solid;
  border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 var(--btn-sh);
  color: #201c16; font-size: 10px; line-height: 1; cursor: default; font-family: var(--font-mono);
}
.tb-btn:active { border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk); box-shadow: none; }
.tb-btn.close { font-weight: bold; }

.win-body {
  flex: 1 1 auto; position: relative; overflow: hidden; margin: 2px;
  border: 2px solid; border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk);
  background: var(--field);
}
.win-body.plain { border: 0; background: var(--win-face); margin: 3px; }
.win-body iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.win.loading .win-body iframe { visibility: hidden; }
.win .frame-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--win-face); color: var(--btn-sh); font-size: 12px;
}
.win:not(.loading) .frame-loading { display: none; }

/* resize handles */
.rz { position: absolute; z-index: 2; }
.rz.e { right: -2px; top: 6px; bottom: 6px; width: 6px; cursor: ew-resize; }
.rz.s { bottom: -2px; left: 6px; right: 6px; height: 6px; cursor: ns-resize; }
.rz.se { right: -2px; bottom: -2px; width: 12px; height: 12px; cursor: nwse-resize; }
.win.fixed .rz { display: none; }

/* status bar used by native apps */
.statusbar {
  display: flex; gap: 3px; padding: 2px; flex: 0 0 auto;
}
.statusbar .cell {
  flex: 1 1 auto; padding: 2px 6px; font-size: 11px; color: #3a352c;
  border: 2px solid; border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk);
  background: var(--win-face); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.statusbar .cell.grow { flex: 4 1 auto; }

/* menubar for native apps */
.menubar { display: flex; gap: 2px; padding: 2px 3px; flex: 0 0 auto; background: var(--win-face); }
.menubar .mi { padding: 2px 8px; cursor: default; }
.menubar .mi:hover { background: var(--sel); color: var(--sel-fg); }

/* ================= NATIVE APP CONTENT ================= */
.pad { padding: 10px; }
.doc {
  height: 100%; overflow: auto; background: var(--field); color: var(--field-ink);
  padding: 10px 12px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; user-select: text; -webkit-user-select: text;
}
.listview {
  height: 100%; overflow: auto; background: var(--field);
  padding: 4px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px;
}
.lv-item {
  width: 84px; padding: 6px 2px; text-align: center; cursor: default;
  display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--field-ink);
}
.lv-item svg { width: 32px; height: 32px; }
.lv-item .lbl { font-size: 11px; line-height: 1.15; word-break: break-word; }
.lv-item.sel { background: var(--sel); }
.lv-item.sel .lbl { color: var(--sel-fg); }

.tree { height: 100%; overflow: auto; background: var(--field); padding: 6px; user-select: none; }
.tree .node { padding: 1px 4px; cursor: default; white-space: nowrap; display:flex; align-items:center; gap:4px; }
.tree .node svg { width: 16px; height: 16px; }
.tree .node.sel { background: var(--sel); color: var(--sel-fg); }
.tree .kids { margin-left: 14px; }

/* ================= DESKTOP ================= */
#desktop {
  position: absolute; inset: 0 0 var(--taskbar-h) 0; overflow: hidden;
  background: var(--desk);
}
#desktop.wp-felt {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 4px),
    radial-gradient(circle at 30% 20%, var(--desk) 0%, var(--desk-2) 100%);
}
#desktop.wp-wattle {
  background-color: var(--desk-2);
  background-image:
    radial-gradient(circle at 6px 6px, rgba(0,0,0,0.15) 2px, transparent 3px),
    radial-gradient(circle at 18px 18px, rgba(255,255,255,0.04) 2px, transparent 3px);
  background-size: 24px 24px;
}
#desktop.wp-teal { background: #008080; }
#desktop.wp-void { background: #05100d; }

#icons {
  position: absolute; inset: 8px; display: flex; flex-direction: column; flex-wrap: wrap;
  align-content: flex-start; gap: 4px;
}
.desk-ico {
  width: 78px; padding: 6px 3px; text-align: center; cursor: default;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #fff; border: 1px dotted transparent;
}
.desk-ico svg { width: 32px; height: 32px; filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5)); }
.desk-ico .lbl {
  font-size: 11.5px; line-height: 1.2; text-shadow: 1px 1px 1px #000; word-break: break-word;
}
/* the pixel face runs wider — shrink desktop labels a touch so they don't clip */
:root.pixel .desk-ico .lbl { font-size: 10px; line-height: 1.3; }
.desk-ico.sel { background: rgba(91,45,29,0.55); border: 1px dotted #fff5e6; }
.desk-ico.sel .lbl { background: var(--sel); padding: 0 2px; }
.desk-ico:focus-visible { outline: 1px dotted #fff5e6; outline-offset: -2px; }

/* ================= TASKBAR ================= */
#taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--taskbar-h);
  display: flex; align-items: center; gap: 4px; padding: 3px 4px;
  background: var(--btn-face); border-top: 2px solid var(--btn-hi);
  box-shadow: inset 0 1px 0 #fff; z-index: 40;
}
#serve-btn {
  display: flex; align-items: center; gap: 5px; padding: 2px 9px 2px 5px; height: 26px;
  font-weight: bold; font-size: 13px;
}
#serve-btn svg { width: 20px; height: 20px; }
#tasks { flex: 1 1 auto; display: flex; gap: 4px; overflow: hidden; }
.task-btn {
  min-width: 120px; max-width: 170px; height: 26px; display: flex; align-items: center; gap: 5px;
  padding: 0 8px; font-size: 12px; overflow: hidden;
}
.task-btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.task-btn .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-btn.active { border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk); box-shadow: inset 1px 1px 0 var(--btn-sh); font-weight: bold; }

#tray {
  display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px;
  border: 2px solid; border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk);
}
#tray .tray-ico { width: 16px; height: 16px; cursor: default; }
#tray .tray-ico svg { width: 16px; height: 16px; display: block; }
#clock { font-size: 12px; min-width: 62px; text-align: center; letter-spacing: 0.2px; cursor: default; }
#clock.glitch { color: #7d2018; }
#drip-ico.dripping svg { animation: traydrip 1.9s ease-in infinite; transform-origin: 50% 0; }
@keyframes traydrip { 0%, 62% { transform: translateY(0); } 80% { transform: translateY(2px) scaleY(1.08); } 100% { transform: translateY(0); } }

/* ================= SERVE MENU ================= */
#serve-menu {
  position: absolute; bottom: var(--taskbar-h); left: 4px; width: 260px; z-index: 60;
  display: none; padding: 3px;
}
#serve-menu.open { display: flex; }
#serve-menu .rail {
  width: 30px; background: linear-gradient(180deg, var(--title-a), var(--title-b));
  color: var(--title-text); writing-mode: vertical-rl; transform: rotate(180deg);
  text-align: center; font-weight: bold; font-size: 14px; letter-spacing: 2px; padding: 8px 0;
}
#serve-menu .items { flex: 1 1 auto; }
.smi {
  display: flex; align-items: center; gap: 9px; padding: 5px 8px; cursor: default; position: relative;
}
.smi svg { width: 22px; height: 22px; flex: 0 0 22px; }
.smi:hover, .smi.open, .smi.kb { background: var(--sel); color: var(--sel-fg); }
.smi.has-sub::after { content: "▸"; position: absolute; right: 8px; }
.smi.sep { height: 0; padding: 0; margin: 3px 4px; border-top: 1px solid var(--btn-sh); border-bottom: 1px solid #fff; }

/* ================= FLYOUT / CONTEXT MENUS ================= */
.menu {
  position: absolute; z-index: 70; min-width: 150px; padding: 2px;
  background: var(--btn-face); border: 2px solid;
  border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi);
  box-shadow: 2px 2px 0 var(--shadow);
}
.menu .item { display: flex; align-items: center; gap: 8px; padding: 4px 20px 4px 10px; cursor: default; position: relative; white-space: nowrap; }
.menu .item svg { width: 16px; height: 16px; }
.menu .item:hover, .menu .item.kb { background: var(--sel); color: var(--sel-fg); }
.menu .item.disabled { color: var(--btn-sh); text-shadow: 1px 1px 0 #fff; }
.menu .item.disabled:hover { background: transparent; color: var(--btn-sh); }
.menu .sep { height: 0; margin: 3px 2px; border-top: 1px solid var(--btn-sh); border-bottom: 1px solid #fff; }
.menu .item .acc { position: absolute; right: 8px; color: inherit; opacity: 0.7; font-size: 11px; }

/* ================= DIALOGS ================= */
#modal-scrim { position: absolute; inset: 0; z-index: 90; display: none; }
#modal-scrim.on { display: block; }
.dialog {
  position: absolute; z-index: 100; min-width: 300px; max-width: 460px;
  left: 50%; top: 42%; transform: translate(-50%, -50%);
}
.dialog .win-body.plain { padding: 0; }
.dialog .dlg-row { display: flex; gap: 12px; padding: 16px 16px 8px; align-items: flex-start; }
.dialog .dlg-ico { flex: 0 0 32px; }
.dialog .dlg-ico svg { width: 32px; height: 32px; }
.dialog .dlg-msg { font-size: 13px; line-height: 1.45; user-select: text; -webkit-user-select: text; }
.dialog .dlg-btns { display: flex; justify-content: center; gap: 8px; padding: 8px 16px 14px; }

/* ================= BOOT / LOGIN (see boot.css for detail) ================= */
#boot-layer, #login-layer, #shutdown-layer {
  position: absolute; inset: 0; z-index: 200; display: none;
}
#boot-layer.on, #login-layer.on, #shutdown-layer.on { display: block; }

/* ================= CRT overlay ================= */
#crt {
  position: absolute; inset: 0; z-index: 300; pointer-events: none; display: none; mix-blend-mode: multiply;
}
#crt.on { display: block; }
#crt::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.16) 0 1px, transparent 1px 3px);
}
#crt::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.35) 100%);
  animation: flick 6s steps(60) infinite;
}
@keyframes flick { 0%,97%,100% { opacity: 0.9; } 98% { opacity: 0.75; } 99% { opacity: 1; } }

/* Toast (registry restore, lore whispers) */
#toaster { position: absolute; right: 8px; bottom: calc(var(--taskbar-h) + 8px); z-index: 80; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.toast {
  padding: 8px 12px; max-width: 300px; font-size: 12px; background: var(--btn-face);
  border: 2px solid; border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi);
  box-shadow: 2px 2px 0 var(--shadow); animation: toastin 0.18s ease-out;
}
.toast b { display: block; margin-bottom: 2px; }
@keyframes toastin { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================= Dirk Explorer (browser) ================= */
.ie-toolbar { display:flex; align-items:center; gap:3px; padding:3px 4px; flex:0 0 auto; background:var(--win-face); border-bottom:1px solid var(--btn-sh); }
.ie-nav { min-width:0 !important; width:auto; padding:3px 8px !important; display:flex; align-items:center; gap:4px; }
.ie-nav svg { width:14px; height:14px; }
.ie-throb { margin-left:auto; width:22px; height:22px; padding:0 4px; }
.ie-throb svg { width:22px; height:22px; display:block; transform-origin:50% 50%; }
.ie-throb.spin svg { animation:iespin .7s linear infinite; }
@keyframes iespin { to { transform:rotate(360deg); } }
.ie-address { display:flex; align-items:center; gap:6px; padding:4px 6px; flex:0 0 auto; background:var(--win-face); border-bottom:1px solid var(--btn-sh); }
.ie-address label { font-size:11px; color:#3a352c; }
.ie-address input { flex:1 1 auto; }
.ie-content { position:relative; flex:1 1 auto; overflow:hidden; background:#fff; }
.ie-content iframe { position:absolute; inset:0; width:100%; height:100%; border:0; background:#fff; }
.ie-page { position:absolute; inset:0; overflow:auto; background:#c7d0d8; display:none; font-family:var(--font-ui); color:#243; }
.ie-start { max-width:560px; margin:0 auto; padding:26px 22px; }
.ie-hero { font-size:26px; font-weight:900; letter-spacing:1px; color:#0a3a5a; text-shadow:1px 1px 0 #fff; }
.ie-start p, .ie-error p { line-height:1.5; }
.ie-bookmarks { display:flex; flex-direction:column; gap:2px; margin:16px 0; background:#eef2f5; padding:10px;
  border:2px solid; border-color:var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk); }
.ie-bookmarks a { color:#0000cc; text-decoration:underline; cursor:default; padding:5px 6px; display:flex; align-items:center; gap:8px; }
.ie-bookmarks a svg { width:16px; height:16px; }
.ie-bookmarks a:hover { background:#000080; color:#fff; text-decoration:none; }
.ie-tip { font-size:11px; color:#5a6b78; margin-top:10px; }
.ie-error { max-width:520px; margin:0 auto; padding:34px 24px; }
.ie-error-h { font-size:20px; font-weight:800; color:#7d2018; letter-spacing:.5px; margin-bottom:10px; }
.ie-error ul { color:#3a4650; line-height:1.6; }
.ie-error a, .ie-start a[data-nav], .ie-start a[data-launch] { color:#0000cc; cursor:default; }

/* ================= screen saver (ADR-017) ================= */
#saver { position: absolute; inset: 0; z-index: 290; display: none; background: #000; cursor: none; }
#saver.on { display: block; }
#saver canvas { display: block; width: 100%; height: 100%; }

/* ================= window zoom (open / minimize / restore) ================= */
.win.zoom-in { animation: winin 0.14s ease-out; }
.win.zoom-out { animation: winout 0.12s ease-in forwards; }
@keyframes winin { from { transform: scale(0.72); opacity: 0.3; } }
@keyframes winout { to { transform: scale(0.72); opacity: 0; } }

/* ================= Wattle (assistant, ADR-018) =================
 * Rides the desktop layer, above windows but below menus/dialogs/toaster.
 * Container is click-through; only the turkey and its bubble take pointer. */
#wattle {
  position: absolute; right: 16px; bottom: calc(var(--taskbar-h) + 12px);
  z-index: 55; width: 64px; pointer-events: none; display: none;
}
#wattle.show { display: block; }
#wattle .w-body {
  position: relative; width: 64px; height: 68px; pointer-events: auto; cursor: pointer;
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.28));
  animation: w-bob 5.5s ease-in-out infinite; transform-origin: 50% 100%;
}
#wattle .w-body svg { display: block; }
@keyframes w-bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1.2deg); } }
#wattle .w-body.w-hop { animation: w-hop 0.52s ease-out; }
@keyframes w-hop { 0% { transform: translateY(0); } 32% { transform: translateY(-15px) rotate(-5deg); } 64% { transform: translateY(0) rotate(3deg); } 100% { transform: translateY(0); } }
/* blink: squish the eye group shut for a beat */
#wattle .w-eyes { transform-box: fill-box; transform-origin: center; transition: transform 0.07s ease; }
#wattle .w-eyes.blink { transform: scaleY(0.12); }

#wattle .w-bubble {
  position: absolute; right: 2px; bottom: calc(100% + 9px); width: 212px;
  pointer-events: auto; padding: 9px 26px 10px 11px; font-size: 12px; line-height: 1.42;
  background: var(--field); color: var(--field-ink);
  border: 2px solid; border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi);
  box-shadow: 2px 2px 0 var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(0.96); transform-origin: 88% 100%;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}
#wattle .w-bubble.show { opacity: 1; visibility: visible; transform: none; }
#wattle .w-bubble::after {  /* speech tail — outer (bevel) triangle */
  content: ""; position: absolute; right: 22px; top: 100%; width: 0; height: 0;
  border: 8px solid transparent; border-top-color: var(--btn-dk);
}
#wattle .w-bubble::before {  /* speech tail — inner (field) triangle */
  content: ""; position: absolute; right: 24px; top: 100%; width: 0; height: 0;
  border: 6px solid transparent; border-top-color: var(--field);
}
#wattle .w-x {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 16px; line-height: 11px;
  padding: 0; font-size: 12px; cursor: pointer; color: var(--field-ink);
  background: var(--btn-face); border: 2px solid;
  border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi);
}
#wattle .w-x:active { border-color: var(--btn-dk) var(--btn-hi) var(--btn-hi) var(--btn-dk); }

/* ================= Gravymine (flag the gizzards) ================= */
.gm-panel { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; overflow: auto; }
.gm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; max-width: 100%; padding: 5px 8px;
  border: 2px solid; border-color: var(--btn-sh) var(--btn-hi) var(--btn-hi) var(--btn-sh); background: var(--btn-face);
}
.gm-led {
  font-family: var(--font-mono); font-weight: bold; font-size: 19px; letter-spacing: 1px;
  color: #ff3b30; background: #1a0a08; padding: 1px 6px; min-width: 50px; text-align: center;
  border: 2px solid; border-color: #3f3c34 #fffef7 #fffef7 #3f3c34;
  text-shadow: 0 0 4px rgba(255,59,48,0.55);
}
.gm-face { width: 32px; height: 32px; min-width: 32px; padding: 0; display: flex; align-items: center; justify-content: center; }
.gm-face svg { display: block; }
.gm-grid {
  display: grid; gap: 0; align-self: center;
  border: 3px solid; border-color: var(--btn-sh) var(--btn-hi) var(--btn-hi) var(--btn-sh); background: var(--btn-sh);
}
.gm-cell {
  width: 24px; height: 24px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: bold; font-size: 14px; line-height: 1;
  cursor: default; user-select: none; -webkit-user-select: none;
}
.gm-cell.covered { background: var(--btn-face); border: 3px solid; border-color: var(--btn-hi) var(--btn-dk) var(--btn-dk) var(--btn-hi); }
.gm-cell.covered:hover { background: #d8d4c8; }
.gm-cell.open { background: #bdb9ad; border: 1px solid var(--btn-sh); }
.gm-cell.open.mine { background: #c98a2e; }
.gm-cell.boom { background: #b23a2e !important; }
.gm-cell.wrongflag { background: #d3b08c; color: #7d2018; }
.gm-cell svg { display: block; pointer-events: none; }

/* ================= DIRK/OS Prompt (fake DOS terminal) ================= */
.dos-term {
  flex: 1 1 auto; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
  background: #05100d; color: var(--phos); font-family: var(--font-mono); font-size: 13px; line-height: 1.34;
  padding: 6px 8px; cursor: text; text-shadow: 0 0 2px rgba(58,255,110,0.4);
}
.dos-out { user-select: text; -webkit-user-select: text; }
.dos-line { white-space: pre-wrap; word-break: break-word; }
.dos-line.echo { color: #cdeccf; }
.dos-row { display: flex; align-items: baseline; }
.dos-ps { white-space: pre; color: var(--phos); flex: 0 0 auto; }
.dos-in {
  flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: none;
  color: var(--phos); font-family: var(--font-mono); font-size: 13px; caret-color: var(--phos);
  text-shadow: inherit; padding: 0;
}

/* ================= reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  #crt::after { animation: none; }
  .toast { animation: none; }
  #drip-ico.dripping svg { animation: none; }
  .win.zoom-in, .win.zoom-out { animation: none; }
  #wattle .w-body, #wattle .w-body.w-hop { animation: none; }
  #wattle .w-bubble, #wattle .w-eyes { transition: none; }
  * { scroll-behavior: auto !important; }
}
