﻿@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@600;700&family=Nunito+Sans:wght@500;700;800;900&display=swap");

:root {
  --bg-top: #f6f7fb;
  --bg-bottom: #eef1f8;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #1f2533;
  --muted: #60697b;
  --primary: #ff4d8d;
  --primary-strong: #ec3b7d;
  --primary-soft: #ffd7e7;
  --success: #1bb97c;
  --locked: #b2b8c4;
  --ring: rgba(255, 77, 141, 0.28);
  --stroke: rgba(255, 143, 183, 0.34);
  --shadow-main: 0 30px 70px rgba(24, 34, 56, 0.14);
  --shadow-soft: 0 10px 28px rgba(23, 30, 47, 0.1);
  --radius-lg: 30px;
  --radius-md: 20px;
  --ease-smooth: cubic-bezier(0.22, 0.78, 0.2, 1);
  --speed-fast: 0.18s;
  --speed-mid: 0.28s;
  --speed-slow: 0.42s;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "SF Pro Display", "SF Pro Text", "Avenir Next", "Nunito Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(56rem 36rem at 50% 100%, rgba(255, 178, 212, 0.18), transparent 62%),
    radial-gradient(48rem 30rem at -8% 0%, rgba(255, 165, 206, 0.16), transparent 58%),
    radial-gradient(42rem 26rem at 108% 8%, rgba(206, 220, 255, 0.16), transparent 58%),
    linear-gradient(165deg, var(--bg-top), var(--bg-bottom));
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 14px;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(24px);
}

body::before {
  top: -20vmax;
  left: -18vmax;
  background:
    radial-gradient(circle at 38% 38%, rgba(255, 120, 178, 0.34), rgba(255, 120, 178, 0.08) 45%, transparent 70%);
}

body::after {
  bottom: -22vmax;
  right: -16vmax;
  background:
    radial-gradient(circle at 58% 46%, rgba(255, 173, 208, 0.32), rgba(255, 173, 208, 0.07) 44%, transparent 72%);
}

#app {
  width: 100%;
  max-width: 760px;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(8px) scale(0.992);
  transition: opacity var(--speed-mid) var(--ease-smooth), transform var(--speed-mid) var(--ease-smooth);
}

#app.app-ready {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.screen {
  position: relative;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.62));
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-main);
  padding: 24px 18px;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise var(--speed-slow) var(--ease-smooth);
  overflow: hidden;
}

.screen > * {
  width: min(100%, 640px);
}

.screen-header {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.18));
  opacity: 0.58;
}

@keyframes rise {
  from {
    transform: translateY(14px) scale(0.985);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes introFloat {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes introShadow {
  0% {
    opacity: 0.28;
    transform: scaleX(1);
  }

  50% {
    opacity: 0.2;
    transform: scaleX(0.95);
  }

  100% {
    opacity: 0.28;
    transform: scaleX(1);
  }
}

@keyframes titleShimmer {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes sparkleFloat {
  0% {
    transform: translateY(0) scale(0.9);
    opacity: 0.25;
  }

  35% {
    transform: translateY(-5px) scale(1.02);
    opacity: 0.78;
  }

  100% {
    transform: translateY(-10px) scale(0.86);
    opacity: 0.1;
  }
}

@keyframes petalFall {
  0% {
    transform: translate3d(0, -14%, 0) rotate(var(--spin-start)) scale(0.96);
    opacity: 0;
  }

  8% {
    opacity: 0.9;
  }

  45% {
    transform: translate3d(calc(var(--drift) * 0.42), 44vh, 0) rotate(calc(var(--spin-start) + (var(--spin-end) * 0.45))) scale(1);
  }

  72% {
    transform: translate3d(calc(var(--drift) * 0.72), 76vh, 0) rotate(calc(var(--spin-start) + (var(--spin-end) * 0.75))) scale(0.98);
  }

  100% {
    transform: translate3d(var(--drift), 112vh, 0) rotate(var(--spin-end)) scale(0.9);
    opacity: 0.06;
  }
}

@keyframes petalFlutter {
  0% {
    transform: rotate(-11deg) scale(1);
  }

  25% {
    transform: rotate(8deg) scale(1.03);
  }

  50% {
    transform: rotate(-5deg) scale(0.98);
  }

  75% {
    transform: rotate(10deg) scale(1.02);
  }

  100% {
    transform: rotate(-11deg) scale(1);
  }
}

@keyframes ctaSweep {
  0% {
    transform: translateX(-180%) rotate(22deg);
    opacity: 0;
  }

  16% {
    opacity: 0.95;
  }

  34% {
    transform: translateX(420%) rotate(22deg);
    opacity: 0;
  }

  100% {
    transform: translateX(420%) rotate(22deg);
    opacity: 0;
  }
}

@keyframes ctaPulse {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-1px);
    box-shadow:
      0 18px 30px rgba(255, 63, 134, 0.48),
      0 0 0 1px rgba(255, 173, 211, 0.35) inset;
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes frameSweep {
  0% {
    transform: translateX(-50%) rotate(8deg);
    opacity: 0;
  }

  14% {
    opacity: 0.9;
  }

  36% {
    transform: translateX(120%) rotate(8deg);
    opacity: 0;
  }

  100% {
    transform: translateX(120%) rotate(8deg);
    opacity: 0;
  }
}

@keyframes orbDrift {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.45;
  }

  50% {
    transform: translateY(-10px) scale(1.04);
    opacity: 0.6;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 0.45;
  }
}

h1,
h2,
h3,
p {
  margin-top: 0;
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
.btn {
  font-family: "SF Pro Display", "SF Pro Text", "Avenir Next", "Nunito Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.title {
  text-align: center;
  margin-top: 12vh;
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 8.5vw, 3.2rem);
  letter-spacing: -0.03em;
  font-weight: 900;
  text-wrap: balance;
}

.screen-landing {
  isolation: isolate;
  justify-content: center;
  gap: 10px;
}

.screen-landing::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--radius-lg) - 8px);
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 156, 199, 0.16), transparent 32%),
    radial-gradient(circle at 20% 70%, rgba(255, 128, 181, 0.14), transparent 36%);
  z-index: 0;
}

