:root {
  --sky-top: #8ecae6;
  --sky-mid: #b8e0d2;
  --meadow: #d8f3dc;
  --leaf: #2d6a4f;
  --leaf-deep: #1b4332;
  --cream: #fff8f0;
  --ink: #1d3557;
  --ink-soft: #457b9d;
  --card: rgba(255, 248, 240, 0.94);
  --shadow: 0 8px 24px rgba(29, 53, 87, 0.12);
  --radius: 18px;
  --tap: 48px;
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --flavor-accent: var(--leaf);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, #ffe8a3 0%, transparent 45%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 38%, var(--meadow) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='8' cy='12' r='2' fill='%23ffffff55'/%3E%3Ccircle cx='42' cy='28' r='1.5' fill='%23ffffff44'/%3E%3Ccircle cx='22' cy='48' r='1.8' fill='%23ffffff33'/%3E%3C/svg%3E");
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(76px + var(--safe-bottom));
}

.brand {
  padding: 1.1rem 1.15rem 0.5rem;
  text-align: center;
  animation: float-in 0.55s ease-out both;
}

.brand-mark {
  display: inline-flex;
  margin-bottom: 0.35rem;
}

.brand-mark svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 8px rgba(29, 53, 87, 0.15));
  animation: bob 3.2s ease-in-out infinite;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.65rem, 6vw, 2rem);
  letter-spacing: 0.02em;
  color: var(--leaf-deep);
  line-height: 1.15;
}

.brand p {
  margin: 0.25rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.panel {
  display: none;
  flex: 1;
  padding: 0.5rem 1rem 1rem;
  animation: float-in 0.4s ease-out both;
}

.panel.is-active {
  display: block;
}

.hint-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  border: 2px solid rgba(45, 106, 79, 0.12);
}

.hint-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--leaf);
}

.hint-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.flavor-chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0.25rem 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(184, 224, 210, 0.95) 55%, transparent);
  margin: 0 -0.25rem;
}

.flavor-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 2px 8px rgba(29, 53, 87, 0.08);
  cursor: pointer;
}

.chip:active {
  transform: scale(0.96);
}

.chip.is-active {
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.22);
  transform: translateY(-1px);
}

.flavor-banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border-left: 6px solid var(--flavor-accent, var(--leaf));
}

.flavor-banner .icon-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.flavor-banner .icon-wrap svg {
  width: 48px;
  height: 48px;
}

.flavor-banner h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.flavor-banner p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.food-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.food-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.7rem;
  align-items: center;
  background: var(--card);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  box-shadow: 0 3px 12px rgba(29, 53, 87, 0.08);
  animation: pop-in 0.35s ease-out both;
}

.food-item .glyph {
  width: 44px;
  height: 44px;
  color: var(--flavor-accent, var(--leaf));
}

.food-item strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
}

.food-item .note {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.1rem;
}

.kind-tag {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--leaf);
  background: rgba(45, 106, 79, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.fossil-progress {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow);
}

.fossil-progress .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.fossil-progress strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.fossil-progress .row span {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #52b788, #2d6a4f);
  transition: width 0.35s ease;
}

.fossil-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  min-height: var(--tap);
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  border: 2px solid rgba(45, 106, 79, 0.25);
  background: var(--cream);
  color: var(--leaf-deep);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.btn:active {
  transform: scale(0.97);
}

.btn-danger {
  border-color: rgba(224, 122, 95, 0.45);
  color: #9b3b2e;
  background: #fff0eb;
}

.fossil-set {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.fossil-set-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.35), transparent);
  border-bottom: 1px solid rgba(29, 53, 87, 0.06);
}

.fossil-set-header svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.fossil-set-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.fossil-set-header p {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.fossil-set-meta {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--leaf);
  white-space: nowrap;
}

.fossil-piece {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--tap);
  padding: 0.55rem 0.9rem;
  border: 0;
  width: 100%;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-top: 1px solid rgba(29, 53, 87, 0.05);
}

.fossil-piece:active {
  background: rgba(45, 106, 79, 0.06);
}

.fossil-piece.is-done {
  background: rgba(82, 183, 136, 0.12);
}

.check {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2.5px solid var(--leaf);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #fff;
  color: #fff;
}

.fossil-piece.is-done .check {
  background: var(--leaf);
  transform: scale(1.05);
}

.check svg {
  width: 16px;
  height: 16px;
  opacity: 0;
}

.fossil-piece.is-done .check svg {
  opacity: 1;
}

.tab-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem calc(0.55rem + var(--safe-bottom));
  background: rgba(255, 248, 240, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(29, 53, 87, 0.08);
  box-shadow: 0 -8px 24px rgba(29, 53, 87, 0.08);
  z-index: 20;
}

.tab {
  min-height: var(--tap);
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab.is-active {
  background: rgba(45, 106, 79, 0.14);
  color: var(--leaf-deep);
}

.credit {
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
  padding: 0.75rem 1rem 0.25rem;
  opacity: 0.85;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
