*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --rainbow-1: #ff6b9d;
  --rainbow-2: #ffa94d;
  --rainbow-3: #ffe066;
  --rainbow-4: #69db7c;
  --rainbow-5: #4dabf7;
  --rainbow-6: #9775fa;
  --rainbow-7: #f06595;
  --dog-brown: #d4a574;
  --dog-dark: #b8864f;
  --dog-light: #f5deb3;
  --shadow: rgba(0, 0, 0, 0.25);
  --panel-bg: rgba(255, 255, 255, 0.94);
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Baloo 2', cursive, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: #333;
  position: relative;
  top: 0 !important;
}

/* Google Translate — bright gold button at top right */
.goog-te-banner-frame.skiptranslate { display: none !important; }
#google_translate_element {
  position: fixed;
  top: 4px;
  right: 4px;
  z-index: 10000;
  display: inline-block;
  vertical-align: middle;
}
#google_translate_element .goog-te-gadget {
  font-size: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
#google_translate_element .goog-te-gadget-simple {
  background: linear-gradient(to right, #fde047, #facc15, #fde047);
  border: 2px solid #ca8a04;
  border-radius: 9999px;
  padding: 6px 10px 6px 8px;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  color: #713f12;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  cursor: pointer;
  transition: filter 0.1s ease, transform 0.1s ease;
  min-width: 98px;
  position: relative;
  line-height: 1;
}
#google_translate_element .goog-te-gadget-simple:hover {
  filter: brightness(1.05);
}
#google_translate_element .goog-te-gadget-simple:active {
  transform: scale(0.985);
}
#google_translate_element .goog-te-gadget-simple::before {
  content: "🌐 Translate";
  white-space: nowrap;
}
#google_translate_element .goog-te-combo {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  background: transparent !important;
  border: none !important;
  color: transparent !important;
  font-size: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}
#google_translate_element .goog-te-gadget > span,
#google_translate_element .goog-te-gadget a,
#google_translate_element .goog-te-gadget img,
.goog-te-gadget-icon,
#google_translate_element .goog-te-gadget-simple img {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}
#google_translate_element .goog-te-gadget-simple::after {
  content: "▼";
  font-size: 7px;
  margin-left: 3px;
  opacity: 0.6;
}

/* Full-page background image */
.game-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: url('https://i.imgur.com/8l6dHHA.jpeg'), url('assets/background.jpeg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(
      160deg,
      rgba(25, 15, 45, 0.45) 0%,
      rgba(90, 30, 80, 0.3) 20%,
      rgba(30, 50, 100, 0.35) 45%,
      rgba(80, 25, 90, 0.32) 70%,
      rgba(20, 25, 50, 0.48) 100%
    ),
    radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.25) 100%);
}

.sparkle-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-sparkle {
  position: absolute;
  font-size: 1rem;
  opacity: 0.6;
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 0.8; transform: scale(1.2) rotate(180deg); }
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
  background: linear-gradient(
    120deg,
    #ff6b9d 0%,
    #ffa94d 16%,
    #ffe066 32%,
    #69db7c 48%,
    #4dabf7 64%,
    #9775fa 80%,
    #ff6b9d 100%
  );
  background-size: 300% 300%;
  animation: headerRainbow 7s ease infinite;
  border-bottom: 4px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.28);
}

@keyframes headerRainbow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.header-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.header-sparkle {
  position: absolute;
  opacity: 0.75;
  animation: headerTwinkle 2.2s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}

@keyframes headerTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.65) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

