:root {
  --journey-ink: #31505a;
  --journey-coral: #f66f7b;
  --journey-orange: #f49b4d;
  --journey-leaf: #72b889;
  --journey-blue: #57a9c4;
  --journey-violet: #7768d8;
  --journey-paper: #fffdf4;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  color: var(--journey-ink);
  background:
    radial-gradient(circle at 9% 8%, rgba(247, 213, 223, 0.86), transparent 25rem),
    radial-gradient(circle at 92% 92%, rgba(183, 224, 216, 0.9), transparent 28rem),
    #eaf3e9;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.journey-app {
  position: relative;
  isolation: isolate;
  width: min(100%, 480px);
  height: 100svh;
  min-height: 100svh;
  margin-inline: auto;
  overflow: hidden;
  overflow: clip;
  border-inline: 1px solid rgba(92, 168, 148, 0.22);
  background: #edf5ed;
  box-shadow: 0 0 56px rgba(64, 112, 100, 0.14);
}

.journey-scene {
  position: absolute;
  inset: 0;
  min-height: 100svh;
  overflow: hidden;
  transition:
    transform 760ms cubic-bezier(0.72, 0, 0.22, 1),
    opacity 460ms ease,
    filter 460ms ease;
}

.words-scene,
.draw-scene {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.87' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E"),
    linear-gradient(155deg, #faf4e6 0%, #f1f7ea 46%, #ebf5f1 100%);
}

.words-scene {
  z-index: 3;
  cursor: crosshair;
}

.game-scene {
  z-index: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 12% 7%, rgba(246, 111, 123, 0.11), transparent 18rem),
    radial-gradient(circle at 88% 90%, rgba(87, 169, 196, 0.13), transparent 24rem),
    #f2f7f5;
  opacity: 0;
  transform: translateY(38px) scale(0.94);
  pointer-events: none;
}

.draw-scene {
  z-index: 4;
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 25px max(16px, env(safe-area-inset-bottom));
  opacity: 0;
  transform: translateY(38px) scale(0.985);
  pointer-events: none;
}

.journey-app[data-view="game"] .words-scene {
  opacity: 0.12;
  filter: blur(2px);
  transform: scale(1.055);
  pointer-events: none;
}