.screen-landing .title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 10vw, 3.3rem);
  line-height: 1.08;
  text-shadow: 0 10px 20px rgba(50, 61, 89, 0.08);
  color: #2c3345;
  letter-spacing: -0.035em;
  animation: none;
}

.screen-landing .subtitle {
  margin-bottom: 10px;
  font-size: 1.08rem;
  color: #6c7486;
}

.landing-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

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

.petal {
  position: absolute;
  top: -12%;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 1.45);
  transform-origin: center;
  opacity: 0;
  background: transparent;
  filter: drop-shadow(0 5px 8px rgba(126, 41, 83, 0.2));
  animation: petalFall var(--dur) linear infinite;
  animation-delay: var(--delay);
}

.petal::before,
.petal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.petal::before {
  border-radius: 72% 38% 78% 34%;
  background:
    radial-gradient(90% 75% at 28% 18%, rgba(255, 255, 255, 0.62), transparent 48%),
    radial-gradient(100% 78% at 62% 84%, rgba(162, 35, 87, 0.24), transparent 58%),
    linear-gradient(168deg, #ffc4df 0%, #ff86b8 58%, #ff6fa9 100%);
  transform-origin: 48% 88%;
  animation: petalFlutter var(--flutter-dur) ease-in-out infinite;
}

.petal::after {
  inset: 22% 30% 16% 28%;
  border-radius: 68% 44% 56% 50%;
  background: linear-gradient(170deg, rgba(255, 231, 242, 0.88), rgba(255, 168, 205, 0.12));
  transform: rotate(-8deg);
}

.petal.v1::before {
  background:
    radial-gradient(90% 75% at 28% 18%, rgba(255, 255, 255, 0.62), transparent 48%),
    radial-gradient(100% 78% at 62% 84%, rgba(162, 35, 87, 0.24), transparent 58%),
    linear-gradient(168deg, #ffc4df 0%, #ff86b8 58%, #ff6fa9 100%);
}

.petal.v2::before {
  background:
    radial-gradient(90% 75% at 28% 18%, rgba(255, 255, 255, 0.55), transparent 48%),
    radial-gradient(100% 78% at 62% 84%, rgba(132, 28, 74, 0.28), transparent 58%),
    linear-gradient(168deg, #ffb9d9 0%, #ff79af 56%, #f95898 100%);
}

.petal.v3::before {
  background:
    radial-gradient(90% 75% at 28% 18%, rgba(255, 255, 255, 0.58), transparent 48%),
    radial-gradient(100% 78% at 62% 84%, rgba(126, 22, 68, 0.28), transparent 58%),
    linear-gradient(168deg, #ffd0e7 0%, #ff95c0 58%, #ff7ab1 100%);
}

.petal.v4::before {
  background:
    radial-gradient(90% 75% at 28% 18%, rgba(255, 255, 255, 0.56), transparent 48%),
    radial-gradient(100% 78% at 62% 84%, rgba(156, 33, 81, 0.24), transparent 58%),
    linear-gradient(168deg, #ffc2dc 0%, #ff8fbc 54%, #ff6ea8 100%);
}

.landing-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.5;
  animation: orbDrift 8s ease-in-out infinite;
}

.landing-orb.o1 {
  width: 140px;
  height: 140px;
  top: 26%;
  left: -20px;
  background: radial-gradient(circle, rgba(255, 148, 195, 0.55) 0%, rgba(255, 148, 195, 0) 72%);
}

.landing-orb.o2 {
  width: 170px;
  height: 170px;
  top: 44%;
  right: -36px;
  background: radial-gradient(circle, rgba(255, 172, 211, 0.5) 0%, rgba(255, 172, 211, 0) 70%);
  animation-delay: 1.8s;
}

.sparkle {
  position: absolute;
  color: rgba(255, 93, 156, 0.68);
  text-shadow: 0 0 12px rgba(255, 143, 189, 0.5);
  font-size: 1.05rem;
  animation: sparkleFloat 3.4s ease-in-out infinite;
}

.sparkle.s1 {
  top: 14%;
  left: 18%;
  animation-delay: 0s;
}

.sparkle.s2 {
  top: 24%;
  right: 16%;
  animation-delay: 0.8s;
}

.sparkle.s3 {
  top: 46%;
  left: 10%;
  animation-delay: 1.4s;
}

.sparkle.s4 {
  top: 56%;
  right: 12%;
  animation-delay: 2.1s;
}

.screen-landing .center-stack {
  margin-top: 0;
  padding-top: 4px;
  width: min(100%, 420px);
}

.landing-footer {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(122, 64, 91, 0.82);
}

.screen-landing .btn-primary {
  width: min(100%, 360px);
  justify-self: center;
  padding: 15px 22px;
  font-size: 1.08rem;
  letter-spacing: 0.015em;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 14px 28px rgba(255, 63, 134, 0.42),
    0 0 0 1px rgba(255, 173, 211, 0.35) inset;
  animation: ctaPulse 2.8s ease-in-out infinite;
}

.screen-landing .btn-primary::after {
  content: "";
  position: absolute;
  top: -160%;
  left: -40%;
  width: 38%;
  height: 420%;
  transform: rotate(22deg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: ctaSweep 3.2s ease-in-out infinite;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 34px;
  font-size: 1.06rem;
}

.btn {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 15px;
  padding: 14px 18px;
  min-height: 50px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform var(--speed-fast) var(--ease-smooth),
    filter var(--speed-fast) var(--ease-smooth),
    box-shadow var(--speed-mid) var(--ease-smooth),
    background var(--speed-mid) var(--ease-smooth);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  filter: saturate(0.6);
  box-shadow: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary {
  background: linear-gradient(165deg, #ff5c9a, var(--primary));
  color: #fff;
  box-shadow: 0 14px 24px rgba(255, 77, 141, 0.3), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 14px 26px rgba(255, 63, 134, 0.45);
}

.btn-secondary {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 255, 0.86));
  color: #2a344a;
  border: 1px solid rgba(190, 200, 224, 0.55);
}

.btn,
.memory-card,
.chase-target,
.joy-btn,
.level-btn {
  user-select: none;
}

.center-stack {
  margin: 0;
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.intro-character-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  margin: 4px 0 10px;
  min-height: 280px;
  align-content: end;
}

.intro-character-halo {
  position: absolute;
  top: 28px;
  width: min(76vw, 320px);
  height: min(76vw, 320px);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 128, 179, 0.35) 0%, rgba(255, 151, 194, 0.18) 45%, rgba(255, 255, 255, 0) 74%);
  filter: blur(3px);
  z-index: 0;
  pointer-events: none;
}

.intro-character-frame {
  position: relative;
  z-index: 2;
  border-radius: 24px;
  padding: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.84), rgba(255, 239, 247, 0.8));
  border: 1px solid rgba(255, 173, 210, 0.5);
  box-shadow:
    0 18px 34px rgba(110, 36, 72, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  transform-style: preserve-3d;
}

.intro-character-frame::after {
  content: "";
  position: absolute;
  inset: -18% -55%;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 26%,
    rgba(255, 255, 255, 0.42) 49%,
    rgba(255, 255, 255, 0) 66%
  );
  transform: translateX(-42%) rotate(8deg);
  animation: frameSweep 3.8s ease-in-out infinite;
}

.intro-character-frame:hover {
  box-shadow:
    0 24px 42px rgba(110, 36, 72, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.74);
}

.intro-character {
  width: auto;
  height: 160px;
  max-width: min(72vw, 260px);
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 8px 16px rgba(77, 31, 53, 0.2));
  animation: introFloat 2.5s ease-in-out infinite;
  transform-origin: 50% 75%;
  user-select: none;
  -webkit-user-drag: none;
}

