/* Updates feed. Loads after bico-theme.css and only styles this page and entity pages. */

.feed-toolbar {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  margin-bottom: var(--gap-md);
}
.feed-toolbar-spacer { flex: 1; min-width: 0; }
.feed-toolbar .bico-btn { font-size: 13px; padding: 6px 13px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.4px;
  color: var(--ok);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 13px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok);
  animation: pulse-dot 2.4s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(93, 202, 165, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(93, 202, 165, 0); }
  100% { box-shadow: 0 0 0 0 rgba(93, 202, 165, 0); }
}

.sound-btn.sound-on { color: var(--gold); border-color: var(--gold-soft); }

/* Filters */
.filters {
  display: grid;
  gap: var(--gap-md);
  margin-bottom: var(--gap-md);
}

.filters-search { position: relative; }
.filters-search .ti {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.filters-search .bico-search-input { padding-left: 42px; }

.category-filter {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  flex-wrap: wrap;
}
.category-filter-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-eyebrow);
  margin-right: var(--gap-xs);
}

.category-chip {
  --chip: var(--gold);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 13px;
  cursor: pointer;
  user-select: none;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.category-chip input { position: absolute; opacity: 0; pointer-events: none; }
.category-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip);
  margin-right: 8px;
  opacity: 0.55;
  transition: opacity var(--dur) var(--ease);
}
.category-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.category-chip:has(input:checked) {
  color: var(--chip);
  border-color: var(--chip);
  background: var(--surface-2);
}
.category-chip:has(input:checked)::before { opacity: 1; }
.category-chip:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

.category-chip[data-src='mage']    { --chip: var(--src-mage); }
.category-chip[data-src='army']    { --chip: var(--src-army); }
.category-chip[data-src='domain']  { --chip: var(--src-domain); }
.category-chip[data-src='ship']    { --chip: var(--src-ship); }
.category-chip[data-src='poi']     { --chip: var(--src-poi); }
.category-chip[data-src='gp']      { --chip: var(--src-gp); }
.category-chip[data-src='guild']   { --chip: var(--src-guild); }
.category-chip[data-src='faction'] { --chip: var(--src-faction); }

.filters-selects {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  align-items: center;
}
.filters-selects .bico-select { width: auto; min-width: 170px; }

.day-nav { display: flex; align-items: center; gap: 4px; }
.day-nav .bico-select { min-width: 210px; border-radius: 0; }
.day-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 38px;
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
#dayPrev { border-radius: var(--radius) 0 0 var(--radius); }
#dayNext { border-radius: 0 var(--radius) var(--radius) 0; }
.day-arrow:hover:not(:disabled) { color: var(--gold); border-color: var(--gold-soft); }
.day-arrow:disabled { opacity: 0.35; cursor: default; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: var(--gap-sm);
  margin-bottom: var(--gap-md);
}
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

/* Feed */
.updates { display: flex; flex-direction: column; gap: var(--gap-sm); }

.update {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}
.update:hover { border-color: var(--border-strong); }
.update-inner { display: flex; }

.stripe { width: 4px; flex-shrink: 0; background: var(--gold); }
.stripe.Mage { background: var(--src-mage); }
.stripe.Army { background: var(--src-army); }
.stripe.Domain { background: var(--src-domain); }
.stripe.Ship { background: var(--src-ship); }
.stripe.POI { background: var(--src-poi); }
.stripe.GP, .stripe.Highpriest { background: var(--src-gp); }
.stripe.Guild { background: var(--src-guild); }
.stripe.Faction { background: var(--src-faction); }

.content { flex: 1; min-width: 0; padding: var(--pad-md) var(--pad-lg); }

.topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--gap-md);
  flex-wrap: wrap;
}
.title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}
.title-link { color: inherit; }
.title-link:hover { color: var(--gold); text-decoration: none; }

.time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}
.badge.new { color: var(--ok); border-color: var(--ok); }
.badge.modified { color: var(--warn); border-color: var(--warn); }
.badge.removed { color: var(--danger); border-color: var(--danger); }

.sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap-md);
  margin-top: var(--pad-md);
}
.section { min-width: 0; }
.section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-eyebrow);
  padding-bottom: 5px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.kv {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 4px 12px;
  font-size: 14px;
}
.key { color: var(--text-muted); }
.value { color: var(--text-primary); word-break: break-word; }

.change-line {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.change-line:last-child { border-bottom: 0; }
.change-line strong { color: var(--text-primary); font-weight: 500; }
.old { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.new { color: var(--ok); }

.note {
  font-family: var(--font-prose);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--border-strong);
  margin-bottom: 6px;
}
.note-label {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-eyebrow);
  margin-right: 5px;
}

.owner-name, .guild-name {
  color: var(--gold);
  border-bottom: 1px dotted var(--gold-soft);
  cursor: pointer;
}
.owner-name:hover, .guild-name:hover { color: var(--text-primary); border-bottom-color: var(--text-primary); }

.map-coordinate-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.empty {
  font-family: var(--font-prose);
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
  padding: var(--pad-xl) var(--pad-lg);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
}

/* New arrivals from a delta poll */
.update { border-left: 3px solid transparent; }
.update.is-new { border-left-color: var(--accent); }

/* Entity history pages share this stylesheet */
.entity-summary-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--pad-md) var(--pad-lg);
  margin-bottom: var(--gap-md);
}
.entity-meta {
  display: flex;
  gap: var(--gap-md);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ok);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
}
.presence-pill.presence-stale { color: var(--text-muted); }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-selects .bico-select, .day-nav { width: 100%; }
  .day-nav .bico-select { flex: 1; min-width: 0; }
  .content { padding: var(--pad-md); }
  .topline { flex-direction: column; gap: 4px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .key { margin-top: 6px; }
}

/* Offscreen cards skip layout and paint entirely. */
.update {
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}
.feed-sentinel { height: 1px; }
