/* Daily line in the center of the stamp coin. Upright Cormorant,
   weight 500, the motto's gold. 9.35px is about a tenth larger than
   the 8.5px ink match, and a 42-character line still wraps to three
   lines inside the inner disc. Line pitch stays 9.44px. The text-free
   face is the disc's own radial gradient. A face that already
   engraves a centre line sets hidden, and this rule keeps that
   overlay off the disc. */
.days-coin .coin-daily-line {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 90px;
  width: 70px;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  text-align: center;
  text-wrap: balance;
  font-family: var(--display);
  font-style: normal;
  font-weight: 500;
  font-size: 9.35px;
  line-height: 9.44px;
  color: #e1c182;
  pointer-events: none;
}

.days-coin .coin-daily-line[hidden] {
  display: none;
}

/* v568 house cut: kept day = You came back. · stamp line · one kind step · exits. */
.earned-screen[data-kept] .earned-fruit,
.earned-screen[data-kept] #finish-kind-line,
.earned-screen[data-kept] [data-kids-share] { display: none !important; }
.earned-screen[data-kept] #finish-stamp-tx { display: block; margin-top: .35rem; font-size: .8rem; opacity: .6; }
.earned-screen[data-kept] #finish-stamp-tx[hidden] { display: none; }

/* v604: the completion screen is the day's coin, Collect, and Back home.
   A kept or failed stamp may add its one status line. These fillers stay off
   even if an older player bundle writes them back. */
.earned-screen[data-finish] .earned-keepsake,
.earned-screen[data-finish] .earned-fruit,
.earned-screen[data-finish] .earned-kind,
.earned-screen[data-finish] .kids-share,
.earned-screen[data-finish] .finish-stamp-headline,
.earned-screen[data-finish] .finish-stamp-soft,
.earned-screen[data-finish] #finish-kind-line {
  display: none !important;
}

/* The blank lotus day carries one word in the empty lower bowl.
   Engraved faces do not get this overlay. */
/* v605 phone layout. The open screen was centering a tight coin+button
   cluster, so ~200px sat empty above the coin and ~200px below the exits,
   with only ~11px between the coin and Collect.
   On a phone the three bands share the free space (space-evenly), and the
   button group takes an extra 1.75rem (28px) before Collect. Collect's own
   size, padding, type, and gold are unchanged.
   html is on the selector because sit.js moves sit.css to the end of head,
   and that file's equal-specificity rules would otherwise win.
   Measured target on 390×800: coin higher, a clear gap before Collect,
   top and bottom leftovers closer to each other and smaller. */
@media (max-width: 520px) {
  html body.is-earned-open .earned-screen[data-finish] {
    justify-content: space-evenly;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }
  html body.is-earned-open .earned-screen[data-finish] .earned-coin {
    margin-top: 0;
    margin-bottom: 0;
  }
  /* A little bigger than the 176px / 44vw phone coin. On 390px this is 208px. */
  html body.is-earned-open .earned-screen[data-finish] .earned-coin .foil-coin {
    width: min(208px, 54vw, 28dvh);
    height: min(208px, 54vw, 28dvh);
  }
  html body.is-earned-open .earned-screen[data-finish] .earned-later {
    width: min(100%, 22rem);
    margin-top: 1.75rem;
    margin-bottom: 0;
  }
  html body.is-earned-open .earned-screen[data-finish] .finish-stamp {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
  }
  /* The same gap the exit row used, now under one Back home the size of Keep today's stamp. */
  html body.is-earned-open .earned-screen[data-finish] .earned-exits {
    margin-top: 1.2rem;
  }
}

/* v612: Back home is the same pill as Keep today's stamp, directly under it.
   Ivory, a thin gold edge, and a slow pearl sweep. The gold button stays gold.
   Reduced motion keeps the ivory still. */
html body.is-earned-open .earned-screen[data-finish] .earned-exits {
  width: min(14rem, 100%);
  margin-inline: auto;
  justify-content: center;
  gap: 0;
}
html body.is-earned-open .earned-screen[data-finish] #earned-keep {
  flex: none;
  align-self: center;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0.3rem 1.3rem;
  border: 1px solid rgba(184, 146, 68, 0.78);
  border-radius: 999px;
  color: #24180f;
  -webkit-text-fill-color: #24180f;
  font-size: 0.98rem;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.03em;
  cursor: pointer;
  background-color: #ead9b8;
  background-image:
    linear-gradient(105deg,
      rgba(255, 250, 236, 0) 0%,
      rgba(255, 250, 236, 0) 43%,
      rgba(255, 252, 244, 0.78) 50%,
      rgba(255, 250, 236, 0) 57%,
      rgba(255, 250, 236, 0) 100%),
    linear-gradient(180deg, #f6ead4 0%, #e4cfaa 100%);
  background-repeat: no-repeat;
  background-size: 220% 100%, 100% 100%;
  background-position: 120% 0, 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
@media (prefers-reduced-motion: no-preference) {
  html body.is-earned-open .earned-screen[data-finish] #earned-keep {
    animation: finish-home-shimmer 8.8s ease-in-out infinite;
  }
}
@keyframes finish-home-shimmer {
  0%, 18% { background-position: 120% 0, 0 0; }
  48%, 100% { background-position: -40% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  html body.is-earned-open .earned-screen[data-finish] #earned-keep {
    animation: none;
    background-image: linear-gradient(180deg, #f6ead4 0%, #e4cfaa 100%);
    background-size: 100% 100%;
    background-position: 0 0;
  }
}

/* One calm line under the coin, above the buttons. Exact house spelling. No emoji. */
.finish-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.finish-motto {
  margin: 0.9rem 0 0;
  max-width: 18rem;
  text-align: center;
  font-family: "Cormorant Garamond", var(--display), serif;
  font-style: normal;
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
  color: #e1c182;
}

.earned-coin .finish-day-word {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 64%;
  width: 70%;
  margin: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: "Cormorant Garamond", var(--display), serif;
  font-style: normal;
  font-weight: 500;
  font-size: clamp(0.95rem, 4.2vw, 1.2rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #e1c182;
  pointer-events: none;
}
