:root {
  --teal: #008080;
  --face: #c0c0c0;
  --navy: #000080;
  --lo: #808080;
  --dk: #0a0a0a;
  --light: #dfdfdf;
  --green: #3cff6e;
  --raised: inset -1px -1px var(--dk), inset 1px 1px #fff, inset -2px -2px var(--lo), inset 2px 2px var(--light);
  --sunken: inset 1px 1px var(--lo), inset -1px -1px #fff, inset 2px 2px var(--dk), inset -2px -2px var(--light);
  --field: inset 1px 1px var(--lo), inset -1px -1px #fff;
  /* retro pointers */
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='31' viewBox='0 0 13 20' shape-rendering='crispEdges'%3E%3Cpath d='M.5.5v16l4-4 2.5 6 2-1-2.5-5.5h5z' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E") 1 1, default;
  --wait: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='31' viewBox='0 0 13 20' shape-rendering='crispEdges'%3E%3Cpath d='M.5.5h12v2h-1v3l-4 4 4 4v3h1v2H.5v-2h1v-3l4-4-4-4v-3h-1z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M3 4h7l-3.5 4zM3 17l3.5-4 3.5 4z' fill='%23000'/%3E%3C/svg%3E") 10 15, wait;
}
*, *::before, *::after { cursor: var(--arrow) !important; }
#boot, #boot * { cursor: var(--wait) !important; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--teal);
  font: 12px/1.35 "Pixelated MS Sans Serif", "Microsoft Sans Serif", Tahoma, Arial, sans-serif;
  color: #000;
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* no double-tap-to-zoom delay on phones */
}
button { font: inherit; color: inherit; }
a { color: var(--navy); }
[hidden] { display: none !important; }