.header-content {
  position: relative;
  z-index: 1;
  padding: 1rem 1rem 0.9rem;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.logo-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo h1 {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: clamp(1.5rem, 5.5vw, 2.35rem);
  font-weight: 700;
  color: #fff;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.12),
    0 0 18px rgba(255, 255, 255, 0.65),
    2px 2px 10px rgba(90, 40, 130, 0.35);
  letter-spacing: 0.02em;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.version-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--rainbow-6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.stats-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  min-height: 7.5rem;
}

.sparkle-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.counter-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.07em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.counter-value {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: clamp(2.2rem, 9vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  text-shadow:
    0 0 14px rgba(255, 224, 102, 0.95),
    0 2px 0 #e67700,
    0 4px 14px rgba(0, 0, 0, 0.28);
  transition: transform 0.1s ease;
}

.counter-value.pulse {
  animation: counterPulse 0.2s ease;
}

@keyframes counterPulse {
  50% { transform: scale(1.08); }
}

.per-second {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.2rem 0.35rem;
  min-width: 15rem;
  min-height: 1.5rem;
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.sps-value {
  color: #fff;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(137, 247, 254, 0.85);
}

.bonus-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 0.3rem;
  min-height: 1.75rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.rebirth-stat,
.achieve-stat {
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  min-width: 10.5rem;
  text-align: center;
  white-space: nowrap;
}

/* Main layout */
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1rem;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 180px);
  min-height: calc(100dvh - 180px);
  align-items: start;
}

/* Click zone */
.click-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: visible;
  min-height: clamp(380px, 85vw, 560px);
}

.dog-scene {
  position: relative;
  z-index: 3;
  width: min(72%, 420px);
  min-height: clamp(300px, 68vw, 460px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  margin: 0 auto;
}

.building-visuals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.visual-group {
  position: absolute;
  pointer-events: none;
}

.visual-group:not(.visual-houses) {
  inset: 0;
}

.visual-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-6));
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 5;
  white-space: nowrap;
}

.visual-prop {
  position: absolute;
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
  line-height: 1;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Floating treats */
.visual-treats .visual-prop {
  animation: floatTreat var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes floatTreat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0) rotate(-8deg); opacity: 0.85; }
  50% { transform: translate(-50%, -50%) translateY(-16px) rotate(8deg); opacity: 1; }
}

