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

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  text-align: center;
  background-image: url('Assets/backgrounds/journee_ensoleillee.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  cursor: url('Assets/curseurs/curseur_32.png') 0 0, auto;
}

#app {
  transform: scale(var(--ui-scale, 1));
  transform-origin: top left;
  width: calc(100% / var(--ui-scale, 1));
  height: calc(100% / var(--ui-scale, 1));
}

#top-bar {
  margin: 10px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 30;
  width: min(620px, calc(100vw - 24px));
}

#menu-toggle {
  min-width: 112px;
  height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 10px;
  position: relative;
}

#menu-toggle.quest-ready::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 7px;
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: #238a4f;
  box-shadow: 0 0 0 3px rgba(35, 138, 79, 0.22);
}

#menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(560px, calc(100vw - 28px));
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 240, 245, 0.94);
  border: 1px solid rgba(76, 45, 32, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
  font-family: inherit;
  font-size: 0.95rem;
}

#menu-panel.open {
  display: grid;
}

#menu-panel button,
#menu-panel .menu-link,
#menu-panel select {
  min-height: 40px;
  width: 100%;
  font: inherit;
  line-height: 1.2;
  border-radius: 9px;
}

#menu-panel .menu-link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 10px;
  border: 2px solid #4d3027;
  background: #ffffff;
  color: #2f241f;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(47, 36, 31, 0.28);
}

#menu-panel .menu-link:hover,
#menu-panel .menu-link:focus-visible {
  background: #fff7cc;
}

#placement-toggle.active {
  background: #ffe58a;
  border-color: #2f2a25;
  box-shadow: inset 0 0 0 2px rgba(47, 42, 37, 0.16), 0 3px 0 rgba(47, 42, 37, 0.35);
}

#placement-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  z-index: 34;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 9px 10px 9px 14px;
  border: 1px solid rgba(47, 42, 37, 0.24);
  border-radius: 999px;
  background: rgba(255, 245, 184, 0.96);
  color: #3d2a1d;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  font-size: 0.92rem;
  transform: translateX(-50%);
}

#placement-banner[hidden] {
  display: none;
}

#placement-banner-title {
  white-space: nowrap;
}

#placement-banner-done {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(47, 42, 37, 0.25);
  border-radius: 999px;
  background: #ffffff;
  color: #3d2a1d;
  font: inherit;
  font-weight: 800;
}

#placement-storage {
  position: fixed;
  top: 118px;
  left: 50%;
  z-index: 33;
  width: min(360px, calc(100vw - 24px));
  transform: translateX(-50%);
  text-align: left;
}

#placement-storage[hidden] {
  display: none;
}

#placement-storage-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(47, 42, 37, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #3d2a1d;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  font: inherit;
  font-weight: 800;
}

#placement-storage-count {
  min-width: 28px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #238a4f;
  color: #fff;
  text-align: center;
  font-size: 0.78rem;
}

#placement-storage-panel {
  max-height: min(320px, calc(100vh - 180px));
  margin-top: 7px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(47, 42, 37, 0.18);
  border-radius: 12px;
  background: rgba(255, 250, 245, 0.96);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.placement-storage-empty {
  margin: 4px;
  color: #6c5142;
  font-weight: 700;
  text-align: center;
}

.placement-storage-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
}

.placement-storage-item + .placement-storage-item {
  margin-top: 6px;
}

.placement-storage-image {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.placement-storage-details {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.placement-storage-details strong,
.placement-storage-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placement-storage-details span {
  color: #6c5142;
  font-size: 0.78rem;
  font-weight: 700;
}

.placement-storage-place {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(35, 138, 79, 0.42);
  border-radius: 9px;
  background: rgba(218, 250, 226, 0.95);
  color: #185c36;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.menu-background-control {
  grid-column: span 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid rgba(120, 72, 43, 0.22);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
  color: #4c2d20;
  font-size: 0.85rem;
  font-weight: 800;
}

#menu-panel .menu-background-control select {
  min-height: 32px;
}

#quests-toggle {
  position: relative;
}

#quests-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 24px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #7b634f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
}

#quests-badge.ready {
  background: #238a4f;
}

#room-switch {
  position: fixed;
  top: 50%;
  right: 16px;
  z-index: 24;
  display: none;
  align-items: center;
  gap: 7px;
  min-width: 92px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(76, 45, 32, 0.22);
  border-radius: 999px;
  background: rgba(255, 240, 245, 0.88);
  color: #4c2d20;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  font-weight: 800;
  transform: translateY(-50%);
}

#room-switch.visible {
  display: inline-flex;
}

#bowl-routine-claim {
  position: fixed;
  top: 170px;
  left: 50%;
  z-index: 32;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(80, 56, 35, 0.24);
  border-radius: 999px;
  background: rgba(255, 248, 220, 0.96);
  color: #4b2d18;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  font: inherit;
  font-weight: 800;
  transform: translateX(-50%);
}

#bowl-routine-claim[hidden] {
  display: none;
}

#bowl-routine-amount {
  padding: 4px 9px;
  border-radius: 999px;
  background: #238a4f;
  color: #fff;
  font-size: 0.88rem;
}

#room-switch-arrow {
  font-size: 1.35rem;
  line-height: 1;
}

#room-switch-label {
  font-size: 0.85rem;
  line-height: 1;
}

#cat-stories-link,
#language-toggle {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  font-size: 1.25rem;
  border-radius: 10px;
}

#language-toggle,
#welcome-language-toggle {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
}

.language-flag {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1;
}

.language-code {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

#ronron-counter {
font-size: 1.5em;
margin: 20px;
background-color: rgba(0, 0, 0, 0.28);
padding: 10px 20px;
display: inline-block;
min-width: min(360px, calc(100vw - 40px));
box-sizing: border-box;
border-radius: 12px;
color: #fff;
border: 2px solid rgba(0, 0, 0, 0.6);
}

#ronron-counter.counter-gain-pulse {
animation: counterGainPulse 0.48s cubic-bezier(0.2, 0.85, 0.25, 1);
}

@keyframes counterGainPulse {
0% { transform: scale(1); }
42% { transform: scale(1.035); box-shadow: 0 0 0 5px rgba(255, 231, 163, 0.18); }
100% { transform: scale(1); box-shadow: none; }
}

#next-objective {
  margin-top: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffe7a3;
}

#next-objective.ready {
  color: #9df0b4;
}

#game-container {
display: flex;
justify-content: center;
align-items: flex-start;
gap: 40px;
margin-top: 30px;
}

#shop-panel {
position: fixed;
top: 16px;
right: 16px;
width: 96px;
background-color: rgba(255, 240, 245, 0.0);
padding: 0;
border-radius: 12px;
box-shadow: none;
text-align: right;
z-index: 40;
}

#shop-panel-toggle {
width: 96px;
height: 96px;
padding: 0;
border-radius: 14px;
background: transparent;
border: 2px solid rgba(0, 0, 0, 0.2);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: visible;
}

#shop-panel-toggle img {
width: 100%;
height: 100%;
object-fit: contain;
}

#shop-panel.dragging #shop-panel-toggle {
  cursor: grabbing;
}

#shop-panel-content {
display: none;
position: absolute;
top: 108px;
right: 0;
width: min(360px, calc(100vw - 32px));
max-height: calc(100vh - 140px);
overflow-y: auto;
text-align: left;
}

#shop-panel-content.open {
display: block;
}

#shop-section,
#decor-shop-section {
background: rgba(255, 240, 245, 0.85);
padding: 12px;
border-radius: 8px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
margin-bottom: 12px;
border: 1px solid rgba(120, 72, 43, 0.2);
border-left: 5px solid var(--section-accent, #f0a33a);
}

#shop-section {
--section-accent: #2f8d6b;
}

#decor-shop-section {
--section-accent: #c47a2c;
}

#shop-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 240, 245, 0.78);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.shop-tab {
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(120, 72, 43, 0.22);
  background: rgba(255, 255, 255, 0.62);
  font-weight: 700;
}

.shop-tab.active {
  background: #fff;
  box-shadow: inset 0 -3px 0 rgba(240, 163, 58, 0.85);
}

#shop-section h2,
#decor-shop-section h2 {
margin: 8px 0 8px;
text-align: center;
font-size: 1.05rem;
}

#shop-content button,
#decor-shop-content button {
width: 100%;
margin: 10px 0;
}

#decor-delete-mode {
width: 100%;
margin: 0 0 8px;
background: rgba(255, 255, 255, 0.72);
border: 1px solid rgba(120, 72, 43, 0.28);
color: #4e2d1b;
font-weight: 800;
}

#decor-delete-mode.active {
background: rgba(210, 42, 42, 0.95);
color: #fff;
}

#second-cat-shop-controls {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(120, 72, 43, 0.2);
  text-align: left;
}

#second-cat-shop-controls label {
  display: block;
  margin: 6px 0;
}

#second-cat-shop-controls select {
  width: 100%;
  margin-top: 4px;
}