.journey-app[data-view="game"] .game-scene {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.journey-app[data-view="draw"] .words-scene,
.journey-app[data-view="draw"] .game-scene {
  opacity: 0.1;
  filter: blur(2px);
  transform: scale(1.035);
  pointer-events: none;
}

.journey-app[data-view="draw"] .draw-scene {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 非当前场景不仅淡出，还要彻底退出触摸命中，避免上层透明按钮截走点击。 */
.journey-app[data-view="words"] .game-scene *,
.journey-app[data-view="words"] .draw-scene *,
.journey-app[data-view="game"] .words-scene *,
.journey-app[data-view="game"] .draw-scene *,
.journey-app[data-view="draw"] .words-scene *,
.journey-app[data-view="draw"] .game-scene * {
  pointer-events: none !important;
}

.word-wash {
  position: absolute;
  z-index: -2;
  width: 270px;
  aspect-ratio: 1;
  border-radius: 48% 52% 62% 38% / 56% 44% 56% 44%;
  opacity: 0.48;
  animation: word-wash 16s ease-in-out infinite alternate;
  pointer-events: none;
}

.word-wash.is-pink {
  top: -120px;
  right: -90px;
  background: radial-gradient(circle, rgba(244, 186, 205, 0.68), transparent 69%);
}

.word-wash.is-blue {
  bottom: -100px;
  left: -140px;
  background: radial-gradient(circle, rgba(154, 218, 227, 0.66), transparent 70%);
  animation-delay: -7s;
}

.word-orbit {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.word-orbit path {
  fill: none;
  stroke: rgba(91, 199, 184, 0.2);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 2 9;
  animation: word-dash 22s linear infinite;
}

.phrase-layer,
.smile-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-phrase {
  --x: 50%;
  --y: 50%;
  --size: 18px;
  --rotate: 0deg;
  --dx: 10px;
  --dy: -8px;
  --duration: 9s;
  --delay: 0s;
  --color: var(--journey-coral);
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  max-width: min(78vw, 350px);
  margin: 0;
  color: var(--color);
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: clamp(14px, var(--size), 27px);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-shadow: 0 3px 12px color-mix(in srgb, var(--color) 20%, transparent);
  transform: translate(-50%, -50%) rotate(var(--rotate));
  transform-origin: center;
  animation: word-drift var(--duration) ease-in-out var(--delay) infinite alternate;
  will-change: transform;
}

.floating-phrase.is-hero {
  font-size: clamp(23px, 7vw, 34px);
  letter-spacing: 0.12em;
}

.floating-phrase.is-soft {
  opacity: 0.59;
  font-weight: 500;
}

.floating-phrase.is-tiny {
  opacity: 0.66;
  letter-spacing: 0.16em;
}

.floating-phrase.is-born {
  animation:
    word-arrive 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both,
    word-drift var(--duration) ease-in-out 720ms infinite alternate;
}

.ink-drop {
  position: absolute;
  z-index: 5;
  width: 10px;
  height: 10px;
  border: 1px solid var(--drop-color, var(--journey-coral));
  border-radius: 50%;
  translate: -50% -50%;
  animation: ink-ripple 1s ease-out both;
  pointer-events: none;
}

.photo-invitation {
  position: absolute;
  z-index: 14;
  left: 50%;
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 88px));
  display: grid;
  width: min(86%, 390px);
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 8px 15px 8px 9px;
  border: 0;
  color: var(--journey-ink);
  background: transparent;
  opacity: 0;
  transform: translate(-50%, 18px) rotate(1deg) scale(0.94);
  transition: opacity 360ms ease, transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  cursor: pointer;
  isolation: isolate;
}

.photo-invitation::before {
  position: absolute;
  z-index: -2;
  inset: -24px -35px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 252, 238, 0.98) 0 38%, rgba(255, 247, 224, 0.7) 55%, transparent 74%);
  filter: blur(2px);
  animation: invitation-glow 2.4s ease-in-out infinite;
}

.photo-invitation::after {
  position: absolute;
  z-index: -1;
  inset: -7px -12px;
  content: "";
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 330 100' preserveAspectRatio='none'%3E%3Cpath d='M22 59C2 25 55 7 164 8c108 1 165 14 162 47-3 31-66 40-168 39C62 93 22 84 16 61' fill='none' stroke='%23ef6679' stroke-opacity='.48' stroke-width='2.2' stroke-linecap='round' stroke-dasharray='170 14'/%3E%3Cpath d='M304 76l13-6-4 13' fill='none' stroke='%23ef6679' stroke-opacity='.62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.photo-invitation.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-1.2deg) scale(1);
  pointer-events: auto;
  animation: invitation-bob 2.6s ease-in-out infinite;
}

.journey-app.is-entering-game .photo-invitation {
  opacity: 0;
  transform: translate(-50%, -8px) rotate(0) scale(1.18);
}

.invitation-photo {
  position: relative;
  display: block;
  overflow: hidden;
  width: 72px;
  aspect-ratio: 3 / 4;
  padding: 4px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 17px 14px 18px 7px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 9px 22px rgba(49, 80, 90, 0.18);
  transform: rotate(-5deg);
}

.invitation-photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px 10px 13px 4px;
  object-fit: cover;
}

.invitation-photo i {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f7cc58;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.68);
}

.invitation-copy {
  min-width: 0;
  text-align: left;
}

.invitation-copy small,
.invitation-copy strong,
.invitation-copy em {
  display: block;
}

