:root {
  color-scheme: dark;
  --desktop-silver: #d7d5ce;
  --desktop-shadow: #3b3b39;
  --signal-yellow: #ffd719;
  --pixel-red: #e00012;
}

@font-face {
  font-family: "Faith Collapsing";
  src: url("/assets/fonts/faith-collapsing.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Black Gothics";
  src: url("/assets/fonts/black-gothics.ttf") format("truetype");
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #000;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a,
summary {
  cursor: pointer;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px dashed var(--signal-yellow);
  outline-offset: 4px;
}

.checkpoint {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  grid-template-rows: 34px 1fr;
  isolation: isolate;
  background: #020202;
}

.checkpoint__backdrop {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.48) 46%, rgba(0, 0, 0, 0.3) 72%, rgba(0, 0, 0, 0.58) 100%),
    url("/assets/westopolis/entrance-background.webp") center / cover no-repeat;
  filter: contrast(1.12) saturate(0.9);
  transform: scale(1.015);
}

.checkpoint::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 0, 0, 0.09) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(255, 215, 25, 0.06) 80px);
  opacity: 0.7;
}

.screen-noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, transparent 0 5px, rgba(0, 0, 0, 0.1) 5px 6px),
    repeating-linear-gradient(90deg, rgba(255, 0, 0, 0.012) 0 1px, transparent 1px 8px);
  mix-blend-mode: multiply;
}

.screen-noise::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(0, 90, 255, 0.035), transparent 25%, transparent 75%, rgba(255, 0, 0, 0.04));
  animation: screen-flicker 5s steps(2, end) infinite;
}

.desktop-bar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  color: #fff;
  border-top: 1px solid #ff1b2e;
  border-bottom: 2px solid #000;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent 14%, transparent 68%, rgba(0, 0, 0, 0.55)),
    linear-gradient(90deg, #050505, #780008 46%, #050505);
  box-shadow:
    inset 0 1px #ff4858,
    inset 0 -1px #520006,
    0 3px 0 rgba(0, 0, 0, 0.8);
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-size: 11px;
}

