@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@400;600;700;800;900&display=swap");
:root {
  --ink: #653551;
  --berry: #a72863;
  --pink: #e45a96;
  --hot: #d93280;
  --paper: #fff8f9;
  --shadow: #ae577735;
  --round: "Baloo 2", "Arial Rounded MT Bold", ui-rounded, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, sans-serif;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  background: #f2c6d8;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 12px,
    #ffffff20 12px,
    #ffffff20 13px
  );
  font-family: var(--body);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 18px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #874eb1;
  outline-offset: 4px;
}
button {
  touch-action: manipulation;
}
button[hidden],
[hidden] {
  display: none !important;
}
#game {
  height: min(850px, calc(100dvh - 36px));
  width: min(1320px, 100%);
  min-height: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 2px solid white;
  border-radius: 14px;
  box-shadow:
    0 0 0 5px #ebb1cc,
    0 16px 65px #8d416333;
  background: #ffeef5 var(--garden-art, url("assets/garden.webp")) center/cover;
  display: flex;
  flex-direction: column;
}
#game:after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 75px #efaec16b;
  pointer-events: none;
  z-index: 0;
}
.topbar {
  z-index: 5;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid #fff9;
  background: #fff4f6d9;
  backdrop-filter: blur(8px);
}
.arcade-link {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.small-logo {
  font-family: var(--round);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px;
}
.small-logo b {
  color: var(--pink);
}
.small-logo i {
  color: var(--hot);
  font-style: normal;
  padding-left: 4px;
}
.tools {
  display: flex;
  gap: 7px;
}
.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid #dfafc6;
  border-radius: 50%;
  background: #fff7fa;
  font-size: 20px;
  position: relative;
  display: grid;
  place-items: center;
}
.sound-slash {
  font-size: 24px;
  position: absolute;
  color: var(--hot);
}
#screen {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
footer {
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.3px;
  color: #844764;
  background: #fff4f5d6;
  z-index: 5;
}
footer button {
  border: 0;
  background: transparent;
  padding: 0 5px;
  font-size: 15px;
}
#petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}
.title-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 22px 20px 17px;
  background: linear-gradient(#ffeef589, transparent 50%, #fff2f4bf);
}
.title-mark {
  position: relative;
  text-align: center;
  z-index: 2;
  flex-shrink: 0;
}
.japanese {
  font-size: 12px;
  letter-spacing: 5px;
  font-weight: 800;
  color: #af4a7a;
  margin: 0 0 5px;
}
.title-mark h1 {
  font-family: var(--round);
  font-weight: 800;
  font-size: clamp(60px, 7vw, 99px);
  line-height: 0.8;
  letter-spacing: -4px;
  transform: rotate(-4deg);
  margin: 14px 0 16px;
  color: #ef76a8;
  -webkit-text-stroke: 2px #fff;
  paint-order: stroke fill;
  text-shadow:
    0 4px 0 #ad3c76,
    0 7px 0 #fff,
    3px 8px 0 #d79ab8;
}
.title-mark h1 b {
  font-size: 1.12em;
  color: #d94085;
}
.title-mark h1 .heart {
  font-size: 0.65em;
  display: inline-block;
  transform: rotate(12deg);
  vertical-align: middle;
}
.title-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8b446a;
  border-bottom: 1px solid #d090af;
  padding: 8px 22px 6px;
}
.cast {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  width: min(790px, 88%);
  flex: 1;
  min-height: 0;
  padding: 20px 0 14px;
}
.cast-card {
  height: min(100%, 305px);
  aspect-ratio: 0.65;
  max-width: 22%;
  background: #fff7f9;
  padding: 7px 7px 32px;
  box-shadow: 0 5px 16px #91436038;
  border: 1px solid #fff;
  position: relative;
  transform: rotate(var(--tilt));
  animation: float 5s ease-in-out infinite;
  animation-delay: var(--delay);
}
.cast-card:nth-child(even) {
  margin-top: 25px;
}
.cast-card:before {
  content: "♡";
  position: absolute;
  top: -15px;
  right: -10px;
  font-size: 36px;
  z-index: 2;
  color: #f16fa5;
  text-shadow: 2px 2px white;
}
.cast-card .portrait {
  width: 100%;
  height: 100%;
  background-size: 100% 100%;
  border: 1px solid #efc7d7;
}
.cast-card .cast-name {
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--round);
  font-weight: 700;
  font-size: 19px;
}
.portrait {
  background-image: var(--portrait-art, url("assets/portraits.webp"));
  background-position: center top;
  background-repeat: no-repeat;
}
.primary {
  border: 2px solid white;
  border-radius: 50px;
  background: linear-gradient(#ed7fae, #d94b8d);
  box-shadow:
    0 0 0 1px #d776a0,
    0 5px 0 #af356e,
    0 8px 15px #b44a7136;
  color: white;
  font-family: var(--round);
  font-weight: 700;
  font-size: 21px;
  padding: 9px 37px;
  min-height: 48px;
  transition:
    transform 0.15s,
    filter 0.15s;
  position: relative;
}
.primary:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}
.primary:active {
  transform: translateY(3px);
  box-shadow:
    0 0 0 1px #d776a0,
    0 2px 0 #af356e;
}
.primary .end-heart {
  margin-left: 20px;
}
.title-bottom {
  flex-shrink: 0;
  text-align: center;
  padding-bottom: 5px;
}
.title-bottom .tiny {
  margin-top: 14px;
}
.tiny {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 800;
}
.side-doodle {
  position: absolute;
  top: 32%;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 20px;
  color: #aa4d7990;
  transform: rotate(-15deg);
  left: 5%;
}
.side-doodle.right {
  left: auto;
  right: 5%;
  top: 39%;
  transform: rotate(15deg);
}
.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  flex-shrink: 0;
  margin: 15px 25px 0;
}
.friend-meter {
  background: #fff7fadf;
  border: 2px solid #fff;
  box-shadow:
    0 2px 0 #dea3c1,
    0 3px 12px #99507618;
  border-radius: 12px;
  padding: 9px 12px;
  position: relative;
  transition:
    background 0.3s,
    transform 0.3s;
}
.friend-meter.active {
  background: #fff4f8;
  box-shadow:
    0 0 0 2px var(--friend-color),
    0 4px 15px #9e437529;
}
.meter-top {
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  width: 38px;
  height: 38px;
  border: 2px solid white;
  border-radius: 50%;
  background-size: 100% 200%;
  background-position: center 9%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px #e5b9ce;
}
.meter-name {
  font-family: var(--round);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}
