/* Kedi odası sahnesi, gece/gündüz temaları, dağ/çim ortamı, kedi evleri ve GPU Lottie stilleri */
.cat-room-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: linear-gradient(180deg, #060b1a 0%, #0f1b38 62%, #102526 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 34px 28px 30px;
  opacity: 1;
  transform: scale(1);
  will-change: opacity, transform;
  transition:
    background 0.9s ease,
    opacity 0.45s var(--smooth-easing),
    transform 0.45s var(--spring-easing);
  cursor: pointer;
}

/* Gündüz (07:00 - 18:59) ve Gece (19:00 - 06:59) tema geçişleri */
.cat-room-overlay.is-day {
  background: linear-gradient(180deg, #6ab7ff 0%, #b8e1ff 62%, #d8f3dc 100%);
}

.cat-room-overlay.is-night {
  background: linear-gradient(180deg, #060b1a 0%, #0f1b38 62%, #102526 100%);
}

.cat-room-overlay.hidden {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
}

.cat-room-close-btn {
  position: fixed;
  top: 26px;
  right: 28px;
  z-index: 9999;
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--spring-easing), background 0.25s ease;
}

.cat-room-overlay.is-day .cat-room-close-btn {
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(255, 255, 255, 0.72);
  color: #10203b;
  box-shadow: 0 10px 26px rgba(15, 35, 70, 0.16);
}

.cat-room-close-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: scale(1.1) rotate(90deg);
}

/* Üst başlık, saat ve üst üste sıralı anı sayaçları */
.cat-room-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: min(960px, 100%);
  pointer-events: none;
}

.cat-room-top-row {
  position: relative;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  pointer-events: auto;
}

.cat-room-memories {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: default;
}

.cat-room-clock-pill,
.memory-counter-card,
.admin-cat-sky-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: var(--text-primary);
  transition: background 0.6s ease, border-color 0.6s ease, color 0.6s ease, transform 0.25s var(--spring-easing);
}

