/* News overlay: war reports, standings, unread badge (src/ui/news.ts).
   Reuses the theme variables from styles.css; orchestrator links this file
   into index.html after styles.css. */

#news { position: absolute; inset: 0; z-index: 60; }

.news-backdrop { position: absolute; inset: 0; background: rgba(6, 8, 14, 0.6); }

.news-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(92vw, 380px);
  background: var(--bg2);
  border-left: 1px solid #34406a;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  animation: news-in 0.18s ease-out;
}
@keyframes news-in { from { transform: translateX(100%); } }

.news-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 8px;
}
.news-head h2 { font-size: 17px; flex: 1; color: var(--gold); }
.news-close {
  min-width: 44px; min-height: 36px;
  background: none; border: none;
  color: var(--dim); font-size: 20px;
}

/* ---------- standings ---------- */
.news-standings { padding: 4px 14px 10px; border-bottom: 1px solid #2a3450; }

.standing {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 4px 8px;
  padding: 5px 0;
}
.standing .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
}
.standing .s-name { font-size: 13px; font-weight: 600; }
.standing .s-count {
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.standing .s-bar {
  grid-column: 1 / -1;
  height: 5px;
  background: #232c48;
  border-radius: 3px;
  overflow: hidden;
}
.standing .s-fill { height: 100%; border-radius: 3px; }
.standing.fallen .s-name { color: var(--dim); text-decoration: line-through; }
.standing .s-fallen { grid-column: 1 / -1; font-size: 11px; color: var(--danger); }

/* ---------- log list ---------- */
.news-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px 14px;
}

.news-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--panel);
  border: 1px solid #2c385c;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.35;
}
.news-item.battle { border-left-color: var(--danger); }
.news-item.capture { border-left-color: var(--gold); }
.news-item.power { border-left-color: #b06cff; }
.news-item.age { border-left-color: var(--ok); }
.news-item.system { border-left-color: var(--dim); }
.news-item.info { border-left-color: #4a5568; }
.news-item .news-icon { flex-shrink: 0; }
.news-item .news-text { flex: 1; min-width: 0; }
.news-item .news-tick {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- unread badge on the 📰 ctrl-bar button ---------- */
#ctrl-bar [data-ctrl="news"] { position: relative; }
.news-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  background: var(--danger);
  color: #fff;
  border-radius: 9px;
  font-size: 10px; font-weight: 700;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}