.invitation-copy small {
  margin-bottom: 4px;
  color: rgba(49, 80, 90, 0.55);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.invitation-copy strong {
  color: var(--journey-coral);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(18px, 5.5vw, 23px);
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.invitation-copy em {
  width: fit-content;
  margin-top: 5px;
  border-bottom: 1px solid rgba(246, 111, 123, 0.35);
  color: rgba(49, 80, 90, 0.68);
  font-size: 10px;
  font-style: normal;
}

.tap-footer {
  position: absolute;
  z-index: 12;
  right: 24px;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(39, 77, 89, 0.52);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.tap-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.photo-invitation.is-visible ~ .tap-footer .tap-hint {
  opacity: 0.22;
  transform: translateY(3px);
}

.tap-cue {
  position: relative;
  flex: 0 0 25px;
  width: 25px;
  height: 28px;
  color: rgba(45, 119, 128, 0.58);
}

.tap-hand {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: 50% 90%;
  animation: tap-hand 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.tap-ring {
  position: absolute;
  top: -2px;
  left: 3px;
  width: 11px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: tap-ring 2.2s ease-out infinite;
}

.magic-button {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 6px;
  padding: 4px 0 4px 7px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.magic-star {
  grid-row: 1 / 3;
  color: var(--journey-violet);
  font-size: 16px;
  line-height: 1;
  animation: magic-wink 2.4s ease-in-out infinite;
}

.magic-lead {
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.1em;
  opacity: 0.72;
  white-space: nowrap;
}

.magic-action {
  width: max-content;
  border-bottom: 1px solid rgba(39, 77, 89, 0.24);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.magic-button.is-paused .magic-star {
  color: var(--journey-coral);
  animation: none;
  transform: rotate(18deg);
}

.words-scene.is-time-paused .floating-phrase,
.words-scene.is-time-paused .word-wash,
.words-scene.is-time-paused .word-orbit path,
.words-scene.is-time-paused .tap-hand,
.words-scene.is-time-paused .tap-ring,
.words-scene.is-time-paused .ink-drop,
.words-scene.is-time-paused .smile-sticker {
  animation-play-state: paused !important;
}

.time-spell {
  position: absolute;
  z-index: 24;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  background: radial-gradient(ellipse 76% 19% at 50% 50%, rgba(255, 253, 245, 0.94), rgba(255, 253, 245, 0.72) 42%, transparent 76%);
  opacity: 0;
  pointer-events: none;
}

.time-spell.is-held {
  opacity: 1;
}

.time-spell.is-casting {
  animation: spell-show 1.8s ease both;
}

.spell-word {
  position: relative;
  color: #ff5876;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(31px, 10vw, 46px);
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.76), 0 5px 18px rgba(255, 88, 118, 0.23);
}

.time-spell.is-resuming .spell-word {
  color: #6278e7;
  font-size: clamp(25px, 8vw, 38px);
}

.time-spell.is-held .spell-word,
.time-spell.is-casting .spell-word {
  animation: spell-pop 0.8s cubic-bezier(0.2, 0.9, 0.25, 1.25) both;
}

.spell-word::before,
.spell-word::after {
  position: absolute;
  color: #f1aa43;
  font-family: Georgia, serif;
  font-size: 0.48em;
  font-weight: 400;
  content: "✦";
}

.spell-word::before {
  top: -0.4em;
  left: -1.25em;
}

.spell-word::after {
  right: -1.1em;
  bottom: -0.15em;
  transform: scale(0.75);
}

.spell-reply {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 999px;
  color: rgba(39, 77, 89, 0.72);
  background: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0;
}

.time-spell.is-held .spell-reply,
.time-spell.is-casting .spell-reply {
  animation: spell-reply 0.82s 0.55s ease both;
}

.game-scene .app-shell {
  min-height: 100%;
  padding-top: max(42px, env(safe-area-inset-top));
}

.entry-teaser #caughtNote {
  max-width: min(230px, 70vw);
  margin-top: 5px;
  overflow: hidden;
  color: rgba(75, 73, 62, 0.68);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-form {
  position: relative;
  z-index: 3;
  isolation: isolate;
}

.answer-input,
.answer-unit,
.answer-icon,
.answer-submit {
  position: relative;
  z-index: 1;
}

.answer-submit {
  min-width: 84px;
  touch-action: manipulation;
  pointer-events: auto;
}

.result-sheet .smile-entry {
  width: 100%;
  min-height: 40px;
  padding: 0 18px;
  border: 1.5px solid rgba(246, 111, 123, 0.38);
  border-radius: 999px;
  color: #a84f59;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.result-sheet .smile-entry:hover {
  background: rgba(255, 255, 255, 0.82);
}

.result-sheet .smile-entry.is-primary-action {
  min-height: 43px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  color: #ffffff;
  background: var(--journey-coral);
  box-shadow: 0 6px 0 rgba(130, 64, 60, 0.15), 0 11px 21px rgba(24, 37, 36, 0.13);
}

.draw-back {
  align-self: flex-start;
  padding: 4px 0;
  border: 0;
  color: rgba(49, 80, 90, 0.62);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.draw-header {
  margin: 18px 0 14px;
  text-align: center;
}

.draw-header p,
.draw-header h1,
.draw-header span,
.draw-header strong {
  display: block;
  margin: 0;
}

.draw-header p {
  color: rgba(49, 80, 90, 0.48);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.draw-header h1 {
  margin: 5px 0 12px;
  color: var(--journey-ink);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(31px, 9vw, 43px);
  line-height: 1;
  letter-spacing: 0.08em;
}

.draw-header span {
  color: rgba(49, 80, 90, 0.5);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.draw-header strong {
  margin-top: 5px;
  color: var(--journey-coral);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(15px, 4.8vw, 20px);
  line-height: 1.4;
}

.draw-paper {
  position: relative;
  flex: 1 1 auto;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid rgba(87, 169, 196, 0.2);
  border-radius: 52% 48% 54% 46% / 47% 53% 46% 54%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.96), rgba(255, 253, 244, 0.72) 58%, rgba(218, 239, 231, 0.48));
  box-shadow: inset 0 0 45px rgba(114, 184, 137, 0.08), 0 18px 48px rgba(49, 80, 90, 0.1);
  transform: rotate(-0.6deg);
  touch-action: none;
}

#drawingCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: rgba(70, 113, 111, 0.35);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.09em;
  text-align: center;
  transform: translate(-50%, -50%) rotate(-2deg);
  transition: opacity 300ms ease;
  pointer-events: none;
}

.canvas-hint svg {
  width: 64px;
  color: rgba(246, 111, 123, 0.38);
  animation: pencil-nudge 2.3s ease-in-out infinite;
}

.draw-paper.has-ink .canvas-hint {
  opacity: 0;
}

.draw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 15px;
}

.palette {
  display: flex;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.palette legend {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
}

.swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.84);
  border-radius: 46% 54% 48% 52%;
  background: var(--swatch);
  box-shadow: 0 4px 10px rgba(49, 80, 90, 0.12);
  transform: rotate(var(--tilt));
  transition: transform 170ms ease, box-shadow 170ms ease;
  cursor: pointer;
}

.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--swatch) 32%, transparent), 0 5px 12px rgba(49, 80, 90, 0.15);
  transform: rotate(var(--tilt)) scale(1.17);
}

