/* ============================================================
   CHUNKY'S PARADISE
   Tropical Tech Theme — matches Repairadise.tech vibe
   Static twilight-sea background + stylish UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bungee+Shade&family=Righteous&family=Fredoka:wght@300;400;500;600;700&family=Bangers&display=swap');

:root {
  --teal: #00CED1;
  --teal-deep: #008B8B;
  --teal-light: #40E0D0;
  --hot-pink: #FF1493;
  --magenta: #FF0080;
  --yellow: #FFD700;
  --yellow-light: #FFEC8B;
  --orange: #FF6B35;
  --bamboo: #D4A76A;
  --night-sky: #0D0221;
  --deep-ocean: #0a1e32;

  --font-display: 'Bungee Shade', cursive;
  --font-heading: 'Bangers', cursive;
  --font-accent: 'Righteous', cursive;
  --font-body: 'Fredoka', sans-serif;

  --shadow-neon-pink: 0 0 20px rgba(255, 20, 147, 0.5), 0 0 40px rgba(255, 20, 147, 0.2);
  --shadow-neon-cyan: 0 0 18px rgba(0, 206, 209, 0.45);
  --shadow-tiki: 0 10px 36px rgba(0, 0, 0, 0.35);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: #fff;
  line-height: 1.6;
  min-height: 100%;
  overflow-x: hidden;
  /* fallback if bg layer fails */
  background: var(--deep-ocean);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--night-sky); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--hot-pink), var(--teal));
  border-radius: 5px;
}

/* ============================================================
   STATIC BACKGROUND (fixed — never scrolls)
   Clear beach sunset: warm sky + bright sun on horizon + blue ocean
   Islands nestled at the very bottom.
   ============================================================ */
.bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/*
  SKY only (upper ~68%). Heavy orange/gold so it never reads as “all purple”.
  Purple is a thin band at the top only.
*/
.bg-sky {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 68%;
  background: linear-gradient(
    180deg,
    #2b1055 0%,
    #5c1a7a 10%,
    #c23a7a 22%,
    #e85d5a 34%,
    #ff7a35 48%,
    #ff9a3c 60%,
    #ffc14d 78%,
    #ffd978 92%,
    #ffe9a8 100%
  );
}

/* Warm sun bloom near the horizon (no heavy purple wash) */
.bg-glow {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 68%;
  background:
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(255, 220, 120, 0.55) 0%, rgba(255, 140, 60, 0.2) 45%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 50% 20%, rgba(255, 100, 150, 0.18) 0%, transparent 60%);
}

/* Setting sun — rests on the waterline */
.bg-sun {
  position: absolute;
  left: 50%;
  top: 68%;
  transform: translate(-50%, -42%);
  width: min(160px, 24vw);
  height: min(160px, 24vw);
  z-index: 3;
}

.bg-sun::before {
  content: '';
  position: absolute;
  inset: -60%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 240, 160, 0.7) 0%,
    rgba(255, 160, 60, 0.35) 38%,
    transparent 68%
  );
}

.bg-sun-core {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 32%,
    #fffef0 0%,
    #ffe566 28%,
    #ffb84a 60%,
    #ff8a30 100%
  );
  box-shadow:
    0 0 36px 10px rgba(255, 210, 90, 0.65),
    0 0 70px 28px rgba(255, 120, 50, 0.35);
}

/* Bright waterline where sky meets sea */
.bg-horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 68%;
  height: 4px;
  z-index: 4;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 230, 160, 0.35) 15%,
    #fff6c8 50%,
    rgba(255, 230, 160, 0.35) 85%,
    transparent 100%
  );
  box-shadow:
    0 0 24px 6px rgba(255, 200, 100, 0.45),
    0 2px 20px rgba(100, 200, 230, 0.25);
}

/*
  OCEAN — solid lower third, unmistakably blue (not purple).
*/
.bg-sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  z-index: 2;
  overflow: hidden; /* waves never leave the ocean */
  background: linear-gradient(
    180deg,
    #5eb8d4 0%,
    #2a8fba 18%,
    #156f96 40%,
    #0c4d6e 65%,
    #083348 85%,
    #041e2c 100%
  );
}