.intro-character-video {
  display: block;
  width: clamp(170px, 54vw, 250px);
  height: clamp(220px, 58vw, 310px);
  object-fit: cover;
  object-position: center 28%;
  animation: introFloat 2.5s ease-in-out infinite;
  transform-origin: 50% 75%;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    0 10px 24px rgba(77, 31, 53, 0.16);
}

.intro-character-shadow {
  width: min(56vw, 210px);
  height: 26px;
  margin-top: auto;
  margin-bottom: 6px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(77, 31, 53, 0.24) 0%, rgba(77, 31, 53, 0.05) 70%, transparent 100%);
  filter: blur(4px);
  animation: introShadow 2.5s ease-in-out infinite;
  z-index: 1;
}

.input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid #ffd4e6;
  background: #fff;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  border-color: #ff7fb0;
  box-shadow: 0 0 0 4px var(--ring);
}

.error {
  min-height: 24px;
  color: #cb1f67;
  font-weight: 700;
  margin: 6px 0 0;
}

.map-grid {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

.summary-panel {
  border: 1px solid #ffc5dd;
  border-radius: 16px;
  background: linear-gradient(160deg, #fff8fc, #ffe9f3);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 1;
}

.summary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #7b3758;
  margin-bottom: 8px;
}

.summary-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #ffdceb;
  border: 1px solid #ffc0da;
  overflow: hidden;
}