.core-shop-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid rgba(120, 72, 43, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.core-shop-card.purchase-pulse,
.decor-catalog-card.purchase-pulse {
  animation: purchasePulse 0.62s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.core-shop-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 36px;
}

.core-shop-text {
  display: inline-block;
}

.core-shop-body {
  flex: 1;
  min-width: 0;
}

.core-shop-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

#shop-content .core-shop-actions button {
  width: auto;
  flex: 1;
  margin: 0;
  padding: 6px 8px;
  opacity: 1;
  filter: none;
  pointer-events: auto;
}

.core-buy-btn.unaffordable {
  opacity: 0.72;
  filter: grayscale(0.2);
}

.decor-empty {
  margin: 8px 0;
  text-align: center;
  font-size: 0.95rem;
}

.decor-category-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.decor-category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 118px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  padding: 10px;
}

.decor-category-preview {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.decor-category-label {
  font-weight: 700;
  font-size: 0.92rem;
}

.decor-catalog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.decor-catalog-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.decor-catalog-title {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
}

.decor-catalog-effect {
  margin: 3px 0 0;
  color: rgba(63, 42, 30, 0.78);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
}

.decor-catalog-progress {
  margin: 4px 0 0;
  color: #21623d;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.25;
}

.decor-catalog-sortbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.decor-catalog-sortlabel {
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(63, 42, 30, 0.88);
}

.decor-catalog-sort {
  flex: 1;
}

.decor-catalog-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.decor-catalog-filter {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(120, 72, 43, 0.22);
  background: rgba(255, 255, 255, 0.82);
  color: #3f2a1e;
  font-size: 0.82rem;
  font-weight: 700;
}

.decor-back-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 6px 10px;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.decor-catalog-group {
  margin-top: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.28);
}

.decor-catalog-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.decor-catalog-group-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
}

.decor-catalog-group-count {
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(63, 42, 30, 0.7);
}

.decor-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.decor-catalog-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 10px;
  transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.decor-catalog-card.owned {
  opacity: 0.72;
  filter: saturate(0.72);
}

.decor-catalog-card.owned:hover,
.decor-catalog-card.owned:focus-within {
  opacity: 1;
  filter: none;
}

.decor-collection-card {
  border-color: rgba(145, 91, 24, 0.32);
  background: linear-gradient(180deg, rgba(255, 250, 236, 0.96), rgba(252, 239, 207, 0.84));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.decor-collection-card .decor-catalog-label {
  color: #7c4b10;
}

.decor-catalog-image {
  width: 100%;
  max-height: 92px;
  object-fit: contain;
  display: block;
}

.decor-catalog-label {
  margin: 8px 0 4px;
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.2;
}

.decor-catalog-bonus {
  margin: 0 0 8px;
  color: #5e3d2c;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0.88;
}

.decor-catalog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

.decor-catalog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 100%;
}

.decor-catalog-owned {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.8;
}

.decor-buy-btn {
  width: 100% !important;
  margin: 0 !important;
  padding: 6px 10px;
  font-size: 0.76rem;
  opacity: 1;
  filter: none;
  pointer-events: auto;
}

.decor-place-btn {
  width: 100% !important;
  margin: 0 !important;
  padding: 6px 8px;
  border-color: rgba(35, 138, 79, 0.42);
  background: rgba(218, 250, 226, 0.92);
  color: #185c36;
  font-size: 0.76rem;
  font-weight: 800;
}

.decor-place-btn:disabled {
  opacity: 0.42;
}

.decor-buy-btn.unaffordable {
  opacity: 0.72;
  filter: grayscale(0.2);
}

button,
select,
input {
  cursor: url('Assets/curseurs/curseur_32.png') 0 0, pointer;
}

#decor-layer {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 1;
}

#fireplace-fire {
  --fireplace-x: 23%;
  --fireplace-y: 55%;
  --fireplace-scale: 1.5;
  position: fixed;
  left: var(--fireplace-x);
  top: var(--fireplace-y);
  width: calc(78px * var(--fireplace-scale));
  height: calc(88px * var(--fireplace-scale));
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-40deg);
  transform-origin: center bottom;
  transition: opacity 0.25s ease;
  z-index: 0;
}

body.fireplace-visible #fireplace-fire {
  opacity: 1;
}

body.fireplace-wide-living #fireplace-fire {
  --fireplace-x: 24%;
  --fireplace-y: 52%;
  --fireplace-scale: 1.2;
}

.fireplace-glow,
.fireplace-flame,
.fireplace-ember {
  position: absolute;
  pointer-events: none;
}

.fireplace-glow {
  left: 50%;
  bottom: 2%;
  width: 150%;
  height: 95%;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 194, 76, 0.48), rgba(255, 93, 31, 0.2) 42%, rgba(255, 93, 31, 0) 72%);
  filter: blur(6px);
  transform: translateX(-50%);
  animation: fireplaceGlow 2.4s ease-in-out infinite;
}

.fireplace-flame {
  left: 50%;
  bottom: 10%;
  border-radius: 48% 52% 45% 55% / 62% 62% 38% 38%;
  filter: drop-shadow(0 0 7px rgba(255, 107, 35, 0.72));
  transform: translateX(-50%) rotate(45deg);
  transform-origin: center bottom;
  mix-blend-mode: screen;
}

.fireplace-flame-back {
  width: 58%;
  height: 70%;
  background: linear-gradient(135deg, #9b2414 0%, #f05a24 42%, #ffb347 100%);
  animation: fireplaceFlickerBack 1.45s ease-in-out infinite;
}

.fireplace-flame-mid {
  width: 42%;
  height: 58%;
  bottom: 13%;
  background: linear-gradient(135deg, #ff6a00 0%, #ffc247 50%, #fff0a8 100%);
  animation: fireplaceFlickerMid 1.05s ease-in-out infinite;
}

.fireplace-flame-front {
  width: 24%;
  height: 40%;
  bottom: 16%;
  background: linear-gradient(135deg, #ffd35c 0%, #fff2aa 64%, #ffffff 100%);
  filter: blur(0.2px) drop-shadow(0 0 6px rgba(255, 224, 120, 0.8));
  animation: fireplaceFlickerFront 0.82s ease-in-out infinite;
}

.fireplace-ember {
  left: 50%;
  bottom: 20%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 8px rgba(255, 151, 52, 0.8);
  opacity: 0;
}

.fireplace-ember-one {
  animation: fireplaceEmber 2.8s ease-in-out infinite;
}

.fireplace-ember-two {
  animation: fireplaceEmber 3.4s 0.7s ease-in-out infinite;
}

.fireplace-ember-three {
  animation: fireplaceEmber 3s 1.3s ease-in-out infinite;
}

body.reduced-motion #fireplace-fire * {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #fireplace-fire * {
    animation: none !important;
  }
}

body.reduced-motion.fireplace-visible #fireplace-fire {
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  body.fireplace-visible #fireplace-fire {
    opacity: 0.55;
  }
}

@keyframes fireplaceGlow {
  0%, 100% { opacity: 0.58; transform: translateX(-50%) scale(0.94); }
  50% { opacity: 0.86; transform: translateX(-50%) scale(1.04); }
}

@keyframes fireplaceFlickerBack {
  0%, 100% { transform: translateX(-51%) rotate(42deg) scale(0.95, 1); opacity: 0.82; }
  35% { transform: translateX(-46%) rotate(48deg) scale(1.08, 0.94); opacity: 0.94; }
  70% { transform: translateX(-54%) rotate(39deg) scale(0.98, 1.08); opacity: 0.76; }
}

@keyframes fireplaceFlickerMid {
  0%, 100% { transform: translateX(-50%) rotate(45deg) scale(1, 1); opacity: 0.9; }
  45% { transform: translateX(-44%) rotate(52deg) scale(0.9, 1.14); opacity: 1; }
  75% { transform: translateX(-56%) rotate(40deg) scale(1.08, 0.92); opacity: 0.82; }
}

@keyframes fireplaceFlickerFront {
  0%, 100% { transform: translateX(-50%) rotate(45deg) scale(0.86, 1.02); opacity: 0.9; }
  50% { transform: translateX(-47%) rotate(50deg) scale(1.08, 0.88); opacity: 1; }
}

@keyframes fireplaceEmber {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.7); }
  18% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(calc(-50% + 18px), -54px) scale(0.2); }
}

#laser-game-hud {
  position: fixed;
  left: 50%;
  bottom: 24px;
  min-width: 260px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(20, 20, 20, 0.86);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
}

#catnip-frenzy-hud {
  position: fixed;
  top: 18px;
  left: 50%;
  width: min(440px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 2px solid rgba(178, 255, 132, 0.72);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(23, 70, 38, 0.94), rgba(45, 105, 47, 0.92));
  color: #fff;
  box-shadow: 0 8px 28px rgba(17, 74, 31, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 75;
}

#catnip-frenzy-hud.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.catnip-frenzy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#catnip-frenzy-title {
  font-size: 1rem;
}

#catnip-frenzy-time {
  color: #dcffb9;
  font-size: 1.1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.catnip-frenzy-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

#catnip-frenzy-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9bea63, #e4ff82);
  box-shadow: 0 0 14px rgba(203, 255, 119, 0.72);
  transform-origin: left center;
}

.catnip-frenzy-charge-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

#catnip-frenzy-charge-label {
  color: #eaffcf;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.catnip-frenzy-charge-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

