:root {
  --ink: #4d2940;
  --muted: #967386;
  --pink: #e879a7;
  --pink-dark: #c94f83;
  --pink-soft: #ffe3ed;
  --rose: #fff3f7;
  --cream: #fffaf7;
  --lilac: #eee8ff;
  --line: #f1d8e3;
  --green: #4f9b78;
  --red: #d46b78;
  --shadow: 0 18px 50px rgba(111, 52, 82, 0.09);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, #fff8fa 0%, #fff3f6 45%, #fff8f0 100%);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
button {
  font: inherit;
}
.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
}
.ambient-one {
  width: 420px;
  height: 420px;
  background: #f9d8e6;
  top: -180px;
  right: -120px;
}
.ambient-two {
  width: 340px;
  height: 340px;
  background: #e9defe;
  bottom: -190px;
  left: -130px;
}
.site-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}
.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  border-bottom: 1px solid rgba(218, 174, 195, 0.35);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  min-width: 190px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: white;
  background: linear-gradient(145deg, #f39abd, #d96396);
  font-size: 20px;
  box-shadow: 0 7px 16px rgba(211, 93, 143, 0.24);
  transform: rotate(-5deg);
}
.brand strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 800;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.19em;
  font-weight: 700;
}
.top-nav {
  display: flex;
  gap: 7px;
  align-items: center;
}
.nav-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 11px 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s ease;
}
.nav-link:hover {
  background: #fff;
  color: var(--pink-dark);
}
.nav-link.active {
  background: #fff;
  color: var(--pink-dark);
  box-shadow: 0 4px 15px rgba(130, 62, 93, 0.07);
}
#app {
  min-height: 650px;
  padding: 35px 0 60px;
  outline: none;
}
.site-footer {
  border-top: 1px solid rgba(218, 174, 195, 0.35);
  padding: 22px 0 27px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #a88b9a;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-footer b {
  color: var(--pink);
}
.loading-screen {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}
.loader-heart {
  color: var(--pink);
  font-size: 40px;
  animation: pulse 1.1s infinite;
}
@keyframes pulse {
  50% {
    transform: scale(1.2);
  }
}
.eyebrow {
  color: var(--pink-dark);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 800;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
.serif {
  font-family: 'Playfair Display', Georgia, serif;
}
h1 {
  font-size: clamp(37px, 5vw, 57px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 12px 0 13px;
}
h2 {
  font-size: clamp(27px, 3vw, 35px);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
h3 {
  margin-bottom: 8px;
}
.muted {
  color: var(--muted);
}
.hero {
  position: relative;
  isolation: isolate;
  min-height: 275px;
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 20px;
  overflow: hidden;
  padding: 38px 44px;
  border: 1px solid #f2d4e0;
  border-radius: 28px;
  background: linear-gradient(115deg, #ffe7ef 0%, #fff0f4 57%, #f6edff 100%);
  box-shadow: var(--shadow);
}
.hero::after {
  content: '♥';
  position: absolute;
  z-index: -1;
  right: 16%;
  top: -78px;
  color: rgba(231, 121, 167, 0.12);
  font-size: 330px;
  line-height: 1;
  transform: rotate(14deg);
}
.hero-copy {
  max-width: 670px;
  align-self: center;
}
.hero-copy p {
  max-width: 620px;
  color: #896b7d;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 22px;
}
.hero-art {
  align-self: center;
  justify-self: center;
  position: relative;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
}
.orbit {
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(205, 110, 153, 0.45);
  border-radius: 50%;
  animation: spin 28s linear infinite;
}
.orbit::before,
.orbit::after {
  content: '✦';
  position: absolute;
  color: #d977a2;
  font-size: 18px;
}
.orbit::before {
  top: 5px;
  left: 32px;
}
.orbit::after {
  bottom: 22px;
  right: 1px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.big-heart {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 35px;
  background: linear-gradient(145deg, #f7a9c6, #d95f94);
  box-shadow: 0 18px 32px rgba(205, 91, 140, 0.26);
  color: white;
  font-size: 58px;
  transform: rotate(-9deg);
}
.button-primary,
.button-secondary,
.button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.button-primary {
  color: white;
  background: linear-gradient(135deg, #e77da7, #ce5b8e);
  box-shadow: 0 8px 18px rgba(205, 91, 140, 0.22);
}
.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 11px 24px rgba(205, 91, 140, 0.28);
}
.button-secondary {
  color: var(--pink-dark);
  background: white;
  border: 1px solid var(--line);
}
.button-secondary:hover,
.button-quiet:hover {
  background: #fff7fa;
  transform: translateY(-1px);
}
.button-quiet {
  color: var(--muted);
  background: transparent;
  padding-inline: 12px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin: 19px 0 35px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(241, 216, 227, 0.85);
  padding: 14px 17px;
  border-radius: 17px;
}
.stat-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #fff0f5;
  font-size: 18px;
}
.stat-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}
.stat-card small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.09em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 2px 16px;
}
.section-heading p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.game-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 218px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.83);
  box-shadow: 0 7px 22px rgba(110, 55, 83, 0.045);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.game-card::after {
  content: '';
  position: absolute;
  width: 130px;
  height: 130px;
  right: -45px;
  top: -45px;
  border-radius: 50%;
  background: var(--card-tint, #fff0f5);
  opacity: 0.85;
}
.game-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.game-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--card-tint, #fff0f5);
  font-size: 23px;
}
.game-number {
  color: #c3a6b5;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 800;
}
.game-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 21px;
  margin: 15px 0 6px;
}
.game-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 15px;
  max-width: 280px;
}
.game-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.game-tag {
  color: var(--pink-dark);
  background: #fff1f6;
  border-radius: 30px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 9px;
}
.play-link {
  color: var(--pink-dark);
  background: transparent;
  border: 0;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}
