/* ===== Explore Map ===== */
.screen-explore {
  background: #0f141c;
  padding-bottom: 0;
  color: #fff;
}

.explore__map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.explore__hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 20;
  padding: var(--safe-top-gap) 12px 0;
  pointer-events: none;
}

.explore__hud > * {
  pointer-events: auto;
}

.explore__top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.explore__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.explore__top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.explore__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  background: rgba(15, 20, 28, 0.82);
  backdrop-filter: blur(12px);
  font-size: 0.72rem;
  font-weight: 650;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.explore__sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-bottom-gap) + 16px);
  z-index: 25;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: rgba(245, 247, 249, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease-out), opacity 0.3s;
}

.explore__chip--ok {
  color: #9dffd0;
}

.explore__chip--warn {
  color: #ffd27a;
}

.explore__chip.is-off {
  opacity: 0.55;
  text-decoration: line-through;
}

.explore__sheet.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.explore__sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.explore__avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.explore__sheet h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.explore__sheet p {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--stone);
}

.explore__sheet-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.explore__sheet-actions .btn {
  flex: 1;
  min-height: 46px;
}

.explore__sim {
  position: absolute;
  right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-bottom-gap) + 130px);
  z-index: 22;
  display: grid;
  grid-template-columns: 40px 40px 40px;
  grid-template-rows: 40px 40px 40px;
  gap: 4px;
  opacity: 0.92;
}

.explore__sim button {
  border-radius: 12px;
  background: rgba(15, 20, 28, 0.78);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.explore__sim .sim-n { grid-column: 2; grid-row: 1; }
.explore__sim .sim-w { grid-column: 1; grid-row: 2; }
.explore__sim .sim-c { grid-column: 2; grid-row: 2; font-size: 0.62rem; }
.explore__sim .sim-e { grid-column: 3; grid-row: 2; }
.explore__sim .sim-s { grid-column: 2; grid-row: 3; }

.explore__radar {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 20, 28, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  line-height: 1.4;
}

.explore__radar strong {
  color: var(--gold-bright);
}

/* Leaflet markers */
.gj-player-wrap,
.gj-treasure-wrap {
  background: transparent !important;
  border: 0 !important;
}

.gj-player-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3d9cff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(61, 156, 255, 0.35);
  position: relative;
  margin: 3px;
}

.gj-player-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(61, 156, 255, 0.45);
  animation: pulseRing 1.8s ease-out infinite;
}

@keyframes pulseRing {
  from { transform: scale(0.6); opacity: 0.9; }
  to { transform: scale(1.6); opacity: 0; }
}

.gj-treasure {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--c, #f0c94d);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #1a1814;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transition: transform 0.2s;
}

.gj-treasure.is-shiny {
  box-shadow: 0 0 0 3px #ffe566, 0 0 16px rgba(255, 229, 102, 0.85), 0 10px 22px rgba(0, 0, 0, 0.3);
  animation: shinyPulse 0.8s ease-in-out infinite alternate;
}

@keyframes shinyPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.25); }
}

.ar-target-ring {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 150px;
  height: 150px;
  margin: 0;
  border: 4px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  display: none;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.15);
  z-index: 6;
}

