/* Windows 98-style pixel font (from 98.css, MIT) */
@font-face { font-family: "Pixel98"; src: url("../assets/fonts/ms_sans_serif.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "Pixel98"; src: url("../assets/fonts/ms_sans_serif_bold.woff2") format("woff2"); font-weight: 700; }

:root {
  --teal: #008080;
  --grey: #c0c0c0;
  --dark: #808080;
  --darker: #404040;
  --light: #dfdfdf;
  --navy: #000080;
  --blue: #1084d0;
  --pixel: "Pixel98", "MS Sans Serif", Tahoma, sans-serif;
}

/* Win98 chrome uses the pixel font; reading text stays in Tahoma */
.titlebar, .taskbar, .startmenu, .icon span, .menubar, .addressbar, .statusbar, .ctrls button {
  font-family: var(--pixel);
  font-size: 11px;
  -webkit-font-smoothing: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: #3b8de0 url("../assets/meadow/meadow-photo.jpg") center / cover no-repeat; /* shown until the 3D meadow is ready */
  color: #000;
  font: 14px/1.45 Tahoma, Verdana, "Segoe UI", system-ui, sans-serif;
}
button { font: inherit; color: inherit; }
a { color: var(--navy); }
[hidden] { display: none !important; }

/* ---------- 3D bevels ---------- */
.out {
  background: var(--grey);
  border: 2px solid;
  border-color: #fff var(--darker) var(--darker) #fff;
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light);
}
.in {
  border: 2px solid;
  border-color: var(--dark) #fff #fff var(--dark);
  box-shadow: inset 1px 1px var(--darker);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 4px 14px;
  background: var(--grey); color: #000; text-decoration: none; cursor: pointer;
  border: 2px solid;
  border-color: #fff var(--darker) var(--darker) #fff;
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light);
}
.btn:active, .btn.pressed {
  border-color: var(--darker) #fff #fff var(--darker);
  box-shadow: inset 1px 1px var(--dark);
}
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -6px; }
.btn.primary { font-weight: bold; box-shadow: 0 0 0 1px #000, inset -1px -1px var(--dark), inset 1px 1px var(--light); }

/* ---------- Desktop ---------- */
#desktop {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 12px;
  overflow: auto;
  min-height: 0;
}

