:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #30283d;
  background: #f7f2ff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #30283d;
  --muted: #625a70;
  --purple: #624187;
  --purple-dark: #4b306e;
  --lavender: #eee6fb;
  --pink: #e7a3c5;
  --line: #e8def3;
  --shadow: 0 22px 60px rgb(68 48 92 / 11%);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 7% 20%, rgb(216 192 247 / 48%) 0 4px, transparent 5px),
    radial-gradient(circle at 90% 12%, rgb(236 177 208 / 34%) 0 5px, transparent 6px),
    radial-gradient(circle at 86% 80%, rgb(216 192 247 / 40%) 0 4px, transparent 5px),
    linear-gradient(145deg, #faf7ff 0%, #f7f1ff 52%, #fff4fa 100%);
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #875cb4;
  outline-offset: 3px;
}

.page-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 22px;
}

.topbar,
.brand,
.date-pill,
.card-heading,
.progress-topline,
.progress-footer,
.footer-note {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #e1d2f0;
  border-radius: 16px;
  background: #f0e5fb;
}

.brand-sticker {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgb(56 38 73 / 12%));
}

.date-pill {
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgb(217 204 233 / 80%);
  border-radius: 999px;
  background: rgb(255 252 255 / 86%);
  color: #554b65;
  font-size: 13px;
}

.date-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d77eac;
  box-shadow: 0 0 0 4px rgb(215 126 172 / 18%);
}

.hero-card {
  position: relative;
  display: grid;
  min-height: 410px;
  grid-template-columns: 1.08fr .92fr;
  overflow: hidden;
  border: 1px solid rgb(225 214 238 / 90%);
  border-radius: 32px;
  background: #fffaff;
  box-shadow: var(--shadow);
}

.hero-copy {
  z-index: 1;
  align-self: center;
  padding: 38px 8px 38px 54px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 15px;
  color: #644285;
  font-size: 13px;
  font-weight: 750;
}

h1 {
  margin: 0;
  color: #30283d;
  font-size: clamp(32px, 3.7vw, 45px);
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1.25;
}

h1 span {
  color: #784e9a;
}

.hero-note {
  max-width: 370px;
  margin: 12px 0 23px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.countdown-label {
  margin: 0 0 9px;
  color: #5e536f;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .04em;
}

.countdown {
  display: flex;
  min-height: 72px;
  align-items: flex-start;
  gap: clamp(7px, 1.4vw, 15px);
  color: #342b43;
  font-variant-numeric: tabular-nums;
}

.time-unit {
  display: flex;
  min-width: 65px;
  flex-direction: column;
  align-items: center;
}

.time-number {
  font-size: clamp(42px, 5.6vw, 63px);
  font-weight: 850;
  letter-spacing: -.05em;
  line-height: 1;
}

.time-caption {
  margin-top: 7px;
  color: #655b72;
  font-size: 11px;
}

.time-colon {
  padding-top: 1px;
  color: #9a78b7;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.countdown:not([data-mode="standard"]) .time-unit,
.countdown:not([data-mode="standard"]) .time-colon {
  display: none;
}

.countdown-total {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: #342b43;
  font-variant-numeric: tabular-nums;
}

.countdown[data-mode="standard"] .countdown-total {
  display: none;
}

.total-number {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(46px, 6vw, 68px);
  font-weight: 850;
  letter-spacing: -.05em;
  line-height: 1;
  text-overflow: ellipsis;
}

.total-unit {
  flex: 0 0 auto;
  color: #655b72;
  font-size: 13px;
  font-weight: 700;
}

.target-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 19px;
  padding: 9px 14px;
  border: 1px solid #ead9eb;
  border-radius: 999px;
  background: #fff3fa;
  color: #51465f;
  font-size: 12px;
}

.target-chip strong {
  color: #372d44;
  font-size: 13px;
}

.target-icon {
  color: #ad5484;
  font-size: 16px;
}

.chip-divider {
  padding: 0 4px;
  color: #8e789e;
}

.hero-art {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 11px 22px 28px 0;
  background: radial-gradient(ellipse at 52% 54%, #eee4fb 0%, #f8effb 52%, transparent 74%);
}

.kuromi-scene {
  display: block;
  width: min(100%, 440px);
  height: auto;
  filter: drop-shadow(0 12px 14px rgb(65 48 85 / 12%));
}

.art-sparkle {
  position: absolute;
  z-index: 1;
  color: #bd75a2;
  animation: float 3.2s ease-in-out infinite;
}

.sparkle-one {
  top: 14%;
  right: 12%;
  font-size: 27px;
}

.sparkle-two {
  top: 25%;
  left: 9%;
  color: #8f76b2;
  font-size: 23px;
  animation-delay: .8s;
}

.art-caption {
  position: absolute;
  right: 29px;
  bottom: 17px;
  color: #554b65;
  font-size: 12px;
}

.art-caption span {
  color: #b84e87;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.card {
  min-width: 0;
  padding: 23px 25px 18px;
  border: 1px solid rgb(225 214 238 / 90%);
  border-radius: 24px;
  background: rgb(255 252 255 / 94%);
  box-shadow: 0 12px 35px rgb(68 48 92 / 7%);
}

.card-heading {
  gap: 12px;
}

.card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: #eee6fb;
  color: #68468c;
  font-size: 23px;
}

.icon-sticker {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgb(56 38 73 / 10%));
}