.ar-target-ring.is-nice { border-color: #9dffb0; }
.ar-target-ring.is-great { border-color: #7ec8ff; }
.ar-target-ring.is-excellent {
  border-color: #ffe566;
  box-shadow: 0 0 0 3px rgba(255, 229, 102, 0.45), inset 0 0 24px rgba(255, 229, 102, 0.25);
}

.ar-lock {
  transform: translate(-50%, -50%);
}

.ar-sprite.is-shiny {
  box-shadow: 0 0 30px rgba(255, 229, 102, 0.75), 0 16px 40px rgba(0, 0, 0, 0.35);
}

.ar-sprite.is-caught {
  animation: caughtPop 0.45s var(--ease-spring) both;
}

@keyframes caughtPop {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  100% { transform: translate(-50%, -55%) scale(0.2); opacity: 0; }
}

.ar-rating {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%) scale(0.8);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  transition: opacity 0.2s, transform 0.25s var(--ease-spring);
}

.ar-rating.is-show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.ar-rating.is-excellent { color: #ffe566; }
.ar-rating.is-great { color: #7ec8ff; }
.ar-rating.is-nice { color: #9dffb0; }
.ar-rating.is-ok { color: #fff; }
.ar-rating.is-miss { color: #ff8a7a; }

.ar-ball.is-miss {
  opacity: 1;
  animation: ballMiss 0.7s ease-in forwards;
}

@keyframes ballMiss {
  0% {
    transform: translateX(-50%) translateY(-35vh) scale(0.5) rotate(200deg);
    opacity: 1;
  }
  100% {
    transform: translateX(30%) translateY(10vh) scale(0.35) rotate(720deg);
    opacity: 0;
  }
}

.ar-ball.is-hit {
  opacity: 1;
  animation: ballHit 0.55s ease-out forwards;
}

@keyframes ballHit {
  0% {
    transform: translateX(-50%) translateY(-38vh) scale(0.55) rotate(300deg);
    opacity: 1;
  }
  40% {
    transform: translateX(-50%) translateY(-42vh) scale(0.7) rotate(400deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(-42vh) scale(0.15) rotate(520deg);
    opacity: 0;
  }
}

.ar-sprite.is-miss-shake {
  animation: missShake 0.55s ease-in-out !important;
}

@keyframes missShake {
  0%, 100% { transform: translate(-50%, -50%) scale(1.05) rotate(0); }
  20% { transform: translate(-42%, -50%) scale(1.05) rotate(-8deg); }
  40% { transform: translate(-58%, -48%) scale(1.05) rotate(8deg); }
  60% { transform: translate(-44%, -50%) scale(1.05) rotate(-5deg); }
  80% { transform: translate(-54%, -50%) scale(1.05) rotate(4deg); }
}

.ar-sprite.is-hit-burst {
  animation: hitBurst 0.5s ease-out !important;
  filter: brightness(1.4) drop-shadow(0 0 24px rgba(255, 229, 102, 0.9));
}

@keyframes hitBurst {
  0% { transform: translate(-50%, -50%) scale(1); }
  40% { transform: translate(-50%, -50%) scale(1.35); }
  100% { transform: translate(-50%, -50%) scale(1.1); }
}

.fun-star {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: #ffe566;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: starBurst 0.9s ease-out forwards;
  pointer-events: none;
}

@keyframes starBurst {
  0% {
    transform: translate(0, 0) scale(0.4);
    opacity: 1;
  }
  100% {
    transform: translate(var(--sx), var(--sy)) scale(0.2);
    opacity: 0;
  }
}

.fun-ring {
  position: absolute;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 229, 102, 0.85);
  border-radius: 50%;
  animation: ringExpand 0.85s ease-out forwards;
  pointer-events: none;
}

@keyframes ringExpand {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: scale(4.5);
    opacity: 0;
  }
}

.fun-capture-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.55), transparent 45%);
  animation: flashOut 0.85s ease-out forwards;
  pointer-events: none;
}

.fun-capture-glow.is-shiny {
  background: radial-gradient(circle at 50% 42%, rgba(255, 229, 102, 0.65), transparent 50%);
}

.fun-popup--miss strong {
  color: #ff8a7a;
}

.ar-ball {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f0c94d 50%, #fff 50%);
  border: 3px solid #1a1814;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  opacity: 0;
  z-index: 9;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
}

.ar-ball.is-throw {
  opacity: 1;
  animation: ballThrowFast 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes ballThrowFast {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(-38vh) scale(0.4);
    opacity: 0.1;
  }
}

.ar-ball.is-water {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

@keyframes ballThrow {
  0% {
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(-42vh) scale(0.45) rotate(480deg);
    opacity: 0.15;
  }
}

.btn-ar-catch {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 56px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--accent-text);
  font-weight: 800;
  font-size: 1.05rem;
}

.xp-bar {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  max-width: 220px;
}

.xp-bar__track {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.xp-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-bright), #fff3b0);
  transition: width 0.4s var(--ease-out);
}

.xp-bar__label {
  margin-top: 6px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
}

.book__cell.is-shiny {
  box-shadow: 0 0 0 2px #e8c85a, 0 8px 18px rgba(232, 200, 90, 0.35);
}

/* Fun layer */
.fun-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  overflow: hidden;
}

