@font-face { font-family: "Silkscreen"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/silkscreen-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Silkscreen"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/silkscreen-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --teal: #008080;
  --win-face: #c0c0c0;
  --win-face-dark: #808080;
  --win-shadow: #404040;
  --win-hi: #ffffff;
  --titlebar-a: #000080;
  --titlebar-b: #1084d0;
  --ink: #000000;
  --ink-dim: #3a3a3a;
  --accent: #ffcc00;
  --link: #0000ee;
  --font-display: "Silkscreen", monospace;
  --font-body: "IBM Plex Sans", "MS Sans Serif", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--teal);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: var(--link); }
[hidden] { display: none !important; }

/* ---------- win98 bevel helpers ---------- */
.win, .desktop-icon img, .progress-track {
  box-shadow: inset -1px -1px 0 var(--win-shadow), inset 1px 1px 0 var(--win-hi);
}

/* ---------- degrading backdrop ---------- */
.degrade-stack { position: relative; z-index: 0; }
.degrade-band {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.degrade-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  image-rendering: pixelated;
  transform: scale(1.08) translateY(18px);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.9s ease;
  will-change: transform;
}
.degrade-band[data-band="0"] .degrade-img,
.degrade-band[data-band="1"] .degrade-img { image-rendering: auto; }
.degrade-band.band-in .degrade-img {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.degrade-caption {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 13px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 8px 14px;
  border-radius: 2px;
  margin: 0 0 24px;
  opacity: 0;
  transform: translateY(14px);
  transition: transform 0.6s ease 0.15s, opacity 0.6s ease 0.15s;
}
.degrade-band.band-in .degrade-caption {
  opacity: 1;
  transform: translateY(0);
}
.degrade-band-last { min-height: 70vh; gap: 16px; }
.reupload-btn {
  position: relative;
  z-index: 1;
  background: var(--win-face);
  border: none;
  box-shadow: inset -2px -2px 0 var(--win-shadow), inset 2px 2px 0 var(--win-hi);
  padding: 12px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  cursor: pointer;
}
.reupload-btn:active { box-shadow: inset 2px 2px 0 var(--win-shadow), inset -2px -2px 0 var(--win-hi); }
.repost-count {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 2px;
  margin: 0;
}

/* ---------- desktop icons ---------- */
.desktop-icons {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: grid;
  gap: 18px;
  width: 84px;
}
.desktop-icon {
  background: none;
  border: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
}
.desktop-icon img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  background: var(--win-face);
  animation: iconBob 3.4s ease-in-out infinite;
}
.desktop-icon:nth-child(2) img { animation-delay: -0.6s; }
.desktop-icon:nth-child(3) img { animation-delay: -1.4s; }
.desktop-icon:nth-child(4) img { animation-delay: -2.1s; }
.desktop-icon:nth-child(5) img { animation-delay: -2.8s; }
@keyframes iconBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .desktop-icon img { animation: none; }
}
.icon-glyph { font-size: 32px; line-height: 1; }
.desktop-icon span {
  font-family: var(--font-body);
  font-size: 11px;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
}
.desktop-icon:focus-visible span { outline: 1px dotted #fff; }

/* ---------- windows ---------- */
.windows-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.win {
  position: absolute;
  pointer-events: auto;
  width: 300px;
  background: var(--win-face);
  border: 2px solid var(--win-hi);
  box-shadow: 2px 2px 0 var(--win-shadow), inset -1px -1px 0 var(--win-shadow), inset 1px 1px 0 var(--win-hi);
}
.win-wide { width: 340px; }
.win-titlebar {
  background: linear-gradient(90deg, var(--titlebar-a), var(--titlebar-b));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  cursor: grab;
  user-select: none;
}
.win-titlebar:active { cursor: grabbing; }
.win-title { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.02em; }
.win-controls { display: flex; gap: 3px; }
.win-btn {
  width: 18px;
  height: 16px;
  background: var(--win-face);
  border: none;
  box-shadow: inset -1px -1px 0 var(--win-shadow), inset 1px 1px 0 var(--win-hi);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.win-body { padding: 12px; font-size: 13px; }
.win-line { margin: 0 0 8px; }
.win-line-dim { color: var(--ink-dim); font-size: 12px; }
.win-hero-art {
  width: 100%;
  border: 1px solid var(--win-shadow);
  margin-bottom: 10px;
  animation: crtFlicker 4s ease-in-out infinite;
}
.win-hero-art-chill { animation: none; }
@keyframes crtFlicker {
  0%, 96%, 100% { filter: brightness(1) saturate(1); }
  97% { filter: brightness(1.08) saturate(1.15); }
  98% { filter: brightness(0.94) saturate(0.9); }
}

.progress-track {
  height: 20px;
  background: #fff;
  border: 1px solid var(--win-shadow);
  margin-bottom: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 87%;
  background: repeating-linear-gradient(90deg, var(--titlebar-a) 0 8px, var(--titlebar-b) 8px 16px);
  background-size: 32px 100%;
  animation: progressGrind 1.1s linear infinite;
}
@keyframes progressGrind {
  from { background-position: 0 0; }
  to { background-position: -32px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-fill { animation: none; }
}
.progress-label { font-family: var(--font-display); font-size: 12px; margin: 0 0 10px; }

.props-tabs { display: flex; gap: 2px; margin-bottom: 10px; }
.props-tab {
  font-size: 11px;
  padding: 4px 10px;
  background: var(--win-face);
  box-shadow: inset -1px -1px 0 var(--win-shadow), inset 1px 1px 0 var(--win-hi);
}
.props-tab-active { background: #fff; font-weight: 700; }
.props-list { margin: 0; }
.props-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid #a0a0a0; font-size: 12px; }
.props-row dt { color: var(--ink-dim); }
.props-row dd { margin: 0; font-weight: 600; text-align: right; }
.props-mono { font-family: "Courier New", monospace; font-size: 11px; }

.recycle-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.recycle-list li {
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  background: #fff;
}
.recycle-list li span:last-child { color: var(--ink-dim); font-size: 11px; white-space: nowrap; }

.ifier-drop {
  border: 2px dashed var(--win-shadow);
  background: #fff;
  padding: 28px 14px;
  text-align: center;
  font-size: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}
.ifier-drop.drag { border-color: var(--titlebar-b); }
.ifier-canvas { width: 100%; border: 1px solid var(--win-shadow); margin-bottom: 10px; image-rendering: pixelated; }
.ifier-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.win-action-btn {
  background: var(--win-face);
  border: none;
  box-shadow: inset -1px -1px 0 var(--win-shadow), inset 1px 1px 0 var(--win-hi);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  display: inline-block;
}
.win-action-btn:active { box-shadow: inset 1px 1px 0 var(--win-shadow), inset -1px -1px 0 var(--win-hi); }
.win-action-btn-tweet { background: #1084d0; color: #fff; }
.win-action-btn-ghost { background: transparent; box-shadow: inset -1px -1px 0 var(--win-face-dark), inset 1px 1px 0 var(--win-hi); }

/* ---------- save as modal ---------- */
body.modal-open .windows-layer .win {
  pointer-events: none !important;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.save-as-win { position: static; width: 320px; }
.save-as-label { display: block; font-size: 12px; margin-bottom: 10px; }
.save-as-input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--win-shadow);
  box-shadow: inset 1px 1px 0 var(--win-shadow);
  font-size: 13px;
  font-family: var(--font-body);
}
.dialog-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ---------- cheat codes ---------- */
.cursor-fx {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 9999;
  font-size: 24px;
  transform: translate3d(-50px, -50px, 0);
}
.cheat-sprite {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  width: 220px;
}
.cheat-sprite-heli { top: 8%; left: -260px; }
.cheat-sprite-heli.fly { animation: flyAcross 3.2s linear forwards; }
@keyframes flyAcross {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 300px)); }
}
.cheat-sprite-car { bottom: 40px; left: -300px; width: 260px; }
.cheat-sprite-car.drive { animation: driveAcross 2.4s ease-in forwards; }
@keyframes driveAcross {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 340px)); }
}
.cheat-toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: #000;
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  padding: 10px 18px;
  border: 2px solid var(--accent);
}