/* Bouncing tennis balls */
.visual-tennis .visual-prop {
  animation: bounceBall var(--dur, 1.2s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes bounceBall {
  0%, 100% { transform: translate(-50%, -50%) translateY(0) scale(1); }
  50% { transform: translate(-50%, -50%) translateY(-24px) scale(1.08); }
}

/* Chew toys on the ground */
.visual-chew .visual-prop {
  animation: wiggleToy var(--dur, 2s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes wiggleToy {
  0%, 100% { transform: translate(-50%, -50%) rotate(-6deg) translateY(0); }
  50% { transform: translate(-50%, -50%) rotate(6deg) translateY(-5px); }
}

/* Walking puppies */
.visual-puppies .visual-prop {
  font-size: clamp(1rem, 2.8vw, 1.4rem);
  animation: puppyWalk var(--dur, 4s) linear infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes puppyWalk {
  0% { transform: translate(-50%, -50%) translateX(0) scaleX(1); }
  49% { transform: translate(-50%, -50%) translateX(var(--walk-dist, 40px)) scaleX(1); }
  50% { transform: translate(-50%, -50%) translateX(var(--walk-dist, 40px)) scaleX(-1); }
  99% { transform: translate(-50%, -50%) translateX(0) scaleX(-1); }
  100% { transform: translate(-50%, -50%) translateX(0) scaleX(1); }
}

/* Mini dog houses */
.visual-houses {
  bottom: 4%;
  left: 1%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: flex-end;
  max-width: 38%;
}

.visual-houses .visual-badge {
  top: -1rem;
  right: auto;
  left: 0;
}

.visual-treats .visual-badge {
  top: 0;
  left: 0;
  right: auto;
}

.visual-tennis .visual-badge {
  top: 0;
  right: 0;
}

.visual-chew .visual-badge {
  top: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.visual-puppies .visual-badge {
  top: auto;
  bottom: 0;
  right: 0;
}

.building-visuals.visual-pop {
  animation: visualPop 0.45s ease;
}

/* Mythic companion field — spread around click zone, clear of dog center */
.companion-visuals {
  position: absolute;
  left: 0;
  right: 0;
  top: 5.5rem;
  bottom: 2.75rem;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.mythic-companion {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
  animation: companionIdle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}

.mythic-companion-aura {
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 102, 0.55) 0%, rgba(255, 107, 157, 0.35) 35%, rgba(151, 117, 250, 0.2) 60%, transparent 75%);
  animation: mythicAuraPulse 2.8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  z-index: 0;
}

.mythic-companion-img {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(58px, 13.5vw, 96px);
  height: clamp(58px, 13.5vw, 96px);
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 16px rgba(255, 107, 157, 0.85),
    0 0 32px rgba(151, 117, 250, 0.65),
    0 0 48px rgba(255, 224, 102, 0.45),
    0 6px 16px rgba(0, 0, 0, 0.25);
  animation: mythicImgGlow 3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes companionIdle {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0) rotate(0deg); }
  25% { transform: translate(-50%, -50%) translate(var(--drift, 5px), calc(var(--drift, 5px) * -0.8)) rotate(3deg); }
  50% { transform: translate(-50%, -50%) translate(calc(var(--drift, 5px) * -0.5), calc(var(--drift, 5px) * -1)) rotate(-2deg); }
  75% { transform: translate(-50%, -50%) translate(calc(var(--drift, 5px) * -0.8), calc(var(--drift, 5px) * -0.4)) rotate(2deg); }
}

@keyframes mythicAuraPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.65; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes mythicImgGlow {
  0%, 100% { filter: brightness(1) saturate(1.05); }
  50% { filter: brightness(1.15) saturate(1.2); }
}

.mythic-companion-rainbow-wooly .mythic-companion-aura {
  inset: -32%;
  background: radial-gradient(
    circle,
    rgba(255, 107, 157, 0.65) 0%,
    rgba(255, 224, 102, 0.5) 25%,
    rgba(105, 219, 124, 0.4) 45%,
    rgba(77, 171, 247, 0.35) 60%,
    rgba(151, 117, 250, 0.25) 75%,
    transparent 85%
  );
  animation: rainbowWoolyAura 2.2s ease-in-out infinite;
}

.mythic-companion-rainbow-wooly .mythic-companion-img {
  border-color: rgba(255, 255, 255, 1);
  box-shadow:
    0 0 20px rgba(255, 107, 157, 0.9),
    0 0 36px rgba(255, 224, 102, 0.75),
    0 0 52px rgba(77, 171, 247, 0.65),
    0 0 68px rgba(151, 117, 250, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.25);
  animation: rainbowWoolyGlow 2.5s ease-in-out infinite;
}

@keyframes rainbowWoolyAura {
  0%, 100% { transform: scale(0.95); opacity: 0.75; }
  50% { transform: scale(1.18); opacity: 1; }
}

@keyframes rainbowWoolyGlow {
  0%, 100% { filter: brightness(1.05) saturate(1.15) hue-rotate(0deg); }
  33% { filter: brightness(1.2) saturate(1.35) hue-rotate(15deg); }
  66% { filter: brightness(1.15) saturate(1.3) hue-rotate(-12deg); }
}

.mythic-companion-ultra .mythic-companion-img {
  width: clamp(68px, 15vw, 112px);
  height: clamp(68px, 15vw, 112px);
}

.mythic-companion-rainbow-grace .mythic-companion-aura {
  inset: -38%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 107, 157, 0.7) 0deg,
    rgba(255, 224, 102, 0.65) 60deg,
    rgba(105, 219, 124, 0.55) 120deg,
    rgba(77, 171, 247, 0.6) 180deg,
    rgba(151, 117, 250, 0.65) 240deg,
    rgba(240, 101, 149, 0.7) 300deg,
    rgba(255, 107, 157, 0.7) 360deg
  );
  animation: rainbowGraceAura 2s linear infinite;
  filter: blur(2px);
}

.mythic-companion-rainbow-grace .mythic-companion-img {
  border-color: rgba(255, 255, 255, 1);
  box-shadow:
    0 0 24px rgba(255, 107, 157, 0.95),
    0 0 42px rgba(255, 224, 102, 0.85),
    0 0 60px rgba(77, 171, 247, 0.75),
    0 0 78px rgba(151, 117, 250, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.28);
  animation: rainbowGraceGlow 2.4s ease-in-out infinite;
}

.mythic-companion-glaze .mythic-companion-aura {
  inset: -40%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85) 0%, transparent 45%),
    radial-gradient(circle at 70% 65%, rgba(173, 216, 255, 0.7) 0%, transparent 50%),
    radial-gradient(circle, rgba(151, 117, 250, 0.55) 0%, rgba(77, 171, 247, 0.4) 40%, rgba(255, 224, 102, 0.25) 65%, transparent 82%);
  animation: glazeAura 2.6s ease-in-out infinite;
}

