.temple-activity {
  --ta-paper: #f2eee4;
  --ta-ink: #25281f;
  --ta-muted: #5d6253;
  --ta-olive: #4e5946;
  --ta-red: #8b4539;
  --ta-line: #cec6b5;
  --ta-serif: "Noto Serif SC", "Songti SC", "Yu Mincho", Georgia, serif;
  --ta-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans", sans-serif;
  position: fixed;
  inset: 0;
  color: var(--ta-ink);
  width: min(540px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #bdb3a0;
  background: var(--ta-paper);
  box-shadow: 0 24px 110px #19181060;
  font-family: var(--ta-sans);
  font-size: 14px;
  text-align: start;
  overscroll-behavior: contain;
}

.temple-activity::backdrop {
  background: #151912af;
  backdrop-filter: blur(3px);
}

body:has(.temple-activity[open]) {
  overflow: hidden;
}

.temple-activity .ta-shell {
  position: relative;
  padding: clamp(27px, 5vw, 46px);
}

.temple-activity .ta-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--ta-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.temple-activity .ta-close:hover {
  color: var(--ta-ink);
  background: #25281f0b;
}

.temple-activity .ta-header {
  padding-inline-end: 23px;
}

.temple-activity .ta-eyebrow {
  color: var(--ta-red);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  margin: 0 0 12px;
}

.temple-activity h2 {
  margin: 0;
  color: var(--ta-ink);
  font-family: var(--ta-serif);
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .07em;
}

.temple-activity h2:focus {
  outline: none;
}

.temple-activity .ta-description {
  color: var(--ta-muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 12px 0 0;
}

.temple-activity .ta-art {
  display: grid;
  place-items: center;
  margin: 23px 0;
  background: radial-gradient(ellipse at 50% 65%, #eee5d0, #e5dbc7 75%);
  border-block: 1px solid #d5c8b1;
}

.temple-activity .ta-art svg {
  display: block;
  width: min(100%, 345px);
  height: auto;
  max-height: 205px;
  overflow: visible;
}

.temple-activity .ta-smoke {
  stroke: #867d6b;
  stroke-width: 1.6;
  stroke-linecap: round;
  fill: none;
}

.temple-activity .ta-smoke,
.temple-activity .ta-glow,
.temple-activity .ta-flame,
.temple-activity .ta-flame-halo {
  opacity: 0;
}

.temple-activity .ta-is-lit .ta-smoke {
  opacity: .75;
  animation: ta-smoke-drift 5s infinite ease-in-out;
}

.temple-activity .ta-is-lit .ta-glow,
.temple-activity .ta-is-lit .ta-flame {
  opacity: 1;
}

.temple-activity .ta-is-lit .ta-flame {
  transform-origin: 181px 75px;
  animation: ta-flame-flicker 1.6s infinite alternate ease-in-out;
}

.temple-activity .ta-is-lit .ta-flame-halo {
  opacity: .22;
}

.temple-activity .ta-is-lit .ta-coin {
  opacity: 0;
  animation: ta-coin-drop .55s ease-in both;
}

@keyframes ta-smoke-drift {
  0%, 100% { transform: translate(0, 2px); opacity: .56; }
  50% { transform: translate(2px, -3px); opacity: .8; }
}

@keyframes ta-flame-flicker {
  from { transform: rotate(-3deg) scaleX(.88); }
  to { transform: rotate(4deg) scaleX(1.08); }
}

@keyframes ta-coin-drop {
  0% { transform: translateY(0); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translateY(51px); opacity: 0; }
}

.temple-activity .ta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 15px;
  margin-top: 22px;
}

.temple-activity .ta-related {
  margin-top: 15px;
}

.temple-activity .ta-button,
.temple-activity .ta-durations button,
.temple-activity .ta-text-button {
  min-height: 42px;
  font: inherit;
  font-weight: 500;
  letter-spacing: .045em;
  line-height: 1.35;
  cursor: pointer;
}

.temple-activity .ta-button {
  color: var(--ta-paper);
  background: var(--ta-olive);
  border: 1px solid var(--ta-olive);
  padding: 10px 18px;
}

.temple-activity .ta-button:hover {
  background: #394434;
}

.temple-activity .ta-button-quiet {
  color: var(--ta-olive);
  background: transparent;
  border-color: var(--ta-line);
}

.temple-activity .ta-button-quiet:hover {
  background: #e8e3d8;
}

.temple-activity .ta-text-button {
  min-height: 36px;
  padding: 4px 0;
  color: var(--ta-olive);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #777f69;
}

.temple-activity .ta-text-button:hover {
  color: var(--ta-red);
}

.temple-activity button:focus-visible,
.temple-activity textarea:focus-visible {
  outline: 2px solid var(--ta-red);
  outline-offset: 3px;
}

.temple-activity .ta-note,
.temple-activity .ta-counter {
  color: var(--ta-muted);
  font-size: 11px;
  line-height: 1.7;
  margin: 14px 0 0;
}

.temple-activity .ta-message {
  color: var(--ta-red);
  margin: 16px 0 0;
  font-family: var(--ta-serif);
  font-size: 15px;
}

.temple-activity .ta-live {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  margin: -1px;
}

.temple-activity .ta-clock {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: 172px;
  aspect-ratio: 1;
  margin: 28px auto;
}

.temple-activity .ta-clock::before,
.temple-activity .ta-clock::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border: 1px solid #a49d8b;
  border-radius: 46% 54% 52% 48% / 50% 49% 51% 50%;
  transform: rotate(-7deg);
}

.temple-activity .ta-clock::after {
  inset: 9px;
  border-color: #c9bdab;
  background: #eae4d5;
  transform: rotate(18deg);
}

.temple-activity .ta-breathing::before {
  animation: ta-breathe 8s ease-in-out infinite;
}

@keyframes ta-breathe {
  0%, 100% { transform: rotate(-7deg) scale(.98); }
  50% { transform: rotate(0) scale(1.06); }
}

.temple-activity .ta-clock-center {
  display: grid;
  place-items: center;
  gap: 4px;
}

.temple-activity .ta-timer {
  font-family: var(--ta-serif);
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.temple-activity .ta-timer-status {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ta-muted);
}

.temple-activity .ta-durations {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.temple-activity .ta-durations button {
  padding: 5px 9px;
  color: var(--ta-olive);
  background: transparent;
  border: 1px solid var(--ta-line);
  font-size: 12px;
}

.temple-activity .ta-durations button[aria-pressed="true"] {
  background: #e3e4d6;
  border-color: #818b74;
}

.temple-activity .ta-durations button:disabled {
  cursor: default;
}

.temple-activity[data-kind="practice"] .ta-actions,
.temple-activity[data-kind="practice"] .ta-related {
  justify-content: center;
  text-align: center;
}

.temple-activity .ta-form label {
  display: block;
  font-size: 12px;
  color: var(--ta-muted);
  margin-bottom: 5px;
}

.temple-activity .ta-form textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--ta-line);
  border-radius: 0;
  padding: 9px;
  color: var(--ta-ink);
  background: #faf6ec;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.temple-activity .ta-form .ta-counter {
  margin-top: 5px;
  text-align: end;
}