.summary-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff76ab, #ff3f86);
}

.summary-sub {
  margin: 8px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #96466d;
}

.level-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 241, 248, 0.96));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--speed-fast) var(--ease-smooth),
    box-shadow var(--speed-mid) var(--ease-smooth),
    border-color var(--speed-mid) var(--ease-smooth);
}

.level-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(88, 31, 57, 0.16);
  border-color: #ff9fc6;
}

.level-left {
  display: grid;
  gap: 4px;
}

.level-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-title {
  font-weight: 800;
}

.level-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  width: fit-content;
}

.badge-done {
  background: rgba(27, 185, 124, 0.14);
  color: #157d55;
}

.badge-open {
  background: rgba(255, 63, 134, 0.14);
  color: #ad0f52;
}

.badge-locked {
  background: rgba(129, 109, 122, 0.16);
  color: #64545d;
}

.level-btn {
  min-width: 110px;
}

.level-btn.locked {
  background: linear-gradient(160deg, #cab9c3, var(--locked));
  color: #fff;
}

.level-btn.done {
  background: linear-gradient(160deg, #28c98d, var(--success));
  color: #fff;
}

.headline {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 2.8vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.level-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #4d5873;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(200, 210, 230, 0.72);
}

.meta-chip.subtle {
  color: #6d7588;
  background: rgba(248, 251, 255, 0.78);
}

.intro {
  color: var(--muted);
  line-height: 1.62;
  margin-bottom: 14px;
  font-size: 1.01rem;
  position: relative;
  z-index: 1;
}

.intro-highlight {
  color: #eb3d7e;
  font-weight: 800;
}

.hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 11px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.hud-card {
  flex: 1;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 255, 0.74));
  border: 1px solid rgba(198, 209, 231, 0.64);
  border-radius: 15px;
  padding: 11px 10px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform var(--speed-fast) var(--ease-smooth), box-shadow var(--speed-mid) var(--ease-smooth);
}

.hud-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(88, 31, 57, 0.15);
}

.hud-label {
  color: #707a8f;
  font-size: 0.79rem;
  font-weight: 700;
}

.hud-value {
  font-weight: 900;
  font-size: 1.22rem;
  line-height: 1.2;
}

.combo-indicator {
  min-height: 18px;
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 900;
  color: #eb3d7e;
}

.streak-track {
  margin-top: 6px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(230, 236, 250, 0.82);
  border: 1px solid rgba(196, 207, 232, 0.7);
  overflow: hidden;
}

.streak-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff8ab8, #ff3f86);
  transition: width 0.2s ease;
}

.hud-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.status-chat-row {
  justify-content: flex-start;
  align-items: flex-end;
  gap: 10px;
}

.chat-avatar-wrap {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
}

.status-pill {
  margin: 0;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(197, 208, 232, 0.72);
  background: rgba(255, 255, 255, 0.9);
  color: #4a5672;
  font-size: 0.9rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.chat-bubble {
  position: relative;
  max-width: min(100%, 520px);
  flex: 1 1 auto;
  border-radius: 18px;
  padding: 11px 15px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(249, 252, 255, 0.88));
  border: 1px solid rgba(195, 208, 232, 0.74);
  box-shadow: 0 10px 20px rgba(33, 44, 73, 0.1);
}

.chat-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 13px;
  width: 14px;
  height: 14px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(249, 252, 255, 0.88));
  border-right: 1px solid rgba(195, 208, 232, 0.74);
  border-bottom: 1px solid rgba(195, 208, 232, 0.74);
  transform: rotate(45deg);
}

.girl-avatar {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 10px rgba(77, 31, 53, 0.22));
}

.girl-sm {
  width: 72px;
  height: 72px;
}

.girl-md {
  width: 96px;
  height: 96px;
}

.girl-lg {
  width: 128px;
  height: 128px;
}

.date-card-avatar {
  opacity: 0.94;
}

.hud-girl {
  flex: 0 0 auto;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.action-zone {
  display: grid;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

.game-area {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 360px;
  border-radius: 20px;
  border: 1px solid rgba(196, 209, 234, 0.85);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 183, 214, 0.24), transparent 28%),
    radial-gradient(circle at 88% 94%, rgba(202, 220, 255, 0.22), transparent 34%),
    linear-gradient(165deg, #fbfcff, #f4f7ff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.94);
  overflow: hidden;
  touch-action: none;
}

.game-area::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.6), transparent 19px);
  opacity: 0.15;
  z-index: 0;
}

.catcher-cup {
  position: absolute;
  width: 92px;
  height: 34px;
  left: 0;
  top: 0;
  z-index: 5;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #fffaf5 0%, #ffd9e9 100%);
  border: 2px solid #e39bbd;
  box-shadow: 0 6px 10px rgba(109, 51, 75, 0.24);
}

.catcher-cup::before {
  content: "";
  position: absolute;
  left: 14px;
  top: -10px;
  width: 64px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe5f0 0%, #ffc8dd 100%);
  border: 2px solid #e39bbd;
}

