:root {
  --stone: #ffe4f1;
  --ink: #5c2a3d;
  --paper: #fffdfb;
  --muted: #b06b88;
  --line: #ff8dc7;
  --pink: #ff8dc7;
  --pink-deep: #e84b8a;
  --bow: #ff4d8d;
  --abertura: #f4b183;
  --intermedio: #a9d08e;
  --fechamento: #ff99cc;
  --weekend: #bdd7ee;
  --out: #d9d9d9;
  --title: #ff6600;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 245, 250, 0.55), rgba(255, 228, 241, 0.7)),
    url("/img/hk-wallpaper.png") center / cover no-repeat fixed;
  color: var(--ink);
  font-family: Sora, sans-serif;
}
button, input, select { font-family: inherit; }

.kitty-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 28px 36px;
  padding: 18px;
  align-items: center;
  justify-items: center;
}
.kitty {
  width: min(140px, 18vw);
  height: auto;
  max-height: 28vh;
  object-fit: contain;
  border-radius: 24px;
  animation: kitty-float 7s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(232, 75, 138, 0.22));
}
.kitty:nth-child(odd) { animation-delay: -2.4s; }
.kitty:nth-child(3n) { animation-delay: -4.1s; }

@keyframes kitty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.frame {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 calc(80px + env(safe-area-inset-bottom));
}

.hero { margin-bottom: 28px; animation: rise 0.7s cubic-bezier(.16,1,.3,1); }
.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--pink-deep);
  font-weight: 700;
}
.bow {
  width: 10px;
  height: 10px;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  margin: 0 10px 0 8px;
  background: var(--bow);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 0 rgba(182, 29, 99, 0.2);
  z-index: 1;
}
.bow::before,
.bow::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 16px;
  height: 16px;
  background: var(--bow);
  border: 2px solid #fff;
  border-radius: 70% 70% 55% 55%;
  z-index: -1;
}
.bow::before { left: -14px; transform: rotate(-32deg); }
.bow::after { right: -14px; transform: rotate(32deg); }

.hero-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}
.hero h1 {
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(32px, 4.6vw, 58px);
  font-weight: 500;
  line-height: 0.95;
  max-width: 14ch;
  font-style: italic;
  color: #c2185b;
}

