* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Hiragino Maru Gothic ProN', 'Yu Gothic', sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #ffd6e7 0%, #ffe5d9 50%, #d4f4dd 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.game {
  background: #fff;
  border-radius: 30px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(255, 150, 180, 0.3);
  max-width: 440px;
  width: 100%;
  border: 4px solid #ffb3d1;
}

.header { text-align: center; margin-bottom: 12px; position: relative; }
.title { color: #ff6b9d; font-size: 20px; font-weight: bold; }

.header-btns {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
  align-items: center;
}

.bgm-toggle, .ctrl-btn {
  background: #fff4f8;
  border: 2px solid #ffc9dc;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
}

.info-bar {
  display: flex;
  justify-content: space-between;
  background: #fff4f8;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  margin-top: 6px;
  color: #9d5577;
  align-items: center;
}

.screen {
  background: linear-gradient(180deg, #e6f7ff 0%, #d4f4dd 100%);
  border-radius: 20px;
  padding: 10px;
  height: 260px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin-bottom: 12px;
  overflow: hidden;
  border: 3px solid #ffc9dc;
  cursor: pointer;
}

.puppy-container { position: relative; z-index: 2; }
.puppy-svg { width: 180px; height: 180px; filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1)); }
.egg-svg { width: 120px; height: 140px; animation: eggShake 0.8s ease infinite; }

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

/* 各部位アニメ */
.body-part { transform-origin: center; transform-box: fill-box; }

.tail { animation: tailWag 0.55s ease-in-out infinite alternate; }
.tail-slow { animation: tailWag 1.4s ease-in-out infinite alternate; }
.tail-fast { animation: tailWagHappy 0.18s ease-in-out infinite alternate; }

@keyframes tailWag {
  from { transform: rotate(-24deg); }
  to   { transform: rotate(36deg); }
}
@keyframes tailWagHappy {
  from { transform: rotate(-50deg) scaleY(1.12); }
  to   { transform: rotate(60deg) scaleY(0.9); }
}

.ear-l { transform-origin: bottom right; animation: earL 2s ease-in-out infinite; }
.ear-r { transform-origin: bottom left; animation: earR 2s ease-in-out infinite; }
@keyframes earL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-8deg); } }
@keyframes earR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(8deg); } }

.body-anim { animation: breathe 1.8s ease-in-out infinite; transform-origin: center bottom; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.04); } }

.body-jump { animation: jump 0.5s ease-in-out infinite; }
@keyframes jump {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.body-sad { opacity: 0.6; transform: translateY(3px); }

.body-sick { animation: shiver 0.2s linear infinite; }
@keyframes shiver {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.eye { animation: blink 4s infinite; transform-origin: center; }
@keyframes blink {
  0%, 90%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.1); }
}

.sleep-z { animation: sleepZ 2s ease infinite; font-size: 22px; fill: #9d5577; }
@keyframes sleepZ {
  0% { opacity: 0; transform: translate(0, 0); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translate(20px, -20px); }
}

.poop {
  position: absolute;
  bottom: 12px;
  font-size: 26px;
  z-index: 1;
  animation: poopDrop 0.4s ease;
}
@keyframes poopDrop {
  0% { transform: translateY(-30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.call-alert {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 26px;
  animation: blinkAlert 0.5s ease infinite;
  z-index: 3;
}
@keyframes blinkAlert {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.2); }
}

.effect {
  position: absolute;
  font-size: 30px;
  animation: float 1.5s ease-out forwards;
  pointer-events: none;
  z-index: 3;
}
@keyframes float {
  0% { opacity: 1; transform: translateY(0) scale(0.5); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.3); }
}

.message {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  color: #666;
  border: 2px solid #ffc9dc;
  white-space: nowrap;
  max-width: 90%;
  z-index: 4;
}

.breed-label {
  position: absolute;
  bottom: 8px;
  left: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  color: #9d5577;
  font-weight: bold;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.stat {
  background: #fff8fb;
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid #ffe0ec;
}

.stat-label {
  font-size: 10px;
  color: #9d5577;
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
}

.bar { height: 6px; background: #ffe5ed; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

.fill-hp { background: linear-gradient(90deg, #ff9ebb, #ff6b9d); }
.fill-full { background: linear-gradient(90deg, #e0b5ff, #c47fff); }
.fill-happy { background: linear-gradient(90deg, #ffd59e, #ffae5d); }
.fill-disc { background: linear-gradient(90deg, #b5e7a0, #6dc77a); }

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 0;
}

.btn {
  background: linear-gradient(180deg, #ffe5ed, #ffd0e0);
  border: 2px solid #ffb3d1;
  border-radius: 12px;
  padding: 8px 2px;
  cursor: pointer;
  font-size: 10px;
  color: #9d5577;
  font-weight: bold;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(255, 150, 180, 0.3); }
.btn:active { transform: translateY(0); }
.btn-icon { font-size: 18px; }

.btn-alert { animation: pulse 1s infinite; border-color: #ff3366 !important; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(255, 51, 102, 0); }
}

.miss-counter {
  background: #ffebf0;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: #cc3366;
  text-align: center;
  margin-bottom: 8px;
  border: 1px solid #ffc0d0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  z-index: 10;
  padding: 16px;
}

.modal.show { display: flex; }

.modal-box {
  background: #fff;
  padding: 24px;
  border-radius: 20px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  border: 4px solid #ffb3d1;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.modal-emoji { font-size: 70px; margin-bottom: 8px; }
.modal-title { font-size: 20px; color: #ff6b9d; font-weight: bold; margin-bottom: 8px; }
.modal-desc { color: #666; margin-bottom: 16px; line-height: 1.6; font-size: 13px; white-space: pre-line; }

.modal-btn {
  background: linear-gradient(180deg, #ff9ebb, #ff6b9d);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 16px;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
  margin: 4px;
}

.modal-btn.sub { background: linear-gradient(180deg, #e0e0e0, #c0c0c0); }
.modal-btn.danger { background: linear-gradient(180deg, #ff6b6b, #e03333); }

.btn-quit {
  background: linear-gradient(180deg, #f0f0f0, #ddd);
  border-color: #bbb !important;
  color: #888 !important;
}
.btn-quit:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.15); }

.breed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.breed-card {
  background: #fff8fb;
  border: 3px solid #ffe0ec;
  border-radius: 14px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.breed-card:hover { border-color: #ff6b9d; transform: translateY(-2px); }
.breed-card svg { width: 56px; height: 56px; }
.breed-name { font-size: 11px; color: #9d5577; font-weight: bold; margin-top: 2px; }
.breed-trait { font-size: 9px; color: #999; margin-top: 1px; }

.minigame { padding: 10px; }
.mg-title { font-size: 16px; color: #ff6b9d; margin-bottom: 10px; font-weight: bold; }
.mg-hint { font-size: 13px; color: #666; margin: 10px 0; }

.mg-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.mg-choice {
  background: #fff4f8;
  border: 2px solid #ffc9dc;
  border-radius: 12px;
  padding: 14px 4px;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.mg-choice:hover { background: #ffe5ed; transform: scale(1.05); }

.gen-badge {
  background: #ff6b9d;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
}
