/* ============================================================
   番茄岛 · 弹窗 / 签到 / 设置 / 扭蛋结果 / 庆祝
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(40, 30, 20, 0.4);
  backdrop-filter: blur(12px) saturate(0.9);
  -webkit-backdrop-filter: blur(12px) saturate(0.9);
  opacity: 0;
  transition: opacity 0.24s var(--ease-soft);
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(ellipse 75% 45% at 50% 0%, color-mix(in srgb, var(--surface-2) 50%, transparent), transparent 65%),
    var(--surface);
  box-shadow: 0 34px 100px rgba(35, 24, 14, 0.3);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.28s var(--ease-soft), transform 0.38s var(--ease-spring);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.modal::-webkit-scrollbar {
  width: 8px;
}

.modal::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
}

.modal-backdrop.is-open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 28px 17px;
}

.modal-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.modal-head h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.modal-close {
  flex: none;
  width: 36px;
  height: 36px;
  border-color: transparent;
  background: var(--surface-2);
}

.modal-close:hover {
  transform: rotate(90deg);
  border-color: var(--line);
  color: var(--primary);
}

.modal-close .icon {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 0 28px 27px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 7px -28px -27px;
  padding: 15px 28px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
}

.save-note {
  margin-right: auto;
  color: var(--muted);
  font-size: 9px;
}

/* ---------- settings ---------- */
.settings-modal {
  width: min(760px, 100%);
}

.settings-body {
  padding-bottom: 0;
}

.setting-block {
  padding: 19px 0 21px;
  border-top: 1px solid var(--line);
}

.setting-block:first-child {
  border-top: 0;
  padding-top: 4px;
}

.setting-block-head {
  margin-bottom: 15px;
}

.setting-block-head h3,
.danger-block h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.setting-block-head p,
.danger-block p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.duration-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-strong) 55%, transparent);
}

.duration-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
}

.duration-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.duration-dot.short { background: var(--leaf); }
.duration-dot.long { background: var(--accent); }

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.stepper button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 28px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 15px;
  transition: background 0.2s, color 0.2s;
}

.stepper button:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.stepper input {
  width: 36px;
  height: 25px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-digit);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.duration-unit {
  color: var(--muted);
  font-size: 8px;
  text-align: right;
}

.rounds-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 48%, transparent);
}

.rounds-field > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rounds-field strong {
  font-size: 11px;
  font-weight: 650;
}

.rounds-field small {
  color: var(--muted);
  font-size: 9px;
}

.rounds-control {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.rounds-control input {
  width: 120px;
  accent-color: var(--primary);
}

.rounds-control output {
  min-width: 36px;
  color: var(--primary);
  font-family: var(--font-digit);
  font-size: 11px;
  text-align: right;
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-row > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-row strong {
  font-size: 11px;
  font-weight: 600;
}

.switch-row small {
  color: var(--muted);
  font-size: 9px;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 23px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--surface-3);
  transition: background 0.22s, border-color 0.22s;
}

.switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: 0 2px 5px rgba(60, 40, 20, 0.16);
  transition: transform 0.28s var(--ease-spring);
}

.switch-row input:checked + .switch {
  border-color: var(--primary);
  background: var(--primary);
}

.switch-row input:checked + .switch::after {
  transform: translateX(17px);
}

.switch-row input:focus-visible + .switch {
  outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent);
  outline-offset: 3px;
}

.switch-row.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.volume-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-strong) 46%, transparent);
}

.volume-field > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-size: 10px;
}

.volume-field .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.volume-field input {
  width: 130px;
  accent-color: var(--primary);
}

.volume-field output {
  min-width: 37px;
  color: var(--primary);
  font-family: var(--font-digit);
  font-size: 10px;
  text-align: right;
}

.danger-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  margin: 2px 0 24px;
  border: 1px dashed color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--danger-soft) 32%, transparent);
}

.danger-block .danger-button {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  font-size: 10px;
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  color: var(--danger);
  box-shadow: none;
}

.danger-block .danger-button:hover {
  color: #fff8f2;
  background: var(--danger);
}

/* ---------- check-in modal ---------- */
.checkin-modal {
  width: min(640px, 100%);
}

.checkin-modal-head {
  align-items: center;
  padding-bottom: 13px;
}

.checkin-modal-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.checkin-modal-tomato {
  display: grid;
  place-items: center;
  flex: none;
  width: 57px;
  height: 57px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  transform: rotate(-4deg);
}

