/* ===== disable the global full-viewport CRT overlay for this prototype —
   it'll be reapplied scoped to just the screen-cutout instead ===== */
body.crt-proto::before,
body.crt-proto::after {
  content: none;
}

/* ===== desk background (tiled pattern instead of flat teal) ===== */
body.crt-proto {
  background-color: #3a2a4a;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 2px, transparent 2px, transparent 14px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.06) 0px, rgba(0,0,0,0.06) 2px, transparent 2px, transparent 14px);
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 40px 16px 60px;
}

.proto-page {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== the monitor bezel — CSS-drawn plastic with some grime/texture
   layered in so it doesn't read as too smooth/toy-like ===== */
.monitor {
  width: min(880px, 100%);
  aspect-ratio: 4 / 3;
  background:
    /* darker corner grime pooling, like dust/dirt settled in corners */
    radial-gradient(circle at 4% 4%, rgba(0,0,0,0.16), transparent 22%),
    radial-gradient(circle at 96% 6%, rgba(0,0,0,0.13), transparent 20%),
    radial-gradient(circle at 6% 96%, rgba(0,0,0,0.18), transparent 24%),
    radial-gradient(circle at 95% 92%, rgba(0,0,0,0.15), transparent 22%),
    /* larger blotchy discoloration, uneven old plastic */
    radial-gradient(circle at 20% 25%, rgba(0,0,0,0.08), transparent 38%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.09), transparent 42%),
    radial-gradient(circle at 35% 80%, rgba(70,60,40,0.10), transparent 30%),
    radial-gradient(circle at 60% 15%, rgba(255,255,255,0.14), transparent 35%),
    /* fine grain */
    repeating-linear-gradient(0deg, rgba(0,0,0,0.035) 0px, rgba(0,0,0,0.035) 1px, transparent 1px, transparent 2px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.03) 0px, rgba(0,0,0,0.03) 1px, transparent 1px, transparent 2px),
    /* base plastic gradient, slightly yellowed */
    linear-gradient(155deg, #d6cfbd, #9e967f);
  border-radius: 22px;
  padding: 34px 34px 58px;
  box-shadow:
    0 26px 55px rgba(0,0,0,0.55),
    inset 0 2px 2px rgba(255,255,255,0.35),
    inset 0 -6px 12px rgba(0,0,0,0.35);
  position: relative;
}

/* scuff marks, streaks, and small speckled dirt for visible wear */
.monitor::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background:
    linear-gradient(115deg, transparent 38%, rgba(0,0,0,0.07) 39%, transparent 41%),
    linear-gradient(75deg, transparent 55%, rgba(0,0,0,0.05) 56%, transparent 59%),
    linear-gradient(20deg, transparent 70%, rgba(0,0,0,0.05) 71%, transparent 73%),
    radial-gradient(circle at 12% 55%, rgba(0,0,0,0.12) 0%, transparent 1.4%),
    radial-gradient(circle at 30% 22%, rgba(0,0,0,0.10) 0%, transparent 1%),
    radial-gradient(circle at 72% 40%, rgba(0,0,0,0.10) 0%, transparent 1.2%),
    radial-gradient(circle at 88% 65%, rgba(0,0,0,0.11) 0%, transparent 1%),
    radial-gradient(circle at 45% 88%, rgba(0,0,0,0.09) 0%, transparent 1.3%),
    radial-gradient(circle at 15% 80%, rgba(0,0,0,0.08) 0%, transparent 0.8%);
  pointer-events: none;
}

.brand-plate {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #5a5548;
  font-weight: bold;
  text-transform: uppercase;
}

.power-led {
  position: absolute;
  bottom: 24px;
  right: 34px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6dff8f;
  box-shadow: 0 0 6px 2px rgba(109, 255, 143, 0.8);
  animation: led-pulse 3s ease-in-out infinite;
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ===== the actual screen — everything from the live desktop lives here,
   just scaled down and contained instead of spanning the viewport ===== */
.screen-cutout {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #046863;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 10px 2px #000, inset 0 0 40px rgba(0,0,0,0.7);
}

/* scoped CRT overlay — same effect as the global one, just contained */
.screen-cutout::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0.14) 2px,
    rgba(0,0,0,0) 3px
  );
  z-index: 50;
  mix-blend-mode: multiply;
}

