:root {
  --bg: #07070a;
  --panel: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.55);
  --gold: #d4a017;
  --red: #e8001c;
  --cyan: #38e0ff;
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 20% -10%, rgba(56, 224, 255, 0.2), transparent 55%),
    radial-gradient(1000px 700px at 110% 30%, rgba(232, 0, 28, 0.22), transparent 60%), var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.app {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.header {
  padding: 14px 16px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.2em;
  font-family: "Press Start 2P", monospace;
  color: rgba(255, 255, 255, 0.9);
}

.brand .sub {
  font-size: 11px;
  color: var(--muted);
}

.wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pill strong {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.2s ease, border-color 0.2s ease;
  font-weight: 800;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn.primary {
  background: linear-gradient(180deg, rgba(232, 0, 28, 0.95), rgba(232, 0, 28, 0.72));
  border-color: rgba(232, 0, 28, 0.7);
}
.btn.ghost {
  background: transparent;
}
.btn.small {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.main {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.kotodama-panel {
  display: grid;
  gap: 12px;
}

.kotodama-card {
  position: relative;
  min-height: 220px;
  border-radius: 16px;
  background: radial-gradient(700px 280px at 20% 0%, rgba(56, 224, 255, 0.22), transparent 55%),
    radial-gradient(700px 280px at 100% 120%, rgba(232, 0, 28, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.kotodama-word {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 18px;
  text-align: center;
}

.kotodama-word span {
  font-family: "Press Start 2P", monospace;
  letter-spacing: 0.42em;
  font-size: clamp(22px, 3.4vw, 46px);
  line-height: 1.35;
  text-shadow: 0 10px 30px var(--shadow);
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.45));
}

.kotodama-pixel {
  width: min(560px, 100%);
  height: 120px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.45));
}

.kotodama-pt {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.35;
}

.kotodama-nuance {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: calc(100% - 120px);
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kotodama-tier {
  position: absolute;
  left: 12px;
  top: 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.74);
  opacity: 0.75;
}

.selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 520px) {
  .selector {
    grid-template-columns: 1fr;
  }
}

.tier-btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  padding: 12px 10px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
  display: grid;
  gap: 8px;
  min-height: 70px;
}
.tier-btn:active {
  transform: translateY(1px) scale(0.99);
}
.tier-btn.active {
  border-color: rgba(56, 224, 255, 0.5);
  background: rgba(56, 224, 255, 0.08);
}

.tier-btn.unaffordable {
  opacity: 0.56;
}

.tier-btn .w {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tier-btn .p {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  opacity: 0.42;
  justify-self: end;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.6;
}

.side {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.section-title {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  margin: 0;
  opacity: 0.86;
}

.setting-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.setting-row label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.setting-row input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.setting-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.56);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.danger {
  background: linear-gradient(180deg, rgba(232, 0, 28, 0.9), rgba(232, 0, 28, 0.45));
  border-color: rgba(255, 90, 110, 0.35);
  box-shadow: 0 16px 40px rgba(232, 0, 28, 0.14);
}

.pet-panel {
  display: grid;
  gap: 12px;
}
/* Map-only: 画面はマップ中心に */
/* map-only is default */
.pet-card {
  position: relative;
  min-height: 180px;
  border-radius: 20px;
  background: radial-gradient(500px 160px at 20% 0%, rgba(56, 224, 255, 0.16), transparent 55%),
    radial-gradient(500px 200px at 100% 120%, rgba(255, 150, 180, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 245, 250, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 12px 36px rgba(255, 120, 160, 0.06);
}
.pet-stage {
  position: relative;
  height: 100vh;
  touch-action: none; /* gestures */
}
.map-only-root {
  position: fixed;
  inset: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
.map-topbtn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  pointer-events: auto;
  display: flex;
  gap: 8px;
}
.map-topbtn .btn {
  padding: 10px 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.pet-mood {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(10, 16, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 6;
}
.pet-avatar.sated {
  transform: translate(-50%, -50%) scale(0.98) translateY(6px);
  opacity: 0.92;
}
.world-divine .pet-card {
  background: radial-gradient(500px 160px at 20% 0%, rgba(255, 220, 120, 0.22), transparent 55%),
    radial-gradient(500px 200px at 100% 120%, rgba(160, 220, 255, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 255, 255, 0.18);
}

.ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(56, 224, 255, 0.45);
  background: rgba(56, 224, 255, 0.12);
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0.9;
  pointer-events: none;
  animation: ripple 520ms ease-out forwards;
  z-index: 6;
}
@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(6);
    opacity: 0;
  }
}

.drag-orb {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), var(--c) 45%, rgba(0, 0, 0, 0) 78%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 7;
}

.orbs {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  pointer-events: auto;
  z-index: 4;
  display: none;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(10, 16, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
}
.orb {
  position: relative;
  left: auto;
  top: auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  transform: none;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), var(--c) 45%, rgba(0, 0, 0, 0) 78%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  opacity: 1;
  pointer-events: auto;
  display: grid;
  place-items: center;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
}
.orb .cnt {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 9px;
  opacity: 0.8;
  padding: 0 5px;
}
.orb.disabled {
  opacity: 0.35 !important;
}
.orbs.show {
  display: flex;
  align-items: center;
  pointer-events: auto;
}
.orbs.show .orb {
  animation: orbIn 0.24s cubic-bezier(0.2, 1.1, 0.25, 1) backwards;
}
.orbs.show .orb:nth-child(1) {
  animation-delay: 0ms;
}
.orbs.show .orb:nth-child(2) {
  animation-delay: 35ms;
}
.orbs.show .orb:nth-child(3) {
  animation-delay: 70ms;
}
.orbs.show .orb:nth-child(4) {
  animation-delay: 105ms;
}
.orbs.show .orb:nth-child(5) {
  animation-delay: 140ms;
}
@keyframes orbIn {
  from {
    transform: scale(0.55);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.play-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 8;
  max-width: min(92%, 340px);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(10, 16, 32, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  animation: playHintPulse 2.8s ease-in-out infinite;
}
.play-hint[hidden] {
  display: none !important;
}
@keyframes playHintPulse {
  0%,
  100% {
    opacity: 0.72;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
  }
}
.orb:active {
  transform: scale(0.96);
}

.beam {
  position: absolute;
  left: var(--x1);
  top: var(--y1);
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 18px color-mix(in oklab, var(--c), white 25%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: beamFly 520ms ease-out forwards;
  z-index: 4;
}
@keyframes beamFly {
  to {
    left: var(--x2);
    top: var(--y2);
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0.15;
  }
}

.map-layer {
  position: absolute;
  inset: 0;
  opacity: 1;
  transition: opacity 160ms ease;
}
.map-layer.hidden {
  opacity: 0;
  pointer-events: none;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.55;
  filter: drop-shadow(0 18px 48px rgba(0, 0, 0, 0.25));
}

.map-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side at 50% 45%, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

/* シールド：たまごっち「おうち」背景（マップレイヤを暖色に） */
.map-layer.shield-home .map-grid {
  background-image: linear-gradient(rgba(255, 210, 220, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 210, 220, 0.1) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 72%, rgba(255, 230, 200, 0.18), transparent 58%);
  background-size: 20px 20px, 20px 20px, 100% 100%;
  opacity: 0.88;
  filter: saturate(1.12) brightness(1.04);
}
.map-layer.shield-home .map-vignette {
  background: radial-gradient(closest-side at 50% 40%, rgba(0, 0, 0, 0), rgba(35, 18, 28, 0.38));
}

.shield-tamagotchi-ui {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 46px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  pointer-events: none;
}
.shield-friend-shell {
  pointer-events: auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 14, 20, 0.55);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
.shield-friend-line {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-left: 4px solid #06c755;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  text-align: left;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-weight: 800;
  font-size: 14px;
}
.shield-friend-line:active {
  background: rgba(255, 255, 255, 0.1);
}
.shield-friend-ico {
  font-size: 22px;
  line-height: 1;
}
.shield-friend-title {
  letter-spacing: 0.02em;
}
.shield-friend-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  opacity: 0.82;
}
.shield-friend-chev {
  font-size: 10px;
  opacity: 0.65;
  width: 1.2em;
  text-align: center;
}
.shield-friend-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
  max-height: min(42vh, 320px);
  display: flex;
  flex-direction: column;
}
.shield-friend-panel[hidden] {
  display: none !important;
}
.shield-friend-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}
.shield-friend-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-align: left;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-size: 13px;
}
.shield-friend-row:last-child {
  border-bottom: 0;
}
.shield-friend-row.selected {
  background: rgba(6, 199, 85, 0.12);
}
.shield-friend-row .sfi {
  font-size: 20px;
  line-height: 1;
}
.shield-friend-row .sfm {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}
.shield-friend-row .sfd {
  font-size: 11px;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}
.shield-friend-actions {
  display: flex;
  gap: 8px;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}
.shield-friend-actions .btn {
  flex: 1;
  font-size: 10px;
  padding: 10px 8px;
}
.shield-pet-caption {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-align: center;
  color: rgba(255, 240, 245, 0.88);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.sheet .settings-friend-block {
  margin-top: 4px;
}
.sheet .settings-friend-block .shield-friend-panel {
  max-height: min(36vh, 260px);
}

.radar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.radar-circle {
  width: 150px;
  height: 150px;
  border-radius: 999px;
  border: 1px solid rgba(56, 224, 255, 0.22);
  background: radial-gradient(circle at 50% 50%, rgba(56, 224, 255, 0.10), rgba(0, 0, 0, 0) 60%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  position: relative;
  overflow: hidden;
}
.radar-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%) scale(0.7);
  border-radius: 999px;
  border: 2px solid rgba(255, 0, 0, 0.0);
  box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.0);
  pointer-events: none;
  opacity: 0;
}
.radar-ring.ping {
  animation: radarPing 520ms ease-out forwards;
}
@keyframes radarPing {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
    border-color: rgba(255, 0, 0, 0.0);
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.0);
  }
  20% {
    opacity: 1;
    border-color: rgba(255, 0, 0, 0.75);
    box-shadow: 0 0 0 10px rgba(255, 0, 0, 0.10), 0 0 60px rgba(255, 0, 0, 0.20);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.22);
    border-color: rgba(255, 0, 0, 0.0);
    box-shadow: 0 0 0 24px rgba(255, 0, 0, 0.0);
  }
}
.radar-circle::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    rgba(56, 224, 255, 0.00) 0deg,
    rgba(56, 224, 255, 0.00) 300deg,
    rgba(56, 224, 255, 0.30) 340deg,
    rgba(56, 224, 255, 0.00) 360deg
  );
  animation: radarSweep 1800ms linear infinite;
}
.radar-lines {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at center, rgba(56, 224, 255, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.35;
  mix-blend-mode: screen;
}

.radar-blips {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.blip {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(56, 224, 255, 0.95);
  box-shadow: 0 0 14px rgba(56, 224, 255, 0.22);
  opacity: 0.92;
  transform: translate(-50%, -50%);
  animation: blipPulse var(--pulseDur, 1200ms) ease-in-out infinite;
  filter: drop-shadow(0 0 calc(var(--glow, 10px)) rgba(56, 224, 255, 0.25));
}
.blip.open {
  background: rgba(232, 0, 28, 0.95);
  box-shadow: 0 0 14px rgba(232, 0, 28, 0.22);
  filter: drop-shadow(0 0 calc(var(--glow, 10px)) rgba(232, 0, 28, 0.25));
}
.blip.sel {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}
.blip.snap {
  outline: 2px solid rgba(255, 0, 0, 0.8);
  outline-offset: 4px;
}

.impact {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0.9;
  pointer-events: none;
  animation: impact 520ms ease-out forwards;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.fw {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) scale(0.5);
  opacity: 0;
  pointer-events: none;
  animation: fwPop 1200ms ease-out forwards;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.35));
  z-index: 6;
}
@keyframes fwPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) scale(0.35);
  }
  18% {
    opacity: 1;
  }
  55% {
    transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) scale(4.2);
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) scale(0.6);
    opacity: 0;
  }
}
@keyframes impact {
  35% {
    transform: translate(-50%, -50%) scale(2.6);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(5.4);
    opacity: 0;
  }
}