.meter-value {
  margin-left: auto;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  color: var(--berry);
}
.meter-track {
  height: 8px;
  background: #ecd9e3;
  border-radius: 9px;
  overflow: hidden;
  margin-top: 7px;
}
.meter-fill {
  height: 100%;
  width: 42%;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--friend-color), #f097ba);
  transition: width 0.15s linear;
}
.friend-meter.locked {
  background: #fff8e9;
  border-color: #fff9c7;
}
.friend-meter.locked .meter-fill {
  background: linear-gradient(90deg, #e5ae52, #f2d079);
}
.friend-meter.danger {
  animation: warning 1.2s infinite;
}
.play-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 42% 58%;
  padding: 10px 28px 17px;
  gap: 0;
}
.character-stage {
  position: relative;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 20px 10px 0;
}
.character-frame {
  position: relative;
  height: 100%;
  width: min(100%, 310px);
  background: #fff2f7;
  border: 6px solid #fff3f8;
  box-shadow:
    0 0 0 1px #d493b1,
    0 10px 30px #8b466044;
  border-radius: 150px 150px 16px 16px;
  overflow: hidden;
  transform: rotate(-3deg);
  animation: arrive 0.5s ease-out;
}
.character-frame .portrait {
  height: 100%;
  width: 100%;
  background-size: 100% 100%;
}
.character-stage:before {
  content: "♡";
  font-size: 110px;
  color: #fff9;
  position: absolute;
  top: 17%;
  left: -1%;
  text-shadow: 0 3px #e899b6;
  transform: rotate(-20deg);
}
.character-stage:after {
  content: "✧";
  font-size: 85px;
  color: #fff;
  position: absolute;
  right: 1%;
  top: 30%;
  text-shadow: 1px 2px #e790b1;
  animation: twinkle 3s infinite;
}
.character-label {
  position: absolute;
  bottom: 21px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: #fff2f6f5;
  box-shadow: 0 2px 0 #d18daf;
  padding: 8px 24px;
  border: 1px solid white;
  border-radius: 5px;
  text-align: center;
  min-width: 190px;
  white-space: nowrap;
  z-index: 2;
}
.character-label strong {
  display: block;
  font-family: var(--round);
  font-size: 25px;
  color: #b53b75;
  line-height: 1.1;
}
.character-label small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}
.story-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 0 0 22px;
  gap: 12px;
}
.chapter-line {
  display: flex;
  justify-content: space-between;
  color: #824965;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.7px;
  padding: 0 7px;
  text-shadow: 0 1px white;
}
.dialogue {
  position: relative;
  padding: 23px 24px 18px;
  background: #fffafbef;
  border: 2px solid #fff;
  border-radius: 4px 20px 20px 20px;
  box-shadow:
    0 0 0 1px #dc9dbb,
    0 5px 15px #97607724;
}
.speaker {
  position: absolute;
  top: -12px;
  left: 16px;
  border: 2px solid #fff;
  border-radius: 5px 12px 5px 12px;
  padding: 2px 16px;
  background: #cb588e;
  color: white;
  font-family: var(--round);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}
