/* Compile 95 – stygg med vilje. */
:root {
  --face: #c0c0c0;
  --hi: #ffffff;
  --lite: #dfdfdf;
  --shadow: #808080;
  --dark: #0a0a0a;
  --navy: #000080;
  --desk: #008080;
  --taskbar-h: 34px;
  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--lite), inset -2px -2px var(--shadow), inset 2px 2px var(--hi);
  --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--lite), inset 2px 2px var(--shadow);
  --field: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--lite), inset 2px 2px var(--dark);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--desk);
  color: #000;
  font: 13px/1.4 "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, Verdana, sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
}
h1, h2, p, ul, dl, pre, fieldset { margin: 0; padding: 0; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

/* ---------- Skrivebord ---------- */
.desktop {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;
  overflow: hidden;
  background: var(--desk);
}
.icons {
  position: absolute; inset: 8px auto 8px 8px;
  display: flex; flex-flow: column wrap; align-content: flex-start; gap: 6px 4px;
  z-index: 2;
}
.icon {
  width: 100px; padding: 4px 0; border: 1px dotted transparent; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #fff; text-align: center; font-size: 12px; line-height: 1.2;
}
.icon svg { width: 32px; height: 32px; }
.icon span { padding: 1px 3px; overflow-wrap: break-word; max-width: 100%; }
.icon:hover span, .icon:focus-visible span { background: var(--navy); }
.icon:focus-visible { outline: none; border-color: #fff; }

.counter {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: max-content; max-width: 90vw; text-align: center;
  color: #00ff00; font: 11px/1.5 "Courier New", monospace; z-index: 2;
  text-shadow: 1px 1px #000;
}
.counter span { background: #000; padding: 0 4px; letter-spacing: 2px; border: 1px inset #808080; }

/* ---------- Vinduer ---------- */
.window {
  position: absolute; z-index: 10;
  width: 580px; max-width: calc(100vw - 8px); max-height: calc(100% - 8px);
  display: flex; flex-direction: column;
  background: var(--face); box-shadow: var(--raised); padding: 3px;
}
.window.small { width: 320px; }
.title-bar {
  display: flex; align-items: center; gap: 6px;
  background: var(--shadow); color: var(--face); padding: 3px 3px 3px 6px;
  user-select: none; touch-action: none; cursor: default; flex: none;
}
.window.active .title-bar, .modal-layer .title-bar { background: var(--navy); color: #fff; }
.title-bar h1 { flex: 1; font-size: 13px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn {
  width: 18px; height: 16px; padding: 0 0 2px; border: 0; flex: none;
  background: var(--face); box-shadow: var(--raised); color: #000;
  font: bold 14px/1 Arial, sans-serif;
}
.tb-btn:active { box-shadow: var(--pressed); }
.win-body { padding: 10px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.menu-bar { display: flex; gap: 12px; padding: 2px 6px; flex: none; }
.status-bar { box-shadow: var(--field); padding: 3px 6px; margin-top: 3px; font-size: 12px; overflow: hidden; flex: none; }
.sunken { box-shadow: var(--field); background: #fff; border: 0; padding: 6px 8px; }
.fine { font-size: 12px; color: #404040; }
.right { text-align: right; }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 78px; min-height: 26px; padding: 3px 10px;
  border: 0; background: var(--face); box-shadow: var(--raised);
  color: #000; text-decoration: none; white-space: nowrap;
}
.btn.default { outline: 1px solid #000; outline-offset: 0; }
.btn:active, .btn.down { box-shadow: var(--pressed); padding: 4px 9px 2px 11px; }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn:disabled { color: var(--shadow); text-shadow: 1px 1px var(--hi); cursor: default; }

/* ---------- Veiviser ---------- */
.wizard { display: flex; gap: 12px; padding: 10px; min-height: 0; overflow: auto; flex: 1; }
.wizard-side {
  flex: none; width: 124px; padding: 14px 8px;
  background: linear-gradient(#000080, #008080); color: #fff;
  text-align: center; font-size: 11px; box-shadow: var(--field);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.gilded {
  width: 84px; padding: 0;
  border: 9px ridge #c9a227; outline: 2px solid #5b4208;
  box-shadow: 0 0 0 1px #f4e08a inset, 3px 4px 0 rgba(0, 0, 0, .5);
  background: #6b4e0a;
}
.gilded svg { width: 100%; height: auto; }
.wizard-main { flex: 1; min-width: 0; min-height: 250px; }
.step { display: flex; flex-direction: column; gap: 9px; }
.step h2 { font-size: 16px; outline: none; }
fieldset { border: 2px groove var(--hi); padding: 6px 10px 9px; min-width: 0; }
legend { padding: 0 4px; }
.radio-list { display: flex; flex-direction: column; gap: 5px; }
.radio-list label { display: flex; align-items: baseline; gap: 7px; }
.radio-list label > span { flex: 1; }
.radio-list i { color: #404040; font-style: normal; font-size: 12px; }
.radio-list label.off { color: var(--shadow); text-shadow: 1px 1px var(--hi); }
.radio-list label.off i { color: inherit; }
input[type="radio"], input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 13px; height: 13px; margin: 0; background: #fff; box-shadow: var(--field);
  position: relative; top: 2px;
}
input[type="radio"] { border-radius: 50%; }
input[type="radio"]:checked::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #000; }
input[type="checkbox"]:checked::after { content: "✓"; position: absolute; inset: -3px 0 0 1px; font: bold 12px/1 Arial, sans-serif; }
input:disabled { background: var(--face); }
input[type="checkbox"]:disabled:checked::after { color: #505050; }
input:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
.field-label { margin-bottom: -6px; }
textarea { width: 100%; resize: vertical; font-family: "Courier New", monospace; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.summary dt { color: #404040; }
.summary dd { margin: 0; font-weight: bold; }
.final-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.final-actions .btn { min-height: 32px; }
.send-list { display: flex; flex-direction: column; gap: 6px; }
.send-list .btn { justify-content: flex-start; min-height: 32px; }
.wizard-buttons {
  display: flex; justify-content: flex-end; gap: 6px; flex: none;
  margin: 0 10px; padding: 10px 0 8px; border-top: 2px groove var(--hi);
}
.wizard-buttons #wiz-cancel { margin-left: 8px; }

/* ---------- Notisblokk, lister, palett ---------- */
.notepad {
  font: 13px/1.35 "Courier New", monospace; overflow: auto; min-height: 0; flex: 1;
  white-space: pre-wrap; max-height: 320px;
}
.marquee { white-space: nowrap; overflow: hidden; }
.marquee span { display: inline-block; padding-left: 100%; animation: marquee 22s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
.horoskop { min-height: 70px; font-size: 14px; }
.file-list { list-style: none; padding: 4px; overflow: auto; }
.file-list button { width: 100%; display: flex; justify-content: space-between; gap: 12px; border: 0; background: none; padding: 3px 5px; text-align: left; }
.file-list button:hover, .file-list button:focus-visible { background: var(--navy); color: #fff; outline: none; }
.file-list i { font-style: normal; opacity: .7; white-space: nowrap; }
.palette { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.palette button { aspect-ratio: 1; min-width: 0; border: 0; box-shadow: var(--field); padding: 0; }
.palette button:focus-visible { outline: 2px dotted #000; outline-offset: 1px; }

/* ---------- Diskett-Dagfinn ---------- */
.assistant { position: absolute; right: 12px; bottom: 10px; z-index: 5000; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.assistant > * { pointer-events: auto; }
#dagfinn { width: 60px; height: 60px; padding: 0; border: 0; background: none; filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, .4)); }
#dagfinn svg { width: 100%; height: 100%; }
#dagfinn:hover { transform: rotate(-6deg); }
#dagfinn:focus-visible { outline: 1px dotted #fff; outline-offset: 3px; }
.eyes { animation: blink 5s steps(1) infinite; transform-origin: 12px 15.5px; }
@keyframes blink { 0%, 96% { transform: scaleY(1); } 97%, 100% { transform: scaleY(.1); } }
.bubble {
  position: relative; max-width: 220px; padding: 8px 10px;
  background: #ffffe1; border: 1px solid #000; border-radius: 8px; font-size: 12px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .4);
}
.bubble::after { content: ""; position: absolute; right: 22px; bottom: -8px; width: 14px; height: 14px; background: #ffffe1; border: solid #000; border-width: 0 1px 1px 0; transform: rotate(45deg) translate(-3px, -3px); }
.bubble:empty { display: none; }

/* ---------- Diskokuler ---------- */
.corner-ball {
  position: fixed; top: 0; right: 18px; z-index: 6000;
  width: 46px; height: 62px; padding: 16px 0 0; border: 0; background: none;
}
.corner-ball::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 17px; background: #000; }
.corner-ball canvas, .ball { image-rendering: pixelated; border-radius: 50%; display: block; }
.corner-ball canvas { width: 46px; height: 46px; }
.corner-ball:hover canvas { filter: brightness(1.25); }
.corner-ball:focus-visible { outline: 1px dotted #fff; }
.ball { position: fixed; left: 0; top: 0; z-index: 5500; pointer-events: none; will-change: transform; }

.disco-lights { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s; overflow: hidden; }
body.disco .disco-lights { opacity: 1; }
.disco-lights i { position: absolute; width: 38vmax; height: 38vmax; border-radius: 50%; filter: blur(30px); mix-blend-mode: screen; opacity: .55; animation: drift 9s ease-in-out infinite alternate paused; }
body.disco .disco-lights i, body.disco .specks { animation-play-state: running; }
.disco-lights i:nth-child(1) { background: #ff00ff; left: -10%; top: -10%; }
.disco-lights i:nth-child(2) { background: #00ffff; right: -10%; top: 10%; animation-duration: 11s; animation-direction: alternate-reverse; }
.disco-lights i:nth-child(3) { background: #ffff00; left: 20%; bottom: -20%; animation-duration: 7s; }
.disco-lights i:nth-child(4) { background: #ff3300; right: 15%; bottom: -15%; animation-duration: 13s; animation-direction: alternate-reverse; }
.disco-lights i:nth-child(5) { background: #00ff66; left: 40%; top: -20%; animation-duration: 10s; }
.disco-lights i:nth-child(6) { background: #6633ff; left: -15%; bottom: 0; animation-duration: 8s; animation-direction: alternate-reverse; }
@keyframes drift { from { transform: translate(-12vw, -8vh) scale(.8); } to { transform: translate(14vw, 12vh) scale(1.15); } }
.specks {
  position: absolute; inset: -50%;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .9) 0 3px, transparent 4px), radial-gradient(circle, rgba(255, 255, 255, .6) 0 2px, transparent 3px);
  background-size: 110px 90px, 70px 130px; background-position: 0 0, 35px 50px;
  animation: spin 60s linear infinite paused;
}
@keyframes spin { to { transform: rotate(360deg); } }
body.disco .window.active .title-bar { animation: hue 5s linear infinite; background: #c000c0; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ---------- Oppgavelinje ---------- */
.taskbar {
  position: fixed; inset: auto 0 0 0; height: var(--taskbar-h); z-index: 7000;
  display: flex; align-items: center; gap: 4px; padding: 4px 3px 2px;
  background: var(--face); box-shadow: inset 0 1px var(--lite), inset 0 2px var(--hi);
}
.start-btn { min-width: 0; padding: 2px 7px 2px 4px; height: 26px; }
.start-btn svg { width: 18px; height: 18px; }
.tasks { flex: 1; display: flex; gap: 3px; min-width: 0; }
.tasks .btn { flex: 0 1 150px; min-width: 0; justify-content: flex-start; overflow: hidden; height: 26px; }
.tasks .btn span { overflow: hidden; text-overflow: ellipsis; }
.tasks .btn.down { font-weight: bold; background: repeating-conic-gradient(var(--face) 0 25%, var(--hi) 0 50%) 0 0 / 2px 2px; }
.tray { display: flex; align-items: center; gap: 6px; height: 26px; padding: 2px 8px; background: var(--face); box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow); }
.tray button { border: 0; background: none; padding: 0; font-size: 14px; line-height: 1; }
.start-menu {
  position: fixed; left: 3px; bottom: calc(var(--taskbar-h) - 3px); z-index: 7001;
  display: flex; background: var(--face); box-shadow: var(--raised); padding: 3px;
}
.start-side { width: 26px; background: var(--shadow); color: var(--face); position: relative; }
.start-side span { position: absolute; left: 3px; bottom: 6px; transform-origin: 0 100%; transform: rotate(-90deg) translateY(100%); white-space: nowrap; font-size: 18px; }
.start-side b { color: #fff; }
.start-menu ul { list-style: none; min-width: 170px; }
.start-menu li button { width: 100%; border: 0; background: none; text-align: left; padding: 8px 14px 8px 10px; }
.start-menu li button:hover, .start-menu li button:focus-visible { background: var(--navy); color: #fff; outline: none; }
.start-menu .sep { border-top: 1px solid var(--shadow); box-shadow: inset 0 1px var(--hi); margin-top: 3px; padding-top: 3px; }

/* ---------- Modale dialoger ---------- */
.modal-layer { position: fixed; inset: 0; z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 8px; }
.modal-layer .window { position: relative; width: 380px; }
.msg { display: flex; gap: 14px; padding: 14px 12px 8px; align-items: flex-start; }
.msg-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: bold 22px/1 "Times New Roman", serif; color: #fff; border: 2px solid #000; box-shadow: 2px 2px 0 var(--shadow); }
.msg-icon.error { background: #e00000; }
.msg-icon.info { background: #0000c0; font-style: italic; }
.msg-icon.ask { background: #fff; color: #0000c0; }
.msg-icon.warn { background: #ffe000; color: #000; border-radius: 4px; }
.msg-buttons { position: relative; display: flex; justify-content: center; gap: 8px; padding: 8px 12px 12px; min-height: 48px; }
.runaway { position: relative; transition: transform .12s; }
.progress { box-shadow: var(--field); background: #fff; height: 22px; padding: 3px; margin-top: 8px; }
.progress div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--navy) 0 10px, transparent 10px 12px); }
.progress-text { min-height: 2.8em; }

/* ---------- Fullskjerm ---------- */
.fullscreen { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; cursor: pointer; }
.boot { background: #000; color: #c0c0c0; align-items: flex-start; justify-content: flex-start; font: 14px/1.5 "Courier New", monospace; }
.boot pre { font: inherit; white-space: pre-wrap; }
.boot-skip { margin-top: auto; color: #606060; align-self: center; }
.bsod { background: #0000a8; color: #fff; font: bold 15px/1.5 "Courier New", monospace; }
.bsod > div { max-width: 640px; display: flex; flex-direction: column; gap: 1.4em; }
.bsod-title { text-align: center; }
.bsod-title span { background: #a8a8a8; color: #0000a8; padding: 0 8px; }
.blink { animation: blinker 1s steps(1) infinite; }
@keyframes blinker { 50% { opacity: 0; } }
.shutdown { background: #000; color: #ff8c1a; text-align: center; font: bold 28px/1.3 Arial, sans-serif; gap: 20px; }
.shutdown small { font: 12px "Courier New", monospace; color: #606060; }

/* ---------- Små skjermer ---------- */
@media (max-width: 640px) {
  .wizard-side { display: none; }
  .icon { width: 88px; font-size: 11px; }
  .counter { display: none; }
  textarea { font-size: 16px; }
  .bubble { max-width: 170px; }
  #dagfinn { width: 48px; height: 48px; }
  .tasks .btn:not(.down) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; padding-left: 0; }
  .eyes, .blink, .disco-lights i, .specks, body.disco .window.active .title-bar { animation: none !important; }
}
