/* ============================================================
   PEN-DOS — Windows 95 edition stylesheet
   Aesthetic: Win95 chrome (silver bevels, navy title bars,
   teal desktop) on a Geocities-style single-column page.
   ============================================================ */

:root {
  --desktop: #008080;      /* Win95 teal desktop */
  --face: #c0c0c0;         /* button/window face */
  --face-light: #dfdfdf;
  --hilight: #ffffff;
  --shadow: #808080;
  --shadow-dark: #0a0a0a;
  --navy: #000080;         /* title bars, selection */
  --navy-light: #1084d0;
  --ink: #000000;
  --paper: #ffffff;
  --yellow: #ffe100;       /* warning triangle */
  --cream: #ffe97f;        /* folder yellow */
  --link: #0000ee;
  --link-visited: #551a8b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 24px 12px 48px;
  background: var(--desktop);
  font-family: Tahoma, "MS Sans Serif", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

/* Native Apple fallback for regular body copy. */
html.apple-device .content,
html.apple-device .footer,
html.apple-device .sidepanel {
  font-family: "Lucida Grande", Geneva, system-ui, sans-serif;
}

img { image-rendering: pixelated; }

a         { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover   { background: var(--navy); color: var(--paper) !important; text-decoration: none; }

/* ---------- classic Win95 bevels ---------- */
/* raised (buttons, panels) */
.raised, .page, .btn, .badge, .dialog, .tb-btn {
  box-shadow:
    inset -1px -1px 0 var(--shadow-dark),
    inset  1px  1px 0 var(--hilight),
    inset -2px -2px 0 var(--shadow),
    inset  2px  2px 0 var(--face-light);
}

/* sunken (list views, text fields, status cells) */
.sunken, .modlist, .meter, .about-mascot, .statusbar-cell, .finder-status {
  box-shadow:
    inset -1px -1px 0 var(--hilight),
    inset  1px  1px 0 var(--shadow),
    inset -2px -2px 0 var(--face-light),
    inset  2px  2px 0 var(--shadow-dark);
}

/* ---------- the page column ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  background: var(--face);
  padding: 3px;
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 26px 20px 20px;
  text-align: center;
}

.mascot { flex: 0 0 auto; }
.mascot-right { transform: scaleX(-1); }

.masthead h1 {
  margin: 0;
  font-family: "Arial Black", "Franklin Gothic Medium", Arial, sans-serif;
  font-size: 46px;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--navy);
  text-shadow: 3px 3px 0 var(--hilight), 5px 5px 0 var(--shadow);
}

.tagline {
  margin: 10px 0 2px;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 2px;
}

.subtagline { margin: 0; font-size: 11px; }

/* ---------- nav ---------- */
.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 12px 100px;
  border-top: 1px solid var(--shadow);
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--hilight), 0 -1px 0 var(--hilight) inset;
}

/* theme switcher */
.btn-switch {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

/* Win95 push button */
.btn {
  display: inline-block;
  padding: 6px 18px;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  background: var(--face);
  border: none;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:visited { color: var(--ink); }

.btn:hover { background: var(--face); color: var(--ink) !important; }

/* pressed-in look on click */
.btn:active {
  box-shadow:
    inset -1px -1px 0 var(--hilight),
    inset  1px  1px 0 var(--shadow-dark),
    inset -2px -2px 0 var(--face-light),
    inset  2px  2px 0 var(--shadow);
  padding: 7px 17px 5px 19px;
}

/* the default button: heavy outer border + dotted focus ring */
.btn-default {
  outline: 1px dotted var(--ink);
  outline-offset: -5px;
  border: 1px solid var(--shadow-dark);
  font-weight: bold;
}

.btn-small { padding: 4px 12px; font-size: 11px; }
.btn-small:active { padding: 5px 11px 3px 13px; }

/* ---------- news ticker ---------- */
.ticker {
  background: var(--navy);
  color: var(--paper);
  font-size: 12px;
  font-weight: bold;
  padding: 4px 0;
  border-top: 1px solid var(--shadow-dark);
  border-bottom: 1px solid var(--shadow-dark);
}

.ticker-mobile {
  display: none;
  overflow: hidden;
  white-space: nowrap;
}

@keyframes ticker-mobile-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---------- no-JavaScript notice (shown only via <noscript>) ---------- */
.noscript-notice {
  max-width: 560px;
  margin: 24px auto;
  padding: 16px 20px;
  background: var(--face);
  box-shadow:
    inset -1px -1px 0 var(--shadow-dark),
    inset  1px  1px 0 var(--hilight),
    inset -2px -2px 0 var(--shadow),
    inset  2px  2px 0 var(--face-light);
}
.noscript-notice p { margin: 8px 0; }

/* ---------- generic content section ---------- */
.content { padding: 20px 24px; }

/* Win95 title bar, repurposed as a section heading */
.wintitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 3px 3px 3px 8px;
  background: linear-gradient(to right, var(--navy), var(--navy-light));
  color: var(--paper);
  font-size: 14px;
  font-weight: bold;
  border: 1px solid var(--shadow-dark);
}

.wintitle-text { flex: 1; text-align: left; }

/* decorative titlebar buttons ( _ □ × ) */
.dialog-buttons { display: inline-flex; gap: 2px; }

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 16px;
  background: var(--face);
  color: var(--ink);
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
}