/* ---------- taskbar ---------- */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: 40px;
  background: var(--win-face);
  box-shadow: inset 0 1px 0 var(--win-hi);
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 8px;
}
.taskbar-tasks { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.taskbar-task {
  background: var(--win-face);
  box-shadow: inset -1px -1px 0 var(--win-shadow), inset 1px 1px 0 var(--win-hi);
  border: none;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taskbar-task.active { box-shadow: inset 1px 1px 0 var(--win-shadow), inset -1px -1px 0 var(--win-hi); }
.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--win-face);
  box-shadow: inset 1px 1px 0 var(--win-shadow);
  padding: 4px 10px;
}
.tray-social { color: var(--ink); display: flex; }
.tray-buy {
  background: #c00000;
  color: #fff;
  border: none;
  box-shadow: inset -1px -1px 0 #600, inset 1px 1px 0 #f88;
  font-family: var(--font-display);
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
}
.tray-clock { font-size: 11px; font-family: var(--font-body); }

.footer-canary {
  position: fixed;
  bottom: 44px;
  right: 10px;
  z-index: 15;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ---------- responsive: windows become static stacked cards on small screens ---------- */
@media (max-width: 760px) {
  .windows-layer {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 12px 90px;
  }
  .windows-layer .win {
    position: static !important;
    width: 100%;
  }
  .desktop-icons {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: auto;
    padding: 12px;
    gap: 14px;
  }
  .win-titlebar { cursor: default; }
}

@media (prefers-reduced-motion: reduce) {
  .cheat-sprite-heli.fly, .cheat-sprite-car.drive { animation: none; }
}