#catnip-frenzy-charge-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f8ffe0, #ffdd63, #ff9f43);
  box-shadow: 0 0 16px rgba(255, 213, 91, 0.75);
  transform: scaleX(0);
  transform-origin: left center;
}

#catnip-frenzy-hud.charge-bonus #catnip-frenzy-charge-fill {
  animation: catnip-charge-flash 0.34s ease;
}

@keyframes catnip-charge-flash {
  0%, 100% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.9);
  }
}

#catnip-frenzy-details {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
}

body.catnip-frenzy-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      115deg,
      rgba(184, 255, 112, 0.08) 0 8px,
      rgba(255, 255, 255, 0) 8px 20px
    );
  mix-blend-mode: screen;
  animation: catnipScreenSweep 1.35s linear infinite;
}

body.catnip-frenzy-mode #game-container {
  filter: saturate(1.2) contrast(1.04);
}

body.catnip-frenzy-mode #second-pet-zone.visible,
body.catnip-frenzy-mode #third-pet-zone.visible {
  animation: catnipSideCatFrenzy 0.58s ease-in-out infinite;
}

body.catnip-frenzy-mode #catnip-frenzy-hud.active {
  animation: catnipHudPulse 0.72s ease-in-out infinite;
}

body.catnip-frenzy-mode .pop.caresse-pop {
  color: #ffef7a;
  font-size: 34px;
  text-shadow: 0 2px 0 rgba(55, 76, 12, 0.62), 0 0 18px rgba(181, 255, 93, 0.95);
  animation-duration: 0.95s;
}

body.catnip-frenzy-burst #game-container {
  filter: saturate(1.28) contrast(1.08) brightness(1.04);
}

.particle.catnip-particle {
  color: #d8ff79;
  font-size: 25px;
  text-shadow: 0 0 12px rgba(183, 255, 92, 0.9);
  animation: catnipParticleBurst 1.15s cubic-bezier(0.14, 0.72, 0.24, 1) forwards;
}

@keyframes catnipScreenSweep {
  0% {
    background-position: 0 0;
    opacity: 0.45;
  }
  50% {
    opacity: 0.72;
  }
  100% {
    background-position: 78px 0;
    opacity: 0.45;
  }
}

@keyframes catnipRoomWobble {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(0.25deg) scale(1.006);
  }
  75% {
    transform: rotate(-0.25deg) scale(1.006);
  }
}

@keyframes catnipPetZoneFrenzy {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
}

@keyframes catnipSideCatFrenzy {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}

@keyframes catnipHudPulse {
  0%, 100% {
    box-shadow: 0 8px 28px rgba(17, 74, 31, 0.42);
  }
  50% {
    box-shadow: 0 10px 36px rgba(180, 255, 97, 0.7);
  }
}

@keyframes catnipBonusKick {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.025) rotate(-0.45deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes catnipParticleBurst {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.62) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--catnip-x), var(--catnip-y)) scale(1.18) rotate(var(--catnip-rotate));
  }
}

#laser-game-overlay {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  z-index: 78;
}

#laser-game-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#laser-game-countdown {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(8, 5, 18, 0.88);
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.08);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

#laser-game-countdown.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.laser-game-countdown-title {
  font-size: clamp(2.2rem, 8vw, 5rem);
  font-weight: 900;
  text-shadow: 0 0 24px rgba(255, 37, 37, 0.7);
}

.laser-game-countdown-number {
  min-width: 1.4em;
  font-size: clamp(7rem, 30vw, 18rem);
  font-weight: 900;
  line-height: 0.9;
  color: #ff2525;
  text-shadow: 0 0 18px #ff2525, 0 0 50px rgba(255, 37, 37, 0.85);
}

.laser-game-countdown-hint {
  font-size: clamp(1.1rem, 4vw, 2rem);
  font-weight: 700;
}

#laser-game-hud.active {
  opacity: 1;
}

.laser-game-difficulty {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.laser-game-difficulty[hidden] {
  display: none;
}

.laser-game-difficulty button {
  min-height: 84px;
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 0 22px rgba(255, 37, 37, 0.18);
}

.laser-game-difficulty strong,
.laser-game-difficulty span {
  display: block;
}

.laser-game-difficulty strong {
  margin-bottom: 5px;
  font-size: 1rem;
}

.laser-game-difficulty span {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
}

@media (max-width: 560px) {
  .laser-game-difficulty {
    grid-template-columns: 1fr;
  }

  .laser-game-difficulty button {
    min-height: 68px;
  }
}

.laser-combo-track {
  display: block;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.laser-combo-track span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: #ffdf45;
  transition: transform 0.12s ease;
}

.laser-milestone-pop {
  position: absolute;
  left: 50%;
  bottom: 100%;
  color: #ffdf45;
  font-size: 1.25rem;
  font-weight: 900;
  text-shadow: 0 0 14px rgba(255, 223, 69, 0.8);
  transform: translateX(-50%);
  animation: laserMilestonePop 0.78s ease forwards;
  pointer-events: none;
}

.laser-milestone-pop.bad {
  color: #ff5a5a;
  text-shadow: 0 0 14px rgba(255, 90, 90, 0.8);
}

#laser-target {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 7px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: #ff2525;
  box-shadow: 0 0 8px #ff2525, 0 0 22px #ff2525;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  z-index: 79;
}

#laser-target.laser-target-gold {
  background: #ffdf45;
  box-shadow: 0 0 10px #ffdf45, 0 0 30px rgba(255, 223, 69, 0.95);
}

#laser-target.laser-target-blue {
  background: #33c7ff;
  box-shadow: 0 0 10px #33c7ff, 0 0 30px rgba(51, 199, 255, 0.95);
}

#laser-target.laser-target-trap {
  background: #29222f;
  border-color: rgba(255, 90, 90, 0.86);
  box-shadow: 0 0 10px #ff5a5a, 0 0 28px rgba(255, 90, 90, 0.72);
}

#laser-target.active {
  opacity: 1;
  pointer-events: auto;
  animation: laserTargetPulse 0.65s ease-in-out infinite alternate;
}

#bell-simon-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 13, 24, 0.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 101;
}

#bell-simon-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.bell-simon-panel {
  width: min(520px, 100%);
  padding: 18px;
  border: 2px solid rgba(255, 241, 190, 0.56);
  border-radius: 8px;
  background: rgba(255, 248, 221, 0.96);
  color: #2f241f;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

.bell-simon-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#bell-simon-title {
  display: block;
  font-size: 1.35rem;
}

#bell-simon-hud,
#bell-simon-message {
  font-weight: 800;
}

#bell-simon-hud {
  margin-top: 4px;
  color: #6f4f1c;
  font-size: 0.92rem;
}

#bell-simon-message {
  min-height: 26px;
  margin-bottom: 14px;
  color: #344d3a;
  text-align: center;
}

