* {
  box-sizing: border-box;
}

:root {
  --burgundy: #761d42;
  --purple: #8b45aa;
  --pink: #e6a0e8;
  --white: #fff2ff;
  --muted: #c9b4d9;
  --dark: #090511;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--white);

  background:
    radial-gradient(
      ellipse at 20% 20%,
      rgba(105, 30, 92, 0.35),
      transparent 40%
    ),
    radial-gradient(
      ellipse at 80% 75%,
      rgba(66, 26, 105, 0.35),
      transparent 45%
    ),
    #07040d;

  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;

  background-image:
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(1px 1px at 70% 20%, #e7b7ff, transparent),
    radial-gradient(2px 2px at 40% 80%, #e8a0e8, transparent),
    radial-gradient(1px 1px at 85% 65%, white, transparent),
    radial-gradient(2px 2px at 12% 72%, #c18cff, transparent);

  background-size: 180px 180px;
  animation: starDrift 25s linear infinite;
}

@keyframes starDrift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 180px 360px;
  }
}

.screen {
  position: relative;
  min-height: 100vh;
  width: 100%;
  padding: 30px 18px 50px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  animation: fadeIn 0.6s ease;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

h1 {
  color: #fff2ff;
  font-size: clamp(34px, 8vw, 56px);
  font-weight: normal;
  font-style: italic;
  line-height: 1.2;

  text-shadow:
    0 0 15px rgba(221, 116, 238, 0.7),
    0 0 35px rgba(121, 40, 150, 0.5);
}

h2 {
  color: #ffeaff;
  font-size: 28px;
  font-weight: normal;
  font-style: italic;
}

h3 {
  color: #f2b9f0;
  font-weight: normal;
}

p {
  line-height: 1.8;
}

.subtitle {
  max-width: 480px;
  color: var(--muted);
  font-style: italic;
}

.welcome-note {
  max-width: 400px;
  margin: 30px auto;
  color: #e4c9ed;
  line-height: 2;
}

.welcome-stars {
  color: #e8a0ff;
  font-size: 32px;
  letter-spacing: 12px;
  text-shadow: 0 0 20px #d78bff;

  animation: sparkle 2s infinite alternate;
}

@keyframes sparkle {
  from {
    opacity: 0.6;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

/* BUTTONS */

button {
  font-family: inherit;
}

.main-btn {
  margin: 18px 0;
  padding: 15px 27px;

  color: white;
  font-size: 16px;
  letter-spacing: 0.5px;

  background: linear-gradient(
    120deg,
    #751e43,
    #54216e,
    #762454
  );

  border: 1px solid #df9ce8;
  border-radius: 40px;

  box-shadow: 0 0 22px rgba(183, 87, 201, 0.25);

  cursor: pointer;
  transition: 0.25s;
}

.main-btn:hover {
  box-shadow: 0 0 28px rgba(221, 139, 241, 0.6);
  transform: translateY(-2px);
}

.back-btn {
  align-self: flex-start;

  margin: 0 0 18px;
  padding: 10px 16px;

  color: #edc7f7;
  background: rgba(34, 17, 48, 0.8);

  border: 1px solid #75428b;
  border-radius: 25px;

  cursor: pointer;
}

/* GALAXY */

#galaxy {
  justify-content: flex-start;
  padding-top: 40px;
}

#planetField {
  width: min(100%, 650px);
  margin: 25px auto;

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px 12px;
}

.planet {
  min-width: 0;
  min-height: 83px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;

  color: #fceaff;
  background: transparent;
  border: none;

  cursor: pointer;
  transition: transform 0.25s;
}

.planet:hover {
  transform: scale(1.12);
}

.planet-symbol {
  font-size: 35px;
  line-height: 1;

  color: #f0b5ff;
  text-shadow:
    0 0 8px #d58aff,
    0 0 20px #8f39b4;
}

.planet.unlocked .planet-symbol {
  color: #ffd5f8;
  text-shadow:
    0 0 12px #ff92e8,
    0 0 28px #aa44d5;
}

.planet.locked {
  opacity: 0.4;
  filter: grayscale(0.4);
}

.planet-label {
  font-size: 12px;
  color: #e0c8eb;
}

.status {
  color: #e7b9f0;
  font-size: 14px;
}

/* GAME CARD */

.glass-card {
  width: min(100%, 540px);
  padding: 28px 20px;

  background: rgba(23, 11, 34, 0.94);
  border: 1px solid rgba(189, 108, 211, 0.7);
  border-radius: 25px;

  box-shadow:
    0 0 30px rgba(119, 37, 149, 0.2),
    inset 0 0 20px rgba(115, 39, 130, 0.1);
}

.big-star {
  color: #f3c4ff;
  font-size: 48px;
  text-shadow: 0 0 22px #d878ff;
}

.day-label {
  color: #e9a4ec;
  font-size: 13px;
  letter-spacing: 5px;
}

#gameDescription {
  color: #cdb5db;
}

#gameArea {
  margin-top: 25px;
}