.falling-item {
  position: absolute;
  width: 46px;
  height: 46px;
  z-index: 4;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 10px rgba(84, 41, 58, 0.28));
  transform-origin: 50% 50%;
}

.falling-item.golden {
  filter:
    drop-shadow(0 0 12px rgba(255, 214, 93, 0.9))
    drop-shadow(0 6px 10px rgba(84, 41, 58, 0.26));
}

.falling-item.spilled {
  filter: grayscale(0.72) brightness(0.7) contrast(0.95);
  opacity: 0.75;
}

.maze-shell {
  position: relative;
  z-index: 1;
}

.maze-goal-helper {
  margin: 0 0 8px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #2d6731;
}

.maze-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: #3c5f40;
  font-weight: 700;
}

.maze-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.start {
  background: linear-gradient(160deg, #ff8cb7, #ff4b91);
  border: 2px solid #fff;
}

.legend-dot.goal {
  background: linear-gradient(160deg, #fbe27a, #ffb952);
  box-shadow: 0 0 10px rgba(255, 188, 84, 0.7);
}

.hint-btn {
  padding: 8px 11px;
  font-size: 0.78rem;
}

.maze-sign {
  width: fit-content;
  margin: 0 auto 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(160deg, #d6f4d3, #b9e8b4);
  border: 1px solid #98c88f;
  color: #2f5a2b;
  font-weight: 900;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
}

.maze-area {
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-height: 320px;
  background:
    radial-gradient(circle at 16% 12%, rgba(138, 200, 125, 0.25), transparent 33%),
    radial-gradient(circle at 86% 80%, rgba(120, 184, 210, 0.2), transparent 38%),
    linear-gradient(160deg, #effae8, #dff2d9);
}

.maze-grid {
  --maze-cols: 15;
  --maze-rows: 19;
  --maze-cell: 18px;
  display: grid;
  grid-template-columns: repeat(var(--maze-cols), var(--maze-cell));
  grid-template-rows: repeat(var(--maze-rows), var(--maze-cell));
  gap: 0;
  border: 2px solid #95c996;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 14px rgba(69, 112, 65, 0.2);
}

.maze-tile {
  width: var(--maze-cell);
  height: var(--maze-cell);
  position: relative;
}

.maze-tile.path,
.maze-tile.start,
.maze-tile.goal,
.maze-tile.sign {
  background: #eef4df;
}

.maze-tile.hint-path {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 98, 152, 0.78) 0%, rgba(255, 98, 152, 0.3) 38%, rgba(238, 244, 223, 0) 72%),
    #eef4df;
}

.maze-tile.visited:not(.player):not(.goal):not(.wall) {
  background:
    radial-gradient(circle at 50% 50%, rgba(123, 205, 245, 0.45) 0%, rgba(123, 205, 245, 0.15) 36%, rgba(238, 244, 223, 0) 70%),
    #eef4df;
}

.maze-tile.wall {
  background: #4f7b49;
}

.maze-tile.tree {
  background:
    radial-gradient(circle at 35% 35%, rgba(184, 231, 154, 0.5), transparent 35%),
    #4f7b49;
}

.maze-tile.pond {
  background:
    radial-gradient(circle at 60% 40%, rgba(198, 241, 255, 0.58), transparent 42%),
    #6baecc;
}

.maze-tile.bench {
  background:
    linear-gradient(180deg, transparent 32%, #8d6840 32%, #8d6840 50%, transparent 50%),
    #dbeed5;
}

.maze-sign-small {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #4b7f43;
}

.maze-girl {
  width: 18px;
  height: 18px;
  margin: 0;
  filter: drop-shadow(0 2px 3px rgba(60, 35, 20, 0.3));
}

.maze-goal-ping {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 192, 74, 0.9);
  animation: goalPing 1.4s ease-out infinite;
}

.maze-goal-label {
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #7d4f02;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  pointer-events: none;
  background: rgba(255, 235, 160, 0.82);
  border-radius: 999px;
  padding: 1px 5px;
}

.maze-start-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ff4d90;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 124, 178, 0.35);
}

.maze-tile.player::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #ff8db7, #ff4d8d);
  border: 2px solid #ffffff;
  box-shadow:
    0 2px 8px rgba(190, 43, 107, 0.4),
    0 0 0 6px rgba(255, 126, 180, 0.18);
}

.maze-tip {
  font-size: 0.9rem;
}

.memory-shell {
  position: relative;
  z-index: 1;
}

.memory-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 2px dashed #ff9fc6;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 126, 178, 0.15), transparent 28%),
    radial-gradient(circle at 84% 88%, rgba(255, 167, 208, 0.15), transparent 30%),
    linear-gradient(160deg, #f5ffef, #e9f7df);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  touch-action: manipulation;
}

.memory-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: transform var(--speed-fast) var(--ease-smooth), filter var(--speed-fast) var(--ease-smooth);
}

.memory-card:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.memory-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  transform-style: preserve-3d;
  transition: transform var(--speed-mid) var(--ease-smooth);
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-weight: 900;
  box-shadow: 0 8px 12px rgba(71, 117, 63, 0.18);
}