/* ---------- Desktop icons ---------- */
#desktop {
  position: absolute; inset: 0 0 30px 0; padding: 8px;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 78px);
  grid-auto-columns: 84px; gap: 6px 4px; align-content: start;
}
.icon {
  background: none; border: 0; padding: 4px 2px; width: 84px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: #fff; text-align: center; cursor: default;
}
.icon svg { width: 32px; height: 32px; flex: none; }
.icon span { padding: 0 2px; line-height: 1.25; overflow-wrap: break-word; }
.icon.sel span { background: var(--navy); color: #fff; outline: 1px dotted #fff; }
.icon.sel svg { filter: brightness(.55) sepia(1) hue-rotate(190deg) saturate(5); }
.icon:focus { outline: none; }

/* ---------- Windows ---------- */
.win {
  position: absolute; background: var(--face); padding: 3px; box-shadow: var(--raised);
  display: flex; flex-direction: column;
  max-width: calc(100vw - 8px); max-height: calc(100vh - 38px);
}
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - 30px); max-height: none; max-width: none; }
.win.max .body { height: auto !important; }
.title {
  background: linear-gradient(90deg, var(--navy), #1084d0); color: #fff; font-weight: bold;
  height: 20px; padding: 0 2px 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  touch-action: none; flex: none;
}
.win.inactive .title { background: linear-gradient(90deg, var(--lo), #b5b5b5); color: var(--face); }
.title .t { display: flex; align-items: center; gap: 4px; min-width: 0; }
.title .t svg { width: 14px; height: 14px; flex: none; }
.tt { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ctrls { display: flex; gap: 0; flex: none; }
.ctrls [data-a="close"] { margin-left: 2px; }
.btn {
  background: var(--face); border: 0; width: 16px; height: 14px; padding: 0;
  font: bold 11px/1 Tahoma, sans-serif; color: #000; box-shadow: var(--raised);
}
.btn:active, .b95:active { box-shadow: var(--sunken); }
.menu { padding: 2px 2px; display: flex; flex: none; }
.menu span { padding: 1px 6px; }
.menu span::first-letter { text-decoration: underline; }
.body {
  background: #fff; margin: 2px 1px; padding: 8px; overflow: auto; flex: 1 1 auto; min-height: 0;
  box-shadow: var(--sunken);
}
.body.flush { background: var(--face); box-shadow: none; padding: 4px; }
.body.notepad { padding: 6px 8px; font: 13px/1.5 "Courier New", monospace; white-space: pre-wrap; user-select: text; }
.status { margin: 2px 1px 0; padding: 2px 5px; box-shadow: var(--field); flex: none; }
.b95 { background: var(--face); border: 0; padding: 5px 14px; min-width: 75px; box-shadow: var(--raised); }
.b95:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }

/* ---------- Shoot folders ---------- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; align-content: start; }
.note { grid-column: 1 / -1; margin: 0 0 2px; padding: 2px 2px 10px; border-bottom: 1px solid var(--light); font-style: italic; }
.thumb { background: none; border: 0; padding: 3px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.thumb .cap { padding: 0 3px; max-width: 100%; text-align: center; overflow-wrap: anywhere; }
.thumb:hover .cap, .thumb:focus-visible .cap { background: var(--navy); color: #fff; }
.thumb:focus { outline: none; }
.photo { width: 100%; aspect-ratio: 3 / 4; background: #222; position: relative; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { background: radial-gradient(circle at 50% 38%, #8a8a8a, #1d1d1d 68%); }
.big.ph::after { content: attr(data-label) " (placeholder)"; position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; color: #aaa; font-size: 10px; }
.ph-green::before {
  content: ""; position: absolute; top: 35%; left: calc(50% - 12px); width: 6px; height: 4px; border-radius: 50%;
  background: var(--green); box-shadow: 18px 0 0 var(--green), 0 0 6px var(--green), 18px 0 6px var(--green);
}

/* ---------- Image viewer ---------- */
.viewer { display: flex; flex-direction: column; height: 100%; }
.stage {
  height: min(64vh, 600px); background: #000; box-shadow: var(--sunken); padding: 2px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: pan-y;
}
.win.max .stage { flex: 1; height: auto; }
.photo.big { height: 100%; width: 100%; aspect-ratio: auto; background: #000; }
.photo.big img { object-fit: contain; }
.photo.big.ph { width: auto; aspect-ratio: 3 / 4; max-width: 100%; background: radial-gradient(circle at 50% 38%, #8a8a8a, #1d1d1d 68%); }
.vbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 2px; flex: none; }

/* ---------- Explorer / docs ---------- */
.explorer { display: flex; flex-wrap: wrap; gap: 6px; align-content: start; }
.explorer .icon { color: #000; }
.explorer .icon.sel span { color: #fff; outline-color: #000; }
.details { width: 100%; border-collapse: collapse; }
.details th { background: var(--face); box-shadow: var(--raised); font-weight: normal; text-align: left; padding: 2px 6px; }
.details td { padding: 3px 6px; cursor: pointer; }
.details tr:hover td { background: var(--navy); color: #fff; }
fieldset { border: 0; box-shadow: inset 1px 1px var(--lo), inset -1px -1px #fff, inset 2px 2px #fff, inset -2px -2px var(--lo); padding: 10px 12px; margin: 4px 0 8px; }
legend { padding: 0 4px; }
.stats { border-collapse: collapse; width: 100%; }
.stats td { padding: 3px 0; border-bottom: 1px dotted var(--lo); }
.stats td:first-child { font-weight: bold; width: 45%; }
.eyes { color: #0a8a33; font-weight: bold; }
.dialog { display: flex; gap: 14px; align-items: flex-start; padding: 10px 6px; }
.dialog svg { width: 32px; height: 32px; flex: none; }
.dialog p { margin: 0 0 8px; }
.actions { display: flex; justify-content: center; gap: 8px; padding: 6px 0 4px; }
.contact-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; user-select: text; }
.contact-row b { width: 70px; flex: none; }

/* ---------- Taskbar & Start menu ---------- */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30px; z-index: 5000;
  background: var(--face); box-shadow: inset 0 1px var(--light), inset 0 2px #fff;
  display: flex; align-items: center; gap: 4px; padding: 3px 3px 2px;
}
#start { height: 23px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 5px 0 3px; font-weight: bold; border: 0; background: var(--face); box-shadow: var(--raised); }
#start svg { width: 18px; height: 18px; }
#start.on { box-shadow: var(--sunken); }
#tasks { flex: 1; display: flex; gap: 3px; min-width: 0; }
.task { flex: 0 1 160px; min-width: 0; height: 23px; border: 0; background: var(--face); box-shadow: var(--raised); display: flex; align-items: center; gap: 4px; padding: 0 5px; text-align: left; }
.task svg { width: 14px; height: 14px; flex: none; }
.task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task.active { box-shadow: var(--sunken); background: repeating-conic-gradient(var(--face) 0 25%, #fff 0 50%) 0 0 / 2px 2px; font-weight: bold; }
.tray { height: 23px; flex: none; display: flex; align-items: center; padding: 0 10px; box-shadow: var(--field); }

#startmenu { position: absolute; left: 2px; bottom: 28px; z-index: 6000; background: var(--face); box-shadow: var(--raised); padding: 3px; display: flex; min-width: 210px; }
.side {
  width: 24px; background: linear-gradient(0deg, var(--navy), #1084d0); color: var(--face);
  writing-mode: vertical-rl; transform: rotate(180deg); font: bold 16px Arial, sans-serif; padding: 8px 0; white-space: nowrap;
}
.side b { color: #fff; }
.items { flex: 1; display: flex; flex-direction: column; }
.items button { border: 0; background: none; display: flex; align-items: center; gap: 10px; padding: 5px 24px 5px 6px; text-align: left; }
.items button:hover, .items button:focus-visible { background: var(--navy); color: #fff; outline: none; }
.items svg { width: 24px; height: 24px; flex: none; }
.items hr { border: 0; border-top: 1px solid var(--lo); border-bottom: 1px solid #fff; margin: 3px 2px; width: calc(100% - 4px); }

/* ---------- Boot & shutdown ---------- */
#boot { position: fixed; inset: 0; z-index: 9000; background: #000; color: #aaa; font: 15px/1.45 "Courier New", monospace; padding: 24px 16px; cursor: pointer; }
#boot pre { margin: 0; white-space: pre-wrap; }
.splash {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #3a78e0, #0b2a86 75%); color: #fff; padding: 16px;
}
.splash h1 { margin: 0; font: italic 900 clamp(34px, 9vw, 84px)/1 "Arial Black", "Franklin Gothic Heavy", Arial, sans-serif; letter-spacing: -2px; text-shadow: 3px 3px 0 #000; }
.splash h1 sup { font-size: .45em; color: var(--green); vertical-align: super; margin-left: 4px; }
.splash p { font: bold 13px Tahoma, sans-serif; letter-spacing: 6px; margin: 14px 0 0; opacity: .9; }
.loadbar { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: linear-gradient(90deg, #00007a, #00a0ff, var(--green), #00a0ff, #00007a) 0 0 / 200% 100%; animation: slide 1.2s linear infinite; }
@keyframes slide { to { background-position: -200% 0; } }
#boot .skip { position: absolute; right: 16px; bottom: 22px; color: #fff; opacity: .6; font: 11px Tahoma, sans-serif; }
#shutdown {
  position: fixed; inset: 0; z-index: 9500; background: #000; color: #f58a00; cursor: pointer; padding: 16px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font: bold clamp(20px, 4.5vw, 38px)/1.3 Tahoma, Arial, sans-serif;
}

/* ---------- Easter egg: VHS video ---------- */
#egg { position: fixed; inset: 0; z-index: 9200; background: #000; display: flex; align-items: center; justify-content: center; }
.egg-frame { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; overflow: hidden; background: #000; }
#egg.on .egg-frame { animation: tv-on .55s ease-out; }
#eggVideo { width: 100%; height: 100%; object-fit: cover; display: block; filter: contrast(1.08) saturate(1.1); }
.egg-frame::after { /* scanlines + vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px), radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.6));
  animation: roll 7s linear infinite;
}
.vhs { position: absolute; top: 18px; left: 18px; right: 18px; display: flex; gap: 14px; color: #fff; font: bold 20px "Courier New", monospace; text-shadow: 2px 0 #ff2a6d, -2px 0 #05d9e8; z-index: 2; }
.vhs .ts { margin-left: auto; }
.egg-missing { display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px;
  color: #fff; font: bold 26px "Courier New", monospace; background: #00f; }
.egg-missing small { font-size: 12px; font-weight: normal; opacity: .8; }
#egg.missing .egg-missing { display: flex; }
.egg-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 34px; height: 30px; border: 0; background: var(--face); box-shadow: var(--raised); font: bold 18px/1 Tahoma, sans-serif; }
@keyframes tv-on {
  0% { transform: scale(1, .004); filter: brightness(8); }
  45% { transform: scale(1, .004); filter: brightness(8); }
  100% { transform: scale(1, 1); filter: brightness(1); }
}
@keyframes roll { to { background-position: 0 300px, 0 0; } }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  #desktop { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-template-rows: none; grid-auto-rows: 84px; justify-items: center; }
  .win { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - 30px); max-height: none; max-width: none; }
  .win .body { height: auto !important; }
  .win .stage { flex: 1; height: auto; }
  .title { height: 28px; }
  .btn { width: 24px; height: 22px; font-size: 13px; }
  .ctrls [data-a="max"] { display: none; }
  .thumbs { grid-template-columns: repeat(2, 1fr); }
  .win.dlg { height: auto; top: 30% !important; left: 16px !important; width: calc(100% - 32px) !important; }
}