.bell-simon-difficulty {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.bell-simon-difficulty[hidden] {
  display: none;
}

.bell-simon-difficulty button {
  min-height: 82px;
  padding: 10px;
  border: 2px solid rgba(47, 36, 31, 0.26);
  border-radius: 8px;
  background: #fff;
  color: #2f241f;
  box-shadow: 0 3px 0 rgba(47, 36, 31, 0.18);
}

.bell-simon-difficulty strong,
.bell-simon-difficulty span {
  display: block;
}

.bell-simon-difficulty strong {
  margin-bottom: 5px;
  font-size: 1rem;
}

.bell-simon-difficulty span {
  color: #6f4f1c;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
}

#bell-simon-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid rgba(47, 36, 31, 0.42);
  border-radius: 8px;
  background: #fff;
  color: #2f241f;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.bell-simon-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bell-simon-pad {
  min-height: 128px;
  padding: 14px;
  border: 3px solid rgba(47, 36, 31, 0.24);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 -5px 0 rgba(47, 36, 31, 0.12), 0 6px 0 rgba(47, 36, 31, 0.2);
  transition: filter 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.bell-simon-pad img {
  width: min(82px, 58%);
  aspect-ratio: 1;
  object-fit: contain;
  pointer-events: none;
  transform-origin: 50% 14%;
}

.bell-simon-pad-gold {
  background: #fff2b7;
}

.bell-simon-pad-blue {
  background: #cdefff;
}

.bell-simon-pad-pink {
  background: #ffd8ea;
}

.bell-simon-pad-green {
  background: #cdeecd;
}

.bell-simon-pad.active {
  filter: brightness(1.24) saturate(1.32);
  transform: translateY(4px) scale(1.03);
  box-shadow: inset 0 -2px 0 rgba(47, 36, 31, 0.1), 0 0 22px rgba(255, 207, 68, 0.88);
}

.bell-simon-pad.bell-wiggle img {
  animation: bellSimonWiggle 0.34s ease-in-out;
}

.bell-simon-pad.wrong {
  filter: saturate(1.4);
  transform: translateY(4px) scale(0.98);
  box-shadow: inset 0 -2px 0 rgba(47, 36, 31, 0.1), 0 0 26px rgba(217, 55, 55, 0.86);
}

@media (max-width: 560px) {
  .bell-simon-difficulty {
    grid-template-columns: 1fr;
  }

  .bell-simon-pad {
    min-height: 104px;
  }
}

.decor-delete-zone {
position: fixed;
top: 16px;
right: 16px;
width: 48px;
height: 48px;
border-radius: 12px;
background: rgba(0, 0, 0, 0.6);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
font-weight: bold;
opacity: 0;
transform: scale(0.9);
transition: opacity 0.15s ease, transform 0.15s ease;
pointer-events: none;
z-index: 3;
}

.decor-delete-zone.active {
opacity: 1;
transform: scale(1);
pointer-events: auto;
}

.decor-delete-zone.over {
background: rgba(220, 60, 60, 0.9);
transform: scale(1.05);
}

.decor-item {
position: fixed;
left: 0;
top: 0;
width: 160px;
transform-origin: center bottom;
cursor: url('Assets/curseurs/curseur_32.png') 0 0, grab;
user-select: none;
touch-action: none;
pointer-events: auto;
overflow: visible;
}

.decor-item.dragging {
cursor: grabbing;
}

.decor-item-image {
display: block;
width: 100%;
height: auto;
}

.decor-item-delete {
position: absolute;
top: -10px;
right: -10px;
width: 30px;
height: 30px;
border: none;
border-radius: 999px;
background: rgba(210, 42, 42, 0.95);
color: #fff;
font-size: 16px;
font-weight: bold;
display: none;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
z-index: 2;
}

.decor-item-rotate {
position: absolute;
top: -42px;
left: 50%;
width: 30px;
height: 30px;
transform: translateX(-50%);
border: none;
border-radius: 999px;
background: rgba(61, 111, 174, 0.95);
color: #fff;
font-size: 21px;
font-weight: bold;
display: none;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
cursor: grab;
touch-action: none;
z-index: 2;
}

.decor-item-resize {
position: absolute;
right: -14px;
bottom: -14px;
width: 32px;
height: 32px;
padding: 0;
border: 2px solid #fff;
border-radius: 999px;
background: rgba(190, 115, 42, 0.96);
color: #fff;
font-size: 18px;
font-weight: bold;
display: none;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
cursor: nwse-resize;
touch-action: none;
z-index: 3;
}

.decor-layer-controls {
position: absolute;
left: 50%;
bottom: -38px;
display: none;
grid-template-columns: repeat(4, 28px);
gap: 4px;
transform: translateX(-50%);
z-index: 4;
}

.decor-layer-btn {
width: 28px;
height: 28px;
padding: 0;
border: 2px solid #fff;
border-radius: 999px;
background: rgba(47, 42, 37, 0.92);
color: #fff;
font-size: 15px;
font-weight: 800;
line-height: 1;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.decor-item.selected .decor-item-rotate {
display: inline-flex;
}

.decor-item.selected .decor-item-resize {
display: inline-flex;
}

.decor-item.selected .decor-layer-controls {
display: grid;
}

body.placement-mode .decor-item .decor-item-rotate,
body.placement-mode .decor-item .decor-item-resize {
display: inline-flex;
}

body.placement-mode .decor-item .decor-layer-controls {
display: grid;
}

.decor-item-rotate::after {
content: "";
position: absolute;
left: 50%;
top: 100%;
width: 2px;
height: 14px;
background: rgba(61, 111, 174, 0.95);
transform: translateX(-50%);
}

.decor-item.rotating .decor-item-rotate {
cursor: grabbing;
}

.decor-item.resizing .decor-item-resize {
background: rgba(225, 139, 52, 1);
}

.decor-item.dragging .decor-item-rotate,
.decor-item.confirm-delete .decor-item-rotate,
body.decor-delete-mode-active .decor-item .decor-item-rotate {
display: none;
}

.decor-item.dragging .decor-item-resize,
.decor-item.confirm-delete .decor-item-resize,
body.decor-delete-mode-active .decor-item .decor-item-resize {
display: none;
}

.decor-item.dragging .decor-layer-controls,
.decor-item.confirm-delete .decor-layer-controls,
body.decor-delete-mode-active .decor-item .decor-layer-controls {
display: none;
}

body.placement-mode #pet-zone,
body.placement-mode #second-pet-zone,
body.placement-mode #third-pet-zone,
body.placement-mode .decor-item {
cursor: move;
}

@media (max-width: 520px) {
  #placement-banner {
    top: 64px;
    width: calc(100vw - 24px);
    justify-content: space-between;
    border-radius: 12px;
  }

  #placement-banner-title {
    white-space: normal;
  }

  #placement-storage {
    top: 114px;
  }

  .placement-storage-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .placement-storage-image {
    width: 38px;
    height: 38px;
  }

  .placement-storage-place {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.decor-item.confirm-delete .decor-item-image {
filter: grayscale(1) brightness(0.7);
}

.decor-item.confirm-delete .decor-item-delete {
display: inline-flex;
animation: decorDeleteBadgePop 0.2s ease-out;
}

body.decor-delete-mode-active .decor-item {
cursor: url('Assets/curseurs/curseur_32.png') 0 0, not-allowed;
}

body.decor-delete-mode-active .decor-item .decor-item-image {
filter: grayscale(0.8) brightness(0.82);
}

body.decor-delete-mode-active .decor-item .decor-item-delete {
display: inline-flex;
}

.decor-item.removing {
  animation: decorRemove 0.25s ease forwards;
}

.decor-item.decor-bell-ring .decor-item-image {
  animation: decorBellRing 0.55s ease-in-out;
  transform-origin: center top;
}

.scratcher-particle {
  position: fixed;
  width: 7px;
  height: 14px;
  border-radius: 2px;
  background: #d7b47b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 20;
  animation: scratcherParticle 0.75s ease-out forwards;
}

.painting-inspection {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  background: rgba(20, 18, 16, 0.88);
  cursor: zoom-out;
  z-index: 100;
}

.painting-inspection img {
  max-width: min(88vw, 900px);
  max-height: 78vh;
  object-fit: contain;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.painting-inspection-label {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.decor-delete-zone.pulse {
  animation: decorDeletePulse 0.35s ease;
}

#main-cat {
  --cat-size-scale: 1;
  width: calc(60vw * var(--cat-size-scale));
  max-width: calc(280px * var(--cat-size-scale));
  height: auto;
  border-radius: 12px;
  cursor: url('Assets/curseurs/curseur_32.png') 0 0, pointer;
  transition: transform 0.1s ease;
  transform-origin: center bottom;
}

#main-cat:not(.sprite) {
  animation: catIdleBreath 4.8s ease-in-out infinite;
}

body.catnip-frenzy-mode #main-cat:not(.sprite) {
  animation: catnipPetZoneFrenzy 0.42s ease-in-out infinite;
}

#main-cat:active {
transform: none;
}

#main-cat.sprite {
  object-fit: none;
  object-position: 0 0;
  image-rendering: pixelated;
  transform: scale(var(--sprite-scale, 1));
  transform-origin: center;
}

#main-cat.sprite:active {
  transform: scale(var(--sprite-scale, 1));
}

.pop {
  position: absolute;
  font-weight: bold;
  font-size: 18px;
  color: #5e2750;
  animation: floatUp 1s ease-out forwards;
}

.pop.caresse-pop {
  font-size: 30px;
  color: #ff7a1a;
  text-shadow: 0 2px 0 rgba(82, 35, 8, 0.55), 0 0 12px rgba(255, 178, 99, 0.95);
  -webkit-text-stroke: 1px rgba(82, 35, 8, 0.45);
  animation: caresseFloatUp 1.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.pop.fusion-pop {
  position: fixed;
  font-size: 24px;
  color: #9a5d00;
  text-shadow: 0 0 12px rgba(255, 222, 122, 0.95), 0 2px 0 rgba(92, 49, 0, 0.18);
  animation: fusionFloatUp 1.35s cubic-bezier(0.16, 0.8, 0.18, 1) forwards;
  z-index: 1600;
}

.pop.diamond-pop {
  color: #f6fbff;
  text-shadow: 0 0 10px rgba(102, 216, 255, 0.95), 0 0 22px rgba(255, 255, 255, 0.9);
}

.pop.passive-rps-pop {
  position: fixed;
  font-size: 14px;
  color: rgba(94, 39, 80, 0.72);
  text-shadow: none;
  animation: passiveFloatUp 1.55s ease-out forwards;
  z-index: 1300;
}

.fly-to-counter {
  position: fixed;
  z-index: 1600;
  left: 0;
  top: 0;
  pointer-events: none;
  font-weight: 800;
  color: #7b3f00;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  transform: translate(-50%, -50%);
  animation: flyToCounter 0.82s cubic-bezier(0.22, 0.78, 0.22, 1) forwards;
}

.fly-to-counter.purchase-cost {
  color: #9a4f00;
}

.fly-to-counter.quest-reward-fly {
  color: #2f7a3b;
}

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

@keyframes caresseFloatUp {
  0% { opacity: 0; transform: translateY(8px) scale(0.7); }
  20% { opacity: 1; transform: translateY(-8px) scale(1.18); }
  100% { opacity: 0; transform: translateY(-72px) scale(1); }
}

@keyframes passiveFloatUp {
  0% { opacity: 0; transform: translateY(4px) scale(0.88); }
  18% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-32px) scale(1); }
}

