:root {
  color-scheme: light;
  --ink: #2e2739;
  --pink: #f3619b;
  --pink-soft: #ffd4e5;
  --yellow: #ffe15d;
  --sky: #acdcef;
  --paper: #fffafc;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  background: #172137;
}

button {
  color: inherit;
  font: inherit;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.game-page {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  aspect-ratio: auto;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  background: var(--sky);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.45);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.hud {
  position: absolute;
  z-index: 10;
  inset: 3.2% 3.2% auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  pointer-events: none;
}

.score {
  display: grid;
  width: max-content;
  line-height: 0.92;
}

.score small {
  color: #fff4ad;
  font-size: clamp(9px, 1.05vw, 15px);
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-shadow: 1px 1px #263146;
}

.score b {
  color: var(--yellow);
  font-size: clamp(24px, 3.1vw, 52px);
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  -webkit-text-stroke: clamp(1px, 0.13vw, 2px) #273142;
  text-shadow: 3px 3px 0 rgba(32, 43, 56, 0.7);
}

.lives {
  justify-self: end;
  display: flex;
  gap: clamp(5px, 0.7vw, 11px);
}

.lives i {
  color: #ff3f49;
  font-size: clamp(27px, 3.3vw, 56px);
  font-style: normal;
  line-height: 0.8;
  -webkit-text-stroke: clamp(1px, 0.12vw, 2px) white;
  filter: drop-shadow(2px 2px 0 rgba(72, 45, 59, 0.36));
  transition: opacity 180ms ease, transform 180ms ease;
}

.lives i.lost {
  opacity: 0.18;
  transform: scale(0.7);
}

.enemy-bar {
  position: absolute;
  z-index: 11;
  top: 4.1%;
  left: 50%;
  width: min(42%, 560px);
  display: grid;
  gap: 3px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.enemy-bar b {
  color: #fff;
  font-size: clamp(9px, 0.9vw, 14px);
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 #273142;
}

.enemy-bar i {
  position: relative;
  height: clamp(10px, 1.15vw, 18px);
  overflow: hidden;
  border: clamp(2px, 0.2vw, 4px) solid #222b35;
  background: #ff4152;
}

.enemy-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: #38ba55;
  transition: width 110ms linear;
}

.level-card {
  position: absolute;
  z-index: 18;
  top: 29%;
  left: 50%;
  min-width: min(78%, 520px);
  padding: clamp(12px, 1.8vw, 24px) clamp(20px, 3vw, 44px);
  transform: translateX(-50%);
  border: 3px solid #2c3340;
  border-radius: 6px;
  text-align: center;
  background: rgba(255, 252, 245, 0.94);
  box-shadow: 8px 8px 0 rgba(51, 62, 74, 0.28);
  pointer-events: none;
  animation: card-pop 280ms ease both;
}

.level-card strong {
  display: block;
  margin: 4px 0;
  font-size: clamp(23px, 3vw, 46px);
  letter-spacing: 0.04em;
}

.level-card p {
  margin: 0;
  font-size: clamp(10px, 1.1vw, 16px);
  font-weight: 800;
}

@keyframes card-pop {
  from { opacity: 0; transform: translate(-50%, 10px) scale(0.94); }
}

.screen,
.novel-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
}