/* Soft sun reflection on the water */
.bg-sea::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(220px, 40vw);
  height: 70%;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(255, 230, 150, 0.4) 0%,
    rgba(255, 180, 80, 0.15) 40%,
    transparent 100%
  );
  filter: blur(2px);
  pointer-events: none;
}

/* Subtle ocean-only wave ribbons */
.sea-waves {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.sea-wave {
  position: absolute;
  left: 0;
  display: flex;
  width: 200%;
  opacity: 0.22;
}

.sea-wave svg {
  width: 50%;
  height: 100%;
  flex-shrink: 0;
  display: block;
}

.sea-wave svg path {
  fill: currentColor;
}

/* Near surface — soft light crest */
.sea-wave-a {
  top: 8%;
  height: 28px;
  color: rgba(200, 240, 255, 0.55);
  animation: waveSlide 14s linear infinite;
}

/* Mid water — slightly deeper, reverse */
.sea-wave-b {
  top: 28%;
  height: 24px;
  color: rgba(120, 200, 230, 0.4);
  animation: waveSlide 11s linear infinite reverse;
  opacity: 0.18;
}

/* Lower, quieter band above the islands */
.sea-wave-c {
  top: 48%;
  height: 20px;
  color: rgba(80, 170, 210, 0.35);
  animation: waveSlide 16s linear infinite;
  opacity: 0.14;
}

@keyframes waveSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Islands nestled at the absolute bottom of the fixed bg */
.bg-islands {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: clamp(120px, 20vh, 220px);
  z-index: 5;
  display: block;
}

/* Hibiscus snowflakes — soft petals drifting in the sky */
.petal {
  position: absolute;
  z-index: 2;
  opacity: 0.22;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 105, 180, 0.25));
  animation: petalDrift 18s ease-in-out infinite;
  will-change: transform;
}

@keyframes petalDrift {
  0%, 100% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  25% {
    transform: translateY(18px) translateX(12px) rotate(12deg);
  }
  50% {
    transform: translateY(-10px) translateX(-8px) rotate(-8deg);
  }
  75% {
    transform: translateY(14px) translateX(6px) rotate(6deg);
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 2px;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: var(--transition);
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, var(--hot-pink), var(--magenta));
  box-shadow: var(--shadow-neon-pink);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 32px rgba(255, 20, 147, 0.7);
}

.btn-lg {
  font-size: 1.3rem;
  padding: 16px 40px;
}

.btn-block {
  width: 100%;
}

/* ============================================================
   PASSWORD GATE
   ============================================================ */
#gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: max(24px, 12vh); /* keep card clear of islands a bit */
}

#gate.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px 34px;
  text-align: center;
  background: linear-gradient(
    160deg,
    rgba(13, 2, 33, 0.92),
    rgba(20, 40, 70, 0.88)
  );
  border: 4px solid var(--bamboo);
  border-radius: 22px;
  box-shadow: var(--shadow-tiki), var(--shadow-neon-pink);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.card-logo {
  width: 130px;
  height: 130px;
  margin: 0 auto 14px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 20, 147, 0.5));
  animation: floaty 4s ease-in-out infinite;
}

.card-title {
  font-family: var(--font-accent);
  font-size: 1.85rem;
  background: linear-gradient(135deg, var(--hot-pink), var(--yellow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.card-sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  margin-bottom: 22px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 20, 147, 0.45);
  background: rgba(10, 5, 28, 0.7);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  transition: var(--transition);
}

.gate-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1px;
}

.gate-input:focus {
  border-color: var(--teal);
  box-shadow: var(--shadow-neon-cyan);
}

.gate-error {
  min-height: 1.2em;
  color: #ff6b8a;
  font-size: 0.9rem;
}

.gate-card.shake {
  animation: shake 0.4s ease;
}

/* ============================================================
   MAIN APP
   ============================================================ */
#app {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: none; /* shown via .visible after unlock */
  flex-direction: column;
}

#app.visible {
  display: flex !important;
  animation: fadeIn 0.5s ease;
}