@keyframes fusionFloatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.72); }
  20% { opacity: 1; transform: translate(-50%, -8px) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -74px) scale(1); }
}

@keyframes flyToCounter {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--fly-x)), calc(-50% + var(--fly-y))) scale(0.72);
  }
}

@keyframes purchasePulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(240, 163, 58, 0);
  }
  28% {
    transform: translateY(-3px) scale(1.045);
    box-shadow: 0 12px 26px rgba(130, 76, 21, 0.2), 0 0 0 5px rgba(240, 163, 58, 0.45);
  }
  58% {
    transform: translateY(1px) scale(0.992);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(240, 163, 58, 0);
  }
}

.fusion-flash {
  animation: fusionFlash 0.9s ease-out;
}

@keyframes fusionFlash {
  0% { filter: drop-shadow(0 0 0 rgba(255, 210, 77, 0)); transform: scale(1); }
  28% { filter: drop-shadow(0 0 16px rgba(255, 210, 77, 0.95)); transform: scale(1.08); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 210, 77, 0)); transform: scale(1); }
}

@keyframes decorRemove {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.7); }
}

@keyframes decorBellRing {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-18deg); }
  40% { transform: rotate(15deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(6deg); }
}

@keyframes scratcherParticle {
  from {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  to {
    opacity: 0;
    transform: translate(var(--particle-x), var(--particle-y)) rotate(180deg);
  }
}

@keyframes laserTargetPulse {
  from { transform: translate(-50%, -50%) scale(0.88); }
  to { transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes laserMilestonePop {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.72);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.12);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -34px) scale(0.94);
  }
}

@keyframes bellSimonWiggle {
  0% { transform: translateX(0) rotate(0deg); }
  18% { transform: translateX(-8px) rotate(-8deg); }
  36% { transform: translateX(7px) rotate(7deg); }
  54% { transform: translateX(-5px) rotate(-5deg); }
  72% { transform: translateX(3px) rotate(3deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

@keyframes decorDeletePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes decorDeleteBadgePop {
  0% {
    opacity: 0;
    transform: scale(0.55);
  }
  70% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#settings, #achievements, #stats-panel, #quests-panel, #prestige-panel {
background-color: #fff0f5;
margin: 10px auto;
padding: 14px;
width: min(560px, calc(100vw - 32px));
border-radius: 12px;
position: relative;
z-index: 18;
}

#prestige-settings-section {
--section-accent: #7f4aa0;
margin: 12px 0;
}

.settings-save-section,
.settings-desktop-section {
display: grid;
gap: 8px;
margin: 12px 0;
padding: 10px;
border: 1px solid rgba(120, 72, 43, 0.16);
border-radius: 8px;
background: rgba(255, 255, 255, 0.58);
text-align: left;
}

.settings-save-section h3,
.settings-desktop-section h3 {
margin: 0;
font-size: 1rem;
}

.settings-save-actions,
.settings-desktop-section {
grid-template-columns: 1fr;
}

.settings-save-actions {
display: grid;
gap: 8px;
}

body.desktop-platform .desktop-only {
display: grid;
}

.desktop-only[hidden],
body:not(.desktop-platform) .desktop-only {
display: none !important;
}

#prestige-points-status {
margin: 8px 0;
font-weight: 700;
color: #5e2750;
}

#prestige-upgrade-list {
display: grid;
gap: 8px;
margin: 10px 0;
}

.prestige-upgrade-row {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: 8px;
align-items: center;
padding: 8px;
border: 1px solid rgba(120, 72, 43, 0.16);
border-radius: 8px;
background: rgba(255, 255, 255, 0.58);
}

.prestige-upgrade-row span {
font-size: 0.9rem;
}

.prestige-upgrade-row small {
display: block;
margin-top: 3px;
color: #6b4b39;
}

#help-panel {
margin-top: 14px;
padding: 10px 12px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.62);
border: 1px solid rgba(120, 72, 43, 0.14);
}

#help-panel h3 {
margin: 0 0 8px;
font-size: 0.95rem;
}

#help-panel p {
margin: 6px 0;
font-size: 0.86rem;
line-height: 1.4;
}

.section-hint {
margin: 0 0 10px;
font-size: 0.84rem;
color: #6d4a3a;
}

.ux-section {
padding: 12px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.58);
border: 1px solid rgba(120, 72, 43, 0.18);
border-left: 5px solid var(--section-accent, #f0a33a);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.ux-section-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 8px;
padding-bottom: 7px;
border-bottom: 1px solid rgba(120, 72, 43, 0.14);
}

.ux-section-header strong {
font-size: 0.92rem;
color: #4e2d1b;
text-align: right;
}

.ux-section-kicker {
display: inline-flex;
align-items: center;
min-height: 24px;
padding: 3px 8px;
border-radius: 999px;
background: color-mix(in srgb, var(--section-accent, #f0a33a) 18%, white);
border: 1px solid color-mix(in srgb, var(--section-accent, #f0a33a) 36%, transparent);
color: #4e2d1b;
font-size: 0.74rem;
font-weight: 900;
letter-spacing: 0;
text-transform: uppercase;
}

#item-stacks-panel .ux-section-header {
--section-accent: #4f75b8;
}

button:disabled {
opacity: 0.48;
cursor: not-allowed;
filter: grayscale(0.25);
}

#stats-content {
display: grid;
gap: 7px;
text-align: left;
}

.stats-row {
display: flex;
justify-content: space-between;
gap: 14px;
padding: 7px 9px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.58);
}

.stats-label {
color: #5c3b2a;
}

.stats-value {
color: #2f1d14;
text-align: right;
}

#quests-content {
display: grid;
gap: 10px;
text-align: left;
}

.quest-card {
padding: 10px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.62);
border: 1px solid rgba(120, 72, 43, 0.15);
position: relative;
overflow: hidden;
}

.quest-card.complete {
box-shadow: 0 0 0 2px rgba(91, 154, 88, 0.28);
}

.quest-card.purchase-pulse,
.quest-card.quest-claim-pulse {
animation: questPulse 0.75s ease-out;
}

.quest-card.cooldown {
opacity: 0.72;
}

.quest-card.state-ready {
border-color: rgba(35, 138, 79, 0.42);
background: rgba(238, 255, 243, 0.72);
}

.quest-card.state-active {
border-color: rgba(240, 163, 58, 0.32);
}

.quest-card.state-unavailable {
opacity: 0.6;
filter: grayscale(0.25);
}

.quest-card.cooldown .quest-progress span {
background: rgba(120, 72, 43, 0.34);
}

.quest-cooldown-veil {
position: absolute;
left: 0;
right: auto;
bottom: 0;
height: 4px;
width: var(--cooldown-progress, 100%);
background: linear-gradient(90deg, rgba(120, 72, 43, 0.4), rgba(240, 163, 58, 0.55));
animation: questCooldownDrain var(--cooldown-duration, 600s) linear forwards;
}

.quest-cooldown-text {
font-weight: 700;
color: #7a562f;
}

.quest-cooldown-badge {
display: inline-flex;
align-self: flex-start;
margin-bottom: 6px;
padding: 3px 8px;
border-radius: 999px;
background: rgba(240, 163, 58, 0.18);
color: #7a562f;
font-size: 0.76rem;
}

.quest-card-header {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
gap: 8px;
margin-bottom: 7px;
}

.quest-type-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.72);
border: 1px solid rgba(120, 72, 43, 0.16);
font-size: 1rem;
}

.quest-state-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 24px;
padding: 3px 8px;
border-radius: 999px;
font-size: 0.72rem;
font-weight: 900;
white-space: nowrap;
}

.quest-state-badge.active {
background: rgba(240, 163, 58, 0.18);
color: #7a562f;
}

.quest-state-badge.ready {
background: rgba(35, 138, 79, 0.16);
color: #17683a;
}

.quest-state-badge.cooldown {
background: rgba(120, 72, 43, 0.15);
color: #6f513b;
}

.quest-state-badge.unavailable {
background: rgba(94, 87, 82, 0.14);
color: #5f5851;
}

.quest-card h3 {
margin: 0;
font-size: 1rem;
line-height: 1.2;
}

.quest-card p {
margin: 5px 0;
}

.quest-progress {
height: 9px;
overflow: hidden;
border-radius: 999px;
background: rgba(120, 72, 43, 0.18);
}

.quest-progress span {
display: block;
height: 100%;
border-radius: inherit;
background: linear-gradient(90deg, #f0a33a, #7ac76d);
}

.quest-reward {
font-size: 0.9rem;
font-weight: 700;
}

#quests-toggle.quest-attention,
#menu-toggle.quest-attention {
animation: questAttention 0.85s ease-in-out;
}

@keyframes questPulse {
0% { box-shadow: 0 0 0 rgba(91, 154, 88, 0); transform: scale(1); }
35% { box-shadow: 0 0 0 5px rgba(91, 154, 88, 0.34); transform: scale(1.018); }
100% { box-shadow: 0 0 0 rgba(91, 154, 88, 0); transform: scale(1); }
}

