:root {
  color-scheme: dark;
  background: #000;
  font-family: Georgia, "Times New Roman", serif;
}

@font-face {
  font-family: "VT323";
  src: url("VT323-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

* {
  box-sizing: border-box;
}

html,
body,
body * {
  cursor: url("ghost-cursor.svg") 4 3, auto;
}

a,
button {
  cursor: url("ghost-cursor.svg") 4 3, pointer;
}

html,
body {
  min-width: 260px;
  min-height: 100%;
  margin: 0;
  background: #000;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
}

.invitation {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding:
    calc(clamp(20px, 5vh, 52px) + env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    calc(126px + env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  text-align: center;
}

.image-heading {
  position: static;
  margin: 0;
  line-height: 0;
}

.image-heading img {
  display: block;
  width: min(92vw, 620px);
  max-width: 100%;
  height: auto;
}

.skull-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: clamp(34px, 7vh, 70px);
}

.skull-art {
  display: block;
  flex: none;
  width: min(118vw, 760px);
  max-width: none;
  height: auto;
  transform: translateX(1.5%);
}

.invite-link {
  margin-top: -1px;
  color: #d86f0b;
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.invite-link:visited {
  color: #d86f0b;
}

.invite-link:hover,
.invite-link:focus-visible {
  color: #ff9b22;
}

.invite-link:focus-visible {
  outline: 1px dotted #d86f0b;
  outline-offset: 5px;
}

.choice-page {
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #000;
}

.choice-screen {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    calc(clamp(24px, 4vh, 34px) + env(safe-area-inset-top))
    env(safe-area-inset-right)
    calc(126px + env(safe-area-inset-bottom))
    env(safe-area-inset-left);
  text-align: center;
}

.choice-heading {
  margin: 0;
  color: #d86f0b;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 400;
  line-height: normal;
  text-decoration: none;
}

.choice-grid {
  width: min(92vw, 690px);
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(14px, 4vw, 50px);
  margin-top: clamp(56px, 10vh, 86px);
}

.choice-card {
  display: block;
  min-width: 0;
  margin: 0;
  color: #f6f6f6;
  text-align: center;
  text-decoration: none;
}

.choice-card:visited {
  color: #f6f6f6;
}

.choice-card:focus-visible {
  outline: none;
}

.choice-frame {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #080000;
  border: 3px solid #f01a14;
  box-shadow:
    inset 0 0 0 1px #730000,
    0 0 3px rgba(240, 26, 20, .45);
}

.choice-card:hover .choice-frame,
.choice-card:focus-visible .choice-frame {
  border-color: #ff3a32;
  box-shadow:
    inset 0 0 0 1px #730000,
    0 0 8px rgba(240, 26, 20, .7);
}

.choice-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.choice-frame--crt img {
  object-position: 50% 35%;
  filter: contrast(1.1) saturate(.82) brightness(.9);
}

.choice-frame--crt::before,
.choice-frame--crt::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.choice-frame--crt::before {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, .14) 0,
      rgba(0, 0, 0, .14) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(circle at center, transparent 52%, rgba(0, 0, 0, .32) 100%);
}

.choice-frame--crt::after {
  opacity: .075;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  background-size: 180px 120px;
  mix-blend-mode: screen;
}

.choice-caption {
  display: block;
  margin-top: 12px;
  overflow: visible;
  color: #f6f6f6;
  font-family: "VT323", "Courier New", Courier, monospace;
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 400;
  line-height: 1;
  text-shadow: 1px 0 0 #747474;
  white-space: nowrap;
}

.details-page {
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #000;
}

.details-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding:
    calc(20px + env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    calc(126px + env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  text-align: center;
}

.details-content {
  width: min(94vw, 680px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.details-divider {
  display: block;
  width: min(100%, 610px);
  height: auto;
  margin: 0 0 clamp(4px, 1vh, 9px);
  transform: translateX(3.04%);
}

.party-details {
  width: 100%;
  max-width: none;
  margin: 0;
  color: #d86f0b;
  font: 400 14px/1.45 "Times New Roman", Times, serif;
  text-align: center;
}

.party-details > * {
  display: block;
}

.details-expecting {
  --gothic-size: clamp(112px, 18vw, 154px);
  display: block;
  width: var(--gothic-size);
  height: var(--gothic-size);
  max-width: 100%;
  object-fit: contain;
  margin-top: clamp(58px, 8vh, 88px);
}

.page-main:focus {
  outline: none;
}

.cd-player {
  position: fixed;
  z-index: 20;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 50%;
  width: min(
    292px,
    calc(100vw - 12px - env(safe-area-inset-left) - env(safe-area-inset-right))
  );
  color: #111;
  background: #c0c0c0;
  border: 2px outset #f4f4f4;
  box-shadow: 3px 3px 0 #050505;
  font: 10px/1.15 Arial, Helvetica, sans-serif;
  transform: translateX(-50%);
}

.player-titlebar {
  display: flex;
  align-items: center;
  min-height: 18px;
  gap: 4px;
  padding: 2px 3px;
  color: #fff;
  background: linear-gradient(90deg, #000080, #2673b4);
  font-size: 11px;
}

.disc-icon {
  color: #c7ff93;
  font-size: 10px;
  text-shadow: 0 0 2px #fff;
}

.player-titlebar strong {
  flex: 1;
  text-align: left;
}

.window-controls {
  display: flex;
  gap: 2px;
}

.window-controls i {
  display: grid;
  width: 16px;
  height: 14px;
  place-items: center;
  color: #000;
  background: #c0c0c0;
  border: 1px outset #fff;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.player-body {
  padding: 5px;
  border-top: 1px solid #fff;
}

.track-readout {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 3px 4px;
}

.track-readout > span {
  font-weight: 700;
  text-align: right;
}

.track-readout output {
  min-width: 0;
  overflow: hidden;
  padding: 2px 4px;
  color: #000;
  background: #fff;
  border: 2px inset #fff;
  font: 10px/1 "Courier New", Courier, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transport {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}

.transport-button,
.youtube-link {
  display: grid;
  width: 28px;
  height: 18px;
  flex: none;
  place-items: center;
  padding: 0;
  color: #000;
  background: #c0c0c0;
  border: 2px outset #fff;
  font: 10px/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
}

.transport-button:active,
.youtube-link:active {
  border-style: inset;
}

.player-meter {
  height: 8px;
  flex: 1;
  overflow: hidden;
  background: #858585;
  border: 2px inset #fff;
}

.player-meter span {
  display: block;
  width: 35%;
  height: 100%;
  background: #001d78;
}

.cd-player.is-playing .player-meter span {
  animation: meter 2.4s linear infinite;
}

.player-status {
  min-width: 43px;
  color: #000080;
  font: 700 8px/1 "Courier New", Courier, monospace;
  text-align: center;
}

.youtube-audio {
  position: fixed;
  top: -320px;
  left: -320px;
  width: 200px;
  height: 200px;
  overflow: hidden;
  opacity: .01;
  pointer-events: none;
}

.youtube-audio iframe {
  border: 0;
}

@keyframes meter {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(320%);
  }
}

@media (max-height: 520px) {
  .invitation {
    padding:
      calc(12px + env(safe-area-inset-top))
      max(20px, env(safe-area-inset-right))
      calc(92px + env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
  }

  .image-heading img {
    width: min(76vw, 430px);
  }

  .skull-block {
    margin-top: 12px;
  }

  .skull-art {
    width: min(96vw, 540px);
  }

  .cd-player {
    transform: translateX(-50%) scale(.86);
    transform-origin: bottom center;
  }

  .choice-screen {
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  .choice-grid {
    margin-top: 28px;
  }

  .details-screen {
    align-items: start;
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .details-divider {
    width: min(82vw, 500px);
    margin-bottom: 2px;
  }

  .details-expecting {
    --gothic-size: clamp(96px, 22vh, 118px);
    margin-top: clamp(26px, 7vh, 40px);
  }
}

@media (max-width: 400px) {
  .choice-caption {
    font-size: clamp(14px, 4.5vw, 18px);
  }
}

@media (max-width: 340px) {
  .choice-grid {
    width: 96vw;
    gap: 8px;
  }

  .choice-caption {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cd-player.is-playing .player-meter span {
    animation: none;
  }
}
