:root {
  --mouse-x: 0;
  --mouse-y: 0;
  --ink: #2e3d50;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  min-height: 100%;
}
body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #dce8ec;
  font-family: "Montserrat", sans-serif;
}
.background {
  position: fixed;
  inset: -7%;
  z-index: -3;
  background: url("../img/background.jpg") center / cover no-repeat;
  transform: translate3d(
      calc(var(--mouse-x) * -16px),
      calc(var(--mouse-y) * -16px),
      0
    )
    scale(1.08);
  transition: transform 100ms linear;
  filter: saturate(0.8) contrast(0.94);
}
.veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.6),
    rgba(243, 251, 255, 0.38)
  );
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}
.hero::before {
  content: "";
  position: absolute;
  inset: 4%;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 34px;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.5),
    rgba(255, 255, 255, 0.08) 58%,
    transparent 72%
  );
  box-shadow:
    inset 0 0 80px rgba(255, 255, 255, 0.2),
    0 24px 70px rgba(66, 104, 119, 0.12);
}
.content {
  position: relative;
  z-index: 3;
  width: min(40vw, 520px);
  padding: 58px 28px 52px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50% 50% 46% 54% / 53% 45% 55% 47%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 24px 80px rgba(78, 120, 136, 0.12),
    inset 0 0 34px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  animation: content-float 7s ease-in-out infinite;
}
.eyebrow {
  margin: 0 0 -4px;
  color: #66808d;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  color: #30475c;
  font-family: "Caveat", cursive;
  font-size: clamp(5rem, 9.2vw, 9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  text-shadow:
    0 3px 0 rgba(255, 255, 255, 0.7),
    0 12px 26px rgba(59, 108, 127, 0.14);
}
.sparkle {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  margin: -4px auto 17px;
  color: #79bfd1;
  font-size: 1.05rem;
  animation: twinkle 2.4s ease-in-out infinite;
}
.explore {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 13px 19px 13px 24px;
  border: 1px solid rgba(57, 92, 106, 0.2);
  border-radius: 999px;
  color: #fff;
  background: rgba(61, 91, 107, 0.82);
  box-shadow: 0 10px 25px rgba(49, 79, 93, 0.23);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.explore:hover,
.explore:focus-visible {
  transform: translateY(-3px);
  border-color: #1f3441;
  background: #304b5a;
  box-shadow: 0 14px 28px rgba(31, 52, 65, 0.34);
  outline: none;
}
.arrow {
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
  transition: transform 0.3s ease;
}
.explore:hover .arrow {
  transform: translate(2px, -2px);
}
.character {
  position: absolute;
  z-index: 4;
  bottom: -11vh;
  width: min(38vw, 550px);
  max-height: 103vh;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 28px 25px rgba(50, 74, 86, 0.18));
  transform-origin: 50% 68%;
  will-change: transform, translate, rotate;
}
.character--left {
  left: 3vw;
  z-index: 6;
  transform: translate3d(
    calc(var(--mouse-x) * 9px),
    calc(var(--mouse-y) * 7px),
    0
  );
  animation: float-left 8.5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.character--right {
  right: 3vw;
  z-index: 4;
  transform: translate3d(
    calc(var(--mouse-x) * -10px),
    calc(var(--mouse-y) * -6px),
    0
  );
  animation: float-right 9.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) -2.7s
    infinite;
}
.orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(1px);
}
.orb--one {
  width: 28px;
  height: 28px;
  left: 15%;
  top: 18%;
  animation: drift 8s ease-in-out infinite;
}
.orb--two {
  width: 15px;
  height: 15px;
  right: 19%;
  top: 26%;
  animation: drift 6s ease-in-out -2s infinite reverse;
}
.hint {
  position: absolute;
  right: 6%;
  bottom: 4%;
  margin: 0;
  color: rgba(47, 68, 82, 0.55);
  font-family: "Caveat", cursive;
  font-size: 1rem;
  letter-spacing: 0.08em;
}
@keyframes float-left {
  0%,
  100% {
    translate: 0 3px;
    rotate: -0.35deg;
  }
  24% {
    translate: 3px -7px;
    rotate: 0.05deg;
  }
  52% {
    translate: 0 -17px;
    rotate: 0.45deg;
  }
  76% {
    translate: -3px -8px;
    rotate: 0deg;
  }
}
@keyframes float-right {
  0%,
  100% {
    translate: 0 -2px;
    rotate: 0.4deg;
  }
  22% {
    translate: -3px -12px;
    rotate: 0.05deg;
  }
  50% {
    translate: 1px -22px;
    rotate: -0.4deg;
  }
  74% {
    translate: 4px -11px;
    rotate: -0.05deg;
  }
}
@keyframes content-float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateY(-9px) rotate(0.5deg);
  }
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.8) rotate(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.15) rotate(45deg);
  }
}
@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.25;
  }
  50% {
    transform: translate(18px, -28px);
    opacity: 0.75;
  }
}
@media (max-width: 1100px) {
  .content {
    width: min(43vw, 460px);
  }
  .character {
    width: min(43vw, 500px);
  }
  .character--left {
    left: -2vw;
  }
  .character--right {
    right: -2vw;
  }
}