@keyframes questAttention {
0%, 100% { transform: translateX(0); }
18% { transform: translateX(-3px) rotate(-1.5deg); }
36% { transform: translateX(3px) rotate(1.5deg); }
54% { transform: translateX(-2px) rotate(-1deg); }
72% { transform: translateX(2px) rotate(1deg); }
}

@keyframes questCooldownDrain {
from { width: var(--cooldown-progress, 100%); }
to { width: 0; }
}

#achievements-list {
margin: 0;
padding-left: 18px;
text-align: left;
max-height: 420px;
overflow-y: auto;
font-size: 1.04em;
}

.achievement-item {
margin: 6px 0;
line-height: 1.3;
}

.achievement-name {
font-weight: 700;
}

.achievement-hint {
font-size: 0.9em;
}

.achievement-item.locked {
color: rgba(58, 31, 42, 0.45);
}

.achievement-item.unlocked {
color: #3a1f2a;
}

#particles-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
overflow: hidden;
z-index: 10;
}

.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: none;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.5);
z-index: 20;
padding: 20px;
box-sizing: border-box;
}

.modal.open {
display: flex;
}

.modal-content {
max-width: 680px;
width: 100%;
max-height: calc(100vh - 40px);
overflow: auto;
background: #fff0f5;
border-radius: 16px;
padding: 20px 24px;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
text-align: left;
color: #3a1f2a;
}

.confirm-modal-content {
max-width: 420px;
}

.prestige-summary {
display: grid;
gap: 8px;
margin-top: 8px;
}

.prestige-summary-row {
display: grid;
grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
gap: 10px;
align-items: start;
padding: 9px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.62);
border: 1px solid rgba(120, 72, 43, 0.14);
}

.prestige-summary-row span {
font-size: 0.78rem;
font-weight: 900;
color: #6a4533;
text-transform: uppercase;
}

.prestige-summary-row strong {
font-size: 0.9rem;
color: #372015;
line-height: 1.35;
}

.confirm-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 16px;
}

.modal-content h2 {
margin: 0 0 10px;
}

.welcome-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}

.welcome-header h2 {
margin-bottom: 0;
}

#welcome-language-toggle {
flex: 0 0 auto;
min-width: 44px;
height: 44px;
padding: 0 10px;
font-family: inherit;
font-size: 1.25rem;
font-weight: 700;
line-height: 1;
border-radius: 10px;
}

.modal-content h3 {
margin: 16px 0 8px;
}

.modal-content ul {
margin: 0 0 12px 18px;
padding: 0;
}

.welcome-tip-card {
margin: 14px 0;
padding: 14px 16px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.72);
border: 1px solid rgba(120, 72, 43, 0.18);
}

.welcome-tip-card h3 {
margin-top: 0;
}

.welcome-tip-card p {
margin: 8px 0 0;
line-height: 1.45;
}

#welcome-close {
width: 100%;
margin-top: 10px;
}

.particle {
  position: absolute;
  font-size: 24px;
  color: #ff69b4;
  animation: rise 1s ease-out forwards;
}

@keyframes rise {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100px); opacity: 0; }
}


#item-stacks {
position: fixed;
top: 16px;
left: 16px;
z-index: 4;
text-align: left;
}

#item-stacks-toggle {
width: 96px;
height: 96px;
padding: 0;
border-radius: 14px;
background: transparent;
border: 2px solid rgba(0, 0, 0, 0.2);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
overflow: visible;
}

#item-stacks-toggle img {
width: 100%;
height: 100%;
object-fit: contain;
}

#shop-panel-toggle.new-player-indicator,
#item-stacks-toggle.new-player-indicator {
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(255, 223, 120, 0.45),
    0 0 18px rgba(255, 197, 67, 0.65);
  animation: newPlayerIndicatorPulse 1.2s ease-in-out infinite;
}

#shop-panel-toggle.new-player-indicator::after,
#item-stacks-toggle.new-player-indicator::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 18px;
  border: 2px solid rgba(255, 213, 95, 0.7);
  box-shadow: 0 0 20px rgba(255, 176, 46, 0.55);
  animation: newPlayerIndicatorRing 1.2s ease-out infinite;
}

#shop-panel-toggle.new-player-indicator::before,
#item-stacks-toggle.new-player-indicator::before {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffd166;
  box-shadow: 0 0 0 2px rgba(71, 34, 11, 0.35), 0 0 12px rgba(255, 163, 43, 0.95);
}

@keyframes newPlayerIndicatorPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

@keyframes newPlayerIndicatorRing {
  0% { opacity: 0.9; transform: scale(0.96); }
  70% { opacity: 0.35; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.1); }
}

#item-stacks-panel {
display: none;
margin-top: 12px;
width: min(420px, calc(100vw - 32px));
max-height: calc(100vh - 132px);
padding: 10px;
border-radius: 8px;
background-image: linear-gradient(rgba(255, 243, 236, 0.86), rgba(255, 243, 236, 0.86)), url('Assets/Divers/texture.png');
background-size: cover, 240px 240px;
background-position: center, center;
background-repeat: no-repeat, repeat;
backdrop-filter: blur(6px);
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
border: 1px solid rgba(120, 72, 43, 0.25);
border-left: 5px solid #4f75b8;
overflow-y: auto;
overscroll-behavior: contain;
scrollbar-gutter: stable;
}

#item-stacks-panel.open {
display: block;
}

#toggle-collection {
width: 100%;
margin-bottom: 6px;
font-weight: 700;
}

#item-stacks-content {
display: flex;
flex-direction: column;
gap: 10px;
}

.item-stack {
display: flex;
flex-direction: column;
gap: 8px;
padding: 10px 12px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.56);
box-shadow: inset 0 0 0 1px rgba(120, 72, 43, 0.12);
}

.item-stack-title {
font-weight: bold;
color: #4e2d1b;
text-align: left;
font-size: 0.92em;
letter-spacing: 0.3px;
text-transform: uppercase;
}

.collection-progress-summary {
display: flex;
flex-wrap: wrap;
gap: 6px 12px;
font-size: 0.82rem;
color: #604334;
}

.collection-progress-bar {
height: 7px;
overflow: hidden;
border-radius: 999px;
background: rgba(120, 72, 43, 0.16);
}

.collection-progress-bar span {
display: block;
height: 100%;
border-radius: inherit;
background: linear-gradient(90deg, #f0a33a, #7ac76d);
}

.item-stack-line {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
}

.item-stack-slot {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
font-size: 0.76em;
color: #3a1f2a;
min-width: 84px;
min-height: 94px;
padding: 6px 8px;
border-radius: 10px;
background: linear-gradient(180deg, rgba(255, 247, 240, 0.72), rgba(246, 229, 218, 0.72));
border: 1px solid rgba(120, 72, 43, 0.2);
box-shadow: 0 3px 10px rgba(62, 33, 18, 0.12);
}

.item-stack-slot img {
width: 40px;
height: 40px;
border-radius: 8px;
background-color: transparent;
padding: 0;
box-shadow: none;
}

.item-stack-slot-name {
margin-top: 5px;
font-size: 0.82em;
line-height: 1.2;
text-align: center;
color: #4e2d1b;
font-weight: 700;
}

.item-stack-slot-count {
margin-top: 5px;
font-weight: bold;
padding: 2px 8px;
border-radius: 999px;
background: rgba(78, 45, 27, 0.12);
color: #4e2d1b;
}

.item-stack-slot.owned {
border-color: rgba(59, 130, 88, 0.55);
box-shadow: 0 5px 12px rgba(59, 130, 88, 0.14);
}

.item-stack-slot.empty {
opacity: 0.65;
filter: grayscale(0.35);
}

#success-toast {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #fff3cd;
color: #856404;
border: 2px solid #ffeeba;
padding: 10px 20px;
border-radius: 12px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
font-weight: bold;
text-align: left;
white-space: pre-line;
line-height: 1.4;
max-width: min(92vw, 420px);
opacity: 0;
pointer-events: none;
transition: opacity 0.5s ease;
z-index: 1000;
}

#success-toast.show {
opacity: 1;
}

#success-toast.rare {
padding: 16px 28px;
font-size: 1.18rem;
border-color: #b9f0ff;
background: linear-gradient(135deg, #fff8d8, #e9fbff);
color: #245268;
box-shadow: 0 0 0 4px rgba(153, 223, 255, 0.22), 0 18px 46px rgba(30, 62, 80, 0.24);
animation: rareToastPop 1.05s cubic-bezier(0.18, 0.82, 0.22, 1);
}

.diamond-screen-flash {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 1500;
background: radial-gradient(circle at center, rgba(255,255,255,0.75), rgba(135,224,255,0.28) 28%, rgba(255,255,255,0) 62%);
animation: diamondFlash 0.85s ease-out forwards;
}

.diamond-sparkle {
position: fixed;
z-index: 1600;
pointer-events: none;
color: #f7fcff;
font-size: 18px;
text-shadow: 0 0 8px rgba(79, 209, 255, 0.95), 0 0 16px rgba(255,255,255,0.9);
transform: translate(-50%, -50%);
animation: diamondSparkle 1.1s ease-out forwards;
}

.milestone-screen-glow {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 1450;
background: radial-gradient(circle at center, rgba(255,255,255,0.55), rgba(255, 208, 99, 0.22) 30%, rgba(255,255,255,0) 66%);
animation: milestoneGlow 1.15s ease-out forwards;
}