.checkin-modal-tomato svg {
  width: 49px;
  height: 49px;
}

.checkin-modal-body {
  padding-top: 0;
}

.checkin-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(ellipse 80% 100% at 100% 0%, var(--accent-soft), transparent 65%),
    var(--surface-2);
}

.streak-summary {
  display: flex;
  align-items: center;
  gap: 9px;
}

.streak-flame {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.streak-flame .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.streak-summary p {
  color: var(--text-soft);
  font-size: 11px;
}

.streak-summary strong {
  color: var(--primary);
  font-family: var(--font-digit);
  font-size: 17px;
}

.checkin-today-reward {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.checkin-today-reward > strong {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  font-family: var(--font-digit);
  font-size: 17px;
  font-weight: 600;
}

.checkin-today-reward svg {
  width: 16px;
  height: 16px;
}

.checkin-today-reward b {
  font-weight: 600;
}

.calendar-panel {
  margin-top: 16px;
  padding: 15px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 50%, transparent);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 11px;
}

.calendar-head > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.calendar-head strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.calendar-head span {
  color: var(--muted);
  font-size: 8px;
}

.calendar-head .icon-button {
  background: transparent;
}

.calendar-head .icon-button:disabled {
  opacity: 0.25;
  pointer-events: none;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.calendar-weekdays {
  padding: 5px 0 7px;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text-soft);
  font-family: var(--font-digit);
  font-size: 10px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.calendar-day.is-blank {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.calendar-day.is-today {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.calendar-day.is-checked {
  background: var(--leaf);
  color: var(--surface-strong);
}

.calendar-day.is-checked.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.calendar-day.is-future {
  opacity: 0.3;
}

.calendar-mark {
  position: absolute;
  right: -1px;
  top: -2px;
  display: grid;
  place-items: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--leaf);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--leaf) 30%, transparent);
}

.calendar-mark .icon {
  width: 7px;
  height: 7px;
}

.streak-reward-path {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2px;
  margin: 17px 0 15px;
}

.streak-step {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.streak-step-dot {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-digit);
  font-size: 9px;
}

.streak-step-dot .icon {
  width: 11px;
  height: 11px;
}

.streak-step.is-passed .streak-step-dot {
  border-color: var(--leaf);
  background: var(--leaf);
  color: var(--surface-strong);
}

.streak-step.is-today .streak-step-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent);
}

.streak-step-label {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streak-step-reward {
  color: var(--accent);
  font-family: var(--font-digit);
  font-size: 8px;
}

.checkin-submit {
  height: 46px;
  font-size: 12px;
}

.checkin-submit:disabled {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
}

.checkin-footnote {
  margin-top: 10px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- guide ---------- */
.guide-modal {
  width: min(820px, 100%);
}

.guide-intro {
  margin-bottom: 19px;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.8;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.guide-step {
  position: relative;
  min-height: 190px;
  padding: 17px 15px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface-strong) 48%, transparent);
}

.guide-number {
  position: absolute;
  right: 12px;
  top: 9px;
  color: var(--line-strong);
  font-family: var(--font-digit);
  font-size: 24px;
  font-weight: 600;
}

.guide-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.guide-icon .icon {
  width: 19px;
  height: 19px;
}

.guide-step h3 {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.guide-step p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.75;
}

.guide-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-soft) 34%, transparent);
}

.guide-note > span {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.guide-note .icon {
  width: 14px;
  height: 14px;
}

.guide-note p {
  color: var(--text-soft);
  font-size: 9px;
  line-height: 1.7;
}

.guide-note strong {
  color: var(--primary);
}

.guide-body .modal-actions {
  margin-top: 19px;
}

/* ---------- confirm ---------- */
.confirm-modal {
  width: min(430px, 100%);
  padding: 30px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.confirm-icon.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-icon .icon {
  width: 23px;
  height: 23px;
}

.confirm-modal h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.confirm-modal > p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.confirm-actions > button {
  flex: 1;
}

/* ---------- gacha result modal ---------- */
.gacha-result-modal {
  width: min(980px, 100%);
}

.gacha-result-head {
  padding-bottom: 13px;
}

.gacha-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 9px;
  padding: 3px 0 18px;
}

.gacha-results:has(.gacha-result-card:only-child) {
  grid-template-columns: minmax(0, 220px);
  justify-content: center;
}

.gacha-result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 10px 11px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rarity-color) 28%, var(--line));
  border-radius: 15px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, var(--rarity-soft), transparent 70%),
    var(--surface);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  animation: gacha-card-in 0.48s var(--ease-spring) forwards;
  animation-delay: calc(var(--i) * 55ms + 80ms);
}