.memory-front {
  background: linear-gradient(160deg, #f7fff3, #d9f0cf);
  color: #3f6d39;
  border: 1px solid #b8dbad;
  font-size: 1.2rem;
}

.memory-back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #fff4f8, #ffe3ef);
  border: 1px solid #ffc8dd;
  font-size: 1.4rem;
}

.chase-shell {
  position: relative;
  z-index: 1;
}

.chase-arena {
  position: relative;
  min-height: 290px;
  border-radius: 18px;
  border: 2px dashed #ff9fc6;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 117, 173, 0.16), transparent 28%),
    radial-gradient(circle at 86% 84%, rgba(255, 174, 214, 0.2), transparent 34%),
    linear-gradient(160deg, #f6fff1, #e6f6dc);
  overflow: hidden;
  touch-action: manipulation;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.76),
    0 12px 22px rgba(70, 37, 56, 0.12);
}

.chase-arena.paused::after {
  content: "PAUSED";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 246, 251, 0.65);
  color: #8c2a57;
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 1rem;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.chase-target {
  position: absolute;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 35%, #fff8dd 0%, #ffd77f 58%, #ffbe47 100%);
  color: rgba(119, 72, 12, 0.9);
  font-size: 1.35rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 6px rgba(255, 205, 104, 0.24),
    0 10px 16px rgba(138, 91, 27, 0.22);
  animation: chaseAppear 0.18s ease-out, chasePulse 0.9s ease-in-out 0.18s infinite;
  transition: transform var(--speed-fast) var(--ease-smooth), opacity var(--speed-fast) var(--ease-smooth);
}

.chase-target:active {
  transform: scale(0.95);
}

.chase-target.hit {
  animation: chaseHit 0.12s ease-out forwards;
}

.chase-target.golden {
  background: radial-gradient(circle at 36% 35%, #ffffff 0%, #ffe58a 55%, #ffc84d 100%);
  box-shadow:
    0 0 0 8px rgba(255, 226, 140, 0.3),
    0 0 18px rgba(255, 199, 70, 0.85),
    0 10px 18px rgba(139, 94, 30, 0.28);
}

@keyframes chasePulse {
  0% {
    transform: scale(0.95);
  }

  50% {
    transform: scale(1);
  }

  100% {
    transform: scale(0.95);
  }
}

@keyframes chaseAppear {
  from {
    opacity: 0;
    transform: scale(0.7);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes chaseHit {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.6);
  }
}

.chase-float {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 1rem;
  pointer-events: none;
  z-index: 5;
  animation: chaseFloatUp 0.4s ease-out forwards;
}

.chase-float.plus {
  color: #9a2b58;
}

.chase-float.gold {
  color: #8f6616;
}

.chase-float.minus {
  color: #7a5f6d;
}

@keyframes chaseFloatUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.9);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -135%) scale(1.02);
  }
}

.dash-shell {
  position: relative;
  z-index: 1;
}

.dash-arena {
  position: relative;
  min-height: 280px;
  border-radius: 18px;
  border: 1px solid rgba(255, 124, 176, 0.58);
  background:
    linear-gradient(180deg, #4a0030 0%, #70002f 40%, #5d001c 100%);
  overflow: hidden;
  touch-action: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 12px 24px rgba(56, 14, 39, 0.35);
}

.dash-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 174, 212, 0.18), transparent 20%, transparent 80%, rgba(255, 174, 212, 0.14));
}

.dash-bg,
.dash-mountains,
.dash-grid,
.dash-lava {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.dash-bg {
  top: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 138, 206, 0.24), transparent 36%),
    radial-gradient(circle at 74% 24%, rgba(190, 136, 255, 0.2), transparent 32%);
}

.dash-mountains {
  bottom: 20px;
  height: 120px;
  opacity: 0.7;
  background: linear-gradient(180deg, rgba(255, 92, 170, 0.36), rgba(149, 33, 96, 0.42));
  clip-path: polygon(0 100%, 12% 58%, 24% 100%, 35% 56%, 48% 100%, 58% 50%, 72% 100%, 84% 62%, 100% 100%);
}

.dash-grid {
  bottom: 20px;
  height: 70px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 116, 181, 0.18) 0 2px, transparent 2px 20px),
    linear-gradient(180deg, transparent, rgba(255, 126, 186, 0.16));
}

.dash-lava {
  bottom: 0;
  height: 20px;
  background:
    linear-gradient(180deg, #ff8b1a, #ff3b00),
    repeating-linear-gradient(90deg, rgba(255, 197, 91, 0.55) 0 14px, rgba(255, 122, 46, 0.55) 14px 28px);
  box-shadow: 0 -4px 10px rgba(255, 130, 26, 0.5);
}

.dash-portal {
  position: absolute;
  right: 22px;
  bottom: 52px;
  width: 44px;
  height: 62px;
  border-radius: 999px;
  border: 3px solid #68d8ff;
  box-shadow:
    0 0 0 4px rgba(117, 218, 255, 0.28),
    0 0 18px rgba(90, 196, 255, 0.75);
  background:
    radial-gradient(circle at 50% 50%, rgba(173, 239, 255, 0.38), rgba(84, 93, 255, 0.22) 60%, rgba(0, 0, 0, 0) 78%);
  animation: dashPortalPulse 1.15s ease-in-out infinite;
}

.dash-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff9dc6, #ff5f9d, #ff9dc6);
  box-shadow: 0 0 10px rgba(255, 97, 157, 0.35);
  z-index: 2;
}