.icons {
  flex: none;
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start;
  gap: 6px;
  max-height: 100%;
}
.icon {
  width: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px;
  background: none; border: 1px dotted transparent; cursor: pointer;
  color: #fff; text-align: center;
}
.icon svg { width: 40px; height: 40px; }
.icon span { font-size: 11px; padding: 0 3px; text-shadow: 1px 1px #000; word-break: break-word; }
.icon.selected span { background: var(--navy); text-shadow: none; }
.icon.selected svg { filter: brightness(.75) sepia(1) hue-rotate(190deg) saturate(3); }
.icon:focus-visible { outline: none; border-color: #fff; }

.icon span { text-shadow: 1px 1px #000, 0 0 3px #000; }

/* Profile window */
.profile { text-align: center; padding: 6px 4px; }
.pf-badge { display: inline-block; margin-bottom: 10px; padding: 1px 10px; font-size: 12px; font-weight: bold; color: #006400; border: 1px solid #006400; }
.pf-name { font-family: "Pixelify Sans", Tahoma, sans-serif; font-size: clamp(30px, 7vw, 40px); line-height: 1.05; color: var(--navy); }
.pf-job { margin-top: 6px; font-size: 18px; font-weight: bold; }
.pf-pitch { margin-top: 10px; font-style: italic; }
.profile .row { justify-content: center; }

/* ---------- Windows ---------- */
.win {
  position: fixed;
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 56px);
  padding: 3px;
  outline: none;
}
.titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 3px 3px 3px 6px;
  background: linear-gradient(90deg, var(--dark), #b5b5b5);
  color: var(--light); font-weight: bold;
  cursor: grab; user-select: none; touch-action: none;
}
.win.active .titlebar { background: linear-gradient(90deg, var(--navy), var(--blue)); color: #fff; }
.titlebar .title { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.titlebar svg { width: 16px; height: 16px; flex: none; }
.ctrls { display: flex; gap: 2px; flex: none; }
.ctrls button { min-height: 0; width: 22px; height: 20px; padding: 0; font-size: 12px; font-weight: bold; line-height: 1; }
.ctrls [data-act="close"] { margin-inline-start: 2px; }

.win-body {
  flex: 1; overflow: auto;
  padding: 16px;
  background: #fff;
}

/* Win98 explorer bits */
.menubar { display: flex; gap: 2px; padding: 3px 2px 2px; }
.menubar span { padding: 1px 6px; cursor: default; }
.menubar span:first-letter { text-decoration: underline; }
.addressbar { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-top: 1px solid #fff; border-bottom: 1px solid var(--dark); margin-bottom: 3px; }
.addressbar .field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 2px 4px; background: #fff; white-space: nowrap; overflow: hidden; }
.addressbar svg { width: 14px; height: 14px; flex: none; }
.statusbar { display: flex; gap: 2px; margin-top: 3px; }
.statusbar span { flex: 1; padding: 2px 6px; border: 1px solid; border-color: var(--dark) #fff #fff var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar span:last-child { flex: 0 0 auto; }

/* Setup wizard (Hire_me.exe) */
.win-body.wizard { display: flex; padding: 0; background: var(--grey); }
.wiz-side {
  flex: 0 0 120px; display: grid; place-items: center; align-content: center; gap: 8px;
  background: linear-gradient(180deg, var(--navy), var(--teal)); color: #fff;
  font: 700 22px "Pixelify Sans", Tahoma, sans-serif; text-align: center; padding: 12px;
}
.wiz-side svg { width: 56px; height: 56px; }
.wiz-main { flex: 1; min-width: 0; padding: 16px; display: flex; flex-direction: column; }
.wiz-main h3 { font-size: 16px; }
.wiz-content { flex: 1; }
.wiz-buttons { display: flex; justify-content: flex-end; gap: 6px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--dark); box-shadow: inset 0 1px #fff; flex-wrap: wrap; }
.wiz-buttons .btn { min-width: 84px; }
.wiz-main .meter.big { background: #fff; }
.wiz-main .links a { background: var(--grey); }
.win.max { left: 0 !important; top: 0 !important; width: 100vw !important; height: calc(100dvh - 40px); max-height: none; }

/* window content */
.win-body h3 { font-size: 15px; margin-bottom: 8px; }
.win-body p + p { margin-top: 10px; }
.muted { color: #555; }
.lead { font-size: 16px; font-weight: bold; color: var(--navy); }
.box { margin-top: 14px; padding: 10px 12px; background: #ffffe1; border: 1px solid #000; }

.exp { padding: 12px 0; border-bottom: 1px dashed var(--dark); }
.exp:first-child { padding-top: 0; }
.exp:last-child { border: 0; padding-bottom: 0; }
.exp-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.exp-head b span { color: var(--teal); }
.result { margin-top: 4px; }
.result::before { content: "✔ "; color: green; font-weight: bold; }
.win-body .result + .result { margin-top: 4px; }
.cv-item ul { margin-top: 2px; }

.skill { margin-bottom: 12px; }
.skill-row { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 4px; }
.meter {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px;
  height: 20px; padding: 2px; background: #fff;
}
.meter.big { grid-template-columns: repeat(20, 1fr); height: 24px; margin: 12px 0 8px; }
.meter i.on { background: var(--navy); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 2px 10px; border: 1px solid var(--dark); background: #eef; }

.project { padding: 10px 0; border-bottom: 1px dashed var(--dark); }
.project:first-child { padding-top: 0; }
.project:last-child { border: 0; }
.folder-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px; border: 1px dotted transparent; background: none; font: inherit; text-align: start; cursor: pointer; }
.folder-link:hover, .folder-link:focus-visible { border-color: var(--dark); background: #e8e8ff; outline: none; }
.folder-link svg { width: 32px; height: 32px; flex: none; }
.folder-link b { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.folder-link .muted { margin-inline-start: auto; font-size: 12px; text-align: end; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.file-icon { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; min-width: 0; padding: 6px 2px; border: 1px dotted transparent; background: none; font: inherit; font-size: 12px; cursor: pointer; }
.file-icon svg { width: 32px; height: 32px; }
.file-icon span { overflow-wrap: anywhere; text-align: center; }
.file-icon:hover, .file-icon:focus-visible { border-color: var(--dark); background: #e8e8ff; outline: none; }
.win-body.viewer { display: flex; flex-direction: column; padding: 0; background: var(--grey); overflow: hidden; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; }
.viewer-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar .btn { flex: none; text-decoration: none; color: inherit; }
.win-body.viewer iframe { display: block; width: 100%; height: min(640px, calc(100dvh - 170px)); border: 2px inset #fff; background: #fff; }
.win.max .win-body.viewer iframe { flex: 1; height: auto; }
.viewer-bar span { min-width: 0; }

.links { list-style: none; display: grid; gap: 8px; }
.links a, .links button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; text-decoration: none; color: #000; text-align: start;
  justify-content: flex-start;
}
.links b { min-width: 72px; }

.files { list-style: none; margin: 10px 0 14px; }
.files li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid #eee; }
.files svg { width: 20px; height: 20px; flex: none; }
.error { margin-top: 10px; color: #b00; font-weight: bold; }

.center { text-align: center; }
.big-emoji { font-size: 44px; line-height: 1; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.center .row { justify-content: center; }

/* ---------- Space Pinball ---------- */
.win-body.pinball { display: flex; flex-direction: column; align-items: center; padding: 0; background: #000; overflow: hidden; }
.pb-game { position: relative; display: flex; width: 100%; justify-content: center; background: #000; }
.pinball canvas { display: block; height: min(560px, calc(100dvh - 170px)); aspect-ratio: 360 / 560; max-width: 100%; min-width: 0; touch-action: none; }
.pb-panel { display: flex; flex-direction: column; gap: 8px; width: 180px; flex: none; padding: 10px 8px; background: linear-gradient(160deg, #3a4170, #151936 60%, #0b0d20); border-left: 3px solid #6f7fb8; color: #cfe0ff; }
.pb-logo { text-align: center; line-height: 1; font-family: Tahoma, sans-serif; font-weight: 700; padding: 6px 0; }
.pb-logo small { display: block; font-size: 14px; color: #ffe066; font-style: italic; }
.pb-logo b { display: block; font-size: 30px; letter-spacing: 2px; background: linear-gradient(#fff, #7fb2ff 55%, #2f4fbf); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1px #0b1150; }
.pb-logo span { display: block; font-size: 14px; letter-spacing: 4px; color: #ff6b6b; }
.pb-screen { padding: 6px 8px; background: #000a26; border: 2px inset #6f7fb8; font: 700 12px/1.3 "Courier New", monospace; color: #6fe3ff; }
.pb-row { display: flex; justify-content: space-between; font-size: 11px; color: #7fa8ff; }
.pb-score { display: block; margin: 4px 0; text-align: right; font-size: 22px; color: #fff; text-shadow: 0 0 6px #3df; white-space: nowrap; overflow: hidden; }
.pb-rank { text-align: center; color: #ffe066; }
.pb-mission { flex: 1; }
.pb-mission small { display: block; color: #7fa8ff; font-size: 10px; }
.pb-mission p { margin: 4px 0 0; }
.pb-msg { min-height: 2.6em; color: #ffe066; }
.pb-keys { margin: 0; font: 10px var(--pixel); color: #8fa3d9; text-align: center; }
.pb-over { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 20, .6); z-index: 2; }
.pb-over[hidden] { display: none; }
.pb-over-box { width: min(320px, 100%); padding: 3px; background: var(--grey); }
.pb-over-box .titlebar { background: linear-gradient(90deg, var(--navy), var(--blue)); color: #fff; cursor: default; }
.pb-over-box .titlebar .btn { min-height: 0; width: 22px; height: 20px; padding: 0; font-size: 12px; font-weight: bold; }
.pb-over-body { padding: 16px; text-align: center; color: #000; }
.pb-over-body p + p { margin-top: 6px; font-weight: bold; }
.pb-over-body .btn { margin-top: 14px; padding: 6px 18px; font-weight: bold; }
.pb-controls { display: flex; gap: 4px; width: 100%; padding: 4px; background: var(--grey); }
.pb-controls .btn { flex: 1; user-select: none; -webkit-user-select: none; touch-action: none; }

/* ---------- SifAmp (Winamp-style player) ---------- */
.win-body.amp { display: flex; flex-direction: column; padding: 0; background: #1d1d29; color: #00e000; font: 11px var(--pixel); -webkit-font-smoothing: none; }
.amp-main { padding: 8px; background: linear-gradient(#41415a, #23232f); border-bottom: 2px solid #000; }
.amp-top { display: flex; gap: 8px; }
.amp-lcd, .amp-marquee { background: #000; border: 2px solid; border-color: #0b0b12 #5f5f7c #5f5f7c #0b0b12; }
.amp-lcd { flex: 0 0 96px; display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.amp-time { font: 700 24px/1 "Courier New", monospace; color: #00ff00; text-align: right; text-shadow: 0 0 4px #00ff0088; }
.amp-time.blink { animation: amp-blink 1s steps(2) infinite; }
@keyframes amp-blink { 50% { opacity: 0; } }
.amp-vis { display: block; width: 100%; height: 22px; image-rendering: pixelated; }
.amp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.amp-marquee { overflow: hidden; white-space: nowrap; padding: 3px 0; color: #00ff00; }
.amp-marquee span { display: inline-block; padding-left: 4px; animation: amp-marquee 14s linear infinite; }
@keyframes amp-marquee { to { transform: translateX(-50%); } }
.amp-meta { display: flex; align-items: center; gap: 4px; color: #00b000; }
.amp-meta span { padding: 0 3px; background: #000; color: #00ff00; }
.amp-meta b { margin-left: auto; color: #ffd23d; }
.amp-vol { display: flex; align-items: center; gap: 6px; color: #aaa; }
.amp-vol input, .amp-seek { flex: 1; min-width: 0; accent-color: #d6a32b; }
.amp-seek { display: block; width: 100%; margin-top: 8px; }
.amp-buttons { display: flex; align-items: center; gap: 3px; margin-top: 6px; }
.amp-spacer { flex: 1; }
.amp-buttons button {
  min-width: 32px; height: 24px; padding: 0 6px;
  display: grid; place-items: center;
  background: linear-gradient(#e2e2ec, #8d8da3); color: #000; cursor: pointer;
  border: 1px solid; border-color: #fff #333 #333 #fff;
  font: 13px/1 system-ui, sans-serif;
}
.amp-buttons button:active { border-color: #333 #fff #fff #333; }
.amp-buttons .toggle { font: 11px var(--pixel); color: #555; }
.amp-buttons .toggle[aria-pressed="true"] { color: #008000; font-weight: bold; }
.amp-pl { flex: 1; display: flex; flex-direction: column; min-height: 130px; background: #000; }
.amp-pl-title { padding: 3px; text-align: center; letter-spacing: 3px; color: #ccc; background: linear-gradient(#41415a, #23232f); }
.amp-pl ol { flex: 1; list-style: none; overflow: auto; padding: 4px 0; }
.amp-pl li { display: flex; gap: 6px; padding: 3px 8px; cursor: pointer; }
.amp-pl li .name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.amp-pl li .dur { margin-left: auto; }
.amp-pl li:hover { background: #14143a; }
.amp-pl li.current { color: #fff; background: #0000c6; }
.amp-pl li.missing { color: #5a5a5a; }
.amp-pl-foot { min-height: 22px; padding: 4px 8px; border-top: 1px solid #333; color: #ffd23d; }

/* ---------- Taskbar ---------- */
.taskbar {
  flex: none;
  height: 40px;
  display: flex; align-items: center; gap: 4px;
  padding: 3px;
  border-left: 0; border-right: 0; border-bottom: 0;
  position: relative; z-index: 1000;
}
.start { height: 100%; font-weight: bold; padding: 0 8px; }
.quick { display: flex; align-items: center; gap: 1px; height: 100%; padding: 0 4px 0 8px; position: relative; }
.quick::before { content: ""; position: absolute; left: 2px; top: 3px; bottom: 3px; width: 3px; border: 1px solid; border-color: #fff var(--dark) var(--dark) #fff; }
.quick a, .quick button { display: grid; place-items: center; width: 26px; height: 26px; font-size: 15px; text-decoration: none; background: none; border: 1px solid transparent; cursor: pointer; }
.quick a:hover, .quick button:hover { border-color: #fff var(--dark) var(--dark) #fff; }
.quick::after { content: ""; margin-left: 4px; align-self: stretch; margin-block: 3px; border-left: 1px solid var(--dark); border-right: 1px solid #fff; }
.start svg { width: 18px; height: 18px; }
.tasks { flex: 1; min-width: 0; height: 100%; display: flex; gap: 4px; overflow-x: auto; }
.task {
  flex: 0 1 170px; min-width: 0; height: 100%; justify-content: flex-start;
  padding: 0 8px;
}
.task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task svg { width: 16px; height: 16px; flex: none; }
.task.active { font-weight: bold; background: repeating-conic-gradient(#fff 0 25%, var(--grey) 0 50%) 0 0 / 2px 2px; }
.tray { height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--grey); white-space: nowrap; }

/* ---------- Start menu ---------- */
.startmenu {
  position: fixed; left: 2px; bottom: 38px; z-index: 1001;
  display: flex; width: 250px;
}
.sm-banner {
  writing-mode: vertical-rl; transform: rotate(180deg);
  padding: 10px 5px;
  background: linear-gradient(0deg, var(--navy), var(--blue));
  color: #fff; font: 700 20px "Pixelify Sans", Tahoma, sans-serif;
}
.sm-banner b { color: #fff; font-weight: 700; }
.sm-banner span { color: var(--grey); font-weight: 500; }
.sm-list { list-style: none; flex: 1; padding: 2px; }
.sm-list a, .sm-list button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px;
  background: none; border: 0; color: #000; text-decoration: none; text-align: start; cursor: pointer;
}
.sm-list a:hover, .sm-list button:hover, .sm-list a:focus-visible, .sm-list button:focus-visible { background: var(--navy); color: #fff; outline: none; }
.sm-list .ico { width: 24px; text-align: center; font-size: 18px; }
.sm-list a, .sm-list button { font-size: 11px; }
.sm-list li:first-child b { font-size: 11px; }
.sm-list hr { border: 0; border-top: 1px solid var(--dark); border-bottom: 1px solid #fff; margin: 3px 2px; }

/* ---------- Quick view CV ---------- */
.cv-overlay {
  position: fixed; inset: 0; z-index: 2000;
  overflow: auto; padding: 20px 16px 40px;
  background: #000a;
}
.cv-bar { max-width: 780px; margin: 0 auto 10px; display: flex; justify-content: flex-end; gap: 8px; }
.cv {
  max-width: 780px; margin: 0 auto; padding: 40px;
  background: #fff; color: #1b1b1b;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 10px 40px #0006;
}
.cv h1 { font-size: 32px; line-height: 1.15; }
.cv .cv-job { font-size: 18px; font-weight: 600; color: var(--teal); }
.cv .cv-contact { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 14px; }
.cv .cv-contact a { color: #1b1b1b; }
.cv .cv-pitch { margin-top: 14px; font-style: italic; }
.cv h2 {
  margin: 24px 0 10px; padding-bottom: 4px;
  font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--teal); border-bottom: 2px solid #e5e5e5;
}
.cv-item + .cv-item { margin-top: 10px; }
.cv-item .cv-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; }
.cv-item .cv-row span { color: #666; font-size: 14px; }
.cv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.cv ul { padding-inline-start: 18px; }

/* ---------- Shut down ---------- */
.shutdown {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-items: center; padding: 24px;
  background: #000; color: #ff8c00; text-align: center; cursor: pointer;
  font: 700 clamp(22px, 4vw, 40px) "Pixelify Sans", Tahoma, sans-serif;
}
.shutdown small { display: block; margin-top: 16px; font: 14px Tahoma, sans-serif; color: #aaa; }

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  #desktop { flex-direction: column; gap: 4px; }
  .icons { display: grid; grid-template-columns: repeat(4, 1fr); max-height: none; }
  .icon { width: auto; min-width: 0; padding: 6px 0; }
  .icon span { font-size: 12px; padding: 0 1px; }
  .win {
    left: 6px !important; top: 6px !important;
    width: calc(100vw - 12px) !important;
    height: calc(100dvh - 52px); max-height: none;
  }
  .titlebar { cursor: default; }
  .ctrls button { width: 34px; height: 28px; font-size: 14px; }
  .ctrls [data-act="max"] { display: none; }
  .quick a:not(:first-child) { display: none; }
  .wiz-side { display: none; }
  .menubar span:nth-child(n+3) { display: none; }
  .cv { padding: 22px 18px; }
  .cv-cols { grid-template-columns: 1fr; }
  .pb-game { flex-direction: column-reverse; align-items: center; }
  .pb-panel { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 4px; border-left: 0; border-bottom: 3px solid #6f7fb8; }
  .pb-panel > * { flex: 1 1 45%; min-width: 0; }
  .pb-logo, .pb-keys { display: none; }
  .pb-score { font-size: 16px; margin: 2px 0; }
  .pb-msg { min-height: 0; }
  .pinball canvas { height: calc(100dvh - 300px); }
  .win-body.viewer iframe { flex: 1; height: auto; min-height: 0; }
  .viewer-bar .btn { font-size: 12px; padding: 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Print: only the CV ---------- */
@media print {
  body { display: block; height: auto; overflow: visible; background: #fff; }
  body > *:not(.cv-overlay) { display: none !important; }
  .cv-overlay { position: static; display: block !important; padding: 0; background: none; }
  .cv-bar { display: none; }
  .cv { box-shadow: none; padding: 0; max-width: none; }
}

/* ---------- Language indicator (tray) + menu ---------- */
.lang-btn {
  display: inline-flex; align-items: center; gap: 3px;
  height: 22px; padding: 0 6px;
  background: var(--navy); color: #fff; border: 0; cursor: pointer;
  font: 700 11px var(--pixel); -webkit-font-smoothing: none;
}
.lang-btn:hover { background: var(--blue); }
.lang-caret { font-size: 9px; }
.lang-btn:focus-visible { outline: 1px dotted #000; outline-offset: 1px; }
.lang-menu {
  position: fixed; z-index: 3000; list-style: none; min-width: 160px; padding: 2px;
  font: 11px var(--pixel); -webkit-font-smoothing: none;
}
.lang-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px;
  background: none; border: 0; color: #000; text-align: start; cursor: pointer; font: inherit; font-size: 13px;
}
.lang-menu [lang="ar"] { font-family: Tahoma, "Segoe UI", sans-serif; font-size: 14px; }
.lang-check { margin-inline-start: auto; }
.lang-menu button:hover, .lang-menu button:focus-visible { background: var(--navy); color: #fff; outline: none; }
.lang-chip { display: inline-grid; place-items: center; min-width: 24px; height: 17px; padding: 0 3px; background: var(--navy); color: #fff; font: 700 11px var(--pixel); }
.lang-menu button:hover .lang-chip, .lang-menu button:focus-visible .lang-chip { background: #fff; color: var(--navy); }

/* ---------- Right-to-left (Arabic) ---------- */
[dir="rtl"] .startmenu { left: auto; right: 2px; }
[dir="rtl"] .quick::before { left: auto; right: 2px; }
[dir="rtl"] .quick { padding: 0 8px 0 4px; }
[dir="rtl"] .quick::after { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .sm-banner { transform: none; }
/* games and the music player keep their physical left/right controls */
[dir="rtl"] .win-body.pinball, [dir="rtl"] .win-body.amp, [dir="rtl"] .pb-controls { direction: ltr; }
[dir="rtl"] .pb-mission, [dir="rtl"] .pb-over-body { direction: rtl; }
/* Arabic text: pixel fonts have no Arabic letters, so use Tahoma, which does */
[dir="rtl"] body, [dir="rtl"] .titlebar, [dir="rtl"] .taskbar, [dir="rtl"] .startmenu, [dir="rtl"] .icon span,
[dir="rtl"] .menubar, [dir="rtl"] .addressbar, [dir="rtl"] .statusbar, [dir="rtl"] .d-app span, [dir="rtl"] .pf-name {
  font-family: Tahoma, "Segoe UI", "Geeza Pro", sans-serif;
}
[dir="rtl"] .addressbar .field { direction: ltr; justify-content: flex-end; }
[dir="rtl"] .pb-screen, [dir="rtl"] .pb-msg { font-family: Tahoma, "Geeza Pro", sans-serif; }
[dir="rtl"] .pb-screen .pb-score { font-family: "Courier New", monospace; }

/* First-visit language tip (yellow Win98 tooltip with a pointer) */
.lang-hint {
  position: fixed; z-index: 2500; width: min(300px, calc(100vw - 16px));
  padding: 10px 10px 10px; background: #ffffe1; color: #000;
  border: 1px solid #000; box-shadow: 3px 3px 0 rgba(0, 0, 0, .35);
  font: 13px/1.35 Tahoma, "Segoe UI", sans-serif;
  animation: lang-pop .25s ease-out;
}
@keyframes lang-pop { from { opacity: 0; transform: translateY(6px); } }
.lang-hint::after { /* pointer towards the language button */
  content: ""; position: absolute; left: calc(var(--arrow-x, 50%) - 8px);
  width: 14px; height: 14px; background: #ffffe1; border: solid #000; transform: rotate(45deg);
}
.lang-hint.above::after { bottom: -8px; border-width: 0 1px 1px 0; }
.lang-hint.below::after { top: -8px; border-width: 1px 0 0 1px; }
.lang-hint-title { margin: 0 22px 8px 0; font-weight: bold; }
[dir="rtl"] .lang-hint-title { margin: 0 0 8px 22px; }
.lang-hint-x { position: absolute; top: 4px; inset-inline-end: 4px; width: 20px; height: 18px; padding: 0; background: none; border: 1px solid transparent; cursor: pointer; font-size: 12px; }
.lang-hint-x:hover { border-color: #000; }
.lang-hint-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lang-pick {
  display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 8px;
  background: var(--grey); color: #000; cursor: pointer; font: inherit;
  border: 2px solid; border-color: #fff var(--darker) var(--darker) #fff;
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light);
}
.lang-pick:active { border-color: var(--darker) #fff #fff var(--darker); box-shadow: inset 1px 1px var(--dark); }
.lang-pick.on { font-weight: bold; box-shadow: 0 0 0 1px #000, inset -1px -1px var(--dark), inset 1px 1px var(--light); }
.lang-pick [lang="ar"] { font-family: Tahoma, "Segoe UI", sans-serif; font-size: 14px; }

/* ---------- Live wallpaper: 3D meadow ---------- */
#wallpaper { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#meadow, #meadow-life { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#meadow { opacity: 0; transition: opacity .8s ease; }
#meadow.on { opacity: 1; }
#desktop { position: relative; z-index: 1; }