.gacha-result-card.is-dupe {
  opacity: 0.72;
}

@keyframes gacha-card-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gacha-result-rarity {
  position: absolute;
  left: 10px;
  top: 9px;
  z-index: 4;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--rarity-soft);
  color: var(--rarity-color);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.gacha-result-type {
  margin-top: 8px;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.gacha-result-card h3 {
  overflow: hidden;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gacha-result-status {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.gacha-result-card.is-new .gacha-result-status {
  color: var(--leaf);
  font-weight: 600;
}

.gacha-result-card.is-dupe .gacha-result-status {
  color: var(--accent);
}

.gacha-result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.result-balance {
  color: var(--muted);
  font-size: 9px;
}

.result-balance strong {
  margin-left: 4px;
  color: var(--accent);
  font-family: var(--font-digit);
  font-size: 17px;
  font-weight: 600;
}

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

.result-actions button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 10px;
}

.result-actions button:disabled {
  opacity: 0.5;
}

/* ---------- celebration ---------- */
.celebration-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 40%),
    rgba(30, 22, 15, 0.72);
  backdrop-filter: blur(10px) saturate(0.9);
  -webkit-backdrop-filter: blur(10px) saturate(0.9);
  opacity: 0;
  transition: opacity 0.3s var(--ease-soft);
}

.celebration-backdrop.is-open {
  opacity: 1;
}

.celebration-rays {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: min(920px, 140vw);
  height: min(920px, 140vw);
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    color-mix(in srgb, var(--accent) 13%, transparent) 0deg 5deg,
    transparent 5deg 13deg
  );
  mask: radial-gradient(circle, #000 0 40%, transparent 72%);
  transform: translate(-50%, -50%);
  animation: rotate-slow 80s linear infinite;
  opacity: 0.75;
}

.celebration-backdrop > .fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.celebration-card {
  position: relative;
  z-index: 2;
  width: min(485px, 100%);
  padding: 28px 31px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 33px;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, color-mix(in srgb, var(--accent-soft) 65%, transparent), transparent 70%),
    linear-gradient(160deg, var(--surface-strong), var(--surface));
  box-shadow:
    0 40px 110px rgba(24, 15, 8, 0.38),
    0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
  text-align: center;
  opacity: 0;
  transform: translateY(26px) scale(0.94);
  transition: opacity 0.35s var(--ease-soft), transform 0.55s var(--ease-spring);
}

.celebration-backdrop.is-open .celebration-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.celebration-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line-strong) 0.75px, transparent 0.75px);
  background-size: 18px 18px;
  opacity: 0.22;
  mask-image: radial-gradient(ellipse at 50% 25%, #000, transparent 75%);
  pointer-events: none;
}

.confetti-chip {
  position: absolute;
  z-index: 2;
  width: 7px;
  height: 15px;
  border-radius: 2px;
  opacity: 0.75;
  animation: chip-float 5s ease-in-out infinite;
}

.chip-one { left: 6%; top: 13%; background: var(--primary); transform: rotate(24deg); }
.chip-two { right: 6%; top: 11%; width: 6px; height: 12px; background: var(--accent); transform: rotate(-32deg); animation-delay: -1.4s; }
.chip-three { left: 5%; bottom: 10%; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); animation-delay: -2.6s; }
.chip-four { right: 5%; bottom: 8%; width: 5px; height: 13px; background: var(--primary-light); transform: rotate(50deg); animation-delay: -3.4s; }

@keyframes chip-float {
  0%, 100% { translate: 0 0; opacity: 0.35; }
  50% { translate: 0 -11px; opacity: 0.9; }
}

