:root {
  --bg: #fff7ec;
  --card: #ffffff;
  --accent: #ff9800;
  --accent-dark: #e65100;
  --text: #333;
  --muted: #777;
  --line: #ffe0b2;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header h1 {
  font-size: 22px;
  margin: 0;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 3px solid var(--accent);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.card h2 {
  font-size: 16px;
  margin: 0 0 8px;
}

.card p {
  margin: 0 0 10px;
  font-size: 14px;
}

.status {
  text-align: center;
}

.status-cat {
  width: 120px;
  height: 120px;
  display: block;
  margin: 0 auto 4px;
}

.breed-preview {
  width: 56px;
  height: 56px;
}

.phase {
  color: var(--muted);
  font-size: 14px;
}

.time {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: 2px;
  margin: 4px 0 12px;
  font-variant-numeric: tabular-nums;
}

.controls,
.cat-btn-row,
.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 22px;
  padding: 10px 18px;
  cursor: pointer;
  background: #eeeeee;
  color: #555;
  transition: filter 0.15s, transform 0.1s;
}

.btn:hover {
  filter: brightness(0.96);
}

.btn:active {
  transform: scale(0.97);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.note {
  font-size: 13px;
  color: #2e7d32;
}

.warn {
  font-size: 13px;
  color: #b71c1c;
  background: #fff3f3;
  border-radius: 10px;
  padding: 10px 12px;
}

code {
  background: #f3f3f3;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
}

.row small {
  color: var(--muted);
  font-weight: 400;
}

.control {
  display: flex;
  align-items: center;
  gap: 8px;
}

select,
input[type="number"] {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  background: #fffdf9;
  width: 110px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.pip-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.pip-row .hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.pip-row .note {
  margin: 6px 0 0;
}

.footnote {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* 고양이 오버레이 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 40, 20, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fade-in 0.3s ease-out;
}

.overlay[hidden] {
  display: none;
}

.cat-box {
  width: min(calc(var(--cat-size, 280px) + 90px), 100%);
  min-width: min(320px, 100%);
  background: #fffaf3;
  border: 3px solid var(--accent);
  border-radius: 20px;
  padding: 18px 20px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: pop-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.cat-img {
  width: min(var(--cat-size, 280px), 100%);
  max-height: 60vh;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  animation: cat-bounce 1.6s ease-in-out infinite;
}

.cat-msg {
  margin: 0;
  max-width: 100%;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  position: relative;
}

.cat-msg::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top: 0;
  border-bottom-color: #fff;
}

.cat-countdown {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    transform: translateY(60px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes cat-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (display-mode: standalone) {
  .app {
    padding-top: 16px;
  }
}