@keyframes blipPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0.55;
  }
  50% {
    transform: translate(-50%, -50%) scale(var(--pulseScale, 1.25));
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0.55;
  }
}

.temu-roulette-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  place-items: center;
  padding: 16px;
  background: radial-gradient(800px 500px at 50% 20%, rgba(255, 160, 200, 0.18), transparent 55%),
    radial-gradient(600px 400px at 80% 90%, rgba(180, 220, 255, 0.12), transparent 50%), rgba(12, 8, 18, 0.78);
  backdrop-filter: blur(8px);
}
.temu-roulette-overlay.show {
  display: grid;
}
.temu-roulette-overlay.show .temu-roulette-card {
  animation: temuCardPop 0.42s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}
@keyframes temuCardPop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.temu-roulette-hearts {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.35em;
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(255, 100, 160, 0.45);
  animation: temuHeartsFloat 2.4s ease-in-out infinite;
}
@keyframes temuHeartsFloat {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.88;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}
.temu-roulette-card {
  width: min(340px, 94vw);
  border-radius: 22px;
  padding: 20px 16px 16px;
  background: linear-gradient(
    155deg,
    #ffb8d9 0%,
    #ffc9a8 28%,
    #ffe08a 55%,
    #a8e6ff 100%
  );
  box-shadow: 0 28px 64px rgba(80, 40, 90, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    inset 0 -6px 24px rgba(255, 120, 160, 0.15);
  position: relative;
  overflow: hidden;
}
.temu-roulette-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: repeating-conic-gradient(
    rgba(255, 255, 255, 0.08) 0deg 12deg,
    rgba(255, 255, 255, 0) 12deg 24deg
  );
  animation: temuShine 4s linear infinite;
  pointer-events: none;
}
@keyframes temuShine {
  to {
    transform: rotate(360deg);
  }
}
.temu-roulette-ribbon {
  position: absolute;
  top: 14px;
  right: -36px;
  transform: rotate(38deg);
  background: linear-gradient(90deg, #ff8fb8, #c8f7dc);
  color: #4a3040;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 6px 44px;
  box-shadow: 0 4px 0 rgba(90, 50, 70, 0.12);
  pointer-events: none;
  z-index: 2;
}
.temu-roulette-title {
  position: relative;
  z-index: 1;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-weight: 900;
  font-size: 19px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(180, 80, 120, 0.35), 0 0 20px rgba(255, 255, 255, 0.35);
  text-align: center;
  margin-bottom: 4px;
}
.temu-roulette-sub {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 0 rgba(120, 60, 90, 0.2);
}
.temu-roulette-viewport {
  position: relative;
  z-index: 1;
  height: 88px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(40, 24, 48, 0.45), rgba(20, 14, 32, 0.55));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2), inset 0 8px 24px rgba(0, 0, 0, 0.25);
}
.temu-roulette-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 5px;
  margin-left: -2.5px;
  background: linear-gradient(180deg, #fff8, #ffe082);
  z-index: 2;
  box-shadow: 0 0 18px rgba(255, 200, 120, 0.9);
  border-radius: 3px;
}
.temu-roulette-strip {
  display: flex;
  flex-direction: row;
  height: 100%;
  align-items: stretch;
  will-change: transform;
  position: relative;
  z-index: 1;
}
.temu-cell {
  flex: 0 0 80px;
  width: 80px;
  display: grid;
  place-items: center;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.08));
}
.temu-cell.hot {
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.35), rgba(255, 109, 0, 0.25));
}
.temu-cell.cold {
  background: linear-gradient(180deg, rgba(66, 165, 245, 0.35), rgba(30, 136, 229, 0.22));
}
.temu-roulette-footer {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  text-align: center;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-weight: 900;
  font-size: 12px;
  color: #fff;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 0 rgba(140, 60, 100, 0.25);
}

