
.mini-game-board.royal-archery {
  padding: clamp(8px, 2vw, 16px);
  background:
    linear-gradient(180deg, rgba(250, 255, 252, 0.92), rgba(231, 248, 235, 0.86)),
    #e9f8ef;
}
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-card {
  padding: 0;
  overflow: hidden;
  background: #dff7e8;
}
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-backdrop,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-card::before,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-kicker,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-title,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-prompt,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-brain,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-coach,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-guidance-toggle,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-challenge-charm,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-world-intro,
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-board::after {
  display: none !important;
}
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-close {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  top: max(12px, env(safe-area-inset-top));
  z-index: 320;
  min-width: 72px;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border-width: 2px;
  background: rgba(107, 34, 71, 0.88);
  box-shadow: 0 8px 18px rgba(44, 26, 58, 0.18);
  font-size: 14px;
}
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-progress {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  top: max(14px, env(safe-area-inset-top));
  z-index: 320;
  max-width: min(410px, calc(100vw - 150px));
  min-height: 0;
  margin: 0;
  padding: 9px 14px;
  border: 2px solid rgba(255, 216, 107, 0.58);
  border-radius: 999px;
  background: rgba(255, 253, 238, 0.92);
  color: #6b2247;
  box-shadow: 0 8px 18px rgba(33, 20, 68, 0.2);
  font:
    900 15px/1.08 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
  backdrop-filter: blur(8px);
}
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-feedback {
  position: fixed;
  left: 50%;
  bottom: max(122px, calc(env(safe-area-inset-bottom) + 122px));
  z-index: 315;
  width: min(560px, calc(100vw - 32px));
  min-height: 0;
  margin: 0;
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 216, 107, 0.62);
  border-radius: 8px;
  background: rgba(255, 253, 238, 0.93);
  color: #23633a;
  box-shadow: 0 8px 18px rgba(33, 20, 68, 0.18);
  font:
    900 14px/1.18 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-align: center;
  backdrop-filter: blur(8px);
}
.mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-feedback:empty {
  display: none;
}
.mini-game-board.royalArchery.royal-archery,
.mini-game-board.royal-archery {
  box-sizing: border-box;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: block;
  overflow: hidden;
  box-shadow: none;
}
.royal-archery-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  box-sizing: border-box;
  gap: 12px;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  padding: clamp(58px, 7dvh, 76px) 14px
    max(12px, env(safe-area-inset-bottom));
}
.royal-archery-stage {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  aspect-ratio: auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  background: #bdeed0;
  box-shadow:
    0 18px 34px rgba(47, 92, 76, 0.2),
    inset 0 0 0 1px rgba(55, 101, 72, 0.18);
  cursor: crosshair;
  touch-action: none;
}
.royal-archery-range {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 88%, rgba(255, 244, 167, 0.36), transparent 34%),
    linear-gradient(180deg, #9ed8ff 0 31%, #b9efd0 31% 42%, #84cb8c 42% 100%);
}
.royal-archery-range::before,
.royal-archery-range::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7%;
  width: 120%;
  height: 64%;
  transform: translateX(-50%);
  background:
    linear-gradient(78deg, transparent 0 46%, rgba(255, 255, 255, 0.34) 46% 47%, transparent 47%),
    linear-gradient(102deg, transparent 0 53%, rgba(255, 255, 255, 0.34) 53% 54%, transparent 54%),
    repeating-radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.28) 0 2px, transparent 2px 58px);
  clip-path: polygon(8% 100%, 43% 0, 57% 0, 92% 100%);
  opacity: 0.92;
}
.royal-archery-range::after {
  bottom: 18%;
  width: 68%;
  height: 8%;
  border-radius: 999px;
  background: rgba(56, 92, 67, 0.16);
  filter: blur(8px);
  clip-path: none;
}
.royal-archery-trajectory {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.royal-archery-trajectory path {
  fill: none;
  stroke: #fff4a7;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2.6 2.1;
  filter:
    drop-shadow(0 1px 0 rgba(84, 64, 20, 0.3))
    drop-shadow(0 0 8px rgba(255, 244, 167, 0.8));
}
.royal-archery-trajectory path.complete {
  stroke: #c8ffd1;
}
.royal-archery-target-layer,
.royal-archery-arrow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.royal-archery-target-layer {
  z-index: 4;
}
.royal-archery-arrow-layer {
  z-index: 7;
}
.royal-archery-princess {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: clamp(24px, 6vh, 56px);
  width: clamp(190px, 27vmin, 340px);
  aspect-ratio: 1;
  transform:
    translateX(-58%)
    translate(
      calc(var(--aim-x, 0px) * 0.03),
      calc(var(--aim-y, 0px) * 0.02)
    );
  background-image: url("../../data/royal_archery/princess_archer_atlas_clean_v2.webp");
  background-repeat: no-repeat;
  background-size: 407.03125% 102.34375%;
  background-position: 0.38168% 50%;
  pointer-events: none;
  filter:
    drop-shadow(0 18px 22px rgba(50, 82, 58, 0.3))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.44));
}
.royal-archery-princess.aiming {
  background-position: 33.46056% 50%;
}
.royal-archery-princess.aim-middle,
.royal-archery-princess.aim-far {
  background-position: 66.53944% 50%;
}
.royal-archery-princess.release {
  background-position: 99.61832% 50%;
}
.royal-archery-target {
  position: absolute;
  z-index: 1;
  left: var(--x);
  top: var(--y);
  width: clamp(88px, 12vw, 158px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(var(--target-scale, 1));
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  background-image: url("../../data/royal_archery/royal_archery_targets_atlas_clean_v2.webp");
  background-repeat: no-repeat;
  background-size: 305.46875% 102.34375%;
  cursor: crosshair;
  pointer-events: auto;
  touch-action: manipulation;
  filter:
    drop-shadow(0 18px 18px rgba(47, 70, 46, 0.2))
    drop-shadow(0 3px 2px rgba(255, 255, 255, 0.55));
  transition:
    filter 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}
.royal-archery-target.crown {
  background-position: 0.57034% 50%;
}
.royal-archery-target.star {
  background-position: 50% 50%;
}
.royal-archery-target.rose {
  background-position: 99.42966% 50%;
}
.royal-archery-target.current {
  z-index: 3;
  filter:
    drop-shadow(0 0 0 rgba(255, 255, 255, 0))
    drop-shadow(0 0 18px rgba(255, 244, 167, 0.95))
    drop-shadow(0 18px 18px rgba(47, 70, 46, 0.22));
}
.royal-archery-target.current::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 3px dashed rgba(255, 244, 167, 0.9);
  border-radius: 50%;
  animation: royal-archery-focus 1.2s linear infinite;
}
.royal-archery-target.hit {
  z-index: 0;
  opacity: 0.42;
  transform: translate(-50%, -50%) scale(calc(var(--target-scale, 1) * 0.92));
  filter: grayscale(0.2) drop-shadow(0 10px 10px rgba(47, 70, 46, 0.16));
}
.royal-archery-card {
  position: absolute;
  z-index: 6;
  left: 14px;
  top: 14px;
  display: grid;
  gap: 3px;
  width: min(300px, 42%);
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: #315943;
  font:
    800 13px/1.25 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  pointer-events: none;
  box-shadow: 0 12px 24px rgba(51, 82, 64, 0.14);
}
.royal-archery-card span,
.royal-archery-card em {
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
}
.royal-archery-card em {
  color: #7a5b19;
}
.royal-archery-bow {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 5%;
  width: 126px;
  height: 126px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}
