/* =============================================
   TOKITOPIA — Landing Page Styles
   Brand: Purple #7B3FE4 · Blue #4BA9F5
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple: #7B3FE4;
  --purple-light: #A96FF7;
  --blue: #4BA9F5;
  --blue-light: #8DCFFF;
  --cream: #F0EAFF;
  --star-color: rgba(255, 255, 255, 0.85);
  --font-display: 'Baloo 2', cursive;
  --font-body: 'Nunito', sans-serif;

  /* Planet size — controls everything else via JS too */
  --planet-size: min(900px, 130vw);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: #080618;
  color: white;
}

/* ---- Starfield ---- */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Layout ---- */
main.hero {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* ---- Top content ---- */
.hero-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(24px, 5vh, 56px);
  gap: clamp(8px, 2vh, 18px);
  width: 100%;
  position: relative;
  z-index: 2;
}

/* ---- Logo ---- */
.logo {
  width: clamp(330px, 82vw, 780px);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(123, 63, 228, 0.7))
          drop-shadow(0 0 6px rgba(75, 169, 245, 0.5));
  animation: logo-float 3.6s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* ---- Subtitle ---- */
.subtitle {
  font-family: var(--font-display);
  font-size: clamp(15px, 3.6vw, 25px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.3;
  padding: 0 16px;
}

.description {
  font-family: var(--font-body);
  font-size: clamp(13px, 2vw, 16px);
  font-weight: 400;
  text-align: center;
  line-height: 1.55;
  opacity: 0.7;
  padding: 8px 24px 0;
  max-width: 720px;
  margin: 0 auto;
  white-space: pre-line;
}

.sub-purple {
  color: var(--purple-light);
  text-shadow: 0 0 18px rgba(169, 111, 247, 0.6);
}

.sub-blue {
  color: var(--blue-light);
  text-shadow: 0 0 18px rgba(141, 207, 255, 0.6);
}

/* ---- Mini game CTA ---- */
.minigame-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(14px, 2.5vh, 28px);
}

.minigame-label {
  font-family: var(--font-body);
  font-size: clamp(14px, 2.3vw, 18px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 34px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: clamp(15px, 2.3vw, 19px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(123, 63, 228, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.play-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 26px rgba(123, 63, 228, 0.65);
}

/* ---- Coming Soon ---- */
.coming-soon {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: clamp(11px, 2.8vw, 16px);
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 100px;
  padding: 5px 18px;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.05);
}

/* ---- Center block (socials) ---- */
.center-block {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 2;
  pointer-events: none;
}

.center-block > * {
  pointer-events: auto;
}

/* ---- Social icons ---- */
.socials {
  display: flex;
  gap: 14px;
  align-items: center;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(60, 55, 80, 0.72);
  border: 1.5px solid rgba(255,255,255,0.35);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.social-btn svg {
  width: 18px;
  height: 18px;
}

.social-btn:hover {
  background: rgba(123, 63, 228, 0.75);
  color: #fff;
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

.social-btn--disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Tappatapps credit ---- */
.tappatapps-credit {
  position: fixed;
  bottom: 18px;
  left: 20px;
  font-family: var(--font-body);
  font-size: clamp(20px, 3.6vw, 26px);
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  letter-spacing: 0.03em;
  z-index: 10;
  transition: color 0.2s;
}

.tappatapps-logo {
  height: 1.65em;
  vertical-align: middle;
  opacity: 1;
}

.tappatapps-credit:hover {
  color: rgba(255,255,255,0.55);
}


/* ---- Planet scene ---- */
.planet-scene {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--planet-size);
  height: calc(var(--planet-size) / 2);
  overflow: visible;
  pointer-events: none;
}

/* Planet image */
.planet-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--planet-size);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.planet {
  width: 100%;
  height: var(--planet-size);
  object-fit: contain;
  animation: planet-spin 40s linear infinite;
  transform-origin: center center;
  /* shift up so only top half is visible; matches animation start to avoid Safari flash */
  transform: translateY(74%);
}

@keyframes planet-spin {
  from { transform: translateY(74%) rotate(0deg); }
  to   { transform: translateY(74%) rotate(-360deg); }
}

/* ---- Characters layer ---- */
.characters-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--planet-size);
  pointer-events: none;
}

/* Each character is absolutely positioned by JS */
.character {
  position: absolute;
  width: clamp(50px, 13vw, 150px);
  height: auto;
  image-rendering: smooth;
  transform-origin: bottom center;
}

.character img {
  width: 100%;
  height: auto;
  display: block;
}

/* =============================================
   Responsive tweaks
   ============================================= */
@media (max-width: 480px) {
  :root {
    --planet-size: 125vw;
  }
  .subtitle {
    flex-direction: column;
    gap: 2px;
  }
  /* Reduce planet translateY so it sits higher on screen */
  @keyframes planet-spin {
    from { transform: translateY(46%) rotate(0deg); }
    to   { transform: translateY(46%) rotate(-360deg); }
  }
}

@media (min-width: 1400px) {
  :root {
    --planet-size: 900px;
  }
}

/* ---- Compact landscape tier 1: width ≥ 2× height (e.g. landscape phones, short desktop) ---- */
/* Only the badge drops to just above the socials; all other content stays in normal flow.        */
@media (min-aspect-ratio: 2/1) {
  .hero-top {
    padding-top: clamp(10px, 2vh, 20px);
    gap: clamp(4px, 1vh, 10px);
  }

  .coming-soon {
    position: fixed;
    bottom: 132px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
  }
}

/* ---- Compact landscape tier 2: width ≥ 2.5× height (very short, e.g. 932×370 or less) ---- */
/* Additionally hides the description to reclaim more vertical space.                             */
@media (min-aspect-ratio: 5/2) {
  .description {
    display: none;
  }
}

/* ---- Business card (QR visitors) ---- */
.contact-card {
  position: fixed;
  bottom: 18px;
  right: 20px;
  z-index: 10;
  background: rgba(12, 6, 30, 0.82);
  border: 1.5px solid rgba(123, 63, 228, 0.4);
  border-radius: 16px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 28px rgba(123, 63, 228, 0.2), 0 0 0 1px rgba(75, 169, 245, 0.08);
  font-family: var(--font-body);
}

.contact-card[hidden] {
  display: none;
}

.contact-card__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
}

.contact-card__close:hover {
  color: rgba(255, 255, 255, 0.8);
}

.contact-card__name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  padding-right: 20px;
}

.contact-card__email {
  font-size: 13px;
  color: var(--blue-light);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.contact-card__email:hover {
  opacity: 1;
}

.contact-card__linkedin {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--purple-light);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
  margin-top: 2px;
}

.contact-card__linkedin:hover {
  opacity: 1;
}

.contact-card__linkedin svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