.mythic-companion-glaze .mythic-companion-img {
  border: 3px solid rgba(220, 240, 255, 0.98);
  box-shadow:
    0 0 26px rgba(173, 216, 255, 0.95),
    0 0 44px rgba(151, 117, 250, 0.8),
    0 0 62px rgba(255, 255, 255, 0.65),
    0 0 80px rgba(77, 171, 247, 0.55),
    inset 0 0 12px rgba(255, 255, 255, 0.35),
    0 8px 22px rgba(0, 0, 0, 0.3);
  animation: glazeShimmer 3.2s ease-in-out infinite;
}

@keyframes rainbowGraceAura {
  0% { transform: scale(0.94) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
  100% { transform: scale(0.94) rotate(360deg); opacity: 0.8; }
}

@keyframes rainbowGraceGlow {
  0%, 100% { filter: brightness(1.1) saturate(1.25) hue-rotate(0deg); }
  25% { filter: brightness(1.25) saturate(1.45) hue-rotate(20deg); }
  50% { filter: brightness(1.2) saturate(1.4) hue-rotate(-15deg); }
  75% { filter: brightness(1.3) saturate(1.5) hue-rotate(10deg); }
}

@keyframes glazeAura {
  0%, 100% { transform: scale(0.96); opacity: 0.7; }
  50% { transform: scale(1.22); opacity: 1; }
}

@keyframes glazeShimmer {
  0%, 100% { filter: brightness(1.08) saturate(1.1); }
  33% { filter: brightness(1.28) saturate(1.25) drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)); }
  66% { filter: brightness(1.18) saturate(1.2) drop-shadow(0 0 6px rgba(173, 216, 255, 0.9)); }
}

@keyframes visualPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.mini-house {
  position: relative;
  width: clamp(36px, 8vw, 52px);
  animation: houseGlow 3s ease-in-out infinite;
}

.mini-house:nth-child(2) { animation-delay: 0.5s; }
.mini-house:nth-child(3) { animation-delay: 1s; }

@keyframes houseGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

.house-roof {
  width: 0;
  height: 0;
  border-left: clamp(18px, 4vw, 26px) solid transparent;
  border-right: clamp(18px, 4vw, 26px) solid transparent;
  border-bottom: clamp(14px, 3vw, 20px) solid #e8590c;
  margin: 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.house-body {
  width: clamp(30px, 6.5vw, 44px);
  height: clamp(22px, 5vw, 32px);
  background: linear-gradient(180deg, #ffd43b, #ffa94d);
  border: 2px solid #e67700;
  border-radius: 2px 2px 4px 4px;
  margin: 0 auto;
  position: relative;
}

.house-door {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 55%;
  background: #8b5a2b;
  border-radius: 3px 3px 0 0;
}

.house-window {
  position: absolute;
  top: 20%;
  right: 15%;
  width: 22%;
  height: 22%;
  background: #89f7fe;
  border: 1px solid #4dabf7;
  border-radius: 2px;
}

.multiplier-display {
  position: relative;
  z-index: 5;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  font-weight: 600;
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.2), rgba(151, 117, 250, 0.2));
  border: 2px solid var(--rainbow-6);
  color: var(--rainbow-6);
  margin-bottom: 0.5rem;
  min-width: 11rem;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  animation: glowPulse 2s ease infinite;
}

.action-row {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  width: 100%;
  max-width: 420px;
}

.daily-btn,
.rebirth-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 12px;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}