.screen-cutout::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 49;
  box-shadow: inset 0 0 60px 20px rgba(0,0,0,0.6);
  animation: crt-flicker 7s infinite ease-in-out;
}

@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.88; }
}

/* ===== scaled-down desktop icons, contained within the screen ===== */
.screen-cutout .desktop {
  position: absolute;
  inset: 0;
  height: auto;
  bottom: 32px;
  padding: 14px;
}

.screen-cutout .icon {
  position: absolute;
  width: 62px;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.screen-cutout .icon:active {
  cursor: grabbing;
}

.screen-cutout .icon[data-icon-id="downloads"] { left: 14px; top: 10px; }
.screen-cutout .icon[data-icon-id="cooking"]   { left: 14px; top: 76px; }
.screen-cutout .icon[data-icon-id="gallery"]   { left: 14px; top: 142px; }
.screen-cutout .icon[data-icon-id="thoughts"]  { left: 14px; top: 208px; }
.screen-cutout .icon[data-icon-id="guestbook"] { left: 14px; top: 274px; }

.screen-cutout .icon-img {
  width: 34px;
  height: 34px;
}

.screen-cutout .pixel-icon {
  width: 22px;
  height: 22px;
}

.screen-cutout .cube-scene {
  width: 28px;
  height: 28px;
}

.screen-cutout .icon span {
  font-size: 10px;
}

/* ===== scaled-down taskbar ===== */
.screen-cutout .taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 32px;
  font-size: 11px;
}

.screen-cutout .taskbar-clock {
  padding: 3px 8px;
}

.screen-cutout .start-btn {
  padding: 3px 8px;
}

/* ===== scaled-down welcome window ===== */
.screen-cutout .welcome-window {
  top: 18px;
  right: 18px;
  width: 220px;
  font-size: 11px;
}

.screen-cutout .window-body p {
  margin: 0 0 6px 0;
}

/* ===== chat window: fixed bottom-right by default, still draggable ===== */
.screen-cutout .chat-window {
  bottom: 42px;
  right: 18px;
  width: 200px;
  font-size: 11px;
}

.chat-window-body {
  padding: 0 !important;
  height: 220px;
  overflow: hidden;
}

.chat-window-body iframe {
  display: block;
  border: none;
}

/* ===== content pages (cooking, gallery, etc.) reused inside the same screen ===== */
.screen-cutout .page-window {
  position: absolute;
  inset: 10px 10px 40px 10px;
  width: auto;
  margin: 0;
  overflow-y: auto;
  font-size: 12px;
}

.screen-cutout .page-window h1 {
  font-size: 15px;
}

.screen-cutout .page-window .construction-block {
  margin: 14px 0;
}

/* ===== desk shelf: webring badges + retro clutter, outside the screen ===== */
.desk-shelf {
  width: min(800px, 100%);
  margin-top: 26px;
  text-align: center;
}

.shelf-label {
  font-size: 12px;
  color: #d8cfe0;
  margin-bottom: 10px;
  font-family: "MS Sans Serif", "Tahoma", sans-serif;
}

.shelf-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* classic 88x31 webring badge size */
.webring-badge {
  width: 88px;
  height: 31px;
  background: linear-gradient(to bottom, #2b2b40, #1a1a2e);
  border: 1px solid #6a5acd;
  color: #d8cfe0;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  line-height: 1;
  font-family: "MS Sans Serif", "Tahoma", sans-serif;
}

.wr-text {
  text-align: center;
  flex: 1;
}

.wr-arrow {
  color: #b19cd9;
  font-weight: bold;
}

.blink-badge {
  width: 88px;
  height: 31px;
  background: #000;
  border: 1px solid #ffcc00;
  color: #ffcc00;
  font-size: 9px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: badge-blink 1.2s steps(1) infinite;
}

@keyframes badge-blink {
  0%, 60% { opacity: 1; }
  75% { opacity: 0.2; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .power-led, .blink-badge, .screen-cutout::after { animation: none; }
}

@media (max-width: 600px) {
  .screen-cutout .icon { width: 52px; }
  .screen-cutout .welcome-window { width: 160px; font-size: 10px; }
}