.complete-kicker {
  position: relative;
  z-index: 2;
  display: inline-block;
  color: var(--primary);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.complete-mascot {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 122px;
  height: 122px;
  margin: 7px auto 3px;
}

.mascot-halo {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  animation: halo-breathe 3s ease-in-out infinite;
}

.complete-mascot svg {
  position: relative;
  width: 104px;
  height: 104px;
  filter: drop-shadow(0 11px 16px rgba(90, 38, 22, 0.16));
  animation: celebration-bob 2.8s ease-in-out infinite;
}

@keyframes halo-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.65; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes celebration-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

.complete-star {
  position: absolute;
  color: var(--accent);
  font-size: 16px;
  animation: twinkle 2.4s ease-in-out infinite;
}

.star-a { left: -1px; top: 33px; }
.star-b { right: 1px; top: 54px; font-size: 11px; color: var(--primary); animation-delay: -1s; }
.star-c { right: 23px; bottom: 6px; font-size: 9px; animation-delay: -1.8s; }

.celebration-card h2 {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 38px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.complete-desc {
  position: relative;
  z-index: 2;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.complete-rewards {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 18px;
}

.complete-reward {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 63px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 55%, transparent);
}

.complete-reward svg {
  width: 16px;
  height: 16px;
  margin-bottom: 1px;
  color: var(--accent);
}

.complete-reward strong,
.complete-reward b {
  font-family: var(--font-digit);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.complete-reward small {
  color: var(--muted);
  font-size: 8px;
}

.complete-reward.coin strong {
  color: var(--accent);
}

.complete-task-note {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 11px;
  padding: 8px 11px;
  border: 1px dashed color-mix(in srgb, var(--leaf) 32%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--leaf-soft) 36%, transparent);
  color: var(--text-soft);
  font-size: 9px;
  line-height: 1.5;
}

.complete-task-note strong {
  color: var(--text);
}

.complete-task-note b {
  color: var(--accent);
  font-family: var(--font-digit);
}

.task-note-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--leaf);
  color: var(--surface-strong);
}

.task-note-icon .icon {
  width: 11px;
  height: 11px;
}

.complete-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.complete-actions .primary-button {
  flex: 1.35;
  height: 47px;
  font-size: 12px;
}

.complete-actions .secondary-button {
  flex: 1;
  height: 47px;
  font-size: 11px;
}

.complete-hint {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  color: var(--muted);
  font-size: 8px;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .main-content {
    width: min(1280px, calc(100% - 44px));
  }

  .focus-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(292px, 0.8fr);
  }

  .timer-orbit {
    width: min(360px, 80%);
  }

  .timer-digits {
    font-size: clamp(62px, 8.4vw, 88px);
  }

  .nav-item {
    padding: 0 13px;
  }

  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 15px;
  }

  .main-nav {
    justify-self: center;
  }

  .help-button {
    display: none;
  }

  .focus-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .timer-card {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
  }

  .side-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    align-items: stretch;
  }

  .side-stack .panel {
    min-width: 0;
  }

  .garden-card,
  .mini-tasks,
  .checkin-card {
    height: 100%;
  }

  .focus-strip {
    margin-top: 18px;
  }

  .tasks-layout {
    grid-template-columns: 1fr;
  }

  .tasks-aside {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr);
    gap: 14px;
    align-items: stretch;
  }

  .missions-card {
    grid-row: span 2;
  }

  .achievement-overview {
    grid-template-columns: 1fr;
  }

  .week-chart {
    height: 155px;
  }

  .week-bar-track {
    height: 107px;
  }

  .heading-stats {
    flex-wrap: wrap;
  }
}

@media (max-width: 960px) {
  .coin-caption {
    display: none;
  }

  .nav-item {
    padding: 0 11px;
  }
}