.dash-avatar {
  position: absolute;
  width: 56px;
  height: 56px;
  top: 0;
  left: 0;
  z-index: 5;
  transition: transform 0.03s linear;
}

.dash-avatar-img {
  width: 56px !important;
  height: 56px !important;
  filter: drop-shadow(0 6px 10px rgba(67, 36, 53, 0.24));
}

.dash-obstacle {
  position: absolute;
  z-index: 4;
}

.dash-obstacle.spike {
  background: linear-gradient(180deg, #ffd06a, #ff7f26 55%, #f04100 100%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  box-shadow:
    0 0 10px rgba(255, 144, 51, 0.45),
    0 6px 10px rgba(63, 30, 12, 0.34);
}

.dash-obstacle.spike.top {
  transform: rotate(180deg);
}

.dash-obstacle.block {
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(255, 143, 55, 0.95), rgba(245, 53, 8, 0.95)),
    repeating-linear-gradient(90deg, rgba(255, 210, 104, 0.35) 0 4px, rgba(255, 84, 42, 0.35) 4px 8px);
  border: 2px solid rgba(255, 221, 150, 0.55);
  box-shadow:
    0 0 12px rgba(255, 117, 38, 0.48),
    0 6px 10px rgba(66, 28, 16, 0.35);
}

.dash-orb {
  position: absolute;
  z-index: 4;
  border-radius: 999px;
  border: 2px solid rgba(150, 238, 255, 0.95);
  background:
    radial-gradient(circle at 36% 32%, rgba(232, 255, 255, 0.95), rgba(109, 219, 255, 0.6) 52%, rgba(52, 107, 255, 0.48));
  box-shadow:
    0 0 0 4px rgba(132, 236, 255, 0.22),
    0 0 14px rgba(88, 205, 255, 0.75);
  animation: dashOrbPulse 0.9s ease-in-out infinite;
}

.dash-orb.used {
  filter: grayscale(0.5);
  opacity: 0.45;
  animation: none;
}

.dash-portal-gate {
  position: absolute;
  z-index: 4;
  border-radius: 999px;
  border: 3px solid #68d8ff;
  box-shadow:
    0 0 0 4px rgba(117, 218, 255, 0.24),
    0 0 16px rgba(90, 196, 255, 0.72);
  background:
    radial-gradient(circle at 50% 50%, rgba(173, 239, 255, 0.4), rgba(84, 93, 255, 0.24) 60%, rgba(0, 0, 0, 0) 78%);
  animation: dashPortalPulse 1.05s ease-in-out infinite;
}

.dash-portal-gate.used {
  opacity: 0.4;
}

@keyframes dashPortalPulse {
  0% {
    transform: scale(0.96);
    opacity: 0.85;
  }

  50% {
    transform: scale(1.02);
    opacity: 1;
  }

  100% {
    transform: scale(0.96);
    opacity: 0.85;
  }
}

@keyframes dashOrbPulse {
  0% {
    transform: scale(0.92);
  }

  50% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(0.92);
  }
}

.joystick {
  position: relative;
  z-index: 1;
  width: 170px;
  height: 130px;
  margin: 10px auto 0;
  touch-action: none;
}

.joy-btn {
  position: absolute;
  width: 50px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(160deg, #f7fff3, #d9f0cf);
  color: #3e6a38;
  font-weight: 900;
  box-shadow: 0 6px 10px rgba(71, 117, 63, 0.22);
  touch-action: none;
}

.joy-btn:active {
  transform: scale(0.96);
}

.joy-up {
  left: 60px;
  top: 0;
}

.joy-left {
  left: 0;
  top: 44px;
}

.joy-right {
  right: 0;
  top: 44px;
}

.joy-down {
  left: 60px;
  bottom: 0;
}

.item-pop {
  transition: transform 0.11s ease-out, opacity 0.11s ease-out;
}

.floating-score {
  position: absolute;
  z-index: 8;
  font-size: 0.95rem;
  font-weight: 900;
  color: #9c1b54;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: floatScore 0.52s ease-out forwards;
}

.floating-score.golden {
  color: #af7b12;
}

.floating-score.bad {
  color: #6e5c66;
}

.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff76a7;
  pointer-events: none;
  z-index: 7;
  transform: translate(-50%, -50%);
  animation: particleBurst 0.38s ease-out forwards;
}

.spark.golden {
  background: #ffd35f;
}

.spark.bad {
  background: #8f7e88;
}

.streak-callout {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 9;
  transform: translate(-50%, -50%);
  color: #952253;
  font-size: 1.45rem;
  font-weight: 900;
  pointer-events: none;
  text-shadow: 0 4px 10px rgba(255, 255, 255, 0.72);
  animation: comboPop 0.6s ease-out forwards;
}