.fun-confetti {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translate(var(--dx), 110vh) rotate(var(--rot));
    opacity: 0.2;
  }
}

.fun-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 55%);
  animation: flashOut 0.65s ease-out forwards;
}

.fun-flash--excellent {
  background: radial-gradient(circle, rgba(255, 229, 102, 0.45), transparent 55%);
}

.fun-flash--shiny {
  background: radial-gradient(circle, rgba(255, 215, 80, 0.55), transparent 50%);
}

@keyframes flashOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.fun-popup {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translate(-50%, 12px) scale(0.9);
  padding: 14px 22px;
  border-radius: 18px;
  background: rgba(15, 20, 28, 0.88);
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.fun-popup.is-show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.fun-popup strong {
  display: block;
  font-family: "Noto Serif KR", serif;
  font-size: 1.35rem;
}

.fun-popup span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.ar-intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.ar-intro.is-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ar-intro__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(20, 28, 40, 0.35), rgba(8, 10, 16, 0.92));
  backdrop-filter: blur(6px);
}

.ar-intro__burst {
  position: absolute;
  width: 140vmax;
  height: 140vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 200, 90, 0.35) 0%, transparent 55%);
  transform: scale(0.2);
  opacity: 0;
}

.ar-intro.is-show .ar-intro__burst {
  animation: introBurst 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes introBurst {
  0% { transform: scale(0.15); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scale(1); opacity: 0.15; }
}

.ar-intro__card {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 28px 32px;
  transform: translateY(24px) scale(0.92);
  opacity: 0;
}

.ar-intro.is-show .ar-intro__card {
  animation: introCard 0.7s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes introCard {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.ar-intro__eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8c85a;
}

.ar-intro__jamo {
  margin: 16px auto 10px;
  width: 110px;
  height: 110px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 800;
  color: #1a1814;
  background: radial-gradient(circle at 35% 30%, #fff8d4, var(--intro-c, #f0c94d));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(255, 255, 255, 0.2);
  animation: introJamoPulse 1.2s ease-in-out infinite alternate;
}

.ar-intro.is-shiny .ar-intro__jamo {
  box-shadow: 0 0 40px rgba(255, 229, 102, 0.7), 0 20px 50px rgba(0, 0, 0, 0.35);
}

@keyframes introJamoPulse {
  from { transform: scale(1) rotate(-2deg); }
  to { transform: scale(1.06) rotate(2deg); }
}

.ar-intro__name {
  font-family: "Noto Serif KR", serif;
  font-size: 1.55rem;
  font-weight: 600;
}

.ar-intro__sub {
  margin-top: 8px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}

.ar-intro__bar {
  margin: 22px auto 0;
  width: 160px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.ar-intro__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #e8c85a, #fff3b0);
}

.ar-intro.is-show .ar-intro__bar span {
  animation: introBar 1.6s 0.2s linear forwards;
}

@keyframes introBar {
  to { width: 100%; }
}

.ar-intro.is-out {
  animation: introOut 0.45s ease-in forwards;
}

@keyframes introOut {
  to {
    opacity: 0;
    transform: scale(1.04);
  }
}

/* AR 스프라이트 위치 전환 부드럽게 */
.ar-sprite,
.ar-lock,
.ar-target-ring {
  will-change: left, top, transform;
}

.ar-sprite.is-visible {
  transition: left 0.12s linear, top 0.12s linear;
}

.ar-lock.is-center-lock {
  border-color: #ffe566;
  box-shadow: 0 0 0 6px rgba(255, 229, 102, 0.22);
}

.screen-ar.is-entering .ar-stage {
  animation: arStageIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes arStageIn {
  from {
    opacity: 0;
    transform: scale(1.06);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.gj-treasure.is-caught {
  filter: grayscale(0.7);
  opacity: 0.7;
}

@keyframes hotBounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-4px) scale(1.06); }
}

/* ===== AR Screen ===== */
.screen-ar {
  background: #000;
  color: #fff;
}

.ar-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #111;
}

.ar-stage.is-nocam {
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(196, 160, 53, 0.2), transparent),
    linear-gradient(180deg, #1a2430, #0d1218);
}

.ar-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(1);
}

.ar-hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.ar-hud > * {
  pointer-events: auto;
}

.ar-top {
  position: absolute;
  top: var(--safe-top-gap);
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ar-panel {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ar-panel h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.ar-panel p {
  margin-top: 2px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}

.ar-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(10, 12, 16, 0.55);
  color: #fff;
  font-size: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ar-lock {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 24px;
  pointer-events: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.ar-lock.is-locked-on {
  border-style: solid;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 6px rgba(232, 200, 90, 0.2);
}

.ar-sprite {
  position: absolute;
  left: 50%;
  top: 46%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border-radius: 28px;
  background: radial-gradient(circle at 40% 30%, #fff8d4, var(--c, #f0c94d));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.ar-sprite.is-visible {
  display: flex;
  opacity: 1;
}

.ar-sprite.is-frozen {
  animation: none;
  box-shadow:
    0 0 0 3px rgba(180, 230, 255, 0.55),
    0 0 28px rgba(120, 200, 255, 0.45),
    0 16px 40px rgba(0, 0, 0, 0.35);
}

.ar-sprite__ice {
  position: absolute;
  inset: -8%;
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(220, 245, 255, 0.75), rgba(120, 190, 230, 0.25) 45%, rgba(180, 230, 255, 0.55)),
    repeating-linear-gradient(
      -25deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.12) 8px,
      rgba(255, 255, 255, 0.12) 10px
    );
  pointer-events: none;
  transition: opacity 0.25s, transform 0.3s;
  z-index: 1;
}

.ar-sprite__glyph {
  position: relative;
  z-index: 2;
  font-size: 2.4rem;
  font-weight: 800;
  color: #1a1814;
  line-height: 1;
  text-shadow: 0 0 12px rgba(200, 240, 255, 0.8);
}

.ar-sprite.is-almost-free .ar-sprite__ice {
  filter: brightness(1.15);
}

.ar-sprite.is-thawed .ar-sprite__ice {
  opacity: 0 !important;
}

.ar-sprite.is-hit-splash {
  animation: iceHit 0.28s ease-out;
}

@keyframes iceHit {
  0% { transform: translate(-50%, -50%) scale(1.08); filter: brightness(1); }
  40% { transform: translate(-50%, -50%) scale(1.16); filter: brightness(1.35) saturate(1.2); }
  100% { transform: translate(-50%, -50%) scale(1.08); filter: brightness(1); }
}

.ar-ice-bar {
  position: absolute;
  left: 50%;
  bottom: -36px;
  transform: translateX(-50%);
  width: 132px;
  z-index: 3;
}

.ar-ice-bar__track {
  height: 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid rgba(180, 230, 255, 0.35);
}

.ar-ice-bar__fill {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7ec8ff, #e8f7ff);
  transition: width 0.18s ease-out;
}

.ar-ice-bar__fill.is-mid {
  background: linear-gradient(90deg, #5aa8e8, #b8e4ff);
}

.ar-ice-bar__fill.is-low {
  background: linear-gradient(90deg, #3d8fd4, #8fd0ff);
}

.ar-ice-bar__label {
  margin-top: 4px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #dff3ff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

.ar-stats {
  position: absolute;
  top: calc(var(--safe-top-gap) + 58px);
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 8;
}

.ar-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.78rem;
}

.ar-stat-pill__label {
  opacity: 0.7;
  font-size: 0.68rem;
  font-weight: 600;
}

.ar-stat-pill strong {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.ar-stat-pill--ammo strong { color: #8fd4ff; }
.ar-stat-pill--combo strong { color: #ffe566; }

.ar-crosshair {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  z-index: 6;
}

.ar-crosshair.is-on {
  opacity: 1;
}

.ar-crosshair::before,
.ar-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.ar-crosshair::before {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

.ar-crosshair::after {
  top: 50%;
  left: 0;
  height: 2px;
  width: 100%;
  transform: translateY(-50%);
}

.ar-judge {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translate(-50%, 8px) scale(0.85);
  z-index: 12;
  font-family: var(--font-game);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: none;
}

.ar-judge.is-show {
  animation: judgePop 0.5s var(--ease-out) both;
}

.ar-judge.is-perfect { color: #ffe566; }
.ar-judge.is-great { color: #7ec8ff; }
.ar-judge.is-good { color: #9dffb0; }
.ar-judge.is-ok { color: #fff; }
.ar-judge.is-miss { color: #ff8a7a; font-size: 1.25rem; }

@keyframes judgePop {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(0.7); }
  25% { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
  70% { opacity: 1; transform: translate(-50%, -6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -18px) scale(0.95); }
}

.ar-lock.is-frozen-frame {
  border-color: rgba(160, 220, 255, 0.75);
  box-shadow: 0 0 0 6px rgba(120, 200, 255, 0.18);
  border-style: solid;
}

.ar-target-ring.is-wide {
  border-color: rgba(255, 255, 255, 0.35);
}

.ar-rating.is-perfect { color: #ffe566; }
.ar-rating.is-good { color: #9dffb0; }

.btn-ar-catch.is-firing {
  background: linear-gradient(135deg, #7ec8ff, #3d8fd4);
  color: #041018;
  transform: scale(0.98);
}

.ar-ball.is-water .ar-ball__drop,
.ar-ball .ar-ball__drop {
  display: block;
  width: 28px;
  height: 36px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 35% 30%, #e8f7ff, #4aa3e8 55%, #2a78c4);
  box-shadow: 0 4px 12px rgba(40, 120, 200, 0.45);
}

.ar-ball.is-water {
  background: transparent;
  box-shadow: none;
}

.ar-compass {
  display: none;
}

.ar-compass {
  position: absolute;
  top: calc(var(--safe-top-gap) + 64px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(10, 12, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
}

.ar-compass__needle {
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: linear-gradient(#ff6b5a, #fff);
  transform-origin: center bottom;
  margin-bottom: 10px;
  transition: transform 0.12s linear;
}

.ar-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(20px + max(16px, var(--safe-bottom)));
  z-index: 50;
}

.ar-hint {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.btn-ar-catch {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 56px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--accent-text);
  font-weight: 800;
  font-size: 1.05rem;
}

.btn-ar-catch:disabled {
  opacity: 0.45;
  filter: grayscale(0.4);
}

.ar-catch-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* ===== Book ===== */
.screen-book {
  background: var(--paper);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom-gap) + 20px);
}

.book__header {
  padding: var(--safe-top-gap) 22px 0;
}

.book__header h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.book__header p {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--stone);
}

.book__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 18px 0;
}

.book__cell {
  aspect-ratio: 1;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #fff;
  border: 1px solid rgba(20, 24, 31, 0.06);
  font-weight: 800;
}

.book__cell.is-empty {
  opacity: 0.35;
  filter: grayscale(1);
}

.book__cell .j {
  font-size: 1.35rem;
}

.book__cell .n {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--stone);
}

.book__missions {
  padding: 22px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mission-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(20, 24, 31, 0.06);
}

.mission-card.is-done {
  border-color: rgba(61, 139, 110, 0.45);
  background: linear-gradient(90deg, rgba(61, 139, 110, 0.08), #fff);
}

.mission-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.mission-card p {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--stone);
}

.mission-needed {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mission-needed span {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--mist);
  color: var(--stone);
}

.mission-needed span.have {
  background: var(--gold);
  color: var(--accent-text);
}

/* Home tweaks for GPS CTA */
.home__stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.home__stat {
  text-align: center;
  padding: 12px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.home__stat b {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-bright);
}

.home__stat span {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.65);
}

.screen-home .tabbar button.is-locked::after {
  display: none;
}
