:root {
  --xp-blue: #1457d9;
  --xp-blue-dark: #0037a5;
  --xp-green: #37a934;
  --cream: #fff8dc;
  --shadow: rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  font-family: "Lucida Console", "Courier New", Tahoma, monospace;
  background: #55a2e3;
  color: #fff;
  image-rendering: pixelated;
}

.desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.04)), url("assets/windows-xp-rainbow.jpg");
  background-position: center;
  background-size: cover;
  image-rendering: auto;
}

.desktop::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 52% 42%, rgba(255, 255, 255, 0.22), transparent 26%),
    linear-gradient(180deg, transparent 54%, rgba(22, 89, 16, 0.12));
  mix-blend-mode: soft-light;
  opacity: 0.9;
  z-index: 0;
}

.dog {
  position: absolute;
  left: 50%;
  bottom: 42px;
  z-index: 3;
  width: min(42vw, 560px);
  min-width: 280px;
  transform: translateX(-50%) scale(1);
  opacity: 0.96;
  filter: drop-shadow(0 30px 26px rgba(0, 0, 0, 0.35));
  image-rendering: auto;
  animation: dogIdle 5s ease-in-out infinite;
}

.topbar {
  position: absolute;
  top: clamp(14px, 2.2vh, 24px);
  right: clamp(14px, 2.2vw, 28px);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pixel-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 12px;
  color: #061b55;
  text-decoration: none;
  text-transform: uppercase;
  font: 700 12px/1 "Lucida Console", "Courier New", monospace;
  letter-spacing: 0;
  background: #ece9d8;
  border: 2px solid #fff;
  border-right-color: #716f64;
  border-bottom-color: #716f64;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.26);
  cursor: pointer;
}

.pixel-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.26);
}

.contract-button {
  max-width: min(430px, 48vw);
}

.button-label {
  color: #0b45b2;
}

.button-value {
  overflow: hidden;
  max-width: 280px;
  color: #111;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x-button {
  color: #fff;
  background: linear-gradient(180deg, #2a2a2a, #050505);
  border-color: #777;
  border-right-color: #000;
  border-bottom-color: #000;
}

.x-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #000;
  background: #fff;
  border-radius: 0;
  font-weight: 900;
}

.headline {
  position: absolute;
  top: clamp(72px, 10vh, 96px);
  left: clamp(24px, 5vw, 76px);
  z-index: 5;
  width: min(560px, calc(100vw - 48px));
  color: #fff;
  text-shadow: 0 3px 4px rgba(0, 0, 0, 0.35);
}

.protocol {
  margin: 0 0 2px;
  font-size: clamp(48px, 9vw, 118px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 70px);
  line-height: 0.94;
}

.subline {
  display: inline-block;
  margin: 14px 0 0;
  padding: 6px 10px;
  color: #09215c;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 0;
  font-size: clamp(13px, 1.6vw, 18px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.xp-error {
  position: absolute;
  z-index: 4;
  width: min(360px, calc(100vw - 28px));
  color: #111;
  background: #ece9d8;
  border: 1px solid #0b3f91;
  border-radius: 0;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  animation: errorPop 520ms ease-out forwards, errorShake 160ms linear 560ms 4;
}

.xp-error.behind-dog {
  filter: saturate(0.9);
  opacity: 0;
}

.xp-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 5px 0 10px;
  color: white;
  font-size: 13px;
  font-family: "Lucida Console", "Courier New", monospace;
  font-weight: 700;
  background: linear-gradient(180deg, #2c7bff, var(--xp-blue) 54%, var(--xp-blue-dark));
  border-radius: 0;
  text-shadow: 1px 1px #173c8f;
}

.xp-title button {
  width: 22px;
  height: 22px;
  padding: 0;
  color: #fff;
  font: 700 18px/18px Arial, sans-serif;
  background: linear-gradient(180deg, #f9a08e, #d64124);
  border: 1px solid #fff;
  border-radius: 0;
  box-shadow: inset 0 -1px rgba(0, 0, 0, 0.2);
}

.xp-body {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  min-height: 104px;
  padding: 18px 18px 12px;
  font-size: 13px;
}

.xp-body strong {
  display: block;
  margin-bottom: 7px;
  font-size: 17px;
}

.xp-body p {
  margin: 0;
  line-height: 1.35;
}

.xp-icon {
  width: 38px;
  height: 38px;
  color: #fff;
  text-align: center;
  font: 700 30px/38px Arial, sans-serif;
  background: #f1c400;
  border: 2px solid #111;
  clip-path: polygon(50% 0, 100% 88%, 0 88%);
  text-shadow: 1px 1px #665100;
}

.xp-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 14px 14px;
}

.xp-actions button {
  min-width: 76px;
  height: 25px;
  font: 12px "Lucida Console", "Courier New", monospace;
  background: linear-gradient(#fff, #dad7c8);
  border: 1px solid #6f6b5f;
  border-radius: 0;
  box-shadow: inset 1px 1px #fff;
}

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 8px;
  background: linear-gradient(180deg, #245eea, #1646c5 52%, #0d39a8);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.36);
}

.start-button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 16px 0 10px;
  color: #fff;
  font: italic 700 16px Tahoma, sans-serif;
  text-transform: lowercase;
  background: linear-gradient(180deg, #77d567, #198d23 55%, #0b7317);
  border: 0;
  border-radius: 18px 9px 9px 18px;
  box-shadow: inset 1px 1px rgba(255, 255, 255, 0.48), 2px 0 5px rgba(0, 0, 0, 0.25);
}

.start-orb {
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 35% 35%, #fff, #f34 22%, #ff9c00 43%, #19ae24 44%, #0c6 66%, #1766ff 67%);
  border-radius: 50%;
}

.task {
  width: min(220px, 36vw);
  height: 28px;
  padding: 6px 12px;
  color: #fff;
  font-size: 13px;
  background: linear-gradient(180deg, rgba(84, 137, 255, 0.72), rgba(25, 75, 185, 0.82));
  border-radius: 0;
  box-shadow: inset 1px 1px rgba(255, 255, 255, 0.25);
}

.tray {
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: stretch;
  margin-left: auto;
  padding: 0 12px;
  color: #fff;
  font-size: 12px;
  background: linear-gradient(180deg, rgba(30, 152, 222, 0.62), rgba(19, 105, 184, 0.75));
  box-shadow: inset 1px 0 rgba(255, 255, 255, 0.18);
}

@keyframes dogIdle {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  50% {
    transform: translateX(-50%) translateY(-8px) scale(1.012);
  }
}

@keyframes errorPop {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes errorShake {
  0%,
  100% {
    margin-left: 0;
  }
  25% {
    margin-left: -3px;
  }
  75% {
    margin-left: 3px;
  }
}

@media (max-width: 700px) {
  .dog {
    width: min(76vw, 420px);
    bottom: 42px;
  }

  .headline {
    top: 92px;
  }

  .topbar {
    left: 12px;
    right: 12px;
    justify-content: space-between;
  }

  .contract-button {
    max-width: calc(100vw - 118px);
  }

  .button-value {
    max-width: 128px;
  }

  .xp-error {
    width: min(320px, calc(100vw - 20px));
  }

  .xp-body {
    grid-template-columns: 38px 1fr;
    padding: 14px 14px 10px;
  }
}
