:root {
  --bg: #05070f;
  --panel: #0c1020;
  --panel-2: #121831;
  --line: #1e2542;
  --text: #e8ebf5;
  --muted: #8b93ad;
  --accent: #4da3ff;
  --accent-2: #7c6bff;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* Capçalera */
.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(5, 7, 15, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.mark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #1d3a9a, #0b1a4a); font-weight: 800; font-size: 18px;
}
.word { font-weight: 800; font-size: 22px; letter-spacing: .5px; }
.refresh {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--text); color: var(--bg); border: 0; border-radius: 999px;
  padding: 8px 16px; font: inherit; font-weight: 700; font-size: 15px;
}
.refresh:hover { background: #fff; }
.refresh:disabled { opacity: .6; cursor: progress; }
.refresh.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.intro { padding: 22px 0 6px; }
.intro h1 { margin: 0 0 4px; font-size: 24px; }
.intro p { margin: 0; color: var(--muted); font-size: 15px; }

.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 14px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.status.busy .dot { animation: pulse 1.2s ease-in-out infinite; }
.status.done .dot { background: #3ecf8e; }
@keyframes pulse { 50% { opacity: .25; } }

/* Targetes */
.feed { display: flex; flex-direction: column; }
.card { padding: 14px 0 18px; border-top: 1px solid var(--line); }
.card-title { font-size: 16px; line-height: 1.4; margin: 0; font-weight: 500; color: var(--text); }
.card-title a { color: var(--text); }
.who { color: var(--accent); }
.who a { color: var(--accent); }
.when { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.when b { color: var(--text); font-weight: 700; }
.thumb {
  display: block; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--panel); position: relative; aspect-ratio: 1.91 / 1;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .cap {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px);
  background: rgba(0, 0, 0, .72); color: #fff; font-size: 13px; padding: 2px 8px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb.noimg { aspect-ratio: auto; padding: 14px 16px; background: var(--panel-2); }
.thumb.noimg .cap { position: static; background: none; padding: 0; white-space: normal; font-size: 15px; }
.from { color: var(--muted); font-size: 13px; margin-top: 6px; }

.empty { color: var(--muted); text-align: center; padding: 40px 0; }

.foot { color: var(--muted); font-size: 13px; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 8px; }
.foot p { margin: 0 0 6px; }

@media (max-width: 480px) {
  .word { font-size: 20px; }
  .refresh span { display: none; }
  .refresh { padding: 9px; }
}

/* Mode diagnòstic (?debug) */
.srclog { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.srclog summary { cursor: pointer; color: var(--text); }
.srclog ul { margin: 8px 0 0; padding-left: 18px; }
.srclog li { margin: 2px 0; }
.srclog i { color: var(--accent-2); font-style: normal; }
