:root {
  --bg-color: #0a154c;
  --card-bg: rgba(255, 255, 255, 0.95);
  --container-max: 500px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100svh;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.container {
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene {
  position: relative;
  width: min(100vw, var(--container-max));
  height: 100svh;
  max-height: 915px;
  overflow: hidden;
}

.ninja-bg {
  position: absolute;
  inset: 0;
  background-image: url("../img/ninja.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  z-index: 1;
}

.quote-anchor {
  position: absolute;
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.speech-bubble {
  position: relative;
  width: clamp(230px, 62%, 360px);
  max-height: 34svh;
  overflow-wrap: break-word;
  background: var(--card-bg);
  border-radius: 20px;
  padding: clamp(.75rem, 3vw, 1.2rem);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 16px solid var(--card-bg);
}

.ninja-icon {
  width: clamp(2.4rem, 9vw, 4rem);
  height: auto;
  display: block;
  margin-top: .45rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55));
}

#quote-text {
  margin: 0;
  font-weight: 700;
  color: #333;
  font-size: clamp(.95rem, 4vw, 1.65rem);
  line-height: 1.2;
}

#quote-author {
  margin-top: .45rem;
  font-size: clamp(.65rem, 2vw, .9rem);
  color: #666;
  font-style: italic;
}

#counter {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  color: rgba(255,255,255,0.5);
  font-size: .8rem;
  text-align: center;
  width: 90%;
}

/* Celulares chicos */
@media (max-width: 380px) {
  .quote-anchor {
    top: 8%;
  }

  .speech-bubble {
    width: 68%;
    max-height: 30svh;
    border-radius: 16px;
  }

  #quote-text {
    font-size: clamp(.85rem, 3.8vw, 1.15rem);
  }

  .ninja-emoji {
    font-size: 2.2rem;
  }
}

/* Celulares horizontales */
@media (max-height: 520px) and (orientation: landscape) {
  .scene {
    width: min(100vw, 720px);
  }

  .quote-anchor {
    top: 5%;
  }

  .speech-bubble {
    width: min(55%, 360px);
    max-height: 45svh;
  }

  .ninja-emoji {
    font-size: 2rem;
  }

  #counter {
    display: none;
  }
}