.clear-button {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid rgba(49, 80, 90, 0.24);
  color: rgba(49, 80, 90, 0.62);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.draw-feedback {
  min-height: 18px;
  margin: 10px 0 8px;
  color: rgba(49, 80, 90, 0.62);
  font-size: 10px;
  text-align: center;
}

.draw-feedback.is-new {
  animation: feedback-pop 300ms ease both;
}

.send-smile {
  width: 100%;
  min-height: 47px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: #ffffff;
  background: var(--journey-coral);
  box-shadow: 0 7px 0 rgba(130, 64, 60, 0.15), 0 12px 23px rgba(49, 80, 90, 0.13);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: opacity 180ms ease, transform 180ms ease;
}

.send-smile:disabled {
  opacity: 0.34;
  cursor: default;
}

.send-smile:not(:disabled):active {
  transform: translateY(3px);
}

.smile-sticker {
  --x: 68%; --y: 24%; --r: -6deg; --d: 9s;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 5;
  display: grid;
  justify-items: center;
  width: 105px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%) rotate(var(--r));
  animation: sticker-arrive 0.85s cubic-bezier(0.2, 0.9, 0.24, 1.16) both, sticker-drift var(--d) 0.85s ease-in-out infinite alternate;
  pointer-events: none;
}

.smile-sticker img {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(62, 88, 82, 0.1));
}