.daily-btn {
  background: linear-gradient(135deg, #ffd43b, #ffa94d);
  color: #5c3d00;
}

.daily-btn.ready {
  animation: affordableGlow 1.5s ease infinite;
}

.daily-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rebirth-btn {
  background: linear-gradient(135deg, #868e96, #adb5bd);
  color: white;
}

.rebirth-btn.ready {
  background: linear-gradient(135deg, var(--rainbow-5), var(--rainbow-6));
  animation: glowPulse 2s ease infinite;
}

.rebirth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.daily-btn:active:not(:disabled),
.rebirth-btn:active:not(:disabled) {
  transform: scale(0.96);
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(151, 117, 250, 0.3); }
  50% { box-shadow: 0 0 25px rgba(151, 117, 250, 0.6); }
}

.dog-button {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 100%;
  max-width: clamp(300px, 75vw, 480px);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.dog-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  line-height: 0;
}

.dog-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 85%;
  height: 85%;
  max-width: 460px;
  max-height: 460px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 102, 0.4) 0%, rgba(151, 117, 250, 0.12) 55%, transparent 72%);
  animation: dogGlow 3s ease infinite;
  pointer-events: none;
}

@keyframes dogGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}

.dog-image {
  position: relative;
  display: block;
  width: clamp(240px, 58vw, 380px);
  height: auto;
  max-width: 100%;
  max-height: clamp(300px, 75vw, 480px);
  object-fit: contain;
  object-position: center center;
  margin: 0 auto;
  z-index: 1;
  transition: transform 0.1s ease;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.2));
  animation: dogBounce 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes dogBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.dog-button:active .dog-image,
.dog-button.clicked .dog-image {
  animation: none;
  transform: scale(0.94);
}

.dog-button.barking .dog-image {
  animation: barkShake 0.4s ease;
}

@keyframes barkShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-4deg) scale(1.02); }
  75% { transform: rotate(4deg) scale(1.02); }
}

.bark-bubble {
  position: absolute;
  top: -4%;
  left: 50%;
  transform: translateX(-50%) scale(0);
  z-index: 10;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 700;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  background: white;
  border: 3px solid var(--rainbow-1);
  color: var(--rainbow-6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bark-bubble.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.click-hint {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: var(--rainbow-6);
  margin-top: 0.75rem;
  animation: hintPulse 2s ease infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.click-power {
  position: relative;
  z-index: 5;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--rainbow-4);
  padding: 0.3rem 0.8rem;
  background: rgba(105, 219, 124, 0.2);
  border-radius: 999px;
  min-width: 13rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  text-align: center;
}

/* Shop panel */
.shop-panel {
  background: var(--panel-bg);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 8px 32px var(--shadow);
  border: 3px solid transparent;
  background-clip: padding-box;
  position: relative;
  overflow: hidden;
  width: 380px;
  min-width: 380px;
  max-width: 380px;
  flex-shrink: 0;
  contain: layout style;
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.shop-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 3px;
  background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-3), var(--rainbow-5), var(--rainbow-7));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.tab-btn {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.5rem 0.35rem;
  border: 2px solid #eee;
  border-radius: 12px;
  background: white;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  line-height: 1.15;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--rainbow-5), var(--rainbow-6));
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(151, 117, 250, 0.35);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.shop-section {
  margin-bottom: 1.25rem;
}

.shop-title {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: #444;
}

.shop-subtitle {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px dashed rgba(151, 117, 250, 0.3);
  min-height: 2.5rem;
  line-height: 1.25;
}

.shop-item,
.upgrade-item,
.achievement-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 14px;
  background: white;
  border: 2px solid #eee;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  width: 100%;
  min-width: 100%;
  min-height: 4.75rem;
  box-sizing: border-box;
}

.shop-item:hover:not(.disabled),
.upgrade-item:hover:not(.disabled) {
  border-color: var(--rainbow-5);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(77, 171, 247, 0.2);
}

.shop-item:active:not(.disabled),
.upgrade-item:active:not(.disabled) {
  transform: scale(0.98);
}

.shop-item.disabled,
.upgrade-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shop-item.owned-pulse {
  animation: buyPulse 0.4s ease;
}

