/* =========================================================
   DAY 40 FOREVER - a 90s WinRAR tribute
   ========================================================= */

:root {
  --desk: #008080;
  --gray: #c0c0c0;
  --gray-dk: #808080;
  --gray-lt: #dfdfdf;
  --white: #ffffff;
  --black: #000000;
  --navy: #000080;
  --blue: #1084d0;
  --magenta: #b43cb4;
  --indigo: #1c2cc8;
  --sky: #18a018;
  --purple: #8735b5;
  --gold: #f2c230;
  --belt: #6b3a12;
  --red: #ff2020;
  --lime: #39ff14;
  --pixel: "Press Start 2P", "Courier New", monospace;
  --term: "VT323", "Courier New", monospace;
  --ui: Tahoma, "MS Sans Serif", "Segoe UI", Verdana, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 40px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--purple) url("../img/wallpaper.png") repeat;
  background-size: 192px 176px;
  image-rendering: pixelated;
  color: var(--black);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='24' shape-rendering='crispEdges'%3E%3Cpath d='M0 0v17l4-4 3 7 3-1-3-7h6z' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E") 0 0, auto;
}

a, button, input[type=range], summary { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='22' shape-rendering='crispEdges'%3E%3Cpath d='M6 1h2v8h2V7h2v2h2V9h2v2h1v7l-2 3H7l-4-5v-3h2v2h1z' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E") 6 0, pointer; }

::selection { background: var(--navy); color: #fff; }

img, canvas, svg { display: block; }

img[src*="winrar-logo"] { image-rendering: pixelated; image-rendering: crisp-edges; }

/* CRT scanlines */
#crt {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9000;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.13) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
body.no-crt #crt { display: none; }

/* ------------------ BOOT ------------------ */
#boot {
  position: fixed; inset: 0;
  z-index: 10000;
  background: #000;
  color: #c0c0c0;
  font-family: var(--term);
  font-size: clamp(16px, 2.6vw, 24px);
  padding: 24px;
  overflow: hidden;
  cursor: pointer;
}
#boot pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
}
#boot-skip { position: absolute; bottom: 24px; left: 24px; margin: 0; color: #fff; }
#boot.gone { animation: crt-off .45s ease-in forwards; }
@keyframes crt-off {
  0% { transform: scale(1, 1); filter: brightness(1); }
  60% { transform: scale(1, .004); filter: brightness(4); }
  100% { transform: scale(0, .004); filter: brightness(8); opacity: 0; }
}

.blink { animation: blink 1s steps(1) infinite; }
.blink-slow { animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { visibility: hidden; } }

