:root {
  --g1: #e3e8fc;
  --g2: #ecd5f5;
  --g3: #f8d4ee;
  --accent: #6b4eaa;
  --blue: #1e88e5;
  --purple: #ba68c8;
  --pink: #f06292;
  --ink: #1a1228;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --cta-h: 118px;
  /* Match unow2 GridView: crossAxisSpacing 13, padding 7, mainAxisSpacing 1 */
  --gap-x: 6px;
  --gap-y: 10px;
  --pad: 7px;
  /* Higher aspect = shorter cards (was 0.656) */
  --card-aspect: 0.78;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  font-family: Outfit, system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(
    135deg,
    var(--g1) 0%,
    var(--g2) 52%,
    var(--g3) 100%
  );
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
  padding-top: max(14px, env(safe-area-inset-top));
}

.brand-block {
  min-width: 0;
}

.brand {
  margin: 0;
  font-family: Sora, Outfit, sans-serif;
  font-size: clamp(1.65rem, 6.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}

.tagline {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(26, 18, 40, 0.62);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(107, 78, 170, 0.18);
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: pulse-dot 1.6s ease-out infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0 calc(var(--pad) + 2px);
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 3%,
    #000 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 3%,
    #000 90%,
    transparent 100%
  );
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-x);
  height: 100%;
  overflow: hidden;
}

.column {
  display: flex;
  flex-direction: column;
  gap: var(--gap-y);
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.card {
  position: relative;
  flex: 0 0 auto;
  width: 96%;
  max-width: 100%;
  margin-inline: auto;
  border: 0;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: var(--card-aspect);
  background: #cfc8d8;
  cursor: pointer;
  isolation: isolate;
  transform: translateZ(0);
  -webkit-tap-highlight-color: transparent;
}

.card.is-hidden {
  display: none;
}

.card:active {
  opacity: 0.92;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  pointer-events: none;
}

.card__shade {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.28) 55%,
    transparent 100%
  );
  pointer-events: none;
}

.card__meta {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 48px;
  color: #fff;
  text-align: left;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

.card__name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__nation {
  display: block;
  margin-top: 1px;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.95;
}

.card__status {
  position: absolute;
  top: 3%;
  left: 3%;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 12px;
  background: #000;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
}

.card__status.is-online {
  color: #22c55e;
}

.card__status.is-busy {
  color: #ef4444;
}

.card__status.is-offline {
  color: #9ca3af;
}

.card__hot {
  position: absolute;
  top: 2%;
  right: 1%;
  z-index: 2;
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.call-fab {
  position: absolute;
  right: 6%;
  bottom: calc(7% - 2px);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--blue),
    var(--purple),
    var(--pink)
  );
  box-shadow: 0 6px 16px rgba(30, 136, 229, 0.55);
  pointer-events: none;
  animation: fab-wiggle 0.75s ease-in-out infinite alternate;
}

@keyframes fab-wiggle {
  from {
    transform: rotate(-8deg) scale(1);
  }
  to {
    transform: rotate(8deg) scale(1.08);
  }
}

.stage-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 48px;
  pointer-events: none;
  z-index: 2;
}

.stage-fade-top {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(227, 232, 252, 0.9),
    transparent
  );
}

.stage-fade-bottom {
  bottom: 0;
  height: 96px;
  background: linear-gradient(
    to top,
    rgba(248, 212, 238, 0.95) 0%,
    rgba(236, 213, 245, 0.55) 45%,
    transparent 100%
  );
}

.hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--cta-h) + 6px);
  transform: translateX(-50%);
  z-index: 8;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(26, 18, 40, 0.82);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  animation: hint-in 0.35s ease;
}

@keyframes hint-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.cta-wrap {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 16px calc(16px + var(--safe-bottom));
}

.download-btn {
  position: relative;
  isolation: isolate;
  width: min(220px, 78vw);
  height: 54px;
  border: 0;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-family: Outfit, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(
    135deg,
    var(--blue),
    var(--purple),
    var(--pink)
  );
  box-shadow: 0 8px 20px rgba(30, 136, 229, 0.4);
  overflow: hidden;
  animation: cta-breathe 1.6s ease-in-out infinite;
  transition: box-shadow 0.18s ease;
}

.download-btn:hover {
  box-shadow: 0 12px 28px rgba(30, 136, 229, 0.52);
}

.download-btn:active {
  animation: none;
  transform: scale(0.97);
}

@keyframes cta-breathe {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 14px 30px rgba(240, 98, 146, 0.5);
  }
}

.download-btn__shine {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-18deg);
  animation: shine-sweep 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes shine-sweep {
  0% {
    left: -45%;
  }
  55%,
  100% {
    left: 120%;
  }
}

.download-btn__glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.3),
    transparent 55%
  );
  pointer-events: none;
}

.download-btn__icon,
.download-btn__label {
  position: relative;
  z-index: 3;
  display: inline-flex;
}

.cta-sub {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(26, 18, 40, 0.58);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--cta-h) + 10px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(94vw, 420px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(26, 18, 40, 0.92);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  animation: toast-in 0.28s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .call-fab,
  .download-btn,
  .download-btn__shine,
  .live-dot {
    animation: none !important;
  }
}

@media (min-width: 720px) {
  .page {
    max-width: 640px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    border-right: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 60px rgba(107, 78, 170, 0.08);
  }
}
