
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #160609;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #160609;
  color: #f8ead9;
  font-family: Georgia, serif;
}

button {
  font-family: inherit;
}

.universe {
  min-height: 100vh;
  padding: 42px 20px;
  text-align: center;
  background: radial-gradient(ellipse at top, #65202b, #361019 45%, #160609);
}

.stars {
  color: #d9b779;
  font-size: 25px;
  letter-spacing: 8px;
  text-shadow: 0 0 18px #a93b43;
  animation: glow 2s infinite alternate;
}

h1 {
  margin: 18px 0 12px;
  color: #f0d5b5;
  font-size: clamp(30px, 5vw, 48px);
  font-weight: normal;
  text-shadow: 0 0 22px #9e3945;
}

.subtitle {
  margin-bottom: 38px;
  color: #d7b8a6;
  letter-spacing: 1px;
  line-height: 1.8;
}

.doors {
  width: min(940px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.door {
  min-width: 0;
  min-height: 255px;
  padding: 24px 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  border: 1px solid #a66b53;
  border-radius: 130px 130px 8px 8px;
  color: #f8ead9;
  background:
    radial-gradient(ellipse at 50% 20%, #80333b, transparent 68%),
    linear-gradient(145deg, #651b2a, #351019 75%);
  box-shadow: 0 0 22px #7e202c55,
              inset 0 0 22px #e3b98c12;
  cursor: pointer;
  transition: transform .35s, box-shadow .35s;
}

.door:hover {
  transform: translateY(-7px);
  border-color: #e0bd83;
  box-shadow: 0 0 30px #a33b4777;
}

.number {
  color: #d8b778;
  font-size: 12px;
  letter-spacing: 3px;
}

.symbol {
  color: #e9b6a2;
  font-size: 48px;
  text-shadow: 0 0 20px #9c3443;
}

.door-text {
  max-width: 200px;
  font-size: 17px;
  line-height: 1.6;
}

.door-hint {
  color: #d8b8a5;
  font-size: 12px;
  font-style: italic;
  line-height: 1.5;
}

.final-door {
  border-color: #c38a68;
  background:
    radial-gradient(ellipse at 50% 20%, #9c283b, transparent 68%),
    linear-gradient(145deg, #6d1428, #2c0914);
}

.final-door .symbol {
  color: #ffb5a2;
  text-shadow: 0 0 24px #d5223f;
}

.ending {
  margin: 36px 0 12px;
  color: #e1c49c;
  font-style: italic;
}

.signature {
  color: #b99a86;
  font-size: 12px;
  letter-spacing: 1px;
}

.story-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 2, 5, .91);
  backdrop-filter: blur(9px);
}

.story-overlay.visible {
  display: flex;
  animation: fadeIn .4s ease;
}

.story-card {
  position: relative;
  width: min(500px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px 25px 30px;
  text-align: center;
  border: 1px solid #aa795b;
  border-radius: 22px;
  background: radial-gradient(ellipse at top, #63232d, #321018 55%, #1b080c);
  box-shadow: 0 0 45px #7f1e3066;
  animation: cardIn .5s ease;
}

.close-story {
  position: absolute;
  top: 8px;
  right: 13px;
  border: none;
  background: transparent;
  color: #f8ead9;
  font-size: 30px;
  cursor: pointer;
}

.story-card h2 {
  color: #ead0a7;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: normal;
  line-height: 1.4;
}

.story-card p {
  color: #f8ead9;
  font-size: 17px;
  line-height: 1.9;
}

.phase-label {
  color: #d3aa75;
  font-size: 12px;
  letter-spacing: 4px;
}

.story-button {
  margin-top: 18px;
  padding: 13px 24px;
  border: 1px solid #c8a16f;
  border-radius: 30px;
  background: linear-gradient(135deg, #762333, #4b1420);
  color: #fff0dd;
  font-size: 15px;
  cursor: pointer;
  transition: .25s;
}

.story-button:hover {
  background: linear-gradient(135deg, #9a3040, #671a2a);
  transform: scale(1.04);
}

.final-heart {
  margin: 5px 0 15px;
  color: #d91935;
  font-size: clamp(110px, 27vw, 170px);
  line-height: 1.2;
  animation: heartBeat 1s ease-in-out infinite;
  filter: drop-shadow(0 0 25px #d91935);
}

.proposal-title {
  color: #f0cba5 !important;
  font-size: clamp(32px, 7vw, 45px) !important;
  text-shadow: 0 0 20px #9f293b;
}

.yes-button {
  background: linear-gradient(135deg, #a51e34, #651020);
  border-color: #dfb780;
}

.yes-button:hover {
  background: #b52840;
}

#heartSky {
  position: fixed;
  inset: 0;
  z-index: 1002;
  overflow: hidden;
  pointer-events: none;
}

.floating-heart {
  position: absolute;
  bottom: -40px;
  animation: floatUp 3.2s ease-out forwards;
}

@keyframes glow {
  from { opacity: .6; }
  to { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.88); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-115vh) rotate(30deg); opacity: 0; }
}

@media (max-width: 650px) {
  .doors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }

  .door {
    min-height: 215px;
    padding: 19px 9px;
    gap: 13px;
  }

  .symbol {
    font-size: 40px;
  }

  .door-text {
    font-size: 15px;
  }

  .story-card {
    padding: 38px 19px 25px;
  }
}

@media (max-width: 350px) {
  .doors {
    grid-template-columns: 1fr;
  }
}
