:root {
  --safe-top: env(safe-area-inset-top, 0px);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
  color: #4b2230;
  background: #ffd9df;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .8), transparent 26%),
    radial-gradient(circle at 82% 84%, rgba(255, 180, 195, .7), transparent 34%),
    #ffd9df;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: pointer;
}

.jump {
  position: absolute;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: none;
  width: clamp(76px, 21vw, 108px);
  height: clamp(76px, 21vw, 108px);
  padding: 0;
  border: 4px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  color: #fffdf7;
  background: linear-gradient(160deg, #ee5b70, #b51f40);
  box-shadow: 0 8px 0 #76152e, 0 14px 28px rgba(88, 24, 40, .35);
  font: inherit;
  font-size: clamp(15px, 4.2vw, 21px);
  font-weight: 900;
  letter-spacing: .08em;
  touch-action: none;
  cursor: pointer;
}

.jump:active,
.jump.is-pressed {
  transform: translateY(5px) scale(.97);
  box-shadow: 0 3px 0 #76152e, 0 7px 16px rgba(88, 24, 40, .32);
}

.jump:focus-visible,
.primary:focus-visible {
  outline: 4px solid #2f7fbf;
  outline-offset: 4px;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    calc(18px + env(safe-area-inset-right, 0px))
    calc(18px + env(safe-area-inset-bottom, 0px))
    calc(18px + env(safe-area-inset-left, 0px));
  background: radial-gradient(circle at 50% 40%, rgba(255, 249, 238, .34), rgba(84, 21, 39, .48));
  backdrop-filter: blur(3px);
}

.overlay[hidden] {
  display: none;
}

.card {
  width: min(92vw, 590px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: clamp(22px, 4.3vw, 42px);
  border: 5px solid #fffdf7;
  border-radius: clamp(24px, 5vw, 38px);
  text-align: center;
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 207, 111, .44), transparent 28%),
    linear-gradient(160deg, #fffdf7, #ffe9df);
  box-shadow: 0 26px 70px rgba(91, 24, 42, .38), inset 0 0 0 2px rgba(197, 54, 81, .1);
}

.kicker {
  margin: 0 0 6px;
  color: #b82d4b;
  font-size: clamp(.76rem, 2.6vw, .94rem);
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #b51f40;
  font-size: clamp(3.1rem, 13vw, 6.8rem);
  line-height: .9;
  letter-spacing: -.03em;
  text-shadow: 0 4px 0 #fff, 0 8px 0 rgba(150, 35, 58, .16);
}

#overlay-text {
  max-width: 34rem;
  margin: 1.1em auto 1.35em;
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  line-height: 1.55;
}

.primary {
  min-height: 56px;
  padding: 14px 30px;
  border: 4px solid #fffdf7;
  border-radius: 999px;
  color: #fffdf7;
  background: linear-gradient(160deg, #ee5b70, #b51f40);
  box-shadow: 0 7px 0 #76152e, 0 12px 24px rgba(88, 24, 40, .28);
  font: inherit;
  font-size: clamp(1.08rem, 3.6vw, 1.3rem);
  font-weight: 900;
  cursor: pointer;
}

.primary:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #76152e, 0 6px 14px rgba(88, 24, 40, .25);
}

.hint {
  margin: 1.15em 0 0;
  color: #785040;
  font-size: clamp(.84rem, 2.8vw, 1rem);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  position: absolute;
  inset: auto 20px 20px;
  z-index: 10;
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  color: #4b2230;
  background: #fffdf7;
  text-align: center;
}

@media (hover: none), (pointer: coarse) {
  .jump {
    display: block;
  }
}

@media (max-height: 520px) {
  .card {
    width: min(88vw, 720px);
    padding: 18px 28px;
  }

  h1 {
    font-size: clamp(2.6rem, 11vh, 4.4rem);
  }

  #overlay-text {
    margin: .65em auto .9em;
    font-size: clamp(.9rem, 2.6vh, 1.06rem);
    line-height: 1.4;
  }

  .primary {
    min-height: 48px;
    padding: 10px 24px;
  }

  .hint {
    margin-top: .75em;
  }

  .jump {
    width: clamp(66px, 17vh, 88px);
    height: clamp(66px, 17vh, 88px);
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

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