/* ==========================================================================
   Vibedog — styles
   Blue version of the vibecat layout. Colors live in :root so the whole
   palette can be tuned in one place.
   ========================================================================== */

:root {
  --bg: #6BB3F0;                 /* page background (shows below the sky photo) */
  --box: #A5D5FF;                /* card fill (was pink on vibecat) */
  --box-border: #1E40AF;
  --ink: #0B1B3A;
  --ink-soft: #1E3A8A;

  --hold-fill: #1E3A8A;          /* HOLD TO VIBE */
  --hold-text: #E0F2FF;
  --buy-fill: #8CCBFF;           /* BUY NOW */
  --buy-text: #0B1B3A;

  --gold: #FDE353;
  --gold-badge: #FFAA00;
  --silver: #CECECE;
  --bronze: #D99800;

  --font-display: "Luckiest Guy", "Arial Black", Impact, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --border-gradient: repeating-linear-gradient(to right,
      #00E5FF, #2F80FF, #7B2FFF, #2F80FF, #00E5FF);
  --glow: 0 0 40px rgba(47, 128, 255, .55), 0 0 80px rgba(0, 229, 255, .35),
          inset 0 0 18px rgba(0, 229, 255, .35), 0 4px 15px rgba(0, 0, 0, .2);

  --card-radius: 24px;
  --shadow-card: 0 10px 30px rgba(11, 27, 58, .18);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; overflow-x: clip; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.3;
  position: relative;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- sky background (photo + blue.webp tint) ---------- */
.sky {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 0;
  pointer-events: none;
}
.sky-photo {
  width: 100%;
  height: clamp(70vh, 66.67vw, 1375px);
  object-fit: cover;
  object-position: 50% 35%;
  opacity: .85;
}
.sky-tint {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  object-fit: fill;
}
.sky::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30%;
  background: linear-gradient(to bottom, rgba(107, 179, 240, 0), var(--bg));
}

/* ---------- page container ---------- */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}
main { position: relative; display: flex; flex-direction: column; align-items: center; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  position: relative;
  z-index: 20;
}
.socials { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 22px); }
.socials a {
  display: inline-flex;
  width: clamp(26px, 2.6vw, 38px);
  height: clamp(26px, 2.6vw, 38px);
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
  transition: transform .3s ease;
}
.socials a:hover, .socials a:focus-visible { transform: scale(1.25); outline: none; }
.socials svg { width: 100%; height: 100%; fill: currentColor; }
.socials.dark a { color: var(--ink); filter: none; }

.actions { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.copy-ca {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.4vw, 21px);
  color: #fff;
  letter-spacing: .5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  transition: transform .2s ease;
}
.copy-ca:hover { transform: scale(1.08); }

/* ---------- buttons with animated gradient border ---------- */
.btn {
  --btn-bg: linear-gradient(var(--buy-fill), var(--buy-fill));
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .5px;
  text-decoration: none;
  text-align: center;
  border: 5px solid transparent;
  border-radius: 14px;
  background: var(--btn-bg) padding-box, var(--border-gradient) border-box;
  background-size: 100% 100%, 200% 100%;
  box-shadow: var(--glow);
  animation: moveGradient 3s cubic-bezier(.45, .05, .55, .95) infinite;
  transition: transform .3s cubic-bezier(.175, .885, .32, 1.275);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn-buy {
  color: var(--buy-text);
  font-size: clamp(14px, 1.4vw, 21px);
  padding: 6px clamp(14px, 1.8vw, 26px);
}
.btn-buy:hover { transform: scale(1.08); }

.btn-hold {
  --btn-bg: linear-gradient(var(--hold-fill), var(--hold-fill));
  color: var(--hold-text);
  font-size: clamp(16px, 1.5vw, 23px);
  padding: 12px clamp(18px, 2.2vw, 30px);
  border-width: 6px;
  touch-action: none;
  cursor: pointer;
}
.btn-hold:active { transform: scale(.96); }
.vibing .hold-wrap { animation: pulsePress .5s ease-in-out infinite; }

@keyframes moveGradient {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 0, -200% 0; }
}
@keyframes pulsePress {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(.95); }
}

