/* ══════════════════════════════════════════════════════════
   ✦  PIXEL ART GIFT SITE — STYLE.CSS  ✦
   Paleta: Preto · Lilás · Branco
   ══════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─── */
:root {
  --black: #0a0a0a;
  --black-soft: #141414;
  --lilac: #f472b6;
  --lilac-dark: #db2777;
  --lilac-deep: #9d174d;
  --lilac-glow: #ec4899;
  --lilac-pale: #fce7f3;
  --white: #f0f0f0;
  --white-dim: #c0c0c0;
  --error-red: #f87171;
  --pixel-border: 3px solid var(--lilac);
  --pixel-shadow:
    3px 3px 0 var(--lilac-dark),
    -1px -1px 0 rgba(244, 114, 182, 0.2);
  --font-pixel: 'Press Start 2P', monospace;
  --transition-speed: 0.4s;
}

/* ─── RESET & BASE ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-pixel);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ─── PARTICLES CANVAS ─── */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── SCREEN SYSTEM ─── */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--transition-speed) ease,
    visibility var(--transition-speed) ease;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

/* ─── PIXEL CONTAINER ─── */
.pixel-container {
  background: var(--black-soft);
  border: var(--pixel-border);
  box-shadow: var(--pixel-shadow);
  border-radius: 0;
  padding: 2.5rem 2rem;
  max-width: 650px;
  width: 90%;
  position: relative;
  animation: containerFadeIn 0.6s ease-out;
}

@keyframes containerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ═══════════════════════════
   TELA 1 — PASSWORD
   ═══════════════════════════ */

.password-container {
  text-align: center;
}

/* Lock Icon */
.lock-icon {
  margin: 0 auto 1.5rem;
  width: 48px;
  height: 48px;
  position: relative;
}

.lock-body {
  width: 40px;
  height: 30px;
  background: var(--lilac);
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border: 3px solid var(--lilac-dark);
}

.lock-shackle {
  width: 24px;
  height: 18px;
  border: 4px solid var(--lilac);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
}

.lock-keyhole {
  width: 8px;
  height: 8px;
  background: var(--black);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
}

.lock-keyhole::after {
  content: '';
  width: 4px;
  height: 8px;
  background: var(--black);
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.password-prompt {
  font-size: 0.65rem;
  line-height: 1.8;
  color: var(--lilac);
  margin-bottom: 1.8rem;
  letter-spacing: 0.5px;
}

/* Input */
.input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.pixel-input-wrapper {
  position: relative;
}

.pixel-input-wrapper input {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--lilac-dark);
  padding: 0.7rem 1rem;
  width: 180px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.pixel-input-wrapper input:focus {
  border-color: var(--lilac);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.3);
}

.pixel-input-wrapper input::placeholder {
  color: var(--white-dim);
  opacity: 0.5;
}

/* Error */
.error-msg {
  font-size: 0.5rem;
  color: var(--error-red);
  margin-bottom: 1rem;
  animation: shake 0.4s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

/* Hint */
.hint-section {
  margin-top: 1.5rem;
  border-top: 1px dashed rgba(192, 132, 252, 0.3);
  padding-top: 1.2rem;
}

.hint-title {
  font-size: 0.5rem;
  color: var(--white-dim);
  margin-bottom: 0.6rem;
}

.hint-item {
  font-size: 0.45rem;
  color: var(--white-dim);
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.hint-note {
  color: var(--lilac);
  opacity: 0.7;
}

.hint-text {
  font-size: 0.5rem;
  color: var(--lilac-glow);
  margin-top: 0.8rem;
  animation: blink-soft 1.5s infinite;
}

@keyframes blink-soft {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ─── BUTTONS ─── */
.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  background: var(--black);
  color: var(--lilac);
  border: 2px solid var(--lilac);
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  box-shadow: 3px 3px 0 var(--lilac-dark);
  text-transform: lowercase;
  letter-spacing: 1px;
}

.pixel-btn:hover {
  background: var(--lilac-deep);
  color: var(--white);
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--lilac-dark);
}

.pixel-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--lilac-dark);
}

.pixel-btn-accent {
  background: var(--lilac-dark);
  color: var(--white);
  border-color: var(--lilac);
}

.pixel-btn-accent:hover {
  background: var(--lilac-glow);
  color: var(--black);
}