@keyframes buyPulse {
  0% { background: white; }
  50% { background: rgba(105, 219, 124, 0.3); }
  100% { background: white; }
}

.item-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.item-info {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.item-name {
  font-family: 'Fredoka', cursive, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-desc {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.35em;
  line-height: 1.18;
}

.item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  min-height: 1.15rem;
}

.item-owned {
  font-weight: 700;
  color: var(--rainbow-6);
}

.item-sps {
  font-weight: 600;
  color: var(--rainbow-5);
}

.sps-each {
  color: #888;
}

.sps-total {
  color: var(--rainbow-4);
  font-weight: 700;
}

.item-cost {
  font-family: 'Fredoka', cursive, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd43b, #ffa94d);
  color: #5c3d00;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 5.75rem;
  max-width: 5.75rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cost.affordable {
  animation: affordableGlow 1.5s ease infinite;
}

@keyframes affordableGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 212, 59, 0); }
  50% { box-shadow: 0 0 12px rgba(255, 212, 59, 0.6); }
}

.upgrade-item .item-cost {
  background: linear-gradient(135deg, var(--rainbow-5), var(--rainbow-6));
  color: white;
}

.upgrade-item.maxed {
  opacity: 0.7;
  cursor: default;
}

.upgrade-item.maxed .item-cost {
  background: #ccc;
  color: #666;
}

.achievement-item {
  cursor: default;
}

.achievement-item.unlocked {
  border-color: var(--rainbow-4);
  background: linear-gradient(135deg, rgba(105, 219, 124, 0.12), rgba(255, 255, 255, 1));
}

.achievement-item.locked {
  opacity: 0.85;
}

.ach-progress {
  margin-top: 0.35rem;
}

.ach-bar {
  height: 6px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.ach-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rainbow-4), var(--rainbow-5));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ach-progress-text {
  font-size: 0.7rem;
  color: #888;
  font-weight: 600;
}

.ach-reward {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--rainbow-6);
  margin-top: 0.15rem;
}

.ach-status {
  font-size: 1.25rem;
  flex: 0 0 2rem;
  min-width: 2rem;
  text-align: center;
}

.companion-shop-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 240, 250, 0.95));
  border: 2px solid #eee;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  width: 100%;
  min-width: 100%;
  min-height: 5.25rem;
  box-sizing: border-box;
}

.companion-shop-item:hover:not(.disabled) {
  border-color: var(--rainbow-1);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.25);
}

.companion-shop-item.disabled:not(.owned) {
  opacity: 0.55;
  cursor: not-allowed;
}

.companion-shop-item.owned {
  border-color: var(--rainbow-4);
  background: linear-gradient(135deg, rgba(105, 219, 124, 0.12), rgba(255, 255, 255, 1));
  cursor: default;
}

.companion-shop-item-ultra {
  border-color: rgba(151, 117, 250, 0.55);
  background: linear-gradient(135deg, rgba(255, 240, 250, 1), rgba(230, 245, 255, 0.95));
  box-shadow: 0 0 18px rgba(151, 117, 250, 0.2);
}

.companion-shop-item-ultra .companion-thumb {
  box-shadow:
    0 0 14px rgba(255, 107, 157, 0.65),
    0 0 24px rgba(77, 171, 247, 0.5);
}

.companion-shop-item-ultra.owned {
  border-color: rgba(77, 171, 247, 0.75);
  background: linear-gradient(135deg, rgba(173, 216, 255, 0.18), rgba(255, 240, 250, 1));
}

.companion-thumb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 0 12px rgba(151, 117, 250, 0.5);
}

.gallery-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.65rem;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.5rem;
  border-radius: 16px;
  background: white;
  border: 2px solid #eee;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  touch-action: manipulation;
}

.gallery-card:hover:not(.owned) {
  border-color: var(--rainbow-5);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(77, 171, 247, 0.2);
}

.gallery-card.affordable:not(.owned) {
  border-color: var(--rainbow-4);
  box-shadow: 0 0 12px rgba(105, 219, 124, 0.25);
}