@keyframes radarSweep {
  to {
    transform: rotate(360deg);
  }
}

.map-fab {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.26);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
}
.map-fab:active {
  transform: translateY(1px) scale(0.99);
}
.map-fab span {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  opacity: 0.85;
}

.map-hud {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 6;
  pointer-events: none;
}
.map-hud .left,
.map-hud .right {
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
}
.hud-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.26);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 10px 10px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.hud-btn:active {
  transform: translateY(1px) scale(0.99);
}
.hud-chip {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.62;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 10px;
  border-radius: 999px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  background: var(--bg);
  z-index: 1200;
  overflow: auto;
}
.modal.show {
  display: flex;
}
.sheet {
  width: 100%;
  min-height: 100%;
  background: rgba(10, 10, 16, 0.96);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateX(18px);
  animation: sheetIn 160ms ease-out forwards;
}
@keyframes sheetIn {
  to {
    transform: translateX(0);
  }
}
.sheet-hdr {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sheet-hdr .ttl {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.sheet-body {
  padding: 14px;
  display: grid;
  gap: 12px;
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* 熟成コトダマ：円錐形水槽 + ポコポコ + 液晶は pt のみ */
.kotodama-tank {
  margin-top: 8px;
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  clip-path: polygon(6% 0%, 94% 0%, 100% 100%, 0% 100%);
  border-radius: 18px 18px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.12));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  min-height: 200px;
  overflow: hidden;
}
.kotodama-tank-badge {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  z-index: 2;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  pointer-events: none;
}
.kotodama-tank::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 10px;
  bottom: 10px;
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, rgba(56, 224, 255, 0.12), rgba(10, 40, 70, 0.35));
  opacity: 0.95;
  pointer-events: none;
}
.kotodama-tank-inner {
  position: relative;
  min-height: 200px;
  padding: 32px 10px 18px;
}
.kotodama-bubble {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 56px;
  margin-left: -28px;
  animation: tankBob 2.4s ease-in-out infinite;
}
@keyframes tankBob {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-7px) scale(1.02);
  }
}
.kotodama-orb {
  width: 36px;
  height: 28px;
  border-radius: 999px;
  position: relative;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.55), rgba(0, 0, 0, 0) 52%),
    linear-gradient(90deg, var(--orbA, rgba(56, 224, 255, 0.95)) 0%, var(--orbA, rgba(56, 224, 255, 0.95)) 50%, var(--orbB, rgba(232, 0, 28, 0.65)) 50%, var(--orbB, rgba(232, 0, 28, 0.65)) 100%);
}
.kotodama-orb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(-0.5px);
}
.kotodama-tank-empty {
  position: relative;
  padding: 28px 12px;
  text-align: center;
  font-size: 11px;
  opacity: 0.62;
}

