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

* {
  box-sizing: border-box;
}

html,
body,
body * {
  cursor: url("assets/magic-wand-cursor.png") 1 12, auto !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07150d;
}

body {
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

button {
  font: inherit;
}

.game-shell {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  overflow: hidden;
  isolation: isolate;
  background: #10271a;
  box-shadow: 0 0 80px rgb(0 0 0 / 0.55);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.media-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(32px, 7vw, 112px);
  background:
    linear-gradient(90deg, rgb(3 15 9 / 0.88) 0%, rgb(3 15 9 / 0.58) 42%, transparent 72%),
    linear-gradient(0deg, rgb(0 0 0 / 0.3), transparent 48%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.screen--visible {
  opacity: 1;
  visibility: visible;
}

.screen--win {
  justify-items: center;
  text-align: center;
  background: rgb(3 15 9 / 0.68);
  backdrop-filter: blur(8px);
}

.screen[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 16px;
  color: #f5c85a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(11px, 1vw, 15px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(64px, 8.8vw, 142px);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.055em;
  text-wrap: balance;
  text-shadow: 0 4px 35px rgb(0 0 0 / 0.55);
}

h1 span {
  color: #f5c85a;
  font-style: italic;
}

h2 {
  color: #f5c85a;
  font-size: clamp(78px, 12vw, 190px);
}

.lede {
  max-width: 480px;
  margin: 28px 0 32px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(16px, 1.5vw, 23px);
  line-height: 1.5;
  color: rgb(255 248 223 / 0.82);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 230px;
  gap: 38px;
  padding: 15px 20px 15px 24px;
  border: 1px solid rgb(255 255 255 / 0.36);
  border-radius: 999px;
  background: #f5c85a;
  color: #182112;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #ffdb78;
  box-shadow: 0 12px 36px rgb(0 0 0 / 0.26);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.hint {
  margin: 18px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgb(255 255 255 / 0.48);
  text-transform: uppercase;
}

.fullscreen-button {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 8;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: 50%;
  background: rgb(2 12 7 / 0.34);
  color: #fff8df;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.fullscreen-button:hover {
  transform: scale(1.05);
  border-color: rgb(245 200 90 / 0.72);
  background: rgb(2 12 7 / 0.62);
}

.fullscreen-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 700px), (max-height: 540px) {
  .screen {
    padding: clamp(24px, 6vw, 52px);
  }

  .lede {
    margin: 18px 0 22px;
  }

  .hint {
    display: none;
  }

  .fullscreen-button {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .primary-button,
  .fullscreen-button {
    transition: none;
  }
}
