.heart-page {
  background: radial-gradient(
    ellipse at 70% 40%,
    #422535 0%,
    #1c1523 55%,
    #101321 100%
  );
  color: #fbede9;
  min-height: 100dvh;
}
.heart-page .game-top {
  position: relative;
  z-index: 5;
}
.heart-page .game-back {
  color: #cab5c1;
}
.heart-layout {
  max-width: 1000px;
  display: grid;
  grid-template-columns: 300px 430px;
  gap: 100px;
  margin: 25px auto 0;
  padding: 0 25px 35px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.heart-aside .game-kicker {
  font-size: 9px;
  color: #d2a58f;
}
.heart-aside h1 {
  font-size: 83px;
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.87;
  margin: 32px 0;
}
.heart-aside h1 em {
  font-family: var(--serif);
  font-weight: 400;
  color: #ef9eac;
}
.heart-line {
  font-size: 32px !important;
  line-height: 1.5 !important;
  color: #faeae2 !important;
  letter-spacing: -0.03em;
}
.heart-aside > p {
  font-size: 14px;
  line-height: 1.9;
  color: #bba7b7;
}
.heart-legend {
  border-top: 1px solid #ffffff20;
  padding-top: 20px;
  margin-top: 30px;
  font-size: 11px;
  color: #ae9eaf;
}
.heart-legend > div {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 15px;
}
.heart-legend b {
  font-size: 21px;
  font-weight: 400;
  color: #dcb7d9;
}
.heart-aside .help {
  color: #ad9baa;
}
.heart-aside .help button {
  margin-bottom: 10px;
}
.heart-play {
  position: relative;
  width: 100%;
  min-width: 0;
}
.heart-hud {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 0 5px 19px;
}
.heart-hud > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.heart-hud > div:first-child {
  margin-right: auto;
}
.heart-hud > div:not(:first-child) {
  margin-left: 28px;
  text-align: right;
}
.heart-hud span,
.heart-hud small {
  font-size: 10px;
  color: #c2a5b1;
}
.heart-hud strong {
  font: 22px var(--mono);
}
.heart-hud > div:first-child strong {
  font: 22px var(--sans);
}
.heart-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 7px;
  aspect-ratio: 1;
  padding: 13px;
  border: 1px solid #b58ba077;
  border-radius: 24px;
  background: linear-gradient(145deg, #53465399, #181825b0);
  box-shadow:
    0 20px 65px #0005,
    inset 0 1px 0 #f8daca55;
  position: relative;
  touch-action: none;
  outline: none;
}
.heart-board:focus-visible {
  border-color: #f2c3d1;
}
.heart-well {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #10111e42;
  box-shadow: inset 0 2px 4px #0004;
  border: 1px solid #dbc3d515;
  min-width: 0;
  min-height: 0;
}
.heart-piece {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  will-change: transform;
  pointer-events: none;
}
.heart-piece svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 3px #0005);
}
.heart-piece strong {
  font: 600 clamp(15px, 2.2vw, 25px) / 1 var(--sans);
  z-index: 1;
  color: #fff3ea;
  text-shadow: 0 2px 2px #0007;
  letter-spacing: -0.04em;
  margin-top: -6px;
}
.heart-piece small {
  font-size: 8px;
  position: absolute;
  bottom: 5%;
  color: #efdfebdd;
  letter-spacing: 0.02em;
}
.heart-piece[data-digits="5"] strong,
.heart-piece[data-digits="6"] strong {
  font-size: 17px;
}
.heart-piece.special {
  inset: 8%;
  border-radius: 50%;
  border: 1px solid #f5de8a;
  background: radial-gradient(circle, #a785bd, #463753);
  box-shadow:
    0 0 15px #f3c6c733,
    inset 0 0 13px #e8c4db55;
}
.heart-piece.special strong {
  font-size: 31px;
  color: #ffebaa;
  margin-top: -4px;
}
.heart-piece.special small {
  bottom: 9%;
  font-size: 8px;
}
.heart-piece.conflict {
  border-radius: 14px;
  border: 1px dashed #a9b5e7;
  background: linear-gradient(140deg, #556384, #242638);
}
.heart-piece.conflict strong {
  color: #c6cef1;
  font-size: 26px;
}
.heart-status {
  font-size: 11px;
  color: #c1aeba;
  text-align: center;
  margin: 12px 0 17px;
  min-height: 16px;
}
.heart-story {
  border-top: 1px solid #ffffff28;
  padding: 18px 5px 4px;
  min-height: 126px;
}
.heart-story > span {
  font: 9px var(--mono);
  letter-spacing: 0.13em;
  color: #d0a996;
}
.heart-story h2 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  margin: 9px 0;
}
.heart-story p {
  font-size: 13px;
  line-height: 1.9;
  color: #c4b4c4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.heart-buttons {
  display: flex;
  gap: 7px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.heart-buttons button {
  font-size: 11px;
  padding: 9px 13px;
  border-color: #d2a5b83b;
}
.heart-buttons button:first-child {
  background: #d7a7b6;
  color: #271a29;
  border: 0;
  padding-left: 20px;
  padding-right: 20px;
}
#heart-demo-mobile {
  display: none;
}
#heart-fx {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 4;
}
.heart-celebrate {
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: min(580px, 90vw);
  z-index: 6;
  text-align: center;
  pointer-events: none;
  color: #ffead2;
  animation: heart-reveal 2.7s both;
}
.heart-celebrate > span {
  font-size: 11px;
  letter-spacing: 0.3em;
  display: block;
}
.heart-celebrate > strong {
  font: 52px var(--serif);
  display: block;
  margin: 12px 0;
  text-shadow:
    0 0 35px #ff946988,
    0 2px 5px #220e27;
}
.heart-celebrate > i {
  display: block;
  background: linear-gradient(90deg, transparent, #e0b58b, transparent);
  height: 1px;
  width: 70%;
  margin: auto;
}
.heart-celebrate > button {
  pointer-events: auto;
  margin-top: 14px;
  background: #1c1523c9;
  font-size: 10px;
}
.heart-celebrate:before {
  content: "";
  position: absolute;
  inset: -35px;
  background: radial-gradient(ellipse, #32213ce0, transparent 72%);
  z-index: -1;
}
#heart-memories {
  background: #231c2c;
  color: #f8e8ef;
  border: 1px solid #725b73;
  border-radius: 18px;
  max-width: min(500px, 90vw);
  max-height: 80dvh;
  padding: 30px;
}
#heart-memories::backdrop {
  background: #090814cc;
}
#memory-close {
  float: right;
}
#heart-memories h2 {
  font-weight: 400;
}
#memory-list article {
  border-top: 1px solid #ffffff20;
  padding-top: 15px;
  margin-top: 20px;
}
#memory-list h3 {
  font-size: 17px;
}
#memory-list p {
  font-size: 13px;
  line-height: 1.9;
  color: #c6b2c6;
}
.heart-board.bump {
  animation: heart-bump 0.18s;
}
.heart-page .game-result {
  inset: 15% 0 25%;
  background: #25182ff0;
  border-color: #d3b1bd55;
}
.heart-page .primary-button {
  background: #e8b5c7;
  color: #251b28;
}
@keyframes heart-reveal {
  0% {
    opacity: 0;
    translate: 0 15px;
    scale: 0.94;
  }
  15%,
  75% {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
  100% {
    opacity: 0;
    translate: 0 -15px;
    scale: 1.03;
  }
}
@keyframes heart-bump {
  50% {
    transform: scale(0.992);
  }
}
@media (max-width: 760px) {
  .heart-layout {
    display: block;
    padding: 5px 14px 22px;
    margin: 0 auto;
    max-width: 460px;
  }
  .heart-aside {
    display: none;
  }
  .heart-hud {
    padding: 8px 4px 16px;
  }
  .heart-hud strong {
    font-size: 21px;
  }
  .heart-hud > div:first-child strong {
    font-size: 20px;
  }
  .heart-board {
    padding: 10px;
    gap: 6px;
    border-radius: 21px;
  }
  .heart-piece strong {
    font-size: 24px;
  }
  .heart-piece[data-digits="5"] strong,
  .heart-piece[data-digits="6"] strong {
    font-size: 15px;
  }
  .heart-piece small {
    font-size: 8px;
  }
  .heart-story {
    padding-top: 14px;
    min-height: 114px;
  }
  .heart-story h2 {
    font-size: 17px;
  }
  .heart-story p {
    font-size: 12px;
  }
  .heart-buttons {
    gap: 6px;
    margin-top: 14px;
  }
  .heart-buttons button {
    font-size: 11px;
    padding: 8px 11px;
  }
  #heart-demo-mobile {
    display: block;
  }
  .heart-celebrate {
    top: 9%;
  }
  .heart-celebrate > strong {
    font-size: 38px;
  }
  .heart-status {
    margin: 10px 0 12px;
    font-size: 10px;
  }
  .heart-page .game-brand {
    font-size: 9px;
  }
  .heart-page .game-back {
    font-size: 11px;
  }
}
@media (max-height: 720px) and (max-width: 760px) {
  .heart-layout {
    max-width: 375px;
  }
  .heart-hud {
    padding: 2px 4px 10px;
  }
  .heart-story {
    min-height: 100px;
  }
  .heart-story p {
    -webkit-line-clamp: 2;
  }
  .heart-buttons {
    margin-top: 10px;
  }
  .heart-piece strong {
    font-size: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .heart-celebrate {
    animation: none;
  }
  .heart-board.bump {
    animation: none;
  }
  .heart-piece {
    will-change: auto;
  }
}

@media (min-width: 761px) {
  .heart-layout {
    margin-top: 5px;
    gap: 70px;
  }
  .heart-play {
    width: min(430px, calc(100dvh - 400px));
    min-width: 325px;
    justify-self: center;
  }
  .heart-story {
    min-height: 105px;
  }
  .heart-story p {
    -webkit-line-clamp: 2;
  }
  .heart-hud {
    padding-bottom: 14px;
  }
}

.heart-quests {
  display: grid;
  gap: 13px;
  margin: 24px 0;
  max-width: 240px;
}
.heart-quest {
  font-size: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  color: #c7a8b9;
}
.heart-quest b {
  font: 10px var(--mono);
  color: #c7a8b9;
}
.heart-quest i {
  grid-column: 1/-1;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    #e4a6bb var(--progress),
    #ffffff12 var(--progress)
  );
}
.heart-quest.done {
  color: #fbd5ad;
}
.heart-quest.done i {
  background: #e9c496;
}
.heart-combo {
  font: 11px var(--mono);
  text-align: center;
  color: #efc6aa;
  margin: 0 0 15px;
}
.heart-page dialog {
  background: #281c30;
  color: #efdfeb;
  border: 1px solid #785b72;
  border-radius: 16px;
  max-width: 90vw;
  padding: 24px;
}
.heart-page dialog button {
  padding: 12px;
  margin: 4px;
  border: 1px solid #85617c;
  border-radius: 8px;
  background: #483045;
  color: inherit;
}
.heart-page dialog::backdrop {
  background: #110e1cbb;
}
.heart-goals {
  margin: 12px 0 18px;
  color: #d8bcca;
  font-size: 12px;
}
.heart-goals summary {
  cursor: pointer;
}
.heart-quests {
  max-width: none;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  padding: 0 8px;
}
