:root {
  --bg: #FCEEF2;
  --surface: #ffffff;
  --text: #3A2A30;
  --name: #A3365F;
  --muted: #6E5A62;
  --accent: #C2185B;
  --badge-bg: #F8D5E3;
  --new-bg: #FFF1F5;
  --done-bg: #F3EEEF;
  --done-text: #6E5A62;
  --header-h: 120px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

html, body { overflow-x: hidden; }
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background-image:
    radial-gradient(920px 480px at 8% -8%, rgba(255, 255, 255, 0.72), transparent 62%),
    radial-gradient(780px 520px at 100% 110%, rgba(244, 186, 204, 0.38), transparent 58%);
  background-size: 140% 140%;
  animation: ambient-drift 28s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
  from { background-position: 0% 0%; }
  to { background-position: 80% 30%; }
}

.is-hidden {
  display: none !important;
}

.header {
  min-height: var(--header-h);
  flex: 0 0 auto;
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: clamp(12px, 2.5vw, 20px) clamp(16px, 4vw, 56px);
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: clamp(28px, 3.4vw, 42px);
  padding: 0 16px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--accent);
  font-size: clamp(14px, 1.8vw, 22px);
  font-weight: 700;
  line-height: 1;
}

.status {
  text-align: right;
  flex: 0 0 auto;
}

.updated {
  margin: 0;
  font-size: clamp(13px, 1.8vw, 22px);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}

.interval {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 6px 0 0;
  color: var(--accent);
  font-size: clamp(12px, 1.5vw, 18px);
  font-weight: 500;
  line-height: 1.3;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  padding: clamp(14px, 2.5vw, 28px) clamp(12px, 4vw, 56px) clamp(16px, 3vw, 40px);
  position: relative;
  z-index: 1;
}

.empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mark {
  width: clamp(64px, 8vw, 104px);
  height: clamp(64px, 8vw, 104px);
  margin-bottom: 28px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 52px;
  font-weight: 500;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty h2 {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 44px);
  font-weight: 700;
  line-height: 1.3;
}

.empty .lead {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 24px);
  font-weight: 400;
  line-height: 1.5;
}

.empty .hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(13px, 1.7vw, 20px);
  font-weight: 400;
  line-height: 1.5;
}

.has-cache .skeleton {
  display: none;
}

.skeleton {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vw, 22px);
}

.skeleton-card {
  height: clamp(108px, 16vh, 168px);
  border-radius: 16px;
  background: linear-gradient(100deg, #fff 0%, #fff 40%, #f8e4ec 50%, #fff 60%, #fff 100%);
  background-size: 220% 100%;
  animation: skeleton-sweep 1.8s ease-in-out infinite;
}

@keyframes skeleton-sweep {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.list {
  position: relative;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vw, 22px);
  scrollbar-width: thin;
  scrollbar-color: #E4B8C8 transparent;
  perspective: 1400px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: clamp(16px, 3.2vw, 40px) clamp(16px, 3.2vw, 40px) clamp(18px, 3.4vw, 44px);
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  cursor: pointer;
  touch-action: manipulation;
  text-align: left;
}

.card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.card.is-new {
  background: var(--new-bg);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(194, 24, 91, 0.12);
}

.card.is-done {
  background: var(--done-bg);
  border-color: transparent;
  box-shadow: none;
}

.card.is-done .name,
.card.is-done .time,
.card.is-done .question {
  color: var(--done-text);
}

.card.is-done .new-tag,
.card.is-done .fx,
.card.is-done .shimmer {
  display: none !important;
}

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-width: 0;
}