.gallery-card.owned {
  border-color: var(--rainbow-6);
  background: linear-gradient(160deg, rgba(255, 240, 250, 1), rgba(230, 245, 255, 1));
  cursor: default;
}

.gallery-card-ultra {
  border-color: rgba(151, 117, 250, 0.5);
  background: linear-gradient(160deg, rgba(255, 248, 252, 1), rgba(225, 240, 255, 1));
}

.gallery-card-ultra .gallery-aura {
  background: radial-gradient(circle, rgba(173, 216, 255, 0.55) 0%, rgba(151, 117, 250, 0.35) 45%, transparent 72%);
}

.gallery-card-ultra.owned {
  border-color: rgba(77, 171, 247, 0.8);
  box-shadow: 0 0 16px rgba(151, 117, 250, 0.35);
}

.gallery-card.locked .gallery-img {
  filter: grayscale(0.35) brightness(0.85);
}

.gallery-portrait {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 0.4rem;
}

.gallery-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  position: relative;
  z-index: 1;
}

.gallery-aura {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 102, 0.5), rgba(151, 117, 250, 0.25), transparent 70%);
  animation: mythicAuraPulse 3s ease-in-out infinite;
  z-index: 0;
}

.gallery-card.owned .gallery-aura {
  opacity: 1;
}

.gallery-card.locked .gallery-aura {
  opacity: 0.35;
}

.gallery-name {
  font-family: 'Fredoka', cursive, sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  color: #333;
}

.gallery-bonus {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--rainbow-5);
  margin-top: 0.1rem;
}

.gallery-status {
  font-size: 0.68rem;
  font-weight: 600;
  color: #888;
  margin-top: 0.2rem;
}

.gallery-card.owned .gallery-status {
  color: var(--rainbow-6);
}

.gallery-card.affordable:not(.owned) .gallery-status {
  color: var(--rainbow-4);
}

.shop-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 2px dashed rgba(151, 117, 250, 0.2);
}

.save-btn,
.reset-btn {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 10px;
  font-family: 'Baloo 2', cursive, sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.save-btn {
  background: linear-gradient(135deg, var(--rainbow-4), #51cf66);
  color: white;
}

.reset-btn {
  background: #f1f3f5;
  color: #666;
}

.save-btn:active,
.reset-btn:active {
  transform: scale(0.95);
}

.save-btn.saved-flash {
  animation: savedFlash 0.5s ease;
}

@keyframes savedFlash {
  50% { background: #51cf66; transform: scale(1.05); }
}

/* Floating numbers */
.floating-numbers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.float-sparkle {
  position: absolute;
  font-family: 'Fredoka', cursive, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #ffd43b;
  text-shadow: 0 0 8px rgba(255, 212, 59, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.2);
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.3);
  }
}

/* Milestone celebration */
.milestone-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.milestone-overlay.show {
  opacity: 1;
}

.milestone-card {
  text-align: center;
  padding: 1.5rem 2rem;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 240, 250, 0.95));
  border: 4px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  animation: milestonePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.milestone-card::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-3), var(--rainbow-5), var(--rainbow-7));
  z-index: -1;
}

@keyframes milestonePop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.milestone-bark {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 700;
  color: var(--rainbow-6);
  margin-bottom: 0.5rem;
}

.milestone-msg {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 600;
  background: linear-gradient(90deg, var(--rainbow-1), var(--rainbow-4), var(--rainbow-6));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sparkle-explosion {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 250;
  overflow: hidden;
}

.explosion-sparkle {
  position: absolute;
  font-size: 1.25rem;
  animation: explodeOut 1.2s ease-out forwards;
}

@keyframes explodeOut {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--ex), var(--ey)) scale(0.2) rotate(720deg);
  }
}

.confetti-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 260;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  animation: confettiFall linear forwards;
  opacity: 0.95;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(110vh) translateX(var(--cf-drift)) rotate(var(--cf-spin));
  }
}

.game-toast {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 400;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rainbow-5), var(--rainbow-6));
  color: white;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.game-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Funny random events */
.event-popup {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 450;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: min(92vw, 360px);
}