@media (max-width: 860px) {
  body {
    padding-bottom: 86px;
  }

  .topbar {
    position: sticky;
    padding: 10px 16px;
    grid-template-columns: auto 1fr;
  }

  .topbar::after {
    left: 16px;
    right: 16px;
  }

  .main-nav {
    display: none;
  }

  .top-actions {
    gap: 7px;
  }

  .help-button {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .brand-mark svg {
    width: 33px;
    height: 33px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .brand-copy small {
    font-size: 7px;
  }

  .main-content {
    width: calc(100% - 30px);
    padding: 27px 0 40px;
  }

  .focus-heading,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .focus-heading h1,
  .page-heading h1 {
    font-size: clamp(34px, 7.8vw, 46px);
  }

  .focus-heading .immersive-button {
    align-self: flex-end;
    margin-top: -7px;
  }

  .heading-stats {
    width: 100%;
    gap: 7px;
  }

  .heading-stat {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
  }

  .heading-stat strong {
    font-size: 21px;
  }

  .side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .garden-card {
    grid-column: span 2;
  }

  .garden-scene {
    height: 145px;
  }

  .garden-plants {
    justify-content: center;
    gap: clamp(5px, 4vw, 26px);
    padding: 0 6%;
  }

  .garden-plant {
    width: 8.5%;
  }

  .focus-strip {
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 15px 18px;
  }

  .strip-quote {
    flex: 1 0 100%;
    justify-content: flex-start;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
  }

  .strip-quote p {
    white-space: normal;
  }

  .tasks-aside {
    grid-template-columns: 1fr;
  }

  .missions-card {
    grid-row: auto;
  }

  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .achievement-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .compact-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .mobile-nav {
    position: fixed;
    left: 50%;
    bottom: max(10px, calc(env(safe-area-inset-bottom) + 7px));
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(480px, calc(100% - 22px));
    height: 61px;
    padding: 5px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
    box-shadow: 0 16px 42px rgba(40, 25, 12, 0.24);
    transform: translateX(-50%);
    backdrop-filter: blur(21px) saturate(1.25);
    -webkit-backdrop-filter: blur(21px) saturate(1.25);
  }

  .mobile-nav-item {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 50px;
    border-radius: 16px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 600;
    transition: color 0.2s, background 0.2s;
  }

  .mobile-nav-item .icon {
    width: 19px;
    height: 19px;
  }

  .mobile-nav-item.is-active {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary-soft) 35%, transparent);
  }

  .mobile-dot {
    position: absolute;
    top: 5px;
    right: calc(50% - 14px);
    width: 6px;
    height: 6px;
    border: 1.5px solid var(--surface-strong);
    border-radius: 50%;
    background: var(--primary);
  }

  .mobile-checkin {
    flex: 0 0 62px;
    margin-top: -24px;
    color: var(--text-soft);
  }

  .mobile-checkin-inner {
    display: grid;
    place-items: center;
    width: 47px;
    height: 47px;
    border: 4px solid var(--surface-strong);
    border-radius: 50%;
    background: linear-gradient(140deg, var(--primary), var(--primary-deep));
    color: var(--primary-contrast);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 30%, transparent);
  }

  .mobile-checkin-inner .icon {
    width: 21px;
    height: 21px;
  }

  .mobile-checkin::after {
    content: "签到";
    margin-top: -1px;
    color: var(--muted);
    font-size: 8px;
  }

  .mobile-checkin span:last-child {
    display: none;
  }

  .site-footer {
    width: calc(100% - 30px);
    margin-bottom: 2px;
    padding-bottom: 15px;
  }

  .toast-region {
    bottom: max(84px, calc(env(safe-area-inset-bottom) + 80px));
  }

  .guide-steps {
    grid-template-columns: 1fr;
  }

  .guide-step {
    min-height: 0;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal {
    max-height: calc(100vh - 24px);
    border-radius: 24px;
  }

  .modal-head {
    padding: 21px 20px 14px;
  }

  .modal-head h2 {
    font-size: 24px;
  }

  .modal-body {
    padding: 0 20px 22px;
  }

  .modal-actions {
    margin: 7px -20px -22px;
    padding: 13px 20px;
  }

  .duration-grid {
    grid-template-columns: 1fr;
  }

  .duration-field {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .duration-name {
    flex: 1;
  }

  .stepper {
    width: 124px;
  }

  .duration-unit {
    width: 100%;
    margin-top: -4px;
    text-align: left;
    padding-left: 13px;
  }

  .rounds-field {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .rounds-control {
    width: 100%;
  }

  .rounds-control input {
    flex: 1;
    width: auto;
  }

  .volume-field input {
    flex: 1;
    width: auto;
  }

  .danger-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .gacha-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gacha-results:has(.gacha-result-card:only-child) {
    grid-template-columns: minmax(0, 200px);
  }

  .gacha-result-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions button {
    flex: 1;
  }

  .checkin-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 620px) {
  .coin-caption {
    display: none;
  }

  .focus-heading {
    gap: 10px;
    margin-bottom: 16px;
  }

  .focus-heading .eyebrow {
    margin-bottom: 8px;
  }

  .focus-heading h1,
  .page-heading h1 {
    font-size: 31px;
  }

  .focus-heading .lede {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 7px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .focus-heading .immersive-button {
    display: none;
  }

  .timer-orbit {
    width: min(294px, 78vw);
  }

  .timer-stage {
    padding-top: 2px;
  }

  .timer-actions {
    margin-top: 4px;
  }

  .session-progress {
    margin-top: -2px;
  }

  .celebration-card .confetti-chip {
    opacity: 0.4;
  }

  .chip-one { left: 5%; top: 12%; }
  .chip-two { right: 5%; top: 10%; }
  .chip-three { left: 4%; bottom: 12%; }
  .chip-four { right: 4%; bottom: 9%; }

  .streak-pill {
    padding: 0 10px;
  }

  .top-actions .icon-button {
    width: 38px;
    height: 38px;
  }

  .topbar {
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .timer-card {
    padding: 16px 14px 14px;
    border-radius: 27px;
  }

  .timer-head {
    gap: 8px;
  }

  .timer-settings-btn {
    width: 34px;
    height: 34px;
  }

  .mode-tabs {
    gap: 2px;
    padding: 3px;
  }

  .mode-tab {
    min-width: 62px;
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }

  .timer-orbit {
    width: min(330px, 88vw);
    max-width: 100%;
  }

  .timer-center {
    padding: 0 35px;
  }

  .timer-kicker {
    min-height: 23px;
    font-size: 8px;
    padding: 0 9px;
  }

  .timer-digits {
    margin: 8px 0 4px;
    font-size: clamp(58px, 18vw, 78px);
  }

  .timer-sub {
    max-width: 180px;
    font-size: 9px;
  }

  .session-progress {
    width: 88%;
  }

  .round-action {
    width: 46px;
    height: 46px;
  }

  .primary-action {
    min-width: 165px;
    height: 56px;
    padding: 0 20px 0 10px;
    gap: 9px;
  }

  .primary-action-icon {
    width: 37px;
    height: 37px;
  }

  .primary-action-copy strong {
    font-size: 14px;
  }

  .timer-actions {
    gap: 11px;
  }

  .active-task-chip {
    margin-top: 14px;
    min-height: 50px;
    padding: 7px 10px;
    gap: 8px;
  }

  .active-task-chip .chip-progress {
    display: none;
  }

  .timer-foot {
    padding-top: 10px;
  }

  .shortcut-hint {
    display: none;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }

  .garden-card {
    grid-column: auto;
  }

  .focus-strip {
    gap: 7px 14px;
    padding: 13px 15px;
  }

  .strip-stat strong {
    font-size: 19px;
  }

  .strip-stat > span {
    font-size: 9px;
  }

  .strip-quote {
    display: none;
  }

  .focus-heading .immersive-button {
    align-self: flex-start;
    margin-top: 0;
    min-height: 38px;
    padding: 0 14px;
    font-size: 11px;
  }

  .focus-heading h1,
  .page-heading h1 {
    font-size: 33px;
  }

  .heading-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .heading-stat {
    min-width: 0;
    padding: 8px 10px;
    text-align: left;
  }

  .heading-stat strong {
    font-size: 19px;
  }

  .tasks-board {
    padding: 15px;
  }

  .task-compose {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 11px;
  }

  .compose-mark {
    width: 29px;
    height: 29px;
  }

  .compose-field {
    flex: 1 1 calc(100% - 40px);
  }

  .task-compose input {
    height: 28px;
    font-size: 12px;
  }

  .estimate-field {
    flex: 1;
    padding-left: 3px;
    border-left: 0;
  }

  .task-compose .primary-button {
    flex: 1;
    min-height: 35px;
    padding: 0 12px;
    font-size: 10px;
  }

  .board-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin: 17px 0 10px;
  }

  .task-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 68px;
    padding: 10px;
  }

  .task-content .task-title-button > span {
    max-width: 100%;
    font-size: 12px;
  }

  .task-meta {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .task-progress {
    width: 85%;
  }

  .task-actions {
    flex-direction: column;
    opacity: 0.7;
  }

  .task-action-button {
    width: 27px;
    height: 27px;
  }

  .missions-card {
    padding: 17px;
  }

  .mission-item {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 4px;
  }

  .mission-claim {
    font-size: 8px;
    padding: 0 8px;
  }

  .achievement-tally {
    width: 100%;
    justify-content: flex-start;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .achievement-card {
    min-height: 196px;
  }

  .level-card {
    grid-template-columns: 85px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .level-orbit {
    width: 82px;
    height: 82px;
  }

  .level-glyph {
    font-size: 28px;
  }

  .level-title-row h2 {
    font-size: 23px;
  }

  .level-stats {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 12px;
  }

  .level-stats > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .level-stats > div:nth-child(even) {
    border-left: 1px solid var(--line);
    padding-left: 13px;
  }

  .week-card {
    padding: 18px 16px 14px;
  }

  .week-chart {
    gap: 4px;
    height: 145px;
  }

  .week-bar-track {
    height: 96px;
  }

  .collection-heading {
    gap: 12px;
  }

  .collection-tabs {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .collection-tab {
    flex: 0 0 auto;
    padding: 0 11px;
  }

  .collection-tab .icon {
    display: block;
  }

  .collection-grid {
    grid-template-columns: 1fr;
  }

  .skin-preview,
  .effect-preview,
  .sound-preview {
    height: 174px;
  }

  .collection-footer {
    margin-top: 18px;
  }

  .site-footer {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 18px);
    border-radius: 26px 26px 0 0;
    transform: translateY(40px);
  }

  .modal-head {
    padding: 18px 18px 12px;
  }

  .modal-head h2 {
    font-size: 22px;
  }

  .modal-body {
    padding: 0 18px 20px;
  }

  .modal-actions {
    margin: 6px -18px -20px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }

  .modal-actions .save-note {
    display: none;
  }

  .modal-actions .primary-button {
    width: 100%;
  }

  .checkin-modal-head {
    padding-bottom: 10px;
  }

  .checkin-modal-tomato {
    width: 45px;
    height: 45px;
    border-radius: 14px;
  }

  .checkin-modal-tomato svg {
    width: 39px;
    height: 39px;
  }

  .checkin-modal-brand {
    gap: 10px;
  }

  .calendar-panel {
    padding: 11px 9px 8px;
  }

  .calendar-day,
  .calendar-day.is-blank {
    width: 31px;
    height: 31px;
    min-height: 31px;
    font-size: 9px;
  }

  .calendar-mark {
    width: 9px;
    height: 9px;
  }

  .streak-reward-path {
    margin: 14px 0 12px;
    gap: 0;
  }

  .streak-step-dot {
    width: 22px;
    height: 22px;
    font-size: 8px;
  }

  .streak-step-label {
    font-size: 6px;
  }

  .streak-step-reward {
    font-size: 7px;
  }

  .checkin-footnote {
    font-size: 7px;
  }

  .guide-steps {
    gap: 8px;
  }

  .guide-step {
    padding: 14px;
  }

  .guide-step h3 {
    margin-top: 10px;
    font-size: 15px;
  }

  .guide-note {
    padding: 11px;
  }

  .confirm-modal {
    width: 100%;
    padding: 25px 20px calc(22px + env(safe-area-inset-bottom));
  }

  .gacha-result-modal {
    max-height: 92vh;
  }

  .gacha-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .gacha-result-card {
    padding: 8px;
    border-radius: 12px;
  }

  .result-art {
    height: 95px;
  }

  .gacha-result-card h3 {
    font-size: 12px;
  }

  .celebration-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .celebration-card {
    width: 100%;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
    transform: translateY(45px);
  }

  .celebration-backdrop.is-open .celebration-card {
    transform: translateY(0);
  }

  .complete-mascot {
    width: 100px;
    height: 100px;
  }

  .complete-mascot svg {
    width: 87px;
    height: 87px;
  }

  .complete-rewards {
    margin-top: 13px;
  }

  .complete-actions {
    margin-top: 14px;
  }

  .complete-actions .primary-button,
  .complete-actions .secondary-button {
    height: 44px;
  }

  .toast-region {
    width: calc(100% - 26px);
  }

  .toast {
    border-radius: 16px;
    font-size: 11px;
  }

  .coin-floater {
    font-size: 14px;
  }
}

@media (max-width: 390px) {
  .streak-pill span {
    display: none;
  }

  .streak-pill {
    padding: 0 9px;
  }

  .coin-pill {
    padding: 0 10px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .mode-tab {
    min-width: 55px;
    padding: 0 8px;
    font-size: 10px;
  }

  .timer-settings-btn {
    width: 31px;
    height: 31px;
  }

  .primary-action {
    min-width: 152px;
  }

  .round-action {
    width: 43px;
    height: 43px;
  }

  .timer-digits {
    font-size: 55px;
  }

  .streak-step-label {
    display: none;
  }

  .complete-reward strong,
  .complete-reward b {
    font-size: 14px;
  }
}

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