/* ---------- 98.css integration (Mod Library and below) ----------
   Section title bars and buttons from the Mod Library down use
   98.css  */

h2.section-bar {
  margin: 0 0 16px;
  font-size: 11px;
  font-family: "Pixelated MS Sans Serif", Tahoma, Arial, sans-serif;
  /* fallback + dark-mode-aware version of 98.css .title-bar */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 2px 3px 3px;
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
}

.section-bar .title-bar-text { color: #fff; font-weight: 700; }

/* 98.css button, replicated for <a> elements with theme variables
   (identical colors in light mode, adapts in dark mode) */
.btn98 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 23px;
  min-width: 75px;
  padding: 0 12px;
  font-family: "Pixelated MS Sans Serif", Tahoma, Arial, sans-serif;
  font-size: 11px;
  color: var(--ink) !important;
  text-decoration: none;
  text-shadow: none;
  background: var(--face);
  border: none;
  border-radius: 0;
  cursor: pointer;
  box-shadow:
    inset -1px -1px 0 var(--shadow-dark),
    inset  1px  1px 0 var(--hilight),
    inset -2px -2px 0 var(--shadow),
    inset  2px  2px 0 var(--face-light);
}

.btn98:visited { color: var(--ink); }
.btn98:hover { background: var(--face); color: var(--ink) !important; }

.btn98:not(:disabled):active {
  box-shadow:
    inset -1px -1px 0 var(--hilight),
    inset  1px  1px 0 var(--shadow-dark),
    inset -2px -2px 0 var(--face-light),
    inset  2px  2px 0 var(--shadow);
  text-shadow: 1px 1px var(--shadow-dark);
}

.btn98:focus { outline: 1px dotted var(--ink); outline-offset: -4px; }

/* ---------- welcome message box (Win95 dialog) ---------- */
.dialog {
  background: var(--face);
  padding: 3px;
}

.dialog-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 3px 3px 8px;
  background: linear-gradient(to right, var(--navy), var(--navy-light));
  color: var(--paper);
  font-size: 13px;
  font-weight: bold;
}

.dialog-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 16px 4px;
}

.dialog-icon { flex: 0 0 36px; }
.dialog-icon svg { width: 36px; height: 36px; display: block; }

.dialog-text p { margin: 0 0 10px; }
.dialog-question { font-weight: bold; }

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px 14px;
}

.btn-dialog { min-width: 90px; text-align: center; }

/* ---------- mod list (sunken list view) ---------- */
.modlist {
  list-style: none;
  margin: 0;
  padding: 3px;
  background: var(--paper);
}

