/* Layout do hub — tokens e componentes vêm de /theme/theme.css */

/* --- Ícones (sprite SVG em index.html) --- */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn:has(.icon) { display: inline-flex; align-items: center; gap: 7px; }
.stat-label .icon { color: var(--faint); }
.challenge .eyebrow .icon { color: var(--accent); }
.drop-overlay .icon { color: var(--accent); vertical-align: -0.1em; }

/* --- Header --- */
.stats { display: flex; gap: clamp(20px, 3vw, 40px); }
.stat { display: flex; flex-direction: column; align-items: flex-end; }
.stat-value {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }

.section { margin-top: 40px; }

/* --- Ações rápidas --- */
.quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-hint { font-size: 13px; color: var(--faint); margin-left: 6px; }

.drop-overlay {
  position: fixed;
  inset: 12px;
  z-index: 40;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: rgba(14, 13, 12, 0.85);
  pointer-events: none;
}
.drop-overlay p { margin: 0; font-family: var(--serif); font-size: 36px; }
.drop-overlay em { color: var(--accent); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* --- Apps --- */
/* Cards com largura fixa; o desafio ao lado ocupa o que sobrar */
.apps { display: flex; flex-wrap: wrap; gap: 14px; }
.apps > .app-card { flex: 0 0 250px; }
.app-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  animation: rise 0.5s both;
  transition: border-color 0.2s, transform 0.2s;
}
.app-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
/* Topo: ícone à esquerda, seta à direita */
.app-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.app-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 18px;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.app-card:hover .app-icon { color: var(--accent); border-color: var(--line-strong); }
.app-card .arrow { font-size: 20px; color: var(--faint); transition: color 0.2s, transform 0.2s; }
.app-card:hover .arrow { color: var(--accent); transform: translateX(3px); }

/* Meio: nome e descrição */
.app-card h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.05;
}
.app-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; flex: 1; }

/* Rodapé: contagens vivas */
.app-meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--done);
}

.app-card.is-offline { opacity: 0.6; }
.app-card.is-offline:hover { opacity: 1; }

/* --- Desenhos recentes --- */
.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 180px;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  animation: rise 0.5s both;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s cubic-bezier(.2, .8, .2, 1); }
.thumb:hover img { transform: scale(1.04); }
.thumb span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 32px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: #fff;
}

/* --- Projetos em andamento --- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.project {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  animation: rise 0.5s both;
  transition: border-color 0.2s;
}
.project:hover { border-color: var(--line-strong); }
.project h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.15; }
.project p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project .project-meta { margin-top: 10px; font-size: 12px; color: var(--faint); }

.empty { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--faint); font-size: 14px; padding: 24px 0; }

/* --- Backup completo --- */
.backup {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.backup .section-title { margin-bottom: 4px; }
.backup-info { margin: 0; font-size: 14px; color: var(--muted); }

/* --- Grade principal: esquerda na largura dos cards de espaços, direita com o resto --- */
.overview { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; }
.overview > * { min-width: 0; }
.overview-apps, .overview-projects { grid-column: 1; }
.overview-challenge, .overview-recent { grid-column: 2; }
/* Projetos não influenciam a largura da coluna — só acompanham a dos espaços */
.overview-projects { contain: inline-size; }
.overview-challenge { display: flex; flex-direction: column; }
.overview-challenge[hidden] { display: none; }

@media (max-width: 860px) {
  .overview { grid-template-columns: 1fr; }
  .overview > * { grid-column: 1; }
}

/* --- Desafio do mês --- */
.challenge {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}
.challenge .eyebrow { margin: 0; }
.challenge-prompt { margin: 6px 0 16px; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(30px, 3vw, 38px); line-height: 1.05; }
.challenge-progress { height: 3px; background: var(--line); border-radius: 99px; overflow: hidden; }
.challenge-progress div { height: 100%; width: 0; background: var(--ink); transition: width 0.6s cubic-bezier(.2, .8, .2, 1); }
/* Rodapé: contagem à esquerda, botão à direita, sempre no fim do card */
.challenge-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: auto;
  padding-top: 14px;
}
.challenge-count { margin: 0; font-size: 13px; color: var(--muted); }

/* --- Abas de desenhos --- */
.section-head { flex-wrap: wrap; align-items: center; }
.section-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-actions { gap: 22px; }
.strip-tabs { display: flex; gap: 18px; }
.strip-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.strip-tabs button:hover { color: var(--ink); }
.strip-tabs button.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.strip-tabs button.is-active .icon { color: var(--accent); }
.strip-tabs button:disabled { opacity: 0.35; cursor: default; color: var(--muted); }
.strip-tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.strip[hidden] { display: none; }

@media (max-width: 860px) {
  .stat { align-items: flex-start; }
}