/* ─── ONBOARDING UI ─────────────────────────────── */
.onboard-grid {
  display: grid;
  gap: 12px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 520px) {
  .choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.choice-btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  padding: 12px 10px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
  display: grid;
  gap: 8px;
  min-height: 74px;
  text-align: left;
}
.choice-btn:active {
  transform: translateY(1px) scale(0.99);
}
.choice-btn.active {
  border-color: rgba(56, 224, 255, 0.55);
  background: rgba(56, 224, 255, 0.08);
}
.choice-icon {
  font-size: 22px;
}
.choice-name {
  font-weight: 900;
  font-size: 12px;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: var(--c);
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15);
}
.swatch.active {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 5px rgba(56, 224, 255, 0.18);
}

/* controller UI removed (tap-first) */
.location-off {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.55;
  z-index: 5;
}
/* GOEN Pet: ちいかわ寄せ・もちもち（柔らかい縁・淡い陰影） */
.pet-avatar-wrap {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}
.pet-avatar-wrap .pet-avatar {
  pointer-events: auto;
}
.pet-divine-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  border-radius: 26%;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  /* 神格化：黄色い後光（円形グラデ） */
  background: radial-gradient(
    circle,
    rgba(255, 252, 210, 0.78) 0%,
    rgba(255, 230, 130, 0.42) 32%,
    rgba(255, 200, 70, 0.14) 55%,
    transparent 72%
  );
  box-shadow: 0 0 72px rgba(255, 220, 120, 0.55), inset 0 0 48px rgba(255, 250, 220, 0.2);
  animation: none;
  transition: opacity 0.6s ease;
}
.pet-divine-halo.show {
  animation: divineHaloPulse 2.8s ease-in-out infinite;
}
@keyframes divineHaloPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.93);
    opacity: 0.78;
    filter: brightness(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.07);
    opacity: 1;
    filter: brightness(1.12);
  }
}
.pet-avatar {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: 92px;
  height: 92px;
  /* 円形マスクではなく、柔らかい角丸（スプライトの四角さを消しつつ） */
  border-radius: 22px;
  --petColor: rgba(56, 224, 255, 0.35);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.32), rgba(0, 0, 0, 0) 52%),
    linear-gradient(165deg, var(--petColor), rgba(0, 0, 0, 0.05));
  background-repeat: no-repeat;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.15), 0 8px 22px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  text-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  user-select: none;
  z-index: 1;
}
/* 位置OFF（シールド）だけ大きく表示 */
body.shield .pet-avatar {
  width: 176px;
  height: 176px;
  border-radius: 40px;
  box-shadow: inset 0 3px 18px rgba(255, 255, 255, 0.12), 0 18px 46px rgba(0, 0, 0, 0.45);
}
/* シールド：ペットをステージの縦中央（位置ON時のやや下寄りをやめる） */
body.shield .pet-avatar-wrap,
body.shield .pet-fx-node,
body.shield .pet-aura,
body.shield .pet-sash-ribbon {
  top: 50%;
}
/* シールドではコトダマのオーブ列は非表示 */
body.shield .orbs {
  display: none !important;
  pointer-events: none;
}
.pet-avatar.sprite {
  font-size: 0;
  background-color: rgba(255, 245, 250, 0.12);
  background-position: center;
  image-rendering: auto;
  /* もちもち寄せ：柔らかい彩度とふわっとした陰 */
  filter: saturate(1.14) contrast(1.02) brightness(1.03)
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.28))
    drop-shadow(0 -3px 12px rgba(255, 255, 255, 0.18));
}
/* 16×16 シートを拡大：ドットを潰さない */
.pet-avatar.sprite.pet-pixel-sheet {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: saturate(1.08) contrast(1.03) brightness(1.02)
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.26));
}
/* 第2形態：トコトコ（y のみ微振動） */
.pet-avatar.sprite.pet-bob-walk {
  animation: petMochiBob 0.58s ease-in-out infinite alternate;
}
@keyframes petMochiBob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-4px);
  }
}
.pet-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.pet-fx-node {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pet-fx-node.evolution-burst {
  animation-iteration-count: 1 !important;
}

.pet-light-dust {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 255, 255, 0.98),
    rgba(255, 236, 160, 0.65) 42%,
    rgba(255, 200, 80, 0.25) 62%,
    rgba(255, 180, 40, 0) 78%
  );
  box-shadow: 0 0 14px rgba(255, 235, 180, 0.95);
  animation: petLightDustFloat var(--dur, 1000ms) ease-out forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes petLightDustFloat {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(0.35);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, -90px)) scale(1);
    opacity: 0;
  }
}