@media (max-width: 780px) {
  .hero {
    min-height: 480px;
  }
  .hero::before {
    inset: 2.5%;
    border-radius: 26px;
  }
  .content {
    z-index: 7;
    width: min(78vw, 420px);
    padding: clamp(32px, 6vh, 46px) 18px clamp(30px, 5vh, 40px);
    margin-top: -7vh;
    backdrop-filter: blur(20px) saturate(0.82);
    -webkit-backdrop-filter: blur(20px) saturate(0.82);
  }
  .eyebrow {
    font-size: 0.6rem;
    letter-spacing: 0.28em;
  }
  h1 {
    font-size: clamp(4.8rem, 23vw, 7rem);
  }
  .character {
    bottom: 0;
    width: auto;
    height: 52vh;
    height: 52svh;
    max-width: none;
    max-height: none;
    object-fit: contain;
  }
  .character--left {
    left: -2vw;
    z-index: 8;
  }
  .character--right {
    top: max(24px, env(safe-area-inset-top));
    right: -2vw;
    bottom: auto;
    z-index: 4;
  }
  .hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 440px;
    padding-inline: 12px;
  }
  .hero::before {
    inset: 12px;
    border-radius: 22px;
  }
  .content {
    width: min(84vw, 360px);
    padding: clamp(28px, 5vh, 38px) 14px clamp(26px, 4.5vh, 34px);
    margin-top: -9vh;
  }
  h1 {
    font-size: clamp(4.4rem, 25vw, 6.25rem);
  }
  .sparkle {
    margin-bottom: 13px;
  }
  .explore {
    padding: 12px 17px 12px 21px;
    font-size: 0.66rem;
  }
  .character {
    bottom: 0;
    width: auto;
    height: 52vh;
    height: 52svh;
    max-height: none;
  }
  .character--left {
    left: -7vw;
  }
  .character--right {
    top: max(24px, env(safe-area-inset-top));
    right: -7vw;
    bottom: auto;
  }
  .orb--one {
    left: 8%;
    top: 12%;
  }
  .orb--two {
    right: 9%;
    top: 20%;
  }
}

