/*
 * Yunelo Android APK & Mobile Web Polish (V43.1)
 * Native-grade 60fps transitions, soft app-like entrance animations,
 * safe-area inset handling, pull-to-refresh lock, and universal responsiveness.
 */

@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: yPageOut 0.14s cubic-bezier(0.4, 0, 1, 1) both;
}
::view-transition-new(root) {
  animation: yPageIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes yPageOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes yPageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ySoftRise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

html {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  animation: yPageIn 0.20s ease-out both;
  transition: opacity 0.12s ease;
}

body.is-navigating {
  opacity: 0.75;
}

/* Soft staggered card & list entrances */
.y-card, .hero, .stat, .tile, .buddy-card, .pack-card, .row-link, .cp-unit, .app-card {
  animation: ySoftRise 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}
.y-card:nth-child(2), .stat:nth-child(2), .tile:nth-child(2), .buddy-card:nth-child(2), .pack-card:nth-child(2) { animation-delay: 0.03s; }
.y-card:nth-child(3), .stat:nth-child(3), .tile:nth-child(3), .buddy-card:nth-child(3), .pack-card:nth-child(3) { animation-delay: 0.06s; }
.y-card:nth-child(4), .stat:nth-child(4), .tile:nth-child(4), .buddy-card:nth-child(4), .pack-card:nth-child(4) { animation-delay: 0.09s; }
.buddy-card:nth-child(5), .pack-card:nth-child(5) { animation-delay: 0.12s; }
.buddy-card:nth-child(6), .pack-card:nth-child(6) { animation-delay: 0.15s; }

/* Prevent accidental text selection & long-press callouts on app controls */
a, button, [role="button"], .y-nav, .floating-nav, .chip, .option-card, .buddy-card, .game-item {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, select, textarea {
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}

img, svg {
  -webkit-user-drag: none;
  user-select: none;
}

/* Tactile spring micro-interaction on interactive cards & buttons */
button, [role="button"], a[data-haptic], .y-card, .buddy-card, .tile, .row-link, .pack-card {
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), filter 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}
button:enabled:active,
[role="button"]:active,
a[data-haptic]:active,
.buddy-card:active,
.tile:active,
.row-link:active,
.pack-card:active {
  transform: scale(0.965) !important;
}

/* Small Android phones (320px - 360px width) universal fluid fit */
@media (max-width: 360px) {
  .y-nav, .floating-nav {
    width: calc(100% - 16px) !important;
    padding: 0 6px !important;
    height: 62px !important;
  }
  .y-nav a.y-nav-mic, .floating-nav .nav-center-mic {
    width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    top: -13px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body, .y-card, .hero, .stat, .tile, .buddy-card, .pack-card, .row-link, .cp-unit, .app-card {
    animation: none !important;
    transition: none !important;
  }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Shimmer skeleton utility for async cards */
.y-shimmer {
  background: linear-gradient(100deg, rgba(255,255,255,0.04) 20%, rgba(167,139,250,0.14) 38%, rgba(255,255,255,0.04) 56%);
  background-size: 220% 100%;
  animation: yShimmerSlide 1.3s linear infinite;
}
@keyframes yShimmerSlide { to { background-position-x: -220%; } }


/* Play Store Mobile App Universal Viewport Comfort (320px - 430px) */
@media (max-width: 480px) {
  :root {
    --y-shell: 100%;
    --y-nav-h: 62px;
  }
  body {
    font-size: 14px;
  }
  .y-nav, .floating-nav {
    width: calc(100% - 16px) !important;
    max-width: 420px !important;
    height: 60px !important;
    min-height: 60px !important;
    bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 24px !important;
  }
  .y-nav a.y-nav-mic, .floating-nav .nav-center-mic {
    width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    top: -12px !important;
  }
  .y-nav a:not(.y-nav-mic) {
    height: 48px !important;
    font-size: 10.5px !important;
  }
  .y-nav a:not(.y-nav-mic) svg {
    width: 19px !important;
    height: 19px !important;
  }
}