.title-screen {
  overflow: hidden;
  background:
    radial-gradient(circle at 83% 13%, rgba(255, 247, 185, 0.9) 0 4%, rgba(255, 247, 185, 0.24) 9%, transparent 18%),
    linear-gradient(180deg, #9fdaf3 0%, #cceefa 60%, #ecf9f5 100%);
}

.title-screen::before {
  content: "";
  position: absolute;
  z-index: 0;
  right: -8%;
  bottom: 16%;
  left: -8%;
  height: 22%;
  background:
    radial-gradient(ellipse at 6% 100%, #72bd48 0 18%, transparent 18.5%),
    radial-gradient(ellipse at 22% 100%, #68b741 0 23%, transparent 23.5%),
    radial-gradient(ellipse at 43% 100%, #75c24b 0 19%, transparent 19.5%),
    radial-gradient(ellipse at 66% 100%, #64b33e 0 25%, transparent 25.5%),
    radial-gradient(ellipse at 88% 100%, #76c44c 0 22%, transparent 22.5%);
  opacity: 0.9;
  pointer-events: none;
}

.title-clouds {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.title-clouds i {
  --cloud-size: clamp(105px, 12vw, 220px);
  position: absolute;
  left: -28%;
  width: var(--cloud-size);
  height: calc(var(--cloud-size) * 0.29);
  border-radius: 999px;
  opacity: 0.72;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(78, 140, 171, 0.07);
  animation: title-cloud-drift 27s linear infinite;
}

.title-clouds i::before,
.title-clouds i::after {
  content: "";
  position: absolute;
  bottom: 11%;
  border-radius: 50%;
  background: inherit;
}

.title-clouds i::before {
  left: 18%;
  width: 36%;
  aspect-ratio: 1;
}

.title-clouds i::after {
  right: 14%;
  width: 46%;
  aspect-ratio: 1;
}

.title-clouds i:nth-child(1) { top: 12%; animation-delay: -2s; }
.title-clouds i:nth-child(2) { top: 29%; --cloud-size: clamp(82px, 9vw, 165px); animation-duration: 34s; animation-delay: -21s; opacity: 0.55; }
.title-clouds i:nth-child(3) { top: 7%; --cloud-size: clamp(125px, 15vw, 250px); animation-duration: 42s; animation-delay: -31s; opacity: 0.45; }
.title-clouds i:nth-child(4) { top: 43%; --cloud-size: clamp(72px, 7vw, 125px); animation-duration: 31s; animation-delay: -13s; opacity: 0.46; }

@keyframes title-cloud-drift {
  from { transform: translateX(-8vw); }
  to { transform: translateX(148vw); }
}

.title-meadow {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 18%;
  background:
    radial-gradient(circle at 8% 35%, #fff4a4 0 3px, transparent 3.5px),
    radial-gradient(circle at 18% 58%, #ffb8d2 0 3px, transparent 3.5px),
    radial-gradient(circle at 38% 40%, #fff4a4 0 3px, transparent 3.5px),
    radial-gradient(circle at 67% 55%, #ffb8d2 0 3px, transparent 3.5px),
    radial-gradient(circle at 88% 38%, #fff4a4 0 3px, transparent 3.5px),
    linear-gradient(180deg, #a4da2d 0%, #89c924 100%);
  pointer-events: none;
}

.title-meadow::after {
  content: "";
  position: absolute;
  right: -2%;
  bottom: 0;
  left: -2%;
  height: 42%;
  opacity: 0.54;
  background: repeating-linear-gradient(104deg, transparent 0 12px, #4f9b2e 13px 15px, transparent 16px 23px);
}

.title-cast {
  position: absolute;
  z-index: 3;
  right: 1%;
  bottom: 2.5%;
  width: 56%;
  height: 88%;
  display: block;
  filter: drop-shadow(0 10px 0 rgba(61, 103, 56, 0.12));
  transform-origin: 54% 88%;
  animation: title-cast-breathe 5.2s ease-in-out infinite;
  pointer-events: none;
}

.title-cast::after {
  content: "♥";
  position: absolute;
  top: 28%;
  right: 11%;
  color: #ff6b9f;
  font-size: clamp(16px, 2.1vw, 34px);
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.92));
  animation: title-cast-heart 5.2s ease-in-out infinite;
}

.title-cast-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
}

@keyframes title-cast-breathe {
  0%, 100% { transform: translateY(0) rotate(0); }
  48% { transform: translateY(-2px) rotate(-0.06deg); }
}

@keyframes title-cast-heart {
  0%, 30%, 100% { opacity: 0; transform: translateY(6px) scale(0.72) rotate(-9deg); }
  44%, 62% { opacity: 0.86; transform: translateY(0) scale(1) rotate(4deg); }
  78% { opacity: 0; transform: translateY(-9px) scale(0.9) rotate(8deg); }
}

.screen-cast {
  display: none;
}

.title-copy {
  position: absolute;
  z-index: 5;
  top: max(8.5%, env(safe-area-inset-top));
  left: 5.2%;
  width: 47%;
}

.beta-tag {
  width: max-content;
  margin: 0 0 clamp(9px, 1vw, 15px);
  padding: 4px 9px;
  border: 2px solid #303744;
  border-radius: 4px;
  color: #303744;
  font: 900 clamp(9px, 0.9vw, 13px) ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  background: rgba(255, 250, 252, 0.9);
}

.title-copy h1 {
  display: grid;
  justify-items: start;
  gap: 0.025em;
  margin: 0;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  font-size: clamp(48px, 6.2vw, 104px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.8;
  filter: drop-shadow(0 8px 0 rgba(85, 57, 102, 0.13));
}

.title-logo-main,
.title-logo-all {
  color: #ff6aa4;
  background: linear-gradient(180deg, #ff85b5 0%, #ef4e91 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: clamp(1.5px, 0.15vw, 3px) #3b3046;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #fff9fd;
}

.title-logo-vs {
  width: max-content;
  margin: 0.13em 0 0.14em 0.12em;
  padding: 0.24em 0.68em 0.25em;
  border: clamp(1px, 0.12vw, 2px) solid #3b3046;
  border-radius: 999px;
  color: #fff;
  font-size: 0.36em;
  letter-spacing: 0.14em;
  line-height: 1;
  background: linear-gradient(135deg, #8a68d8, #6f51c8);
  box-shadow: 0 4px 0 #493683;
  transform: rotate(-1.5deg);
}

.title-logo-all {
  font-size: 0.92em;
  background-image: linear-gradient(180deg, #74c4ff 0%, #4f8fe8 100%);
}

.main-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 0.8vw, 12px);
  min-width: clamp(150px, 18vw, 260px);
  padding: clamp(10px, 1.25vw, 17px) clamp(18px, 2.2vw, 32px);
  border: 3px solid #303744;
  border-radius: 5px;
  color: #332c3b;
  font-size: clamp(12px, 1.25vw, 19px);
  font-weight: 1000;
  letter-spacing: 0.08em;
  background: var(--yellow);
  box-shadow: 6px 6px 0 #ef6b9d;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.start-button {
  position: relative;
  min-width: clamp(205px, 19vw, 292px);
  margin-top: clamp(22px, 2.5vw, 40px);
  padding: clamp(12px, 1.15vw, 17px) clamp(20px, 2vw, 30px);
  overflow: hidden;
  border: 2px solid #3b3046;
  border-radius: 14px;
  color: #fff;
  font-size: clamp(14px, 1.25vw, 20px);
  background: linear-gradient(180deg, #ff78aa 0%, #ed4d8c 100%);
  box-shadow: 0 7px 0 #b83d72, 0 14px 28px rgba(115, 50, 87, 0.22);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.start-button::before {
  content: "";
  position: absolute;
  top: -90%;
  bottom: -90%;
  left: -28%;
  width: 18%;
  transform: rotate(18deg);
  background: rgba(255, 255, 255, 0.36);
  animation: title-button-shine 3.2s ease-in-out infinite;
}

.start-button span,
.start-button b {
  position: relative;
  z-index: 1;
}

.start-button span {
  letter-spacing: 0.12em;
}

.start-button b {
  width: 1.62em;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f24e8e;
  background: #fff8fc;
  box-shadow: inset 0 -2px 0 rgba(190, 66, 117, 0.18);
}

@keyframes title-button-shine {
  0%, 58% { transform: translateX(0) rotate(18deg); }
  82%, 100% { transform: translateX(780%) rotate(18deg); }
}

.main-button:hover,
.main-button:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 #ef6b9d;
}

.main-button b {
  color: #f94e65;
}

.start-button:hover,
.start-button:focus-visible {
  transform: translateY(3px);
  filter: saturate(1.07) brightness(1.03);
  box-shadow: 0 4px 0 #b83d72, 0 10px 22px rgba(115, 50, 87, 0.24);
}

.start-button:disabled {
  cursor: wait;
  filter: saturate(0.55);
}

.title-links {
  position: absolute;
  z-index: 44;
  right: calc(1.4% + clamp(42px, 4vw, 58px));
  bottom: 2%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(7px, 0.7vw, 11px);
  max-width: 52%;
}

.title-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: clamp(6px, 0.55vw, 9px) clamp(9px, 0.85vw, 14px);
  border: 2px solid #3b3046;
  border-radius: 999px;
  color: #3b3046;
  font-size: clamp(8px, 0.72vw, 11px);
  font-weight: 1000;
  letter-spacing: 0.07em;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 3px 0 rgba(85, 57, 102, 0.2);
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.title-links a b {
  color: #ed4d8c;
  font-size: 1.2em;
  line-height: 1;
}

.title-links a:hover,
.title-links a:focus-visible {
  transform: translateY(2px);
  background: #fff;
  box-shadow: 0 1px 0 rgba(85, 57, 102, 0.2);
}

.sound-button {
  position: absolute;
  z-index: 45;
  right: 1.4%;
  bottom: 2%;
  width: clamp(30px, 3.2vw, 46px);
  aspect-ratio: 1;
  border: 2px solid #303744;
  border-radius: 50%;
  color: #303744;
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 1000;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.novel-overlay {
  overflow: hidden;
}

.novel-overlay:not(.hidden) {
  animation: novel-enter 180ms ease both;
}

@keyframes novel-enter {
  from { opacity: 0; }
}

.novel-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 38, 66, 0.12), rgba(22, 24, 47, 0.42));
  backdrop-filter: saturate(0.84);
}

.novel-person {
  position: absolute;
  z-index: 2;
  bottom: calc(22.5% - 6px);
  width: min(40%, 420px);
  max-width: 40%;
  height: min(58%, 500px);
  padding: 0;
  object-fit: contain;
  object-position: center bottom;
  filter: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.novel-person.left {
  left: 9%;
}

.novel-person.right {
  right: 9%;
}

.novel-person.dim {
  opacity: 0.56;
  filter: grayscale(0.2) brightness(0.88);
  transform: scale(0.97);
}

.novel-box {
  position: absolute;
  z-index: 5;
  right: 4%;
  bottom: 3.5%;
  left: 4%;
  min-height: 19%;
  padding: clamp(13px, 1.7vw, 24px) clamp(18px, 2.5vw, 36px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 5px;
  border: 3px solid #303744;
  border-radius: 6px;
  text-align: left;
  background: rgba(255, 252, 249, 0.97);
  box-shadow: 8px 8px 0 rgba(36, 42, 62, 0.28);
  cursor: pointer;
}

.novel-box > b {
  width: max-content;
  padding: 3px 8px;
  color: white;
  font-size: clamp(9px, 0.9vw, 13px);
  letter-spacing: 0.08em;
  background: var(--pink);
}

.novel-box > span {
  font-size: clamp(13px, 1.55vw, 24px);
  font-weight: 800;
  line-height: 1.25;
}

.novel-box > small {
  justify-self: end;
  color: #81758a;
  font-size: clamp(7px, 0.75vw, 11px);
  font-weight: 900;
  letter-spacing: 0.12em;
}

.novel-box i {
  color: var(--pink);
  font-style: normal;
  animation: next-bob 700ms ease-in-out infinite alternate;
}

@keyframes next-bob {
  to { transform: translateY(3px); }
}

.result-screen {
  display: grid;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 14%, rgba(255, 245, 172, 0.92) 0 4%, rgba(255, 245, 172, 0.22) 10%, transparent 18%),
    linear-gradient(180deg, #a4dcf4 0%, #d9f2fb 64%, #f4fbf6 100%);
}

.result-screen::before {
  content: "";
  position: absolute;
  z-index: 0;
  right: -8%;
  bottom: 14%;
  left: -8%;
  height: 24%;
  opacity: 0.9;
  background:
    radial-gradient(ellipse at 7% 100%, #75bd49 0 19%, transparent 19.5%),
    radial-gradient(ellipse at 28% 100%, #67b43f 0 25%, transparent 25.5%),
    radial-gradient(ellipse at 52% 100%, #77c24a 0 20%, transparent 20.5%),
    radial-gradient(ellipse at 76% 100%, #62ae3d 0 26%, transparent 26.5%),
    radial-gradient(ellipse at 94% 100%, #78c44c 0 21%, transparent 21.5%);
  pointer-events: none;
}

.result-clouds {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.result-clouds i {
  position: absolute;
  left: -22%;
  width: clamp(90px, 11vw, 190px);
  height: clamp(24px, 2.8vw, 50px);
  border-radius: 999px;
  opacity: 0.58;
  background: rgba(255, 255, 255, 0.88);
  animation: result-cloud-drift 38s linear infinite;
}

.result-clouds i::before,
.result-clouds i::after {
  content: "";
  position: absolute;
  bottom: 10%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: inherit;
}

.result-clouds i::before { left: 18%; width: 36%; }
.result-clouds i::after { right: 15%; width: 46%; }
.result-clouds i:nth-child(1) { top: 14%; animation-delay: -8s; }
.result-clouds i:nth-child(2) { top: 34%; opacity: 0.42; animation-duration: 46s; animation-delay: -29s; }
.result-clouds i:nth-child(3) { top: 7%; opacity: 0.36; animation-duration: 52s; animation-delay: -41s; }

@keyframes result-cloud-drift {
  from { transform: translateX(-8vw); }
  to { transform: translateX(146vw); }
}

.result-meadow {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 16%;
  background:
    radial-gradient(circle at 12% 36%, #fff0a2 0 3px, transparent 3.5px),
    radial-gradient(circle at 31% 58%, #ffb4d0 0 3px, transparent 3.5px),
    radial-gradient(circle at 68% 40%, #fff0a2 0 3px, transparent 3.5px),
    radial-gradient(circle at 89% 55%, #ffb4d0 0 3px, transparent 3.5px),
    linear-gradient(180deg, #9bd52a, #83c223);
  pointer-events: none;
}

.result-decor {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.result-decor i {
  position: absolute;
  color: rgba(255, 92, 150, 0.48);
  font-style: normal;
  font-size: clamp(18px, 2.5vw, 42px);
  animation: result-float 3.8s ease-in-out infinite;
}

.result-decor i:nth-child(1) { top: 17%; right: 7%; animation-delay: -1.2s; }
.result-decor i:nth-child(2) { top: 28%; right: 43%; color: rgba(255, 205, 73, 0.7); animation-delay: -2.4s; }
.result-decor i:nth-child(3) { top: 61%; right: 9%; font-size: clamp(14px, 1.8vw, 30px); animation-delay: -0.5s; }
.result-decor i:nth-child(4) { top: 10%; left: 45%; color: rgba(255, 205, 73, 0.66); animation-delay: -3.1s; }

@keyframes result-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-7px) rotate(5deg); }
}

.result-cast {
  position: absolute;
  z-index: 3;
  right: 1%;
  bottom: 2%;
  width: 56%;
  height: 88%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 11px 0 rgba(66, 104, 57, 0.13));
  animation: result-cast-breathe 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes result-cast-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.result-copy {
  position: relative;
  z-index: 5;
  width: min(43%, 610px);
  margin-left: 5%;
  padding: clamp(20px, 2.5vw, 38px);
  border: 2px solid rgba(59, 48, 70, 0.88);
  border-radius: clamp(16px, 1.8vw, 26px);
  background: rgba(255, 252, 250, 0.86);
  box-shadow: 0 12px 0 rgba(218, 91, 144, 0.22), 0 24px 52px rgba(67, 73, 93, 0.14);
  backdrop-filter: blur(7px);
}

.result-copy > p:first-child {
  width: max-content;
  margin: 0 0 clamp(9px, 1vw, 14px);
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: clamp(8px, 0.8vw, 12px);
  font-weight: 1000;
  letter-spacing: 0.13em;
  background: #e94f91;
}

.result-copy h2 {
  margin: 0;
  font-family: "Arial Rounded MT Bold", "Arial Black", system-ui, sans-serif;
  font-size: clamp(49px, 6.5vw, 108px);
  font-weight: 1000;
  letter-spacing: -0.055em;
  line-height: 0.88;
  background: linear-gradient(180deg, #ff7bad, #ef4e91);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: clamp(1.5px, 0.14vw, 2.5px) #3b3046;
  paint-order: stroke fill;
  filter: drop-shadow(0 5px 0 rgba(255, 255, 255, 0.92));
}

.result-copy > p:not(:first-child) {
  max-width: 520px;
  margin: clamp(12px, 1.6vw, 20px) 0;
  color: #3b3444;
  font-size: clamp(11px, 1.25vw, 19px);
  font-weight: 800;
  line-height: 1.35;
}

.result-score {
  margin: 0 0 clamp(13px, 1.4vw, 19px);
  display: grid;
  width: max-content;
  padding: 8px 13px;
  border-radius: 12px;
  background: rgba(255, 226, 237, 0.72);
}

.result-score small {
  color: #6a5d71;
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: 0.18em;
}

.result-score b {
  color: #303744;
  font-size: clamp(22px, 2.7vw, 42px);
  font-variant-numeric: tabular-nums;
}

.result-copy .main-button {
  border-radius: 14px;
}

.telegram-button {
  width: max-content;
  max-width: 100%;
  margin: 0 0 clamp(12px, 1.4vw, 20px);
  padding: clamp(9px, 1.05vw, 14px) clamp(14px, 1.7vw, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 3px solid #303744;
  border-radius: 14px;
  color: #fff;
  font-size: clamp(10px, 1vw, 15px);
  font-weight: 1000;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: #39a9e8;
  box-shadow: 5px 5px 0 #303744;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.telegram-button:hover,
.telegram-button:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 #303744;
}

.result-screen.loss {
  background:
    radial-gradient(circle at 82% 14%, rgba(218, 210, 242, 0.28) 0 5%, transparent 15%),
    linear-gradient(180deg, #65627e 0%, #89849d 58%, #bbb3bd 100%);
}

.result-screen.loss::before {
  opacity: 0.7;
  background:
    radial-gradient(ellipse at 8% 100%, #5b6571 0 20%, transparent 20.5%),
    radial-gradient(ellipse at 30% 100%, #515d69 0 26%, transparent 26.5%),
    radial-gradient(ellipse at 56% 100%, #616b75 0 21%, transparent 21.5%),
    radial-gradient(ellipse at 80% 100%, #4e5965 0 27%, transparent 27.5%),
    radial-gradient(ellipse at 96% 100%, #606b75 0 22%, transparent 22.5%);
}

.result-screen.loss .result-clouds { opacity: 0.36; }
.result-screen.loss .result-decor { display: none; }
.result-screen.loss .result-meadow { background: linear-gradient(180deg, #687b6b, #56675d); }

.result-screen.loss .result-cast {
  right: 6%;
  width: 43%;
  filter: drop-shadow(0 11px 0 rgba(49, 50, 64, 0.18));
}

.result-screen.loss .result-copy {
  border-color: rgba(58, 54, 72, 0.9);
  background: rgba(247, 243, 247, 0.9);
  box-shadow: 0 12px 0 rgba(73, 69, 91, 0.25), 0 24px 52px rgba(36, 35, 48, 0.18);
}

.result-screen.loss .result-copy > p:first-child { background: #756d8c; }

.result-screen.loss .result-copy h2 {
  background: linear-gradient(180deg, #d6cdea, #948aa9);
  -webkit-background-clip: text;
  background-clip: text;
}

.touch-button {
  position: absolute;
  z-index: 20;
  right: 4%;
  bottom: 7%;
  width: clamp(78px, 13vw, 120px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border: 3px solid #303744;
  border-radius: 50%;
  color: #fff;
  background: rgba(243, 97, 155, 0.9);
  box-shadow: 5px 6px 0 rgba(48, 55, 68, 0.5);
  touch-action: none;
}

.touch-button b {
  font-size: clamp(25px, 5vw, 44px);
  line-height: 0.8;
}

.touch-button span {
  font-size: 8px;
  font-weight: 1000;
}

@media (pointer: coarse), (max-width: 760px) {
  .touch-button:not(.hidden) {
    display: grid !important;
  }

}

@media (max-aspect-ratio: 4 / 3) {
  .stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    aspect-ratio: auto;
  }

  .screen-cast {
    position: absolute;
    z-index: 2;
    right: 1%;
    bottom: 3%;
    width: 57%;
    height: 88%;
    display: block;
    object-fit: contain;
    object-position: center bottom;
    pointer-events: none;
  }

  .title-copy {
    top: max(6%, env(safe-area-inset-top));
    bottom: auto;
    left: 4%;
    width: 48%;
  }

  .title-copy h1 {
    font-size: clamp(40px, 7.8vw, 82px);
  }

  .title-cast {
    right: -1%;
    bottom: 2%;
    width: 61%;
    height: 78%;
  }

  .result-copy {
    width: 52%;
    margin-left: 4%;
  }

  .result-copy h2 {
    font-size: clamp(50px, 9vw, 92px);
  }

  .result-screen.loss .result-copy h2 {
    font-size: clamp(42px, 6.5vw, 70px);
  }

  .hud {
    inset: max(12px, env(safe-area-inset-top)) 3% auto;
  }

  .enemy-bar {
    top: max(11%, calc(env(safe-area-inset-top) + 48px));
    width: min(62%, 520px);
  }

  .novel-person {
    bottom: calc(22.5% - 6px);
    width: min(42%, 400px);
    max-width: 42%;
    height: min(58%, 470px);
  }

  .novel-person.left {
    left: 7%;
  }

  .novel-person.right {
    right: 7%;
  }
}

@media (orientation: portrait) {
  .title-copy {
    top: max(3.5%, env(safe-area-inset-top));
    bottom: auto;
    left: 5%;
    width: 90%;
    text-align: center;
  }

  .beta-tag {
    margin-right: auto;
    margin-left: auto;
  }

  .title-copy h1 {
    justify-items: center;
    font-size: clamp(34px, 12vw, 64px);
  }

  .start-button {
    min-width: min(78vw, 330px);
    margin-top: 12px;
  }

  .title-links {
    right: calc(3% + clamp(38px, 11vw, 52px));
    bottom: max(2%, env(safe-area-inset-bottom));
    max-width: 72%;
  }

  .title-cast {
    right: -10%;
    bottom: 1.5%;
    width: 120%;
    height: 61%;
  }

  .result-screen {
    display: block;
  }

  .result-copy {
    position: absolute;
    top: max(4%, env(safe-area-inset-top));
    left: 5%;
    width: 90%;
    margin: 0;
    text-align: center;
  }

  .result-copy h2 {
    font-size: clamp(44px, 15vw, 72px);
  }

  .result-screen.loss .result-copy h2 {
    font-size: clamp(34px, 11.8vw, 56px);
  }

  .result-copy > p:not(:first-child) {
    margin: 12px auto;
  }

  .result-score,
  .telegram-button,
  .result-copy .main-button {
    margin-right: auto;
    margin-left: auto;
  }

  .telegram-button,
  .result-copy .main-button {
    width: min(100%, 330px);
  }

  .result-cast {
    right: 9%;
    bottom: max(1%, env(safe-area-inset-bottom));
    width: 82%;
    height: 38%;
  }

  .result-screen.loss .result-cast {
    right: 14%;
    width: 72%;
    height: 36%;
  }

  .score small {
    font-size: 8px;
  }

  .score b {
    font-size: clamp(22px, 8vw, 36px);
  }

  .lives {
    gap: 3px;
  }

  .lives i {
    font-size: clamp(24px, 8.5vw, 36px);
  }

  .enemy-bar {
    top: max(10%, calc(env(safe-area-inset-top) + 50px));
    width: 72%;
  }

  .level-card {
    top: 22%;
    min-width: 84%;
  }

  .novel-person {
    bottom: calc(24.5% - 4px);
    width: 46%;
    max-width: 46%;
    height: 54%;
  }

  .novel-person.left {
    left: 3%;
  }

  .novel-person.right {
    right: 3%;
  }

  .novel-person.left.hidden + .novel-person.right:not(.hidden) {
    right: auto;
    left: 50%;
    width: 76%;
    max-width: 76%;
    height: 61%;
    transform: translateX(-50%);
  }

  .novel-box {
    right: 3%;
    bottom: max(2.5%, env(safe-area-inset-bottom));
    left: 3%;
    min-height: 22%;
    padding: 12px 14px;
  }

  .novel-box > span {
    font-size: clamp(13px, 4.4vw, 20px);
  }

  .touch-button {
    right: 4%;
    bottom: max(5%, env(safe-area-inset-bottom));
    width: clamp(64px, 18vw, 88px);
  }

  .sound-button {
    right: 3%;
    bottom: max(2%, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