/* ------------------ TICKER ------------------ */
.ticker {
  position: sticky; top: 0;
  z-index: 500;
  background: var(--navy);
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
  font-family: var(--term);
  font-size: 20px;
  overflow: hidden;
  white-space: nowrap;
  height: 30px;
  line-height: 30px;
}
.ticker-track { display: inline-flex; animation: scroll-x 60s linear infinite; }
.ticker-track span { padding-right: 0; }
.ticker b { color: #fff; }
.chapter-year { image-rendering: auto; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ------------------ LAYOUT ------------------ */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ------------------ WIN95 WINDOWS ------------------ */
.window {
  background: var(--gray);
  border: 2px solid;
  border-color: var(--gray-lt) var(--black) var(--black) var(--gray-lt);
  box-shadow: inset 1px 1px 0 var(--white), inset -1px -1px 0 var(--gray-dk), 6px 6px 0 rgba(0,0,0,.45);
  padding: 3px;
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  padding: 3px 3px 3px 5px;
  user-select: none;
  min-height: 24px;
}
.titlebar.small { font-size: 12px; min-height: 20px; }
.title-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-icon { font-size: 14px; line-height: 1; }
.title-buttons { display: flex; gap: 2px; }
.title-buttons i, .title-buttons .x {
  font-style: normal;
  width: 18px; height: 16px;
  display: inline-grid; place-items: center;
  background: var(--gray);
  color: #000;
  font: bold 12px/1 var(--ui);
  border: 1px solid;
  border-color: var(--white) var(--black) var(--black) var(--white);
  box-shadow: inset -1px -1px 0 var(--gray-dk);
  padding: 0;
}
.window-body { padding: 16px; }

.menubar { font-size: 13px; padding: 3px 6px; display: flex; gap: 14px; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 4px;
  border-top: 1px solid var(--gray-dk);
  border-bottom: 1px solid var(--white);
}
.tool {
  display: flex; flex-direction: column; align-items: center;
  min-width: 64px;
  background: transparent;
  border: 1px solid transparent;
  font: 12px var(--ui);
  padding: 4px 6px;
  color: #000;
}
.tool:hover { border-color: var(--white) var(--gray-dk) var(--gray-dk) var(--white); }
.tool:active { border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk); }
.tool .ti { font-size: 22px; line-height: 1.1; }

.pathbar {
  margin: 4px 2px;
  background: #fff;
  border: 2px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
  padding: 2px 6px;
  font-size: 13px;
}

.statusbar {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px;
  margin-top: 3px;
}
.statusbar span {
  flex: 1;
  padding: 2px 6px;
  border: 1px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
}
.statusbar span:last-child { flex: 0 0 auto; }

/* file list */
.filelist-wrap {
  margin: 0 2px;
  background: #fff;
  border: 2px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
  max-height: 290px;
  overflow: auto;
}
.filelist { width: 100%; border-collapse: collapse; font-size: 13px; }
.filelist th {
  position: sticky; top: 0;
  background: var(--gray);
  text-align: left;
  font-weight: normal;
  padding: 2px 8px;
  border: 1px solid; border-color: var(--white) var(--gray-dk) var(--gray-dk) var(--white);
  white-space: nowrap;
}
.filelist td { padding: 2px 8px; white-space: nowrap; }
.filelist tbody tr { cursor: pointer; }
.filelist tbody tr:hover td { background: #e8e8ff; }
.filelist tbody tr.sel td { background: var(--navy); color: #fff; }
.filelist tbody tr.done td:first-child::after { content: " ✔"; color: #0a0; }
.filelist tbody tr.sel.done td:first-child::after { color: var(--lime); }
.filelist .fname { display: inline-flex; gap: 6px; align-items: center; }

/* ------------------ HERO ------------------ */
.hero { text-align: center; background: var(--gray); }
.hero-logo { width: 192px; margin: 8px auto 12px; animation: bob 2.4s steps(6) infinite; }
.hero-logo img { width: 100%; height: auto; }
@keyframes bob { 50% { transform: translateY(-10px); } }

.wordart {
  margin: 0;
  font-family: var(--pixel);
  line-height: 1.3;
  font-weight: normal;
}
.wordart span { display: block; }
.wordart .w1 {
  font-size: clamp(20px, 5vw, 44px);
  color: var(--gold);
  text-shadow: 1px 1px 0 #000, 2px 2px 0 var(--magenta), 3px 3px 0 var(--magenta), 4px 4px 0 var(--indigo), 5px 5px 0 var(--indigo), 6px 6px 0 #000;
}
.wordart .w2 {
  font-size: clamp(14px, 3.4vw, 28px);
  margin-top: 10px;
  color: var(--magenta);
  text-shadow: 2px 2px 0 #000;
  animation: rainbow 1.2s steps(1) infinite;
}
@keyframes rainbow { 25% { color: var(--indigo); } 50% { color: var(--sky); } 75% { color: #c00000; } }

.hero-sub { max-width: 620px; margin: 18px auto; font-size: 17px; }

.odometer-wrap {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  flex-wrap: wrap;
  font-family: var(--pixel);
  font-size: 11px;
}
.odometer {
  font-family: var(--term);
  font-size: 44px;
  letter-spacing: 4px;
  color: var(--lime);
  background: #000;
  padding: 0 10px;
  border: 3px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
  text-shadow: 0 0 8px var(--lime);
  line-height: 1.1;
}
.odometer.small { font-size: 22px; letter-spacing: 2px; padding: 0 6px; display: inline-block; }
.red { color: var(--red); }
.tiny { font-size: 12px; opacity: .85; }

.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 22px 0; }

.construction {
  display: flex; align-items: center; gap: 0;
  margin: 8px -16px -16px;
  background: #000;
  color: var(--gold);
  font-family: var(--pixel);
  font-size: 9px;
  overflow: hidden;
}
.construction-text { padding: 8px 10px; flex: 1; }
.hazard {
  width: 60px; align-self: stretch;
  background: repeating-linear-gradient(-45deg, var(--gold) 0 10px, #000 10px 20px);
  background-size: 28px 28px;
  animation: hazard 1s linear infinite;
}
@keyframes hazard { to { background-position: 28px 0; } }

/* ------------------ BUTTONS ------------------ */
.btn95 {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--gray);
  color: #000;
  font: 14px var(--ui);
  text-decoration: none;
  padding: 5px 16px;
  min-height: 30px;
  border: 2px solid;
  border-color: var(--white) var(--black) var(--black) var(--white);
  box-shadow: inset -1px -1px 0 var(--gray-dk), inset 1px 1px 0 var(--gray-lt);
}
.btn95:active, .btn95.pressed {
  border-color: var(--black) var(--white) var(--white) var(--black);
  box-shadow: inset 1px 1px 0 var(--gray-dk);
  padding: 6px 15px 4px 17px;
}
.btn95:focus-visible, .tool:focus-visible, .tray-btn:focus-visible, .start-btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn95.big { font-size: 16px; padding: 10px 20px; font-weight: bold; }
.btn95.gold { background: var(--gold); }
.btn95.gold:hover { background: #ffd84a; }

.kbd {
  display: inline-block;
  font: 12px var(--ui);
  padding: 0 6px;
  margin: 0 2px;
  background: var(--gray);
  border: 2px solid; border-color: var(--white) var(--gray-dk) var(--gray-dk) var(--white);
}

/* ------------------ CHAPTERS ------------------ */
.chapters { display: flex; flex-direction: column; gap: 22px; margin-top: -8px; }
.chapter {
  display: grid;
  grid-template-columns: 150px 1fr;
  background: #fffff0;
  border: 2px solid #000;
  box-shadow: 6px 6px 0 rgba(0,0,0,.5);
  position: relative;
  overflow: hidden;
}
.chapter:nth-child(even) { background: #f0fff7; }
.chapter-year {
  font-family: var(--pixel);
  font-size: 26px;
  color: #fff;
  background: var(--navy);
  display: grid; place-items: center;
  text-shadow: 3px 3px 0 var(--magenta);
  padding: 12px;
  border-right: 2px solid #000;
}
.chapter:nth-child(3n+2) .chapter-year { background: var(--indigo); text-shadow: 3px 3px 0 var(--sky); }
.chapter:nth-child(3n) .chapter-year { background: var(--magenta); text-shadow: 3px 3px 0 var(--navy); }
.chapter-body { padding: 14px 18px; }
.chapter h2 {
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 10px;
  color: var(--navy);
}
.chapter p { margin: 0 0 10px; font-size: 16px; }
.chapter p:last-child { margin-bottom: 0; }
.chapter code { background: #000; color: var(--lime); padding: 0 4px; font-family: var(--term); font-size: 18px; }
.chapter q { font-style: italic; color: #700050; }
.chapter .note { background: #ffffc0; border: 1px dashed #b09000; padding: 6px 10px; }

/* packed state */
.chapter.packed .chapter-body > * { filter: blur(5px); opacity: .35; user-select: none; }
.chapter.packed::after {
  content: attr(data-file) "  [PACKED]  scroll to extract ▼";
  position: absolute; left: 150px; right: 0; top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--navy);
  pointer-events: none;
}
.extract-bar {
  position: absolute; left: 150px; right: 0; bottom: 0;
  height: 6px;
  background: #000;
}
.extract-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--navy) 0 8px, transparent 8px 10px); }
.chapter.extracting .chapter-body > * { filter: none; opacity: 1; }
.chapter.extracting::after, .chapter.done::after { content: none; }

/* ------------------ TRIAL ------------------ */
.pixel-h {
  font-family: var(--pixel);
  font-size: 15px;
  font-weight: normal;
  color: var(--navy);
  margin: 0 0 12px;
  line-height: 1.5;
}
.pixel-h.rainbow { color: var(--magenta); text-shadow: 2px 2px 0 var(--gold); }
#trial .window-body { background: #fff; margin: 0 2px 2px; border: 2px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk); font-family: "Courier New", monospace; }
.trial-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }

.dialog {
  background: var(--gray);
  border: 2px solid; border-color: var(--gray-lt) var(--black) var(--black) var(--gray-lt);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 var(--gray-dk), 4px 4px 0 rgba(0,0,0,.4);
  padding: 3px;
  font-family: var(--ui);
  font-size: 13px;
  max-width: 400px;
}
.dialog-body { display: flex; gap: 12px; padding: 14px 12px 8px; align-items: flex-start; }
.dialog-body p { margin: 0; }
.dialog-icon { font-size: 30px; line-height: 1; }
.dialog-logo { width: 48px; height: 36px; flex: none; }
.nag-extra { margin-top: 8px !important; font-size: 12px; }
.title-logo { width: 16px; height: 12px; }
.dialog-buttons { display: flex; justify-content: center; gap: 10px; padding: 6px 0 10px; }
.dialog-buttons .btn95 { min-width: 96px; font-size: 13px; }
.nag-demo.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.stats { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.stats li { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px dotted #888; padding-bottom: 6px; }
.stat-num { font-family: var(--term); font-size: 34px; color: var(--magenta); min-width: 120px; line-height: 1; }
.stat-label { font-size: 14px; }

/* ------------------ PARTY / BBS ------------------ */
#party .window-body { background: #fdf6e3; margin: 0 2px 2px; }
.bbs { display: grid; gap: 14px; margin: 16px 0; }
.bbs-post {
  background: #000;
  color: #d0d0d0;
  font-family: var(--term);
  font-size: 20px;
  line-height: 1.25;
  padding: 12px 14px 8px;
  border: 2px solid var(--lime);
  box-shadow: 4px 4px 0 var(--magenta);
  position: relative;
}
.bbs-post p { margin: 6px 0; color: #fff; }
.bbs-head { display: flex; justify-content: space-between; gap: 10px; color: var(--lime); flex-wrap: wrap; }
.bbs-date { color: var(--gold); }
.bbs-reply { margin: 8px 0 4px 18px; padding-left: 10px; border-left: 3px solid var(--sky); }
.bbs-reply .bbs-head { color: #6cd0ff; }
.bbs .tiny { color: #aaa; }
.src { color: var(--gold); font-size: 16px; }
.src:hover { color: #fff; }

.party-cta { text-align: center; padding: 14px; margin-top: 8px; background: var(--desk); border: 2px solid; border-color: var(--gray-dk) #fff #fff var(--gray-dk); }
.party-cta p { color: #fff !important; }
.party-cta .hop-row { display: flex; justify-content: center; gap: 22px; margin-bottom: 8px; }
.party-cta .hop-row img { width: 64px; height: 48px; animation: hop .5s steps(2) infinite alternate; }
.party-cta .hop-row img:nth-child(even) { animation-delay: .25s; }
.party-cta p { font-family: var(--pixel); font-size: 11px; color: var(--magenta); }

#party-overlay {
  position: fixed; inset: 0;
  z-index: 8000;
  background: var(--desk);
  display: grid; place-items: center;
  overflow: hidden;
}
#party-overlay[hidden] { display: none; }
#party-overlay.flash { animation: flash95 .9s steps(1) 3; }
@keyframes flash95 { 33% { background: var(--purple); } 66% { background: var(--navy); } }
#trails, #confetti { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#cascade { position: absolute; inset: 0; pointer-events: none; }
#cascade .dialog { position: absolute; width: 250px; pointer-events: auto; animation: none; }
#cascade .dialog-body { padding: 10px 10px 4px; font-size: 12px; }
#cascade .dialog-logo { width: 32px; height: 24px; }
#cascade .dialog-buttons { padding: 4px 0 8px; }
#cascade .dialog-buttons .btn95 { min-width: 70px; min-height: 22px; padding: 1px 10px; font-size: 12px; }
.party-marquee {
  position: absolute; left: 0; right: 0; top: 0;
  background: var(--gold); color: #000;
  border-bottom: 3px solid #000;
  font-family: var(--pixel); font-size: 14px;
  height: 34px; line-height: 34px;
  overflow: hidden; white-space: nowrap;
  z-index: 2;
}
.party-marquee-track { display: inline-flex; animation: scroll-x 14s linear infinite; }
.party-window { position: relative; z-index: 3; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 60px); overflow: auto; margin-top: 30px; }
.party-content { text-align: center; padding: 16px; background: var(--gray); }
.party-logos { display: flex; justify-content: center; gap: 18px; }
.party-logos img { width: 96px; height: 72px; animation: hop .5s steps(2) infinite alternate; }
.party-logos img:nth-child(2) { width: 128px; height: 96px; animation-delay: .25s; }
@keyframes hop { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-14px) rotate(6deg); } }
.party-banner {
  font-family: var(--pixel);
  font-size: clamp(16px, 4.6vw, 36px);
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--magenta), 6px 6px 0 var(--navy);
  margin: 14px 0 4px;
  animation: pulse .5s steps(2) infinite alternate;
}
@keyframes pulse { to { transform: scale(1.08); } }
.party-headline { font-family: var(--pixel); font-size: clamp(11px, 2.6vw, 18px); line-height: 1.6; margin: 12px 0 8px; color: var(--navy); }
.sales-ticker { display: inline-block; font-family: var(--term); font-size: 30px; color: var(--lime); background: #000; padding: 0 12px; border: 2px solid; border-color: var(--gray-dk) #fff #fff var(--gray-dk); }
.sales-ticker span { display: inline-block; min-width: 1.5ch; }
.sales-ticker span.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.8); color: #fff; } }
.party-msg { font-family: var(--term); font-size: 22px; margin: 6px 0 12px; }
.party-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.dancers { display: flex; justify-content: center; gap: 18px; margin: 14px 0 6px; height: 60px; align-items: flex-end; }
.dancer {
  width: 6px; height: 6px;
  image-rendering: pixelated;
  transform-origin: 18px 48px;
  margin-right: 30px;
  margin-bottom: 56px;
  --c: #b43cb4;
  box-shadow:
    /* head */ 12px 0 #f5c89a, 18px 0 #f5c89a, 12px 6px #f5c89a, 18px 6px #f5c89a,
    /* body */ 6px 12px var(--c), 12px 12px var(--c), 18px 12px var(--c), 24px 12px var(--c),
    0 18px var(--c), 12px 18px var(--c), 18px 18px var(--c), 30px 18px var(--c),
    12px 24px var(--c), 18px 24px var(--c),
    /* legs */ 12px 30px #223, 18px 30px #223, 6px 36px #223, 24px 36px #223, 6px 42px #111, 24px 42px #111;
  animation: dance .4s steps(2) infinite alternate;
}
.d2 { --c: #1c2cc8; animation-delay: .1s; }
.d3 { --c: #18a018; animation-delay: .2s; }
.d4 { --c: #f2c230; animation-delay: .05s; }
.d5 { --c: #39c050; animation-delay: .15s; }
@keyframes dance { from { transform: translateY(0) rotate(-12deg); } to { transform: translateY(-14px) rotate(12deg); } }

/* ------------------ GAME ------------------ */
.game-body { display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: 20px; align-items: start; }
.game-frame {
  background: #000;
  border: 3px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
}
#game-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  image-rendering: pixelated;
  touch-action: none;
  outline: none;
}
.touch-controls { display: none; gap: 4px; padding: 4px; background: var(--gray); }
.touch-controls .btn95 { flex: 1; font-size: 22px; min-height: 48px; }
.game-help p { margin: 0 0 10px; }
.legend { border-collapse: collapse; margin-bottom: 10px; font-size: 14px; }
.legend td { padding: 3px 8px 3px 0; }
.lg {
  display: inline-grid; place-items: center;
  width: 38px; height: 22px;
  font-family: var(--pixel); font-size: 8px;
  border: 2px solid #000;
}
.lg-file { background: #fff; }
.lg-bug { background: #300; }
.lg-rec { background: #39c050; color: #fff; }
.lg-solid { background: var(--indigo); color: #fff; }
.lg-key { background: var(--gold); }
.lg-coin { background: var(--gold); color: #6b3a12; border-radius: 50%; width: 24px; margin: 0 7px; font-size: 9px; }
.coin-box { background: #ffffe1; border: 1px solid #000; padding: 8px 10px; margin: 0 0 10px; font-size: 13px; }
.coin-box p { margin: 0 0 6px; }
.coin-box p:last-child { margin: 0; }

/* ------------------ WIZARD ------------------ */
.wizard { display: grid; grid-template-columns: 170px 1fr; gap: 20px; }
.wizard-side {
  background: var(--desk);
  border: 2px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
  display: flex; justify-content: center; padding-top: 30px;
}
.wizard-side img { width: 128px; height: auto; animation: bob 3s steps(6) infinite; }

.wizard-main > p { margin-top: 0; }
.group {
  border: 2px groove #fff;
  margin: 0 0 16px;
  padding: 10px 14px 14px;
}
.group legend { padding: 0 6px; font-weight: bold; }
.group label { display: block; margin-top: 8px; }
.group input[type=range] { width: 100%; accent-color: var(--navy); }
.guilt-bar {
  height: 22px; margin: 12px 0 8px;
  background: #fff;
  border: 2px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
  padding: 2px;
}
#guilt-fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--navy) 0 10px, transparent 10px 12px);
  transition: width .3s steps(10);
}
#guilt-fill.hot { background: repeating-linear-gradient(90deg, #d00 0 10px, transparent 10px 12px); }
.guilt-results { margin: 6px 0; padding-left: 20px; }
.verdict { font-family: var(--pixel); font-size: 10px; line-height: 1.8; color: var(--magenta); margin: 8px 0 0; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; }
.reg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.reg-row input {
  flex: 1; min-width: 160px;
  font: 15px var(--ui);
  padding: 4px 6px;
  border: 2px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
  background: #fff;
}
.cert-row { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; flex-wrap: wrap; }
#badge { width: 176px; height: 62px; image-rendering: pixelated; border: 1px solid #000; }
#cert { width: 100%; max-width: 420px; height: auto; border: 1px solid #000; background: #fff; }

/* ------------------ FOOTER ------------------ */
.footer {
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  font-family: "Times New Roman", serif;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.footer a { color: #6cf; }
.footer a:visited { color: #c9f; }
.buttons88 { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.b88 {
  width: 88px; height: 31px;
  display: grid; place-items: center;
  font: bold 9px/1.1 Verdana, sans-serif;
  text-align: center;
  border: 1px solid #fff;
  outline: 1px solid #000;
}
.b88-a { background: var(--magenta); color: #fff; }
.b88-b { background: #004; color: var(--gold); }
.b88-c { background: var(--indigo); color: #fff; text-shadow: 1px 1px 0 #000; }
.b88-d { background: #000; color: var(--lime); font-family: var(--term); font-size: 16px; }
.b88-e { background: #fff; color: #d00; }
.counter-box { font-size: 16px; }
.sources { max-width: 760px; text-align: left; background: var(--navy); border: 2px solid #fff; padding: 10px 16px; }
.sources summary { font-weight: bold; }
.sources li { margin: 4px 0; }

/* ------------------ TASKBAR ------------------ */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 600;
  height: 36px;
  background: var(--gray);
  border-top: 2px solid var(--white);
  box-shadow: 0 -1px 0 var(--gray-lt);
  display: flex; align-items: center; gap: 4px;
  padding: 2px 3px;
}
.start-btn {
  display: flex; align-items: center; gap: 5px;
  height: 28px;
  padding: 0 8px;
  background: var(--gray);
  font: 14px var(--ui);
  border: 2px solid; border-color: var(--white) var(--black) var(--black) var(--white);
  box-shadow: inset -1px -1px 0 var(--gray-dk);
}
.start-btn[aria-expanded=true] { border-color: var(--black) var(--white) var(--white) var(--black); }
.books-mini {
  display: inline-block; width: 20px; height: 15px;
  background: url("../img/winrar-logo.png") center / contain no-repeat;
  image-rendering: pixelated;
}
.start-menu {
  position: absolute; bottom: 36px; left: 2px;
  display: flex;
  background: var(--gray);
  border: 2px solid; border-color: var(--white) var(--black) var(--black) var(--white);
  box-shadow: inset -1px -1px 0 var(--gray-dk), 4px 4px 0 rgba(0,0,0,.4);
  min-width: 230px;
}
.start-menu[hidden] { display: none; }
.start-side {
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--navy);
  color: #c0c0c0;
  font: bold 20px var(--ui);
  padding: 8px 4px;
}
.start-side b { color: #fff; }
.start-menu ul { list-style: none; margin: 0; padding: 2px; flex: 1; }
.start-menu li a, .start-menu li button {
  display: block; width: 100%;
  padding: 7px 14px;
  color: #000; text-decoration: none;
  font: 14px var(--ui);
  background: none; border: 0; text-align: left;
}
.start-menu li a:hover, .start-menu li button:hover, .start-menu li a:focus, .start-menu li button:focus { background: var(--navy); color: #fff; outline: none; }
.start-menu .sep { border-top: 1px solid var(--gray-dk); border-bottom: 1px solid #fff; margin: 3px 2px; }
.task-items { display: flex; gap: 4px; flex: 1; overflow: hidden; }
.task-item {
  height: 28px; padding: 0 10px;
  display: flex; align-items: center;
  font: 13px var(--ui); color: #000; text-decoration: none;
  border: 2px solid; border-color: var(--white) var(--black) var(--black) var(--white);
  white-space: nowrap;
  max-width: 160px;
}
.tray {
  display: flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 6px;
  border: 1px solid; border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk);
  font-size: 13px;
}
.tray-btn { background: none; border: 1px solid transparent; font: 12px var(--ui); padding: 1px 4px; color: #000; }
.tray-btn[aria-pressed=true] { border-color: var(--gray-dk) var(--white) var(--white) var(--gray-dk); background: #d8d8d8; }
.clock { padding-left: 4px; white-space: nowrap; }

/* floating nag */
.nag-float {
  position: fixed;
  z-index: 700;
  left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 32px));
  animation: pop .25s ease-out;
}
.nag-float[hidden] { display: none; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.3); } }

/* toast */
#toast {
  position: fixed; right: 12px; bottom: 48px;
  z-index: 800;
  max-width: 300px;
  background: #ffffe1;
  border: 1px solid #000;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4);
  opacity: 0; transform: translateY(10px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: none; }

/* cursor sparkle */
.sparkle {
  position: fixed; pointer-events: none; z-index: 9500;
  width: 6px; height: 6px;
  background: var(--c, #fff);
  box-shadow: 0 0 6px var(--c, #fff);
  animation: sparkle .7s ease-out forwards;
}
@keyframes sparkle { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

/* ------------------ RESPONSIVE ------------------ */
@media (max-width: 760px) {
  body { font-size: 14px; }
  main { padding: 20px 12px 72px; gap: 28px; }
  .trial-grid, .game-body, .wizard { grid-template-columns: 1fr; }
  .wizard-side { display: none; }
  .chapter { grid-template-columns: 1fr; }
  .chapter-year { border-right: 0; border-bottom: 2px solid #000; font-size: 20px; padding: 8px; }
  .chapter.packed::after, .extract-bar { left: 0; }
  .chapter.packed::after { top: auto; bottom: 30%; }
  .filelist td:nth-child(3), .filelist th:nth-child(3), .filelist td:nth-child(4), .filelist th:nth-child(4) { display: none; }
  .menubar { display: none; }
  .tool { min-width: 52px; font-size: 11px; }
  .task-items { display: none; }
  .touch-controls { display: flex; }
  .odometer { font-size: 34px; }
  .stat-num { min-width: 90px; font-size: 28px; }
  .construction-text { font-size: 7px; }
  .party-banner { text-shadow: 2px 2px 0 var(--navy); animation: none; }
  .party-logos img { width: 64px; height: 48px; }
  .party-logos img:nth-child(2) { width: 96px; height: 72px; }
}

@media (hover: none) {
  .touch-controls { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .ticker-track { animation: none; }
  html { scroll-behavior: auto; }
}