/* Top bar — Repairadise-style teal strip (only when unlocked) */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 42px;
  padding: 10px 24px;
  background: linear-gradient(90deg, #007a7a 0%, #00ced1 50%, #007a7a 100%);
  border-bottom: 4px solid var(--hot-pink);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
}

.topbar-brand {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.topbar-nav a {
  color: #fff;
  font-weight: 700;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}

.topbar-nav a:hover {
  color: var(--yellow-light);
  border-bottom-color: var(--yellow);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Hero */
.hero {
  text-align: center;
  padding: 52px 20px 36px;
  max-width: 680px;
  margin: 0 auto;
}

.hero-logo {
  width: min(220px, 55vw);
  height: auto;
  margin: 0 auto 18px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(255, 20, 147, 0.5));
  animation: floaty 4s ease-in-out infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.9rem);
  line-height: 1.15;
  background: linear-gradient(135deg, var(--hot-pink), var(--yellow), var(--teal-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.hero-tagline {
  font-family: var(--font-accent);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: var(--yellow-light);
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.4), 1px 1px 3px rgba(0, 0, 0, 0.45);
}

.hero-blurb {
  color: rgba(255, 255, 255, 0.9);
  max-width: 480px;
  margin: 0 auto 30px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Links */
.links-section {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 20px 140px; /* clear the fixed islands */
  text-align: center;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-shadow: 0 0 14px rgba(255, 20, 147, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.section-title span {
  color: var(--yellow);
}

.section-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  margin-bottom: 22px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: linear-gradient(
    160deg,
    rgba(13, 2, 33, 0.78),
    rgba(20, 50, 80, 0.62)
  );
  border: 3px solid var(--bamboo);
  border-radius: 18px;
  box-shadow: var(--shadow-tiki);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}

.link-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: var(--hot-pink);
  box-shadow: var(--shadow-neon-pink);
}

.link-icon {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

.link-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  letter-spacing: 1.5px;
  color: var(--yellow-light);
}

.link-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Footer */
.footer {
  text-align: center;
  padding: 18px 16px 28px;
  margin-top: auto;
  border-top: 3px solid rgba(212, 167, 106, 0.5);
  background: linear-gradient(180deg, rgba(6, 30, 48, 0.45), rgba(6, 20, 35, 0.75));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  z-index: 10;
}

.footer-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}

.footer-egg {
  display: inline-block;
  font-size: 1.15rem;
  opacity: 0.35;
  padding: 4px 10px;
  border-radius: 20px;
  transition: var(--transition);
  filter: grayscale(0.35);
}

.footer-egg:hover {
  opacity: 1;
  filter: grayscale(0) drop-shadow(0 0 12px rgba(255, 105, 180, 0.8));
  transform: scale(1.25) rotate(-8deg);
}

.lock-btn {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--font-body);
  font-size: 0.75rem;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}

.lock-btn:hover {
  border-color: var(--hot-pink);
  color: #fff;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-9px); }
  75% { transform: translateX(9px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 700px) {
  .card {
    padding: 30px 22px 26px;
  }

  .card-logo {
    width: 110px;
    height: 110px;
  }

  .hero {
    padding: 36px 16px 28px;
  }

  .hero-logo {
    width: min(170px, 50vw);
  }

  .btn-lg {
    font-size: 1.15rem;
    padding: 14px 32px;
  }

  .links-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .link-card {
    padding: 18px 12px;
  }

  .links-section {
    padding-bottom: 120px;
  }

  .bg-sky,
  .bg-glow {
    height: 64%;
  }

  .bg-sea {
    height: 36%;
  }

  .bg-sun {
    width: min(120px, 28vw);
    height: min(120px, 28vw);
    top: 64%;
  }

  .bg-horizon {
    top: 64%;
  }

  .bg-islands {
    height: clamp(100px, 18vh, 170px);
  }

  .topbar {
    padding: 10px 14px;
    font-size: 0.8rem;
    min-height: 44px;
  }

  #gate {
    padding-bottom: max(20px, 16vh);
  }

  .petal {
    opacity: 0.16;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .card-logo,
  .hero-logo,
  .petal,
  .sea-wave {
    animation: none;
  }
}