/* Initial page loader */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  color: #38566a;
  background:
    radial-gradient(
      circle at 50% 43%,
      rgba(255, 255, 255, 0.9),
      rgba(229, 244, 249, 0.82) 38%,
      rgba(189, 219, 229, 0.94) 100%
    ),
    #dce8ec;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.65s ease,
    visibility 0s linear 0s;
}
.loading-screen::before {
  position: absolute;
  inset: 4%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 34px;
  box-shadow: inset 0 0 90px rgba(255, 255, 255, 0.3);
  content: "";
}
.loading-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition-delay: 0s, 0.65s;
}
.loading-screen__content {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(78vw, 320px);
  place-items: center;
  text-align: center;
}
.loading-screen__content img {
  display: block;
  width: clamp(120px, 18vw, 180px);
  height: auto;
  margin-bottom: 30px;
  border: 4px solid #4aa6cc;
  border-radius: 28px;
  box-shadow:
    0 16px 34px rgba(31, 73, 92, 0.24),
    0 0 20px 6px rgba(45, 126, 158, 0.38),
    0 0 48px 14px rgba(73, 170, 201, 0.2);
}
.loading-screen__action {
  position: relative;
  display: grid;
  min-height: 42px;
  place-items: center;
}
.loading-screen__bar {
  position: relative;
  overflow: hidden;
  width: min(220px, 66vw);
  height: 10px;
  border-radius: 999px;
  background: rgba(42, 105, 130, 0.18);
  box-shadow:
    inset 0 1px 4px rgba(29, 78, 98, 0.18),
    0 4px 16px rgba(45, 106, 130, 0.14);
  backdrop-filter: blur(8px);
  transition:
    opacity 0.3s ease,
    transform 0.35s ease,
    visibility 0s linear 0s;
}
.loading-screen__bar span {
  position: relative;
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #286f8d, #3695b5 48%, #54b9d1);
  box-shadow:
    0 0 8px rgba(45, 143, 176, 0.72),
    0 0 18px rgba(56, 161, 193, 0.42);
  animation: loading-slide 1.25s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}
.loading-screen__bar span::after {
  position: absolute;
  top: 50%;
  right: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #237d9f;
  box-shadow:
    0 0 5px #237d9f,
    0 0 11px rgba(49, 157, 192, 0.8);
  content: "";
  transform: translateY(-50%);
}
.loading-screen__bar::after {
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(44, 146, 180, 0.48) 48%,
    transparent 75%
  );
  content: "";
  opacity: 0.65;
  transform: translateX(-120%);
  animation: loading-shimmer 1.8s ease-in-out infinite;
}
.loading-screen__content small {
  margin-top: 12px;
  color: rgba(53, 83, 98, 0.58);
  font-size: 0.57rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition:
    opacity 0.3s ease,
    transform 0.35s ease,
    visibility 0s linear 0s;
}
.loading-screen__reveal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max-content;
  padding: 10px 18px;
  border: 0;
  color: #276c8b;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transform: translate(-50%, -35%) scale(0.92);
  transition:
    color 0.25s ease,
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.35s;
}
.loading-screen__reveal::after {
  position: absolute;
  right: 18px;
  bottom: 5px;
  left: 18px;
  height: 1px;
  background: currentcolor;
  content: "";
  opacity: 0.42;
  transform: scaleX(0.35);
  transition: transform 0.3s ease;
}
.loading-screen__reveal:hover,
.loading-screen__reveal:focus-visible {
  color: #174e69;
  outline: none;
}
.loading-screen__reveal:hover::after,
.loading-screen__reveal:focus-visible::after {
  transform: scaleX(1);
}
.loading-screen.is-ready .loading-screen__bar,
.loading-screen.is-ready .loading-screen__content small {
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition-delay: 0s, 0s, 0.3s;
}
.loading-screen.is-ready .loading-screen__reveal {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0s, 0.12s, 0.12s, 0s;
}
.loading-screen.is-ready {
  cursor: pointer;
}
.music-toggle {
  position: fixed;
  top: max(29px, calc(env(safe-area-inset-top) + 10px));
  left: 50%;
  z-index: 100;
  padding: 7px 10px;
  border: 0;
  color: rgba(43, 76, 92, 0.68);
  background: transparent;
  font-family: "Montserrat", sans-serif;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transform: translateX(-50%);
  transition:
    color 0.25s ease,
    opacity 0.25s ease;
}
.music-toggle::after {
  position: absolute;
  right: 10px;
  bottom: 3px;
  left: 10px;
  height: 1px;
  background: currentcolor;
  content: "";
  opacity: 0.35;
  transform: scaleX(0.35);
  transition: transform 0.3s ease;
}
.music-toggle:hover,
.music-toggle:focus-visible {
  color: #214f65;
  outline: none;
}
.music-toggle:hover::after,
.music-toggle:focus-visible::after {
  transform: scaleX(1);
}
.music-toggle[aria-pressed="true"] {
  color: rgba(43, 76, 92, 0.46);
}
@media (min-width: 781px) {
  .music-toggle {
    top: max(calc(4vh + 14px), calc(env(safe-area-inset-top) + 10px));
  }
}
@keyframes loading-slide {
  from {
    transform: translateX(-105%);
  }
  to {
    transform: translateX(270%);
  }
}
@keyframes loading-shimmer {
  0%,
  25% {
    transform: translateX(-120%);
  }
  75%,
  100% {
    transform: translateX(120%);
  }
}
@media (max-width: 480px) {
  .loading-screen::before {
    inset: 12px;
    border-radius: 22px;
  }
}