.streak-callout.perfect {
  top: 32%;
  color: #ad5e0e;
}

.countdown {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  transform: translate(-50%, -50%);
  font-size: clamp(2.5rem, 13vw, 3.8rem);
  font-weight: 900;
  color: #7a1740;
  background: rgba(255, 255, 255, 0.93);
  border: 2px solid rgba(255, 132, 181, 0.55);
  border-radius: 16px;
  padding: 8px 16px;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 22px rgba(255, 255, 255, 0.92);
  box-shadow:
    0 14px 28px rgba(119, 30, 70, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  pointer-events: none;
  line-height: 1;
  opacity: 0;
}

.countdown-animate {
  animation: countdownPop 0.7s ease-out forwards;
}

.countdown-layer {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
}

@keyframes countdownPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.76);
  }

  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(1.07);
  }
}

@keyframes floatScore {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }

  20% {
    opacity: 1;
    transform: translate(-50%, -66%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(1.03);
  }
}

@keyframes particleBurst {
  from {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.35);
  }
}

@keyframes comboPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
  }

  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.03);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(1.06);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(53, 20, 39, 0.58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal {
  width: min(430px, 100%);
  background: linear-gradient(170deg, #ffffff, #fff0f8);
  border: 1px solid rgba(255, 184, 215, 0.8);
  border-radius: 20px;
  box-shadow: var(--shadow-main);
  padding: 20px;
  animation: rise var(--speed-mid) var(--ease-smooth);
}

.modal h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.girl-npc {
  position: absolute;
  right: 6px;
  bottom: 0;
  opacity: 0.45;
  pointer-events: none;
  z-index: 2;
}

.girl-bounce {
  animation: girlBounce 0.2s ease-out;
}

.cup-bounce {
  animation: cupBounce 0.18s ease-out;
}

.screen-shake {
  animation: screenShake 0.15s ease-in-out;
}

@keyframes girlBounce {
  0% {
    transform: translateY(0) scale(1);
  }

  35% {
    transform: translateY(-6px) scale(1.03);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes cupBounce {
  0% {
    transform: scale(1, 1);
  }

  40% {
    transform: scale(1.08, 0.85);
  }

  100% {
    transform: scale(1, 1);
  }
}

@keyframes screenShake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-2px);
  }

  50% {
    transform: translateX(2px);
  }

  75% {
    transform: translateX(-1px);
  }

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

@keyframes goalPing {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.7);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

.modal p {
  color: var(--muted);
}

.toast {
  margin-top: 10px;
  min-height: 24px;
  color: #ad0f52;
  font-weight: 700;
  position: relative;
  z-index: 1;
  transition: opacity var(--speed-fast) var(--ease-smooth);
}

@media (min-width: 720px) {
  .intro-character-wrap {
    min-height: 360px;
    margin: 8px 0 12px;
  }

  .intro-character-halo {
    width: 360px;
    height: 360px;
    top: 8px;
  }

  .intro-character-frame {
    border-radius: 28px;
    padding: 10px;
  }

  .intro-character-video {
    width: 230px;
    height: 320px;
    border-radius: 20px;
  }

  .intro-character-shadow {
    width: 250px;
    height: 28px;
  }

  .screen {
    padding: 32px;
  }

  .map-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .game-area {
    min-height: 410px;
  }

  .maze-grid {
    --maze-cell: 20px;
  }

  .memory-grid {
    gap: 12px;
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .intro-character-wrap {
    min-height: 242px;
    margin: 0 0 8px;
  }

  .intro-character-halo {
    top: 18px;
  }

  .intro-character-video {
    width: min(62vw, 236px);
    height: min(74vw, 300px);
  }

  .intro-character-shadow {
    width: min(58vw, 196px);
    height: 23px;
  }

  .girl-sm {
    width: 56px;
    height: 56px;
  }

  .girl-md {
    width: 72px;
    height: 72px;
  }

  .girl-lg {
    width: 96px;
    height: 96px;
  }

  .level-right {
    gap: 8px;
  }

  .combo-indicator {
    font-size: 0.68rem;
  }

  .status-pill {
    font-size: 0.78rem;
  }

  .status-chat-row {
    justify-content: flex-start;
    align-items: flex-end;
    gap: 6px;
  }

  .chat-bubble {
    padding: 9px 12px;
    border-radius: 16px;
    max-width: calc(100% - 64px);
  }

  .chat-bubble::after {
    right: -6px;
    bottom: 11px;
    width: 12px;
    height: 12px;
  }

  .maze-legend {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .maze-grid {
    --maze-cell: 17px;
  }

  .memory-grid {
    gap: 8px;
    padding: 10px;
  }

  .petal:nth-child(n + 10) {
    display: none;
  }
}

@media (max-width: 390px) {
  .maze-grid {
    --maze-cell: 16px;
  }

  .memory-front {
    font-size: 1.05rem;
  }

  .memory-back {
    font-size: 1.2rem;
  }
}

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