.event-title {
  font-family: var(--round);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 800;
  line-height: 1.1;
  color: #983963;
  margin: 0 0 9px;
  letter-spacing: -0.5px;
}
.event-title .event-icon {
  color: #d85a96;
  margin-right: 7px;
}
.scene {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
  margin: 0;
  min-height: 2.8em;
}
.prop {
  font-family: monospace;
  font-size: 13px;
  font-weight: 900;
  color: #aa3c57;
  background: #fff4d9;
  border: 1px solid #e3cab2;
  padding: 7px 12px;
  display: inline-block;
  transform: rotate(-2deg);
  margin-top: 9px;
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.choice {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  width: 100%;
  border: 1px solid #d49cb7;
  border-bottom: 3px solid #cf91ae;
  border-radius: 12px;
  background: linear-gradient(110deg, #fff9fb, #ffeaf3);
  padding: 12px 16px;
  min-height: 58px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: inset 0 0 0 2px #fff;
  transition:
    transform 0.14s,
    background 0.14s;
}
.choice .choice-letter {
  flex-shrink: 0;
  border: 1px solid #e3b3ca;
  background: #fff;
  border-radius: 50%;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  font-family: var(--round);
  font-size: 15px;
  color: #b23f76;
}
.choice .choice-heart {
  margin-left: auto;
  color: #dba0bd;
  font-size: 23px;
  font-weight: 400;
}
.choice:hover:not(:disabled) {
  transform: translateX(-4px);
  background: #fff;
  outline: 2px solid #df78a4;
  outline-offset: 1px;
}
.choice.rejected {
  opacity: 0.38;
  text-decoration: line-through;
  min-height: 40px;
  padding-top: 5px;
  padding-bottom: 5px;
  background: #eddae4;
}
.choice.selected {
  background: #fce0ed;
  border-color: #cf5b8f;
}
.choice.dimmed {
  opacity: 0.45;
}
.prompt-line {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
}
.prompt-line .mini-donnie {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 2px solid white;
  background-size: 100% 200%;
  background-position: 0 10%;
}
.feedback {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 900;
  color: #a02a61;
  min-height: 0;
}
.feedback:empty {
  display: none;
}
.feedback.bad {
  animation: shake 0.38s ease-out;
  background: #fff2f5ef;
  border: 1px solid #e49ab7;
  padding: 9px 13px;
  border-radius: 10px;
}
.reaction-card {
  border: 2px solid white;
  box-shadow: 0 0 0 1px #dca2be;
  border-radius: 18px;
  background: #fff5faed;
  padding: 18px 22px;
  text-align: center;
  animation: pop 0.3s ease-out;
}
.reaction-heart {
  color: #ec619b;
  font-size: 43px;
  line-height: 1.1;
}
.reaction-card h2 {
  font-family: var(--round);
  font-size: 25px;
  line-height: 1.2;
  color: #b63270;
  margin: 7px 0;
}
.gain {
  font-size: 11px;
  letter-spacing: 1.4px;
  font-weight: 900;
  color: #9c4273;
}
.reaction-card .aside {
  font-size: 12px;
  margin: 9px 0;
  font-weight: 900;
}
.reaction-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}
.source-button,
.text-button {
  border: 0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 11px;
  padding: 8px 0;
}
.next-button {
  padding: 7px 23px;
  min-height: 42px;
  font-size: 17px;
}
.intro-screen {
  height: 100%;
  display: grid;
  grid-template-columns: 40% 60%;
  align-items: center;
  padding: 35px 9%;
  gap: 35px;
  background: #fff1f34d;
}
.intro-portrait {
  height: min(440px, 90%);
  width: 100%;
  max-width: 300px;
  border: 7px solid white;
  border-radius: 150px 150px 12px 12px;
  background-size: 100% 100%;
  transform: rotate(-4deg);
  box-shadow: 0 6px 20px #a2546933;
}
.intro-copy {
  background: #fff8f5f0;
  border: 3px solid #fff;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 0 0 1px #d597b4;
}
.intro-copy h2 {
  font-family: var(--round);
  font-size: 32px;
  color: #bf3978;
  margin: 0 0 13px;
}
.intro-copy p {
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
  margin: 0 0 22px;
}
.intro-copy .hint {
  font-size: 13px;
}
.ending {
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  overflow: hidden;
  background: #f4c7dc;
}
.ending-art {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: center 40%;
  z-index: -1;
}
.ending.won {
  isolation: isolate;
}
.ending.won:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    #ffeaf04d 0%,
    transparent 40%,
    transparent 50%,
    #ffeef5ef 86%
  );
  z-index: -1;
}
.ending-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 20px;
  color: #ae3b70;
  font-size: 11px;
  letter-spacing: 4px;
  font-weight: 900;
  text-shadow: 0 1px white;
}
.ending-copy {
  width: 100%;
  padding: 20px 12px 20px;
}
.ending h1 {
  font-family: var(--round);
  font-size: clamp(38px, 5vw, 65px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 0;
  color: #c93d7e;
  -webkit-text-stroke: 4px #fff5fb;
  paint-order: stroke fill;
  text-shadow: 0 4px #e5a3c5;
}
.ending-line {
  font-family: var(--round);
  font-weight: 700;
  font-size: 19px;
  color: #8a4369;
  margin: 6px 0 11px;
}
.ending-stats {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 10px 0 15px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
}
.ending-stats b {
  display: block;
  font-family: var(--round);
  font-size: 25px;
  line-height: 1.1;
  color: #a6356c;
  letter-spacing: 0;
}
.ending .primary {
  font-size: 18px;
  padding: 6px 26px;
  min-height: 42px;
}
.ending.lost {
  background:
    linear-gradient(#eee3f4de, #f6daeced),
    var(--garden-art, url("assets/garden.webp")) center/cover;
  justify-content: center;
}
.lost-heart {
  font-size: 75px;
  color: #a96999;
  line-height: 1;
}
.lost .portrait {
  width: 130px;
  height: 150px;
  border: 5px solid white;
  background-size: 100% 100%;
  border-radius: 70px 70px 10px 10px;
  filter: saturate(0.55);
  transform: rotate(8deg);
  box-shadow: 0 4px 16px #96598730;
  margin-bottom: 10px;
}
.lost-name {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 10px 0;
}
.lost .ending-copy {
  width: min(550px, 95%);
}
dialog {
  border: 3px solid #fff;
  outline: 1px solid #d68fb1;
  border-radius: 20px;
  background: #fff5f9;
  color: var(--ink);
  width: min(440px, calc(100vw - 32px));
  max-height: 85dvh;
  padding: 30px;
  box-shadow: 0 20px 80px #7e3b6266;
  font-family: var(--body);
}
dialog::backdrop {
  background: #67354b80;
  backdrop-filter: blur(7px);
}
dialog h2 {
  font-family: var(--round);
  font-size: 29px;
  color: #aa3970;
  line-height: 1.15;
  margin: 5px 0 15px;
}
dialog p {
  font-size: 14px;
  line-height: 1.6;
}
dialog .primary {
  font-size: 18px;
  display: block;
  margin: 20px auto 10px;
}
dialog .text-button {
  display: block;
  margin: 0 auto;
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 8px;
  background: none;
  border: 0;
  font-size: 25px;
}
dialog a {
  text-decoration: underline;
  color: #a22d66;
}
dialog .badge {
  font-size: 10px;
  background: #ffe6cd;
  color: #985322;
  border: 1px solid #debc99;
  padding: 4px 7px;
  border-radius: 5px;
}
.scene-enter {
  animation: arrive 0.35s ease-out;
}
.happy .character-frame {
  animation: swoon 0.7s ease-out;
}
.sad .character-frame {
  animation: shake 0.4s ease-out;
}
.paused-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #eee0f1aa;
  backdrop-filter: blur(5px);
}
.paused-screen button {
  font-size: 25px;
}
.source-note {
  font-size: 11px !important;
  color: #92647d;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(var(--tilt));
  }
  50% {
    transform: translateY(-7px) rotate(calc(var(--tilt) + 1deg));
  }
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}
@keyframes arrive {
  from {
    opacity: 0;
    translate: 15px 0;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes shake {
  0%,
  100% {
    translate: 0;
  }
  20%,
  60% {
    translate: -7px;
  }
  40%,
  80% {
    translate: 7px;
  }
}
@keyframes swoon {
  0%,
  100% {
    transform: rotate(-3deg) scale(1);
  }
  40% {
    transform: rotate(2deg) scale(1.04);
  }
}
@keyframes warning {
  50% {
    box-shadow:
      0 0 0 2px #df527d,
      0 0 17px #ef4b7a55;
  }
}
@media (max-width: 700px) {
  body {
    padding: 0;
  }
  #game {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .topbar {
    height: 43px;
    padding: 0 13px;
  }
  .small-logo {
    font-size: 19px;
  }
  .arcade-link {
    font-size: 9px;
    gap: 5px;
    letter-spacing: 1px;
  }
  .icon-button {
    width: 31px;
    height: 31px;
  }
  .title-screen {
    padding: 23px 12px 20px;
  }
  .title-mark h1 {
    font-size: 75px;
    line-height: 0.86;
    max-width: 340px;
    margin-top: 20px;
    letter-spacing: -3px;
  }
  .title-mark h1 b {
    display: block;
  }
  .title-mark h1 .heart {
    position: absolute;
    right: -4px;
    top: 20px;
  }
  .japanese {
    font-size: 10px;
    letter-spacing: 3px;
  }
  .title-tag {
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-top: 6px;
    padding: 6px 12px;
  }
  .cast {
    gap: 6px;
    width: 100%;
    padding: 16px 4px 24px;
  }
  .cast-card {
    padding: 4px 4px 27px;
    max-width: 25%;
    height: min(100%, 215px);
    aspect-ratio: 0.49;
  }
  .cast-card .cast-name {
    font-size: 15px;
    bottom: 5px;
  }
  .cast-card:before {
    font-size: 25px;
    right: -3px;
    top: -11px;
  }
  .cast-card:nth-child(even) {
    margin-top: 20px;
  }
  .side-doodle {
    display: none;
  }
  .title-bottom .primary {
    font-size: 21px;
  }
  .hud {
    gap: 7px;
    margin: 12px 11px 0;
  }
  .friend-meter {
    padding: 7px 7px 6px;
    border-radius: 9px;
  }
  .meter-top {
    gap: 5px;
    flex-wrap: wrap;
  }
  .avatar {
    width: 27px;
    height: 27px;
  }
  .meter-name {
    font-size: 13px;
    flex: 1;
    white-space: nowrap;
  }
  .meter-value {
    font-size: 10px;
    position: absolute;
    top: 44px;
    right: 7px;
    line-height: 1;
  }
  .meter-track {
    margin-top: 8px;
    margin-right: 25px;
    height: 6px;
  }
  .play-layout {
    display: flex;
    flex-direction: column;
    padding: 4px 13px 10px;
    gap: 0;
  }
  .character-stage {
    flex: 1;
    min-height: 80px;
    padding: 9px 0 0;
    align-items: flex-end;
  }
  .character-frame {
    width: 150px;
    max-width: 47%;
    border-width: 4px;
    border-radius: 90px 90px 0 0;
    transform: rotate(-3deg);
    height: 100%;
    max-height: 270px;
  }
  .character-frame .portrait {
    background-size: 100% auto;
    background-position: center top;
  }
  .character-label {
    bottom: 15px;
    left: calc(50% + 104px);
    transform: translateX(-50%) rotate(6deg);
    min-width: 100px;
    padding: 6px 9px;
    white-space: normal;
    max-width: 115px;
  }
  .character-label strong {
    font-size: 18px;
  }
  .character-label small {
    font-size: 8px;
    letter-spacing: 0;
  }
  .character-stage:before {
    font-size: 60px;
    left: 12%;
    top: 24%;
  }
  .character-stage:after {
    font-size: 43px;
    right: 12%;
    top: 10%;
  }
  .story-column {
    flex-shrink: 0;
    padding: 0;
    gap: 8px;
    margin-top: -5px;
    z-index: 2;
  }
  .chapter-line {
    font-size: 8px;
    letter-spacing: 1px;
    padding: 0 4px;
    position: absolute;
    top: 92px;
    left: 18px;
    right: 18px;
    pointer-events: none;
  }
  .dialogue {
    padding: 17px 15px 12px;
    border-radius: 4px 15px 15px 15px;
  }
  .speaker {
    font-size: 11px;
    top: -11px;
    left: 12px;
    padding: 1px 12px;
  }
  .event-title {
    font-size: 22px;
    margin-bottom: 5px;
  }
  .scene {
    font-size: 13px;
    line-height: 1.4;
    min-height: 0;
  }
  .prop {
    font-size: 10px;
    margin-top: 5px;
    padding: 4px 8px;
  }
  .prompt-line {
    font-size: 8px;
    letter-spacing: 1px;
    height: 17px;
  }
  .prompt-line .mini-donnie {
    width: 22px;
    height: 22px;
  }
  .choices {
    gap: 6px;
  }
  .choice {
    padding: 9px 11px;
    min-height: 49px;
    font-size: 12px;
    gap: 9px;
    border-radius: 10px;
  }
  .choice .choice-letter {
    width: 23px;
    height: 23px;
    font-size: 13px;
  }
  .choice .choice-heart {
    font-size: 18px;
  }
  .choice.rejected {
    min-height: 32px;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .feedback.bad {
    padding: 6px 10px;
    font-size: 11px;
  }
  .reaction-card {
    padding: 12px 15px;
  }
  .reaction-heart {
    font-size: 30px;
  }
  .reaction-card h2 {
    font-size: 23px;
    margin: 4px 0;
  }
  .gain {
    font-size: 10px;
  }
  .reaction-bottom {
    padding: 0 3px;
  }
  .source-button {
    font-size: 10px;
  }
  .intro-screen {
    display: flex;
    flex-direction: column;
    padding: 18px 23px;
    gap: 0;
  }
  .intro-portrait {
    flex: 1;
    min-height: 70px;
    max-height: 280px;
    width: 155px;
    border-width: 4px;
  }
  .intro-copy {
    padding: 20px;
    position: relative;
    margin-top: -9px;
    flex-shrink: 0;
  }
  .intro-copy h2 {
    font-size: 27px;
  }
  .intro-copy p {
    font-size: 16px;
    margin-bottom: 12px;
  }
  .intro-copy .hint {
    font-size: 12px;
  }
  .intro-copy .primary {
    font-size: 18px;
    padding: 8px 18px;
    width: 100%;
  }
  .ending-art {
    object-fit: contain;
    object-position: center 31%;
    background: #f8cbdc;
  }
  .ending.won:after {
    background: linear-gradient(
      #fff0f760,
      transparent 40%,
      transparent 55%,
      #fff0f5 85%
    );
  }
  .ending-top {
    top: 28px;
    letter-spacing: 2px;
    font-size: 10px;
  }
  .ending-copy {
    padding: 14px 10px 28px;
  }
  .ending h1 {
    font-size: 44px;
    max-width: 360px;
    margin: auto;
  }
  .ending-line {
    font-size: 17px;
  }
  .ending-stats {
    gap: 20px;
  }
  .ending-stats b {
    font-size: 23px;
  }
  .ending-stats {
    font-size: 9px;
  }
  .ending .primary {
    font-size: 17px;
    padding: 7px 22px;
  }
  footer {
    height: 21px;
    font-size: 8px;
    letter-spacing: 0;
  }
}
@media (max-height: 700px) and (max-width: 700px) {
  .title-screen {
    padding-top: 12px;
    padding-bottom: 11px;
  }
  .title-mark h1 {
    font-size: 59px;
    margin-top: 13px;
    margin-bottom: 13px;
  }
  .title-tag {
    padding-top: 2px;
    margin-top: 0;
  }
  .cast {
    padding-top: 10px;
    padding-bottom: 17px;
  }
  .cast-card {
    max-height: 170px;
  }
  .title-bottom .primary {
    min-height: 42px;
    font-size: 18px;
    padding: 7px 27px;
  }
  .title-bottom .tiny {
    margin-top: 10px;
    font-size: 8px;
  }
  .hud {
    margin-top: 8px;
  }
  .story-column {
    gap: 6px;
  }
  .choice {
    min-height: 43px;
    padding: 7px 9px;
    font-size: 11.5px;
  }
  .dialogue {
    padding: 15px 12px 10px;
  }
  .event-title {
    font-size: 20px;
  }
  .scene {
    font-size: 12px;
  }
  .character-frame {
    width: 115px;
  }
  .character-label {
    left: calc(50% + 96px);
    bottom: 10px;
  }
  .chapter-line {
    top: 87px;
  }
  .intro-copy {
    padding: 17px;
  }
  .intro-copy p {
    font-size: 14px;
  }
  .ending-copy {
    padding-bottom: 15px;
  }
  .ending-art {
    object-position: center 22%;
  }
  .ending h1 {
    font-size: 37px;
  }
  .ending-stats {
    margin: 8px 0 11px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 0;
  }
  #game {
    height: 100dvh;
    border-radius: 0;
  }
  .topbar {
    height: 35px;
  }
  .hud {
    margin-top: 8px;
    gap: 10px;
  }
  .friend-meter {
    padding: 4px 10px;
  }
  .avatar {
    height: 26px;
    width: 26px;
  }
  .meter-name {
    font-size: 15px;
  }
  .meter-track {
    height: 5px;
    margin-top: 4px;
  }
  .play-layout {
    padding: 5px 23px 8px;
    grid-template-columns: 35% 65%;
  }
  .story-column {
    padding-top: 0;
    gap: 6px;
  }
  .character-stage {
    padding-top: 5px;
  }
  .character-frame {
    width: 160px;
  }
  .character-label {
    bottom: 10px;
  }
  .character-label strong {
    font-size: 19px;
  }
  .character-label small {
    font-size: 8px;
  }
  .dialogue {
    padding: 15px 14px 9px;
  }
  .event-title {
    font-size: 21px;
    margin-bottom: 4px;
  }
  .scene {
    font-size: 12px;
    min-height: 0;
  }
  .choice {
    padding: 5px 10px;
    min-height: 35px;
    font-size: 11px;
  }
  .choice .choice-letter {
    height: 21px;
    width: 21px;
  }
  .choices {
    gap: 5px;
  }
  .prompt-line {
    display: none;
  }
  .chapter-line {
    font-size: 8px;
  }
  .prop {
    padding: 3px 8px;
    font-size: 10px;
    margin-top: 4px;
  }
  .feedback.bad {
    font-size: 10px;
    padding: 5px 10px;
  }
  .reaction-card {
    padding: 8px 15px;
  }
  .reaction-card h2 {
    font-size: 22px;
  }
  .reaction-heart {
    font-size: 25px;
  }
  .title-screen {
    padding: 8px 20px;
  }
  .title-mark h1 {
    font-size: 54px;
    margin: 6px 0;
  }
  .japanese {
    font-size: 9px;
  }
  .title-tag {
    font-size: 8px;
    padding: 3px 10px;
  }
  .cast {
    padding: 7px 0;
    gap: 20px;
    max-width: 580px;
  }
  .cast-card {
    max-height: 135px;
    padding: 3px 3px 22px;
  }
  .cast-card .cast-name {
    font-size: 14px;
  }
  .cast-card:nth-child(even) {
    margin-top: 7px;
  }
  .title-bottom .primary {
    font-size: 15px;
    min-height: 34px;
    padding: 4px 27px;
  }
  .title-bottom .tiny {
    display: none;
  }
  .ending-copy {
    padding-bottom: 8px;
  }
  .ending h1 {
    font-size: 38px;
  }
  .ending-line {
    font-size: 15px;
    margin: 3px;
  }
  .ending-stats {
    margin: 5px;
    gap: 30px;
  }
  .ending-stats b {
    display: inline;
    font-size: 18px;
    margin-right: 5px;
  }
  .ending .primary {
    font-size: 14px;
    min-height: 33px;
  }
  .ending-top {
    top: 10px;
    font-size: 9px;
  }
  .intro-screen {
    padding: 15px 15%;
    gap: 25px;
  }
  .intro-copy {
    padding: 20px;
  }
  .intro-copy p {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .intro-copy h2 {
    font-size: 25px;
  }
  .intro-copy .primary {
    font-size: 16px;
    padding: 5px 18px;
  }
  .intro-portrait {
    height: 250px;
    width: 160px;
  }
  .lost .portrait {
    width: 75px;
    height: 90px;
    margin: 0;
  }
  .lost-name {
    margin: 5px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Keep the finale illustration above its surface and below its caption. */
.ending-art {
  z-index: 0;
}
.ending.won:after {
  z-index: 1;
  pointer-events: none;
}
.ending-top {
  z-index: 2;
}
.ending-copy {
  position: relative;
  z-index: 2;
}
.primary {
  max-width: 100%;
}
@media (max-width: 360px) {
  .ending .primary {
    font-size: 15px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .ending .primary .end-heart {
    margin-left: 7px;
  }
  .meter-name {
    font-size: 11px;
  }
  .character-label {
    left: calc(50% + 84px);
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .play-layout {
    display: grid;
  }
  .character-frame {
    max-width: none;
  }
  .chapter-line {
    position: static;
  }
  .character-label {
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    min-width: 145px;
    max-width: 200px;
  }
  .title-mark h1 {
    max-width: none;
  }
  .title-mark h1 b {
    display: inline;
  }
  .title-mark h1 .heart {
    position: static;
  }
  .cast-card {
    aspect-ratio: 0.65;
  }
  .intro-screen {
    display: grid;
    grid-template-columns: 35% 65%;
    padding: 12px 10%;
  }
  .intro-portrait {
    max-height: 90%;
    width: 140px;
  }
  .ending-art {
    object-fit: cover;
    object-position: center 40%;
  }
  .story-column {
    margin-top: 0;
  }
  .character-stage {
    min-height: 0;
  }
  .ending-copy {
    padding-top: 4px;
  }
  .ending-top {
    top: 8px;
  }
}
/* Hover never moves a hit target underneath the pointer. */
.primary:hover,
.primary:active,
.choice:hover:not(:disabled) {
  transform: none;
}
@media (max-width: 700px) and (orientation: portrait) {
  .ending.won {
    background:
      linear-gradient(#fff0f58c, #fff0f58c),
      var(--garden-art) center/cover;
  }
  .ending-art {
    background: transparent;
    object-position: center 29%;
  }
  .ending.won:after {
    background: linear-gradient(
      #fff0f530 0%,
      transparent 40%,
      #fff0f500 49%,
      #fff0f5e8 72%
    );
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .hud {
    margin: 6px 14px 0;
  }
  .friend-meter {
    padding: 4px 8px;
  }
  .meter-top {
    flex-wrap: nowrap;
    gap: 5px;
  }
  .meter-name {
    font-size: 12px;
  }
  .meter-value {
    position: static;
    font-size: 10px;
  }
  .meter-track {
    margin-right: 0;
    margin-top: 4px;
  }
  .avatar {
    width: 24px;
    height: 24px;
  }
  .reaction-card {
    padding: 6px 12px;
  }
  .reaction-heart {
    display: none;
  }
  .reaction-card h2 {
    font-size: 18px;
    line-height: 1.15;
    margin: 3px 0;
  }
  .reaction-card .aside {
    font-size: 10px;
    margin: 4px 0;
  }
  .gain {
    font-size: 9px;
  }
  .reaction-bottom {
    padding: 0;
  }
  .next-button {
    min-height: 32px;
    font-size: 14px;
    line-height: 1.4;
    padding: 5px 15px;
  }
  .next-button .end-heart {
    margin-left: 8px;
  }
  .source-button {
    font-size: 9px;
    padding: 4px 0;
  }
  .story-column {
    gap: 5px;
  }
  .dialogue {
    padding: 14px 12px 8px;
  }
  .event-title {
    font-size: 19px;
  }
  .scene {
    font-size: 11px;
    line-height: 1.35;
  }
  .choice {
    min-height: 33px;
    font-size: 10.5px;
  }
  .speaker {
    font-size: 10px;
    top: -10px;
    padding: 1px 10px;
  }
}
@media (max-height: 350px) and (orientation: landscape) {
  .topbar {
    height: 31px;
  }
  .hud {
    margin-top: 5px;
  }
  .avatar {
    width: 20px;
    height: 20px;
  }
  .friend-meter {
    padding: 3px 7px;
  }
  .meter-track {
    height: 4px;
    margin-top: 3px;
  }
  .chapter-line {
    display: none;
  }
  .story-column {
    gap: 4px;
  }
  .dialogue {
    padding: 12px 10px 7px;
  }
  .event-title {
    font-size: 17px;
    line-height: 1.1;
    margin-bottom: 3px;
  }
  .scene {
    font-size: 10px;
    line-height: 1.3;
  }
  .choices {
    gap: 4px;
  }
  .choice {
    min-height: 29px;
    padding: 3px 8px;
    font-size: 10px;
    line-height: 1.25;
  }
  .choice .choice-letter {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
  .character-frame {
    width: 110px;
  }
  .character-frame .portrait {
    background-size: 100% 100%;
  }
  .character-label {
    min-width: 105px;
    max-width: 130px;
    padding: 4px 8px;
    bottom: 6px;
  }
  .character-label strong {
    font-size: 15px;
  }
  .character-label small {
    font-size: 7px;
  }
  .reaction-card h2 {
    font-size: 16px;
  }
  .next-button {
    min-height: 28px;
    font-size: 12px;
    padding: 4px 11px;
  }
  .reaction-card {
    padding: 5px 9px;
  }
}
@media (max-width: 700px) and (orientation: portrait) {
  .reaction-bottom .next-button {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 15px;
    padding: 7px 17px;
    line-height: 1.4;
  }
  .reaction-bottom .next-button .end-heart {
    margin-left: 8px;
  }
  .reaction-bottom .source-button {
    max-width: 40%;
    line-height: 1.35;
  }
}
