:root {
  --bg-deep: #0c0618;
  --bg-mid: #120a22;
  --glow-purple: rgba(140, 80, 220, 0.35);
  --glow-pink: rgba(220, 100, 180, 0.2);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #f4f0fc;
  --text-muted: rgba(228, 220, 245, 0.65);
  --accent: #9b6dff;
  --accent-bright: #b894ff;
  --accent-deep: #6b3fd4;
  --radius: 22px;
  --radius-btn: 999px;
  --press-ease: cubic-bezier(0.34, 1.35, 0.64, 1);
  --press-out: 0.22s var(--press-ease);
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui,
    sans-serif;
  --font-display: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 100% 80% at 50% -30%, var(--glow-purple), transparent 55%),
    radial-gradient(circle 280px at 15% 40%, var(--glow-pink), transparent 70%),
    radial-gradient(circle 240px at 90% 75%, rgba(100, 60, 180, 0.25), transparent 65%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 55%);
}

.app {
  max-width: 400px;
  margin: 0 auto;
  padding: 1.15rem 1.2rem 2.75rem;
}

.home-first-screen {
  display: flex;
  flex-direction: column;
  padding-top: 1.2rem;
  padding-bottom: 1.35rem;
}

.home-block {
  flex-shrink: 0;
}

.home-block--title {
  margin-bottom: 1.75rem;
}

.home-block--stats {
  margin-bottom: 2.05rem;
}

.main {
  margin-top: 0;
}

.task-section {
  display: flex;
  flex-direction: column;
}

.home-block--task-heading {
  margin-bottom: 1.4rem;
}

.home-block--task-heading .section-title {
  margin: 0;
}

.home-block--tasks {
  margin-bottom: 1.85rem;
}

.home-block--hint {
  margin-top: 1.45rem;
}

.header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.62rem, 4.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--text);
}

.title-emoji {
  font-size: 1.48rem;
  line-height: 1;
  flex-shrink: 0;
}

.title-text {
  line-height: 1.15;
  color: var(--text);
}

.header-date {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0;
}

@media (max-width: 360px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .stat-glass {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.3rem 0.4rem;
    min-height: unset;
    padding: 0.62rem 0.85rem;
  }

  .stat-num {
    font-size: 1.32rem;
  }
}

.stat-glass {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.15rem;
  padding: 0.55rem 0.35rem;
  min-height: 4.75rem;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-muted);
  max-width: 100%;
}