.mod {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.mod + .mod { border-top: 1px solid var(--face-light); }

.mod:nth-child(even) { background: #f4f4f4; }

.icon { flex: 0 0 32px; height: 32px; }
/* icons may be inline <svg> or an <img> (see the ICONS block in index.html). */
.icon svg,
.icon img { width: 32px; height: 32px; display: block; image-rendering: pixelated; }

.mod-info { flex: 1 1 auto; min-width: 0; }
.mod-name { display: block; font-size: 13px; }
.mod-game { display: block; font-size: 11px; color: #444; }

.tag {
  font-style: normal;
  font-size: 9px;
  font-weight: bold;
  padding: 1px 5px;
  border: 1px solid var(--shadow-dark);
  vertical-align: 2px;
}

.tag-new { background: var(--yellow); }
.tag-hot { background: var(--navy); color: var(--paper); }

.mod-meta { flex: 0 0 auto; }

/* Win95 segmented progress bar */
.meter {
  display: inline-block;
  width: 90px;
  height: 14px;
  padding: 3px;
  background: var(--paper);
  vertical-align: middle;
}

.meter > span {
  display: block;
  height: 100%;
  background-image: repeating-linear-gradient(
    to right,
    var(--navy) 0 6px,
    var(--paper) 6px 8px
  );
}

.meter-wide { width: 100%; }

/* Explorer-style status strip under the list */
.finder-status {
  display: flex;
  justify-content: space-between;
  margin: 4px 0 0;
  padding: 4px 12px;
  font-size: 11px;
  background: var(--face);
}

/* ---------- about ---------- */
.about {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.about-mascot {
  flex: 0 0 auto;
  padding: 8px;
  background: var(--paper);
}

.about-text p:first-child { margin-top: 0; }

.stats { display: grid; gap: 8px; }

.stat {
  display: grid;
  grid-template-columns: 190px 1fr 90px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.stat-label { font-weight: bold; }
.stat-val { text-align: right; }

/* ---------- faq ---------- */
.faq { margin: 0; }
.faq dt { font-weight: bold; margin-top: 10px; }
.faq dt::before { content: "■ "; color: var(--navy); }
.faq dd { margin: 2px 0 0 18px; }

/* Win95 group box (etched frame) wrapping section content so it
   doesn't float in empty space under the title bar. Uses 98.css's
   authentic fieldset border-image. */
.section-frame {
  margin: 0;
  padding: 14px 16px;
  min-inline-size: 0; /* let flex/grid children shrink inside the fieldset */
  /* longhands so 98.css's fieldset border-image survives the cascade */
  border-width: 2px;
  border-style: groove;
  border-color: var(--face-light);
}

.section-frame > :last-child { margin-bottom: 0; }
.section-frame .about { margin-bottom: 14px; }
.section-frame .faq dt:first-child { margin-top: 0; }

/* ---------- links ---------- */
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { margin: 5px 0; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--hilight) inset;
  padding: 18px 24px 12px;
  text-align: center;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* 88×31 web buttons, drawn in CSS */
.badge {
  width: 88px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--face);
  font-size: 8px;
  font-weight: bold;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
}

.badge-navy   { background: var(--navy);    color: var(--paper); }
.badge-teal   { background: var(--desktop); color: var(--paper); }
.badge-yellow { background: var(--yellow); }

.badge-images { margin-top: -4px; }
.web-button { display: block; flex: 0 0 88px; width: 88px; height: 31px; }

.counter-row { margin: 8px 0; font-size: 12px; }

/* odometer-style hit counter */
.counter {
  display: inline-flex;
  gap: 2px;
  padding: 2px 3px;
  background: var(--ink);
  vertical-align: -4px;
}

.counter span {
  display: inline-block;
  width: 14px;
  padding: 1px 0;
  background: #111;
  color: #7dffa0;
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  border: 1px solid #333;
}

.fineprint { margin: 4px 0; font-size: 10px; color: #333; }
.fineprint a { color: var(--link); }

/* taskbar-style status strip */
.statusbar {
  display: flex;
  gap: 4px;
  margin: 14px -12px -4px;
  font-size: 11px;
  text-align: left;
}

.statusbar-cell {
  padding: 3px 8px;
  background: var(--face);
  white-space: nowrap;
}

.statusbar-wide { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.statusbar-clock {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.statusbar-sound-icon {
  display: block;
  width: 11px;
  height: 11px;
  image-rendering: pixelated;
}

/* ---------- easter egg: the "Done" cell is secretly a Start button ---------- */
.statusbar-startwrap { position: relative; display: flex; }

.statusbar-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: bold;
  cursor: pointer;
}

.statusbar-start-icon {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Keep the 98.css active-button treatment while the menu remains open. */
.statusbar-start[aria-expanded="true"] {
  box-shadow:
    inset -1px -1px #fff,
    inset 1px 1px #0a0a0a,
    inset -2px -2px #dfdfdf,
    inset 2px 2px grey;
  text-shadow: 1px 1px #222;
}

.startmenu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 3px);
  z-index: 50;
  display: flex;
  min-width: 150px;
  padding: 3px;
  background: var(--face);
  box-shadow:
    inset -1px -1px 0 var(--shadow-dark),
    inset  1px  1px 0 var(--hilight),
    inset -2px -2px 0 var(--shadow),
    inset  2px  2px 0 var(--face-light);
}

.startmenu[hidden] { display: none; }

/* the vertical banner down the left edge */
.startmenu-banner {
  width: 24px;
  flex: 0 0 24px;
  background: linear-gradient(to top, var(--navy-light), var(--navy));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 0;
}

.startmenu-banner span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.startmenu-items {
  list-style: none;
  margin: 0;
  padding: 2px 0;
  flex: 1;
}

/* menu entries can be links or buttons — both look identical.
 */
.startmenu-items a,
.startmenu-items button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 7px 20px 7px 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: none;
  border: none;
  box-shadow: none;
  text-shadow: none;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

/* stop 98.css re-adding the pressed bezel on click */
.startmenu-items button:active { box-shadow: none; }

.startmenu-items a:hover,
.startmenu-items a:focus,
.startmenu-items button:hover,
.startmenu-items button:focus {
  background: var(--navy);
  color: #fff !important;
}

.startmenu-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.startmenu-icon img {
  display: block;
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

/* ---------- easter egg: the fake shutdown screen ---------- */
.shutdown {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
}
.shutdown[hidden] { display: none; }

/* the classic amber "safe to turn off" message */
.shutdown-text {
  margin: 0;
  padding: 0 20px;
  color: #ffa030;
  font-family: "Fixedsys", "Lucida Console", "Courier New", monospace;
  font-size: clamp(20px, 4.2vw, 44px);
  line-height: 1.6;
  text-align: center;
}
.shutdown-text[hidden] { display: none; }

/* optional custom picture instead of the text */
.shutdown-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.shutdown-img[hidden] { display: none; }

/* Win95 push button, sitting near the bottom of the screen */
.shutdown-restart {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 96px;
  padding: 7px 20px;
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
  font-size: 13px;
  color: #000;
  background: #c0c0c0;
  border: none;
  cursor: pointer;
  box-shadow:
    inset -1px -1px 0 #0a0a0a,
    inset  1px  1px 0 #ffffff,
    inset -2px -2px 0 #808080,
    inset  2px  2px 0 #dfdfdf;
}
.shutdown-restart:active {
  box-shadow:
    inset -1px -1px 0 #ffffff,
    inset  1px  1px 0 #0a0a0a,
    inset -2px -2px 0 #dfdfdf,
    inset  2px  2px 0 #808080;
  padding: 8px 19px 6px 21px;
}
.shutdown-restart:disabled { cursor: default; opacity: 0.7; }

/* ---------- display panel (desktop only) ---------- */
.sidepanel {
  display: none;
  position: absolute;
  top: 201px; /* aligned with the navbar */
  left: calc(50% + 376px);
  width: 178px;
  padding: 3px 10px 12px;
  background: var(--face);
  box-shadow:
    inset -1px -1px 0 var(--shadow-dark),
    inset  1px  1px 0 var(--hilight),
    inset -2px -2px 0 var(--shadow),
    inset  2px  2px 0 var(--face-light);
}

.sidepanel-title { margin: 3px -7px 14px; font-size: 12px; }

.sidepanel-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

/* the switch button, dressed as a Mac System 7 push button */
.btn-macos {
  display: block;
  padding: 7px 10px;
  font-weight: bold;
  font-size: 12px;
  text-align: center;
  text-decoration: none;
  color: #000 !important;
  background: #fff;
  border: 2px solid #000;
  border-radius: 8px;
}

.btn-macos:hover, .btn-macos:active { background: #000; color: #fff !important; }

/* footer dark mode button: only where the side panel is hidden */
.footer-darkrow { margin: 12px 0 8px; }

@media (min-width: 1120px) {
  .sidepanel { display: block; }
  .navbar .btn-switch { display: none; }
  .footer-darkrow { display: none; }
}

/* ---------- dark mode (night shift at the office) ---------- */
.dark {
  --desktop: #012626;
  --face: #3a3a3a;
  --face-light: #484848;
  --hilight: #6a6a6a;
  --shadow: #141414;
  --shadow-dark: #000000;
  --ink: #e6e6e6;
  --paper: #181818;
  --navy-light: #0f6cb0;
  --link: #9db8ff;
  --link-visited: #cfa9ee;
}

.dark .masthead h1 {
  color: #8fb8ff;
  text-shadow: 3px 3px 0 #000;
}

.dark .mascot { filter: invert(1); }
.dark .about-mascot { background: #d8d8d8; }

.dark .mod:nth-child(even) { background: #222; }
.dark .mod-game { color: #b0b0b0; }
.dark .fineprint { color: #b0b0b0; }

.dark .tag-new { color: #000; }
.dark .badge-yellow { color: #000; }

/* brighter progress blocks so they read on the dark track */
.dark .meter > span {
  background-image: repeating-linear-gradient(
    to right,
    #2a6fd6 0 6px,
    var(--paper) 6px 8px
  );
}

/* ---------- small screens ---------- */
@media (max-width: 620px) {
  .navbar { padding: 12px 16px; }
  .btn-switch { position: static; transform: none; }
  .ticker-desktop { display: none; }
  .ticker-mobile { display: block; }
  .ticker-mobile-track {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-mobile-scroll 36s linear infinite;
    will-change: transform;
  }
  .masthead { flex-direction: column; gap: 10px; }
  .mascot-right { display: none; }
  .masthead h1 { font-size: 36px; }
  .mod { flex-wrap: wrap; }
  .mod-meta { display: none; }
  .stat { grid-template-columns: 1fr; gap: 2px; }
  .stat-val { text-align: left; }
  .dialog-actions { flex-wrap: wrap; }
  .statusbar { flex-wrap: wrap; }
}