.pet-spark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(56, 224, 255, 0.22) 50%, rgba(0, 0, 0, 0) 70%);
  opacity: 0.95;
  filter: drop-shadow(0 10px 20px rgba(56, 224, 255, 0.18));
  animation: petSparkFly var(--dur, 1800ms) ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}

@keyframes petSparkFly {
  0% {
    transform: translate(-50%, -50%) translate(0px, 0px) scale(0.4);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) translate(var(--dx, 120px), var(--dy, -90px)) scale(1);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx2, 170px), var(--dy2, -140px)) scale(0.2);
    opacity: 0;
  }
}

.pet-note {
  font-family: "Press Start 2P", monospace;
  font-size: var(--fs, 16px);
  color: rgba(56, 224, 255, 0.9);
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  animation: petNoteFloat var(--dur, 2200ms) ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}

@keyframes petNoteFloat {
  0% {
    transform: translate(-50%, -50%) translate(0px, 0px) rotate(0deg) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) translate(var(--dx, 60px), var(--dy, -90px)) rotate(180deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx2, -60px), var(--dy2, -130px)) rotate(360deg) scale(0.7);
    opacity: 0;
  }
}

.pet-ball {
  font-size: var(--fs, 20px);
  animation: petBallBounce var(--dur, 1600ms) ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

@keyframes petBallBounce {
  0% {
    transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 0px)) translateY(12px) scale(0.7);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  55% {
    transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 0px)) translateY(0px) scale(1);
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx2, 0px), var(--dy2, 0px)) translateY(-10px) scale(0.8);
    opacity: 0;
  }
}