.stat-unit {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-muted);
  max-width: 100%;
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.8vw, 1.3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.section-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.task-grid {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.task-card {
  width: 100%;
  text-align: left;
  padding: 1rem 1.15rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  transition:
    transform var(--press-out),
    border-color 0.18s ease,
    box-shadow var(--press-out),
    filter 0.12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.task-card:hover {
  border-color: rgba(155, 109, 255, 0.45);
  box-shadow: 0 8px 28px rgba(80, 40, 140, 0.25);
}

.task-card:active {
  transform: scale(0.96);
  filter: brightness(1.08);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}

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

.task-card--selected {
  border-color: rgba(184, 148, 255, 0.65);
  box-shadow:
    0 0 0 1px rgba(184, 148, 255, 0.35),
    0 10px 36px rgba(100, 60, 200, 0.35);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0;
}

.btn {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.88rem 1.25rem;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition:
    transform var(--press-out),
    box-shadow var(--press-out),
    filter 0.12s ease,
    border-color 0.15s ease,
    opacity 0.12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.93);
  filter: brightness(0.92);
}

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

.btn-block {
  width: 100%;
}

.btn-primary {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #faf8ff;
  text-shadow: 0 1px 2px rgba(35, 8, 72, 0.4);
  background: linear-gradient(
    145deg,
    #c9a8f2 0%,
    #a578eb 30%,
    #8b5ae8 55%,
    #6b3fd4 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(140, 95, 220, 0.35),
    0 6px 24px rgba(95, 50, 190, 0.42),
    0 0 28px rgba(130, 80, 220, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.04) saturate(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 0 1px rgba(160, 115, 235, 0.45),
    0 8px 28px rgba(100, 55, 200, 0.48),
    0 0 34px rgba(145, 95, 230, 0.28);
}

.btn-primary:active {
  filter: brightness(0.94);
  box-shadow:
    inset 0 2px 6px rgba(35, 12, 80, 0.4),
    0 0 0 1px rgba(130, 90, 210, 0.3),
    0 3px 14px rgba(75, 40, 170, 0.45);
}

.btn-secondary {
  background: var(--glass);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
  filter: brightness(1.12);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) inset;
}

.hint {
  min-height: 1.2rem;
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 180, 200, 0.85);
}

.calendar-section {
  margin-top: 2.35rem;
  padding: 1rem 0.75rem 1.25rem;
  scroll-margin-top: 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.cal-opens-line {
  margin: 0 0 0.65rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.calendar-title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.cal-nav {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition:
    transform var(--press-out),
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow var(--press-out),
    background 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cal-nav:hover {
  border-color: rgba(155, 109, 255, 0.45);
  color: var(--accent-bright);
}

.cal-nav:active {
  transform: scale(0.88);
  background: rgba(155, 109, 255, 0.22);
  box-shadow: 0 0 0 2px rgba(184, 148, 255, 0.35);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  text-align: center;
  font-size: 0.72rem;
}

.cal-dow {
  padding: 0.35rem 0;
  color: var(--text-muted);
  font-weight: 600;
}

button.cal-cell {
  font-family: inherit;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

button.cal-cell:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.cal-cell {
  position: relative;
  aspect-ratio: 1;
  max-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid transparent;
  background: transparent;
  transition:
    transform var(--press-out),
    background 0.15s ease,
    box-shadow 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cal-cell:not(.cal-cell--muted):active {
  transform: scale(0.9);
  background: rgba(155, 109, 255, 0.2);
}

.cal-cell--selected:not(.cal-cell--muted) {
  box-shadow:
    0 0 0 2px rgba(184, 148, 255, 0.85),
    0 0 12px rgba(155, 109, 255, 0.35);
}

.cal-cell--selected.cal-cell--muted {
  box-shadow: 0 0 0 1px rgba(184, 148, 255, 0.45);
}

.cal-cell--muted {
  color: rgba(228, 220, 245, 0.28);
}

.cal-cell--marked {
  background: rgba(155, 109, 255, 0.32);
  border-color: rgba(184, 148, 255, 0.65);
  color: var(--accent-bright);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(155, 109, 255, 0.2) inset;
}

.cal-cell--marked::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 8px rgba(184, 148, 255, 0.85);
  pointer-events: none;
}

.cal-cell--today:not(.cal-cell--muted):not(.cal-cell--selected) {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.overlay.hidden {
  display: none;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.share-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(400px, calc(100vw - 2rem));
  padding: 1.85rem 1.35rem 1.5rem;
  text-align: center;
  background: linear-gradient(
    165deg,
    rgba(40, 28, 68, 0.92) 0%,
    rgba(22, 14, 42, 0.95) 100%
  );
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(155, 109, 255, 0.12) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.share-done {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.share-persona {
  margin: 0.5rem 0 0;
  font-size: clamp(1.3rem, 4vw, 1.62rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--accent-bright);
  text-shadow: 0 0 28px rgba(155, 109, 255, 0.35);
  white-space: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.share-card .share-stat-line {
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(244, 240, 252, 0.92);
  font-family: var(--font);
  white-space: nowrap;
}

.share-persona + .share-stat-line {
  margin-top: 0.85rem;
}

.share-card .share-stat-line + .share-stat-line {
  margin-top: 0.4rem;
}

.share-card .share-stat-line .share-stat-num {
  display: inline;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1.45;
  vertical-align: baseline;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: -0.02em;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.share-footer-copy {
  margin: 0.85rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(228, 220, 245, 0.52);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-ghost:active {
  background: rgba(255, 255, 255, 0.06);
  filter: brightness(1.08);
}

.site-footer.legal-copy {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.legal-copy p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(228, 220, 245, 0.52);
}

.legal-copy p + p {
  margin-top: 0.45rem;
}

@media (min-width: 420px) {
  .app {
    max-width: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --press-out: 0.08s ease;
  }

  .task-card:active,
  .btn:active,
  .cal-nav:active,
  .cal-cell:not(.cal-cell--muted):active {
    transform: scale(0.98);
  }
}