.temple-activity .ta-fortune {
  margin: 17px 0;
  border-inline-start: 2px solid #a36556;
  padding: 4px 0 4px 17px;
  font-family: var(--ta-serif);
}

.temple-activity .ta-fortune strong {
  font-size: 23px;
  font-weight: 500;
  color: var(--ta-red);
}

.temple-activity .ta-fortune p {
  margin: 7px 0 0;
  line-height: 1.8;
}

.temple-activity .ta-journal {
  margin-top: 22px;
}

.temple-activity .ta-journal section {
  padding: 14px 0 11px;
  border-top: 1px solid var(--ta-line);
}

.temple-activity .ta-journal h3 {
  margin: 0 0 6px;
  font-family: var(--ta-serif);
  font-size: 16px;
  font-weight: 600;
}

.temple-activity .ta-journal ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.temple-activity .ta-journal li {
  display: flex;
  gap: 9px 16px;
  align-items: baseline;
  justify-content: space-between;
  line-height: 1.6;
  margin: 4px 0 0;
}

.temple-activity .ta-journal time,
.temple-activity .ta-journal section > p {
  color: var(--ta-muted);
  font-size: 12px;
  margin: 0;
}

.temple-activity .ta-journal time {
  flex-shrink: 0;
}

.temple-activity .ta-wish {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

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