.desktop-start {
  display: flex;
  height: 29px;
  padding: 0 15px 0 8px;
  align-items: center;
  gap: 6px;
  color: #fff;
  border: 1px solid #ff1b2e;
  border-radius: 0 13px 13px 0;
  background:
    linear-gradient(180deg, #4f4f4f, #151515 45%, #050505 55%, #780008);
  box-shadow: inset 1px 1px rgba(255, 255, 255, 0.55);
  text-decoration: none;
  text-shadow: 1px 1px #000;
}

.desktop-start__heart {
  color: var(--signal-yellow);
  font-size: 18px;
  line-height: 1;
  text-shadow: 1px 1px #7c0000;
}

.desktop-tabs {
  display: flex;
  min-width: 0;
  height: 100%;
  margin-left: 8px;
  align-items: center;
  gap: 4px;
}

.desktop-tab {
  overflow: hidden;
  width: 160px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(20, 0, 2, 0.72);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-tab--active {
  background: rgba(142, 0, 10, 0.88);
  box-shadow: inset 1px 1px rgba(255, 255, 255, 0.35);
}

.desktop {
  position: relative;
  z-index: 3;
  width: min(1500px, calc(100% - 36px));
  min-height: 690px;
  margin: auto;
}

.retro-window {
  position: absolute;
  min-width: 0;
  max-width: 100%;
  color: #111;
  border: 2px solid var(--desktop-silver);
  border-right-color: #2e2e2e;
  border-bottom-color: #2e2e2e;
  border-radius: 0;
  background: var(--desktop-silver);
  box-shadow:
    3px 3px 0 #000,
    8px 8px 0 rgba(88, 0, 6, 0.68),
    11px 11px 0 rgba(0, 0, 0, 0.8);
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
}

.window-titlebar {
  display: flex;
  min-height: 29px;
  padding: 3px 4px 3px 7px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 5px, transparent 5px 10px),
    linear-gradient(90deg, #680008, #d00012 70%, #5b0007);
  border-bottom: 2px solid var(--signal-yellow);
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 1px 1px #000;
}

.window-titlebar--silver {
  color: #050505;
  background: linear-gradient(90deg, #9a9a94, #f1efe8 68%, #777873);
  border-bottom-color: #666;
  text-shadow: 1px 1px #fff;
}

.window-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.window-controls span {
  display: grid;
  width: 19px;
  height: 19px;
  color: #111;
  background: #d7d5ce;
  border: 1px solid #fff;
  border-right-color: #444;
  border-bottom-color: #444;
  place-items: center;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-shadow: none;
}

.welcome-window {
  top: 64px;
  left: 5%;
  z-index: 5;
  width: min(820px, 60vw);
  animation: welcome-float 7.5s ease-in-out infinite;
}

.welcome-window::before,
.welcome-window::after {
  position: absolute;
  z-index: -1;
  width: 68%;
  height: 40px;
  content: "";
  pointer-events: none;
  background:
    repeating-linear-gradient(135deg, #000 0 9px, var(--signal-yellow) 9px 18px);
  border: 2px solid #000;
}

.welcome-window::before {
  top: -22px;
  left: 10%;
  transform: rotate(1.8deg);
}

.welcome-window::after {
  right: -44px;
  bottom: -20px;
  transform: rotate(-2deg);
}

.window-body {
  position: relative;
  min-width: 0;
  min-height: 500px;
  padding: clamp(25px, 4vw, 52px);
  overflow: hidden;
  border: 2px solid #111;
  box-shadow: inset 0 0 0 1px #4a4a4a;
}

.window-body.dark-ark-gradient {
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 0, 0, 0.065) 0,
      rgba(255, 0, 0, 0.065) 1px,
      transparent 1px,
      transparent 13px
    ),
    radial-gradient(circle at 18% 12%, rgba(139, 0, 0, 0.22), transparent 34%),
    linear-gradient(135deg, #000 0%, #080808 42%, #191919 100%);
}

.window-body::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(116deg, transparent 0 62%, rgba(255, 0, 0, 0.11) 62.2%, transparent 62.8%),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255, 255, 255, 0.018) 32px);
}