.name {
  color: var(--name);
  font-size: clamp(16px, 2.3vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  min-width: 0;
}

.time {
  color: var(--muted);
  font-size: clamp(13px, 2vw, 24px);
  font-weight: 400;
  line-height: 1.3;
}

.new-tag {
  display: none;
  position: relative;
  align-items: center;
  margin-left: 10px;
  padding: 4px 10px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.card.is-new .new-tag {
  display: inline-flex;
}

.done-label {
  display: none;
  align-items: center;
  padding: 3px 8px 4px;
  border-radius: 999px;
  background: #E6DDE1;
  color: #5C4E55;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.card.is-done .done-label {
  display: inline-flex;
}

.question {
  margin: clamp(8px, 1.5vw, 18px) 0 0;
  color: var(--text);
  font-size: clamp(18px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.card.is-first {
  animation: card-first 280ms ease both;
}

@keyframes card-first {
  from { opacity: 0.4; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.card.is-armed {
  opacity: 0;
  transform: translate3d(0, 48vh, 0) scale(0.78) rotateX(16deg);
}

.card.is-entering {
  z-index: 2;
  transform-origin: center bottom;
  animation: card-fly 1800ms cubic-bezier(0.18, 1.05, 0.28, 1) both;
}

@keyframes card-fly {
  0% {
    opacity: 0;
    transform: translate3d(0, 48vh, 0) scale(0.78) rotateX(16deg);
  }
  20% {
    opacity: 1;
    transform: translate3d(0, 22vh, 0) scale(0.9) rotateX(8deg);
  }
  58% {
    opacity: 1;
    transform: translate3d(0, -28px, 0) scale(1.06) rotateX(-4deg);
  }
  80% {
    opacity: 1;
    transform: translate3d(0, 12px, 0) scale(0.985) rotateX(1.4deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.card.is-entering .new-tag {
  animation: badge-pop 720ms 480ms cubic-bezier(0.2, 1.6, 0.32, 1) both;
}

@keyframes badge-pop {
  0% { transform: scale(0.15); }
  55% { transform: scale(1.35); }
  78% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.card.is-celebrate .pulse-ring {
  animation: linger-glow 3000ms ease-in-out 1 both;
}

.veil,
.halo,
.pulse-ring,
.burst {
  position: absolute;
  pointer-events: none;
}

.veil {
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  z-index: 3;
}

.shimmer {
  position: absolute;
  inset: -20% 0;
  background: linear-gradient(
    105deg,
    transparent 18%,
    rgba(255, 210, 120, 0.35) 36%,
    rgba(255, 255, 255, 0.92) 50%,
    rgba(255, 154, 190, 0.72) 62%,
    transparent 80%
  );
  transform: translateX(-140%);
  animation: shimmer-sweep 1500ms 180ms ease-in-out 1 both;
}

@keyframes shimmer-sweep {
  to { transform: translateX(140%); }
}

.halo {
  inset: -10px;
  border-radius: 22px;
  border: 3px solid rgba(255, 214, 120, 0.95);
  opacity: 0;
  z-index: 1;
  animation: halo-burst 1600ms ease-out 1 both;
}

@keyframes halo-burst {
  0% {
    opacity: 1;
    transform: scale(0.86);
    box-shadow:
      0 0 0 0 rgba(194, 24, 91, 0.65),
      0 0 28px 6px rgba(255, 196, 72, 0.85);
  }
  45% {
    opacity: 1;
    transform: scale(1.04);
    box-shadow:
      0 0 0 16px rgba(194, 24, 91, 0),
      0 0 54px 16px rgba(255, 186, 72, 0.55);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
    box-shadow:
      0 0 0 28px rgba(194, 24, 91, 0),
      0 0 0 0 rgba(255, 186, 72, 0);
  }
}

.pulse-ring {
  inset: -4px;
  border-radius: 20px;
  z-index: 1;
}

@keyframes linger-glow {
  0% { box-shadow: 0 0 0 0 rgba(194, 24, 91, 0.15), 0 0 0 rgba(255, 196, 90, 0); }
  18% { box-shadow: 0 0 0 7px rgba(194, 24, 91, 0.32), 0 0 32px rgba(255, 196, 90, 0.55); }
  42% { box-shadow: 0 0 0 2px rgba(194, 24, 91, 0.16), 0 0 12px rgba(255, 196, 90, 0.2); }
  68% { box-shadow: 0 0 0 6px rgba(194, 24, 91, 0.26), 0 0 26px rgba(255, 196, 90, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(194, 24, 91, 0), 0 0 0 rgba(255, 196, 90, 0); }
}

.burst {
  left: 50%;
  top: 42%;
  width: 0;
  height: 0;
  z-index: 4;
}

.bit {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  animation: bit-fly 1500ms cubic-bezier(0.16, 0.8, 0.3, 1) var(--delay, 0ms) 1 both;
}

.bit.spark {
  width: var(--size, 8px);
  height: var(--size, 8px);
  margin: calc(var(--size, 8px) / -2) 0 0 calc(var(--size, 8px) / -2);
  border-radius: 50%;
  background: var(--tone, #fff);
  box-shadow: 0 0 10px var(--tone, #fff);
}

.bit.chip {
  width: var(--size, 8px);
  height: var(--size, 8px);
  margin: calc(var(--size, 8px) / -2) 0 0 calc(var(--size, 8px) / -2);
  background: var(--tone, #f5c16c);
  box-shadow: 0 0 8px var(--tone, #f5c16c);
}

.bit.heart {
  width: var(--size, 10px);
  height: var(--size, 10px);
  margin: calc(var(--size, 10px) * -1) 0 0 calc(var(--size, 10px) / -2);
  background: var(--tone, #c2185b);
  animation-name: heart-fly;
}

.bit.heart::before,
.bit.heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.bit.heart::before { left: -50%; top: 0; }
.bit.heart::after { left: 0; top: -50%; }

@keyframes bit-fly {
  0% { opacity: 0; transform: translate(0, 0) scale(0.2) rotate(0deg); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot, 40deg)); }
}

@keyframes heart-fly {
  0% { opacity: 0; transform: translate(0, 0) rotate(45deg) scale(0.2); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(45deg) scale(1); }
}

.card.is-soft {
  animation: soft-fade 480ms ease both;
}

.card.is-soft .pulse-ring {
  animation: soft-highlight 2800ms ease-out 1 both;
}

@keyframes soft-fade {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

@keyframes soft-highlight {
  0% { box-shadow: 0 0 0 0 rgba(194, 24, 91, 0); }
  22% { box-shadow: 0 0 0 5px rgba(194, 24, 91, 0.28), 0 0 18px rgba(255, 196, 90, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(194, 24, 91, 0); }
}

.card.no-motion,
.card.no-motion * {
  animation: none !important;
  transition: none !important;
}

@media (max-width: 600px) {
  .status { text-align: left; }
  .interval { justify-content: flex-start; margin-top: 2px; }
  .card { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .skeleton-card,
  .card.is-first,
  .card.is-entering,
  .card.is-armed,
  .halo,
  .shimmer,
  .bit,
  .card.is-entering .new-tag {
    animation: none !important;
    transition: none !important;
  }
  .card.is-armed { opacity: 1; transform: none; }
  .burst, .halo, .veil { display: none !important; }
  .list { scroll-behavior: auto; }
}

.error {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px clamp(16px, 4vw, 56px);
  background: #FFE3EC;
  color: var(--accent);
  font-size: clamp(13px, 1.6vw, 18px);
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.brand { flex-wrap: wrap; flex: 1 1 auto; }
.brand h1 { white-space: nowrap; }
@media (max-width: 380px) { .brand h1 { white-space: normal; } }
