:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --purple: #9333ea;
  --purple-dark: #7e22ce;
  --green: #22c55e;
  --green-dark: #16a34a;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
img { display: block; max-width: 100%; }
button, select, a { font: inherit; }
button, select { border: 0; }
.shell { min-height: 100vh; }
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid rgba(229,231,235,0.85);
  backdrop-filter: blur(12px);
}
.wrap {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--purple);
}
.cat-logo {
  width: 34px;
  height: 34px;
}
.brand h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem);
}
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.btn, .select {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.12);
}
.btn:hover, .select:hover { transform: translateY(-1px); }
.btn:active, .select:active { transform: translateY(0); }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-secondary { background: #fff; color: var(--purple); border: 1px solid rgba(124,58,237,0.18); }
.btn-secondary:hover { background: #f5f3ff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.select {
  cursor: pointer;
  background: var(--purple);
  color: #fff;
  border: none;
  min-width: min(320px, 100%);
}
.main { padding: 28px 0 40px; }
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.muted { color: var(--muted); }
.note { font-size: 0.95rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}
.thumb-frame {
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, #ede9fe, #f5f3ff 35%, #f3f4f6);
  position: relative;
  overflow: hidden;
}
.thumb-frame img,
.thumb-placeholder {
  position: absolute;
  inset: 0;
}
.thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}
.thumb-placeholder {
  display: grid;
  place-items: center;
  color: #7c3aed;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 1;
}
.card-copy {
  padding: 14px 16px 16px;
}
.card-copy p { margin: 0; }
.error, .empty, .loading {
  background: #fff;
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.error p, .empty p, .loading p { margin: 0; }
.loading-cat-wrap {
  display:flex;
  justify-content:center;
  margin-bottom:18px;
}
.loading-cat {
  width:48px;
  height:48px;
  color: var(--purple);
  animation: cat-bob 0.9s infinite ease-in-out alternate;
}
@keyframes cat-bob { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.84);
  backdrop-filter: blur(5px);
  padding: 24px;
}
.modal.open { display: flex; }
.modal img {
  max-width: min(92vw, 1400px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 16px;
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  font-size: 24px;
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220,38,38,.42);
  animation: pulse 1.8s infinite;
  margin-right: 10px;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(220,38,38,.42); }
  70% { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1040px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { width: min(100vw - 20px, 1200px); }
  .controls { width: 100%; }
  .controls .btn, .controls .select { width: 100%; }
  .status-row { align-items: flex-start; }
  .nav-row { align-items:stretch; }
  .day-nav { width:100%; justify-content:space-between; }
  .day-nav .nav-btn { flex:1 1 0; min-width:0; }
  .update-tools { width:100%; }
  .update-tools .nav-btn { width:100%; }
}


.nav-row {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:12px;
  margin:0 0 18px;
}
.day-nav, .update-tools {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.nav-btn[disabled] {
  opacity:.45;
  cursor:not-allowed;
  transform:none;
}
.update-banner {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  margin-bottom:18px;
  background:#ede9fe;
  color:#5b21b6;
  border:1px solid rgba(124,58,237,.18);
  border-radius:16px;
}
.small-btn {
  min-height:40px;
  padding:0 14px;
}
.skeleton-grid {
  display:grid;
  grid-template-columns:repeat(1,minmax(0,1fr));
  gap:18px;
  margin-top:24px;
}
.skeleton-card {
  background:#fff;
  border-radius:18px;
  overflow:hidden;
  box-shadow: var(--shadow);
}
.skeleton-box,
.skeleton-line {
  background: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 35%, #ede9fe 70%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton-box { aspect-ratio:16/9; }
.skeleton-line {
  height:14px;
  margin:16px;
  border-radius:999px;
}
.skeleton-line.short { width:36%; }
@keyframes shimmer {
  from { background-position:200% 0; }
  to { background-position:-200% 0; }
}
@media (min-width: 700px) {
  .skeleton-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width: 1040px) {
  .skeleton-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

.date-heading {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.today-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:#ede9fe;
  color:#6d28d9;
  font-size:.82rem;
  font-weight:700;
  border:1px solid rgba(124,58,237,.18);
}
.day-nav {
  flex-wrap:nowrap;
}
.day-nav .nav-btn {
  width:auto !important;
  white-space:nowrap;
}