.game-message {
  min-height: 28px;
  color: #f2b4ed;
  line-height: 1.7;
}

.game-question {
  margin: 18px 0;
  padding: 16px;

  text-align: left;

  background: rgba(8, 5, 17, 0.85);
  border: 1px solid #69407b;
  border-radius: 16px;
}

.game-question h3 {
  line-height: 1.6;
}

.game-option {
  display: block;
  width: 100%;

  margin: 10px 0;
  padding: 13px 14px;

  color: #fff0ff;
  background: #24142f;

  border: 1px solid #815093;
  border-radius: 13px;

  text-align: left;
  font-size: 15px;

  cursor: pointer;
  transition: 0.2s;
}

.game-option:hover {
  background: #47204f;
  border-color: #e7a0ed;
}

.game-option:disabled {
  opacity: 0.7;
}

.game-action {
  margin: 8px 4px;
  padding: 13px 19px;

  color: white;
  background: linear-gradient(120deg, #762047, #51246c);

  border: 1px solid #c783db;
  border-radius: 30px;

  cursor: pointer;
}

.game-symbols {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.game-symbol {
  width: 60px;
  height: 60px;

  color: white;
  background: #261333;

  border: 1px solid #a75cbd;
  border-radius: 15px;

  font-size: 26px;
  cursor: pointer;
}

.game-symbol:hover {
  background: #522253;
}

.game-input {
  display: block;
  width: 100%;

  margin: 15px 0;
  padding: 14px;

  color: white;
  background: #100919;

  border: 1px solid #a45fc0;
  border-radius: 12px;

  font-size: 16px;
  text-align: center;
}

/* LETTER */

.letter-card {
  width: min(100%, 620px);
  padding: 30px 22px;

  background: rgba(18, 9, 28, 0.94);
  border: 1px solid #8d4c9e;
  border-radius: 22px;

  box-shadow: 0 0 28px rgba(124, 40, 150, 0.2);
}

.letter-decoration {
  margin: 20px 0;

  color: #e6a4ec;
  font-size: 25px;
  letter-spacing: 10px;

  text-shadow: 0 0 15px #c764d8;
}

.letter-text {
  color: #fff4ff;

  font-size: 18px;
  font-style: italic;
  line-height: 2.1;

  text-align: left;
  white-space: pre-line;

  overflow-wrap: anywhere;
}

.voice-section {
  margin-top: 35px;
  padding-top: 20px;

  border-top: 1px solid #593366;
}

.voice-section h3 {
  font-style: italic;
}

.small-text {
  color: #bfa9ce;
  font-size: 13px;
  line-height: 1.7;
}

#voiceInput {
  display: block;
  width: 100%;

  margin: 20px 0;
  padding: 12px;

  color: #f9eaff;
  background: #171020;

  border: 1px solid #6d447c;
  border-radius: 12px;
}

#voicePlayer {
  width: 100%;
  margin: 12px 0;

  filter: hue-rotate(260deg);
}

/* FINAL PAGE */

.final-message {
  max-width: 500px;
  margin: 20px auto;

  color: #f5d9f5;
  font-size: 18px;
  font-style: italic;
  line-height: 2;
}

/* FALLING FROZEN STARS */

.falling-star {
  position: fixed;
  top: -20px;

  z-index: 10;
  pointer-events: none;

  color: #e7caff;
  text-shadow: 0 0 12px #d6a2ff;

  animation: fall linear forwards;
}

@keyframes fall {
  from {
    transform: translateY(-30px) rotate(0deg);
    opacity: 0.9;
  }

  to {
    transform: translateY(110vh) rotate(300deg);
    opacity: 0;
  }
}

/* MOBILE */

@media (max-width: 420px) {
  #planetField {
    gap: 15px 5px;
  }

  .planet-symbol {
    font-size: 28px;
  }

  .planet-label {
    font-size: 10px;
  }

  .letter-card,
  .glass-card {
    padding: 23px 16px;
  }

  .letter-text {
    font-size: 17px;
  }
}