.pixel-badges {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pixel-badges .chaos-badge {
  min-height: 24px;
  border-radius: 0;
  font-family: "Courier New", monospace;
  font-size: 10px;
  box-shadow: 3px 3px 0 #000;
}

.pixel-badges .chaos-badge--yellow {
  color: #060606;
  border-color: #fff07a;
  background: var(--signal-yellow);
  box-shadow: 3px 3px 0 #7d0000;
}

.welcome-window__kicker {
  position: relative;
  margin-top: 25px;
  color: var(--signal-yellow);
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: none;
}

.welcome-window h1 {
  position: relative;
  max-width: 760px;
  margin-top: 8px;
  color: #fff;
  font-family: "Black Gothics", var(--sth-font-display);
  font-style: normal;
  font-size: clamp(49px, 5vw, 78px);
  line-height: 0.94;
  overflow-wrap: anywhere;
  text-shadow: 3px 3px 0 #690008;
}

.welcome-window .ark-divider {
  position: relative;
  width: 100%;
  margin: 23px 0 18px;
}

.checkpoint__copy {
  position: relative;
  max-width: 680px;
  color: #f8f8f2;
  font-family: Verdana, Tahoma, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.48;
  text-shadow: 1px 1px #000;
}

.checkpoint__copy p + p {
  margin-top: 13px;
}

.checkpoint__copy strong {
  color: var(--signal-yellow);
}

.checkpoint__proceed {
  color: var(--signal-yellow);
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.welcome-actions {
  position: relative;
  display: flex;
  margin-top: 25px;
  align-items: center;
  gap: 15px;
}

.checkpoint-enter {
  min-width: 310px;
  min-height: 57px;
  border: 2px solid #ff1a2d;
  border-radius: 0;
  box-shadow: 4px 4px 0 #000, 7px 7px 0 var(--signal-yellow);
}

.notice-window {
  top: 62px;
  right: 2%;
  z-index: 7;
  width: min(390px, 32vw);
  animation: notice-float 9s ease-in-out -2.2s infinite;
}

.notice-window::before,
.notice-window::after {
  position: absolute;
  z-index: -2;
  width: 100%;
  height: 100%;
  content: "";
  background: #d7d5ce;
  border: 2px solid #fff;
  border-right-color: #333;
  border-bottom-color: #333;
}

.notice-window::before {
  top: -12px;
  left: -13px;
}

.notice-window::after {
  top: -23px;
  left: -24px;
}

.notice-window__body {
  padding: 16px;
  color: #111;
  background:
    repeating-linear-gradient(0deg, rgba(17, 53, 112, 0.055) 0 1px, transparent 1px 5px),
    #deddd7;
  border: 2px inset #ecebe6;
  font-size: 12px;
  line-height: 1.34;
}

.notice-lead {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 6px;
  color: #fff;
  background: #a0000b;
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
}

.notice-window ul {
  display: grid;
  margin-left: 20px;
  gap: 9px;
}

.notice-window li::marker {
  color: #a0000b;
}

.notice-window .chaos-alert {
  width: 100%;
  margin-top: 15px;
  padding: 10px;
  border-radius: 0;
  color: #fff;
  font-size: 11px;
}

.notice-ok {
  width: 88px;
  margin: 13px auto 0;
  padding: 5px 10px;
  border: 2px outset #fff;
  background: #d7d5ce;
  box-shadow: 1px 1px 0 #000;
  text-align: center;
  font-weight: 700;
}

.newcomer-window {
  right: 7%;
  bottom: 35px;
  z-index: 6;
  width: 270px;
  animation: newcomer-float 6.8s ease-in-out -1.1s infinite;
}

.newcomer-window__body {
  padding: 17px;
  text-align: center;
}

.newcomer-window__body strong {
  display: block;
  font-size: 27px;
}

.newcomer-window__body p {
  font-size: 12px;
}

@keyframes screen-flicker {
  0%,
  92%,
  100% {
    opacity: 0.25;
  }

  93% {
    opacity: 0.5;
  }

  94% {
    opacity: 0.08;
  }
}

@keyframes welcome-float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.35deg);
  }

  50% {
    transform: translateY(-7px) rotate(0.1deg);
  }
}

@keyframes notice-float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0.55deg);
  }

  50% {
    transform: translate(-3px, -9px) rotate(-0.2deg);
  }
}

@keyframes newcomer-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1.4deg);
  }

  50% {
    transform: translateY(-6px) rotate(-0.6deg);
  }
}

@media (max-width: 1050px) {
  .checkpoint {
    min-height: 100svh;
    overflow: visible;
  }

  .desktop {
    display: grid;
    width: min(720px, calc(100% - 28px));
    min-height: 0;
    margin: 34px auto;
    gap: 28px;
  }

  .retro-window {
    position: relative;
    inset: auto;
    width: 100%;
    animation: none;
    transform: none;
  }

  .welcome-window {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    order: 1;
    width: 100%;
  }

  .notice-window {
    order: 2;
  }

  .newcomer-window {
    width: min(320px, 100%);
    order: 3;
    justify-self: end;
  }

}

@media (max-width: 640px) {
  .checkpoint {
    grid-template-rows: 34px 1fr;
  }

  .desktop-tabs {
    display: none;
  }

  .desktop-clock {
    font-size: 9px;
  }

  .desktop {
    width: calc(100% - 18px);
    margin: 24px auto 32px;
    gap: 21px;
  }

  .window-body {
    width: 100%;
    min-height: 0;
    padding: 28px 19px;
  }

  .welcome-window h1 {
    max-width: 100%;
    font-size: clamp(31px, 9vw, 38px);
    overflow-wrap: normal;
    word-break: normal;
  }

  .checkpoint__copy {
    width: 100%;
    max-width: 100%;
    font-size: 14px;
    overflow-wrap: break-word;
  }

  .welcome-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .checkpoint-enter {
    min-width: 0;
    width: 100%;
  }

}

@media (prefers-reduced-motion: reduce) {
  .screen-noise::after,
  .retro-window {
    animation: none;
  }
}
