* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: ui-rounded, "Arial Rounded MT Bold", system-ui;
  color: #62465f;
  background: #f7cfe8;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 15%, #fff3fa 0 4px, transparent 5px),
    radial-gradient(circle at 85% 25%, #d8b8ec 0 5px, transparent 6px),
    radial-gradient(circle at 75% 72%, #fff1f8 0 3px, transparent 4px),
    radial-gradient(circle at 18% 82%, #e9b7d8 0 6px, transparent 7px),
    linear-gradient(155deg, #f9d4ea 0%, #f6c8e3 45%, #edcef1 100%);
}
.garden {
  position: relative;
  min-height: 100dvh;
  max-width: 520px;
  margin: auto;
  padding: calc(30px + env(safe-area-inset-top)) 20px 80px;
  overflow: hidden;
}
.garden::before,
.garden::after {
  position: absolute;
  color: #fff5fb;
  opacity: 0.85;
  font-size: 24px;
  pointer-events: none;
}
.garden::before {
  content: "♡  ✿";
  top: 22%;
  left: 8px;
  transform: rotate(-12deg);
}
.garden::after {
  content: "✿  ♡";
  right: 7px;
  bottom: 20%;
  transform: rotate(12deg);
}
header {
  text-align: center;
  margin-bottom: 24px;
}
header small {
  font: 700 11px Georgia;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #a45c90;
}
h1 {
  font: italic 700 34px Georgia;
  margin: 8px 0;
  color: #854c78;
  text-shadow: 0 2px 0 #fff3fa;
}
header p,
section p {
  font: italic 13px Georgia;
  color: #a75f91;
}
section {
  padding: 19px 12px;
  border: 2px solid #e8aecd;
  border-radius: 28px;
  background: #fff1f8;
  box-shadow:
    0 8px 0 #e8b5d2,
    0 15px 30px #9a4f8029;
  text-align: center;
}
.purple {
  border-color: #d8b6e7;
  background: #fcedfa;
  box-shadow:
    0 8px 0 #d9c0e8,
    0 15px 30px #9472aa29;
}
section h2 {
  font: 700 20px Georgia;
  margin: 0 0 12px;
}
.counter,
.ctrl {
  display: flex;
  justify-content: center;
  gap: 5px;
}
.digit {
  width: 72px;
  height: 86px;
  border-radius: 13px;
  background: #66505f;
  color: #fff8fc;
  font: 700 57px/86px "Courier New";
  box-shadow:
    inset 0 4px 8px #2e202a55,
    0 3px 0 #493944;
  position: relative;
}
.digit:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #2e202a66;
}
.ctrl {
  height: 30px;
  visibility: hidden;
}
.ctrl.on {
  visibility: visible;
}
.ctrl button {
  width: 72px;
  border: 0;
  background: none;
  color: #a16f98;
  font-size: 22px;
  font-weight: 900;
}
.bottom button {
  transform: rotate(180deg);
}
.vine {
  text-align: center;
  margin: 18px;
  color: #ae85a5;
  letter-spacing: 7px;
}
.bf {
  position: absolute;
  opacity: 0.55;
  font-style: normal;
}
.a {
  top: 85px;
  left: 12px;
  transform: rotate(-20deg);
}
.b {
  top: 290px;
  right: 8px;
  transform: rotate(20deg);
}
.c {
  bottom: 100px;
  left: 18px;
  font-size: 18px;
}
#info,
#lock {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 24px;
  height: 44px;
  background: #efd5e7;
  color: #704d70;
  font-weight: 800;
  box-shadow: 0 3px 9px #79566f33;
}
#info {
  right: 20px;
  width: 44px;
  font: italic 700 20px Georgia;
}
#lock {
  left: 20px;
  padding: 0 18px;
}
dialog {
  width: min(90vw, 440px);
  max-height: 80dvh;
  border: 2px solid #e7c8dd;
  border-radius: 25px;
  background: #fffafd;
  color: #63455e;
  padding: 24px;
  box-shadow: 0 20px 70px #51364c55;
}
dialog::backdrop {
  background: #5b40584d;
}
dialog h2 {
  font: italic 700 25px Georgia;
}
dialog h3 {
  font: 700 18px Georgia;
  margin-top: 23px;
}
article {
  padding: 10px 0;
  border-bottom: 1px dashed #e8d4e2;
  font-size: 14px;
  line-height: 1.45;
}
dialog em {
  display: block;
  text-align: center;
  margin-top: 20px;
}
.x {
  float: right;
  border: 0;
  background: none;
  font-size: 28px;
  color: #9c7192;
}
form {
  display: flex;
  gap: 8px;
}
input {
  min-width: 0;
  flex: 1;
  border: 2px solid #e6c9dc;
  border-radius: 14px;
  padding: 12px;
  font-size: 18px;
}
form button {
  border: 0;
  border-radius: 14px;
  background: #dcaed0;
  color: white;
  padding: 0 16px;
  font-weight: 800;
}
#err {
  color: #a43c66;
}
@media (max-width: 370px) {
  .digit,
  .ctrl button {
    width: 64px;
  }
  .digit {
    height: 78px;
    line-height: 78px;
    font-size: 52px;
  }
  h1 {
    font-size: 30px;
  }
}