.pet-aura {
  width: 140px;
  height: 140px;
  border-radius: 34px;
  border: 1px solid rgba(56, 224, 255, 0.35);
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  opacity: 0.65;
  animation: petAuraPulse 1.6s ease-in-out infinite;
}

@keyframes petAuraPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0.45;
    filter: blur(0px);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.02);
    opacity: 0.78;
    filter: blur(0.2px);
  }
  100% {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0.45;
  }
}

.pet-confetti {
  width: 8px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.08));
  opacity: 0;
  animation: petConfettiFall var(--dur, 2400ms) ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}

@keyframes petConfettiFall {
  0% {
    transform: translate(-50%, -50%) translate(0px, 0px) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 90px)) rotate(var(--rot, 180deg));
    opacity: 0;
  }
}

.pet-flower {
  font-size: var(--fs, 16px);
  opacity: 0;
  animation: petFlowerDrift var(--dur, 3200ms) ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

@keyframes petFlowerDrift {
  0% {
    transform: translate(-50%, -50%) translate(0px, 0px) scale(0.6);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx, 80px), var(--dy, -140px)) scale(1);
    opacity: 0;
  }
}

.pet-firework {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  opacity: 0;
  animation: petFireworkPop var(--dur, 3600ms) ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}

@keyframes petFireworkPop {
  0% {
    transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 0px)) scale(0.4);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  55% {
    transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 0px)) scale(2);
    opacity: 0.75;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx2, 0px), var(--dy2, 0px)) scale(0.3);
    opacity: 0;
  }
}