.smile-sticker figcaption {
  width: 100%;
  overflow: hidden;
  margin-top: -7px;
  color: rgba(49, 80, 90, 0.47);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 9px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes word-drift {
  from { transform: translate(-50%, -50%) rotate(var(--rotate)); }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(calc(var(--rotate) + 1deg)); }
}

@keyframes word-arrive {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 22px)) rotate(calc(var(--rotate) - 5deg)) scale(0.76); filter: blur(5px); }
  to { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rotate)) scale(1); filter: blur(0); }
}

@keyframes ink-ripple {
  from { opacity: 0.65; transform: scale(0.4); }
  to { opacity: 0; transform: scale(11); }
}

@keyframes word-wash {
  to { transform: translate(18px, -10px) rotate(12deg) scale(1.08); }
}

@keyframes word-dash { to { stroke-dashoffset: -110; } }
@keyframes invitation-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes invitation-glow { 0%, 100% { opacity: 0.72; transform: scale(0.88); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes tap-hand { 0%, 100% { transform: translate(2px, 4px) rotate(-7deg); } 18% { transform: translate(0, 0) rotate(-2deg); } 30%, 72% { transform: translate(2px, 4px) rotate(-7deg); } }
@keyframes tap-ring { 0%, 13% { opacity: 0; transform: scale(0.45); } 22% { opacity: 0.52; } 42%, 100% { opacity: 0; transform: scale(1.8); } }
@keyframes magic-wink { 0%, 100% { opacity: 0.48; transform: rotate(-8deg) scale(0.85); } 50% { opacity: 1; transform: rotate(12deg) scale(1.12); } }
@keyframes spell-show { 0%, 100% { opacity: 0; } 8%, 84% { opacity: 1; } }
@keyframes spell-pop { from { opacity: 0; transform: scale(0.55) rotate(-8deg); filter: blur(6px); } 65% { opacity: 1; transform: scale(1.08) rotate(2deg); filter: blur(0); } to { opacity: 1; transform: scale(1) rotate(-1deg); filter: blur(0); } }
@keyframes spell-reply { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pencil-nudge { 0%, 100% { transform: translate(-5px, 3px) rotate(-10deg); } 50% { transform: translate(5px, -3px) rotate(3deg); } }
@keyframes feedback-pop { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sticker-arrive { from { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--r) - 18deg)) scale(0.32); } to { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)) scale(1); } }
@keyframes sticker-drift { to { transform: translate(calc(-50% + 10px), calc(-50% - 8px)) rotate(calc(var(--r) + 4deg)); } }

@media (max-height: 720px) {
  .game-scene .app-shell {
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .photo-invitation {
    bottom: max(72px, calc(env(safe-area-inset-bottom) + 68px));
  }

  .draw-scene {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .draw-header {
    margin: 8px 0 9px;
  }

  .draw-paper {
    min-height: 190px;
  }

  .draw-toolbar {
    margin-top: 9px;
  }
}

@media (max-width: 360px) {
  .photo-invitation {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }

  .invitation-photo {
    width: 60px;
  }

  .tap-footer {
    right: 16px;
    left: 16px;
  }

  .tap-hint > span:last-child {
    max-width: 130px;
  }

  .draw-scene {
    padding-right: 18px;
    padding-left: 18px;
  }

  .swatch {
    width: 25px;
    height: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-scene,
  .floating-phrase,
  .word-wash,
  .word-orbit path,
  .photo-invitation,
  .photo-invitation::before,
  .tap-hand,
  .tap-ring,
  .magic-star,
  .canvas-hint svg,
  .smile-sticker {
    animation: none !important;
    transition-duration: 1ms !important;
  }

  .time-spell.is-casting,
  .time-spell.is-held {
    animation: none;
    opacity: 1;
  }

  .time-spell.is-casting .spell-word,
  .time-spell.is-casting .spell-reply,
  .time-spell.is-held .spell-word,
  .time-spell.is-held .spell-reply {
    animation: none;
    opacity: 1;
  }
}