.milestone-screen-glow.record {
background: radial-gradient(circle at center, rgba(255,255,255,0.45), rgba(92, 189, 123, 0.25) 30%, rgba(255,255,255,0) 66%);
}

.milestone-screen-glow.prestige {
background: radial-gradient(circle at center, rgba(255,255,255,0.48), rgba(151, 98, 189, 0.25) 30%, rgba(255,255,255,0) 66%);
}

.milestone-particle {
position: fixed;
z-index: 1600;
pointer-events: none;
color: #ffe08a;
font-size: 20px;
font-weight: 900;
text-shadow: 0 0 8px rgba(255, 193, 54, 0.9), 0 0 16px rgba(255,255,255,0.8);
transform: translate(-50%, -50%);
animation: milestoneBurst 1.2s ease-out forwards;
}

.milestone-particle.record {
color: #baf5ca;
text-shadow: 0 0 8px rgba(72, 185, 108, 0.9), 0 0 16px rgba(255,255,255,0.8);
}

.milestone-particle.prestige {
color: #e7c6ff;
text-shadow: 0 0 8px rgba(143, 80, 190, 0.9), 0 0 16px rgba(255,255,255,0.8);
}

@keyframes rareToastPop {
0% { transform: translate(-50%, -50%) scale(0.86); }
45% { transform: translate(-50%, -50%) scale(1.08); }
100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes milestoneGlow {
0% { opacity: 0; }
20% { opacity: 1; }
100% { opacity: 0; }
}

@keyframes milestoneBurst {
0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55); }
18% { opacity: 1; }
100% {
  opacity: 0;
  transform: translate(calc(-50% + var(--burst-x)), calc(-50% + var(--burst-y))) scale(1.35);
}
}

@keyframes diamondFlash {
0% { opacity: 0; }
18% { opacity: 1; }
100% { opacity: 0; }
}

@keyframes diamondSparkle {
0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
20% { opacity: 1; }
100% {
  opacity: 0;
  transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(1.25) rotate(160deg);
}
}

#treat {
position: fixed;
width: 105px;
height: auto;
z-index: 1200;
cursor: pointer;
opacity: 0;
transform: scale(0.9);
transition: opacity 0.2s ease, transform 0.2s ease;
pointer-events: none;
}

#treat-halo {
position: fixed;
width: 150px;
height: 150px;
z-index: 1199;
border-radius: 50%;
background:
  radial-gradient(circle, rgba(255, 255, 255, 0.78) 0 18%, rgba(255, 231, 118, 0.5) 34%, rgba(255, 128, 171, 0.22) 54%, rgba(255, 128, 171, 0) 72%);
box-shadow: 0 0 28px rgba(255, 214, 64, 0.44), 0 0 42px rgba(255, 64, 129, 0.22);
opacity: 0;
transform: translate(-50%, -50%) scale(0.72);
transition: opacity 0.18s ease;
pointer-events: none;
}

#treat-halo.visible {
opacity: 1;
}

#treat-halo.treat-halo-pulse {
animation: treatHaloPulse 1.4s ease-out infinite;
}

#treat.visible {
opacity: 1;
transform: scale(1);
pointer-events: auto;
}

#treat.treat-bounce {
animation: treatBounceIn 0.58s cubic-bezier(0.18, 0.82, 0.26, 1.18);
}

@keyframes treatBounceIn {
0% { opacity: 0; transform: translateY(12px) scale(0.72) rotate(-8deg); }
55% { opacity: 1; transform: translateY(-7px) scale(1.12) rotate(4deg); }
78% { transform: translateY(2px) scale(0.96) rotate(-2deg); }
100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes treatHaloPulse {
0% { opacity: 0; transform: translate(-50%, -50%) scale(0.56); }
22% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
100% { opacity: 0.28; transform: translate(-50%, -50%) scale(1.18); }
}

.animated-rps {
  background: #fff;
  color: #ff4081;
  border: 3px solid #ff4081;
  padding: 5px 12px;
  border-radius: 12px;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  font-size: 1em;
  font-weight: bold;
  box-shadow: 3px 3px 0 #000;
  transform: rotate(-2deg);
  display: inline-block;
  margin-left: 12px;
}

/* Cœurs */
.heart {
  position: absolute;
  font-size: 26px;
  animation: floatHeart 1s ease-out forwards;
  pointer-events: none;
}
@keyframes floatHeart {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-60px) scale(1.5); opacity: 0; }
}

/* Zone de caresse */
#pet-zone {
position: relative;
display: inline-block;
width: fit-content;
touch-action: none;
cursor: url('Assets/curseurs/curseur_32.png') 0 0, grab;
z-index: 2;
}
#pet-zone.dragging {
  cursor: grabbing;
}

.cat-resize-handle {
position: absolute;
right: -10px;
bottom: -10px;
width: 30px;
height: 30px;
display: none;
align-items: center;
justify-content: center;
z-index: 4;
border: 2px solid #2f2a25;
border-radius: 50%;
background: #fff7d7;
color: #2f2a25;
font-size: 17px;
font-weight: 800;
line-height: 1;
box-shadow: 2px 2px 0 rgba(47, 42, 37, 0.45);
cursor: nwse-resize;
touch-action: none;
opacity: 0.68;
transform: scale(0.92);
transition: opacity 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

#pet-zone.resize-selected .cat-resize-handle,
#second-pet-zone.resize-selected .cat-resize-handle,
#third-pet-zone.resize-selected .cat-resize-handle {
display: flex;
}

#pet-zone.resize-selected:hover .cat-resize-handle,
#pet-zone.resize-selected:focus-within .cat-resize-handle,
#pet-zone.resizing .cat-resize-handle,
#second-pet-zone.resize-selected:hover .cat-resize-handle,
#second-pet-zone.resize-selected:focus-within .cat-resize-handle,
#second-pet-zone.resizing .cat-resize-handle,
#third-pet-zone.resize-selected:hover .cat-resize-handle,
#third-pet-zone.resize-selected:focus-within .cat-resize-handle,
#third-pet-zone.resizing .cat-resize-handle {
opacity: 1;
transform: scale(1);
}

.cat-resize-handle:hover,
.cat-resize-handle:focus-visible,
#pet-zone.resizing .cat-resize-handle,
#second-pet-zone.resizing .cat-resize-handle,
#third-pet-zone.resizing .cat-resize-handle {
background: #ffe58a;
}

#pet-zone.resizing,
#second-pet-zone.resizing,
#third-pet-zone.resizing {
cursor: nwse-resize;
}

#second-pet-zone {
position: fixed;
right: 8%;
bottom: 14%;
width: fit-content;
touch-action: none;
cursor: url('Assets/curseurs/curseur_32.png') 0 0, grab;
z-index: 2;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease;
transform-origin: center bottom;
}

#second-pet-zone.visible {
  opacity: 1;
  pointer-events: auto;
  animation: catIdleBreath 5.2s ease-in-out infinite;
}

#second-pet-zone.dragging {
  cursor: grabbing;
}

#third-pet-zone {
position: fixed;
right: 20%;
bottom: 14%;
width: fit-content;
touch-action: none;
cursor: url('Assets/curseurs/curseur_32.png') 0 0, grab;
z-index: 2;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease;
transform-origin: center bottom;
}

#third-pet-zone.visible {
  opacity: 1;
  pointer-events: auto;
  animation: catIdleBreath 5.6s ease-in-out infinite;
}

#third-pet-zone.dragging {
  cursor: grabbing;
}
#pet-zone::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
background: transparent;
pointer-events: none;
}

@keyframes catIdleBreath {
0%, 100% { transform: translateY(0) scale(1); }
50% { transform: translateY(1px) scale(1.012, 0.992); }
}

body.tab-hidden *,
body.tab-hidden *::before,
body.tab-hidden *::after {
animation-play-state: paused !important;
transition: none !important;
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
animation: none !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}

body.reduced-motion .pop,
body.reduced-motion .fly-to-counter,
body.reduced-motion .diamond-screen-flash,
body.reduced-motion .diamond-sparkle,
body.reduced-motion .milestone-screen-glow,
body.reduced-motion .milestone-particle,
body.reduced-motion .catnip-particle,
body.reduced-motion .particle,
body.reduced-motion .heart {
display: none !important;
}

body.compact-ui #top-bar {
gap: 6px;
margin: 6px auto;
}

body.compact-ui #menu-toggle,
body.compact-ui #cat-stories-link,
body.compact-ui #language-toggle,
body.compact-ui #shop-panel-toggle,
body.compact-ui #item-stacks-toggle {
height: 38px;
min-width: 38px;
}

body.compact-ui #ronron-counter {
margin: 10px;
padding: 7px 12px;
font-size: 1.18em;
border-radius: 8px;
}

body.compact-ui #next-objective {
margin-top: 3px;
font-size: 0.78rem;
}

body.compact-ui #shop-panel-content,
body.compact-ui #item-stacks-panel {
max-height: calc(100vh - 104px);
}