.event-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.event-card {
  text-align: center;
  padding: 1rem 1.25rem 1.1rem;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 252, 0.98));
  border: 4px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
  position: relative;
  animation: eventWiggle 0.5s ease;
}

.event-card::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-3), var(--rainbow-5), var(--rainbow-7));
  z-index: -1;
}

@keyframes eventWiggle {
  0% { transform: scale(0.7) rotate(-4deg); }
  60% { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.event-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  animation: eventBounce 0.6s ease infinite alternate;
}

@keyframes eventBounce {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-6px) scale(1.08); }
}

.event-title {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rainbow-6);
  margin-bottom: 0.25rem;
}

.event-message {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

.event-reward {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  display: inline-block;
  background: linear-gradient(135deg, #ffd43b, #ffa94d);
  color: #5c3d00;
  box-shadow: 0 3px 12px rgba(255, 163, 77, 0.45);
}

/* Footer */
.footer {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.75rem;
  color: #eee;
  background: rgba(20, 15, 40, 0.55);
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn-donate {
  display: inline-block;
  margin: 0.5rem 0 0.65rem;
  padding: 0.55rem 1.35rem;
  border: none;
  border-radius: 999px;
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #3f2a00;
  background: linear-gradient(90deg, #ffd700, #ffb800);
  box-shadow: 0 6px 18px rgba(255, 215, 0, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-donate:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 26px rgba(255, 200, 0, 0.55);
}

.btn-donate:active {
  transform: scale(0.98);
}

.now-playing {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.45rem;
  opacity: 0.95;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.now-playing.muted {
  opacity: 0.65;
  font-style: italic;
}

.audio-controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.audio-toggle {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #eee;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.audio-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.audio-toggle.active {
  background: linear-gradient(135deg, rgba(77, 171, 247, 0.55), rgba(151, 117, 250, 0.55));
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  box-shadow: 0 2px 10px rgba(77, 171, 247, 0.35);
}

/* Mobile layout */
@media (max-width: 768px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: auto;
  }

  .click-zone {
    padding: 0.5rem;
    order: 1;
    min-height: clamp(360px, 95vw, 500px);
  }

  .companion-visuals {
    top: 5rem;
    bottom: 2.25rem;
  }

  .dog-scene {
    width: min(68%, 340px);
    min-height: clamp(260px, 62vw, 380px);
  }

  .dog-image {
    width: clamp(220px, 56vw, 340px);
  }

  .mythic-companion-img {
    width: clamp(52px, 12vw, 82px);
    height: clamp(52px, 12vw, 82px);
  }

  .mythic-companion-ultra .mythic-companion-img {
    width: clamp(60px, 14vw, 96px);
    height: clamp(60px, 14vw, 96px);
  }

  .visual-houses {
    left: 0;
    bottom: 5%;
  }

  .shop-panel {
    order: 2;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: none;
    margin-bottom: 1rem;
  }

  .header {
    position: relative;
  }

  .game-bg {
    background-attachment: scroll;
  }
}

@media (max-width: 380px) {
  .shop-item,
  .upgrade-item,
  .achievement-item {
    flex-wrap: wrap;
  }

  .action-row {
    flex-direction: column;
  }

  .daily-btn,
  .rebirth-btn {
    width: 100%;
  }

  .item-cost {
    min-width: 5.25rem;
    max-width: 5.25rem;
    text-align: center;
  }

  .per-second {
    min-width: 12rem;
  }

  .rebirth-stat,
  .achieve-stat {
    min-width: 7rem;
  }
}

/* v2.9: Translation layout stability */
body.translate-settling .game-layout,
body.translate-settling .shop-panel,
body.translate-settling .stats-bar,
body.translate-settling .click-zone {
  transition: none !important;
}

body.translate-settling .shop-item,
body.translate-settling .upgrade-item,
body.translate-settling .companion-shop-item,
body.translate-settling .achievement-item,
body.translate-settling .tab-btn,
body.translate-settling .per-second,
body.translate-settling .multiplier-display,
body.translate-settling .click-power {
  transition: none !important;
  animation: none !important;
}

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