.clock-icon {
  background: #fff0f8;
  color: #a84f7d;
}

.card-heading h2 {
  margin: 0;
  color: #392f48;
  font-size: 15px;
  font-weight: 800;
}

.card-heading p {
  margin: 5px 0 0;
  color: #665c73;
  font-size: 11px;
}

.settings-form {
  display: grid;
  gap: 12px;
  margin-top: 17px;
}

.time-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.time-field,
.mode-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #51465f;
  font-size: 12px;
  font-weight: 750;
}

.time-field input,
.mode-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid #ded1eb;
  border-radius: 13px;
  background: #fffaff;
  color: #392f48;
  font-size: 15px;
  font-weight: 750;
}

.mode-field select {
  cursor: pointer;
}

.settings-form button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 0;
  border-radius: 13px;
  background: #5b397f;
  box-shadow: 0 5px 12px rgb(84 53 119 / 22%);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: transform .18s ease, background-color .18s ease;
}

.settings-form button:hover {
  transform: translateY(-1px);
  background: #482b69;
}

.settings-form button:active {
  transform: translateY(0);
}

.save-status {
  min-height: 16px;
  margin: 9px 0 0;
  color: #625970;
  font-size: 11px;
}

.save-status.is-warning {
  color: #78384f;
}

.progress-topline {
  justify-content: space-between;
  gap: 16px;
}

.leaf-icon {
  background: #f1eafa;
  color: #72508e;
  font-size: 19px;
}

.progress-percent {
  color: #654384;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.progress-card progress {
  display: block;
  width: 100%;
  height: 11px;
  margin-top: 20px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #eee7f5;
  color: #7a579c;
  appearance: none;
  -webkit-appearance: none;
}

.progress-card progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #eee7f5;
}

.progress-card progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #d68eb7, #79549e);
  transition: width .6s ease;
}

.progress-card progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #d68eb7, #79549e);
}

.progress-footer {
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: #625970;
  font-size: 10px;
}

.progress-footer span:nth-child(2) {
  color: #49395a;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.footer-note {
  justify-content: center;
  gap: 12px;
  margin-top: 19px;
  color: #5f566c;
  font-size: 12px;
}

.footer-note p {
  margin: 0;
}

.footer-note span {
  color: #8d65ae;
}

.footer-note img {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
}

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 30px, 560px);
    padding-top: 16px;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    border-radius: 26px;
  }

  .hero-copy {
    padding: 29px 26px 0;
  }

  h1 {
    font-size: clamp(34px, 8vw, 43px);
  }

  .hero-note {
    margin-bottom: 20px;
  }

  .time-unit {
    min-width: 61px;
  }

  .time-number {
    font-size: clamp(46px, 13vw, 60px);
  }

  .hero-art {
    min-height: 282px;
    padding: 0 20px 27px;
  }

  .kuromi-scene {
    width: min(100%, 380px);
  }

  .art-caption {
    right: 23px;
    bottom: 12px;
  }

  .lower-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }

  .card {
    padding: 19px 20px 15px;
    border-radius: 21px;
  }
}

@media (max-width: 390px) {
  .page-shell {
    width: calc(100% - 22px);
  }

  .brand {
    font-size: 14px;
  }

  .date-pill {
    padding: 8px 10px;
    font-size: 11px;
  }

  .hero-copy {
    padding-right: 18px;
    padding-left: 20px;
  }

  .countdown {
    gap: 5px;
  }

  .time-unit {
    min-width: 55px;
  }

  .time-number {
    font-size: 43px;
  }

  .time-colon {
    font-size: 29px;
  }

  .total-number {
    font-size: clamp(40px, 12vw, 50px);
  }

  .time-fields {
    gap: 8px;
  }

  .card {
    padding-right: 16px;
    padding-left: 16px;
  }

  .progress-footer {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
