:root {
  --bg: #f6f3f1;
  --paper: #fffdfb;
  --paper-soft: #fffaf7;
  --ink: #2f2630;
  --ink-soft: #7a6f78;
  --line: rgba(78, 60, 74, 0.16);
  --rose: #e7d4db;
  --rose-strong: #d5b6c1;
  --mauve: #c9b8c8;
  --shadow: 0 20px 42px rgba(95, 72, 88, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Outfit", sans-serif;
  background:
    radial-gradient(1200px 560px at 105% -10%, #eadce1 0%, transparent 62%),
    radial-gradient(900px 540px at -12% 104%, #efe5e0 0%, transparent 64%),
    linear-gradient(140deg, #f7f3f1, #f5f0ee 52%, #f7f3f2);
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(156, 125, 144, 0.22);
  top: -110px;
  left: -90px;
}

body::after {
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(156, 125, 144, 0.16);
  right: -130px;
  bottom: -170px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.25px;
}

.container {
  width: min(1080px, 92vw);
  margin: 34px auto 68px;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 2;
}

.card {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 250, 0.9));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: auto -40px -52px auto;
  width: 180px;
  height: 120px;
  background: radial-gradient(circle at 50% 50%, rgba(213, 182, 193, 0.22), transparent 70%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 11px;
  font-weight: 700;
  color: #9a8590;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 66px);
  line-height: 0.92;
  max-width: 11ch;
}

.lead,
.game p,
.promise li,
.reply p,
.phrases > p {
  color: var(--ink-soft);
  line-height: 1.72;
  margin: 0;
}

.hero .lead {
  margin-top: 14px;
  max-width: 66ch;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  font-size: 12px;
  color: #866d7a;
  border: 1px solid rgba(124, 99, 114, 0.25);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.76);
}

.btn {
  border: 1px solid rgba(124, 99, 114, 0.2);
  background: linear-gradient(130deg, #fefcfb, var(--rose));
  color: #4d3e47;
  padding: 11px 17px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(133, 114, 123, 0.2);
}

.game,
.promise,
.reply,
.phrases {
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 248, 0.88)),
    linear-gradient(120deg, rgba(231, 212, 219, 0.1), transparent 60%);
}

.game h2,
.promise h2,
.phrases h2,
.reply h2 {
  margin-bottom: 8px;
  font-size: clamp(29px, 4.2vw, 39px);
}

.game-controls {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
}

.score,
.timer {
  margin: 0;
  font-size: 14px;
  color: #675660;
  font-weight: 700;
}

#gameArea {
  margin-top: 14px;
  height: 290px;
  border-radius: 18px;
  border: 1px dashed rgba(118, 98, 109, 0.35);
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.9), transparent 56%),
    linear-gradient(165deg, #f9f6f7, #f1e8ec);
  position: relative;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 8%, #f5edf1 66%, #e7d9e0 100%);
  box-shadow: 0 7px 20px rgba(149, 123, 136, 0.24);
  cursor: pointer;
  animation: heartFloat 1.7s ease-in-out infinite;
}

.star::before {
  content: "♡";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -53%);
  color: #8f7581;
  font-size: 19px;
}

.game-message {
  margin-top: 10px;
  min-height: 24px;
  color: #7c6874;
  font-weight: 500;
}

.promise ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.phrase-grid {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phrase-item {
  border: 1px solid rgba(118, 98, 109, 0.2);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 251, 0.62));
}

.phrase-title {
  margin: 0 0 8px;
  font-weight: 700;
  color: #5f5058;
}

.arabic {
  margin: 0;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 28px;
  line-height: 1.62;
  color: #43363d;
}

.translit {
  margin: 10px 0 0;
  color: #7f7079;
  font-style: italic;
  font-size: 14px;
}

.meaning {
  margin: 8px 0 0;
  color: #60525a;
  font-size: 14px;
}

.reply-form {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.reply-form label {
  font-size: 13px;
  color: #6f6269;
  font-weight: 600;
}

.reply-form input,
.reply-form textarea {
  width: 100%;
  border: 1px solid rgba(118, 98, 109, 0.24);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
}

.reply-form textarea {
  resize: vertical;
}

.reply-form input:focus,
.reply-form textarea:focus {
  outline: none;
  border-color: rgba(118, 98, 109, 0.48);
  box-shadow: 0 0 0 3px rgba(209, 180, 191, 0.2);
}

.reply-status {
  margin: 2px 0 0;
  min-height: 20px;
  color: #7f636f;
  font-size: 14px;
}

.music-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  border: 1px solid rgba(118, 98, 109, 0.28);
  background: rgba(255, 255, 255, 0.88);
  color: #5f5058;
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(95, 80, 88, 0.18);
}

dialog {
  width: min(650px, 92vw);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 50px rgba(61, 50, 58, 0.22);
}

dialog::backdrop {
  background: rgba(31, 22, 30, 0.28);
}

dialog article {
  padding: 24px;
}

dialog h3 {
  font-size: clamp(32px, 4.8vw, 40px);
  margin-bottom: 10px;
}

dialog p {
  color: #6d6168;
  line-height: 1.72;
}

.signoff {
  font-style: italic;
  color: #8a717e;
  font-weight: 600;
}

.hearts {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.hearts span {
  position: absolute;
  color: rgba(190, 168, 178, 0.55);
  font-size: clamp(15px, 2.6vw, 24px);
  animation: drift 13s linear infinite;
}

.hearts span:nth-child(1) {
  left: 8%;
  top: -5%;
  animation-delay: 0s;
}

.hearts span:nth-child(2) {
  left: 26%;
  top: -8%;
  animation-delay: 2s;
}

.hearts span:nth-child(3) {
  left: 43%;
  top: -7%;
  animation-delay: 5s;
}

.hearts span:nth-child(4) {
  left: 62%;
  top: -5%;
  animation-delay: 1s;
}

.hearts span:nth-child(5) {
  left: 80%;
  top: -6%;
  animation-delay: 3.8s;
}

.hearts span:nth-child(6) {
  left: 92%;
  top: -9%;
  animation-delay: 6.2s;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: revealUp 0.7s ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 0.12s;
}

.reveal:nth-child(3) {
  animation-delay: 0.24s;
}

.reveal:nth-child(4) {
  animation-delay: 0.34s;
}

.reveal:nth-child(5) {
  animation-delay: 0.44s;
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heartFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.04);
  }
}

@keyframes drift {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.65;
  }
  85% {
    opacity: 0.42;
  }
  100% {
    transform: translateY(112vh) translateX(-18px) rotate(25deg);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .hero h1 {
    max-width: 100%;
  }

  .phrase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    margin-top: 20px;
    gap: 14px;
  }

  .card {
    padding: 20px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: clamp(34px, 12vw, 46px);
    line-height: 0.98;
  }

  #gameArea {
    height: 235px;
  }

  .music-toggle {
    right: 12px;
    bottom: 12px;
    padding: 8px 12px;
    font-size: 13px;
  }
}
