/* 正式行动队列：由本地对战与 Online 对战共用。 */

body:is(.gametank-shell, .online-shell) .action-queue-panel {
  position: absolute;
  z-index: 7;
  left: var(--ct-pad);
  top: 50%;
  width: var(--ct-rail);
  max-height: 290px;
  overflow: hidden;
  border: 1px solid var(--ct-stroke);
  border-radius: var(--ct-r-md);
  background: rgba(14, 21, 30, 0.94);
  box-shadow: var(--ct-shadow);
  backdrop-filter: blur(10px);
  color: var(--ct-text);
  pointer-events: none;
}

body:is(.gametank-shell, .online-shell) .action-queue-panel[hidden] {
  display: none;
}

body:is(.gametank-shell, .online-shell) .action-queue-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 31px;
  padding: 0 10px;
  border-bottom: 1px solid var(--ct-stroke-soft);
  color: var(--ct-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

body:is(.gametank-shell, .online-shell) .action-queue-title span:last-child {
  color: var(--ct-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

body:is(.gametank-shell, .online-shell) .action-queue-list {
  max-height: 257px;
  padding: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  pointer-events: auto;
}

body:is(.gametank-shell, .online-shell) .action-queue-row {
  --queue-team-color: var(--ct-muted);
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) 50px;
  align-items: center;
  min-height: 25px;
  padding: 2px 7px 2px 5px;
  border: 1px solid transparent;
  border-radius: var(--ct-r-sm);
  background: rgba(7, 11, 16, 0.54);
  color: var(--ct-muted);
  font-size: 10px;
  line-height: 1.2;
}

body:is(.gametank-shell, .online-shell) .action-queue-row + .action-queue-row {
  margin-top: 3px;
}

body:is(.gametank-shell, .online-shell) .action-queue-row.current {
  border-color: color-mix(in srgb, var(--queue-team-color) 65%, transparent);
  background: color-mix(in srgb, var(--queue-team-color) 15%, rgba(7, 11, 16, 0.76));
  color: var(--ct-text);
  box-shadow: inset 2px 0 0 var(--queue-team-color);
}

body:is(.gametank-shell, .online-shell) .action-queue-row.completed {
  background: rgba(7, 11, 16, 0.34);
  color: var(--ct-dim);
}

body:is(.gametank-shell, .online-shell) .action-queue-position {
  color: var(--queue-team-color);
  font-size: 9px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

body:is(.gametank-shell, .online-shell) .action-queue-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:is(.gametank-shell, .online-shell) .action-queue-value {
  justify-self: end;
  color: var(--ct-accent);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body:is(.gametank-shell, .online-shell) .action-queue-row:not(.completed) .action-queue-value {
  color: var(--ct-dim);
  font-size: 9px;
  font-weight: 600;
}

body:is(.gametank-shell, .online-shell) .action-queue-divider {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 21px;
  color: var(--ct-dim);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

body:is(.gametank-shell, .online-shell) .action-queue-divider::before,
body:is(.gametank-shell, .online-shell) .action-queue-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--ct-stroke-soft);
}

body:is(.gametank-shell, .online-shell) .action-queue-row.entering {
  animation: action-queue-enter 220ms ease-out;
}

@keyframes action-queue-enter {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 浏览器最大化但不是 F11 时，优先给行动队列留出连续空间。 */
@media (max-height: 980px) {
  body.gametank-shell .battle-log,
  body.online-shell .online-battle-log {
    max-height: 150px;
  }
  body:is(.gametank-shell, .online-shell) .action-queue-panel {
    max-height: 244px;
  }
  body:is(.gametank-shell, .online-shell) .action-queue-list {
    max-height: 211px;
  }
  body:is(.gametank-shell, .online-shell) .action-queue-row {
    min-height: 23px;
  }
}

@media (max-width: 1120px) {
  body:is(.gametank-shell, .online-shell) .action-queue-panel {
    background: rgba(14, 21, 30, 0.88);
  }
}