.pixel-btn-small {
  font-size: 0.4rem;
  padding: 0.4rem 0.8rem;
  margin-top: 0.6rem;
  box-shadow: 2px 2px 0 var(--lilac-dark);
}

/* ─── HIDDEN UTILITY ─── */
.hidden {
  display: none !important;
}

/* ═══════════════════════════
   TELA 2 — TRANSITION
   ═══════════════════════════ */

.transition-container {
  text-align: center;
  position: relative;
  overflow: visible;
  padding: 2.5rem 2rem 2rem;
}

/* ─── Floating Characters ─── */
.floating-char {
  position: absolute;
  width: 80px;
  height: auto;
  image-rendering: pixelated;
  z-index: 2;
  filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.4));
}

.floating-penny {
  top: -20px;
  right: -30px;
  animation: float-penny 3.5s ease-in-out infinite;
}

.floating-ralsei {
  bottom: 40px;
  left: -30px;
  animation: float-ralsei 4s ease-in-out infinite 0.5s;
}

@keyframes float-penny {

  0%,
  100% {
    transform: translateY(0) rotate(3deg);
  }

  50% {
    transform: translateY(-12px) rotate(-3deg);
  }
}

@keyframes float-ralsei {

  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

/* ─── Speech Bubble Group ─── */
.speech-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}

.speech-bubble {
  background: var(--black);
  border: 3px solid var(--lilac);
  box-shadow: 4px 4px 0 var(--lilac-dark);
  padding: 1.2rem 1.2rem;
  max-width: 450px;
  width: 100%;
  position: relative;
  min-height: 80px;
  text-align: center;
}

/* Speech bubble tail pointing down */
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid var(--lilac);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 13px solid var(--black);
  z-index: 1;
}

.speech-text {
  font-size: 0.55rem;
  color: var(--lilac);
  line-height: 2;
  min-height: 1.5rem;
}

/* ─── Speaker (Luis) ─── */
.speech-speaker {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.2rem;
}

.speaker-frame {
  width: 90px;
  height: 90px;
  border: 3px solid var(--lilac);
  box-shadow: 3px 3px 0 var(--lilac-dark);
  overflow: hidden;
  background: var(--black);
}

.speaker-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.speaker-name {
  font-size: 0.4rem;
  color: var(--lilac-glow);
  margin-top: 0.4rem;
  letter-spacing: 1px;
}

/* Loading Bar */
.loading-bar-container {
  width: 80%;
  max-width: 300px;
  height: 14px;
  border: 2px solid var(--lilac);
  margin: 0 auto 0.6rem;
  background: var(--black);
  position: relative;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lilac-dark), var(--lilac-glow), var(--lilac));
  transition: width 0.1s linear;
  position: relative;
}

.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(90deg,
      transparent,
      transparent 8px,
      rgba(0, 0, 0, 0.2) 8px,
      rgba(0, 0, 0, 0.2) 10px);
}

.loading-text {
  font-size: 0.4rem;
  color: var(--white-dim);
  text-align: center;
  animation: blink-soft 1s infinite;
}

/* ═══════════════════════════
   TELA 3 — LETTER
   ═══════════════════════════ */

.letter-container {
  text-align: center;
}

.letter-title {
  font-size: 0.85rem;
  color: var(--lilac);
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 0 var(--lilac-deep);
  animation: glow-pulse 3s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  from {
    text-shadow: 2px 2px 0 var(--lilac-deep);
  }

  to {
    text-shadow: 2px 2px 8px var(--lilac-glow), 0 0 20px rgba(168, 85, 247, 0.3);
  }
}

/* Retro Window */
.letter-window {
  border: 2px solid var(--lilac);
  box-shadow: var(--pixel-shadow);
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
  background: var(--black);
}

/* Letter speech bubble overrides */
.letter-speech-group {
  margin-bottom: 1rem;
}

.letter-bubble {
  max-width: 520px;
  padding: 0.8rem;
}

.letter-bubble .letter-window {
  box-shadow: none;
  border: 2px solid var(--lilac-dark);
  max-width: 100%;
}

.window-titlebar {
  background: var(--lilac-dark);
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 2px solid var(--lilac);
}

.window-dot {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  display: inline-block;
}

.dot-close {
  background: var(--error-red);
}

.dot-minimize {
  background: #fbbf24;
}