/* ---------- cards ---------- */
.card {
  position: relative;
  background: var(--box);
  border: 2px solid var(--box-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(8px, 2vw, 28px) 0 clamp(40px, 6vw, 90px);
}
.wordmark {
  position: relative;
  z-index: 6;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7.5vw, 112px);
  line-height: 1;
  letter-spacing: 3px;
  color: #fff;
  -webkit-text-stroke: clamp(1px, .18vw, 3px) var(--ink-soft);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink-soft), 0 12px 24px rgba(11, 27, 58, .35);
  margin: clamp(8px, 2vw, 30px) 0 clamp(20px, 3vw, 44px);
  user-select: none;
}
.hero-card {
  z-index: 3;
  width: min(92vw, 1400px);
  padding: clamp(16px, 3.5vw, 56px) 0 clamp(20px, 3vw, 44px);
}
.screen-slab {
  width: min(90%, 1080px);
  margin: 0 auto;
  padding: 1.5%;
  border-radius: 16px;
  background: rgba(18, 64, 104, .13);
  box-shadow: 0 8px 4px rgba(0, 0, 0, .35);
}
.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #1a2a44;
  isolation: isolate;
}
.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.screen .dog {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.dog-anim { opacity: 0; }
.vibing .dog-anim { opacity: 1; }
.vibing .dog-idle { opacity: 0; }

/* score row */
.scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(80%, 900px);
  margin: clamp(14px, 2.4vw, 34px) auto 0;
  gap: 12px;
}
.score { text-align: center; position: relative; }
.score-label, .score-value {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(15px, 1.5vw, 24px);
  line-height: 1.3;
}
.score-value {
  position: relative;
  display: inline-block;
  min-width: 2ch;
  transition: transform .15s ease, color .15s ease;
}
.score-value.boost { transform: scale(1.25); color: #fff; }
.double {
  position: absolute;
  left: 50%;
  top: -1.1em;
  transform: translateX(-50%);
  color: #22C55E;
  font-weight: 800;
  font-size: .8em;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.double.show { animation: floatUp .7s ease-out forwards; }
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 6px); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -22px); }
}
.hold-wrap { display: flex; justify-content: center; }
.score-total { display: flex; flex-direction: column; align-items: center; }
.flag {
  --flag-h: clamp(28px, 3.4vw, 50px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--flag-h);
  margin-bottom: 6px;
  font-size: clamp(24px, 3vw, 44px);
  line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3));
}
.flag img {
  height: var(--flag-h);
  width: auto;
  max-width: calc(var(--flag-h) * 1.6);
  object-fit: cover;
  border-radius: 4px;
}

/* ---------- leaderboard ---------- */
.board {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-bottom: clamp(30px, 5vw, 70px);
}
.board-card {
  z-index: 3;
  width: min(92vw, 464px);
  padding: 16px 18px 0;
  border-radius: 16px;
}
.board-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(20px, 2vw, 30px);
  text-align: center;
}
.podium {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: end;
  gap: 8px;
  width: 92%;
  margin: 26px auto 0;
}
.place { display: flex; flex-direction: column; align-items: center; }
.avatar {
  position: relative;
  z-index: 2;
  width: 68px;
  height: 68px;
  margin-bottom: -22px;
  border-radius: 50%;
  border: 3px solid var(--silver);
  background: rgba(255, 255, 255, .35);
  display: grid;
  place-items: center;
  overflow: visible;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-fallback { font-size: 22px; font-weight: 800; color: rgba(11, 27, 58, .5); }
.avatar img:not([hidden]) + .avatar-fallback { display: none; }
.rank {
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 17px;
  height: 17px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 5px;
  background: var(--silver);
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink);
}
.rank span { transform: rotate(-45deg); }
.block {
  width: 100%;
  min-height: 100px;
  padding: 30px 6px 12px;
  border-radius: 14px 14px 0 0;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  text-align: center;
}
.first .block { min-height: 150px; background: rgba(0, 0, 0, .65); border-radius: 18px 18px 0 0; }
.first .avatar { width: 82px; height: 82px; border-color: var(--gold); margin-bottom: -26px; }
.first .rank { background: var(--gold-badge); color: #fff; }
.third .avatar { border-color: var(--bronze); }
.third .rank { background: var(--bronze); color: #fff; }
.name { font-size: 13px; font-weight: 500; line-height: 1.2; word-break: break-word; }
.first .name { font-size: 16px; }
.pts { margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--silver); }
.first .pts { color: var(--gold); font-size: 15px; }
.third .pts { color: var(--bronze); }

.ranks {
  z-index: 3;
  list-style: none;
  width: min(92vw, 464px);
  padding: 8px 14px;
  border-radius: 16px;
}
.ranks li {
  display: grid;
  grid-template-columns: 2.2em 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(30, 64, 175, .18);
  font-size: 15px;
}
.ranks li:last-child { border-bottom: 0; }
.ranks .r-rank { font-weight: 800; color: var(--ink-soft); }
.ranks .r-flag { font-size: 22px; line-height: 1; }
.ranks .r-flag img { width: 30px; height: 22px; object-fit: cover; border-radius: 3px; }
.ranks .r-pts { font-weight: 800; }

/* ---------- VIBE WITH ME banner ---------- */
.vibe-with-me {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 10px 0 clamp(40px, 6vw, 90px);
}
.banner {
  z-index: 3;
  width: min(92vw, 760px);
  min-height: clamp(120px, 14vw, 192px);
  padding: clamp(18px, 2.6vw, 34px) 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-rows {
  position: absolute;
  inset: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: .4;
  pointer-events: none;
  overflow: hidden;
}
.emoji-row {
  white-space: nowrap;
  font-size: clamp(16px, 1.8vw, 26px);
  line-height: 1.4;
  letter-spacing: .3em;
}
.banner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
}
.banner-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 1px;
}
.banner .socials { gap: clamp(18px, 3vw, 44px); }
.banner .socials a { width: clamp(22px, 2.4vw, 36px); height: clamp(22px, 2.4vw, 36px); }

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 10px 16px 28px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(11, 27, 58, .75);
}

