/* Alliance Stats — layout + tables only */

.app.stats-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 12px 28px;
}

.stats-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Author display:flex otherwise overrides the hidden attribute */
.stats-section[hidden] {
  display: none !important;
}

.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.stats-toolbar .field-inline {
  margin: 0;
  min-width: 140px;
}

.stats-toolbar .field-inline .input {
  min-width: 160px;
}

.stats-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.stats-view-tabs .btn.active {
  background: var(--accent-soft, rgba(224, 138, 60, 0.22));
  border-color: var(--accent, #e08a3c);
  color: var(--sand, #f0e6d8);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg1);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.stats-table th,
.stats-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.stats-table th {
  font-weight: 600;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.12);
  user-select: none;
}

.stats-table th.sortable {
  cursor: pointer;
}

.stats-table th.sortable:hover {
  color: var(--sand);
}

.stats-table th.sorted-asc::after,
.stats-table th.sorted-desc::after {
  content: " ▴";
  font-size: 0.75em;
  opacity: 0.85;
}

.stats-table th.sorted-desc::after {
  content: " ▾";
}

.stats-table tbody tr:last-child td {
  border-bottom: none;
}

.stats-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.stats-table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stats-table th.num {
  text-align: right;
}

.flag-outsider {
  color: var(--warn-text, #f0d78a);
  font-size: 0.85em;
  margin-left: 6px;
}

.stats-table tbody tr.lucky-day-sep td {
  padding: 0;
  height: 12px;
  border-bottom: none;
  background: transparent;
  position: relative;
}

.stats-table tbody tr.lucky-day-sep:hover td {
  background: transparent;
}

.stats-table tbody tr.lucky-day-sep td::after {
  content: "";
  display: block;
  margin: 4px 8px;
  border-top: 1px dashed var(--line);
  opacity: 0.85;
}

.lucky-role {
  font-weight: 600;
  font-size: 0.92em;
}

.lucky-role-conductor {
  color: var(--accent, #e08a3c);
}

.lucky-role-vip {
  color: var(--sand, #f0e6d8);
}

.empty-hint {
  margin-top: 8px;
}

.stats-append-warn {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(196, 75, 60, 0.45);
  background: rgba(196, 75, 60, 0.12);
  color: var(--sand);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.stats-append-form .field {
  margin-top: 10px;
}

@media (max-width: 700px) {
  .stats-view-tabs {
    margin-left: 0;
    width: 100%;
  }
}
