:root {
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --shadow: rgba(0,0,0,0.06);
  --pink: #FF6B8A;
  --blue: #5CB8FF;
  --yellow: #FFD93D;
  --danger: #FF4757;
  --success: #2ED573;
  --text: #2D3436;
  --text2: #636E72;
  --purple: #A55EEA;
}

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

body {
  font-family: 'M PLUS Rounded 1c', 'Kosugi Maru', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

@keyframes squish {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.15, 0.85); }
  60% { transform: scale(0.9, 1.1); }
  100% { transform: scale(1, 1); }
}

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

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

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

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(300px) rotate(720deg); opacity: 0; }
}

@keyframes sulk {
  0% { filter: brightness(1); }
  100% { filter: brightness(0.7) saturate(0.5); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes rainDrop {
  0% { opacity: 0; transform: translateY(-5px); }
  50% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(5px); }
}

@keyframes titleBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

.ball-idle {
  animation: bounce 2s ease-in-out infinite;
}

.ball-pet {
  animation: squish 0.5s ease-in-out;
}

.ball-hungry {
  transform: scale(0.85);
  transition: transform 0.5s;
}

.ball-happy::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -5px;
  animation: sparkle 1.5s ease-in-out infinite;
  font-size: 14px;
}

.ball-sad {
  animation: sulk 2s ease-in-out infinite alternate;
}

.ball-jealous {
  animation: wobble 0.5s ease-in-out infinite;
}

.heart-float {
  animation: floatUp 1s ease-out forwards;
  position: absolute;
  pointer-events: none;
  font-size: 20px;
}

.speech-bubble {
  animation: fadeInUp 0.3s ease-out;
  position: absolute;
  background: white;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  white-space: nowrap;
  z-index: 10;
  max-width: 160px;
  white-space: normal;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
}

.stat-bar {
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: #f0f0f0;
  position: relative;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.5s ease;
}

.btn-action {
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-family: inherit;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.btn-action:active {
  transform: translateY(0);
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInUp 0.2s ease-out;
}

.modal-content {
  background: white;
  border-radius: 24px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.room-bg {
  background: linear-gradient(180deg, #E8F4FD 0%, #FFF8F0 40%, #F5E6D3 100%);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  min-height: 300px;
}

.room-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, #F5E6D3, #E8D5BF);
  border-top: 3px solid #D4C4A8;
}

.room-wall-decor {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  opacity: 0.3;
}

.event-ticker {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 2s ease-out forwards;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

@media (max-width: 768px) {
  .desktop-layout { flex-direction: column !important; }
  .sidebar { width: 100% !important; max-height: 200px; }
  .main-panel { width: 100% !important; }
  .action-panel { width: 100% !important; }
}