/* =========================================================
   "SYSTEM MESSAGE" POP-UP

   A Windows-98-era dialog holding three pixel hearts. Shown
   over the page on load; Ok, Cancel, the X and Escape all
   dismiss it. Purely decorative -- nothing is gated behind it.

   Everything is scoped under .w98 so none of it leaks into the
   plain black-and-white pages underneath. Markup is injected by
   assets/win98-popup.js.
   ========================================================= */

/* The classic 3D bevel: light on the top/left, dark on the
   bottom/right, two pixels deep. Buttons invert it when pressed. */
:root {
  --w98-face:    #c0c0c0;
  --w98-light:   #ffffff;
  --w98-shadow:  #808080;
  --w98-dark:    #000000;
  --w98-title:   #00007b;
  --w98-title-2: #0a0a9c;
}

.w98-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}

.w98 {
  /* The reference art uses a bitmap terminal face, so this leans
     monospace rather than the usual MS Sans Serif. */
  font-family: "Courier New", Courier, monospace;
  font-size: 17px;
  font-weight: bold;
  line-height: 1.2;
  color: #000;
  -webkit-font-smoothing: none;
}

.w98-window {
  width: 420px;
  max-width: 100%;
  background: var(--w98-face);
  border: 1px solid var(--w98-dark);
  padding: 3px;
  box-shadow:
    inset -1px -1px 0 0 var(--w98-shadow),
    inset  1px  1px 0 0 var(--w98-light),
    inset -2px -2px 0 0 var(--w98-shadow),
    inset  2px  2px 0 0 var(--w98-face),
    4px 4px 0 0 rgba(0, 0, 0, 0.35);
  animation: w98-open 120ms steps(3, end);
}

/* Windows didn't ease. It stepped. */
@keyframes w98-open {
  from { transform: scale(0.85); opacity: 0.6; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ---- Title bar ---- */

.w98-titlebar {
  display: flex;
  align-items: center;
  padding: 3px 3px 3px 8px;
  background: linear-gradient(90deg, var(--w98-title), var(--w98-title-2));
  color: #fff;
  cursor: default;
  user-select: none;
}

.w98-titlebar h2 {
  flex: 1 1 auto;
  margin: 0;
  font: inherit;
  letter-spacing: 1px;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w98-close {
  flex: none;
  width: 26px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  color: #000;
  background: var(--w98-face);
  border: 1px solid var(--w98-dark);
  cursor: pointer;
  box-shadow:
    inset -1px -1px 0 0 var(--w98-shadow),
    inset  1px  1px 0 0 var(--w98-light);
}

.w98-close:active {
  box-shadow:
    inset  1px  1px 0 0 var(--w98-shadow),
    inset -1px -1px 0 0 var(--w98-light);
}

/* ---- Hearts ---- */

.w98-hearts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 26px 20px 30px;
}

.w98-heart {
  display: block;
  width: 96px;
  height: auto;
  /* Keep the pixel grid hard-edged at any scale. */
  shape-rendering: crispEdges;
}

/* ---- Buttons ---- */

.w98-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 0 20px 22px;
}

.w98-btn {
  min-width: 150px;
  padding: 8px 12px;
  font: inherit;
  letter-spacing: 1px;
  color: #3a3a3a;
  background: var(--w98-face);
  border: 1px solid var(--w98-shadow);
  cursor: pointer;
  box-shadow:
    inset -1px -1px 0 0 var(--w98-shadow),
    inset  1px  1px 0 0 var(--w98-light);
}

.w98-btn:active {
  padding: 9px 11px 7px 13px;
  box-shadow:
    inset  1px  1px 0 0 var(--w98-shadow),
    inset -1px -1px 0 0 var(--w98-light);
}

.w98-btn:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

/* ---- Small screens ----
   Below this the hearts would crowd the window edges, so they
   shrink and the buttons stack full width to stay tappable. */

@media screen and (max-width: 460px) {
  .w98-hearts { gap: 12px; padding: 20px 12px 22px; }
  .w98-heart { width: 72px; }
  .w98-actions { flex-direction: column; gap: 10px; padding: 0 14px 16px; }
  .w98-btn { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .w98-window { animation: none; }
}