/* ---------- clouds ---------- */
.cloud {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(8px 16px 28px rgba(0, 0, 0, .3));
  animation: floatY var(--dur, 9s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
.cloud.front { z-index: 5; }
@keyframes floatY {
  from { transform: translateY(0) scaleX(var(--flip, 1)); }
  to   { transform: translateY(-14px) scaleX(var(--flip, 1)); }
}
/* hero */
.c1  { top: 18%;  right: -7%;  width: 33%; --dur: 10s; }
.c2  { top: 40%;  left: -16%;  width: 40%; --dur: 12s; --delay: -3s; }
.c8  { top: 64%;  right: -12%; width: 34%; --dur: 11s; --delay: -5s; }
.c9  { top: 74%;  left: -8%;   width: 34%; --dur: 13s; --delay: -2s; }
.c10 { top: 84%;  right: -6%;  width: 26%; --dur: 9s;  --delay: -6s; }
.c4  { top: 96%;  left: -14%;  width: 30%; --dur: 10s; --delay: -1s; }
/* leaderboard */
.c6  { top: -22%; left: 50%;   width: 36%; margin-left: -18%; --dur: 12s; --delay: -4s; }
.c7  { top: 12%;  left: 4%;    width: 20%; --dur: 11s; --delay: -2s; }
.c5  { top: 42%;  right: 2%;   width: 26%; --dur: 10s; --delay: -7s; }
/* banner + footer */
.c3  { bottom: 4%; left: 4%;   width: 12%; --dur: 9s;  --delay: -3s; }
.c9b { bottom: -6%; right: -8%; width: 30%; --flip: -1; --dur: 12s; --delay: -5s; }

/* ---------- loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity .45s ease;
}
.loader.hide { opacity: 0; pointer-events: none; }
.loader-ring {
  position: relative;
  width: clamp(150px, 26vw, 210px);
  height: clamp(150px, 26vw, 210px);
  border-radius: 50%;
  border: 8px solid #DCE7F5;
  overflow: hidden;
  background: #e8f2ff;
}
.loader-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0;
  background: #2563EB;
  animation: fillUp 2.4s ease-in-out infinite;
}
@keyframes fillUp { from { height: 0; } to { height: 100%; } }
.loader-ring img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% 25%;
  transform: scale(1.7);
  transform-origin: 30% 30%;
}
.loader-text {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 3px;
  color: var(--ink);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  max-width: min(90vw, 360px);
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  border-left: 6px solid #2563EB;
  transform: translateX(120%);
  opacity: 0;
  transition: transform .35s cubic-bezier(.175, .885, .32, 1.275), opacity .3s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-card { width: 94vw; }
  .screen-slab { width: 94%; }
  .scores { width: 92%; }
}
@media (max-width: 640px) {
  .topbar { padding: 14px 16px; }
  .scores {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "you total" "hold hold";
    align-items: start;
    width: 96%;
    gap: 14px 8px;
  }
  .score-you { grid-area: you; }
  .score-total { grid-area: total; }
  .hold-wrap { grid-area: hold; }
  .btn-hold { width: min(100%, 320px); padding: 14px 20px; }
  .board-card { padding: 14px 10px 0; }
  .avatar { width: 54px; height: 54px; margin-bottom: -18px; }
  .first .avatar { width: 66px; height: 66px; margin-bottom: -22px; }
  .block { min-height: 88px; padding-top: 26px; }
  .first .block { min-height: 128px; }
  .banner { padding-left: 10px; padding-right: 10px; }
  .c8, .c9, .c5, .c9b { display: none; }
  .c1 { width: 44%; right: -12%; top: 12%; }
  .c2 { width: 54%; left: -26%; top: 44%; z-index: 1; }   /* behind the card on phones */
  .c10 { width: 40%; top: 90%; }
  .c4 { width: 42%; top: 99%; }
  .c6 { width: 56%; margin-left: -28%; top: -36%; }
  .c7 { width: 30%; }
  .c3 { width: 22%; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud, .btn, .vibing .hold-wrap, .loader-fill { animation: none !important; }
  html { scroll-behavior: auto; }
}
