/* johnarndt.net — a 1995 desktop. */
:root {
  --teal: #008080; --face: #c0c0c0; --shadow: #808080; --dark: #000; --light: #fff; --navy: #000080; --blue: #1084d0; --sel: #000080;
  --font: Tahoma, "MS Sans Serif", "Segoe UI", Verdana, Arial, sans-serif;
  --mono: "Courier New", Courier, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--teal); color: #000; font: 12px/1.35 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: default; }
a { color: var(--navy); }
u { text-decoration: underline; }
.sprite { position: absolute; width: 0; height: 0; }
svg { display: inline-block; pointer-events: none; }
::selection { background: var(--navy); color: #fff; }

/* bevels */
.raised { background: var(--face); box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #dfdfdf; }
.sunken { background: #fff; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px #dfdfdf; }

/* desktop */
.desktop { position: fixed; inset: 0 0 28px 0; overflow: hidden; }
.icons { position: absolute; top: 8px; left: 8px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(9, auto); gap: 6px 4px; }
.dicon { width: 76px; padding: 4px 2px; background: none; border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; text-decoration: none; text-align: center; -webkit-tap-highlight-color: transparent; }
.dicon svg { width: 32px; height: 32px; image-rendering: pixelated; }
.dicon span { padding: 0 2px; line-height: 1.2; text-shadow: 1px 1px 0 #000; }
.dicon:hover span, .dicon:focus-visible span { background: var(--sel); text-shadow: none; }
.dicon:focus-visible { outline: 1px dotted #fff; outline-offset: -2px; }

/* windows */
.win { position: absolute; display: none; flex-direction: column; min-width: 240px; max-width: calc(100vw - 8px); max-height: calc(100vh - 40px); background: var(--face); box-shadow: inset -1px -1px var(--dark), inset 1px 1px #dfdfdf, inset -2px -2px var(--shadow), inset 2px 2px var(--light); padding: 3px; }
.win.open { display: flex; }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; max-height: none; }
.tbar { display: flex; align-items: center; gap: 4px; height: 18px; padding: 1px 2px 1px 3px; background: linear-gradient(90deg, var(--navy), var(--blue)); color: #fff; font-weight: bold; user-select: none; touch-action: none; }
.win.inactive .tbar { background: linear-gradient(90deg, #808080, #b0b0b0); }
.tbar .ti { width: 16px; height: 16px; flex: none; }
.tbar .ttl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtns { display: flex; gap: 2px; margin-left: auto; }
.tbtns button { width: 16px; height: 14px; padding: 0; display: grid; place-items: center; background: var(--face); border: 0; color: #000; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #dfdfdf; }
.tbtns button:active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light), inset 2px 2px var(--shadow); }
.tbtns button svg { width: 9px; height: 8px; }
.tbtns [data-close] { margin-left: 2px; }
.menubar { display: flex; gap: 2px; padding: 2px 0 1px; user-select: none; }
.menubar span { padding: 1px 6px; }
.menubar span:hover { background: var(--sel); color: #fff; }
.addressbar { display: flex; align-items: center; gap: 6px; padding: 2px 2px 3px; }
.addressbar .field { flex: 1; height: 20px; padding: 2px 4px; background: #fff; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px #dfdfdf; font-family: var(--font); }
.content { flex: 1; min-height: 0; overflow: auto; background: #fff; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px #dfdfdf; scrollbar-color: var(--shadow) var(--face); }
.content.pad { background: var(--face); box-shadow: none; padding: 8px; overflow: auto; }
.statusbar { display: flex; gap: 4px; margin-top: 3px; }
.statusbar span { flex: 1; padding: 2px 6px; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar span:last-child { flex: 2; }

/* controls */
.b95 { min-width: 75px; height: 23px; padding: 0 10px; background: var(--face); border: 0; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #dfdfdf; }
.b95:active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light), inset 2px 2px var(--shadow); }
.b95:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btnrow { display: flex; justify-content: flex-end; gap: 6px; padding-top: 10px; }
.link { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; }
.tabs { display: flex; gap: 0; padding-left: 2px; }
.tab { padding: 3px 10px; background: var(--face); box-shadow: inset -1px 0 var(--dark), inset 1px 1px var(--light); position: relative; top: 2px; }
.tab.on { top: 0; padding-bottom: 6px; z-index: 1; }
.tab:not(.on):hover { text-decoration: underline; }
.panel { background: var(--face); padding: 12px; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #dfdfdf; }
.props { display: grid; grid-template-columns: 64px 1fr; gap: 8px 12px; }
.prop-icon svg { width: 48px; height: 48px; }
.props dl { margin: 0; display: grid; grid-template-columns: 100px 1fr; gap: 8px 6px; }
.props dt, .props dd { margin: 0; }
.about-text { margin: 12px 0 0; max-width: 60ch; }
.empty { text-align: center; padding: 24px 12px; }
.empty .big, .dlg .big { width: 32px; height: 32px; }
.empty p { margin: 8px 0 0; }
.dim { color: var(--shadow); }
.dlg { display: flex; gap: 12px; align-items: flex-start; padding: 6px 4px; }
.dlg p { margin: 0 0 6px; }

/* file list */
.files { list-style: none; margin: 0; padding: 4px; }
.file { display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 5px 6px; text-decoration: none; color: #000; border: 1px dotted transparent; }
.file svg { grid-row: 1 / 3; width: 32px; height: 32px; }
.file .fn { font-weight: bold; }
.file .fd { color: #333; }
.file:hover, .file:focus-visible { background: var(--sel); color: #fff; border-color: #fff; outline: none; }
.file:hover .fd, .file:focus-visible .fd { color: #d8d8ff; }
.files.compact .file { padding: 3px 6px; }
.files.compact .file svg { width: 24px; height: 24px; }
.notepad { margin: 0; padding: 6px 8px; font: 13px/1.4 var(--mono); white-space: pre-wrap; }

/* taskbar */
.taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: 28px; background: var(--face); box-shadow: inset 0 1px var(--light), 0 -1px var(--shadow); display: flex; align-items: center; gap: 4px; padding: 2px; z-index: 1000; }
.start { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px 0 4px; font-weight: bold; background: var(--face); border: 0; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #dfdfdf; }
.start svg { width: 16px; height: 14px; }
.start[aria-expanded=true], .start:active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light), inset 2px 2px var(--shadow); }
.tasks { flex: 1; display: flex; gap: 3px; min-width: 0; overflow: hidden; border-left: 1px solid var(--shadow); box-shadow: -1px 0 var(--light); padding-left: 4px; margin-left: 2px; height: 22px; }
.task { display: inline-flex; align-items: center; gap: 4px; height: 22px; width: 160px; max-width: 30%; padding: 0 6px; background: var(--face); border: 0; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #dfdfdf; white-space: nowrap; overflow: hidden; }
.task svg { width: 16px; height: 16px; flex: none; }
.task span { overflow: hidden; text-overflow: ellipsis; }
.task.on { font-weight: bold; background: repeating-conic-gradient(#fff 0 25%, var(--face) 0 50%) 0 0 / 2px 2px; box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light), inset 2px 2px var(--shadow); }
.tray { height: 22px; display: flex; align-items: center; padding: 0 8px; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light); }
.clock { font-variant-numeric: tabular-nums; }

/* start menu */
.startmenu { position: fixed; left: 2px; bottom: 28px; z-index: 1001; display: flex; background: var(--face); box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #dfdfdf; padding: 3px; }
.startmenu[hidden] { display: none; }
.band { width: 24px; background: linear-gradient(0deg, var(--blue), var(--navy)); color: #c0c0c0; display: flex; align-items: flex-end; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 16px; font-weight: bold; padding: 6px 0; letter-spacing: 0.02em; }
.band b { color: #fff; margin-top: 4px; }
.startmenu ul { list-style: none; margin: 0; padding: 0; min-width: 180px; }
.startmenu li button, .startmenu li a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 24px 6px 8px; background: none; border: 0; text-align: left; text-decoration: none; color: #000; font-size: 13px; }
.startmenu li button:hover, .startmenu li a:hover { background: var(--sel); color: #fff; }
.startmenu svg { width: 24px; height: 24px; }
.startmenu .sep { height: 2px; margin: 3px 2px; box-shadow: inset 0 1px var(--shadow), inset 0 -1px var(--light); }

/* shutdown screen */
.off { position: fixed; inset: 0; z-index: 2000; background: #000; color: #ffa000; display: grid; place-content: center; text-align: center; font: bold 20px/1.4 var(--mono); }
.off[hidden] { display: none; }
.off button { margin-top: 24px; background: none; border: 1px solid #ffa000; color: #ffa000; padding: 6px 16px; font: inherit; cursor: pointer; }
.off button:hover { background: #ffa000; color: #000; }

/* dialogs */
.win.dialog { min-width: 300px; }

/* small screens: one window at a time, full-bleed */
@media (max-width: 720px) {
  body { font-size: 13px; }
  .icons { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-template-rows: none; left: 4px; right: 4px; gap: 6px 2px; }
  .dicon { width: auto; }
  .win, .win.max { left: 4px !important; top: 148px !important; right: 4px; width: auto !important; height: calc(100% - 152px) !important; max-height: none; }
  .win.dialog { top: auto !important; bottom: 12px; height: auto !important; }
  .task { width: auto; max-width: 45%; }
  .props { grid-template-columns: 1fr; }
  .props dl { grid-template-columns: 1fr; gap: 2px; }
  .props dt { font-weight: bold; margin-top: 6px; }
  .tabs .tab { padding: 3px 8px; }
  .notepad { font-size: 11px; }
}

/* ---------- v2: forms ---------- */
.field95 { height: 22px; padding: 1px 4px; background: #fff; border: 0; font: inherit; color: #000; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px #dfdfdf; width: 100%; min-width: 0; }
.field95:focus { outline: 1px dotted #000; outline-offset: -4px; }
.field95[readonly] { background: var(--face); }
.mailform { display: flex; flex-direction: column; gap: 5px; }
.mailform .toolbar { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; margin-bottom: 2px; box-shadow: inset 0 -1px var(--shadow), inset 0 -2px var(--light); }
.mailform label { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 6px; }
.mailform .body { height: auto; padding: 4px; resize: vertical; font: 13px/1.4 var(--font); }
.mailform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mail-status { margin: 4px 0 0; min-height: 1.2em; }
.send { font-weight: bold; }
.runlabel { display: grid; grid-template-columns: 50px 1fr; align-items: center; gap: 6px; margin-top: 10px; }
.file small, .group small { font-weight: normal; color: var(--shadow); font-size: 11px; }
.file:hover small, .file:focus-visible small { color: #d8d8ff; }
button.file { width: 100%; background: none; border: 1px dotted transparent; font: inherit; text-align: left; cursor: pointer; }
span.file { cursor: default; }
span.file:hover { background: none; color: #000; border-color: transparent; }
span.file:hover .fd { color: #333; }
.files .group { padding: 8px 6px 2px; font-weight: bold; color: var(--navy); border-bottom: 1px solid var(--face); margin-bottom: 2px; }
.files .group:first-child { padding-top: 2px; }

/* ---------- minesweeper ---------- */
#w-mines { min-width: 0; }
.mines { background: var(--face); padding: 6px; box-shadow: inset -1px -1px var(--light), inset 1px 1px var(--shadow), inset -3px -3px #dfdfdf, inset 3px 3px var(--dark); margin-top: 2px; }
.mines-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; margin-bottom: 6px; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px #dfdfdf; }
.lcd { font: bold 22px/1 var(--mono); color: #f00; background: #000; padding: 1px 3px; letter-spacing: 1px; min-width: 46px; text-align: center; box-shadow: inset 1px 1px var(--shadow); }
.smiley { width: 26px; height: 26px; padding: 0; background: var(--face); border: 0; font: bold 12px var(--mono); box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #dfdfdf; color: #000; }
.smiley:active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light); }
.smiley.dead { color: #c00; } .smiley.cool { color: #000080; }
.mines-grid { display: grid; grid-template-columns: repeat(9, 26px); grid-auto-rows: 26px; box-shadow: inset 2px 2px var(--shadow), inset -2px -2px var(--light); padding: 3px; width: max-content; }
.cell { width: 26px; height: 26px; padding: 0; border: 0; background: var(--face); font: bold 15px/26px var(--mono); box-shadow: inset -2px -2px var(--shadow), inset 2px 2px var(--light); color: #000; -webkit-tap-highlight-color: transparent; }
.cell:active { box-shadow: inset 1px 1px var(--shadow); }
.cell.open { box-shadow: inset 1px 1px var(--shadow); background: var(--face); }
.cell.flag { color: #c00; }
.cell.mine { color: #000; } .cell.hit { background: #f00; }
.cell.n1 { color: #0000ff; } .cell.n2 { color: #008000; } .cell.n3 { color: #ff0000; } .cell.n4 { color: #000080; } .cell.n5 { color: #800000; } .cell.n6 { color: #008080; } .cell.n7 { color: #000; } .cell.n8 { color: #808080; }
.mines-win { padding: 4px; background: #000; color: #0f0; box-shadow: inset 2px 2px var(--shadow), inset -2px -2px var(--light); }
.mines-win pre { margin: 0; font: 6px/6px var(--mono); letter-spacing: 0; white-space: pre; overflow-x: auto; }
.mines-win p { margin: 6px 0 2px; font: 12px var(--font); color: #fff; text-align: center; }
.mines-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.b95.small { min-width: 0; height: 20px; padding: 0 8px; font-size: 11px; }
.b95.on { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light), inset 2px 2px var(--shadow); background: repeating-conic-gradient(#fff 0 25%, var(--face) 0 50%) 0 0 / 2px 2px; }

/* ---------- MS-DOS ---------- */
.dos { flex: 1; min-height: 320px; max-height: 70vh; overflow: auto; background: #000; color: #c0c0c0; font: 13px/1.25 var(--mono); padding: 4px 6px; cursor: text; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px #dfdfdf; scrollbar-color: var(--shadow) #000; }
.dos-out { margin: 0; white-space: pre-wrap; font: inherit; }
.dos-line { display: flex; gap: 0; font: inherit; }
.dos-line input { flex: 1; background: none; border: 0; color: #c0c0c0; font: inherit; padding: 0; outline: none; caret-color: #c0c0c0; }

/* ---------- dial-up ---------- */
.dialup { position: fixed; inset: 0; z-index: 3000; background: var(--teal); display: grid; place-items: center; }
.dialup[hidden] { display: none; }
.dial-win { position: static; width: 360px; max-width: calc(100vw - 16px); }
.dial-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.dial-head .big { width: 32px; height: 32px; }
.dial-grid { display: grid; gap: 6px; }
.dial-grid label { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 6px; }
.dial-status { margin: 12px 0 0; min-height: 1.3em; }
.dial-win .btnrow { justify-content: flex-end; }
@media (max-width: 720px) {
  .mines-grid { grid-template-columns: repeat(9, 32px); grid-auto-rows: 32px; }
  .cell { width: 32px; height: 32px; line-height: 32px; font-size: 17px; }
  #w-mines .mines { overflow-x: auto; }
  .mailform label { grid-template-columns: 56px 1fr; }
  .dial-grid label { grid-template-columns: 90px 1fr; }
}