.admin-cat-sky-btn {
  position: relative;
  z-index: 9999;
  pointer-events: auto;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.admin-cat-sky-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.admin-cat-sky-btn.is-override-day,
.admin-cat-sky-btn.is-override-night {
  border-color: var(--star-gold);
  box-shadow:
    0 0 16px rgba(255, 214, 10, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.cat-room-overlay.is-day .cat-room-clock-pill,
.cat-room-overlay.is-day .memory-counter-card,
.cat-room-overlay.is-day .admin-cat-sky-btn {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.78);
  color: #0f1c33;
  box-shadow:
    0 12px 30px rgba(18, 44, 84, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.memory-counter-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.88;
  white-space: nowrap;
}

.memory-counter-value {
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cat-room-mode-icon {
  font-size: 16px;
  line-height: 1;
}

.cat-room-clock {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.cat-room-clock-divider {
  opacity: 0.45;
  font-size: 13px;
}

.cat-room-activity-badge {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.88;
}

.cat-room-title {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.cat-room-overlay.is-day .cat-room-title {
  color: #ffffff;
  text-shadow: 0 4px 18px rgba(15, 38, 76, 0.24);
}

.cat-room-subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.cat-room-overlay.is-day .cat-room-subtitle {
  color: rgba(15, 28, 51, 0.82);
  font-weight: 500;
}

/* Doğa sahnesi ve gökyüzü katmanları */
.cat-room-stage {
  position: relative;
  width: min(960px, 100%);
  height: min(420px, 48dvh);
  margin: auto 0;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(11, 20, 44, 0.94) 0%, rgba(16, 36, 56, 0.9) 72%, rgba(20, 56, 40, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  pointer-events: none;
  transition: background 0.9s ease, border-color 0.9s ease, box-shadow 0.9s ease;
}

.cat-room-overlay.is-day .cat-room-stage {
  background: linear-gradient(180deg, #74c0fc 0%, #bde4ff 64%, #d8f5d0 100%);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    0 28px 64px rgba(18, 44, 84, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.cat-room-sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: 220px;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.sky-stars-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.cat-room-overlay.is-day .sky-stars-layer {
  display: none;
}

.sky-lottie {
  display: block;
  object-fit: contain;
  pointer-events: none;
  will-change: transform;
}

.sky-celestial-lottie {
  position: absolute;
  top: 12px;
  right: 8%;
  width: 124px;
  height: 124px;
  z-index: 2;
}

.sky-atmosphere-lottie {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  width: 340px;
  height: 150px;
  opacity: 0.92;
}

.sky-stars-left {
  position: absolute;
  top: 16px;
  left: 3%;
  width: 220px;
  height: 120px;
  opacity: 0.85;
}

.sky-stars-right {
  position: absolute;
  top: 22px;
  right: 21%;
  width: 210px;
  height: 115px;
  opacity: 0.82;
}

.sky-stars-low {
  position: absolute;
  top: 68px;
  left: 20%;
  width: 190px;
  height: 100px;
  opacity: 0.72;
}

/* Dağ silüetleri ve yeşil çim zemin */
.cat-room-mountains {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  height: 210px;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.mountain-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 0.9s ease;
}

.mountain-back {
  clip-path: polygon(0% 100%, 0% 56%, 16% 24%, 34% 48%, 54% 16%, 76% 44%, 92% 22%, 100% 42%, 100% 100%);
  background: linear-gradient(180deg, #1b2f58 0%, #101f3d 100%);
}

.mountain-mid {
  clip-path: polygon(0% 100%, 0% 72%, 22% 38%, 44% 66%, 64% 34%, 84% 58%, 100% 36%, 100% 100%);
  background: linear-gradient(180deg, #142646 0%, #0d1b33 100%);
}

.mountain-front {
  clip-path: polygon(0% 100%, 0% 80%, 14% 58%, 36% 78%, 56% 52%, 78% 74%, 94% 56%, 100% 74%, 100% 100%);
  background: linear-gradient(180deg, #102b36 0%, #0b2226 100%);
}

.cat-room-overlay.is-day .mountain-back {
  background: linear-gradient(180deg, #8ab7d6 0%, #6d9ec2 100%);
}

.cat-room-overlay.is-day .mountain-mid {
  background: linear-gradient(180deg, #689bbf 0%, #4e83a6 100%);
}

.cat-room-overlay.is-day .mountain-front {
  background: linear-gradient(180deg, #4b8f7a 0%, #37755f 100%);
}

.cat-room-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 78px;
  z-index: 5;
  background: linear-gradient(180deg, #1f633d 0%, #15472b 55%, #0d2e1b 100%);
  border-top: 3px solid rgba(74, 201, 120, 0.38);
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transition: background 0.9s ease, border-color 0.9s ease;
}

.cat-room-overlay.is-day .cat-room-floor {
  background: linear-gradient(180deg, #66d96b 0%, #43b54b 55%, #2c8c35 100%);
  border-top-color: rgba(190, 255, 176, 0.8);
  box-shadow: inset 0 8px 18px rgba(255, 255, 255, 0.22);
}

/* Sütlü ve Kahve kedi kulübeleri */
.cat-house {
  position: absolute;
  bottom: 58px;
  width: 150px;
  height: 150px;
  z-index: 4;
  pointer-events: none;
}

.cat-house.house-left {
  left: 5%;
}

.cat-house.house-right {
  right: 5%;
}

.house-roof {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 162px;
  height: 64px;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
}

.house-left .house-roof {
  background: linear-gradient(180deg, rgba(242, 246, 255, 0.88) 0%, rgba(198, 214, 238, 0.72) 100%);
}

.house-right .house-roof {
  background: linear-gradient(180deg, #b87b50 0%, #7d4c2a 100%);
}

.house-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 132px;
  height: 92px;
  border-radius: 14px 14px 18px 18px;
  background: rgba(24, 34, 62, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: background 0.9s ease, border-color 0.9s ease;
}

.cat-room-overlay.is-day .house-body {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.9);
}

.house-tag {
  position: absolute;
  top: 9px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(12, 16, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--star-gold);
}

.house-door {
  position: relative;
  width: 68px;
  height: 54px;
  border-radius: 50% 50% 8px 8px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 224, 132, 0.18) 0%, rgba(8, 11, 22, 0.88) 85%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.house-cushion {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 228, 132, 0.42);
}

/* GPU hızlandırmalı Lottie kedi taşıyıcıları ve durum stilleri */
.room-cat {
  position: absolute;
  left: calc(50% - 75px);
  bottom: 48px;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  pointer-events: none;
  user-select: none;
  will-change: transform;
  transition: transform 0.8s var(--spring-easing);
}

.room-cat.cat-white {
  transform: translate3d(-165px, 0, 0);
}

.room-cat.cat-brown {
  transform: translate3d(165px, 0, 0);
}

.cat-lottie-box {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.25s ease;
}

#cat-lottie-box-white {
  transform: scaleX(-1);
}

#cat-lottie-box-brown {
  transform: scaleX(1);
}

.cat-lottie {
  width: 150px;
  height: 150px;
  object-fit: contain;
  display: block;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.35s ease;
}

#lottie-cat-brown {
  transform: scale(1.14);
  transform-origin: bottom center;
}

.sleep-mode,
.sleep-mode-white {
  transform: translateY(30px);
}

#lottie-cat-brown.sleep-mode {
  transform: translateY(30px) scale(1.14);
  transform-origin: bottom center;
}

#lottie-cat-brown.walk-mode-brown {
  transform: translateY(32px) scale(1.38);
  transform-origin: bottom center;
}

#lottie-cat-brown.read-mode-brown {
  transform: translate3d(0, 14px, 0) scale(1.34);
  transform-origin: bottom center;
}

#lottie-cat-brown.combined-mode-cat {
  transform: translate3d(0, 6px, 0) scale(1.62);
  transform-origin: bottom center;
}

#lottie-cat-white.study-mode-white {
  transform: translate3d(0, 4px, 0) scale(1.22);
  transform-origin: bottom center;
}

#lottie-cat-white.read-mode-white {
  transform: translate3d(0, 12px, 0) scale(1.18);
  transform-origin: bottom center;
}

/* Kalp efektleri ve kontrol menüsü */
.cat-hearts-container {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: 135px;
  left: 50%;
  font-size: 22px;
  user-select: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 10px rgba(255, 80, 120, 0.7));
  animation: floatHeartUp 2.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes floatHeartUp {
  0% {
    opacity: 0;
    transform: translate3d(var(--heart-x, 0px), 10px, 0) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate3d(var(--heart-x, 0px), -20px, 0) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--heart-x-end, 16px), -190px, 0) scale(0.85) rotate(var(--heart-rot, 12deg));
  }
}

.cat-room-controls {
  position: relative;
  top: auto;
  left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  gap: 8px;
  padding: 6px 10px;
  margin-top: 12px;
  margin-bottom: 4px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  z-index: 9999;
  pointer-events: auto;
  cursor: default;
}

.cat-room-overlay.is-day .cat-room-controls {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
}

.cat-mode-btn {
  position: relative;
  z-index: 9999;
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.28s var(--spring-easing),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    color 0.25s ease;
}

.cat-room-overlay.is-day .cat-mode-btn {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(255, 255, 255, 0.82);
  color: #0f1c33;
  box-shadow:
    0 4px 12px rgba(18, 44, 84, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.cat-mode-btn:hover {
  transform: translateY(-2px) scale(1.06);
  background: rgba(255, 255, 255, 0.28);
}

.cat-mode-btn:active {
  transform: scale(0.94);
}

.cat-mode-btn.active {
  background: rgba(255, 255, 255, 0.32);
  border-color: var(--star-gold);
  box-shadow:
    0 0 18px rgba(255, 214, 10, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transform: translateY(-2px) scale(1.08);
}

.cat-room-overlay.is-day .cat-mode-btn.active {
  background: rgba(255, 255, 255, 0.92);
  border-color: #f59e0b;
  box-shadow:
    0 6px 18px rgba(245, 158, 11, 0.32),
    inset 0 1px 0 #ffffff;
}

body.cat-room-open #admin-control-panel {
  opacity: 0;
  pointer-events: none;
}

/* Kedi odası mobil uyumluluğu */
@media (max-width: 768px) {
  .cat-room-overlay {
    padding: 54px 14px 18px;
    overflow-y: auto;
  }

  .cat-room-memories {
    gap: 6px;
  }

  .cat-room-clock-pill,
  .memory-counter-card,
  .admin-cat-sky-btn {
    min-height: 36px;
    padding: 5px 14px;
    gap: 8px;
    border-radius: 999px;
  }

  .admin-cat-sky-btn {
    font-size: 11px;
    padding: 6px 12px;
  }

  .memory-counter-label,
  .memory-counter-value {
    font-size: 11px;
  }

  .cat-room-clock {
    font-size: 22px;
  }

  .cat-room-title {
    font-size: 28px;
  }

  .cat-room-stage {
    height: min(340px, 44dvh);
    border-radius: 26px;
  }

  .sky-celestial-lottie {
    width: 88px;
    height: 88px;
    right: 5%;
  }

  .sky-atmosphere-lottie {
    width: 240px;
    height: 115px;
  }

  .sky-stars-left {
    width: 155px;
    height: 88px;
    top: 14px;
    left: 2%;
  }

  .sky-stars-right {
    width: 150px;
    height: 86px;
    top: 20px;
    right: 18%;
  }

  .sky-stars-low {
    width: 135px;
    height: 76px;
    top: 58px;
    left: 16%;
  }

  .cat-house {
    width: 108px;
    height: 112px;
    bottom: 48px;
  }

  .house-roof {
    width: 118px;
    height: 46px;
  }

  .house-body {
    width: 96px;
    height: 68px;
  }

  .house-door {
    width: 48px;
    height: 40px;
  }

  .cat-room-mountains {
    bottom: 64px;
    height: 150px;
  }

  .cat-room-floor {
    height: 68px;
  }

  .room-cat {
    bottom: 42px;
    width: 150px;
    height: 150px;
  }

  .room-cat.cat-white {
    transform: translate3d(-85px, 0, 0);
  }

  .room-cat.cat-brown {
    transform: translate3d(85px, 0, 0);
  }

  .cat-lottie-box,
  .cat-lottie {
    width: 150px;
    height: 150px;
  }

  #lottie-cat-brown.combined-mode-cat {
    transform: translate3d(0, 6px, 0) scale(1.42);
  }

  #lottie-cat-brown.read-mode-brown {
    transform: translate3d(0, 12px, 0) scale(1.28);
  }

  #lottie-cat-white.study-mode-white {
    transform: translate3d(0, 4px, 0) scale(1.16);
  }

  .cat-room-controls {
    top: auto;
    left: auto;
    max-width: 100%;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px;
    margin-top: 10px;
    border-radius: 22px;
  }

  .cat-mode-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .cat-mode-btn svg {
    width: 16px;
    height: 16px;
  }
}