.dot-maximize {
  background: #34d399;
}

.window-titlebar-text {
  font-size: 0.35rem;
  color: var(--white);
  margin-left: auto;
  opacity: 0.7;
}

.window-content {
  padding: 1.2rem 1rem;
  max-height: 280px;
  overflow-y: auto;
}

/* Custom Scrollbar */
.window-content::-webkit-scrollbar {
  width: 10px;
}

.window-content::-webkit-scrollbar-track {
  background: var(--black);
  border-left: 2px solid var(--lilac-dark);
}

.window-content::-webkit-scrollbar-thumb {
  background: var(--lilac-dark);
  border: 1px solid var(--lilac);
}

.window-content::-webkit-scrollbar-thumb:hover {
  background: var(--lilac);
}

.letter-text {
  font-size: 0.5rem;
  color: var(--white);
  line-height: 2.2;
}

.letter-text p {
  margin-bottom: 0.8rem;
}

.letter-text p:last-child {
  margin-bottom: 0;
}

/* Frisk decoration */
.letter-decoration {
  display: flex;
  justify-content: center;
  margin: 1.2rem 0;
}

.frisk-img {
  width: 120px;
  height: auto;
  image-rendering: pixelated;
  border: 2px solid var(--lilac);
  box-shadow: 3px 3px 0 var(--lilac-dark);
  animation: float-frisk 3s ease-in-out infinite;
}

@keyframes float-frisk {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.letter-footer {
  display: flex;
  justify-content: flex-end;
}

/* ═══════════════════════════
   TELA 4 — SPOTIFY
   ═══════════════════════════ */

.spotify-container {
  text-align: center;
}

.spotify-title {
  font-size: 0.75rem;
  color: var(--lilac);
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 0 var(--lilac-deep);
}

.spotify-frame {
  border: 3px solid var(--lilac);
  box-shadow: var(--pixel-shadow);
  padding: 4px;
  background: var(--black);
  margin: 0 auto 1.5rem;
  max-width: 500px;
}

.spotify-frame iframe {
  display: block;
}

.spotify-footer {
  display: flex;
  justify-content: flex-start;
}

/* ─── FLOATING STARS ─── */
.pixel-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  color: var(--lilac);
  font-size: 0.6rem;
  opacity: 0.4;
  animation: float-star 4s ease-in-out infinite;
}

.s1 {
  top: 8%;
  left: 5%;
  animation-delay: 0s;
}

.s2 {
  top: 15%;
  right: 8%;
  animation-delay: 0.8s;
}

.s3 {
  bottom: 20%;
  left: 10%;
  animation-delay: 1.6s;
}

.s4 {
  bottom: 10%;
  right: 5%;
  animation-delay: 2.4s;
}

.s5 {
  top: 50%;
  left: 50%;
  animation-delay: 3.2s;
  font-size: 0.4rem;
}

@keyframes float-star {

  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.3;
  }

  50% {
    transform: translateY(-8px) scale(1.3);
    opacity: 0.8;
  }
}

/* ═══════════════════════════
   CURSOR PISCANTE CUSTOMIZADO
   ═══════════════════════════ */

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 0.7rem;
  background: var(--lilac);
  margin-left: 2px;
  animation: cursor-blink 0.6s step-end infinite;
  vertical-align: middle;
}

@keyframes cursor-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ═══════════════════════════
   RESPONSIVIDADE
   ═══════════════════════════ */

@media (max-width: 600px) {
  .pixel-container {
    padding: 1.5rem 1rem;
    width: 95%;
  }

  .password-prompt {
    font-size: 0.5rem;
  }

  .pixel-input-wrapper input {
    width: 140px;
    font-size: 0.5rem;
  }

  .letter-title,
  .spotify-title {
    font-size: 0.6rem;
  }

  .letter-text {
    font-size: 0.42rem;
  }

  .window-content {
    max-height: 220px;
    padding: 0.8rem;
  }

  .photo-frame {
    width: 140px;
    height: 140px;
  }

  .hint-title {
    font-size: 0.4rem;
  }

  .hint-item {
    font-size: 0.38rem;
  }
}

@media (max-width: 400px) {
  .input-group {
    flex-direction: column;
    gap: 0.5rem;
  }

  .pixel-container {
    padding: 1.2rem 0.8rem;
  }
}