.play-link span {
  font-size: 15px;
  margin-left: 4px;
}
.home-bottom {
  margin-top: 20px;
  border: 1px dashed #e8bfd0;
  background: rgba(255, 255, 255, 0.55);
  padding: 17px 20px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.home-bottom strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
}
.home-bottom p {
  color: var(--muted);
  font-size: 11px;
  margin: 4px 0 0;
}
.game-layout {
  max-width: 820px;
  margin: 0 auto;
}
.back-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 0 18px;
}
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 20px;
}
.game-header h1 {
  font-size: clamp(32px, 4vw, 43px);
  margin: 8px 0 7px;
}
.game-header p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}
.progress-pill {
  color: var(--pink-dark);
  background: #fff;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 30px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.game-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 23px;
  padding: clamp(20px, 4vw, 34px);
  box-shadow: var(--shadow);
}
.question-count {
  color: var(--pink-dark);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 800;
  margin-bottom: 12px;
}
.question-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.25;
  margin-bottom: 23px;
}
.options-list {
  display: grid;
  gap: 10px;
}
.option-button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--ink);
  background: #fffafd;
  border: 1px solid #f0dce5;
  border-radius: 13px;
  padding: 13px 15px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: 0.18s ease;
}
.option-button:hover:not(:disabled) {
  border-color: #e5a4bf;
  background: #fff5f9;
  transform: translateX(2px);
}
.option-key {
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  height: 25px;
  width: 25px;
  color: #b1879c;
  border-radius: 8px;
  background: #f9edf2;
  font-size: 10px;
  font-weight: 800;
}
.option-button.correct {
  border-color: #9acdb5;
  background: #f1fbf5;
}
.option-button.incorrect {
  border-color: #efb1b9;
  background: #fff5f5;
}
.feedback {
  margin-top: 16px;
  padding: 13px 15px;
  background: #fff4f8;
  color: #94637b;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
}
.feedback.good {
  background: #f1fbf5;
  color: #4c8768;
}
.panel-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 23px;
}
.panel-actions .muted {
  font-size: 10px;
}
.quote-card {
  position: relative;
  padding: 32px 25px;
  border-radius: 19px;
  background: linear-gradient(135deg, #fff0f5, #f7f0ff);
  margin-bottom: 20px;
  text-align: center;
}
.quote-mark {
  color: #e49ab8;
  font-family: Georgia, serif;
  font-size: 55px;
  line-height: 0.7;
}
.quote-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(21px, 3vw, 29px);
  line-height: 1.4;
  margin: 12px auto 0;
  max-width: 570px;
  overflow-wrap: anywhere;
}
.speaker-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.speaker-button {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}
.speaker-button span {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
}
.speaker-button:hover {
  border-color: #e5a4bf;
  background: #fff7fa;
}
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  max-width: 520px;
  margin: 0 auto;
}
.memory-tile {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px solid #f0d9e3;
  background: linear-gradient(145deg, #fff4f8, #f9f2ff);
  border-radius: 15px;
  cursor: pointer;
  color: var(--pink-dark);
  font-size: 26px;
  transition: 0.2s ease;
  box-shadow: 0 4px 10px rgba(130, 62, 93, 0.04);
}
.memory-tile .tile-back {
  font-size: 23px;
  opacity: 0.75;
}
.memory-tile.flipped,
.memory-tile.matched {
  background: white;
  border-color: #e49ab8;
  transform: rotateY(0deg);
}
.memory-tile-caption {
  padding: 10px;
}
.memory-emoji {
  font-size: 38px;
  line-height: 1;
}
.memory-caption {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.memory-tile.matched {
  background: #f1fbf5;
  border-color: #9acdb5;
  cursor: default;
}
.memory-instructions {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.memory-stats {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 0 0 17px;
}
.memory-stats span {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.memory-stats strong {
  color: var(--ink);
  font-size: 15px;
  margin-left: 4px;
}
.flag-card {
  padding: 25px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff4f8, #fff8f0);
  text-align: center;
  margin-bottom: 18px;
}
.flag-card .flag-emoji {
  font-size: 30px;
  margin-bottom: 10px;
}
.flag-prompt {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(21px, 3vw, 29px);
  line-height: 1.35;
  max-width: 600px;
  margin: 0 auto;
}
.flag-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.flag-choice {
  padding: 18px 12px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
  font-size: 12px;
}
.flag-choice.red:hover {
  border-color: #e49ca5;
  background: #fff6f6;
}
.flag-choice.green:hover {
  border-color: #a7d3bb;
  background: #f4fcf7;
}
.flag-choice span {
  display: block;
  font-size: 23px;
  margin-bottom: 7px;
}
.completion {
  text-align: center;
  padding: 12px 5px 5px;
}
.completion-emoji {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 25px;
  background: #fff0f5;
  font-size: 35px;
}
.completion h2 {
  font-size: 32px;
}
.completion p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 20px;
}
.letter-wrap {
  max-width: 790px;
  margin: 0 auto;
}
.letter-paper {
  position: relative;
  overflow: hidden;
  background: #fffdfb;
  border: 1px solid #efd9e1;
  border-radius: 5px 22px 22px 22px;
  padding: clamp(27px, 6vw, 55px);
  box-shadow: var(--shadow);
}
.letter-paper::before {
  content: '♥';
  position: absolute;
  right: -10px;
  top: -27px;
  font-size: 160px;
  color: rgba(234, 151, 184, 0.09);
  transform: rotate(15deg);
}
.letter-paper h1 {
  font-size: 38px;
}
.letter-paper p {
  position: relative;
  white-space: pre-line;
  color: #785c6c;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  line-height: 2;
}
.letter-signoff {
  color: var(--pink-dark) !important;
}
.empty-note {
  border: 1px dashed #e6b4c9;
  padding: 20px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
  background: #fff8fb;
}
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: #57384a;
  color: #fff;
  padding: 12px 17px;
  border-radius: 12px;
  box-shadow: 0 9px 30px rgba(50, 20, 40, 0.2);
  font-size: 12px;
  font-weight: 700;
  transition: 0.25s ease;
  z-index: 20;
  max-width: calc(100% - 30px);
  text-align: center;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.placeholder-warning {
  color: #a5788e;
  font-size: 10px;
  background: #fff8fa;
  border: 1px dashed #efc9d9;
  padding: 9px 12px;
  border-radius: 10px;
  margin-top: 13px;
}
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr 0.35fr;
    padding: 30px;
  }
  .hero-art {
    transform: scale(0.8);
    transform-origin: center right;
  }
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .topbar {
    gap: 12px;
  }
  .brand {
    min-width: auto;
  }
}
@media (max-width: 560px) {
  .site-shell {
    width: min(100% - 24px, 480px);
  }
  .topbar {
    height: auto;
    min-height: 76px;
    flex-wrap: wrap;
    padding: 13px 0 10px;
  }
  .brand {
    flex: 1;
  }
  .top-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .nav-link {
    flex: 1;
    padding: 10px 6px;
    font-size: 11px;
  }
  #app {
    padding: 23px 0 42px;
    min-height: 600px;
  }
  .hero {
    display: block;
    min-height: auto;
    padding: 27px 23px;
  }
  .hero-art {
    position: absolute;
    right: -25px;
    bottom: -35px;
    opacity: 0.27;
    transform: scale(0.8);
  }
  .hero-copy {
    position: relative;
    z-index: 1;
  }
  .hero-copy p {
    font-size: 12px;
    max-width: 95%;
  }
  .stats-row {
    gap: 7px;
    margin: 12px 0 28px;
  }
  .stat-card {
    padding: 10px 8px;
    gap: 7px;
    border-radius: 13px;
  }
  .stat-icon {
    width: 29px;
    height: 29px;
    border-radius: 10px;
    font-size: 14px;
  }
  .stat-card strong {
    font-size: 16px;
  }
  .stat-card small {
    font-size: 8px;
    letter-spacing: 0.03em;
  }
  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }
  .game-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .game-card {
    min-height: 176px;
    padding: 17px;
  }
  .game-card h3 {
    margin-top: 11px;
  }
  .home-bottom {
    align-items: start;
    flex-direction: column;
  }
  .game-header {
    display: block;
  }
  .progress-pill {
    display: inline-block;
    margin-top: 13px;
  }
  .game-panel {
    border-radius: 18px;
    padding: 19px 15px;
  }
  .memory-grid {
    gap: 7px;
  }
  .memory-tile {
    border-radius: 11px;
    font-size: 23px;
  }
  .memory-tile-caption {
    padding: 5px;
  }
  .memory-caption {
    font-size: 10px;
  }
  .memory-emoji {
    font-size: 30px;
  }
  .site-footer {
    flex-direction: column;
    gap: 7px;
    font-size: 9px;
  }
  .letter-paper {
    padding: 27px 21px;
  }
  .letter-paper h1 {
    font-size: 31px;
  }
  .letter-paper p {
    font-size: 14px;
  }
}

/* Small interaction and accessibility refinements */
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(201, 79, 131, 0.38);
  outline-offset: 3px;
}
.option-button:disabled,
.speaker-button:disabled,
.flag-choice:disabled {
  cursor: default;
  opacity: 0.9;
}
.speaker-button:disabled {
  background: #fff8fb;
}
.flag-choice:disabled {
  box-shadow: inset 0 0 0 1px rgba(201, 79, 131, 0.12);
}
.memory-tile:disabled {
  cursor: default;
}
.nav-link,
.play-link,
.back-button {
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