body.compact-ui #shop-section,
body.compact-ui #decor-shop-section,
body.compact-ui #settings,
body.compact-ui #achievements,
body.compact-ui #stats-panel,
body.compact-ui #quests-panel,
body.compact-ui #prestige-panel,
body.compact-ui #item-stacks-panel,
body.compact-ui .ux-section {
padding: 8px;
}

body.compact-ui .ux-section-header {
margin-bottom: 5px;
padding-bottom: 5px;
}

body.compact-ui .section-hint {
margin-bottom: 6px;
font-size: 0.78rem;
}

body.compact-ui .core-shop-card,
body.compact-ui .decor-catalog-card,
body.compact-ui .item-stack,
body.compact-ui .quest-card,
body.compact-ui .prestige-upgrade-row {
padding: 7px;
gap: 6px;
border-radius: 8px;
}

body.compact-ui .core-shop-icon,
body.compact-ui .decor-catalog-image {
width: 44px;
height: 44px;
}

body.compact-ui #shop-content button,
body.compact-ui #decor-shop-content button,
body.compact-ui .decor-buy-btn {
margin: 6px 0;
min-height: 34px;
padding: 6px 8px;
}

body.compact-ui .decor-catalog-grid {
gap: 7px;
}

body.compact-ui .decor-catalog-sortbar,
body.compact-ui .decor-catalog-group {
padding: 7px;
border-radius: 10px;
}

body.compact-ui .decor-catalog-title {
font-size: 0.92rem;
}

body.compact-ui .decor-catalog-sortlabel,
body.compact-ui .decor-catalog-group-count {
font-size: 0.74rem;
}

body.compact-ui .collection-progress-summary,
body.compact-ui .quest-reward {
font-size: 0.76rem;
}

/* Halo du chat */
#main-cat.caresse {
filter: drop-shadow(0 0 18px rgba(255, 105, 180, 0.65));
transition: filter 0.3s ease;
}

#main-cat.sprite.caresse {
  transform: scale(var(--sprite-scale, 1));
}

#second-cat {
  --cat-size-scale: 1;
  width: calc(60vw * var(--cat-size-scale));
  max-width: calc(280px * var(--cat-size-scale));
  height: auto;
  border-radius: 12px;
  display: block;
}

#second-cat.caresse {
  filter: drop-shadow(0 0 18px rgba(255, 105, 180, 0.65));
  transform: scale(0.93);
  transition: filter 0.3s ease, transform 0.3s ease;
}

#third-cat {
  --cat-size-scale: 1;
  width: calc(60vw * var(--cat-size-scale));
  max-width: calc(280px * var(--cat-size-scale));
  height: auto;
  border-radius: 12px;
  display: block;
}

#third-cat.caresse {
  filter: drop-shadow(0 0 18px rgba(255, 105, 180, 0.65));
  transform: scale(0.93);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.cat-sleep-zzz {
  position: absolute;
  right: 8%;
  top: 4%;
  z-index: 3;
  pointer-events: none;
  color: #fff7bf;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: clamp(1.1rem, 3vw, 2rem);
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(45, 35, 70, 0.45);
  animation: catSleepZzz 1.8s ease-in-out infinite;
}

#main-cat.sleeping,
#second-cat.sleeping,
#third-cat.sleeping {
  filter: drop-shadow(0 0 10px rgba(255, 247, 191, 0.45));
}

@keyframes catSleepZzz {
  0% {
    opacity: 0;
    transform: translate(0, 10px) scale(0.85);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(22px, -30px) scale(1.15);
  }
}


#grade-title {
  font-size: 0.7em;
  font-weight: bold;
  color: #ffe7a3;
  margin: 0 0 6px;
  transition: transform 0.3s ease;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
    background-size: cover;
    background-position: center center;
  }

  #game-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  #shop-panel {
    top: 12px;
    right: 12px;
  }

  #shop-panel-toggle {
    width: 84px;
    height: 84px;
  }

  #item-stacks {
    top: 12px;
    left: 12px;
  }

  #item-stacks-toggle {
    width: 84px;
    height: 84px;
  }

  #item-stacks-panel {
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 116px);
  }

  #menu-panel {
    grid-template-columns: 1fr 1fr;
  }

  #menu-panel select {
    grid-column: span 2;
  }

  .item-stack-title {
    text-align: center;
  }

  .item-stack-line {
    justify-content: center;
  }

  .item-stack-slot {
    min-width: 76px;
    min-height: 90px;
  }

  .item-stack-slot img {
    width: 36px;
    height: 36px;
  }

  #main-cat {
    max-width: calc(420px * var(--cat-size-scale));
  }

  #second-cat {
    max-width: calc(420px * var(--cat-size-scale));
  }

  #third-cat {
    max-width: calc(420px * var(--cat-size-scale));
  }

}

/* Added life: subtle action feedback, kept separate from base layout rules. */
.core-shop-card.purchase-pulse .core-shop-icon,
.decor-catalog-card.purchase-pulse .decor-catalog-image {
animation: itemImagePop 0.48s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.shop-price.price-fade {
display: inline-block;
animation: priceFade 0.62s ease-out;
}

.unavailable-shake {
animation: unavailableShake 0.34s ease-in-out;
}

.decor-item.decor-placed-pop .decor-item-image {
animation: decorPlacedPop 0.48s cubic-bezier(0.18, 0.84, 0.18, 1);
}

#decor-layer.room-transition {
animation: roomFade 0.34s ease-out;
}

.decor-catalog-card.decor-collection-card.owned:not(.purchase-pulse)::after {
content: "";
position: absolute;
inset: 0;
pointer-events: none;
border-radius: inherit;
background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,0) 38%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 62%, transparent 100%);
transform: translateX(-130%);
animation: rareDecorShimmer 5.8s ease-in-out infinite;
}

.decor-catalog-card.decor-collection-card {
position: relative;
overflow: hidden;
}

.collection-progress-bar span {
transition: width 0.58s cubic-bezier(0.22, 0.78, 0.22, 1);
}

.quest-card.state-ready {
animation: questReadyBreath 2.4s ease-in-out infinite;
}

.quest-cooldown-veil {
animation: questCooldownDrain var(--cooldown-duration, 1s) linear forwards;
}

.milestone-screen-glow.secret {
background: radial-gradient(circle at center, rgba(255,255,255,0.42), rgba(88, 51, 112, 0.25) 30%, rgba(255,255,255,0) 66%);
}

.milestone-particle.secret {
color: #f5ddff;
text-shadow: 0 0 8px rgba(103, 58, 143, 0.85), 0 0 16px rgba(255,255,255,0.8);
}

.prestige-point-drop {
position: fixed;
z-index: 1700;
pointer-events: none;
font-weight: 1000;
font-size: 1.4rem;
color: #7b4cc2;
text-shadow: 0 0 10px rgba(255,255,255,0.95), 0 0 18px rgba(170, 120, 230, 0.85);
transform: translate(-50%, -50%);
animation: prestigePointDrop 1s cubic-bezier(0.2, 0.82, 0.2, 1) forwards;
}

.prestige-summary-row {
animation: prestigeSummaryIn 0.42s ease-out both;
}

.prestige-summary-row:nth-child(2) { animation-delay: 0.05s; }
.prestige-summary-row:nth-child(3) { animation-delay: 0.1s; }
.prestige-summary-row:nth-child(4) { animation-delay: 0.15s; }
.prestige-summary-row:nth-child(5) { animation-delay: 0.2s; }

@keyframes itemImagePop {
0% { transform: scale(1); }
35% { transform: scale(1.16) rotate(-2deg); }
68% { transform: scale(0.96) rotate(1deg); }
100% { transform: scale(1) rotate(0deg); }
}

@keyframes priceFade {
0% { opacity: 1; transform: translateY(0); }
38% { opacity: 0.35; transform: translateY(-3px); }
100% { opacity: 1; transform: translateY(0); }
}

@keyframes unavailableShake {
0%, 100% { transform: translateX(0); }
20% { transform: translateX(-4px); }
40% { transform: translateX(4px); }
60% { transform: translateX(-3px); }
80% { transform: translateX(3px); }
}

@keyframes decorPlacedPop {
0% { opacity: 0; transform: scale(0.85); }
45% { opacity: 1; transform: scale(1.06); }
100% { opacity: 1; transform: scale(1); }
}

@keyframes roomFade {
0% { opacity: 0.35; filter: blur(2px); }
100% { opacity: 1; filter: blur(0); }
}

@keyframes rareDecorShimmer {
0%, 68%, 100% { transform: translateX(-130%); opacity: 0; }
76% { opacity: 1; }
88% { transform: translateX(130%); opacity: 0; }
}

@keyframes questReadyBreath {
0%, 100% { box-shadow: 0 0 0 2px rgba(35, 138, 79, 0.18); }
50% { box-shadow: 0 0 0 4px rgba(35, 138, 79, 0.34), 0 10px 24px rgba(35, 138, 79, 0.12); }
}

@keyframes prestigePointDrop {
0% { opacity: 0; transform: translate(-50%, -50%) scale(0.78); }
18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
100% {
  opacity: 0;
  transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y))) scale(0.76);
}
}

@keyframes prestigeSummaryIn {
0% { opacity: 0; transform: translateY(8px); }
100% { opacity: 1; transform: translateY(0); }
}