.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tab, .ghost, .btn-line, .btn-black {
  border: 2px solid var(--pink-deep);
  background: #fff;
  color: var(--pink-deep);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.tab:hover, .ghost:hover, .btn-line:hover {
  transform: translateY(-1px);
  background: #ffe0ef;
  box-shadow: 0 6px 0 rgba(232, 75, 138, 0.15);
}
.tab.is-active, .btn-black {
  background: var(--pink-deep);
  border-color: var(--pink-deep);
  color: white;
  box-shadow: 0 6px 0 #b61d63;
}
.btn-black:hover { transform: translateY(-1px); background: var(--bow); }
.ghost { width: 44px; height: 44px; padding: 0; font-size: 20px; }

.view { display: none; }
.view.is-active { display: block; animation: rise 0.45s ease; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.month-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.month-line h2 {
  font-family: Newsreader, Georgia, serif;
  font-size: 42px;
  font-weight: 500;
  min-width: 240px;
  text-align: center;
  color: #c2185b;
}
.hint { color: var(--muted); font-size: 13px; margin-left: auto; max-width: 420px; }

.stamp-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.stamp-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--pink);
  background: white;
  color: #c2185b;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: grab;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.chip:hover { transform: translateY(-2px) rotate(-2deg); background: #fff0f7; }
.chip.is-on { background: var(--pink-deep); border-color: var(--pink-deep); color: white; cursor: pointer; }

.pattern {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
}
.pattern select, .people-form input, .people-list input {
  border: 2px solid var(--pink);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 10px;
  min-width: 120px;
  font-size: 16px;
}

.paper {
  background: var(--paper);
  border: 2px solid #ffb6d9;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px 18px 8px 8px;
  box-shadow: 12px 12px 0 rgba(232, 75, 138, 0.16);
}

.week + .week { border-top: 10px solid var(--paper); }
.grid {
  display: grid;
  grid-template-columns: 140px repeat(7, minmax(108px, 1fr));
}
.cell {
  min-height: 44px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
}
.grid > :nth-child(-n+8) { border-top: 1px solid #000; }
.grid > :nth-child(8n+1) { border-left: 1px solid #000; }

.title-row {
  display: flex;
  width: 100%;
  background: var(--title);
  color: #000;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  min-height: 52px;
  border: 1px solid #000;
  border-bottom: 0;
}

.head { background: #000; color: #fff; font-size: 11px; letter-spacing: 0.03em; }
.head.out { color: #8d8d8d; }
.label.abertura { background: var(--abertura); }
.label.intermedio { background: var(--intermedio); }
.label.fechamento { background: var(--fechamento); }

.slot {
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
@media (hover: hover) {
  .slot:hover { transform: scale(1.03); z-index: 1; box-shadow: 0 8px 18px rgba(0,0,0,0.12); }
}
.slot.empty { color: #b0b0b0; font-weight: 600; }
.slot.weekend { background: var(--weekend); }
.slot.out { background: var(--out); cursor: default; color: transparent; }
.slot.out:hover { transform: none; box-shadow: none; }

.people {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
}
.people-form, .people-list-wrap {
  background: var(--paper);
  border: 2px solid #ffb6d9;
  padding: 24px;
  border-radius: 24px;
  box-shadow: 10px 10px 0 rgba(232, 75, 138, 0.14);
}
.people h2 { font-family: Newsreader, Georgia, serif; font-size: 32px; font-weight: 500; color: #c2185b; }
.people-form p { color: var(--muted); margin: 8px 0 16px; }
.people-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 16px; }
.people-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.count {
  border: 2px solid var(--pink-deep);
  background: #ffe0ef;
  color: var(--pink-deep);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.people-list { list-style: none; display: grid; gap: 8px; }
.person {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.tiny { padding: 8px 12px; font-size: 12px; }
.danger { color: #e11d48; }

.picker {
  position: fixed;
  z-index: 20;
  min-width: 220px;
  max-height: 320px;
  overflow: auto;
  background: white;
  border: 2px solid var(--pink-deep);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 8px 8px 0 rgba(232, 75, 138, 0.2);
  animation: rise 0.18s ease;
}
.picker-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 8px; color: var(--pink-deep); }
.picker button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  cursor: pointer;
  font-weight: 700;
  border-radius: 12px;
  color: var(--ink);
}
.picker button:hover { background: var(--pink-deep); color: #fff; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--pink-deep);
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 8px 0 #b61d63;
  animation: rise 0.25s ease;
}

@media (max-width: 900px) {
  .frame { width: calc(100% - 20px); padding-top: 18px; }
  .hero-row, .people, .stamp-bar { display: grid; }
  .hero-actions { width: 100%; }
  .hero-actions .tab, .hero-actions .btn-black { flex: 1; text-align: center; min-height: 44px; }
  .hero h1 { font-size: 30px; max-width: none; }
  .month-line {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    justify-items: center;
  }
  .month-line h2 { font-size: 28px; min-width: 0; }
  .hint { margin-left: 0; max-width: none; grid-column: 1 / -1; text-align: center; }
  .pattern { width: 100%; }
  .pattern select, .pattern .btn-line { flex: 1; min-width: 0; min-height: 44px; }
  .paper { box-shadow: none; }
  .title-row { font-size: 14px; min-height: 42px; letter-spacing: 0; padding: 8px; }
  .grid { grid-template-columns: 88px repeat(7, minmax(86px, 1fr)); }
  .week { min-width: 720px; }
  .cell { font-size: 10px; min-height: 40px; padding: 4px 2px; }
  .ghost { min-width: 44px; min-height: 44px; }
  .chip { min-height: 40px; }
  .picker { left: 12px !important; right: 12px; width: auto; min-width: 0; max-width: none; }
  .toast { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .kitty-bg {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 16px;
    padding: 8px;
  }
  .kitty { width: min(92px, 28vw); max-height: 16vh; }
}

@media (max-width: 520px) {
  .kitty-bg { grid-template-columns: repeat(2, 1fr); }
  .kitty:nth-child(n+9) { display: none; }
}