@media (max-height: 650px) and (min-width: 781px) {
  .hero {
    min-height: 420px;
  }
  .hero::before {
    inset: 3%;
  }
  .content {
    width: min(36vw, 430px);
    padding: 26px 20px 24px;
  }
  h1 {
    font-size: clamp(4.5rem, 17vh, 7rem);
  }
  .sparkle {
    margin-bottom: 10px;
  }
  .character {
    bottom: -18vh;
    width: min(35vw, 430px);
    max-height: 112vh;
  }
}

@media (max-height: 500px) and (max-width: 900px) and (orientation: landscape) {
  .hero {
    min-height: 340px;
  }
  .hero::before {
    inset: 10px;
    border-radius: 20px;
  }
  .content {
    width: min(45vw, 370px);
    padding: 18px 16px 16px;
    margin-top: 0;
  }
  .eyebrow {
    font-size: 0.52rem;
  }
  h1 {
    font-size: clamp(3.8rem, 23vh, 6rem);
  }
  .sparkle {
    margin: -3px auto 7px;
    font-size: 0.8rem;
  }
  .explore {
    padding: 9px 14px 9px 18px;
    font-size: 0.6rem;
  }
  .character {
    bottom: 0;
    width: auto;
    height: 52vh;
    height: 52svh;
    max-height: none;
  }
  .character--left {
    left: -2vw;
  }
  .character--right {
    top: max(24px, env(safe-area-inset-top));
    right: -2vw;
    bottom: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .background,
  .character {
    transform: none !important;
  }
}

/* FBK cheat sequence */
.cheat-toast {
  position: absolute;
  top: clamp(70px, 11vh, 105px);
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #294d5e;
  background: rgba(230, 250, 255, 0.82);
  box-shadow:
    0 0 0 5px rgba(108, 214, 239, 0.12),
    0 14px 45px rgba(39, 108, 133, 0.25);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
  transform: translate(-50%, -16px) scale(0.9);
  transition:
    opacity 0.25s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cheat-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.cheat-toast svg {
  width: 19px;
  height: 19px;
  color: #20a9ce;
  fill: rgba(63, 204, 238, 0.2);
}
.cheat-toast span {
  display: grid;
  gap: 2px;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
}
.cheat-toast strong {
  font-size: 0.69rem;
  letter-spacing: 0.13em;
}
.game-shell.is-overdrive {
  animation: overdrive-pulse 0.42s ease-in-out infinite alternate;
}
.game-shell.is-overdrive #game-canvas {
  filter: saturate(1.45) contrast(1.08);
}
.game-shell.is-jumpscare .game-hud,
.game-shell.is-jumpscare .cheat-toast {
  opacity: 0;
}
.game-message.is-summary {
  top: 50%;
  width: min(88%, 520px);
  border-color: rgba(145, 233, 255, 0.92);
  color: #f3fcff;
  background: rgba(8, 37, 53, 0.9);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 90px rgba(92, 213, 240, 0.42);
}
.game-message.is-summary .game-message__eyebrow,
.game-message.is-summary p:last-child {
  color: rgba(235, 250, 255, 0.88);
}
.game-message.is-summary .game-message__eyebrow {
  color: #91e9ff;
}
.game-message.is-summary kbd {
  border-color: #65cee8;
  color: #123849;
  background: #dff9ff;
  box-shadow:
    0 2px 0 #54b8d2,
    0 0 16px rgba(112, 224, 249, 0.4);
  font-weight: 700;
}
.summary-icon {
  width: clamp(38px, 6vw, 58px);
  height: clamp(38px, 6vw, 58px);
  margin-bottom: 8px;
  color: #8feaff;
  filter: drop-shadow(0 0 15px rgba(92, 225, 255, 0.65));
  stroke-width: 1.5;
}
.summary-score {
  margin: 11px 0 18px;
  color: #fff;
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-shadow: 0 0 22px rgba(121, 231, 255, 0.72);
}
.game-shell.is-summary .game-brand {
  color: #f4fdff;
  text-shadow: 0 0 16px rgba(119, 229, 255, 0.55);
}
.game-shell.is-summary .game-brand__spark {
  color: #8feaff;
}
.game-shell.is-summary .game-stats {
  color: rgba(225, 248, 255, 0.86);
}
.game-shell.is-summary .game-stats span {
  min-width: 74px;
}
.game-shell.is-summary .game-stats strong {
  color: #ffffff;
  text-shadow: 0 0 14px rgba(119, 229, 255, 0.62);
}
@keyframes overdrive-pulse {
  from {
    box-shadow:
      inset 0 0 70px rgba(92, 224, 255, 0.22),
      0 0 30px rgba(76, 207, 238, 0.2);
  }
  to {
    box-shadow:
      inset 0 0 110px rgba(92, 224, 255, 0.48),
      0 0 75px rgba(76, 207, 238, 0.48);
  }
}
@media (max-width: 480px) {
  .cheat-toast {
    top: 67px;
    padding: 10px 14px;
  }
  .cheat-toast span {
    font-size: 0.55rem;
  }
  .game-message.is-summary {
    padding-inline: 18px;
  }
}

/* Game transition and canvas */
.background::after {
  position: absolute;
  inset: 0;
  content: "";
  background: url("../img/background.jpeg") center / cover no-repeat;
  opacity: 0;
  transition: opacity 1.1s ease;
}
body.game-active .background::after {
  opacity: 1;
}
.content {
  transition:
    opacity 0.55s ease,
    scale 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.55s ease,
    visibility 0s linear 0s;
}
.explore {
  cursor: pointer;
  font-family: inherit;
}
.character {
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.24s ease;
}
.orb,
.hint {
  transition: opacity 0.45s ease;
}
body.game-active .character {
  animation-play-state: paused;
  opacity: 0;
  transition:
    transform 1s cubic-bezier(0.7, 0, 0.25, 1),
    opacity 0.8s ease 0.18s;
}
body.game-active .character--left {
  transform: translate3d(-125vw, -8vh, 0) rotate(-9deg);
}
body.game-active .character--right {
  transform: translate3d(125vw, -8vh, 0) rotate(9deg);
}
body.game-active .content {
  visibility: hidden;
  opacity: 0;
  scale: 0.82;
  filter: blur(12px);
  pointer-events: none;
  transition-delay: 0s, 0s, 0s, 0.65s;
}
body.game-active .orb,
body.game-active .hint {
  opacity: 0;
}
body.game-active .hero::before {
  background: rgba(225, 244, 250, 0.36);
  box-shadow:
    inset 0 0 80px rgba(255, 255, 255, 0.34),
    0 28px 90px rgba(36, 80, 101, 0.2);
}

.game-shell {
  position: absolute;
  inset: 4%;
  z-index: 12;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 34px;
  background: rgba(222, 243, 249, 0.16);
  box-shadow:
    inset 0 0 70px rgba(255, 255, 255, 0.18),
    0 24px 70px rgba(57, 99, 117, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  outline: none;
  touch-action: manipulation;
  transition:
    opacity 0.65s ease 0s,
    visibility 0s linear 0.65s;
}
body.game-active .game-shell {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0.5s, 0.5s;
}
#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: clamp(18px, 3vw, 34px) clamp(20px, 4vw, 52px);
  color: #39576a;
  pointer-events: none;
}
.game-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Caveat", cursive;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 600;
}
.game-brand__spark {
  width: 1.15em;
  height: 1.15em;
  color: #64b7ce;
  animation: twinkle 2.4s ease-in-out infinite;
}
.game-stats {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  color: rgba(44, 76, 92, 0.68);
  font-size: clamp(0.55rem, 1vw, 0.7rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.game-stats span {
  display: grid;
  gap: 3px;
}
.game-stats strong {
  color: #304d5d;
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.game-message {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 3;
  width: min(84%, 430px);
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  color: #355165;
  background: rgba(250, 254, 255, 0.62);
  box-shadow: 0 18px 60px rgba(46, 91, 109, 0.16);
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translate(-50%, -50%);
  transition:
    opacity 0.3s ease,
    scale 0.35s ease,
    visibility 0s linear 0s;
}
.game-message.is-hidden {
  visibility: hidden;
  opacity: 0;
  scale: 0.9;
  transition-delay: 0s, 0s, 0.3s;
}
.game-message__eyebrow {
  margin: 0 0 5px;
  color: #6b93a3;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.game-message h2 {
  margin: 0 0 8px;
  font-family: "Caveat", cursive;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1;
}
.game-message p:last-child {
  margin: 0;
  color: rgba(53, 81, 101, 0.7);
  font-size: clamp(0.68rem, 1.6vw, 0.82rem);
}
kbd {
  display: inline-grid;
  min-height: 23px;
  padding: 3px 7px;
  place-items: center;
  border: 1px solid rgba(58, 92, 108, 0.2);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  font-family: inherit;
  font-size: 0.85em;
}
kbd svg {
  width: 0.9em;
  height: 0.9em;
  stroke-width: 2.4;
}
.game-exit {
  position: absolute;
  right: clamp(14px, 2.2vw, 28px);
  bottom: clamp(14px, 2.2vw, 28px);
  z-index: 5;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #3a5c6c;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(54, 92, 107, 0.12);
  font-family: inherit;
  font-size: 1.35rem;
  line-height: 0;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    color 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease;
}
.game-exit:hover,
.game-exit:focus-visible {
  color: #fff;
  background: #304b5a;
  outline: none;
  transform: rotate(6deg) scale(1.06);
}
.game-exit svg {
  display: block;
  width: 19px;
  height: 19px;
  stroke-width: 2.2;
}

@media (max-width: 780px) {
  .game-shell {
    inset: 2.5%;
    border-radius: 26px;
  }
  .game-hud {
    align-items: flex-start;
    padding: 19px 20px;
  }
  .game-stats {
    gap: 11px;
  }
  .game-message {
    top: 42%;
    border-radius: 22px;
  }
}
@media (max-width: 480px) {
  .game-shell {
    inset: 12px;
    border-radius: 22px;
  }
  .game-brand {
    font-size: 1.3rem;
  }
  .game-stats {
    font-size: 0.48rem;
  }
  .game-exit {
    width: 38px;
    height: 38px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .background::after,
  .content,
  .character,
  .game-shell {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

@media (max-width: 480px) {
  .game-shell.is-summary .game-hud {
    flex-direction: column;
    gap: 9px;
  }
  .game-shell.is-summary .game-stats span {
    min-width: 92px;
  }
  .game-shell.is-summary .game-stats strong {
    font-size: 0.72rem;
  }
}