.royal-archery-bow::before {
  content: "";
  position: absolute;
  inset: 4px 20px 4px 42px;
  border-right: 8px solid #7a4a2b;
  border-radius: 50%;
  box-shadow: inset -5px 0 0 #d59a4d;
}
.royal-archery-bow::after {
  content: "";
  position: absolute;
  left: 45px;
  top: 12px;
  width: 2px;
  height: 102px;
  background: rgba(255, 255, 255, 0.88);
  transform:
    translate(
      calc(var(--aim-x, 0px) * 0.16),
      calc(var(--aim-y, 0px) * 0.16)
    )
    skewX(calc(var(--aim-x, 0px) * -0.05deg));
  transform-origin: center;
}
.royal-archery-bow span {
  position: absolute;
  left: 52%;
  top: 51%;
  width: 52px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f8f2df, #7a4a2b);
  transform:
    translate(-50%, -50%)
    translate(
      calc(var(--aim-x, 0px) * 0.12),
      calc(var(--aim-y, 0px) * 0.12)
    );
  box-shadow: 0 2px 7px rgba(68, 47, 30, 0.28);
}
.royal-archery-stage.pulling .royal-archery-bow span {
  background: linear-gradient(90deg, #fff4a7, #7a4a2b);
}
.royal-archery-arrow {
  position: absolute;
  left: 0;
  top: 0;
  width: 74px;
  height: 8px;
  transform-origin: center;
  pointer-events: none;
}
.royal-archery-arrow::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 8px;
  top: 3px;
  height: 3px;
  border-radius: 999px;
  background: #6f4429;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.royal-archery-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 12px solid #f8f2df;
  filter: drop-shadow(0 1px 0 rgba(84, 64, 20, 0.35));
}
.royal-archery-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(520px, 100%);
  margin: 0 auto;
}
.royal-archery-controls button {
  min-height: 48px;
  border: 2px solid rgba(75, 122, 92, 0.3);
  border-radius: 8px;
  background: #fff8dc;
  color: #385c45;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(55, 92, 67, 0.14);
}
.royal-archery-controls button:disabled {
  opacity: 0.55;
}
.royal-archery-controls button.helper-path:not(:disabled) {
  border-color: rgba(123, 224, 200, 0.92);
  background: linear-gradient(180deg, #fffbe3, #dffcf3);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.6),
    0 0 0 8px rgba(255, 216, 107, 0.28),
    0 12px 22px rgba(55, 92, 67, 0.2);
  animation: archery-helper-guide 1.2s ease-in-out infinite;
}
.royal-archery-anticipation {
  position: absolute;
  z-index: 8;
  right: 14px;
  top: 14px;
  display: grid;
  gap: 2px;
  width: min(300px, 42%);
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 252, 225, 0.92), rgba(226, 252, 239, 0.92));
  color: #315943;
  box-shadow: 0 12px 24px rgba(48, 82, 58, 0.18);
  pointer-events: none;
}
.royal-archery-anticipation span {
  color: #7b5d18;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.royal-archery-anticipation strong {
  font: 900 14px/1.15 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
}
.royal-archery-anticipation small {
  font-size: 11px;
  font-weight: 800;
}
.royal-archery-anticipation[data-tone="charging"],
.royal-archery-anticipation[data-tone="flight"] {
  border-color: rgba(255, 226, 112, 0.94);
  background: linear-gradient(135deg, rgba(255, 253, 218, 0.96), rgba(222, 250, 247, 0.94));
}
.royal-archery-anticipation[data-tone="helper"] {
  border-color: rgba(123, 224, 200, 0.92);
}
.royal-archery-crest-layer {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.royal-archery-crest {
  display: grid;
  place-items: center;
  width: clamp(140px, 20vw, 210px);
  aspect-ratio: 1;
  border: 5px double rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.96) 0 22%, transparent 23%),
    conic-gradient(from 0deg, #fff5a8, #d8fff1, #ffcae4, #fff5a8);
  color: #46624d;
  font: 900 14px/1.15 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  text-align: center;
  box-shadow: 0 18px 50px rgba(54, 85, 60, 0.32);
  animation: royal-crest-arrive 0.95s ease-out both;
}
.royal-archery-crest.star {
  clip-path: polygon(50% 0, 62% 34%, 98% 34%, 69% 55%, 80% 92%, 50% 70%, 20% 92%, 31% 55%, 2% 34%, 38% 34%);
  border-radius: 0;
}
.royal-archery-crest.rose {
  border-radius: 48% 52% 44% 56%;
  background: radial-gradient(circle, #fff9e9 0 18%, #ffc1df 19% 42%, #f09bc7 43% 58%, #d8fff1 59%);
}
.royal-archery-finale {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 6px;
  width: min(470px, calc(100% - 32px));
  padding: 24px 28px;
  border: 4px double rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 20%, #fff4a7 0 4px, transparent 5px),
    radial-gradient(circle at 80% 26%, #c8fff0 0 5px, transparent 6px),
    linear-gradient(145deg, rgba(36, 76, 69, 0.96), rgba(72, 84, 120, 0.96));
  color: #fffbe5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -44%) scale(0.86);
  box-shadow: 0 24px 60px rgba(27, 57, 47, 0.42);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.royal-archery-finale span {
  color: #fff4a7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.royal-archery-finale strong {
  font: 900 clamp(19px, 3vw, 28px)/1.12 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
}
.royal-archery-finale small {
  font-size: 13px;
  font-weight: 800;
}
.royal-archery-finale[aria-hidden="false"] {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.royal-archery-stage.practice-shimmer {
  box-shadow: inset 0 0 0 6px rgba(123, 224, 200, 0.36), 0 20px 36px rgba(47, 76, 54, 0.2);
}
.royal-archery-stage.target-celebrating {
  box-shadow: inset 0 0 40px rgba(255, 244, 167, 0.46), 0 20px 36px rgba(47, 76, 54, 0.2);
}
@keyframes royal-crest-arrive {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.5) rotate(-10deg);
  }
  55% {
    opacity: 1;
    transform: translateY(-6px) scale(1.08) rotate(3deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1) rotate(0deg);
  }
}
@keyframes royal-archery-focus {
  to {
    transform: rotate(360deg);
  }
}
@keyframes archery-helper-guide {
  50% {
    transform: translateY(-2px);
  }
}
@media (max-width: 760px) {
  .bubble-wand-mission,
  .secret-garden-guardian-status {
    left: 10px;
    right: 10px;
    top: 112px;
    width: auto;
    padding: 7px 9px;
    font-size: 11px;
  }
  .bubble-wand-beacon,
  .secret-garden-shadow {
    min-width: 46px;
    min-height: 46px;
  }
  .bubble-wand-anticipation {
    left: 10px;
    right: 10px;
    bottom: 152px;
    width: auto;
    padding: 7px 9px;
  }
  .bubble-wand-anticipation small {
    display: none;
  }
  .bubble-wand-crown {
    left: 50%;
    right: auto;
    bottom: 204px;
    min-height: 34px;
    padding: 6px 8px;
    transform: translateX(-50%);
  }
  .bubble-wand-crown i {
    width: 12px;
    height: 16px;
  }
  .bubble-wand-reticle,
  .secret-garden-reticle,
  .royal-kitchen-reticle {
    width: 48px;
    height: 48px;
  }
  .bubble-wand-reticle::before,
  .secret-garden-reticle::before,
  .royal-kitchen-reticle::before {
    height: 58px;
  }
  .bubble-wand-reticle::after,
  .secret-garden-reticle::after,
  .royal-kitchen-reticle::after {
    width: 58px;
  }
  .royal-kitchen-order {
    left: 8px;
    top: 66px;
    width: calc(100% - 16px);
    padding: 6px 8px;
    font-size: 11px;
  }
  .royal-kitchen-token {
    min-width: 62px;
    min-height: 44px;
    padding: 0 8px;
    font-size: 11px;
  }
  .royal-archery-stage {
    min-height: 0;
    max-height: none;
  }
  .royal-archery-card {
    left: 8px;
    top: 8px;
    width: min(190px, 48%);
    padding: 7px 8px;
    font-size: 11px;
  }
  .royal-archery-card span,
  .royal-archery-card em {
    font-size: 10.5px;
  }
  .royal-archery-anticipation {
    right: 8px;
    top: 8px;
    width: min(180px, 47%);
    padding: 7px 8px;
  }
  .royal-archery-anticipation strong {
    font-size: 11px;
  }
  .royal-archery-anticipation small {
    display: none;
  }
  .royal-archery-target {
    width: clamp(76px, 19vw, 116px);
  }
  .royal-archery-princess {
    bottom: clamp(20px, 5vh, 44px);
    width: clamp(170px, 46vw, 250px);
  }
  .royal-archery-bow {
    width: 100px;
    height: 100px;
    bottom: 2%;
  }
  .royal-archery-bow::before {
    inset: 4px 16px 4px 34px;
  }
  .royal-archery-bow::after {
    left: 36px;
    top: 10px;
    height: 82px;
  }
  .royal-archery-bow span {
    width: 42px;
  }
  .royal-archery-controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .mini-game-modal:has(.mini-game-board.royal-archery) .mini-game-feedback {
    bottom: max(130px, calc(env(safe-area-inset-bottom) + 130px));
    width: min(330px, calc(100vw - 24px));
    padding: 8px 10px;
    font-size: 12px;
  }
  .mini-reflection-answers button {
    min-height: 48px !important;
    padding: 10px 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubble-wand-beacon.helper-path,
  .royal-archery-controls button.helper-path:not(:disabled),
  .royal-archery-target.current::after {
    animation: none;
  }
  .royal-archery-crest,
  .bubble-wand-crown i,
  .bubble-wand-finale,
  .royal-archery-finale {
    animation: none;
    transition: none;
  }
  .royal-archery-princess.release {
    animation: none;
    background-position: 99.61832% 50%;
  }
}

/* Comet Courtyard Dash */
.mini-game-board.comet-courtyard-dash {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #25235f;
}
.mini-game-modal:has(.mini-game-board.comet-courtyard-dash) .mini-game-kicker,
.mini-game-modal:has(.mini-game-board.comet-courtyard-dash) .mini-game-title,
.mini-game-modal:has(.mini-game-board.comet-courtyard-dash) .mini-game-prompt,
.mini-game-modal:has(.mini-game-board.comet-courtyard-dash) .mini-game-brain,
.mini-game-modal:has(.mini-game-board.comet-courtyard-dash) .mini-game-coach,
.mini-game-modal:has(.mini-game-board.comet-courtyard-dash) .mini-guidance-toggle,
.mini-game-modal:has(.mini-game-board.comet-courtyard-dash) .mini-challenge-charm {
  display: none;
}
.mini-game-modal.comet-courtyard-active .mini-game-feedback,
.mini-game-modal.comet-courtyard-active .mini-game-coach {
  display: none;
}
.comet-dash-shell {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}
.comet-dash-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(28, 22, 71, 0.1), rgba(36, 87, 95, 0.06)),
    url("../../data/mini_game_worlds/comet_courtyard_dash_world_1280.png?v=imagegen-20260608") center / cover no-repeat,
    radial-gradient(circle at 50% 8%, rgba(255, 246, 178, 0.86), transparent 10%),
    radial-gradient(circle at 18% 28%, rgba(174, 220, 255, 0.42), transparent 18%),
    radial-gradient(circle at 82% 33%, rgba(255, 181, 224, 0.32), transparent 20%),
    linear-gradient(180deg, #25235f 0 28%, #4565a8 28% 42%, #5ab49f 42% 100%);
  box-shadow: none;
  touch-action: none;
}
.comet-dash-sky,
.comet-dash-path,
.comet-dash-layer {
  position: absolute;
  inset: 0;
}
.comet-dash-sky {
  background:
    radial-gradient(circle at 22% 18%, #fff7b4 0 3px, transparent 4px),
    radial-gradient(circle at 41% 12%, #c9fff7 0 3px, transparent 4px),
    radial-gradient(circle at 67% 18%, #fff7b4 0 4px, transparent 5px),
    radial-gradient(circle at 83% 10%, #ffd6f0 0 3px, transparent 4px);
  opacity: 0.42;
  animation: comet-sky-drift 8s ease-in-out infinite alternate;
}
.comet-dash-path {
  inset: 16% 5% 6%;
  border-radius: 42% 42% 18% 18%;
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(255, 255, 255, 0.18) 14% 16%, transparent 16% 32%, rgba(255, 255, 255, 0.18) 32% 34%, transparent 34% 100%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(141, 236, 191, 0.08), rgba(66, 154, 99, 0.16));
  clip-path: polygon(7% 100%, 17% 48%, 33% 62%, 48% 18%, 64% 61%, 83% 42%, 94% 100%);
}
.comet-dash-status {
  position: absolute;
  z-index: 7;
  left: clamp(14px, 2vw, 24px);
  top: 76px;
  max-width: min(330px, 56%);
  padding: 9px 11px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #342a66;
  font-weight: 900;
  font-size: 13px;
  line-height: 1.25;
  box-shadow: 0 10px 20px rgba(37, 35, 95, 0.16);
}
.comet-spark,
.comet-gate,
.comet-gust,
.comet-dash-player,
.comet-dash-finish {
  position: absolute;
  transform: translate(-50%, -50%);
}
.comet-spark {
  z-index: 4;
  width: clamp(44px, 6vmin, 58px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  background: url("../../data/mini_game_worlds/comet_pickup_imagegen_256.png?v=imagegen-20260608") center / contain no-repeat;
  filter:
    drop-shadow(0 0 14px rgba(255, 244, 167, 0.82))
    drop-shadow(0 10px 10px rgba(35, 67, 83, 0.22));
  cursor: pointer;
  animation: comet-spark-bob 1.2s ease-in-out infinite alternate;
}
.comet-spark.collected {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.6);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.comet-gate {
  z-index: 3;
  width: clamp(68px, 10vmin, 112px);
  height: clamp(72px, 10vmin, 116px);
  border: 5px solid rgba(255, 255, 255, 0.55);
  border-bottom: 0;
  border-radius: 48% 48% 8px 8px;
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.2),
    0 12px 18px rgba(37, 35, 95, 0.18);
}
.comet-gate span {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #49347b;
  font-weight: 900;
}
.comet-gate.ready {
  border-color: #fff4a7;
  box-shadow:
    0 0 22px rgba(255, 244, 167, 0.8),
    inset 0 0 18px rgba(255, 244, 167, 0.26);
}
.comet-gate.open {
  opacity: 0.3;
  transform: translate(-50%, -50%) scale(0.86);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.comet-gust {
  z-index: 5;
  width: clamp(44px, 7vmin, 72px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.86) 0 18%, transparent 19%),
    conic-gradient(from 0deg, transparent 0 16%, rgba(208, 246, 255, 0.9) 16% 27%, transparent 27% 43%, rgba(255, 255, 255, 0.78) 43% 55%, transparent 55% 72%, rgba(194, 232, 255, 0.82) 72% 84%, transparent 84%);
  filter: drop-shadow(0 8px 10px rgba(37, 35, 95, 0.18));
  animation: comet-gust-spin 1.1s linear infinite;
  /* --gx/--gy: per-frame position from comet-courtyard-dash.js (perf sweep 2026-09-24).
     Individual `translate` applies OUTSIDE the spin's `rotate`, so the spin never swings
     the position offset (putting it inside `transform` did). */
  translate: var(--gx, 0px) var(--gy, 0px);
}
.comet-dash-player {
  z-index: 6;
  width: clamp(50px, 8vmin, 72px);
  aspect-ratio: 400 / 560;
  background-image: url("../../data/princess4_3d_20260607.webp?v=runtime-webp-1");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: 0 0;
  filter:
    drop-shadow(0 14px 12px rgba(32, 56, 65, 0.28))
    drop-shadow(0 0 8px rgba(255, 244, 167, 0.38));
}
.comet-dash-player.facing-right {
  background-position: 66.666% 0;
}
.comet-dash-player.facing-left {
  background-position: 100% 0;
}
.comet-dash-player.facing-up {
  background-position: 33.333% 0;
}
.comet-dash-player.facing-down {
  background-position: 0 0;
}
.comet-dash-player.walking {
  animation: comet-player-pulse 0.45s ease-in-out infinite alternate;
}
.comet-dash-player.dashing {
  filter:
    drop-shadow(0 0 18px rgba(255, 244, 167, 0.92))
    drop-shadow(0 14px 12px rgba(32, 56, 65, 0.28));
}
.comet-dash-player.bumped {
  animation: comet-player-bump 0.25s ease-out both;
}
.comet-dash-finish {
  z-index: 3;
  left: 50%;
  top: 10%;
  width: clamp(72px, 11vmin, 122px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 54%, #fff8bd 0 16%, #ffcb57 17% 28%, transparent 29%),
    conic-gradient(from 0deg, #fff4a7 0 10%, transparent 10% 22%, #ff94d6 22% 32%, transparent 32% 44%, #a6fff6 44% 54%, transparent 54% 66%, #fff4a7 66% 76%, transparent 76%);
  opacity: 0.62;
  box-shadow: 0 0 18px rgba(255, 244, 167, 0.48);
}
.comet-dash-finish.ready {
  opacity: 1;
  cursor: pointer;
  animation: comet-crown-ready 0.8s ease-in-out infinite alternate;
}
.comet-dash-finish.lit {
  background:
    radial-gradient(circle, #fffbd3 0 30%, #ffcb57 31% 52%, transparent 53%),
    conic-gradient(from 0deg, #fff4a7, #ff94d6, #a6fff6, #fff4a7);
}
.comet-dash-controls {
  position: absolute;
  z-index: 8;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
}
.comet-dash-controls button {
  min-height: 48px;
  border: 2px solid rgba(80, 68, 142, 0.28);
  border-radius: 8px;
  background: #fff8dc;
  color: #3d2e77;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(37, 35, 95, 0.14);
  touch-action: manipulation;
}
.comet-dash-controls [data-comet-dash] {
  background: #ffe8f6;
}
.comet-dash-controls button:disabled {
  opacity: 0.62;
}
.comet-dash-next {
  position: absolute;
  z-index: 7;
  right: clamp(14px, 2vw, 24px);
  top: 76px;
  display: grid;
  gap: 2px;
  width: min(330px, 40%);
  padding: 9px 12px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(41, 36, 100, 0.88), rgba(78, 75, 155, 0.84));
  color: #fff9d2;
  box-shadow: 0 12px 24px rgba(25, 25, 79, 0.24);
  pointer-events: none;
}
.comet-dash-next span {
  color: #d5fff5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.comet-dash-next strong {
  font: 900 13px/1.2 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
}
.comet-dash-sash {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 20px;
  display: flex;
  gap: 5px;
  padding: 8px 11px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(39, 32, 92, 0.74);
  transform: translateX(-50%);
  box-shadow: 0 10px 24px rgba(25, 25, 79, 0.24);
  pointer-events: none;
}
.comet-dash-sash i {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.66);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.comet-dash-sash i.lit {
  background: linear-gradient(135deg, #fff6a7, #ff9ed3 48%, #a6fff6);
  box-shadow: 0 0 11px rgba(255, 246, 167, 0.9);
  transform: scale(1.15);
}
.comet-magic-burst {
  position: absolute;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 4px double rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 246, 167, 0.92), rgba(255, 158, 211, 0.74), rgba(166, 255, 246, 0.9), rgba(255, 246, 167, 0.92));
  color: #42326f;
  font: 900 12px/1.1 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: comet-burst-arrive 0.7s ease-out both;
}
.comet-magic-burst.gate-burst {
  width: 150px;
  height: 150px;
  border-radius: 48% 48% 14px 14px;
}
.comet-magic-burst.dash-burst {
  width: 92px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(166, 255, 246, 0.18), rgba(255, 246, 167, 0.94));
}
.comet-dash-finale {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 6px;
  width: min(470px, calc(100% - 32px));
  padding: 24px 28px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 34px 34px 18px 18px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 248, 190, 0.98), transparent 32%),
    linear-gradient(145deg, rgba(46, 38, 112, 0.97), rgba(96, 66, 156, 0.96) 52%, rgba(50, 130, 142, 0.96));
  color: #fffbe0;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -43%) scale(0.84);
  box-shadow: 0 26px 64px rgba(22, 22, 72, 0.48);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.comet-dash-finale span {
  color: #fff3a1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.comet-dash-finale strong {
  font: 900 clamp(19px, 3vw, 28px)/1.12 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
}
.comet-dash-finale small {
  color: #d9fff6;
  font-size: 13px;
  font-weight: 800;
}
.comet-dash-finale[aria-hidden="false"] {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.comet-dash-stage.comet-coronation::after {
  content: "";
  position: absolute;
  z-index: 11;
  inset: 0;
  background:
    radial-gradient(circle at 18% 28%, #fff5a4 0 5px, transparent 6px),
    radial-gradient(circle at 78% 22%, #b5fff4 0 5px, transparent 6px),
    radial-gradient(circle at 70% 76%, #ffb3dc 0 5px, transparent 6px),
    rgba(31, 26, 87, 0.24);
  pointer-events: none;
}
@keyframes comet-burst-arrive {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(-12deg);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotate(3deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(1.2) rotate(0deg);
  }
}
@keyframes comet-sky-drift {
  from {
    transform: translate3d(-1%, 0, 0);
  }
  to {
    transform: translate3d(1%, 1%, 0);
  }
}
@keyframes comet-spark-bob {
  from {
    transform: translate(-50%, -50%) scale(0.95) rotate(-5deg);
  }
  to {
    transform: translate(-50%, -56%) scale(1.06) rotate(7deg);
  }
}
@keyframes comet-gust-spin {
  to {
    rotate: 360deg;
  }
}
@keyframes comet-player-pulse {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 -2px;
  }
}
@keyframes comet-player-bump {
  0% {
    rotate: -4deg;
  }
  50% {
    rotate: 5deg;
  }
  100% {
    rotate: 0deg;
  }
}
@keyframes comet-crown-ready {
  from {
    transform: translate(-50%, -50%) scale(0.96);
  }
  to {
    transform: translate(-50%, -50%) scale(1.08);
  }
}
@media (max-width: 640px) {
  .mini-game-board.comet-courtyard-dash {
    min-height: 100dvh;
  }
  .comet-dash-stage {
    min-height: 100%;
  }
  .comet-dash-status {
    max-width: calc(100% - 24px);
    font-size: 12px;
    top: 78px;
  }
  .comet-dash-next {
    left: 12px;
    right: 12px;
    top: 140px;
    width: auto;
    padding: 7px 10px;
  }
  .comet-dash-next span {
    display: none;
  }
  .comet-dash-sash {
    top: 22px;
    gap: 3px;
    padding: 6px 8px;
  }
  .comet-dash-sash i {
    width: 11px;
    height: 11px;
  }
  .comet-dash-controls {
    left: 50%;
    right: auto;
    grid-template-columns: repeat(3, minmax(64px, 1fr));
    grid-template-rows: repeat(3, 48px);
    width: min(250px, calc(100% - 24px));
    transform: translateX(-50%);
  }
  .comet-dash-controls button {
    min-height: 48px;
  }
  .comet-dash-controls [data-comet-dir="up"] {
    grid-column: 2;
    grid-row: 1;
  }
  .comet-dash-controls [data-comet-dir="left"] {
    grid-column: 1;
    grid-row: 2;
  }
  .comet-dash-controls [data-comet-dash] {
    grid-column: 2;
    grid-row: 2;
  }
  .comet-dash-controls [data-comet-dir="right"] {
    grid-column: 3;
    grid-row: 2;
  }
  .comet-dash-controls [data-comet-dir="down"] {
    grid-column: 2;
    grid-row: 3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .comet-dash-sky,
  .comet-spark,
  .comet-gust,
  .comet-dash-player.walking,
  .comet-dash-player.bumped,
  .comet-dash-finish.ready {
    animation: none;
  }
  .comet-magic-burst,
  .comet-dash-sash i,
  .comet-dash-finale {
    animation: none;
    transition: none;
  }
}

.mini-game-board.princess-arrow-tactica {
  display: flex;
  height: 100dvh;
  min-height: 100dvh;
  margin-top: 0;
  padding: 0;
  overflow: hidden;
  background: #07101a;
}

.mini-game-modal:has(.mini-game-board.princess-arrow-tactica) .mini-game-card {
  padding: 0;
  overflow: hidden;
  background: #dbe8f2;
}

.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-game-backdrop,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-game-card::before,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-game-kicker,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-game-title,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-game-prompt,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-game-brain,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-game-coach,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-guidance-toggle,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-challenge-charm,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-world-intro,
.mini-game-modal:has(.mini-game-board.princess-arrow-tactica)
  .mini-game-board::after {
  display: none !important;
}

.princess-arrow-tactica-shell {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: calc(100dvh - 72px);
  min-height: 0;
  background: #07101a;
}

.princess-arrow-tactica-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.princess-arrow-tactica-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 540px;
  border: 0;
  background: #07101a;
}

.princess-arrow-tactica-loader,
.princess-arrow-tactica-reward {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.princess-arrow-tactica-loader {
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 209, 102, 0.18), transparent 34%),
    rgba(7, 16, 26, 0.68);
  color: #fff8df;
  text-align: center;
  transition:
    opacity 240ms ease,
    visibility 240ms ease;
}

.princess-arrow-tactica-loader strong {
  font-size: clamp(19px, 3vw, 30px);
  font-weight: 950;
}

.princess-arrow-tactica-loader span {
  max-width: 36rem;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.princess-arrow-tactica-frame[data-princess-arrow-state="ready"]
  .princess-arrow-tactica-loader {
  visibility: hidden;
  opacity: 0;
}

.princess-arrow-tactica-frame[data-princess-arrow-state="slow"]
  .princess-arrow-tactica-loader {
  background:
    radial-gradient(circle at 50% 42%, rgba(104, 240, 167, 0.22), transparent 36%),
    rgba(7, 16, 26, 0.72);
}

.princess-arrow-tactica-frame[data-princess-arrow-state="resting"]
  .princess-arrow-tactica-loader {
  visibility: visible;
  opacity: 1;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 209, 102, 0.18), transparent 35%),
    linear-gradient(135deg, rgba(11, 26, 39, 0.92), rgba(42, 24, 54, 0.88));
}

.princess-arrow-tactica-frame[data-princess-arrow-state="resting"] iframe {
  visibility: hidden;
}

.princess-arrow-tactica-reward {
  top: 84px;
  right: 18px;
  display: grid;
  place-items: center;
  min-width: 150px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 209, 102, 0.52);
  border-radius: 8px;
  background: rgba(33, 24, 49, 0.86);
  color: #fff2be;
  font-size: 13px;
  font-weight: 950;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.princess-arrow-tactica-frame.has-evidence .princess-arrow-tactica-reward {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.princess-arrow-tactica-frame.has-bullseye .princess-arrow-tactica-reward span {
  color: #d9ffd9;
}

.princess-arrow-tactica-frame.slow-frame-hint::after {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  max-width: min(280px, calc(100% - 36px));
  padding: 9px 12px;
  border: 1px solid rgba(104, 240, 167, 0.38);
  border-radius: 8px;
  background: rgba(6, 22, 26, 0.8);
  color: #d8fff0;
  content: "calmer view on";
  font-size: 12px;
  font-weight: 900;
}

.princess-arrow-tactica-actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  padding: 0;
}

.princess-arrow-tactica-actions p {
  display: none;
}

.princess-arrow-tactica-actions button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #ffd166;
  color: #311532;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.princess-arrow-tactica-actions button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.princess-arrow-tactica-actions button:disabled {
  cursor: default;
  opacity: 0.72;
}

body:has(.mini-game-board.princess-arrow-tactica) #touch-controls {
  display: none !important;
}

@media (max-width: 720px) {
  .mini-game-board.princess-arrow-tactica,
  .princess-arrow-tactica-shell {
    height: 100dvh;
    min-height: 100dvh;
  }

  .princess-arrow-tactica-frame iframe {
    min-height: 0;
  }

  .princess-arrow-tactica-frame {
    padding-top: 118px;
    background: #dbe8f2;
  }

  .princess-arrow-tactica-frame iframe {
    height: 100%;
  }

  .princess-arrow-tactica-actions {
    right: 10px;
    bottom: 10px;
    padding: 0;
  }

  .princess-arrow-tactica-actions button {
    width: auto;
    min-width: 160px;
  }

  .princess-arrow-tactica-reward {
    display: none;
  }

  .princess-arrow-tactica-frame.slow-frame-hint::after {
    right: 10px;
    bottom: 10px;
  }
}
