/* ========= VARIÁVEIS ========= */
:root {
  --bg: #000;
  --card: #ffffff;
  --card-hover: #f1f1f1;
  --text: #111;
  --title: #fff;
  --fire-1: #ffd60a;
  --fire-2: #ff7a00;
  --fire-3: #e10600;
  --radius: 16px;
  --gap: clamp(10px, 2vw, 16px);
  --shadow: 0 6px 20px rgba(255, 90, 0, .18);
}

/* ========= BASE ========= */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--title);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Brilho de fogo de fundo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 90, 0, .28), transparent 60%),
    radial-gradient(ellipse at 90% 110%, rgba(225, 6, 0, .18), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  padding: calc(env(safe-area-inset-top) + 28px) 18px calc(env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

@media (min-width: 768px) {
  .page { max-width: 640px; padding-top: 48px; }
}
@media (min-width: 1200px) {
  .page { max-width: 680px; }
}

/* ========= TOPO ========= */
.topbar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  min-height: 40px;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .2s, background .2s;
}
.share-btn:hover { background: rgba(255, 255, 255, .14); transform: scale(1.06); }
.share-btn:focus-visible { outline: 2px solid var(--fire-1); outline-offset: 3px; }

/* ========= PERFIL ========= */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  width: clamp(96px, 22vw, 130px);
  height: clamp(96px, 22vw, 130px);
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--fire-1), var(--fire-2), var(--fire-3), var(--fire-1));
  animation: spin 6s linear infinite;
  box-shadow: 0 0 30px rgba(255, 110, 0, .45);
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #000;
  overflow: hidden;
  display: grid;
  place-items: center;
  animation: spin-reverse 6s linear infinite; /* mantém o logo parado */
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback caso a imagem não carregue */
.avatar-fallback {
  font-weight: 800;
  font-size: clamp(28px, 6vw, 40px);
  background: linear-gradient(180deg, var(--fire-1), var(--fire-2) 50%, var(--fire-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 2px;
}

.title {
  margin: 0;
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  font-weight: 800;
  letter-spacing: .3px;
  text-shadow: 0 2px 14px rgba(255, 110, 0, .35);
}

.subtitle {
  margin: 0;
  font-size: clamp(.85rem, 2.6vw, .98rem);
  color: #bbb;
  max-width: 40ch;
}

/* ========= REDES SOCIAIS (ÍCONES) ========= */
.social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(14px, 3vw, 22px);
  margin-top: 6px;
}

.social:empty { display: none; }

.social-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.35rem;
  text-decoration: none;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}

.social-link:hover {
  transform: translateY(-3px) scale(1.06);
  background: var(--fire-1);
  color: #000;
  box-shadow: 0 6px 18px rgba(255, 140, 0, .35);
}

.social-link:focus-visible { outline: 2px solid var(--fire-1); outline-offset: 3px; }

@media (min-width: 768px) {
  .social-link { width: 48px; height: 48px; font-size: 1.5rem; }
}

/* ========= SEÇÕES ========= */
.app {
  width: 100%;
}

.section {
  width: 100%;
  margin-top: 18px;
}

.section-title {
  text-align: center;
  font-size: clamp(.95rem, 2.8vw, 1.1rem);
  font-weight: 700;
  margin: 0 0 12px;
  color: #f4f4f4;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before,
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 140, 0, .6));
}
.section-title::after {
  background: linear-gradient(90deg, rgba(255, 140, 0, .6), transparent);
}

.links {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ========= CARDS DE LINK ========= */
.link-card {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: transform .2s ease, box-shadow .25s ease, background .2s ease;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateY(12px);
  animation: rise .55s ease forwards;
  animation-delay: var(--delay, 0s);
}

.link-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow);
  background: var(--card-hover);
}
.link-card:active { transform: scale(.98); }
.link-card:focus-visible { outline: 3px solid var(--fire-1); outline-offset: 3px; }

.link-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  color: #000;
}

.link-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.link-label {
  font-weight: 600;
  font-size: clamp(.95rem, 2.8vw, 1.05rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-handle {
  font-size: .78rem;
  color: #555;
  margin-top: 2px;
}

.link-arrow {
  justify-self: end;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #222;
  opacity: .7;
  font-size: .95rem;
  transition: transform .25s;
}
.link-card:hover .link-arrow { transform: translateX(3px); opacity: 1; }

/* ========= ACORDEÃO (REDES DE MEMES) ========= */
.accordion-trigger {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: clamp(.95rem, 2.8vw, 1.05rem);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .4);
  transition: box-shadow .25s, background .2s;
  opacity: 0;
  animation: rise .55s ease forwards;
  animation-delay: var(--delay, 0s);
}
.accordion-trigger:hover { background: var(--card-hover); box-shadow: var(--shadow); }
.accordion-trigger:focus-visible { outline: 3px solid var(--fire-1); outline-offset: 3px; }

.accordion-emoji { font-size: 1.6rem; text-align: center; }

.accordion-chevron {
  justify-self: end;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transition: transform .3s ease;
}
.accordion-trigger[aria-expanded="true"] .accordion-chevron { transform: rotate(180deg); }

.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s ease;
}
.accordion-panel.open { grid-template-rows: 1fr; }
.accordion-panel > .links {
  overflow: hidden;
  min-height: 0;
  padding-top: var(--gap);
}

/* ========= RODAPÉ ========= */
footer {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #888;
  font-size: .85rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #ddd;
  text-decoration: none;
}
.footer-brand i { color: var(--fire-2); }

/* ========= TOAST ========= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translate(-50%, 140%);
  background: #fff;
  color: #111;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2);
  z-index: 10;
  white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); }

/* ========= ANIMAÇÕES ========= */
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }

/* Respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .link-card, .accordion-trigger { opacity: 1; transform: none; }
  .avatar, .avatar-inner { animation: none; }
}

/* ========= AJUSTES POR TELA ========= */
@media (min-width: 768px) {
  .link-card, .accordion-trigger {
    min-height: 66px;
    grid-template-columns: 52px 1fr 52px;
    padding: 10px 16px;
  }
  .link-icon, .accordion-emoji { width: 52px; height: 52px; font-size: 2rem; }
  .link-arrow, .accordion-chevron { width: 40px; height: 40px; }
}

@media (max-width: 360px) {
  .link-card, .accordion-trigger { grid-template-columns: 36px 1fr 30px; min-height: 52px; }
  .link-icon, .accordion-emoji { width: 36px; font-size: 1.4rem; }
}

/* Telas com pouca altura (paisagem em celular) */
@media (max-height: 500px) and (orientation: landscape) {
  .page { padding-top: 16px; }
  .avatar { width: 80px; height: 80px; }
}