.pet-sash-ribbon {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%) rotate(-20deg);
  width: 160px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(232, 0, 28, 0.45), rgba(56, 224, 255, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  opacity: 0.95;
  z-index: 2;
}
.pet-sash-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pet-sash-ribbon::after {
  content: "";
  position: absolute;
  inset: -14px -18px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.14), transparent 55%);
  animation: petRibbonWave 2.4s ease-in-out infinite;
}
@keyframes petRibbonWave {
  0% {
    transform: scale(0.92);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.7;
  }
  100% {
    transform: scale(0.92);
    opacity: 0.3;
  }
}

.shop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.shop-item {
  flex: 1 1 120px;
  min-width: 120px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.14);
  padding: 10px 10px;
  display: grid;
  gap: 8px;
}
.shop-item-top {
  display: flex;
  gap: 8px;
  align-items: center;
}
.shop-item-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
}
.shop-item-name {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-item-price {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  opacity: 0.55;
  letter-spacing: 0.07em;
}
.shop-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: min(520px, calc(100% - 26px));
  text-align: center;
  z-index: 999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.burst {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  overflow: hidden;
}
.burst.show {
  display: flex;
}
.burst .word {
  font-family: "Press Start 2P", monospace;
  text-align: center;
  letter-spacing: 0.42em;
  font-size: clamp(28px, 6.5vw, 90px);
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
  animation: pop 700ms cubic-bezier(0.2, 1.1, 0.25, 1) forwards;
  transform-origin: center;
  padding: 0 18px;
}
.burst .pt {
  position: absolute;
  right: 18px;
  bottom: 18px;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  opacity: 0.35;
}

.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.1) 60%, transparent 70%);
  opacity: 0.9;
  animation: spark 720ms ease-out forwards;
  filter: drop-shadow(0 10px 20px rgba(56, 224, 255, 0.22));
}

@keyframes pop {
  0% {
    transform: translateY(10px) scale(0.86);
    opacity: 0;
  }
  45% {
    transform: translateY(0) scale(1.06);
    opacity: 1;
  }
  100% {
    transform: translateY(-6px) scale(1);
    opacity: 1;
  }
}

@keyframes spark {
  0% {
    transform: translate(0, 0) scale(0.75);
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(1.5);
    opacity: 0;
  }
}
    </style>
