:root {
  --brand: #8a5a48;
  --brand-mid: #9d6b58;
  --brand-soft: #f3eae6;
  --accent: #ad7fb3;
  --accent-soft: #f4e8f5;
  --page: #f7f5f3;
  --ink: #221c1a;
  --ink-soft: #655a56;
  --line: rgba(138, 90, 72, 0.14);
  --card: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 16px;
  --font-display: "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--page);
  line-height: 1.45;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 65% 42% at 100% 0%, rgba(173, 127, 179, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 0% 28%, rgba(138, 90, 72, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #faf8f6 0%, #f1eeeb 100%);
}

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem
    max(2rem, env(safe-area-inset-bottom));
}

.hero {
  padding: 0.35rem 0.05rem 1rem;
}

.eyebrow {
  margin: 0.85rem 0 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 8vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--brand);
}

.lede {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 450;
  max-width: 34ch;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

#fetched-at {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.refresh {
  appearance: none;
  border: none;
  background: var(--brand);
  color: #faf6f3;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 42px;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(138, 90, 72, 0.28);
}

.refresh:hover {
  background: var(--brand-mid);
}

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

.refresh:disabled {
  opacity: 0.55;
  cursor: wait;
  box-shadow: none;
}

.status {
  margin: 0.1rem 0 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
}

.status.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.18);
}

.card.skeleton {
  pointer-events: none;
  gap: 0.45rem;
  min-height: 8.5rem;
}

.skel {
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(138, 90, 72, 0.07) 0%,
    rgba(173, 127, 179, 0.14) 45%,
    rgba(138, 90, 72, 0.07) 90%
  );
  background-size: 200% 100%;
  animation: skel-shimmer 1.35s ease-in-out infinite;
}

.skel-rank {
  width: 4.2rem;
  height: 1.05rem;
  border-radius: 999px;
}

.skel-name {
  width: 78%;
  height: 1.15rem;
  margin-top: 0.1rem;
}

.skel-line {
  width: 88%;
  height: 0.65rem;
}

.skel-line.short {
  width: 62%;
}

.skel-price {
  width: 3.4rem;
  height: 1.55rem;
  margin-top: 0.35rem;
  border-radius: 10px;
}

@keyframes skel-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: start;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(138, 90, 72, 0.05), 0 8px 24px rgba(34, 28, 26, 0.05);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(138, 90, 72, 0.07), 0 14px 28px rgba(34, 28, 26, 0.1);
}

.card:active {
  transform: scale(0.98);
}

.card.best {
  border-color: rgba(173, 127, 179, 0.42);
  background: linear-gradient(165deg, #f4e8f5 0%, #ffffff 55%);
  box-shadow: 0 1px 0 rgba(173, 127, 179, 0.1), 0 10px 26px rgba(173, 127, 179, 0.14);
}

.rank {
  margin: 0;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(34, 28, 26, 0.06);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  line-height: 1.2;
}

.card.best .rank {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.schedule {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  line-height: 1.25;
}

.schedule.closed {
  color: var(--danger);
}

.validity {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.3;
}

.price-block {
  margin-top: 0.35rem;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.price {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.04em;
  line-height: 1;
}

.unit {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.price.missing {
  color: var(--ink-soft);
  font-size: 1.15rem;
  font-weight: 700;
}

.foot {
  margin-top: 1.4rem;
  padding: 0 0.05rem;
}

.foot p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 450;
  color: var(--ink-soft);
}

.foot a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.foot a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (min-width: 560px) {
  .list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .shell {
    padding-top: 2.25rem;
  }

  .card {
    padding: 1rem;
  }

  .name {
    font-size: 1.12rem;
  }

  .price {
    font-size: 1.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .refresh,
  .card {
    transition: none;
  }

  .card:hover {
    transform: none;
  }

  .skel {
    animation: none;
    background: rgba(138, 90, 72, 0.1);
  }
}
