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

body {
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDGothic", "Yu Gothic", sans-serif;
  background: linear-gradient(180deg, #fdf3e3 0%, #fce8d5 100%);
  min-height: 100vh;
  color: #5b4636;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 430px;
  padding: 20px 16px 40px;
}

.header { text-align: center; margin-bottom: 14px; }
.header h1 { font-size: 1.6rem; letter-spacing: 0.15em; }
.player { font-size: 0.8rem; color: #9b8672; margin-top: 4px; }

.meta-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.meta-badge {
  background: #fffdf8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(120, 80, 40, 0.08);
}

.hidden { display: none !important; }

.link-btn {
  border: none; background: none; color: #c98f5f;
  text-decoration: underline; cursor: pointer; font-size: 0.8rem;
}

.stats {
  background: #fffdf8;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 3px 10px rgba(120, 80, 40, 0.08);
  display: grid;
  gap: 10px;
}

.stat { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: 8px; }
.stat-label { font-size: 0.85rem; }

.bar {
  height: 14px;
  background: #f0e4d4;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc266, #ff9d5c);
  transition: width 0.6s ease;
}

.bar-fill.low { background: linear-gradient(90deg, #ff8a80, #ff5e57); }

.cat-area { text-align: center; margin: 22px 0 10px; }

.cat-wrap { position: relative; display: inline-block; }

#cat-img {
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(120, 80, 40, 0.18));
}

.cat-wrap.bounce #cat-img { animation: bounce 0.5s ease; }

@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-16px) scale(1.05); }
  70% { transform: translateY(0) scale(0.97); }
}

.pop {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  color: #e8853d;
  opacity: 0;
  pointer-events: none;
  font-size: 1.1rem;
  white-space: nowrap;
}

.pop.show { animation: popup 1s ease forwards; }

@keyframes popup {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}

.cat-message {
  margin-top: 8px;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.stage-progress {
  font-size: 0.78rem;
  color: #b8a48e;
}

.poop-badge {
  position: absolute;
  bottom: 4px;
  right: -4px;
  font-size: 1.2rem;
  letter-spacing: -2px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0 24px;
}

.action-btn {
  border: none;
  border-radius: 14px;
  padding: 14px 4px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #5b4636;
  background: #fffdf8;
  box-shadow: 0 3px 0 #e8d5bd, 0 4px 10px rgba(120, 80, 40, 0.1);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.action-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #e8d5bd; }
.action-btn:disabled { opacity: 0.5; cursor: wait; }

.log h2 { font-size: 0.95rem; margin-bottom: 8px; color: #9b8672; }

.log ul { list-style: none; }

.log li {
  background: #fffdf8;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.log .time { color: #b8a48e; font-size: 0.75rem; flex-shrink: 0; }

.death-section {
  background: #fffdf8;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  margin: 14px 0 24px;
  box-shadow: 0 3px 10px rgba(120, 80, 40, 0.08);
}

.death-section p {
  margin-bottom: 14px;
  line-height: 1.6;
}

.memories h2 { font-size: 0.95rem; margin: 20px 0 8px; color: #9b8672; }

.memories ul { list-style: none; }

.memories li {
  background: #fffdf8;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #7a6650;
}

dialog {
  border: none;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(80, 50, 20, 0.25);
}

dialog::backdrop { background: rgba(90, 60, 30, 0.4); }

#name-form { display: grid; gap: 14px; text-align: center; }
#name-form h2 { font-size: 1.1rem; color: #5b4636; }

#name-input {
  border: 2px solid #e8d5bd;
  border-radius: 10px;
  padding: 10px;
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
}

#name-form button {
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #ffab61;
  color: #fff;
  cursor: pointer;
}
